@univerjs/preset-sheets-sort 0.10.3 → 0.10.5

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.
package/lib/umd/index.js CHANGED
@@ -1,13 +1,13 @@
1
1
  // @univerjs/sheets-sort/index
2
- (function(l,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("@univerjs/core"),require("@univerjs/sheets"),require("@univerjs/engine-formula")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/sheets","@univerjs/engine-formula"],o):(l=typeof globalThis<"u"?globalThis:l||self,o(l.UniverSheetsSort={},l.UniverCore,l.UniverSheets,l.UniverEngineFormula))})(this,function(l,o,d,I){"use strict";var te=Object.defineProperty;var ne=(l,o,d)=>o in l?te(l,o,{enumerable:!0,configurable:!0,writable:!0,value:d}):l[o]=d;var N=(l,o,d)=>ne(l,typeof o!="symbol"?o+"":o,d);var g=(e=>(e.DESC="desc",e.ASC="asc",e))(g||{});const w=e=>e.replace(/-/gi,"").replace(/'/gi,""),T=(e,n)=>{const t=e===null||e==="",r=n===null||n==="";return t&&r?0:t?1:r?-1:null},E=(e,n,t)=>{const r=typeof e=="number",s=typeof n=="number";return r&&s?e<n?t===g.ASC?-1:1:e>n?t===g.ASC?1:-1:0:r?t===g.ASC?1:-1:s?t===g.ASC?-1:1:null},O=(e,n,t)=>{const r=typeof e=="string",s=typeof n=="string";if(r&&(e=w(e.toLocaleLowerCase())),s&&(n=w(n.toLocaleLowerCase())),!r&&!s)return null;if(r&&s){const i=e,u=n;return i<u?t===g.ASC?-1:1:i>u?t===g.ASC?1:-1:0}return r?t===g.ASC?1:-1:s?t===g.ASC?-1:1:null},b=e=>!e||Object.keys(e).length===0||(e==null?void 0:e.v)==null&&(e==null?void 0:e.p)==null;var j=Object.getOwnPropertyDescriptor,M=(e,n,t,r)=>{for(var s=r>1?void 0:r?j(n,t):n,i=e.length-1,u;i>=0;i--)(u=e[i])&&(s=u(s)||s);return s},C=(e,n)=>(t,r)=>n(t,r,e);l.SheetsSortService=class extends o.Disposable{constructor(t,r,s){super();N(this,"_compareFns",[]);this._univerInstanceService=t,this._commandService=r,this._formulaDataModel=s}mergeCheck(t){var a;const{unitId:r,subUnitId:s,range:i}=t,u=(a=this._univerInstanceService.getUnit(r))==null?void 0:a.getSheetBySheetId(s);if(!u)return!1;const c=u.getMergeData().filter(f=>o.Rectangle.contains(i,f));return c.length===0?!0:V(i,c)}emptyCheck(t){var c;const{unitId:r,subUnitId:s,range:i}=t,u=(c=this._univerInstanceService.getUnit(r))==null?void 0:c.getSheetBySheetId(s);if(!u)return!1;for(let a=i.startRow;a<=i.endRow;a++)for(let f=i.startColumn;f<=i.endColumn;f++)if(!b(u.getCellRaw(a,f)))return!0;return!1}singleCheck(t){return t.range.startRow!==t.range.endRow}formulaCheck(t){var c,a;const{unitId:r,subUnitId:s,range:i}=t,u=(a=(c=this._formulaDataModel.getArrayFormulaRange())==null?void 0:c[r])==null?void 0:a[s];for(const f in u){const S=u[Number(f)];for(const p in S){const v=S[Number(p)];if(v&&o.Rectangle.intersects(i,v))return!1}}return!0}registerCompareFn(t){this._compareFns.unshift(t)}getAllCompareFns(){return this._compareFns}applySort(t,r,s){var c;const{unitId:i,subUnitId:u}=d.getSheetCommandTarget(this._univerInstanceService)||{};this._commandService.executeCommand(_.id,{orderRules:t.orderRules,range:t.range,hasTitle:(c=t.hasTitle)!=null?c:!1,unitId:r||i,subUnitId:s||u})}},l.SheetsSortService=M([C(0,o.IUniverInstanceService),C(1,o.ICommandService),C(2,o.Inject(I.FormulaDataModel))],l.SheetsSortService);function V(e,n){const t=e.endRow-e.startRow+1,r=e.endColumn-e.startColumn+1;let s=null,i=null;const u=t*r;let c=0;for(const a of n)if(a.startRow>=e.startRow&&a.endRow<=e.endRow&&a.startColumn>=e.startColumn&&a.endColumn<=e.endColumn){const f=a.endRow-a.startRow+1,S=a.endColumn-a.startColumn+1;if(s===null&&i===null)s=f,i=S;else if(f!==s||S!==i)return!1;c+=f*S}return c===u}const _={id:"sheet.command.sort-range",type:o.CommandType.COMMAND,handler:(e,n)=>{const{range:t,orderRules:r,hasTitle:s,unitId:i,subUnitId:u}=n,c=e.get(l.SheetsSortService),a=e.get(o.IUniverInstanceService),{worksheet:f}=d.getSheetCommandTarget(a,n)||{};if(!f)return!1;const S=f.getMergeData().filter(m=>o.Rectangle.contains(t,m)),p=S.map(m=>m.startRow),{startRow:v,endRow:J}=t,Q=s?v+1:v,R=[],F=[];for(let m=Q;m<=J;m++)f.getRowFiltered(m)||f.getRowRawVisible(m)!==!1&&(S.length&&!p.includes(m)||(R.push({index:m,value:$(f,m,r)}),F.push(m)));const X=c.getAllCompareFns();R.sort(G(r,L(X)));const D={};R.forEach(({index:m,value:se},ee)=>{D[F[ee]]=m});const Z={id:d.ReorderRangeCommand.id,params:{unitId:i,subUnitId:u,range:t,order:D}},k=e.get(o.ICommandService);return o.sequenceExecute([Z],k).result}};function $(e,n,t){const r=[];return t.forEach(({colIndex:s})=>{r.push(e.getCellRaw(n,s))}),r}function L(e){return(n,t,r)=>{for(let s=0;s<e.length;s++){const i=e[s](n,t,r);if(i!=null)return i}return 0}}function G(e,n){return function(t,r){let s=null;for(let i=0;i<e.length;i++){const u=t.value[i],c=r.value[i];if(s=n(e[i].type,u,c),s!==0&&s!==null&&s!==void 0)return s}return 0}}const q="sheets-sort.config",U={};var B=Object.getOwnPropertyDescriptor,H=(e,n,t,r)=>{for(var s=r>1?void 0:r?B(n,t):n,i=e.length-1,u;i>=0;i--)(u=e[i])&&(s=u(s)||s);return s},y=(e,n)=>(t,r)=>n(t,r,e);let h=class extends o.Disposable{constructor(e,n){super(),this._commandService=e,this._sortService=n,this._initCommands(),this._registerCompareFns()}_initCommands(){[_].forEach(e=>this.disposeWithMe(this._commandService.registerCommand(e)))}_registerCompareFns(){const e=(n,t,r)=>{const s=this._getCommonValue(t),i=this._getCommonValue(r),u=[T,O,E];for(let c=0;c<u.length;c++){const a=u[c](s,i,n);if(a!==null)return a}return null};this._sortService.registerCompareFn(e)}_getCommonValue(e){var t,r;if(b(e))return null;const n=(r=(t=e==null?void 0:e.p)==null?void 0:t.body)==null?void 0:r.dataStream;return n||((e==null?void 0:e.t)===o.CellValueType.NUMBER?Number.parseFloat(`${e.v}`):(e==null?void 0:e.t)===o.CellValueType.STRING?typeof e.v=="number"?e.v:`${e.v}`:(e==null?void 0:e.t)===o.CellValueType.BOOLEAN?`${e.v}`:(e==null?void 0:e.t)===o.CellValueType.FORCE_STRING?Number.parseFloat(`${e.v}`):`${e==null?void 0:e.v}`)}};h=H([y(0,o.ICommandService),y(1,o.Inject(l.SheetsSortService))],h);var K=Object.defineProperty,W=Object.getOwnPropertyDescriptor,Y=(e,n,t)=>n in e?K(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,x=(e,n,t,r)=>{for(var s=r>1?void 0:r?W(n,t):n,i=e.length-1,u;i>=0;i--)(u=e[i])&&(s=u(s)||s);return s},A=(e,n)=>(t,r)=>n(t,r,e),P=(e,n,t)=>Y(e,typeof n!="symbol"?n+"":n,t);const z="SHEET_SORT_PLUGIN";l.UniverSheetsSortPlugin=class extends o.Plugin{constructor(n=U,t,r){super(),this._config=n,this._injector=t,this._configService=r;const{...s}=o.merge({},U,this._config);this._configService.setConfig(q,s)}onStarting(){[[h],[l.SheetsSortService]].forEach(n=>this._injector.add(n))}onReady(){this._injector.get(h)}},P(l.UniverSheetsSortPlugin,"type",o.UniverInstanceType.UNIVER_SHEET),P(l.UniverSheetsSortPlugin,"pluginName",z),l.UniverSheetsSortPlugin=x([o.DependentOn(d.UniverSheetsPlugin,I.UniverFormulaEnginePlugin),A(1,o.Inject(o.Injector)),A(2,o.IConfigService)],l.UniverSheetsSortPlugin),l.SortRangeCommand=_,l.SortType=g,Object.defineProperty(l,Symbol.toStringTag,{value:"Module"})});
2
+ (function(l,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("@univerjs/core"),require("@univerjs/sheets"),require("@univerjs/engine-formula")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/sheets","@univerjs/engine-formula"],o):(l=typeof globalThis<"u"?globalThis:l||self,o(l.UniverSheetsSort={},l.UniverCore,l.UniverSheets,l.UniverEngineFormula))})(this,(function(l,o,d,I){"use strict";var te=Object.defineProperty;var ne=(l,o,d)=>o in l?te(l,o,{enumerable:!0,configurable:!0,writable:!0,value:d}):l[o]=d;var N=(l,o,d)=>ne(l,typeof o!="symbol"?o+"":o,d);var g=(e=>(e.DESC="desc",e.ASC="asc",e))(g||{});const w=e=>e.replace(/-/gi,"").replace(/'/gi,""),T=(e,n)=>{const t=e===null||e==="",r=n===null||n==="";return t&&r?0:t?1:r?-1:null},E=(e,n,t)=>{const r=typeof e=="number",s=typeof n=="number";return r&&s?e<n?t===g.ASC?-1:1:e>n?t===g.ASC?1:-1:0:r?t===g.ASC?1:-1:s?t===g.ASC?-1:1:null},O=(e,n,t)=>{const r=typeof e=="string",s=typeof n=="string";if(r&&(e=w(e.toLocaleLowerCase())),s&&(n=w(n.toLocaleLowerCase())),!r&&!s)return null;if(r&&s){const i=e,u=n;return i<u?t===g.ASC?-1:1:i>u?t===g.ASC?1:-1:0}return r?t===g.ASC?1:-1:s?t===g.ASC?-1:1:null},b=e=>!e||Object.keys(e).length===0||(e==null?void 0:e.v)==null&&(e==null?void 0:e.p)==null;var j=Object.getOwnPropertyDescriptor,M=(e,n,t,r)=>{for(var s=r>1?void 0:r?j(n,t):n,i=e.length-1,u;i>=0;i--)(u=e[i])&&(s=u(s)||s);return s},C=(e,n)=>(t,r)=>n(t,r,e);l.SheetsSortService=class extends o.Disposable{constructor(t,r,s){super();N(this,"_compareFns",[]);this._univerInstanceService=t,this._commandService=r,this._formulaDataModel=s}mergeCheck(t){var a;const{unitId:r,subUnitId:s,range:i}=t,u=(a=this._univerInstanceService.getUnit(r))==null?void 0:a.getSheetBySheetId(s);if(!u)return!1;const c=u.getMergeData().filter(f=>o.Rectangle.contains(i,f));return c.length===0?!0:V(i,c)}emptyCheck(t){var c;const{unitId:r,subUnitId:s,range:i}=t,u=(c=this._univerInstanceService.getUnit(r))==null?void 0:c.getSheetBySheetId(s);if(!u)return!1;for(let a=i.startRow;a<=i.endRow;a++)for(let f=i.startColumn;f<=i.endColumn;f++)if(!b(u.getCellRaw(a,f)))return!0;return!1}singleCheck(t){return t.range.startRow!==t.range.endRow}formulaCheck(t){var c,a;const{unitId:r,subUnitId:s,range:i}=t,u=(a=(c=this._formulaDataModel.getArrayFormulaRange())==null?void 0:c[r])==null?void 0:a[s];for(const f in u){const S=u[Number(f)];for(const p in S){const v=S[Number(p)];if(v&&o.Rectangle.intersects(i,v))return!1}}return!0}registerCompareFn(t){this._compareFns.unshift(t)}getAllCompareFns(){return this._compareFns}applySort(t,r,s){var c;const{unitId:i,subUnitId:u}=d.getSheetCommandTarget(this._univerInstanceService)||{};this._commandService.executeCommand(_.id,{orderRules:t.orderRules,range:t.range,hasTitle:(c=t.hasTitle)!=null?c:!1,unitId:r||i,subUnitId:s||u})}},l.SheetsSortService=M([C(0,o.IUniverInstanceService),C(1,o.ICommandService),C(2,o.Inject(I.FormulaDataModel))],l.SheetsSortService);function V(e,n){const t=e.endRow-e.startRow+1,r=e.endColumn-e.startColumn+1;let s=null,i=null;const u=t*r;let c=0;for(const a of n)if(a.startRow>=e.startRow&&a.endRow<=e.endRow&&a.startColumn>=e.startColumn&&a.endColumn<=e.endColumn){const f=a.endRow-a.startRow+1,S=a.endColumn-a.startColumn+1;if(s===null&&i===null)s=f,i=S;else if(f!==s||S!==i)return!1;c+=f*S}return c===u}const _={id:"sheet.command.sort-range",type:o.CommandType.COMMAND,handler:(e,n)=>{const{range:t,orderRules:r,hasTitle:s,unitId:i,subUnitId:u}=n,c=e.get(l.SheetsSortService),a=e.get(o.IUniverInstanceService),{worksheet:f}=d.getSheetCommandTarget(a,n)||{};if(!f)return!1;const S=f.getMergeData().filter(m=>o.Rectangle.contains(t,m)),p=S.map(m=>m.startRow),{startRow:v,endRow:J}=t,Q=s?v+1:v,R=[],F=[];for(let m=Q;m<=J;m++)f.getRowFiltered(m)||f.getRowRawVisible(m)!==!1&&(S.length&&!p.includes(m)||(R.push({index:m,value:$(f,m,r)}),F.push(m)));const X=c.getAllCompareFns();R.sort(G(r,L(X)));const D={};R.forEach(({index:m,value:se},ee)=>{D[F[ee]]=m});const Z={id:d.ReorderRangeCommand.id,params:{unitId:i,subUnitId:u,range:t,order:D}},k=e.get(o.ICommandService);return o.sequenceExecute([Z],k).result}};function $(e,n,t){const r=[];return t.forEach(({colIndex:s})=>{r.push(e.getCellRaw(n,s))}),r}function L(e){return(n,t,r)=>{for(let s=0;s<e.length;s++){const i=e[s](n,t,r);if(i!=null)return i}return 0}}function G(e,n){return function(t,r){let s=null;for(let i=0;i<e.length;i++){const u=t.value[i],c=r.value[i];if(s=n(e[i].type,u,c),s!==0&&s!==null&&s!==void 0)return s}return 0}}const q="sheets-sort.config",U={};var B=Object.getOwnPropertyDescriptor,H=(e,n,t,r)=>{for(var s=r>1?void 0:r?B(n,t):n,i=e.length-1,u;i>=0;i--)(u=e[i])&&(s=u(s)||s);return s},y=(e,n)=>(t,r)=>n(t,r,e);let h=class extends o.Disposable{constructor(e,n){super(),this._commandService=e,this._sortService=n,this._initCommands(),this._registerCompareFns()}_initCommands(){[_].forEach(e=>this.disposeWithMe(this._commandService.registerCommand(e)))}_registerCompareFns(){const e=(n,t,r)=>{const s=this._getCommonValue(t),i=this._getCommonValue(r),u=[T,O,E];for(let c=0;c<u.length;c++){const a=u[c](s,i,n);if(a!==null)return a}return null};this._sortService.registerCompareFn(e)}_getCommonValue(e){var t,r;if(b(e))return null;const n=(r=(t=e==null?void 0:e.p)==null?void 0:t.body)==null?void 0:r.dataStream;return n||((e==null?void 0:e.t)===o.CellValueType.NUMBER?Number.parseFloat(`${e.v}`):(e==null?void 0:e.t)===o.CellValueType.STRING?typeof e.v=="number"?e.v:`${e.v}`:(e==null?void 0:e.t)===o.CellValueType.BOOLEAN?`${e.v}`:(e==null?void 0:e.t)===o.CellValueType.FORCE_STRING?Number.parseFloat(`${e.v}`):`${e==null?void 0:e.v}`)}};h=H([y(0,o.ICommandService),y(1,o.Inject(l.SheetsSortService))],h);var K=Object.defineProperty,W=Object.getOwnPropertyDescriptor,Y=(e,n,t)=>n in e?K(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,x=(e,n,t,r)=>{for(var s=r>1?void 0:r?W(n,t):n,i=e.length-1,u;i>=0;i--)(u=e[i])&&(s=u(s)||s);return s},A=(e,n)=>(t,r)=>n(t,r,e),P=(e,n,t)=>Y(e,typeof n!="symbol"?n+"":n,t);const z="SHEET_SORT_PLUGIN";l.UniverSheetsSortPlugin=class extends o.Plugin{constructor(n=U,t,r){super(),this._config=n,this._injector=t,this._configService=r;const{...s}=o.merge({},U,this._config);this._configService.setConfig(q,s)}onStarting(){[[h],[l.SheetsSortService]].forEach(n=>this._injector.add(n))}onReady(){this._injector.get(h)}},P(l.UniverSheetsSortPlugin,"type",o.UniverInstanceType.UNIVER_SHEET),P(l.UniverSheetsSortPlugin,"pluginName",z),l.UniverSheetsSortPlugin=x([o.DependentOn(d.UniverSheetsPlugin,I.UniverFormulaEnginePlugin),A(1,o.Inject(o.Injector)),A(2,o.IConfigService)],l.UniverSheetsSortPlugin),l.SortRangeCommand=_,l.SortType=g,Object.defineProperty(l,Symbol.toStringTag,{value:"Module"})}));
3
3
 
4
4
 
5
5
  // @univerjs/sheets-sort/facade
6
- (function(e,s){typeof exports=="object"&&typeof module<"u"?s(require("@univerjs/sheets-sort"),require("@univerjs/sheets/facade"),require("@univerjs/core"),require("@univerjs/core/facade")):typeof define=="function"&&define.amd?define(["@univerjs/sheets-sort","@univerjs/sheets/facade","@univerjs/core","@univerjs/core/facade"],s):(e=typeof globalThis<"u"?globalThis:e||self,s(e.UniverSheetsSort,e.UniverSheetsFacade,e.UniverCore,e.UniverCoreFacade))})(this,function(e,s,R,h){"use strict";class v extends s.FRange{sort(o){const t=this._range.startColumn,i=(Array.isArray(o)?o:[o]).map(r=>typeof r=="number"?{colIndex:r+t,type:e.SortType.ASC}:{colIndex:r.column+t,type:r.ascending?e.SortType.ASC:e.SortType.DESC});return this._commandService.syncExecuteCommand(e.SortRangeCommand.id,{orderRules:i,range:this._range,hasTitle:!1,unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId()}),this}}s.FRange.extend(v);class C extends s.FWorksheet{sort(o,t=!0){const n=[{colIndex:o,type:t?e.SortType.ASC:e.SortType.DESC}],i={startRow:0,startColumn:0,endRow:this._worksheet.getRowCount()-1,endColumn:this._worksheet.getColumnCount()-1,rangeType:R.RANGE_TYPE.ALL};return this._commandService.syncExecuteCommand(e.SortRangeCommand.id,{orderRules:n,range:i,hasTitle:!1,unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId()}),this}}s.FWorksheet.extend(C);class l{get SheetRangeSorted(){return"SheetRangeSorted"}get SheetBeforeRangeSort(){return"SheetBeforeRangeSort"}}h.FEventName.extend(s.FSheetEventName);class f extends h.FUniver{_initialize(o){const t=o.get(R.ICommandService);this.registerEventHandler(this.Event.SheetBeforeRangeSort,()=>t.beforeCommandExecuted(n=>{n.id===e.SortRangeCommand.id&&this._beforeRangeSort(n)})),this.registerEventHandler(this.Event.SheetRangeSorted,()=>t.onCommandExecuted(n=>{n.id===e.SortRangeCommand.id&&this._onRangeSorted(n)}))}_beforeRangeSort(o){const t=o.params,n=this.getUniverSheet(t.unitId),i=n.getSheetBySheetId(t.subUnitId),{startColumn:r,endColumn:m,startRow:a,endRow:S}=t.range,g=i.getRange(a,r,S-a+1,m-r+1),d={workbook:n,worksheet:i,range:g,sortColumn:t.orderRules.map(u=>({column:u.colIndex-r,ascending:u.type===e.SortType.ASC}))};if(this.fireEvent(this.Event.SheetBeforeRangeSort,d),d.cancel)throw new Error("SortRangeCommand canceled.")}_onRangeSorted(o){const t=o.params,n=this.getUniverSheet(t.unitId),i=n.getSheetBySheetId(t.subUnitId),{startColumn:r,endColumn:m,startRow:a,endRow:S}=t.range,g=i.getRange(a,r,S-a+1,m-r+1),d={workbook:n,worksheet:i,range:g,sortColumn:t.orderRules.map(u=>({column:u.colIndex-r,ascending:u.type===e.SortType.ASC}))};if(this.fireEvent(this.Event.SheetRangeSorted,d),d.cancel)throw new Error("SortRangeCommand canceled.")}}h.FUniver.extend(f),h.FEventName.extend(l)});
6
+ (function(e,s){typeof exports=="object"&&typeof module<"u"?s(require("@univerjs/sheets-sort"),require("@univerjs/sheets/facade"),require("@univerjs/core"),require("@univerjs/core/facade")):typeof define=="function"&&define.amd?define(["@univerjs/sheets-sort","@univerjs/sheets/facade","@univerjs/core","@univerjs/core/facade"],s):(e=typeof globalThis<"u"?globalThis:e||self,s(e.UniverSheetsSort,e.UniverSheetsFacade,e.UniverCore,e.UniverCoreFacade))})(this,(function(e,s,R,h){"use strict";class v extends s.FRange{sort(o){const t=this._range.startColumn,i=(Array.isArray(o)?o:[o]).map(r=>typeof r=="number"?{colIndex:r+t,type:e.SortType.ASC}:{colIndex:r.column+t,type:r.ascending?e.SortType.ASC:e.SortType.DESC});return this._commandService.syncExecuteCommand(e.SortRangeCommand.id,{orderRules:i,range:this._range,hasTitle:!1,unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId()}),this}}s.FRange.extend(v);class C extends s.FWorksheet{sort(o,t=!0){const n=[{colIndex:o,type:t?e.SortType.ASC:e.SortType.DESC}],i={startRow:0,startColumn:0,endRow:this._worksheet.getRowCount()-1,endColumn:this._worksheet.getColumnCount()-1,rangeType:R.RANGE_TYPE.ALL};return this._commandService.syncExecuteCommand(e.SortRangeCommand.id,{orderRules:n,range:i,hasTitle:!1,unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId()}),this}}s.FWorksheet.extend(C);class l{get SheetRangeSorted(){return"SheetRangeSorted"}get SheetBeforeRangeSort(){return"SheetBeforeRangeSort"}}h.FEventName.extend(s.FSheetEventName);class f extends h.FUniver{_initialize(o){const t=o.get(R.ICommandService);this.registerEventHandler(this.Event.SheetBeforeRangeSort,()=>t.beforeCommandExecuted(n=>{n.id===e.SortRangeCommand.id&&this._beforeRangeSort(n)})),this.registerEventHandler(this.Event.SheetRangeSorted,()=>t.onCommandExecuted(n=>{n.id===e.SortRangeCommand.id&&this._onRangeSorted(n)}))}_beforeRangeSort(o){const t=o.params,n=this.getUniverSheet(t.unitId),i=n.getSheetBySheetId(t.subUnitId),{startColumn:r,endColumn:m,startRow:a,endRow:S}=t.range,g=i.getRange(a,r,S-a+1,m-r+1),d={workbook:n,worksheet:i,range:g,sortColumn:t.orderRules.map(u=>({column:u.colIndex-r,ascending:u.type===e.SortType.ASC}))};if(this.fireEvent(this.Event.SheetBeforeRangeSort,d),d.cancel)throw new Error("SortRangeCommand canceled.")}_onRangeSorted(o){const t=o.params,n=this.getUniverSheet(t.unitId),i=n.getSheetBySheetId(t.subUnitId),{startColumn:r,endColumn:m,startRow:a,endRow:S}=t.range,g=i.getRange(a,r,S-a+1,m-r+1),d={workbook:n,worksheet:i,range:g,sortColumn:t.orderRules.map(u=>({column:u.colIndex-r,ascending:u.type===e.SortType.ASC}))};if(this.fireEvent(this.Event.SheetRangeSorted,d),d.cancel)throw new Error("SortRangeCommand canceled.")}}h.FUniver.extend(f),h.FEventName.extend(l)}));
7
7
 
8
8
 
9
9
  // @univerjs/sheets-sort-ui/index
10
- (function(d,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("@univerjs/core"),require("react/jsx-runtime"),require("@univerjs/sheets"),require("@univerjs/sheets-sort"),require("@univerjs/ui"),require("rxjs"),require("@univerjs/design"),require("react"),require("@univerjs/engine-formula"),require("@univerjs/sheets-ui")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","react/jsx-runtime","@univerjs/sheets","@univerjs/sheets-sort","@univerjs/ui","rxjs","@univerjs/design","react","@univerjs/engine-formula","@univerjs/sheets-ui"],i):(d=typeof globalThis<"u"?globalThis:d||self,i(d.UniverSheetsSortUi={},d.UniverCore,d.React,d.UniverSheets,d.UniverSheetsSort,d.UniverUi,d.rxjs,d.UniverDesign,d.React,d.UniverEngineFormula,d.UniverSheetsUi))})(this,function(d,i,a,u,E,h,re,f,l,pe,T){"use strict";var Ct=Object.defineProperty;var mt=(d,i,a)=>i in d?Ct(d,i,{enumerable:!0,configurable:!0,writable:!0,value:a}):d[i]=a;var te=(d,i,a)=>mt(d,typeof i!="symbol"?i+"":i,a);const ye=e=>{const[t,n]=l.useState("0"),r=h.useDependency(i.LocaleService);return a.jsxs("div",{className:"univer-text-sm",children:[a.jsx("div",{className:"extend-confirm-desc",children:r.t("sheets-sort.dialog.sort-reminder-desc")}),a.jsxs(f.RadioGroup,{className:"univer-mt-4",value:t,direction:"vertical",onChange:o=>{n(o),e.onChange(o)},children:[a.jsx(f.Radio,{value:"0",children:r.t("sheets-sort.dialog.sort-reminder-no")}),a.jsx(f.Radio,{value:"1",children:r.t("sheets-sort.dialog.sort-reminder-ext")})]})]})};var Ie=Object.getOwnPropertyDescriptor,_e=(e,t,n,r)=>{for(var o=r>1?void 0:r?Ie(t,n):t,s=e.length-1,c;s>=0;s--)(c=e[s])&&(o=c(o)||o);return o},R=(e,t)=>(n,r)=>t(n,r,e);const N={MERGE_ERROR:"sheets-sort.error.merge-size",EMPTY_ERROR:"sheets-sort.error.empty",SINGLE_ERROR:"sheets-sort.error.single",FORMULA_ARRAY:"sheets-sort.error.formula-array"};let p=class extends i.Disposable{constructor(t,n,r,o,s,c){super();te(this,"_customSortState$",new re.BehaviorSubject(null));te(this,"customSortState$",this._customSortState$.asObservable());this._univerInstanceService=t,this._confirmService=n,this._selectionManagerService=r,this._sheetsSortService=o,this._localeService=s,this._commandService=c}async triggerSortDirectly(t,n,r){const o=r||await this._detectSortLocation(n);if(!o||!this._check(o))return!1;const c={orderRules:[{type:t?E.SortType.ASC:E.SortType.DESC,colIndex:o.colIndex}],range:o.range};return this._sheetsSortService.applySort(c,o.unitId,o.subUnitId),!0}async triggerSortCustomize(){const t=await this._detectSortLocation();return!t||!this._check(t)?!1:(this.showCustomSortPanel(t),!0)}customSortState(){return this._customSortState$.getValue()}getTitles(t){var v,m;const n=(v=this.customSortState())==null?void 0:v.location;if(!n)return[];const{unitId:r,subUnitId:o,range:s}=n,c=(m=this._univerInstanceService.getUnit(r))==null?void 0:m.getSheetBySheetId(o);if(!c)return[];const g=xe(this._localeService);return Array.from({length:s.endColumn-s.startColumn+1},(b,I)=>{var y;const k=(y=c.getCell(s.startRow,I+s.startColumn))==null?void 0:y.v;return{index:I+s.startColumn,label:t?`${k!=null?k:g(I+s.startColumn)}`:g(I+s.startColumn)}})}setSelection(t,n,r){var c;const o=(c=this._univerInstanceService.getUnit(t))==null?void 0:c.getSheetBySheetId(n);if(!o)return;const s={unitId:t,subUnitId:n,selections:[{range:r,primary:u.getPrimaryForRange(r,o),style:null}]};this._commandService.executeCommand(u.SetSelectionsOperation.id,s)}async showCheckError(t){return await this._confirmService.confirm({id:"sort-range-check-error",title:{title:this._localeService.t("info.tooltip")},children:{title:a.jsx("div",{children:this._localeService.t(t)})},cancelText:this._localeService.t("sheets-sort.dialog.cancel"),confirmText:this._localeService.t("sheets-sort.dialog.confirm")})}async showExtendConfirm(){let t=!1;return await this._confirmService.confirm({id:"extend-sort-range-dialog",title:{title:this._localeService.t("sheets-sort.dialog.sort-reminder")},children:{title:a.jsx(ye,{onChange:r=>{t=r==="1"}})},width:400,cancelText:this._localeService.t("sheets-sort.dialog.cancel"),confirmText:this._localeService.t("sheets-sort.dialog.confirm")})?t?"extend":"keep":"cancel"}showCustomSortPanel(t){this._customSortState$.next({location:t,show:!0})}closeCustomSortPanel(){this._customSortState$.next({show:!1})}_check(t){return this._sheetsSortService.singleCheck(t)?this._sheetsSortService.mergeCheck(t)?this._sheetsSortService.formulaCheck(t)?this._sheetsSortService.emptyCheck(t)?!0:(this.showCheckError(N.EMPTY_ERROR),!1):(this.showCheckError(N.FORMULA_ARRAY),!1):(this.showCheckError(N.MERGE_ERROR),!1):(this.showCheckError(N.SINGLE_ERROR),!1)}async _detectSortLocation(t){const n=this._univerInstanceService.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET),r=n.getActiveSheet(),o=n.getUnitId(),s=r.getSheetId(),c=this._selectionManagerService.getCurrentLastSelection();if(!c)return null;let g;if(t===!0)g=u.expandToContinuousRange(c.range,{up:!0,down:!0,left:!0,right:!0},r),this.setSelection(o,s,g);else if(t===!1)g=c.range;else{const v=await this.showExtendConfirm();if(v==="cancel")return null;v==="keep"?g=c.range:(g=u.expandToContinuousRange(c.range,{up:!0,down:!0,left:!0,right:!0},r),this.setSelection(o,s,g))}return{range:g,unitId:o,subUnitId:s,colIndex:c.primary.actualColumn}}};p=_e([R(0,i.IUniverInstanceService),R(1,h.IConfirmService),R(2,i.Inject(u.SheetsSelectionsService)),R(3,i.Inject(E.SheetsSortService)),R(4,i.Inject(i.LocaleService)),R(5,i.ICommandService)],p);function xe(e){return t=>{const n=i.Tools.chatAtABC(t);switch(e.getCurrentLocale()){case i.LocaleType.ZH_CN:return`"${n}"列`;case i.LocaleType.EN_US:return`Column "${n}"`;default:return`Column "${n}"`}}}const L={id:"sheet.command.sort-range-asc",type:i.CommandType.COMMAND,handler:async e=>await e.get(p).triggerSortDirectly(!0,!1)},U={id:"sheet.command.sort-range-asc-ext",type:i.CommandType.COMMAND,handler:async e=>await e.get(p).triggerSortDirectly(!0,!0)},H={id:"sheet.command.sort-range-desc",type:i.CommandType.COMMAND,handler:async e=>await e.get(p).triggerSortDirectly(!1,!1)},j={id:"sheet.command.sort-range-desc-ext",type:i.CommandType.COMMAND,handler:async e=>await e.get(p).triggerSortDirectly(!1,!0)},A={id:"sheet.command.sort-range-custom",type:i.CommandType.COMMAND,handler:async e=>await e.get(p).triggerSortCustomize()},$={id:"sheet.command.sort-range-asc-ctx",type:i.CommandType.COMMAND,handler:async e=>await e.get(p).triggerSortDirectly(!0,!1)},Z={id:"sheet.command.sort-range-asc-ext-ctx",type:i.CommandType.COMMAND,handler:async e=>await e.get(p).triggerSortDirectly(!0,!0)},B={id:"sheet.command.sort-range-desc-ctx",type:i.CommandType.COMMAND,handler:async e=>await e.get(p).triggerSortDirectly(!1,!1)},F={id:"sheet.command.sort-range-desc-ext-ctx",type:i.CommandType.COMMAND,handler:async e=>await e.get(p).triggerSortDirectly(!1,!0)},W={id:"sheet.command.sort-range-custom-ctx",type:i.CommandType.COMMAND,handler:async e=>await e.get(p).triggerSortCustomize()},we="sheets-sort-ui.config",ne={};var _=function(){return _=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},_.apply(this,arguments)},Ee=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},x=l.forwardRef(function(e,t){var n=e.icon,r=e.id,o=e.className,s=e.extend,c=Ee(e,["icon","id","className","extend"]),g="univerjs-icon univerjs-icon-".concat(r," ").concat(o||"").trim(),v=l.useRef("_".concat(be()));return oe(n,"".concat(r),{defIds:n.defIds,idSuffix:v.current},_({ref:t,className:g},c),s)});function oe(e,t,n,r,o){return l.createElement(e.tag,_(_({key:t},Te(e,n,o)),r),(Me(e,n).children||[]).map(function(s,c){return oe(s,"".concat(t,"-").concat(e.tag,"-").concat(c),n,void 0,o)}))}function Te(e,t,n){var r=_({},e.attrs);n!=null&&n.colorChannel1&&r.fill==="colorChannel1"&&(r.fill=n.colorChannel1),e.tag==="mask"&&r.id&&(r.id=r.id+t.idSuffix),Object.entries(r).forEach(function(s){var c=s[0],g=s[1];c==="mask"&&typeof g=="string"&&(r[c]=g.replace(/url\(#(.*)\)/,"url(#$1".concat(t.idSuffix,")")))});var o=t.defIds;return!o||o.length===0||(e.tag==="use"&&r["xlink:href"]&&(r["xlink:href"]=r["xlink:href"]+t.idSuffix),Object.entries(r).forEach(function(s){var c=s[0],g=s[1];typeof g=="string"&&(r[c]=g.replace(/url\(#(.*)\)/,"url(#$1".concat(t.idSuffix,")")))})),r}function Me(e,t){var n,r=t.defIds;return!r||r.length===0?e:e.tag==="defs"&&(!((n=e.children)===null||n===void 0)&&n.length)?_(_({},e),{children:e.children.map(function(o){return typeof o.attrs.id=="string"&&r&&r.includes(o.attrs.id)?_(_({},o),{attrs:_(_({},o.attrs),{id:o.attrs.id+t.idSuffix})}):o})}):e}function be(){return Math.random().toString(36).substring(2,8)}x.displayName="UniverIcon";var ke={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M12.4208 14.4667C12.4208 14.798 12.1522 15.0667 11.8208 15.0667C11.4895 15.0667 11.2208 14.798 11.2208 14.4667V2.98193L9.97861 4.22417C9.7443 4.45848 9.3644 4.45848 9.13008 4.22417C8.89577 3.98985 8.89577 3.60995 9.13008 3.37564L11.3967 1.10897C11.6311 0.874657 12.011 0.874657 12.2453 1.10897L14.5119 3.37564C14.7463 3.60995 14.7463 3.98985 14.5119 4.22417C14.2776 4.45848 13.8977 4.45848 13.6634 4.22417L12.4208 2.9816V14.4667Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M1.98967 10.2798C1.6583 10.2798 1.38967 10.0112 1.38967 9.67983C1.38967 9.34846 1.6583 9.07983 1.98967 9.07983H6.50138C6.74406 9.07983 6.96284 9.22602 7.05571 9.45022C7.14858 9.67443 7.09725 9.9325 6.92565 10.1041L3.43819 13.5916H6.50138C6.83276 13.5916 7.10138 13.8602 7.10138 14.1916C7.10138 14.5229 6.83276 14.7916 6.50138 14.7916H1.98967C1.74699 14.7916 1.52821 14.6454 1.43534 14.4212C1.34247 14.197 1.3938 13.9389 1.5654 13.7673L5.05286 10.2798H1.98967Z",fillRule:"evenodd",clipRule:"evenodd"}},{tag:"path",attrs:{fill:"currentColor",d:"M5.1846 1.86439C4.8641 0.989866 3.62725 0.989866 3.30674 1.86439L1.34882 7.20672C1.23479 7.51786 1.39458 7.86252 1.70571 7.97655C2.01684 8.09058 2.3615 7.93079 2.47553 7.61966L3.06159 6.02055L3.06338 6.02056H5.42975L6.01581 7.61966C6.12984 7.93079 6.4745 8.09058 6.78563 7.97655C7.09677 7.86252 7.25655 7.51786 7.14252 7.20672L5.1846 1.86439ZM4.98996 4.82056L4.24567 2.78971L3.50138 4.82056H4.98996Z",fillRule:"evenodd",clipRule:"evenodd"}}]},q=l.forwardRef(function(e,t){return l.createElement(x,Object.assign({},e,{id:"ascending-icon",ref:t,icon:ke}))});q.displayName="AscendingIcon";var Re={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M14.1544 3.75557C14.3887 3.98988 14.3887 4.36978 14.1544 4.6041L6.51409 12.2444C6.40157 12.3569 6.24896 12.4201 6.08983 12.4201C5.9307 12.4201 5.77808 12.3569 5.66556 12.2444L1.84541 8.42425C1.6111 8.18993 1.6111 7.81003 1.84541 7.57572C2.07973 7.34141 2.45963 7.34141 2.69394 7.57572L6.08983 10.9716L13.3059 3.75557C13.5402 3.52126 13.9201 3.52126 14.1544 3.75557Z",fillRule:"evenodd",clipRule:"evenodd"}}]},ie=l.forwardRef(function(e,t){return l.createElement(x,Object.assign({},e,{id:"check-mark-icon",ref:t,icon:Re}))});ie.displayName="CheckMarkIcon";var Oe={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M9.77445 9.24306L9.77457 11.9573C9.77458 12.2887 9.50597 12.5574 9.17459 12.5574C8.84322 12.5574 8.57458 12.2888 8.57457 11.9574L8.57439 7.79509C8.57438 7.46372 8.84299 7.19508 9.17436 7.19507C9.3281 7.19493 9.48196 7.25351 9.59925 7.3708L11.3465 9.11808C11.5808 9.3524 11.5808 9.7323 11.3465 9.96661C11.1122 10.2009 10.7323 10.2009 10.498 9.96661L9.77445 9.24306Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M6.22584 10.5094L6.22572 7.79514C6.22571 7.46377 6.49433 7.19513 6.8257 7.19512C7.15707 7.1951 7.42571 7.46372 7.42572 7.79509L7.4259 11.9574C7.42592 12.2888 7.1573 12.5574 6.82593 12.5574C6.67228 12.5575 6.51828 12.4989 6.40104 12.3817L4.65376 10.6344C4.41945 10.4001 4.41945 10.0202 4.65376 9.78588C4.88808 9.55156 5.26798 9.55156 5.50229 9.78588L6.22584 10.5094Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M1.14014 3.73989C1.14014 2.30396 2.3042 1.13989 3.74014 1.13989H12.2601C13.6961 1.13989 14.8601 2.30395 14.8601 3.73989V12.2599C14.8601 13.6958 13.6961 14.8599 12.2601 14.8599H3.74014C2.3042 14.8599 1.14014 13.6958 1.14014 12.2599V3.73989ZM2.34014 5.86724V12.2599C2.34014 13.0331 2.96694 13.6599 3.74014 13.6599H12.2601C13.0333 13.6599 13.6601 13.0331 13.6601 12.2599V5.86724H2.34014ZM13.6601 4.66724H2.34014V3.73989C2.34014 2.9667 2.96694 2.33989 3.74014 2.33989H12.2601C13.0333 2.33989 13.6601 2.96669 13.6601 3.73989V4.66724Z",fillRule:"evenodd",clipRule:"evenodd"}}]},se=l.forwardRef(function(e,t){return l.createElement(x,Object.assign({},e,{id:"custom-sort-icon",ref:t,icon:Oe}))});se.displayName="CustomSortIcon";var Pe={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M5.3313 1.4667C5.3313 1.13533 5.59993 0.866699 5.9313 0.866699H10.069C10.4004 0.866699 10.669 1.13533 10.669 1.4667C10.669 1.79807 10.4004 2.0667 10.069 2.0667H5.9313C5.59993 2.0667 5.3313 1.79807 5.3313 1.4667Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M1.09985 3.64443C1.09985 3.31306 1.36848 3.04443 1.69985 3.04443H14.2999C14.6312 3.04443 14.8999 3.31306 14.8999 3.64443C14.8999 3.9758 14.6312 4.24443 14.2999 4.24443H1.69985C1.36848 4.24443 1.09985 3.9758 1.09985 3.64443Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M4.75332 5.22217C3.86966 5.22217 3.15332 5.93851 3.15332 6.82217V13.1332C3.15332 14.2377 4.04875 15.1332 5.15332 15.1332H10.8465C11.9511 15.1332 12.8465 14.2377 12.8465 13.1331V6.82217C12.8465 5.93851 12.1302 5.22217 11.2465 5.22217H4.75332ZM4.35332 6.82217C4.35332 6.60125 4.53241 6.42217 4.75332 6.42217H11.2465C11.4674 6.42217 11.6465 6.60125 11.6465 6.82217V13.1331C11.6465 13.575 11.2884 13.9331 10.8465 13.9331H5.15332C4.71149 13.9331 4.35332 13.575 4.35332 13.1332V6.82217Z",fillRule:"evenodd",clipRule:"evenodd"}}]},ae=l.forwardRef(function(e,t){return l.createElement(x,Object.assign({},e,{id:"delete-empty-icon",ref:t,icon:Pe}))});ae.displayName="DeleteEmptyIcon";var De={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M12.4208 1.53335C12.4208 1.20198 12.1522 0.93335 11.8208 0.93335C11.4895 0.93335 11.2208 1.20198 11.2208 1.53335V13.0181L9.97861 11.7758C9.7443 11.5415 9.3644 11.5415 9.13008 11.7758C8.89577 12.0101 8.89577 12.39 9.13008 12.6244L11.3967 14.891C11.6311 15.1253 12.011 15.1253 12.2453 14.891L14.5119 12.6244C14.7463 12.39 14.7463 12.0101 14.5119 11.7758C14.2776 11.5415 13.8977 11.5415 13.6634 11.7758L12.4208 13.0184V1.53335Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M1.98967 10.2798C1.6583 10.2798 1.38967 10.0112 1.38967 9.67983C1.38967 9.34846 1.6583 9.07983 1.98967 9.07983H6.50138C6.74406 9.07983 6.96284 9.22602 7.05571 9.45022C7.14858 9.67443 7.09725 9.9325 6.92565 10.1041L3.43819 13.5916H6.50138C6.83276 13.5916 7.10138 13.8602 7.10138 14.1916C7.10138 14.5229 6.83276 14.7916 6.50138 14.7916H1.98967C1.74699 14.7916 1.52821 14.6454 1.43534 14.4212C1.34247 14.197 1.3938 13.9389 1.5654 13.7673L5.05286 10.2798H1.98967Z",fillRule:"evenodd",clipRule:"evenodd"}},{tag:"path",attrs:{fill:"currentColor",d:"M5.1846 1.86439C4.8641 0.989866 3.62725 0.989866 3.30674 1.86439L1.34882 7.20672C1.23479 7.51786 1.39458 7.86252 1.70571 7.97655C2.01684 8.09058 2.3615 7.93079 2.47553 7.61966L3.06159 6.02055L3.06338 6.02056H5.42975L6.01581 7.61966C6.12984 7.93079 6.4745 8.09058 6.78563 7.97655C7.09677 7.86252 7.25655 7.51786 7.14252 7.20672L5.1846 1.86439ZM4.98996 4.82056L4.24567 2.78971L3.50138 4.82056H4.98996Z",fillRule:"evenodd",clipRule:"evenodd"}}]},z=l.forwardRef(function(e,t){return l.createElement(x,Object.assign({},e,{id:"descending-icon",ref:t,icon:De}))});z.displayName="DescendingIcon";var Ne={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M1.9064 3.20024C1.57503 3.20024 1.3064 2.93161 1.3064 2.60024C1.3064 2.26887 1.57503 2.00024 1.9064 2.00024H4.57306C4.90443 2.00024 5.17306 2.26887 5.17306 2.60024C5.17306 2.93161 4.90443 3.20024 4.57306 3.20024H1.9064ZM1.3064 6.19985C1.3064 6.53122 1.57503 6.79985 1.9064 6.79985H5.9064C6.23777 6.79985 6.5064 6.53122 6.5064 6.19985C6.5064 5.86848 6.23777 5.59985 5.9064 5.59985H1.9064C1.57503 5.59985 1.3064 5.86848 1.3064 6.19985ZM1.9064 10.3997C1.57503 10.3997 1.3064 10.1311 1.3064 9.79971C1.3064 9.46834 1.57503 9.19971 1.9064 9.19971H7.23973C7.5711 9.19971 7.83973 9.46834 7.83973 9.79971C7.83973 10.1311 7.5711 10.3997 7.23973 10.3997H1.9064ZM1.9064 13.9996C1.57503 13.9996 1.3064 13.7309 1.3064 13.3996C1.3064 13.0682 1.57503 12.7996 1.9064 12.7996H8.57306C8.90443 12.7996 9.17306 13.0682 9.17306 13.3996C9.17306 13.7309 8.90443 13.9996 8.57306 13.9996H1.9064Z",fillRule:"evenodd",clipRule:"evenodd"}},{tag:"path",attrs:{fill:"currentColor",d:"M12.4267 14.2667C12.4267 14.5981 12.1581 14.8667 11.8267 14.8667C11.4953 14.8667 11.2267 14.5981 11.2267 14.2667V3.18198L9.98447 4.42422C9.75015 4.65853 9.37026 4.65853 9.13594 4.42422C8.90163 4.1899 8.90163 3.81 9.13594 3.57569L11.4026 1.30902C11.6369 1.07471 12.0168 1.07471 12.2511 1.30902L14.5178 3.57569C14.7521 3.81 14.7521 4.1899 14.5178 4.42422C14.2835 4.65853 13.9036 4.65853 13.6693 4.42422L12.4267 3.18165V14.2667Z"}}]},ce=l.forwardRef(function(e,t){return l.createElement(x,Object.assign({},e,{id:"expand-ascending-icon",ref:t,icon:Ne}))});ce.displayName="ExpandAscendingIcon";var Le={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M1.9064 12.7998C1.57503 12.7998 1.3064 13.0684 1.3064 13.3998C1.3064 13.7311 1.57503 13.9998 1.9064 13.9998H4.57306C4.90443 13.9998 5.17306 13.7311 5.17306 13.3998C5.17306 13.0684 4.90443 12.7998 4.57306 12.7998H1.9064ZM1.3064 9.80015C1.3064 9.46878 1.57503 9.20015 1.9064 9.20015H5.9064C6.23777 9.20015 6.5064 9.46878 6.5064 9.80015C6.5064 10.1315 6.23777 10.4001 5.9064 10.4001H1.9064C1.57503 10.4001 1.3064 10.1315 1.3064 9.80015ZM1.9064 5.60029C1.57503 5.60029 1.3064 5.86892 1.3064 6.20029C1.3064 6.53166 1.57503 6.80029 1.9064 6.80029H7.23973C7.5711 6.80029 7.83973 6.53166 7.83973 6.20029C7.83973 5.86892 7.5711 5.60029 7.23973 5.60029H1.9064ZM1.9064 2.00044C1.57503 2.00044 1.3064 2.26907 1.3064 2.60044C1.3064 2.93181 1.57503 3.20044 1.9064 3.20044H8.57306C8.90443 3.20044 9.17306 2.93181 9.17306 2.60044C9.17306 2.26907 8.90443 2.00044 8.57306 2.00044H1.9064Z",fillRule:"evenodd",clipRule:"evenodd"}},{tag:"path",attrs:{fill:"currentColor",d:"M12.4267 1.7333C12.4267 1.40193 12.1581 1.1333 11.8267 1.1333C11.4953 1.1333 11.2267 1.40193 11.2267 1.7333V12.818L9.98447 11.5758C9.75015 11.3415 9.37026 11.3415 9.13594 11.5758C8.90163 11.8101 8.90163 12.19 9.13594 12.4243L11.4026 14.691C11.6369 14.9253 12.0168 14.9253 12.2511 14.691L14.5178 12.4243C14.7521 12.19 14.7521 11.8101 14.5178 11.5758C14.2835 11.3415 13.9036 11.3415 13.6693 11.5758L12.4267 12.8183V1.7333Z"}}]},le=l.forwardRef(function(e,t){return l.createElement(x,Object.assign({},e,{id:"expand-descending-icon",ref:t,icon:Le}))});le.displayName="ExpandDescendingIcon";var Ue={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M8.6 1.99991C8.60001 1.66854 8.33138 1.39991 8.00001 1.3999C7.66864 1.3999 7.40001 1.66853 7.4 1.9999L7.39996 7.3999H1.9999C1.66853 7.3999 1.3999 7.66853 1.3999 7.9999C1.3999 8.33127 1.66853 8.5999 1.9999 8.5999H7.39995L7.3999 13.9999C7.3999 14.3313 7.66853 14.5999 7.9999 14.5999C8.33127 14.5999 8.5999 14.3313 8.5999 13.9999L8.59995 8.5999H13.9999C14.3313 8.5999 14.5999 8.33127 14.5999 7.9999C14.5999 7.66853 14.3313 7.3999 13.9999 7.3999H8.59996L8.6 1.99991Z"}}]},Y=l.forwardRef(function(e,t){return l.createElement(x,Object.assign({},e,{id:"increase-icon",ref:t,icon:Ue}))});Y.displayName="IncreaseIcon";var He={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M11.3536 6.14645C11.5488 6.34171 11.5488 6.65829 11.3536 6.85355L8.35355 9.85355C8.15829 10.0488 7.84171 10.0488 7.64645 9.85355L4.64645 6.85355C4.45118 6.65829 4.45118 6.34171 4.64645 6.14645C4.84171 5.95118 5.15829 5.95118 5.35355 6.14645L8 8.79289L10.6464 6.14645C10.8417 5.95118 11.1583 5.95118 11.3536 6.14645Z",fillRule:"evenodd",clipRule:"evenodd"}}]},de=l.forwardRef(function(e,t){return l.createElement(x,Object.assign({},e,{id:"more-down-icon",ref:t,icon:He}))});de.displayName="MoreDownIcon";var je={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"mask",attrs:{id:"mask0_622_8",width:16,height:16,x:0,y:0,maskUnits:"userSpaceOnUse"},children:[{tag:"path",attrs:{fill:"#D9D9D9",d:"M0 0H16V16H0z"}}]},{tag:"g",attrs:{fill:"currentColor",mask:"url(#mask0_622_8)"},children:[{tag:"path",attrs:{d:"M6 5C6.55228 5 7 4.55228 7 4C7 3.44772 6.55228 3 6 3C5.44772 3 5 3.44772 5 4C5 4.55228 5.44772 5 6 5Z"}},{tag:"path",attrs:{d:"M6 9C6.55228 9 7 8.55229 7 8C7 7.44772 6.55228 7 6 7C5.44772 7 5 7.44772 5 8C5 8.55229 5.44772 9 6 9Z"}},{tag:"path",attrs:{d:"M7 12C7 12.5523 6.55228 13 6 13C5.44772 13 5 12.5523 5 12C5 11.4477 5.44772 11 6 11C6.55228 11 7 11.4477 7 12Z"}},{tag:"path",attrs:{d:"M10 5C10.5523 5 11 4.55228 11 4C11 3.44772 10.5523 3 10 3C9.44771 3 9 3.44772 9 4C9 4.55228 9.44771 5 10 5Z"}},{tag:"path",attrs:{d:"M11 8C11 8.55229 10.5523 9 10 9C9.44771 9 9 8.55229 9 8C9 7.44772 9.44771 7 10 7C10.5523 7 11 7.44772 11 8Z"}},{tag:"path",attrs:{d:"M10 13C10.5523 13 11 12.5523 11 12C11 11.4477 10.5523 11 10 11C9.44771 11 9 11.4477 9 12C9 12.5523 9.44771 13 10 13Z"}}]}]},ue=l.forwardRef(function(e,t){return l.createElement(x,Object.assign({},e,{id:"sequence-icon",ref:t,icon:je}))});ue.displayName="SequenceIcon";function Ae(){const e=h.useDependency(p),t=h.useObservable(e.customSortState$);return!t||!t.location?null:a.jsx($e,{state:t})}function $e({state:e}){const t=h.useDependency(E.SheetsSortService),n=h.useDependency(i.LocaleService),r=h.useDependency(p),[o,s]=l.useState(!1),[c,g]=l.useState(0),v=l.useRef(null),{range:m,unitId:b,subUnitId:I}=e.location,k=r.getTitles(o),[y,P]=l.useState([{type:E.SortType.ASC,colIndex:m.startColumn}]),G=l.useCallback((C,w)=>{const D=[...y];w===null?D.splice(C,1):D[C]=w,P(D)},[y]),S=l.useCallback(i.throttle(()=>{const C=[...y],w=Be(m,y);w!==null&&(C.push({type:E.SortType.ASC,colIndex:w}),P(C))},200),[y,m]),ee=l.useCallback((C,w)=>{t.applySort({range:m,orderRules:C,hasTitle:w}),r.closeCustomSortPanel()},[t,r,m]),ht=l.useCallback(()=>{r.closeCustomSortPanel()},[r]),gt=l.useCallback(C=>{s(C),C?r.setSelection(b,I,{...m,startRow:m.startRow+1}):r.setSelection(b,I,m)},[r,m,I,b]);l.useEffect(()=>{v.current&&y.length>5&&(v.current.scrollTop=v.current.scrollHeight)},[y]);const vt=y.length<k.length,Se=y.map(C=>({...C,id:`${C.colIndex}`}));return a.jsxs("div",{children:[a.jsxs("div",{onMouseDown:C=>{C.stopPropagation()},children:[a.jsxs("div",{className:"univer-flex univer-items-center univer-justify-between",children:[a.jsx(f.Checkbox,{checked:o,onChange:C=>gt(!!C),children:n.t("sheets-sort.dialog.first-row-check")}),vt?a.jsxs("div",{className:"univer-flex univer-cursor-pointer univer-select-none univer-items-center univer-text-base",onClick:S,children:[a.jsx(Y,{}),a.jsx("span",{className:"univer-ml-1.5",children:n.t("sheets-sort.dialog.add-condition")})]}):a.jsxs("div",{className:"univer-flex univer-cursor-pointer univer-select-none univer-items-center univer-text-base univer-text-primary-500 disabled:univer-cursor-not-allowed disabled:univer-divide-opacity-30 disabled:univer-text-gray-800",children:[a.jsx(Y,{}),a.jsx("span",{className:"univer-ml-1.5 univer-text-xs",children:n.t("sheets-sort.dialog.add-condition")})]})]}),a.jsx("div",{ref:v,className:f.clsx("univer-max-h-[310px] univer-overflow-y-auto univer-overflow-x-hidden",f.scrollbarClassName),onScroll:C=>{const w=C.currentTarget.scrollTop;g(w)},children:a.jsx(f.DraggableList,{className:"[&_.react-grid-item]:univer-transition-none [&_.react-grid-placeholder]:univer-rounded [&_.react-grid-placeholder]:!univer-bg-gray-200",list:Se,onListChange:P,idKey:"id",draggableHandle:"[data-u-comp=sort-panel-item-handler]",itemRender:C=>a.jsx(Ze,{titles:k,list:Se,item:C,onChange:(w,D)=>G(D,w),scrollPosition:c}),rowHeight:32,margin:[0,12]})})]}),a.jsxs("div",{className:"univer-mt-5 univer-flex univer-justify-end",children:[a.jsx(f.Button,{className:"univer-ml-3",onClick:()=>ht(),children:n.t("sheets-sort.dialog.cancel")}),a.jsx(f.Button,{className:"univer-ml-3",variant:"primary",onClick:()=>ee(y,o),children:n.t("sheets-sort.dialog.confirm")})]})]})}function Ze(e){var G;const{list:t,item:n,titles:r,onChange:o,scrollPosition:s}=e,c=h.useDependency(i.LocaleService),g=r.filter(S=>!t.some(ee=>ee.colIndex===S.index)||S.index===n.colIndex),v=t.findIndex(S=>S.colIndex===n.colIndex),m=l.useCallback(S=>{o({...n,colIndex:S.index},v),I(!1)},[v,n,o]),[b,I]=l.useState(!1),k=S=>{I(S)};l.useEffect(()=>{I(!1)},[s]);const y=t.length>1,P=(G=r.find(S=>S.index===n.colIndex))==null?void 0:G.label;return a.jsxs("div",{className:"univer-grid univer-grid-flow-col univer-grid-cols-2 univer-items-center univer-gap-2",children:[a.jsxs("div",{className:"univer-flex univer-items-center",children:[a.jsx("div",{"data-u-comp":"sort-panel-item-handler",className:"univer-flex univer-cursor-pointer univer-items-center univer-justify-center univer-text-base univer-text-gray-700",children:a.jsx(ue,{})}),a.jsx(f.Dropdown,{overlay:a.jsx("ul",{className:f.clsx("univer-my-0 univer-box-border univer-grid univer-max-h-[310px] univer-w-[var(--radix-popper-anchor-width)] univer-items-center univer-gap-1 univer-overflow-y-auto univer-overflow-x-hidden univer-rounded-lg univer-border univer-bg-white univer-p-1 univer-text-base univer-shadow-lg",f.scrollbarClassName),children:g.map(S=>a.jsxs("li",{onClick:()=>m(S),className:"univer-relative univer-box-border univer-flex univer-h-7 univer-cursor-pointer univer-list-none univer-items-center univer-justify-between univer-rounded univer-px-2 univer-text-sm univer-transition-all hover:univer-bg-gray-100 dark:hover:!univer-bg-gray-700",children:[a.jsx("span",{className:"univer-max-w-[220px] univer-truncate",children:S.label}),a.jsx("span",{children:S.index===n.colIndex&&a.jsx(ie,{})})]},S.index))}),open:b,onOpenChange:k,children:a.jsxs("div",{className:f.clsx("univer-ml-2 univer-flex univer-w-full univer-items-center univer-justify-between univer-overflow-hidden univer-rounded-md univer-py-1.5 univer-text-sm univer-text-gray-900 dark:!univer-text-white"),children:[a.jsx("span",{className:"univer-max-w-[220px] univer-truncate",children:P}),a.jsx(de,{})]})})]}),a.jsxs("div",{className:"univer-flex univer-items-center univer-justify-end univer-gap-2",children:[a.jsxs(f.RadioGroup,{value:n.type,onChange:S=>{o({...n,type:S},v)},children:[a.jsx(f.Radio,{value:E.SortType.ASC,children:c.t("sheets-sort.general.sort-asc")}),a.jsx(f.Radio,{value:E.SortType.DESC,children:c.t("sheets-sort.general.sort-desc")})]}),a.jsx("a",{className:"univer-flex univer-cursor-pointer univer-items-center univer-text-sm univer-transition-colors hover:univer-text-red-500",onClick:()=>o(null,v),children:!y&&a.jsx(ae,{})})]})]})}function Be(e,t){const{startColumn:n,endColumn:r}=e,o=new Set(t.map(s=>s==null?void 0:s.colIndex));for(let s=n;s<=r;s++)if(!o.has(s))return s;return null}function Fe(e){const{range:t,colIndex:n,onClose:r}=e,o=h.useDependency(p),s=h.useDependency(i.IUniverInstanceService),c=h.useDependency(i.LocaleService),g=l.useCallback(v=>{const{unitId:m,subUnitId:b}=u.getSheetCommandTarget(s)||{};if(t&&m&&b){const I={...t,startRow:t.startRow+1};o.triggerSortDirectly(v,!1,{unitId:m,subUnitId:b,range:I,colIndex:n})}else throw new Error(`Cannot find the target to sort. unitId: ${m}, subUnitId: ${b}, range: ${t}, colIndex: ${n}`);r()},[t,n,o,s,r]);return a.jsxs(f.ButtonGroup,{className:"univer-mb-3 univer-w-full univer-grid-cols-2",children:[a.jsxs(f.Button,{onClick:()=>g(!0),children:[a.jsx(q,{}),c.t("sheets-sort.general.sort-asc")]}),a.jsxs(f.Button,{onClick:()=>g(!1),children:[a.jsx(z,{}),c.t("sheets-sort.general.sort-desc")]})]})}const he="sheet.menu.sheets-sort",ge="sheet.menu.sheets-sort-ctx",O="AscendingIcon",X="ExpandAscendingIcon",K="DescendingIcon",J="ExpandDescendingIcon",Q="CustomSortIcon";function We(e){return{id:he,type:h.MenuItemType.SUBITEMS,icon:O,tooltip:"sheets-sort.general.sort",hidden$:h.getMenuHiddenObservable(e,i.UniverInstanceType.UNIVER_SHEET),disabled$:T.getCurrentRangeDisable$(e,{workbookTypes:[u.WorkbookEditablePermission],worksheetTypes:[u.WorksheetSortPermission,u.WorksheetEditPermission],rangeTypes:[u.RangeProtectionPermissionEditPoint]})}}function Ve(e){return{id:L.id,icon:O,title:"sheets-sort.general.sort-asc-cur",type:h.MenuItemType.BUTTON,hidden$:T.getCurrentExclusiveRangeInterest$(e)}}function Ge(e){return{id:U.id,title:"sheets-sort.general.sort-asc-ext",icon:X,type:h.MenuItemType.BUTTON}}function qe(e){return{id:H.id,title:"sheets-sort.general.sort-desc-cur",icon:K,type:h.MenuItemType.BUTTON}}function ze(e){return{id:j.id,title:"sheets-sort.general.sort-desc-ext",icon:J,type:h.MenuItemType.BUTTON}}function Ye(e){return{id:A.id,title:"sheets-sort.general.sort-custom",type:h.MenuItemType.BUTTON,icon:Q}}function Xe(e){return{id:ge,title:"sheets-sort.general.sort",type:h.MenuItemType.SUBITEMS,icon:O,hidden$:h.getMenuHiddenObservable(e,i.UniverInstanceType.UNIVER_SHEET),disabled$:T.getCurrentRangeDisable$(e,{workbookTypes:[u.WorkbookEditablePermission],worksheetTypes:[u.WorksheetSortPermission,u.WorksheetEditPermission],rangeTypes:[u.RangeProtectionPermissionEditPoint]})}}function Ke(e){return{id:$.id,title:"sheets-sort.general.sort-asc-cur",type:h.MenuItemType.BUTTON,icon:O,disabled$:T.getCurrentRangeDisable$(e,{workbookTypes:[u.WorkbookEditablePermission],worksheetTypes:[u.WorksheetSortPermission,u.WorksheetEditPermission],rangeTypes:[u.RangeProtectionPermissionEditPoint]})}}function Je(e){return{id:Z.id,title:"sheets-sort.general.sort-asc-ext",type:h.MenuItemType.BUTTON,icon:X,disabled$:T.getCurrentRangeDisable$(e,{workbookTypes:[u.WorkbookEditablePermission],worksheetTypes:[u.WorksheetSortPermission,u.WorksheetEditPermission],rangeTypes:[u.RangeProtectionPermissionEditPoint]})}}function Qe(e){return{id:B.id,title:"sheets-sort.general.sort-desc-cur",type:h.MenuItemType.BUTTON,icon:K,disabled$:T.getCurrentRangeDisable$(e,{workbookTypes:[u.WorkbookEditablePermission],worksheetTypes:[u.WorksheetSortPermission,u.WorksheetEditPermission],rangeTypes:[u.RangeProtectionPermissionEditPoint]})}}function et(e){return{id:F.id,title:"sheets-sort.general.sort-desc-ext",type:h.MenuItemType.BUTTON,icon:J,disabled$:T.getCurrentRangeDisable$(e,{workbookTypes:[u.WorkbookEditablePermission],worksheetTypes:[u.WorksheetSortPermission,u.WorksheetEditPermission],rangeTypes:[u.RangeProtectionPermissionEditPoint]})}}function tt(e){return{id:W.id,title:"sheets-sort.general.sort-custom",type:h.MenuItemType.BUTTON,icon:Q,disabled$:T.getCurrentRangeDisable$(e,{workbookTypes:[u.WorkbookEditablePermission],worksheetTypes:[u.WorksheetSortPermission,u.WorksheetEditPermission],rangeTypes:[u.RangeProtectionPermissionEditPoint]})}}const rt={[h.RibbonDataGroup.ORGANIZATION]:{[he]:{order:3,menuItemFactory:We,[L.id]:{order:0,menuItemFactory:Ve},[U.id]:{order:1,menuItemFactory:Ge},[H.id]:{order:2,menuItemFactory:qe},[j.id]:{order:3,menuItemFactory:ze},[A.id]:{order:4,menuItemFactory:Ye}}},[h.ContextMenuPosition.MAIN_AREA]:{[h.ContextMenuGroup.DATA]:{[ge]:{order:0,menuItemFactory:Xe,[$.id]:{order:0,menuItemFactory:Ke},[Z.id]:{order:1,menuItemFactory:Je},[B.id]:{order:2,menuItemFactory:Qe},[F.id]:{order:3,menuItemFactory:et},[W.id]:{order:4,menuItemFactory:tt}}}}};var nt=Object.getOwnPropertyDescriptor,ot=(e,t,n,r)=>{for(var o=r>1?void 0:r?nt(t,n):t,s=e.length-1,c;s>=0;s--)(c=e[s])&&(o=c(o)||o);return o},M=(e,t)=>(n,r)=>t(n,r,e);const ve="custom-sort-dialog",Ce=560,it=128;let V=class extends i.RxDisposable{constructor(e,t,n,r,o,s,c,g,v,m){super(),this._commandService=e,this._menuManagerService=t,this._dialogService=n,this._layoutService=r,this._uiPartsService=o,this._sheetRenderService=s,this._localeService=c,this._sheetsSortUIService=g,this._injector=v,this._componentManager=m,this._initCommands(),this._initMenu(),this._initUI()}_initMenu(){this._menuManagerService.mergeMenu(rt)}_initCommands(){[L,U,H,j,A,$,Z,B,F,W].forEach(e=>this.disposeWithMe(this._commandService.registerCommand(e))),this.disposeWithMe(this._sheetRenderService.registerSkeletonChangingMutations(E.SortRangeCommand.id))}_initUI(){this.disposeWithMe(this._uiPartsService.registerComponent(T.SheetsUIPart.FILTER_PANEL_EMBED_POINT,()=>h.connectInjector(Fe,this._injector))),[["CustomSortPanel",Ae],[O,q],[X,ce],[K,z],[J,le],[Q,se]].forEach(([e,t])=>{this.disposeWithMe(this._componentManager.register(e,t))}),this._sheetsSortUIService.customSortState$.pipe(re.takeUntil(this.dispose$)).subscribe(e=>{e&&e.show&&e.location?this._openCustomSortPanel(e.location):e&&!(e!=null&&e.show)&&this._closePanel()})}_openCustomSortPanel(e){this._dialogService.open({id:ve,draggable:!0,width:Ce,title:{title:`${this._localeService.t("sheets-sort.general.sort-custom")}: ${pe.serializeRange(e.range)}`},children:{label:"CustomSortPanel"},destroyOnClose:!0,defaultPosition:st(),preservePositionOnDestroy:!1,onClose:()=>this._closePanel(),mask:!0})}_closePanel(){this._dialogService.close(ve),queueMicrotask(()=>this._layoutService.focus())}};V=ot([M(0,i.ICommandService),M(1,h.IMenuManagerService),M(2,h.IDialogService),M(3,h.ILayoutService),M(4,h.IUIPartsService),M(5,i.Inject(T.SheetsRenderService)),M(6,i.Inject(i.LocaleService)),M(7,i.Inject(p)),M(8,i.Inject(i.Injector)),M(9,i.Inject(h.ComponentManager))],V);function st(){return{x:(window.innerWidth-Ce)/2,y:it}}var at=Object.defineProperty,ct=Object.getOwnPropertyDescriptor,lt=(e,t,n)=>t in e?at(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,dt=(e,t,n,r)=>{for(var o=r>1?void 0:r?ct(t,n):t,s=e.length-1,c;s>=0;s--)(c=e[s])&&(o=c(o)||o);return o},me=(e,t)=>(n,r)=>t(n,r,e),fe=(e,t,n)=>lt(e,typeof t!="symbol"?t+"":t,n);const ut="SHEET_SORT_UI_PLUGIN";d.UniverSheetsSortUIPlugin=class extends i.Plugin{constructor(t=ne,n,r){super(),this._config=t,this._injector=n,this._configService=r;const{...o}=i.merge({},ne,this._config);this._configService.setConfig(we,o)}onStarting(){[[p],[V]].forEach(t=>this._injector.add(t))}onRendered(){this._injector.get(V)}},fe(d.UniverSheetsSortUIPlugin,"type",i.UniverInstanceType.UNIVER_SHEET),fe(d.UniverSheetsSortUIPlugin,"pluginName",ut),d.UniverSheetsSortUIPlugin=dt([i.DependentOn(E.UniverSheetsSortPlugin),me(1,i.Inject(i.Injector)),me(2,i.IConfigService)],d.UniverSheetsSortUIPlugin),d.SortRangeAscCommand=L,d.SortRangeAscExtCommand=U,d.SortRangeAscExtInCtxMenuCommand=Z,d.SortRangeAscInCtxMenuCommand=$,d.SortRangeCustomCommand=A,d.SortRangeCustomInCtxMenuCommand=W,d.SortRangeDescCommand=H,d.SortRangeDescExtCommand=j,d.SortRangeDescExtInCtxMenuCommand=F,d.SortRangeDescInCtxMenuCommand=B,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});
10
+ (function(d,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("@univerjs/core"),require("react/jsx-runtime"),require("@univerjs/sheets"),require("@univerjs/sheets-sort"),require("@univerjs/ui"),require("rxjs"),require("@univerjs/design"),require("react"),require("@univerjs/engine-formula"),require("@univerjs/sheets-ui")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","react/jsx-runtime","@univerjs/sheets","@univerjs/sheets-sort","@univerjs/ui","rxjs","@univerjs/design","react","@univerjs/engine-formula","@univerjs/sheets-ui"],i):(d=typeof globalThis<"u"?globalThis:d||self,i(d.UniverSheetsSortUi={},d.UniverCore,d.React,d.UniverSheets,d.UniverSheetsSort,d.UniverUi,d.rxjs,d.UniverDesign,d.React,d.UniverEngineFormula,d.UniverSheetsUi))})(this,(function(d,i,a,u,E,h,re,f,l,pe,T){"use strict";var Ct=Object.defineProperty;var mt=(d,i,a)=>i in d?Ct(d,i,{enumerable:!0,configurable:!0,writable:!0,value:a}):d[i]=a;var te=(d,i,a)=>mt(d,typeof i!="symbol"?i+"":i,a);const ye=e=>{const[t,n]=l.useState("0"),r=h.useDependency(i.LocaleService);return a.jsxs("div",{className:"univer-text-sm",children:[a.jsx("div",{className:"extend-confirm-desc",children:r.t("sheets-sort.dialog.sort-reminder-desc")}),a.jsxs(f.RadioGroup,{className:"univer-mt-4",value:t,direction:"vertical",onChange:o=>{n(o),e.onChange(o)},children:[a.jsx(f.Radio,{value:"0",children:r.t("sheets-sort.dialog.sort-reminder-no")}),a.jsx(f.Radio,{value:"1",children:r.t("sheets-sort.dialog.sort-reminder-ext")})]})]})};var Ie=Object.getOwnPropertyDescriptor,_e=(e,t,n,r)=>{for(var o=r>1?void 0:r?Ie(t,n):t,s=e.length-1,c;s>=0;s--)(c=e[s])&&(o=c(o)||o);return o},R=(e,t)=>(n,r)=>t(n,r,e);const N={MERGE_ERROR:"sheets-sort.error.merge-size",EMPTY_ERROR:"sheets-sort.error.empty",SINGLE_ERROR:"sheets-sort.error.single",FORMULA_ARRAY:"sheets-sort.error.formula-array"};let p=class extends i.Disposable{constructor(t,n,r,o,s,c){super();te(this,"_customSortState$",new re.BehaviorSubject(null));te(this,"customSortState$",this._customSortState$.asObservable());this._univerInstanceService=t,this._confirmService=n,this._selectionManagerService=r,this._sheetsSortService=o,this._localeService=s,this._commandService=c}async triggerSortDirectly(t,n,r){const o=r||await this._detectSortLocation(n);if(!o||!this._check(o))return!1;const c={orderRules:[{type:t?E.SortType.ASC:E.SortType.DESC,colIndex:o.colIndex}],range:o.range};return this._sheetsSortService.applySort(c,o.unitId,o.subUnitId),!0}async triggerSortCustomize(){const t=await this._detectSortLocation();return!t||!this._check(t)?!1:(this.showCustomSortPanel(t),!0)}customSortState(){return this._customSortState$.getValue()}getTitles(t){var v,m;const n=(v=this.customSortState())==null?void 0:v.location;if(!n)return[];const{unitId:r,subUnitId:o,range:s}=n,c=(m=this._univerInstanceService.getUnit(r))==null?void 0:m.getSheetBySheetId(o);if(!c)return[];const g=xe(this._localeService);return Array.from({length:s.endColumn-s.startColumn+1},(b,I)=>{var y;const k=(y=c.getCell(s.startRow,I+s.startColumn))==null?void 0:y.v;return{index:I+s.startColumn,label:t?`${k!=null?k:g(I+s.startColumn)}`:g(I+s.startColumn)}})}setSelection(t,n,r){var c;const o=(c=this._univerInstanceService.getUnit(t))==null?void 0:c.getSheetBySheetId(n);if(!o)return;const s={unitId:t,subUnitId:n,selections:[{range:r,primary:u.getPrimaryForRange(r,o),style:null}]};this._commandService.executeCommand(u.SetSelectionsOperation.id,s)}async showCheckError(t){return await this._confirmService.confirm({id:"sort-range-check-error",title:{title:this._localeService.t("info.tooltip")},children:{title:a.jsx("div",{children:this._localeService.t(t)})},cancelText:this._localeService.t("sheets-sort.dialog.cancel"),confirmText:this._localeService.t("sheets-sort.dialog.confirm")})}async showExtendConfirm(){let t=!1;return await this._confirmService.confirm({id:"extend-sort-range-dialog",title:{title:this._localeService.t("sheets-sort.dialog.sort-reminder")},children:{title:a.jsx(ye,{onChange:r=>{t=r==="1"}})},width:400,cancelText:this._localeService.t("sheets-sort.dialog.cancel"),confirmText:this._localeService.t("sheets-sort.dialog.confirm")})?t?"extend":"keep":"cancel"}showCustomSortPanel(t){this._customSortState$.next({location:t,show:!0})}closeCustomSortPanel(){this._customSortState$.next({show:!1})}_check(t){return this._sheetsSortService.singleCheck(t)?this._sheetsSortService.mergeCheck(t)?this._sheetsSortService.formulaCheck(t)?this._sheetsSortService.emptyCheck(t)?!0:(this.showCheckError(N.EMPTY_ERROR),!1):(this.showCheckError(N.FORMULA_ARRAY),!1):(this.showCheckError(N.MERGE_ERROR),!1):(this.showCheckError(N.SINGLE_ERROR),!1)}async _detectSortLocation(t){const n=this._univerInstanceService.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET),r=n.getActiveSheet(),o=n.getUnitId(),s=r.getSheetId(),c=this._selectionManagerService.getCurrentLastSelection();if(!c)return null;let g;if(t===!0)g=u.expandToContinuousRange(c.range,{up:!0,down:!0,left:!0,right:!0},r),this.setSelection(o,s,g);else if(t===!1)g=c.range;else{const v=await this.showExtendConfirm();if(v==="cancel")return null;v==="keep"?g=c.range:(g=u.expandToContinuousRange(c.range,{up:!0,down:!0,left:!0,right:!0},r),this.setSelection(o,s,g))}return{range:g,unitId:o,subUnitId:s,colIndex:c.primary.actualColumn}}};p=_e([R(0,i.IUniverInstanceService),R(1,h.IConfirmService),R(2,i.Inject(u.SheetsSelectionsService)),R(3,i.Inject(E.SheetsSortService)),R(4,i.Inject(i.LocaleService)),R(5,i.ICommandService)],p);function xe(e){return t=>{const n=i.Tools.chatAtABC(t);switch(e.getCurrentLocale()){case i.LocaleType.ZH_CN:return`"${n}"列`;case i.LocaleType.EN_US:return`Column "${n}"`;default:return`Column "${n}"`}}}const L={id:"sheet.command.sort-range-asc",type:i.CommandType.COMMAND,handler:async e=>await e.get(p).triggerSortDirectly(!0,!1)},U={id:"sheet.command.sort-range-asc-ext",type:i.CommandType.COMMAND,handler:async e=>await e.get(p).triggerSortDirectly(!0,!0)},H={id:"sheet.command.sort-range-desc",type:i.CommandType.COMMAND,handler:async e=>await e.get(p).triggerSortDirectly(!1,!1)},j={id:"sheet.command.sort-range-desc-ext",type:i.CommandType.COMMAND,handler:async e=>await e.get(p).triggerSortDirectly(!1,!0)},A={id:"sheet.command.sort-range-custom",type:i.CommandType.COMMAND,handler:async e=>await e.get(p).triggerSortCustomize()},$={id:"sheet.command.sort-range-asc-ctx",type:i.CommandType.COMMAND,handler:async e=>await e.get(p).triggerSortDirectly(!0,!1)},Z={id:"sheet.command.sort-range-asc-ext-ctx",type:i.CommandType.COMMAND,handler:async e=>await e.get(p).triggerSortDirectly(!0,!0)},B={id:"sheet.command.sort-range-desc-ctx",type:i.CommandType.COMMAND,handler:async e=>await e.get(p).triggerSortDirectly(!1,!1)},F={id:"sheet.command.sort-range-desc-ext-ctx",type:i.CommandType.COMMAND,handler:async e=>await e.get(p).triggerSortDirectly(!1,!0)},W={id:"sheet.command.sort-range-custom-ctx",type:i.CommandType.COMMAND,handler:async e=>await e.get(p).triggerSortCustomize()},we="sheets-sort-ui.config",ne={};var _=function(){return _=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},_.apply(this,arguments)},Ee=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},x=l.forwardRef(function(e,t){var n=e.icon,r=e.id,o=e.className,s=e.extend,c=Ee(e,["icon","id","className","extend"]),g="univerjs-icon univerjs-icon-".concat(r," ").concat(o||"").trim(),v=l.useRef("_".concat(be()));return oe(n,"".concat(r),{defIds:n.defIds,idSuffix:v.current},_({ref:t,className:g},c),s)});function oe(e,t,n,r,o){return l.createElement(e.tag,_(_({key:t},Te(e,n,o)),r),(Me(e,n).children||[]).map(function(s,c){return oe(s,"".concat(t,"-").concat(e.tag,"-").concat(c),n,void 0,o)}))}function Te(e,t,n){var r=_({},e.attrs);n!=null&&n.colorChannel1&&r.fill==="colorChannel1"&&(r.fill=n.colorChannel1),e.tag==="mask"&&r.id&&(r.id=r.id+t.idSuffix),Object.entries(r).forEach(function(s){var c=s[0],g=s[1];c==="mask"&&typeof g=="string"&&(r[c]=g.replace(/url\(#(.*)\)/,"url(#$1".concat(t.idSuffix,")")))});var o=t.defIds;return!o||o.length===0||(e.tag==="use"&&r["xlink:href"]&&(r["xlink:href"]=r["xlink:href"]+t.idSuffix),Object.entries(r).forEach(function(s){var c=s[0],g=s[1];typeof g=="string"&&(r[c]=g.replace(/url\(#(.*)\)/,"url(#$1".concat(t.idSuffix,")")))})),r}function Me(e,t){var n,r=t.defIds;return!r||r.length===0?e:e.tag==="defs"&&(!((n=e.children)===null||n===void 0)&&n.length)?_(_({},e),{children:e.children.map(function(o){return typeof o.attrs.id=="string"&&r&&r.includes(o.attrs.id)?_(_({},o),{attrs:_(_({},o.attrs),{id:o.attrs.id+t.idSuffix})}):o})}):e}function be(){return Math.random().toString(36).substring(2,8)}x.displayName="UniverIcon";var ke={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M12.4208 14.4667C12.4208 14.798 12.1522 15.0667 11.8208 15.0667C11.4895 15.0667 11.2208 14.798 11.2208 14.4667V2.98193L9.97861 4.22417C9.7443 4.45848 9.3644 4.45848 9.13008 4.22417C8.89577 3.98985 8.89577 3.60995 9.13008 3.37564L11.3967 1.10897C11.6311 0.874657 12.011 0.874657 12.2453 1.10897L14.5119 3.37564C14.7463 3.60995 14.7463 3.98985 14.5119 4.22417C14.2776 4.45848 13.8977 4.45848 13.6634 4.22417L12.4208 2.9816V14.4667Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M1.98967 10.2798C1.6583 10.2798 1.38967 10.0112 1.38967 9.67983C1.38967 9.34846 1.6583 9.07983 1.98967 9.07983H6.50138C6.74406 9.07983 6.96284 9.22602 7.05571 9.45022C7.14858 9.67443 7.09725 9.9325 6.92565 10.1041L3.43819 13.5916H6.50138C6.83276 13.5916 7.10138 13.8602 7.10138 14.1916C7.10138 14.5229 6.83276 14.7916 6.50138 14.7916H1.98967C1.74699 14.7916 1.52821 14.6454 1.43534 14.4212C1.34247 14.197 1.3938 13.9389 1.5654 13.7673L5.05286 10.2798H1.98967Z",fillRule:"evenodd",clipRule:"evenodd"}},{tag:"path",attrs:{fill:"currentColor",d:"M5.1846 1.86439C4.8641 0.989866 3.62725 0.989866 3.30674 1.86439L1.34882 7.20672C1.23479 7.51786 1.39458 7.86252 1.70571 7.97655C2.01684 8.09058 2.3615 7.93079 2.47553 7.61966L3.06159 6.02055L3.06338 6.02056H5.42975L6.01581 7.61966C6.12984 7.93079 6.4745 8.09058 6.78563 7.97655C7.09677 7.86252 7.25655 7.51786 7.14252 7.20672L5.1846 1.86439ZM4.98996 4.82056L4.24567 2.78971L3.50138 4.82056H4.98996Z",fillRule:"evenodd",clipRule:"evenodd"}}]},q=l.forwardRef(function(e,t){return l.createElement(x,Object.assign({},e,{id:"ascending-icon",ref:t,icon:ke}))});q.displayName="AscendingIcon";var Re={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M14.1544 3.75557C14.3887 3.98988 14.3887 4.36978 14.1544 4.6041L6.51409 12.2444C6.40157 12.3569 6.24896 12.4201 6.08983 12.4201C5.9307 12.4201 5.77808 12.3569 5.66556 12.2444L1.84541 8.42425C1.6111 8.18993 1.6111 7.81003 1.84541 7.57572C2.07973 7.34141 2.45963 7.34141 2.69394 7.57572L6.08983 10.9716L13.3059 3.75557C13.5402 3.52126 13.9201 3.52126 14.1544 3.75557Z",fillRule:"evenodd",clipRule:"evenodd"}}]},ie=l.forwardRef(function(e,t){return l.createElement(x,Object.assign({},e,{id:"check-mark-icon",ref:t,icon:Re}))});ie.displayName="CheckMarkIcon";var Oe={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M9.77445 9.24306L9.77457 11.9573C9.77458 12.2887 9.50597 12.5574 9.17459 12.5574C8.84322 12.5574 8.57458 12.2888 8.57457 11.9574L8.57439 7.79509C8.57438 7.46372 8.84299 7.19508 9.17436 7.19507C9.3281 7.19493 9.48196 7.25351 9.59925 7.3708L11.3465 9.11808C11.5808 9.3524 11.5808 9.7323 11.3465 9.96661C11.1122 10.2009 10.7323 10.2009 10.498 9.96661L9.77445 9.24306Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M6.22584 10.5094L6.22572 7.79514C6.22571 7.46377 6.49433 7.19513 6.8257 7.19512C7.15707 7.1951 7.42571 7.46372 7.42572 7.79509L7.4259 11.9574C7.42592 12.2888 7.1573 12.5574 6.82593 12.5574C6.67228 12.5575 6.51828 12.4989 6.40104 12.3817L4.65376 10.6344C4.41945 10.4001 4.41945 10.0202 4.65376 9.78588C4.88808 9.55156 5.26798 9.55156 5.50229 9.78588L6.22584 10.5094Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M1.14014 3.73989C1.14014 2.30396 2.3042 1.13989 3.74014 1.13989H12.2601C13.6961 1.13989 14.8601 2.30395 14.8601 3.73989V12.2599C14.8601 13.6958 13.6961 14.8599 12.2601 14.8599H3.74014C2.3042 14.8599 1.14014 13.6958 1.14014 12.2599V3.73989ZM2.34014 5.86724V12.2599C2.34014 13.0331 2.96694 13.6599 3.74014 13.6599H12.2601C13.0333 13.6599 13.6601 13.0331 13.6601 12.2599V5.86724H2.34014ZM13.6601 4.66724H2.34014V3.73989C2.34014 2.9667 2.96694 2.33989 3.74014 2.33989H12.2601C13.0333 2.33989 13.6601 2.96669 13.6601 3.73989V4.66724Z",fillRule:"evenodd",clipRule:"evenodd"}}]},se=l.forwardRef(function(e,t){return l.createElement(x,Object.assign({},e,{id:"custom-sort-icon",ref:t,icon:Oe}))});se.displayName="CustomSortIcon";var Pe={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M5.3313 1.4667C5.3313 1.13533 5.59993 0.866699 5.9313 0.866699H10.069C10.4004 0.866699 10.669 1.13533 10.669 1.4667C10.669 1.79807 10.4004 2.0667 10.069 2.0667H5.9313C5.59993 2.0667 5.3313 1.79807 5.3313 1.4667Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M1.09985 3.64443C1.09985 3.31306 1.36848 3.04443 1.69985 3.04443H14.2999C14.6312 3.04443 14.8999 3.31306 14.8999 3.64443C14.8999 3.9758 14.6312 4.24443 14.2999 4.24443H1.69985C1.36848 4.24443 1.09985 3.9758 1.09985 3.64443Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M4.75332 5.22217C3.86966 5.22217 3.15332 5.93851 3.15332 6.82217V13.1332C3.15332 14.2377 4.04875 15.1332 5.15332 15.1332H10.8465C11.9511 15.1332 12.8465 14.2377 12.8465 13.1331V6.82217C12.8465 5.93851 12.1302 5.22217 11.2465 5.22217H4.75332ZM4.35332 6.82217C4.35332 6.60125 4.53241 6.42217 4.75332 6.42217H11.2465C11.4674 6.42217 11.6465 6.60125 11.6465 6.82217V13.1331C11.6465 13.575 11.2884 13.9331 10.8465 13.9331H5.15332C4.71149 13.9331 4.35332 13.575 4.35332 13.1332V6.82217Z",fillRule:"evenodd",clipRule:"evenodd"}}]},ae=l.forwardRef(function(e,t){return l.createElement(x,Object.assign({},e,{id:"delete-empty-icon",ref:t,icon:Pe}))});ae.displayName="DeleteEmptyIcon";var De={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M12.4208 1.53335C12.4208 1.20198 12.1522 0.93335 11.8208 0.93335C11.4895 0.93335 11.2208 1.20198 11.2208 1.53335V13.0181L9.97861 11.7758C9.7443 11.5415 9.3644 11.5415 9.13008 11.7758C8.89577 12.0101 8.89577 12.39 9.13008 12.6244L11.3967 14.891C11.6311 15.1253 12.011 15.1253 12.2453 14.891L14.5119 12.6244C14.7463 12.39 14.7463 12.0101 14.5119 11.7758C14.2776 11.5415 13.8977 11.5415 13.6634 11.7758L12.4208 13.0184V1.53335Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M1.98967 10.2798C1.6583 10.2798 1.38967 10.0112 1.38967 9.67983C1.38967 9.34846 1.6583 9.07983 1.98967 9.07983H6.50138C6.74406 9.07983 6.96284 9.22602 7.05571 9.45022C7.14858 9.67443 7.09725 9.9325 6.92565 10.1041L3.43819 13.5916H6.50138C6.83276 13.5916 7.10138 13.8602 7.10138 14.1916C7.10138 14.5229 6.83276 14.7916 6.50138 14.7916H1.98967C1.74699 14.7916 1.52821 14.6454 1.43534 14.4212C1.34247 14.197 1.3938 13.9389 1.5654 13.7673L5.05286 10.2798H1.98967Z",fillRule:"evenodd",clipRule:"evenodd"}},{tag:"path",attrs:{fill:"currentColor",d:"M5.1846 1.86439C4.8641 0.989866 3.62725 0.989866 3.30674 1.86439L1.34882 7.20672C1.23479 7.51786 1.39458 7.86252 1.70571 7.97655C2.01684 8.09058 2.3615 7.93079 2.47553 7.61966L3.06159 6.02055L3.06338 6.02056H5.42975L6.01581 7.61966C6.12984 7.93079 6.4745 8.09058 6.78563 7.97655C7.09677 7.86252 7.25655 7.51786 7.14252 7.20672L5.1846 1.86439ZM4.98996 4.82056L4.24567 2.78971L3.50138 4.82056H4.98996Z",fillRule:"evenodd",clipRule:"evenodd"}}]},z=l.forwardRef(function(e,t){return l.createElement(x,Object.assign({},e,{id:"descending-icon",ref:t,icon:De}))});z.displayName="DescendingIcon";var Ne={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M1.9064 3.20024C1.57503 3.20024 1.3064 2.93161 1.3064 2.60024C1.3064 2.26887 1.57503 2.00024 1.9064 2.00024H4.57306C4.90443 2.00024 5.17306 2.26887 5.17306 2.60024C5.17306 2.93161 4.90443 3.20024 4.57306 3.20024H1.9064ZM1.3064 6.19985C1.3064 6.53122 1.57503 6.79985 1.9064 6.79985H5.9064C6.23777 6.79985 6.5064 6.53122 6.5064 6.19985C6.5064 5.86848 6.23777 5.59985 5.9064 5.59985H1.9064C1.57503 5.59985 1.3064 5.86848 1.3064 6.19985ZM1.9064 10.3997C1.57503 10.3997 1.3064 10.1311 1.3064 9.79971C1.3064 9.46834 1.57503 9.19971 1.9064 9.19971H7.23973C7.5711 9.19971 7.83973 9.46834 7.83973 9.79971C7.83973 10.1311 7.5711 10.3997 7.23973 10.3997H1.9064ZM1.9064 13.9996C1.57503 13.9996 1.3064 13.7309 1.3064 13.3996C1.3064 13.0682 1.57503 12.7996 1.9064 12.7996H8.57306C8.90443 12.7996 9.17306 13.0682 9.17306 13.3996C9.17306 13.7309 8.90443 13.9996 8.57306 13.9996H1.9064Z",fillRule:"evenodd",clipRule:"evenodd"}},{tag:"path",attrs:{fill:"currentColor",d:"M12.4267 14.2667C12.4267 14.5981 12.1581 14.8667 11.8267 14.8667C11.4953 14.8667 11.2267 14.5981 11.2267 14.2667V3.18198L9.98447 4.42422C9.75015 4.65853 9.37026 4.65853 9.13594 4.42422C8.90163 4.1899 8.90163 3.81 9.13594 3.57569L11.4026 1.30902C11.6369 1.07471 12.0168 1.07471 12.2511 1.30902L14.5178 3.57569C14.7521 3.81 14.7521 4.1899 14.5178 4.42422C14.2835 4.65853 13.9036 4.65853 13.6693 4.42422L12.4267 3.18165V14.2667Z"}}]},ce=l.forwardRef(function(e,t){return l.createElement(x,Object.assign({},e,{id:"expand-ascending-icon",ref:t,icon:Ne}))});ce.displayName="ExpandAscendingIcon";var Le={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M1.9064 12.7998C1.57503 12.7998 1.3064 13.0684 1.3064 13.3998C1.3064 13.7311 1.57503 13.9998 1.9064 13.9998H4.57306C4.90443 13.9998 5.17306 13.7311 5.17306 13.3998C5.17306 13.0684 4.90443 12.7998 4.57306 12.7998H1.9064ZM1.3064 9.80015C1.3064 9.46878 1.57503 9.20015 1.9064 9.20015H5.9064C6.23777 9.20015 6.5064 9.46878 6.5064 9.80015C6.5064 10.1315 6.23777 10.4001 5.9064 10.4001H1.9064C1.57503 10.4001 1.3064 10.1315 1.3064 9.80015ZM1.9064 5.60029C1.57503 5.60029 1.3064 5.86892 1.3064 6.20029C1.3064 6.53166 1.57503 6.80029 1.9064 6.80029H7.23973C7.5711 6.80029 7.83973 6.53166 7.83973 6.20029C7.83973 5.86892 7.5711 5.60029 7.23973 5.60029H1.9064ZM1.9064 2.00044C1.57503 2.00044 1.3064 2.26907 1.3064 2.60044C1.3064 2.93181 1.57503 3.20044 1.9064 3.20044H8.57306C8.90443 3.20044 9.17306 2.93181 9.17306 2.60044C9.17306 2.26907 8.90443 2.00044 8.57306 2.00044H1.9064Z",fillRule:"evenodd",clipRule:"evenodd"}},{tag:"path",attrs:{fill:"currentColor",d:"M12.4267 1.7333C12.4267 1.40193 12.1581 1.1333 11.8267 1.1333C11.4953 1.1333 11.2267 1.40193 11.2267 1.7333V12.818L9.98447 11.5758C9.75015 11.3415 9.37026 11.3415 9.13594 11.5758C8.90163 11.8101 8.90163 12.19 9.13594 12.4243L11.4026 14.691C11.6369 14.9253 12.0168 14.9253 12.2511 14.691L14.5178 12.4243C14.7521 12.19 14.7521 11.8101 14.5178 11.5758C14.2835 11.3415 13.9036 11.3415 13.6693 11.5758L12.4267 12.8183V1.7333Z"}}]},le=l.forwardRef(function(e,t){return l.createElement(x,Object.assign({},e,{id:"expand-descending-icon",ref:t,icon:Le}))});le.displayName="ExpandDescendingIcon";var Ue={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M8.6 1.99991C8.60001 1.66854 8.33138 1.39991 8.00001 1.3999C7.66864 1.3999 7.40001 1.66853 7.4 1.9999L7.39996 7.3999H1.9999C1.66853 7.3999 1.3999 7.66853 1.3999 7.9999C1.3999 8.33127 1.66853 8.5999 1.9999 8.5999H7.39995L7.3999 13.9999C7.3999 14.3313 7.66853 14.5999 7.9999 14.5999C8.33127 14.5999 8.5999 14.3313 8.5999 13.9999L8.59995 8.5999H13.9999C14.3313 8.5999 14.5999 8.33127 14.5999 7.9999C14.5999 7.66853 14.3313 7.3999 13.9999 7.3999H8.59996L8.6 1.99991Z"}}]},Y=l.forwardRef(function(e,t){return l.createElement(x,Object.assign({},e,{id:"increase-icon",ref:t,icon:Ue}))});Y.displayName="IncreaseIcon";var He={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M11.3536 6.14645C11.5488 6.34171 11.5488 6.65829 11.3536 6.85355L8.35355 9.85355C8.15829 10.0488 7.84171 10.0488 7.64645 9.85355L4.64645 6.85355C4.45118 6.65829 4.45118 6.34171 4.64645 6.14645C4.84171 5.95118 5.15829 5.95118 5.35355 6.14645L8 8.79289L10.6464 6.14645C10.8417 5.95118 11.1583 5.95118 11.3536 6.14645Z",fillRule:"evenodd",clipRule:"evenodd"}}]},de=l.forwardRef(function(e,t){return l.createElement(x,Object.assign({},e,{id:"more-down-icon",ref:t,icon:He}))});de.displayName="MoreDownIcon";var je={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"mask",attrs:{id:"mask0_622_8",width:16,height:16,x:0,y:0,maskUnits:"userSpaceOnUse"},children:[{tag:"path",attrs:{fill:"#D9D9D9",d:"M0 0H16V16H0z"}}]},{tag:"g",attrs:{fill:"currentColor",mask:"url(#mask0_622_8)"},children:[{tag:"path",attrs:{d:"M6 5C6.55228 5 7 4.55228 7 4C7 3.44772 6.55228 3 6 3C5.44772 3 5 3.44772 5 4C5 4.55228 5.44772 5 6 5Z"}},{tag:"path",attrs:{d:"M6 9C6.55228 9 7 8.55229 7 8C7 7.44772 6.55228 7 6 7C5.44772 7 5 7.44772 5 8C5 8.55229 5.44772 9 6 9Z"}},{tag:"path",attrs:{d:"M7 12C7 12.5523 6.55228 13 6 13C5.44772 13 5 12.5523 5 12C5 11.4477 5.44772 11 6 11C6.55228 11 7 11.4477 7 12Z"}},{tag:"path",attrs:{d:"M10 5C10.5523 5 11 4.55228 11 4C11 3.44772 10.5523 3 10 3C9.44771 3 9 3.44772 9 4C9 4.55228 9.44771 5 10 5Z"}},{tag:"path",attrs:{d:"M11 8C11 8.55229 10.5523 9 10 9C9.44771 9 9 8.55229 9 8C9 7.44772 9.44771 7 10 7C10.5523 7 11 7.44772 11 8Z"}},{tag:"path",attrs:{d:"M10 13C10.5523 13 11 12.5523 11 12C11 11.4477 10.5523 11 10 11C9.44771 11 9 11.4477 9 12C9 12.5523 9.44771 13 10 13Z"}}]}]},ue=l.forwardRef(function(e,t){return l.createElement(x,Object.assign({},e,{id:"sequence-icon",ref:t,icon:je}))});ue.displayName="SequenceIcon";function Ae(){const e=h.useDependency(p),t=h.useObservable(e.customSortState$);return!t||!t.location?null:a.jsx($e,{state:t})}function $e({state:e}){const t=h.useDependency(E.SheetsSortService),n=h.useDependency(i.LocaleService),r=h.useDependency(p),[o,s]=l.useState(!1),[c,g]=l.useState(0),v=l.useRef(null),{range:m,unitId:b,subUnitId:I}=e.location,k=r.getTitles(o),[y,P]=l.useState([{type:E.SortType.ASC,colIndex:m.startColumn}]),G=l.useCallback((C,w)=>{const D=[...y];w===null?D.splice(C,1):D[C]=w,P(D)},[y]),S=l.useCallback(i.throttle(()=>{const C=[...y],w=Be(m,y);w!==null&&(C.push({type:E.SortType.ASC,colIndex:w}),P(C))},200),[y,m]),ee=l.useCallback((C,w)=>{t.applySort({range:m,orderRules:C,hasTitle:w}),r.closeCustomSortPanel()},[t,r,m]),ht=l.useCallback(()=>{r.closeCustomSortPanel()},[r]),gt=l.useCallback(C=>{s(C),C?r.setSelection(b,I,{...m,startRow:m.startRow+1}):r.setSelection(b,I,m)},[r,m,I,b]);l.useEffect(()=>{v.current&&y.length>5&&(v.current.scrollTop=v.current.scrollHeight)},[y]);const vt=y.length<k.length,Se=y.map(C=>({...C,id:`${C.colIndex}`}));return a.jsxs("div",{children:[a.jsxs("div",{onMouseDown:C=>{C.stopPropagation()},children:[a.jsxs("div",{className:"univer-flex univer-items-center univer-justify-between",children:[a.jsx(f.Checkbox,{checked:o,onChange:C=>gt(!!C),children:n.t("sheets-sort.dialog.first-row-check")}),vt?a.jsxs("div",{className:"univer-flex univer-cursor-pointer univer-select-none univer-items-center univer-text-base",onClick:S,children:[a.jsx(Y,{}),a.jsx("span",{className:"univer-ml-1.5",children:n.t("sheets-sort.dialog.add-condition")})]}):a.jsxs("div",{className:"univer-flex univer-cursor-pointer univer-select-none univer-items-center univer-text-base univer-text-primary-500 disabled:univer-cursor-not-allowed disabled:univer-divide-opacity-30 disabled:univer-text-gray-800",children:[a.jsx(Y,{}),a.jsx("span",{className:"univer-ml-1.5 univer-text-xs",children:n.t("sheets-sort.dialog.add-condition")})]})]}),a.jsx("div",{ref:v,className:f.clsx("univer-max-h-[310px] univer-overflow-y-auto univer-overflow-x-hidden",f.scrollbarClassName),onScroll:C=>{const w=C.currentTarget.scrollTop;g(w)},children:a.jsx(f.DraggableList,{className:"[&_.react-grid-item]:univer-transition-none [&_.react-grid-placeholder]:univer-rounded [&_.react-grid-placeholder]:!univer-bg-gray-200",list:Se,onListChange:P,idKey:"id",draggableHandle:"[data-u-comp=sort-panel-item-handler]",itemRender:C=>a.jsx(Ze,{titles:k,list:Se,item:C,onChange:(w,D)=>G(D,w),scrollPosition:c}),rowHeight:32,margin:[0,12]})})]}),a.jsxs("div",{className:"univer-mt-5 univer-flex univer-justify-end",children:[a.jsx(f.Button,{className:"univer-ml-3",onClick:()=>ht(),children:n.t("sheets-sort.dialog.cancel")}),a.jsx(f.Button,{className:"univer-ml-3",variant:"primary",onClick:()=>ee(y,o),children:n.t("sheets-sort.dialog.confirm")})]})]})}function Ze(e){var G;const{list:t,item:n,titles:r,onChange:o,scrollPosition:s}=e,c=h.useDependency(i.LocaleService),g=r.filter(S=>!t.some(ee=>ee.colIndex===S.index)||S.index===n.colIndex),v=t.findIndex(S=>S.colIndex===n.colIndex),m=l.useCallback(S=>{o({...n,colIndex:S.index},v),I(!1)},[v,n,o]),[b,I]=l.useState(!1),k=S=>{I(S)};l.useEffect(()=>{I(!1)},[s]);const y=t.length>1,P=(G=r.find(S=>S.index===n.colIndex))==null?void 0:G.label;return a.jsxs("div",{className:"univer-grid univer-grid-flow-col univer-grid-cols-2 univer-items-center univer-gap-2",children:[a.jsxs("div",{className:"univer-flex univer-items-center",children:[a.jsx("div",{"data-u-comp":"sort-panel-item-handler",className:"univer-flex univer-cursor-pointer univer-items-center univer-justify-center univer-text-base univer-text-gray-700",children:a.jsx(ue,{})}),a.jsx(f.Dropdown,{overlay:a.jsx("ul",{className:f.clsx("univer-my-0 univer-box-border univer-grid univer-max-h-[310px] univer-w-[var(--radix-popper-anchor-width)] univer-items-center univer-gap-1 univer-overflow-y-auto univer-overflow-x-hidden univer-rounded-lg univer-border univer-bg-white univer-p-1 univer-text-base univer-shadow-lg",f.scrollbarClassName),children:g.map(S=>a.jsxs("li",{onClick:()=>m(S),className:"univer-relative univer-box-border univer-flex univer-h-7 univer-cursor-pointer univer-list-none univer-items-center univer-justify-between univer-rounded univer-px-2 univer-text-sm univer-transition-all hover:univer-bg-gray-100 dark:hover:!univer-bg-gray-700",children:[a.jsx("span",{className:"univer-max-w-[220px] univer-truncate",children:S.label}),a.jsx("span",{children:S.index===n.colIndex&&a.jsx(ie,{})})]},S.index))}),open:b,onOpenChange:k,children:a.jsxs("div",{className:f.clsx("univer-ml-2 univer-flex univer-w-full univer-items-center univer-justify-between univer-overflow-hidden univer-rounded-md univer-py-1.5 univer-text-sm univer-text-gray-900 dark:!univer-text-white"),children:[a.jsx("span",{className:"univer-max-w-[220px] univer-truncate",children:P}),a.jsx(de,{})]})})]}),a.jsxs("div",{className:"univer-flex univer-items-center univer-justify-end univer-gap-2",children:[a.jsxs(f.RadioGroup,{value:n.type,onChange:S=>{o({...n,type:S},v)},children:[a.jsx(f.Radio,{value:E.SortType.ASC,children:c.t("sheets-sort.general.sort-asc")}),a.jsx(f.Radio,{value:E.SortType.DESC,children:c.t("sheets-sort.general.sort-desc")})]}),a.jsx("a",{className:"univer-flex univer-cursor-pointer univer-items-center univer-text-sm univer-transition-colors hover:univer-text-red-500",onClick:()=>o(null,v),children:!y&&a.jsx(ae,{})})]})]})}function Be(e,t){const{startColumn:n,endColumn:r}=e,o=new Set(t.map(s=>s==null?void 0:s.colIndex));for(let s=n;s<=r;s++)if(!o.has(s))return s;return null}function Fe(e){const{range:t,colIndex:n,onClose:r}=e,o=h.useDependency(p),s=h.useDependency(i.IUniverInstanceService),c=h.useDependency(i.LocaleService),g=l.useCallback(v=>{const{unitId:m,subUnitId:b}=u.getSheetCommandTarget(s)||{};if(t&&m&&b){const I={...t,startRow:t.startRow+1};o.triggerSortDirectly(v,!1,{unitId:m,subUnitId:b,range:I,colIndex:n})}else throw new Error(`Cannot find the target to sort. unitId: ${m}, subUnitId: ${b}, range: ${t}, colIndex: ${n}`);r()},[t,n,o,s,r]);return a.jsxs(f.ButtonGroup,{className:"univer-mb-3 univer-w-full univer-grid-cols-2",children:[a.jsxs(f.Button,{onClick:()=>g(!0),children:[a.jsx(q,{}),c.t("sheets-sort.general.sort-asc")]}),a.jsxs(f.Button,{onClick:()=>g(!1),children:[a.jsx(z,{}),c.t("sheets-sort.general.sort-desc")]})]})}const he="sheet.menu.sheets-sort",ge="sheet.menu.sheets-sort-ctx",O="AscendingIcon",X="ExpandAscendingIcon",K="DescendingIcon",J="ExpandDescendingIcon",Q="CustomSortIcon";function We(e){return{id:he,type:h.MenuItemType.SUBITEMS,icon:O,tooltip:"sheets-sort.general.sort",hidden$:h.getMenuHiddenObservable(e,i.UniverInstanceType.UNIVER_SHEET),disabled$:T.getCurrentRangeDisable$(e,{workbookTypes:[u.WorkbookEditablePermission],worksheetTypes:[u.WorksheetSortPermission,u.WorksheetEditPermission],rangeTypes:[u.RangeProtectionPermissionEditPoint]})}}function Ve(e){return{id:L.id,icon:O,title:"sheets-sort.general.sort-asc-cur",type:h.MenuItemType.BUTTON,hidden$:T.getCurrentExclusiveRangeInterest$(e)}}function Ge(e){return{id:U.id,title:"sheets-sort.general.sort-asc-ext",icon:X,type:h.MenuItemType.BUTTON}}function qe(e){return{id:H.id,title:"sheets-sort.general.sort-desc-cur",icon:K,type:h.MenuItemType.BUTTON}}function ze(e){return{id:j.id,title:"sheets-sort.general.sort-desc-ext",icon:J,type:h.MenuItemType.BUTTON}}function Ye(e){return{id:A.id,title:"sheets-sort.general.sort-custom",type:h.MenuItemType.BUTTON,icon:Q}}function Xe(e){return{id:ge,title:"sheets-sort.general.sort",type:h.MenuItemType.SUBITEMS,icon:O,hidden$:h.getMenuHiddenObservable(e,i.UniverInstanceType.UNIVER_SHEET),disabled$:T.getCurrentRangeDisable$(e,{workbookTypes:[u.WorkbookEditablePermission],worksheetTypes:[u.WorksheetSortPermission,u.WorksheetEditPermission],rangeTypes:[u.RangeProtectionPermissionEditPoint]})}}function Ke(e){return{id:$.id,title:"sheets-sort.general.sort-asc-cur",type:h.MenuItemType.BUTTON,icon:O,disabled$:T.getCurrentRangeDisable$(e,{workbookTypes:[u.WorkbookEditablePermission],worksheetTypes:[u.WorksheetSortPermission,u.WorksheetEditPermission],rangeTypes:[u.RangeProtectionPermissionEditPoint]})}}function Je(e){return{id:Z.id,title:"sheets-sort.general.sort-asc-ext",type:h.MenuItemType.BUTTON,icon:X,disabled$:T.getCurrentRangeDisable$(e,{workbookTypes:[u.WorkbookEditablePermission],worksheetTypes:[u.WorksheetSortPermission,u.WorksheetEditPermission],rangeTypes:[u.RangeProtectionPermissionEditPoint]})}}function Qe(e){return{id:B.id,title:"sheets-sort.general.sort-desc-cur",type:h.MenuItemType.BUTTON,icon:K,disabled$:T.getCurrentRangeDisable$(e,{workbookTypes:[u.WorkbookEditablePermission],worksheetTypes:[u.WorksheetSortPermission,u.WorksheetEditPermission],rangeTypes:[u.RangeProtectionPermissionEditPoint]})}}function et(e){return{id:F.id,title:"sheets-sort.general.sort-desc-ext",type:h.MenuItemType.BUTTON,icon:J,disabled$:T.getCurrentRangeDisable$(e,{workbookTypes:[u.WorkbookEditablePermission],worksheetTypes:[u.WorksheetSortPermission,u.WorksheetEditPermission],rangeTypes:[u.RangeProtectionPermissionEditPoint]})}}function tt(e){return{id:W.id,title:"sheets-sort.general.sort-custom",type:h.MenuItemType.BUTTON,icon:Q,disabled$:T.getCurrentRangeDisable$(e,{workbookTypes:[u.WorkbookEditablePermission],worksheetTypes:[u.WorksheetSortPermission,u.WorksheetEditPermission],rangeTypes:[u.RangeProtectionPermissionEditPoint]})}}const rt={[h.RibbonDataGroup.ORGANIZATION]:{[he]:{order:3,menuItemFactory:We,[L.id]:{order:0,menuItemFactory:Ve},[U.id]:{order:1,menuItemFactory:Ge},[H.id]:{order:2,menuItemFactory:qe},[j.id]:{order:3,menuItemFactory:ze},[A.id]:{order:4,menuItemFactory:Ye}}},[h.ContextMenuPosition.MAIN_AREA]:{[h.ContextMenuGroup.DATA]:{[ge]:{order:0,menuItemFactory:Xe,[$.id]:{order:0,menuItemFactory:Ke},[Z.id]:{order:1,menuItemFactory:Je},[B.id]:{order:2,menuItemFactory:Qe},[F.id]:{order:3,menuItemFactory:et},[W.id]:{order:4,menuItemFactory:tt}}}}};var nt=Object.getOwnPropertyDescriptor,ot=(e,t,n,r)=>{for(var o=r>1?void 0:r?nt(t,n):t,s=e.length-1,c;s>=0;s--)(c=e[s])&&(o=c(o)||o);return o},M=(e,t)=>(n,r)=>t(n,r,e);const ve="custom-sort-dialog",Ce=560,it=128;let V=class extends i.RxDisposable{constructor(e,t,n,r,o,s,c,g,v,m){super(),this._commandService=e,this._menuManagerService=t,this._dialogService=n,this._layoutService=r,this._uiPartsService=o,this._sheetRenderService=s,this._localeService=c,this._sheetsSortUIService=g,this._injector=v,this._componentManager=m,this._initCommands(),this._initMenu(),this._initUI()}_initMenu(){this._menuManagerService.mergeMenu(rt)}_initCommands(){[L,U,H,j,A,$,Z,B,F,W].forEach(e=>this.disposeWithMe(this._commandService.registerCommand(e))),this.disposeWithMe(this._sheetRenderService.registerSkeletonChangingMutations(E.SortRangeCommand.id))}_initUI(){this.disposeWithMe(this._uiPartsService.registerComponent(T.SheetsUIPart.FILTER_PANEL_EMBED_POINT,()=>h.connectInjector(Fe,this._injector))),[["CustomSortPanel",Ae],[O,q],[X,ce],[K,z],[J,le],[Q,se]].forEach(([e,t])=>{this.disposeWithMe(this._componentManager.register(e,t))}),this._sheetsSortUIService.customSortState$.pipe(re.takeUntil(this.dispose$)).subscribe(e=>{e&&e.show&&e.location?this._openCustomSortPanel(e.location):e&&!(e!=null&&e.show)&&this._closePanel()})}_openCustomSortPanel(e){this._dialogService.open({id:ve,draggable:!0,width:Ce,title:{title:`${this._localeService.t("sheets-sort.general.sort-custom")}: ${pe.serializeRange(e.range)}`},children:{label:"CustomSortPanel"},destroyOnClose:!0,defaultPosition:st(),preservePositionOnDestroy:!1,onClose:()=>this._closePanel(),mask:!0})}_closePanel(){this._dialogService.close(ve),queueMicrotask(()=>this._layoutService.focus())}};V=ot([M(0,i.ICommandService),M(1,h.IMenuManagerService),M(2,h.IDialogService),M(3,h.ILayoutService),M(4,h.IUIPartsService),M(5,i.Inject(T.SheetsRenderService)),M(6,i.Inject(i.LocaleService)),M(7,i.Inject(p)),M(8,i.Inject(i.Injector)),M(9,i.Inject(h.ComponentManager))],V);function st(){return{x:(window.innerWidth-Ce)/2,y:it}}var at=Object.defineProperty,ct=Object.getOwnPropertyDescriptor,lt=(e,t,n)=>t in e?at(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,dt=(e,t,n,r)=>{for(var o=r>1?void 0:r?ct(t,n):t,s=e.length-1,c;s>=0;s--)(c=e[s])&&(o=c(o)||o);return o},me=(e,t)=>(n,r)=>t(n,r,e),fe=(e,t,n)=>lt(e,typeof t!="symbol"?t+"":t,n);const ut="SHEET_SORT_UI_PLUGIN";d.UniverSheetsSortUIPlugin=class extends i.Plugin{constructor(t=ne,n,r){super(),this._config=t,this._injector=n,this._configService=r;const{...o}=i.merge({},ne,this._config);this._configService.setConfig(we,o)}onStarting(){[[p],[V]].forEach(t=>this._injector.add(t))}onRendered(){this._injector.get(V)}},fe(d.UniverSheetsSortUIPlugin,"type",i.UniverInstanceType.UNIVER_SHEET),fe(d.UniverSheetsSortUIPlugin,"pluginName",ut),d.UniverSheetsSortUIPlugin=dt([i.DependentOn(E.UniverSheetsSortPlugin),me(1,i.Inject(i.Injector)),me(2,i.IConfigService)],d.UniverSheetsSortUIPlugin),d.SortRangeAscCommand=L,d.SortRangeAscExtCommand=U,d.SortRangeAscExtInCtxMenuCommand=Z,d.SortRangeAscInCtxMenuCommand=$,d.SortRangeCustomCommand=A,d.SortRangeCustomInCtxMenuCommand=W,d.SortRangeDescCommand=H,d.SortRangeDescExtCommand=j,d.SortRangeDescExtInCtxMenuCommand=F,d.SortRangeDescInCtxMenuCommand=B,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})}));
11
11
 
12
12
 
13
13
  // index
@@ -1,9 +1,9 @@
1
1
  // @univerjs/sheets-sort/locale/ca-ES
2
- (function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsSortCaES=t())})(this,function(){"use strict";return{sheetsSort:{title:"Ordena",toolbar:{"sort-asc":"ordre ascendent","sort-desc":"ordre descendent","sort-custom":"ordre personalitzat"},"context-menu":{"sort-asc":"ordre ascendent","sort-desc":"ordre descendent","sort-custom":"ordre personalitzat"}}}});
2
+ (function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsSortCaES=t())})(this,(function(){"use strict";return{sheetsSort:{title:"Ordena",toolbar:{"sort-asc":"ordre ascendent","sort-desc":"ordre descendent","sort-custom":"ordre personalitzat"},"context-menu":{"sort-asc":"ordre ascendent","sort-desc":"ordre descendent","sort-custom":"ordre personalitzat"}}}}));
3
3
 
4
4
 
5
5
  // @univerjs/sheets-sort-ui/locale/ca-ES
6
- (function(e,n){typeof exports=="object"&&typeof module<"u"?module.exports=n():typeof define=="function"&&define.amd?define(n):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsSortUiCaES=n())})(this,function(){"use strict";return{"sheets-sort":{general:{sort:"Ordena","sort-asc":"Ascendent","sort-desc":"Descendent","sort-custom":"Ordre personalitzat","sort-asc-ext":"Expandeix ascendent","sort-desc-ext":"Expandeix descendent","sort-asc-cur":"Ascendent","sort-desc-cur":"Descendent"},error:{"merge-size":"L'interval seleccionat conté cel·les combinades de diferents mides, que no es poden ordenar.",empty:"L'interval seleccionat no té contingut i no es pot ordenar.",single:"L'interval seleccionat només té una fila i no es pot ordenar.","formula-array":"L'interval seleccionat té fórmules de matriu i no es pot ordenar."},dialog:{"sort-reminder":"Recordatori d'ordenació","sort-reminder-desc":"Estendre l'interval d'ordenació o mantenir-lo?","sort-reminder-ext":"Estendre l'interval d'ordenació","sort-reminder-no":"Mantenir l'interval d'ordenació","first-row-check":"La primera fila no participa en l'ordenació","add-condition":"Afegeix condició",cancel:"Cancel·lar",confirm:"Confirmar"}}}});
6
+ (function(e,n){typeof exports=="object"&&typeof module<"u"?module.exports=n():typeof define=="function"&&define.amd?define(n):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsSortUiCaES=n())})(this,(function(){"use strict";return{"sheets-sort":{general:{sort:"Ordena","sort-asc":"Ascendent","sort-desc":"Descendent","sort-custom":"Ordre personalitzat","sort-asc-ext":"Expandeix ascendent","sort-desc-ext":"Expandeix descendent","sort-asc-cur":"Ascendent","sort-desc-cur":"Descendent"},error:{"merge-size":"L'interval seleccionat conté cel·les combinades de diferents mides, que no es poden ordenar.",empty:"L'interval seleccionat no té contingut i no es pot ordenar.",single:"L'interval seleccionat només té una fila i no es pot ordenar.","formula-array":"L'interval seleccionat té fórmules de matriu i no es pot ordenar."},dialog:{"sort-reminder":"Recordatori d'ordenació","sort-reminder-desc":"Estendre l'interval d'ordenació o mantenir-lo?","sort-reminder-ext":"Estendre l'interval d'ordenació","sort-reminder-no":"Mantenir l'interval d'ordenació","first-row-check":"La primera fila no participa en l'ordenació","add-condition":"Afegeix condició",cancel:"Cancel·lar",confirm:"Confirmar"}}}}));
7
7
 
8
8
 
9
9
  // locale/ca-ES
@@ -1,9 +1,9 @@
1
1
  // @univerjs/sheets-sort/locale/en-US
2
- (function(e,o){typeof exports=="object"&&typeof module<"u"?module.exports=o():typeof define=="function"&&define.amd?define(o):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsSortEnUS=o())})(this,function(){"use strict";return{sheetsSort:{title:"Sort",toolbar:{"sort-asc":"ascending order","sort-desc":"descending order","sort-custom":"custom order"},"context-menu":{"sort-asc":"ascending order","sort-desc":"descending order","sort-custom":"custom order"}}}});
2
+ (function(e,o){typeof exports=="object"&&typeof module<"u"?module.exports=o():typeof define=="function"&&define.amd?define(o):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsSortEnUS=o())})(this,(function(){"use strict";return{sheetsSort:{title:"Sort",toolbar:{"sort-asc":"ascending order","sort-desc":"descending order","sort-custom":"custom order"},"context-menu":{"sort-asc":"ascending order","sort-desc":"descending order","sort-custom":"custom order"}}}}));
3
3
 
4
4
 
5
5
  // @univerjs/sheets-sort-ui/locale/en-US
6
- (function(e,n){typeof exports=="object"&&typeof module<"u"?module.exports=n():typeof define=="function"&&define.amd?define(n):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsSortUiEnUS=n())})(this,function(){"use strict";return{"sheets-sort":{general:{sort:"Sort","sort-asc":"Ascending","sort-desc":"Descending","sort-custom":"Custom Sort","sort-asc-ext":"Expand Ascending","sort-desc-ext":"Expand Descending","sort-asc-cur":"Ascending","sort-desc-cur":"Descending"},error:{"merge-size":"The selected range contains merged cells of different sizes, which cannot be sorted.",empty:"The selected range has no content and cannot be sorted.",single:"The selected range has only one row and cannot be sorted.","formula-array":"The selected range has array formulas and cannot be sorted."},dialog:{"sort-reminder":"Sort Reminder","sort-reminder-desc":"Extend range sorting or keep range sorting?","sort-reminder-ext":"Extend range sorting","sort-reminder-no":"Keep range sorting","first-row-check":"First row does not participate in sorting","add-condition":"Add condition",cancel:"Cancel",confirm:"Confirm"}}}});
6
+ (function(e,n){typeof exports=="object"&&typeof module<"u"?module.exports=n():typeof define=="function"&&define.amd?define(n):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsSortUiEnUS=n())})(this,(function(){"use strict";return{"sheets-sort":{general:{sort:"Sort","sort-asc":"Ascending","sort-desc":"Descending","sort-custom":"Custom Sort","sort-asc-ext":"Expand Ascending","sort-desc-ext":"Expand Descending","sort-asc-cur":"Ascending","sort-desc-cur":"Descending"},error:{"merge-size":"The selected range contains merged cells of different sizes, which cannot be sorted.",empty:"The selected range has no content and cannot be sorted.",single:"The selected range has only one row and cannot be sorted.","formula-array":"The selected range has array formulas and cannot be sorted."},dialog:{"sort-reminder":"Sort Reminder","sort-reminder-desc":"Extend range sorting or keep range sorting?","sort-reminder-ext":"Extend range sorting","sort-reminder-no":"Keep range sorting","first-row-check":"First row does not participate in sorting","add-condition":"Add condition",cancel:"Cancel",confirm:"Confirm"}}}}));
7
7
 
8
8
 
9
9
  // locale/en-US
@@ -1,9 +1,9 @@
1
1
  // @univerjs/sheets-sort/locale/es-ES
2
- (function(e,o){typeof exports=="object"&&typeof module<"u"?module.exports=o():typeof define=="function"&&define.amd?define(o):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsSortEsES=o())})(this,function(){"use strict";return{sheetsSort:{title:"Ordenar",toolbar:{"sort-asc":"orden ascendente","sort-desc":"orden descendente","sort-custom":"orden personalizado"},"context-menu":{"sort-asc":"orden ascendente","sort-desc":"orden descendente","sort-custom":"orden personalizado"}}}});
2
+ (function(e,o){typeof exports=="object"&&typeof module<"u"?module.exports=o():typeof define=="function"&&define.amd?define(o):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsSortEsES=o())})(this,(function(){"use strict";return{sheetsSort:{title:"Ordenar",toolbar:{"sort-asc":"orden ascendente","sort-desc":"orden descendente","sort-custom":"orden personalizado"},"context-menu":{"sort-asc":"orden ascendente","sort-desc":"orden descendente","sort-custom":"orden personalizado"}}}}));
3
3
 
4
4
 
5
5
  // @univerjs/sheets-sort-ui/locale/es-ES
6
- (function(e,n){typeof exports=="object"&&typeof module<"u"?module.exports=n():typeof define=="function"&&define.amd?define(n):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsSortUiEsES=n())})(this,function(){"use strict";return{"sheets-sort":{general:{sort:"Ordenar","sort-asc":"Ascendente","sort-desc":"Descendente","sort-custom":"Orden personalizado","sort-asc-ext":"Expandir ascendente","sort-desc-ext":"Expandir descendente","sort-asc-cur":"Ascendente","sort-desc-cur":"Descendente"},error:{"merge-size":"El rango seleccionado contiene celdas combinadas de diferentes tamaños, que no se pueden ordenar.",empty:"El rango seleccionado no tiene contenido y no se puede ordenar.",single:"El rango seleccionado solo tiene una fila y no se puede ordenar.","formula-array":"El rango seleccionado tiene fórmulas de matriz y no se puede ordenar."},dialog:{"sort-reminder":"Recordatorio de ordenación","sort-reminder-desc":"¿Extender el rango de ordenación o mantener el rango?","sort-reminder-ext":"Extender el rango de ordenación","sort-reminder-no":"Mantener el rango de ordenación","first-row-check":"La primera fila no participa en la ordenación","add-condition":"Agregar condición",cancel:"Cancelar",confirm:"Confirmar"}}}});
6
+ (function(e,n){typeof exports=="object"&&typeof module<"u"?module.exports=n():typeof define=="function"&&define.amd?define(n):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsSortUiEsES=n())})(this,(function(){"use strict";return{"sheets-sort":{general:{sort:"Ordenar","sort-asc":"Ascendente","sort-desc":"Descendente","sort-custom":"Orden personalizado","sort-asc-ext":"Expandir ascendente","sort-desc-ext":"Expandir descendente","sort-asc-cur":"Ascendente","sort-desc-cur":"Descendente"},error:{"merge-size":"El rango seleccionado contiene celdas combinadas de diferentes tamaños, que no se pueden ordenar.",empty:"El rango seleccionado no tiene contenido y no se puede ordenar.",single:"El rango seleccionado solo tiene una fila y no se puede ordenar.","formula-array":"El rango seleccionado tiene fórmulas de matriz y no se puede ordenar."},dialog:{"sort-reminder":"Recordatorio de ordenación","sort-reminder-desc":"¿Extender el rango de ordenación o mantener el rango?","sort-reminder-ext":"Extender el rango de ordenación","sort-reminder-no":"Mantener el rango de ordenación","first-row-check":"La primera fila no participa en la ordenación","add-condition":"Agregar condición",cancel:"Cancelar",confirm:"Confirmar"}}}}));
7
7
 
8
8
 
9
9
  // locale/es-ES
@@ -1,9 +1,9 @@
1
1
  // @univerjs/sheets-sort/locale/fa-IR
2
- (function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsSortFaIR=t())})(this,function(){"use strict";return{sheetsSort:{title:"مرتب‌سازی",toolbar:{"sort-asc":"ترتیب صعودی","sort-desc":"ترتیب نزولی","sort-custom":"ترتیب سفارشی"},"context-menu":{"sort-asc":"ترتیب صعودی","sort-desc":"ترتیب نزولی","sort-custom":"ترتیب سفارشی"}}}});
2
+ (function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsSortFaIR=t())})(this,(function(){"use strict";return{sheetsSort:{title:"مرتب‌سازی",toolbar:{"sort-asc":"ترتیب صعودی","sort-desc":"ترتیب نزولی","sort-custom":"ترتیب سفارشی"},"context-menu":{"sort-asc":"ترتیب صعودی","sort-desc":"ترتیب نزولی","sort-custom":"ترتیب سفارشی"}}}}));
3
3
 
4
4
 
5
5
  // @univerjs/sheets-sort-ui/locale/fa-IR
6
- (function(e,r){typeof exports=="object"&&typeof module<"u"?module.exports=r():typeof define=="function"&&define.amd?define(r):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsSortUiFaIR=r())})(this,function(){"use strict";return{"sheets-sort":{general:{sort:"مرتب‌سازی","sort-asc":"صعودی","sort-desc":"نزولی","sort-custom":"مرتب‌سازی سفارشی","sort-asc-ext":"گسترش صعودی","sort-desc-ext":"گسترش نزولی","sort-asc-cur":"صعودی","sort-desc-cur":"نزولی"},error:{"merge-size":"محدوده انتخاب شده حاوی سلول‌های ادغام شده با اندازه‌های مختلف است که نمی‌توان مرتب کرد.",empty:"محدوده انتخاب شده هیچ محتوایی ندارد و نمی‌توان مرتب کرد.",single:"محدوده انتخاب شده فقط یک ردیف دارد و نمی‌توان مرتب کرد.","formula-array":"محدوده انتخاب شده دارای فرمول‌های آرایه‌ای است و نمی‌توان مرتب کرد."},dialog:{"sort-reminder":"یادآوری مرتب‌سازی","sort-reminder-desc":"گسترش مرتب‌سازی محدوده یا حفظ مرتب‌سازی محدوده؟","sort-reminder-ext":"گسترش مرتب‌سازی محدوده","sort-reminder-no":"حفظ مرتب‌سازی محدوده","first-row-check":"ردیف اول در مرتب‌سازی شرکت نمی‌کند","add-condition":"افزودن شرط",cancel:"انصراف",confirm:"تایید"}}}});
6
+ (function(e,r){typeof exports=="object"&&typeof module<"u"?module.exports=r():typeof define=="function"&&define.amd?define(r):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsSortUiFaIR=r())})(this,(function(){"use strict";return{"sheets-sort":{general:{sort:"مرتب‌سازی","sort-asc":"صعودی","sort-desc":"نزولی","sort-custom":"مرتب‌سازی سفارشی","sort-asc-ext":"گسترش صعودی","sort-desc-ext":"گسترش نزولی","sort-asc-cur":"صعودی","sort-desc-cur":"نزولی"},error:{"merge-size":"محدوده انتخاب شده حاوی سلول‌های ادغام شده با اندازه‌های مختلف است که نمی‌توان مرتب کرد.",empty:"محدوده انتخاب شده هیچ محتوایی ندارد و نمی‌توان مرتب کرد.",single:"محدوده انتخاب شده فقط یک ردیف دارد و نمی‌توان مرتب کرد.","formula-array":"محدوده انتخاب شده دارای فرمول‌های آرایه‌ای است و نمی‌توان مرتب کرد."},dialog:{"sort-reminder":"یادآوری مرتب‌سازی","sort-reminder-desc":"گسترش مرتب‌سازی محدوده یا حفظ مرتب‌سازی محدوده؟","sort-reminder-ext":"گسترش مرتب‌سازی محدوده","sort-reminder-no":"حفظ مرتب‌سازی محدوده","first-row-check":"ردیف اول در مرتب‌سازی شرکت نمی‌کند","add-condition":"افزودن شرط",cancel:"انصراف",confirm:"تایید"}}}}));
7
7
 
8
8
 
9
9
  // locale/fa-IR
@@ -1,9 +1,9 @@
1
1
  // @univerjs/sheets-sort/locale/fr-FR
2
- (function(e,o){typeof exports=="object"&&typeof module<"u"?module.exports=o():typeof define=="function"&&define.amd?define(o):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsSortFrFR=o())})(this,function(){"use strict";return{sheetsSort:{title:"Trier",toolbar:{"sort-asc":"ordre croissant","sort-desc":"ordre décroissant","sort-custom":"ordre personnalisé"},"context-menu":{"sort-asc":"ordre croissant","sort-desc":"ordre décroissant","sort-custom":"ordre personnalisé"}}}});
2
+ (function(e,o){typeof exports=="object"&&typeof module<"u"?module.exports=o():typeof define=="function"&&define.amd?define(o):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsSortFrFR=o())})(this,(function(){"use strict";return{sheetsSort:{title:"Trier",toolbar:{"sort-asc":"ordre croissant","sort-desc":"ordre décroissant","sort-custom":"ordre personnalisé"},"context-menu":{"sort-asc":"ordre croissant","sort-desc":"ordre décroissant","sort-custom":"ordre personnalisé"}}}}));
3
3
 
4
4
 
5
5
  // @univerjs/sheets-sort-ui/locale/fr-FR
6
- (function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsSortUiFrFR=t())})(this,function(){"use strict";return{"sheets-sort":{general:{sort:"Trier","sort-asc":"Croissant","sort-desc":"Décroissant","sort-custom":"Tri personnalisé","sort-asc-ext":"Étendre croissant","sort-desc-ext":"Étendre décroissant","sort-asc-cur":"Croissant","sort-desc-cur":"Décroissant"},error:{"merge-size":"La plage sélectionnée contient des cellules fusionnées de tailles différentes, qui ne peuvent pas être triées.",empty:"La plage sélectionnée ne contient aucun contenu et ne peut pas être triée.",single:"La plage sélectionnée ne contient qu'une seule ligne et ne peut pas être triée.","formula-array":"La plage sélectionnée contient des formules matricielles et ne peut pas être triée."},dialog:{"sort-reminder":"Rappel de tri","sort-reminder-desc":"Étendre le tri de la plage ou conserver le tri de la plage?","sort-reminder-ext":"Étendre le tri de la plage","sort-reminder-no":"Conserver le tri de la plage","first-row-check":"La première ligne ne participe pas au tri","add-condition":"Ajouter une condition",cancel:"Annuler",confirm:"Confirmer"}}}});
6
+ (function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsSortUiFrFR=t())})(this,(function(){"use strict";return{"sheets-sort":{general:{sort:"Trier","sort-asc":"Croissant","sort-desc":"Décroissant","sort-custom":"Tri personnalisé","sort-asc-ext":"Étendre croissant","sort-desc-ext":"Étendre décroissant","sort-asc-cur":"Croissant","sort-desc-cur":"Décroissant"},error:{"merge-size":"La plage sélectionnée contient des cellules fusionnées de tailles différentes, qui ne peuvent pas être triées.",empty:"La plage sélectionnée ne contient aucun contenu et ne peut pas être triée.",single:"La plage sélectionnée ne contient qu'une seule ligne et ne peut pas être triée.","formula-array":"La plage sélectionnée contient des formules matricielles et ne peut pas être triée."},dialog:{"sort-reminder":"Rappel de tri","sort-reminder-desc":"Étendre le tri de la plage ou conserver le tri de la plage?","sort-reminder-ext":"Étendre le tri de la plage","sort-reminder-no":"Conserver le tri de la plage","first-row-check":"La première ligne ne participe pas au tri","add-condition":"Ajouter une condition",cancel:"Annuler",confirm:"Confirmer"}}}}));
7
7
 
8
8
 
9
9
  // locale/fr-FR
@@ -1,9 +1,9 @@
1
1
  // @univerjs/sheets-sort/locale/ko-KR
2
- (function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsSortKoKR=t())})(this,function(){"use strict";return{sheetsSort:{title:"정렬",toolbar:{"sort-asc":"오름차순","sort-desc":"내림차순","sort-custom":"사용자 정의 순서"},"context-menu":{"sort-asc":"오름차순","sort-desc":"내림차순","sort-custom":"사용자 정의 순서"}}}});
2
+ (function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsSortKoKR=t())})(this,(function(){"use strict";return{sheetsSort:{title:"정렬",toolbar:{"sort-asc":"오름차순","sort-desc":"내림차순","sort-custom":"사용자 정의 순서"},"context-menu":{"sort-asc":"오름차순","sort-desc":"내림차순","sort-custom":"사용자 정의 순서"}}}}));
3
3
 
4
4
 
5
5
  // @univerjs/sheets-sort-ui/locale/ko-KR
6
- (function(e,r){typeof exports=="object"&&typeof module<"u"?module.exports=r():typeof define=="function"&&define.amd?define(r):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsSortUiKoKR=r())})(this,function(){"use strict";return{"sheets-sort":{general:{sort:"정렬","sort-asc":"오름차순","sort-desc":"내림차순","sort-custom":"사용자 정의 순서","sort-asc-ext":"오름차순 확장","sort-desc-ext":"내림차순 확장","sort-asc-cur":"오름차순","sort-desc-cur":"내림차순"},error:{"merge-size":"선택한 범위에 서로 다른 크기의 병합 셀이 있어 정렬할 수 없습니다.",empty:"선택한 범위에 내용이 없어 정렬할 수 없습니다.",single:"선택한 범위에 한 행만 있어 정렬할 수 없습니다.","formula-array":"선택한 범위에 배열 수식이 있어 정렬할 수 없습니다."},dialog:{"sort-reminder":"정렬 알림","sort-reminder-desc":"범위 정렬 확장 또는 범위 정렬 유지?","sort-reminder-ext":"범위 정렬 확장","sort-reminder-no":"범위 정렬 유지","first-row-check":"첫 번째 행은 정렬에 참여하지 않습니다","add-condition":"조건 추가",cancel:"취소",confirm:"확인"}}}});
6
+ (function(e,r){typeof exports=="object"&&typeof module<"u"?module.exports=r():typeof define=="function"&&define.amd?define(r):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsSortUiKoKR=r())})(this,(function(){"use strict";return{"sheets-sort":{general:{sort:"정렬","sort-asc":"오름차순","sort-desc":"내림차순","sort-custom":"사용자 정의 순서","sort-asc-ext":"오름차순 확장","sort-desc-ext":"내림차순 확장","sort-asc-cur":"오름차순","sort-desc-cur":"내림차순"},error:{"merge-size":"선택한 범위에 서로 다른 크기의 병합 셀이 있어 정렬할 수 없습니다.",empty:"선택한 범위에 내용이 없어 정렬할 수 없습니다.",single:"선택한 범위에 한 행만 있어 정렬할 수 없습니다.","formula-array":"선택한 범위에 배열 수식이 있어 정렬할 수 없습니다."},dialog:{"sort-reminder":"정렬 알림","sort-reminder-desc":"범위 정렬 확장 또는 범위 정렬 유지?","sort-reminder-ext":"범위 정렬 확장","sort-reminder-no":"범위 정렬 유지","first-row-check":"첫 번째 행은 정렬에 참여하지 않습니다","add-condition":"조건 추가",cancel:"취소",confirm:"확인"}}}}));
7
7
 
8
8
 
9
9
  // locale/ko-KR
@@ -1,9 +1,9 @@
1
1
  // @univerjs/sheets-sort/locale/ru-RU
2
- (function(e,o){typeof exports=="object"&&typeof module<"u"?module.exports=o():typeof define=="function"&&define.amd?define(o):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsSortRuRU=o())})(this,function(){"use strict";return{sheetsSort:{title:"Sort",toolbar:{"sort-asc":"ascending order","sort-desc":"descending order","sort-custom":"custom order"},"context-menu":{"sort-asc":"ascending order","sort-desc":"descending order","sort-custom":"custom order"}}}});
2
+ (function(e,o){typeof exports=="object"&&typeof module<"u"?module.exports=o():typeof define=="function"&&define.amd?define(o):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsSortRuRU=o())})(this,(function(){"use strict";return{sheetsSort:{title:"Sort",toolbar:{"sort-asc":"ascending order","sort-desc":"descending order","sort-custom":"custom order"},"context-menu":{"sort-asc":"ascending order","sort-desc":"descending order","sort-custom":"custom order"}}}}));
3
3
 
4
4
 
5
5
  // @univerjs/sheets-sort-ui/locale/ru-RU
6
- (function(e,r){typeof exports=="object"&&typeof module<"u"?module.exports=r():typeof define=="function"&&define.amd?define(r):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsSortUiRuRU=r())})(this,function(){"use strict";return{"sheets-sort":{general:{sort:"Сортировка","sort-asc":"По возрастанию","sort-desc":"По убыванию","sort-custom":"Пользовательская сортировка","sort-asc-ext":"Расширенная сортировка по возрастанию","sort-desc-ext":"Расширенная сортировка по убыванию","sort-asc-cur":"По возрастанию","sort-desc-cur":"По убыванию"},error:{"merge-size":"Выбранный диапазон содержит объединенные ячейки разного размера, которые нельзя отсортировать.",empty:"Выбранный диапазон не содержит данных и не может быть отсортирован.",single:"Выбранный диапазон содержит только одну строку и не может быть отсортирован.","formula-array":"Выбранный диапазон содержит массив формул и не может быть отсортирован."},dialog:{"sort-reminder":"Напоминание о сортировке","sort-reminder-desc":"Расширить сортировку диапазона или оставить сортировку диапазона?","sort-reminder-ext":"Расширить сортировку диапазона","sort-reminder-no":"Оставить сортировку диапазона","first-row-check":"Первая строка контента не участвует в сортировке","add-condition":"Добавить условие",cancel:"Отмена",confirm:"Подтвердить"}}}});
6
+ (function(e,r){typeof exports=="object"&&typeof module<"u"?module.exports=r():typeof define=="function"&&define.amd?define(r):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsSortUiRuRU=r())})(this,(function(){"use strict";return{"sheets-sort":{general:{sort:"Сортировка","sort-asc":"По возрастанию","sort-desc":"По убыванию","sort-custom":"Пользовательская сортировка","sort-asc-ext":"Расширенная сортировка по возрастанию","sort-desc-ext":"Расширенная сортировка по убыванию","sort-asc-cur":"По возрастанию","sort-desc-cur":"По убыванию"},error:{"merge-size":"Выбранный диапазон содержит объединенные ячейки разного размера, которые нельзя отсортировать.",empty:"Выбранный диапазон не содержит данных и не может быть отсортирован.",single:"Выбранный диапазон содержит только одну строку и не может быть отсортирован.","formula-array":"Выбранный диапазон содержит массив формул и не может быть отсортирован."},dialog:{"sort-reminder":"Напоминание о сортировке","sort-reminder-desc":"Расширить сортировку диапазона или оставить сортировку диапазона?","sort-reminder-ext":"Расширить сортировку диапазона","sort-reminder-no":"Оставить сортировку диапазона","first-row-check":"Первая строка контента не участвует в сортировке","add-condition":"Добавить условие",cancel:"Отмена",confirm:"Подтвердить"}}}}));
7
7
 
8
8
 
9
9
  // locale/ru-RU
@@ -1,9 +1,9 @@
1
1
  // @univerjs/sheets-sort/locale/vi-VN
2
- (function(e,o){typeof exports=="object"&&typeof module<"u"?module.exports=o():typeof define=="function"&&define.amd?define(o):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsSortViVN=o())})(this,function(){"use strict";return{sheetsSort:{title:"Sort",toolbar:{"sort-asc":"ascending order","sort-desc":"descending order","sort-custom":"custom order"},"context-menu":{"sort-asc":"ascending order","sort-desc":"descending order","sort-custom":"custom order"}}}});
2
+ (function(e,o){typeof exports=="object"&&typeof module<"u"?module.exports=o():typeof define=="function"&&define.amd?define(o):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsSortViVN=o())})(this,(function(){"use strict";return{sheetsSort:{title:"Sort",toolbar:{"sort-asc":"ascending order","sort-desc":"descending order","sort-custom":"custom order"},"context-menu":{"sort-asc":"ascending order","sort-desc":"descending order","sort-custom":"custom order"}}}}));
3
3
 
4
4
 
5
5
  // @univerjs/sheets-sort-ui/locale/vi-VN
6
- (function(n,c){typeof exports=="object"&&typeof module<"u"?module.exports=c():typeof define=="function"&&define.amd?define(c):(n=typeof globalThis<"u"?globalThis:n||self,n.UniverSheetsSortUiViVN=c())})(this,function(){"use strict";return{"sheets-sort":{general:{sort:"Sắp xếp","sort-asc":"Tăng dần","sort-desc":"Giảm dần","sort-custom":"Tùy chỉnh sắp xếp","sort-asc-ext":"Tăng dần khu vực mở rộng","sort-desc-ext":"Giảm dần khu vực mở rộng","sort-asc-cur":"Tăng dần khu vực hiện tại","sort-desc-cur":"Giảm dần khu vực hiện tại"},error:{"merge-size":"Kích thước của các ô đã hợp nhất trong vùng được chọn không đồng nhất, không thể sắp xếp.",empty:"Vùng được chọn không có nội dung, không thể sắp xếp.",single:"Vùng được chọn chỉ có một hàng, không thể sắp xếp.","formula-array":"Vùng được chọn chứa công thức mảng, không thể sắp xếp."},dialog:{"sort-reminder":"Nhắc nhở sắp xếp","sort-reminder-desc":"Hiện tại chỉ sắp xếp vùng được chọn, có muốn mở rộng phạm vi sắp xếp không?","sort-reminder-ext":"Mở rộng phạm vi sắp xếp","sort-reminder-no":"Giữ nguyên phạm vi sắp xếp được chọn","first-row-check":"Hàng đầu tiên không tham gia sắp xếp","add-condition":"Thêm điều kiện sắp xếp",cancel:"Hủy bỏ",confirm:"Xác nhận"}}}});
6
+ (function(n,c){typeof exports=="object"&&typeof module<"u"?module.exports=c():typeof define=="function"&&define.amd?define(c):(n=typeof globalThis<"u"?globalThis:n||self,n.UniverSheetsSortUiViVN=c())})(this,(function(){"use strict";return{"sheets-sort":{general:{sort:"Sắp xếp","sort-asc":"Tăng dần","sort-desc":"Giảm dần","sort-custom":"Tùy chỉnh sắp xếp","sort-asc-ext":"Tăng dần khu vực mở rộng","sort-desc-ext":"Giảm dần khu vực mở rộng","sort-asc-cur":"Tăng dần khu vực hiện tại","sort-desc-cur":"Giảm dần khu vực hiện tại"},error:{"merge-size":"Kích thước của các ô đã hợp nhất trong vùng được chọn không đồng nhất, không thể sắp xếp.",empty:"Vùng được chọn không có nội dung, không thể sắp xếp.",single:"Vùng được chọn chỉ có một hàng, không thể sắp xếp.","formula-array":"Vùng được chọn chứa công thức mảng, không thể sắp xếp."},dialog:{"sort-reminder":"Nhắc nhở sắp xếp","sort-reminder-desc":"Hiện tại chỉ sắp xếp vùng được chọn, có muốn mở rộng phạm vi sắp xếp không?","sort-reminder-ext":"Mở rộng phạm vi sắp xếp","sort-reminder-no":"Giữ nguyên phạm vi sắp xếp được chọn","first-row-check":"Hàng đầu tiên không tham gia sắp xếp","add-condition":"Thêm điều kiện sắp xếp",cancel:"Hủy bỏ",confirm:"Xác nhận"}}}}));
7
7
 
8
8
 
9
9
  // locale/vi-VN
@@ -1,9 +1,9 @@
1
1
  // @univerjs/sheets-sort/locale/zh-CN
2
- (function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsSortZhCN=t())})(this,function(){"use strict";return{sheetsSort:{title:"排序",toolbar:{"sort-asc":"升序","sort-desc":"降序","sort-custom":"自定义排序"},"context-menu":{"sort-asc":"升序","sort-desc":"降序","sort-custom":"自定义排序"}}}});
2
+ (function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsSortZhCN=t())})(this,(function(){"use strict";return{sheetsSort:{title:"排序",toolbar:{"sort-asc":"升序","sort-desc":"降序","sort-custom":"自定义排序"},"context-menu":{"sort-asc":"升序","sort-desc":"降序","sort-custom":"自定义排序"}}}}));
3
3
 
4
4
 
5
5
  // @univerjs/sheets-sort-ui/locale/zh-CN
6
- (function(e,r){typeof exports=="object"&&typeof module<"u"?module.exports=r():typeof define=="function"&&define.amd?define(r):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsSortUiZhCN=r())})(this,function(){"use strict";return{"sheets-sort":{general:{sort:"排序","sort-asc":"升序","sort-desc":"降序","sort-custom":"自定义排序","sort-asc-ext":"拓展区域升序","sort-desc-ext":"拓展区域降序","sort-asc-cur":"当前区域升序","sort-desc-cur":"当前区域降序"},error:{"merge-size":"所选区域的合并单元格的大小不一致,无法排序。",empty:"所选区域无内容,无法排序。",single:"所选区域仅有一行,无法排序。","formula-array":"所选区域含数组公式,无法排序。"},dialog:{"sort-reminder":"排序提醒","sort-reminder-desc":"当前仅会对选中区域进行排序,是否拓展排序范围?","sort-reminder-ext":"拓展排序范围","sort-reminder-no":"保持所选排序范围","first-row-check":"标题不参与排序","add-condition":"添加排序条件",cancel:"取消",confirm:"确认"}}}});
6
+ (function(e,r){typeof exports=="object"&&typeof module<"u"?module.exports=r():typeof define=="function"&&define.amd?define(r):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsSortUiZhCN=r())})(this,(function(){"use strict";return{"sheets-sort":{general:{sort:"排序","sort-asc":"升序","sort-desc":"降序","sort-custom":"自定义排序","sort-asc-ext":"拓展区域升序","sort-desc-ext":"拓展区域降序","sort-asc-cur":"当前区域升序","sort-desc-cur":"当前区域降序"},error:{"merge-size":"所选区域的合并单元格的大小不一致,无法排序。",empty:"所选区域无内容,无法排序。",single:"所选区域仅有一行,无法排序。","formula-array":"所选区域含数组公式,无法排序。"},dialog:{"sort-reminder":"排序提醒","sort-reminder-desc":"当前仅会对选中区域进行排序,是否拓展排序范围?","sort-reminder-ext":"拓展排序范围","sort-reminder-no":"保持所选排序范围","first-row-check":"标题不参与排序","add-condition":"添加排序条件",cancel:"取消",confirm:"确认"}}}}));
7
7
 
8
8
 
9
9
  // locale/zh-CN
@@ -1,9 +1,9 @@
1
1
  // @univerjs/sheets-sort/locale/zh-TW
2
- (function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsSortZhTW=t())})(this,function(){"use strict";return{sheetsSort:{title:"Sắp xếp",toolbar:{"sort-asc":"Tăng dần","sort-desc":"Giảm dần","sort-custom":"Sắp xếp tùy chỉnh"},"context-menu":{"sort-asc":"Tăng dần","sort-desc":"Giảm dần","sort-custom":"Sắp xếp tùy chỉnh"}}}});
2
+ (function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsSortZhTW=t())})(this,(function(){"use strict";return{sheetsSort:{title:"Sắp xếp",toolbar:{"sort-asc":"Tăng dần","sort-desc":"Giảm dần","sort-custom":"Sắp xếp tùy chỉnh"},"context-menu":{"sort-asc":"Tăng dần","sort-desc":"Giảm dần","sort-custom":"Sắp xếp tùy chỉnh"}}}}));
3
3
 
4
4
 
5
5
  // @univerjs/sheets-sort-ui/locale/zh-TW
6
- (function(e,r){typeof exports=="object"&&typeof module<"u"?module.exports=r():typeof define=="function"&&define.amd?define(r):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsSortUiZhTW=r())})(this,function(){"use strict";return{"sheets-sort":{general:{sort:"排序","sort-asc":"升序","sort-desc":"降序","sort-custom":"自訂排序","sort-asc-ext":"拓展區域升序","sort-desc-ext":"拓展區域降序","sort-asc-cur":"目前區域升序","sort-desc-cur":"當前區域降序"},error:{"merge-size":"所選區域的合併儲存格的大小不一致,無法排序。 ",empty:"所選區域無內容,無法排序。 ",single:"所選區域只有一行,無法排序。 ","formula-array":"所選區域含數組公式,無法排序。 "},dialog:{"sort-reminder":"排序提醒","sort-reminder-desc":"目前只會對選取區域進行排序,是否拓展排序範圍? ","sort-reminder-ext":"拓展排序範圍","sort-reminder-no":"保持所選排序範圍","first-row-check":"標題不參與排序","add-condition":"新增排序條件",cancel:"取消",confirm:"確認"}}}});
6
+ (function(e,r){typeof exports=="object"&&typeof module<"u"?module.exports=r():typeof define=="function"&&define.amd?define(r):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsSortUiZhTW=r())})(this,(function(){"use strict";return{"sheets-sort":{general:{sort:"排序","sort-asc":"升序","sort-desc":"降序","sort-custom":"自訂排序","sort-asc-ext":"拓展區域升序","sort-desc-ext":"拓展區域降序","sort-asc-cur":"目前區域升序","sort-desc-cur":"當前區域降序"},error:{"merge-size":"所選區域的合併儲存格的大小不一致,無法排序。 ",empty:"所選區域無內容,無法排序。 ",single:"所選區域只有一行,無法排序。 ","formula-array":"所選區域含數組公式,無法排序。 "},dialog:{"sort-reminder":"排序提醒","sort-reminder-desc":"目前只會對選取區域進行排序,是否拓展排序範圍? ","sort-reminder-ext":"拓展排序範圍","sort-reminder-no":"保持所選排序範圍","first-row-check":"標題不參與排序","add-condition":"新增排序條件",cancel:"取消",confirm:"確認"}}}}));
7
7
 
8
8
 
9
9
  // locale/zh-TW
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@univerjs/preset-sheets-sort",
3
- "version": "0.10.3",
3
+ "version": "0.10.5",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "author": "DreamNum Co., Ltd. <developer@univer.ai>",
@@ -58,16 +58,16 @@
58
58
  "rxjs": ">=7.0.0"
59
59
  },
60
60
  "dependencies": {
61
- "@univerjs/sheets-sort": "0.10.3",
62
- "@univerjs/sheets-sort-ui": "0.10.3"
61
+ "@univerjs/sheets-sort": "0.10.5",
62
+ "@univerjs/sheets-sort-ui": "0.10.5"
63
63
  },
64
64
  "devDependencies": {
65
- "@univerjs/core": "0.10.3",
65
+ "@univerjs/core": "0.10.5",
66
66
  "react": "18.3.1",
67
67
  "react-dom": "18.3.1",
68
68
  "rxjs": "7.8.2",
69
69
  "typescript": "^5.8.3",
70
- "@univerjs-infra/shared": "0.10.3"
70
+ "@univerjs-infra/shared": "0.10.5"
71
71
  },
72
72
  "scripts": {
73
73
  "prebuild:preset": "tsx prepare.ts",