@univerjs/presets 0.9.3 → 0.9.4

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
@@ -1212,9 +1212,9 @@ exports.useUpdateBinder = useUpdateBinder;
1212
1212
  `)===r?ae.TRUE:ae.FALSE}const Vr=class Vr{constructor(t,n,r){C(this,"_range");C(this,"_worksheet");this._deps=r,this._range=n,this._worksheet=t}static foreach(t,n){const{startRow:r,startColumn:s,endRow:i,endColumn:o}=t;for(let a=r;a<=i;a++)for(let l=s;l<=o;l++)n(a,l)}getRangeData(){return this._range}getValue(){return this.getValues()[0][0]}getValues(){const{startRow:t,endRow:n,startColumn:r,endColumn:s}=this._range,i=[];for(let o=t;o<=n;o++){const a=[];for(let l=r;l<=s;l++)a.push(this.getMatrix().getValue(o,l)||null);i.push(a)}return i}getMatrix(){const{startRow:t,endRow:n,startColumn:r,endColumn:s}=this._range,i=this._worksheet.getCellMatrix(),o=new ct;for(let a=t;a<=n;a++)for(let l=r;l<=s;l++)o.setValue(a,l,i.getValue(a,l)||null);return o}getMatrixObject(){const{startRow:t,endRow:n,startColumn:r,endColumn:s}=this._range,i=this._worksheet.getCellMatrix(),o=new ct;for(let a=t;a<=n;a++)for(let l=r;l<=s;l++)o.setValue(a-t,l-r,i.getValue(a,l)||{});return o}getA1Notation(){const{startRow:t,endRow:n,startColumn:r,endColumn:s}=this._range;let i,o;return r<s?(i=Z.numToWord(r+1)+(t+1),o=Z.numToWord(s+1)+(n+1)):(i=Z.numToWord(s+1)+(n+1),o=Z.numToWord(r+1)+(t+1)),i===o?`${i}`:`${i}:${o}`}getBackground(){return this.getBackgrounds()[0][0]}getBackgrounds(){const t=this._deps.getStyles();return this.getValues().map(n=>n.map(r=>{var i;const s=t.getStyleByCell(r);return((i=s==null?void 0:s.bg)==null?void 0:i.rgb)||st.bg.rgb}))}getCell(t,n){const{startRow:r,startColumn:s}=this._range,i={startRow:r+t,endRow:r+t,startColumn:s+n,endColumn:s+n};return new Vr(this._worksheet,i,this._deps)}getColumn(){return this._range.startColumn}getObjectValue(t={}){return this.getObjectValues(t)[0][0]}getObjectValues(t={}){var a;const{startRow:n,endRow:r,startColumn:s,endColumn:i}=this._range,o=this._worksheet.getCellMatrix().getFragment(n,r,s,i).getData();if(t.isIncludeStyle){const l=this._deps.getStyles();for(let c=0;c<=r-n;c++)for(let u=0;u<=i-s;u++){if(o==null||((a=o==null?void 0:o[c])==null?void 0:a[u])==null)continue;const h=o[c][u].s;h&&(o[c][u].s=l.get(h))}}return o}getFontColor(){return this.getFontColors()[0][0]}getFontColors(){const t=this._deps.getStyles();return this.getValues().map(n=>n.map(r=>{var i;const s=t.getStyleByCell(r);return((i=s==null?void 0:s.cl)==null?void 0:i.rgb)||st.cl.rgb}))}getFontFamilies(){return this._getStyles("ff")}getFontFamily(){return this.getFontFamilies()[0][0]}getUnderlines(){return this._getStyles("ul")}getUnderline(){var n,r;const{p:t}=(n=this.getValue())!=null?n:{};return t&&Array.isArray((r=t.body)==null?void 0:r.textRuns)&&t.body.textRuns.length>0?Ns("ul",t.body)===ae.TRUE?{s:ae.TRUE}:{s:ae.FALSE}:this.getUnderlines()[0][0]}getOverlines(){return this._getStyles("ol")}getOverline(){return this.getOverlines()[0][0]}getStrikeThrough(){var n,r;const{p:t}=(n=this.getValue())!=null?n:{};return t&&Array.isArray((r=t.body)==null?void 0:r.textRuns)&&t.body.textRuns.length>0?Ns("st",t.body)===ae.TRUE?{s:ae.TRUE}:{s:ae.FALSE}:this.getStrikeThroughs()[0][0]}getStrikeThroughs(){return this._getStyles("st")}getFontSize(){var n,r;const t=((n=this.getValue())==null?void 0:n.p)||{};return t&&Array.isArray((r=t.body)==null?void 0:r.textRuns)&&t.body.textRuns.length>0?t.body.textRuns.some(s=>{var i;return((i=s==null?void 0:s.ts)==null?void 0:i.fs)!=null})?Math.max(...t.body.textRuns.map(s=>{var i;return((i=s==null?void 0:s.ts)==null?void 0:i.fs)||0})):this.getFontSizes()[0][0]:this.getFontSizes()[0][0]}getFontSizes(){return this._getStyles("fs")}getBorder(){return this.getBorders()[0][0]}getBorders(){return this._getStyles("bd")}getFontStyle(){var n,r;const{p:t}=(n=this.getValue())!=null?n:{};return t&&Array.isArray((r=t.body)==null?void 0:r.textRuns)&&t.body.textRuns.length>0?Ns("it",t.body)===ae.TRUE?ts.ITALIC:ts.NORMAL:this._getFontStyles()[0][0]}_getFontStyles(){return this._getStyles("it")}getFontWeight(){var n,r;const{p:t}=(n=this.getValue())!=null?n:{};return t&&Array.isArray((r=t.body)==null?void 0:r.textRuns)&&t.body.textRuns.length>0?Ns("bl",t.body)===ae.TRUE?ns.BOLD:ns.NORMAL:this._getFontWeights()[0][0]}_getFontWeights(){return this._getStyles("bl")}getGridId(){return this._worksheet.getSheetId()}getHeight(){const{_range:t,_worksheet:n}=this,{startRow:r,endRow:s}=t;let i=0;for(let o=0;o<=s-r;o++){const a=n.getRowHeight(o);i+=a}return i}getHorizontalAlignment(){return this.getHorizontalAlignments()[0][0]}getHorizontalAlignments(){return this._getStyles("ht")}getLastColumn(){return this._range.endColumn}getLastRow(){return this._range.endRow}getNumColumns(){const{startColumn:t,endColumn:n}=this._range;return n-t+1}getNumRows(){const{startRow:t,endRow:n}=this._range;return n-t+1}getRichTextValue(){return this.getRichTextValues()[0][0]}getRichTextValues(){return this.getValues().map(t=>t.map(n=>(n==null?void 0:n.p)||""))}getRowIndex(){return this._range.startRow}getSheet(){return this._worksheet}getTextDirection(){return this.getTextDirections()[0][0]}getTextDirections(){return this._getStyles("td")}getTextRotation(){return this.getTextRotations()[0][0]}getTextRotations(){return this._getStyles("tr")}getTextStyle(){return this.getTextStyles()[0][0]}getTextStyles(){const t=this._deps.getStyles();return this.getValues().map(n=>n.map(r=>t.getStyleByCell(r)))}getVerticalAlignment(){return this.getVerticalAlignments()[0][0]}getVerticalAlignments(){return this._getStyles("vt")}getWidth(){const{_range:t,_worksheet:n}=this,{startColumn:r,endColumn:s}=t;let i=0;for(let o=0;o<=s-r;o++)i+=n.getColumnWidth(o);return i}getWrap(){return this.getWrapStrategy()===dn.WRAP?ae.TRUE:ae.FALSE}getWrapStrategies(){return this._getStyles("tb")}getWrapStrategy(){return this.getWrapStrategies()[0][0]}forEach(t){Vr.foreach(this._range,t)}_getStyles(t){const n=this._deps.getStyles();return this.getValues().map(r=>r.map(s=>{const i=n&&n.getStyleByCell(s);return i&&i[t]||st[t]}))}};C(Vr,"transformRange",(t,n)=>{const r=n.getMaxColumns()-1,s=n.getMaxRows()-1;return t.rangeType===pe.ALL?{startColumn:0,startRow:0,endColumn:r,endRow:s}:t.rangeType===pe.COLUMN?{startRow:0,endRow:s,startColumn:t.startColumn,endColumn:t.endColumn}:t.rangeType===pe.ROW?{startColumn:0,endColumn:r,startRow:t.startRow,endRow:t.endRow}:{startColumn:t.startColumn,endColumn:Math.min(t.endColumn,r),startRow:t.startRow,endRow:Math.min(t.endRow,s)}});let xn=Vr;function Hc(e,t,n=0,r=e.length-1,s=m_){for(;r>n;){if(r-n>600){const l=r-n+1,c=t-n+1,u=Math.log(l),h=.5*Math.exp(2*u/3),d=.5*Math.sqrt(u*h*(l-h)/l)*(c-l/2<0?-1:1),m=Math.max(n,Math.floor(t-c*h/l+d)),_=Math.min(r,Math.floor(t+(l-c)*h/l+d));Hc(e,t,m,_,s)}const i=e[t];let o=n,a=r;for(vr(e,n,t),s(e[r],i)>0&&vr(e,n,r);o<a;){for(vr(e,o,a),o++,a--;s(e[o],i)<0;)o++;for(;s(e[a],i)>0;)a--}s(e[n],i)===0?vr(e,n,a):(a++,vr(e,a,r)),a<=t&&(n=a+1),t<=a&&(r=a-1)}}function vr(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function m_(e,t){return e<t?-1:e>t?1:0}class Ms{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(t){let n=this.data;const r=[];if(!Ds(t,n))return r;const s=this.toBBox,i=[];for(;n;){for(let o=0;o<n.children.length;o++){const a=n.children[o],l=n.leaf?s(a):a;Ds(t,l)&&(n.leaf?r.push(a):go(t,l)?this._all(a,r):i.push(a))}n=i.pop()}return r}collides(t){let n=this.data;if(!Ds(t,n))return!1;const r=[];for(;n;){for(let s=0;s<n.children.length;s++){const i=n.children[s],o=n.leaf?this.toBBox(i):i;if(Ds(t,o)){if(n.leaf||go(t,o))return!0;r.push(i)}}n=r.pop()}return!1}load(t){if(!(t&&t.length))return this;if(t.length<this._minEntries){for(let r=0;r<t.length;r++)this.insert(t[r]);return this}let n=this._build(t.slice(),0,t.length-1,0);if(!this.data.children.length)this.data=n;else if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){const r=this.data;this.data=n,n=r}this._insert(n,this.data.height-n.height-1,!0)}return this}insert(t){return t&&this._insert(t,this.data.height-1),this}clear(){return this.data=$n([]),this}remove(t,n){if(!t)return this;let r=this.data;const s=this.toBBox(t),i=[],o=[];let a,l,c;for(;r||i.length;){if(r||(r=i.pop(),l=i[i.length-1],a=o.pop(),c=!0),r.leaf){const u=g_(t,r.children,n);if(u!==-1)return r.children.splice(u,1),i.push(r),this._condense(i),this}!c&&!r.leaf&&go(r,s)?(i.push(r),o.push(a),a=0,l=r,r=r.children[0]):l?(a++,r=l.children[a],c=!1):r=null}return this}toBBox(t){return t}compareMinX(t,n){return t.minX-n.minX}compareMinY(t,n){return t.minY-n.minY}toJSON(){return this.data}fromJSON(t){return this.data=t,this}_all(t,n){const r=[];for(;t;)t.leaf?n.push(...t.children):r.push(...t.children),t=r.pop();return n}_build(t,n,r,s){const i=r-n+1;let o=this._maxEntries,a;if(i<=o)return a=$n(t.slice(n,r+1)),Bn(a,this.toBBox),a;s||(s=Math.ceil(Math.log(i)/Math.log(o)),o=Math.ceil(i/Math.pow(o,s-1))),a=$n([]),a.leaf=!1,a.height=s;const l=Math.ceil(i/o),c=l*Math.ceil(Math.sqrt(o));Wc(t,n,r,c,this.compareMinX);for(let u=n;u<=r;u+=c){const h=Math.min(u+c-1,r);Wc(t,u,h,l,this.compareMinY);for(let d=u;d<=h;d+=l){const m=Math.min(d+l-1,h);a.children.push(this._build(t,d,m,s-1))}}return Bn(a,this.toBBox),a}_chooseSubtree(t,n,r,s){for(;s.push(n),!(n.leaf||s.length-1===r);){let i=1/0,o=1/0,a;for(let l=0;l<n.children.length;l++){const c=n.children[l],u=mo(c),h=E_(t,c)-u;h<o?(o=h,i=u<i?u:i,a=c):h===o&&u<i&&(i=u,a=c)}n=a||n.children[0]}return n}_insert(t,n,r){const s=r?t:this.toBBox(t),i=[],o=this._chooseSubtree(s,this.data,n,i);for(o.children.push(t),br(o,s);n>=0&&i[n].children.length>this._maxEntries;)this._split(i,n),n--;this._adjustParentBBoxes(s,i,n)}_split(t,n){const r=t[n],s=r.children.length,i=this._minEntries;this._chooseSplitAxis(r,i,s);const o=this._chooseSplitIndex(r,i,s),a=$n(r.children.splice(o,r.children.length-o));a.height=r.height,a.leaf=r.leaf,Bn(r,this.toBBox),Bn(a,this.toBBox),n?t[n-1].children.push(a):this._splitRoot(r,a)}_splitRoot(t,n){this.data=$n([t,n]),this.data.height=t.height+1,this.data.leaf=!1,Bn(this.data,this.toBBox)}_chooseSplitIndex(t,n,r){let s,i=1/0,o=1/0;for(let a=n;a<=r-n;a++){const l=wr(t,0,a,this.toBBox),c=wr(t,a,r,this.toBBox),u=C_(l,c),h=mo(l)+mo(c);u<i?(i=u,s=a,o=h<o?h:o):u===i&&h<o&&(o=h,s=a)}return s||r-n}_chooseSplitAxis(t,n,r){const s=t.leaf?this.compareMinX:__,i=t.leaf?this.compareMinY:p_,o=this._allDistMargin(t,n,r,s),a=this._allDistMargin(t,n,r,i);o<a&&t.children.sort(s)}_allDistMargin(t,n,r,s){t.children.sort(s);const i=this.toBBox,o=wr(t,0,n,i),a=wr(t,r-n,r,i);let l=Ls(o)+Ls(a);for(let c=n;c<r-n;c++){const u=t.children[c];br(o,t.leaf?i(u):u),l+=Ls(o)}for(let c=r-n-1;c>=n;c--){const u=t.children[c];br(a,t.leaf?i(u):u),l+=Ls(a)}return l}_adjustParentBBoxes(t,n,r){for(let s=r;s>=0;s--)br(n[s],t)}_condense(t){for(let n=t.length-1,r;n>=0;n--)t[n].children.length===0?n>0?(r=t[n-1].children,r.splice(r.indexOf(t[n]),1)):this.clear():Bn(t[n],this.toBBox)}}function g_(e,t,n){if(!n)return t.indexOf(e);for(let r=0;r<t.length;r++)if(n(e,t[r]))return r;return-1}function Bn(e,t){wr(e,0,e.children.length,t,e)}function wr(e,t,n,r,s){s||(s=$n(null)),s.minX=1/0,s.minY=1/0,s.maxX=-1/0,s.maxY=-1/0;for(let i=t;i<n;i++){const o=e.children[i];br(s,e.leaf?r(o):o)}return s}function br(e,t){return e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),e}function __(e,t){return e.minX-t.minX}function p_(e,t){return e.minY-t.minY}function mo(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function Ls(e){return e.maxX-e.minX+(e.maxY-e.minY)}function E_(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function C_(e,t){const n=Math.max(e.minX,t.minX),r=Math.max(e.minY,t.minY),s=Math.min(e.maxX,t.maxX),i=Math.min(e.maxY,t.maxY);return Math.max(0,s-n)*Math.max(0,i-r)}function go(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function Ds(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function $n(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Wc(e,t,n,r,s){const i=[t,n];for(;i.length;){if(n=i.pop(),t=i.pop(),n-t<=r)continue;const o=t+Math.ceil((n-t)/r/2)*r;Hc(e,o,t,n,s),i.push(t,o,o,n)}}function R_(e,t,n,r=!1){if(t===0&&n===0)return e;let s={...e};const i=s.startAbsoluteRefType||Ne.NONE,o=s.endAbsoluteRefType||Ne.NONE,a=s.rangeType||pe.NORMAL;if(!r&&i===Ne.ALL&&o===Ne.ALL)return s;const l=jc(s.startRow,n,s.startColumn,t,a),c=jc(s.endRow,n,s.endColumn,t,a);return r||i===Ne.NONE&&o===Ne.NONE?s={...s,startRow:l.row,startColumn:l.column,endRow:c.row,endColumn:c.column}:(i===Ne.NONE?s={...s,startRow:l.row,startColumn:l.column}:i===Ne.COLUMN?s={...s,startRow:l.row}:i===Ne.ROW&&(s={...s,startColumn:l.column}),o===Ne.NONE?s={...s,endRow:c.row,endColumn:c.column}:o===Ne.COLUMN?s={...s,endRow:c.row}:o===Ne.ROW&&(s={...s,endColumn:c.column}),s)}function jc(e,t,n,r,s){return s===pe.NORMAL?{row:e+t,column:n+r}:s===pe.ROW?{row:e+t,column:n}:s===pe.COLUMN?{row:e,column:n+r}:{row:e,column:n}}function _o(e){const t=new Set,n=new Set;for(const o of e)t.add(o.startColumn),t.add(o.endColumn+1),n.add(o.startRow),n.add(o.endRow+1);const r=Array.from(t).sort((o,a)=>o-a),s=Array.from(n).sort((o,a)=>o-a);e.sort((o,a)=>o.startRow-a.startRow||o.startColumn-a.startColumn);const i=[];for(let o=0;o<s.length-1;o++)for(let a=0;a<r.length-1;a++){const l=r[a],c=r[a+1]-1,u=s[o],h=s[o+1]-1;for(const d of e){if(d.startRow>h)break;if(d.startRow<=u&&d.endRow>=h&&d.startColumn<=l&&d.endColumn>=c){i.push({startColumn:l,endColumn:c,startRow:u,endRow:h});break}}}return i}function I_(e){e.sort((r,s)=>r.startRow-s.startRow||r.startColumn-s.startColumn);const t={};for(const r of e)t[r.startRow]||(t[r.startRow]=[]),t[r.startRow].push(r);const n=[];for(const r in t){const s=t[+r];s.sort((o,a)=>o.startColumn-a.startColumn);let i=s[0];for(let o=1;o<s.length;o++){const a=s[o];a.startColumn<=i.endColumn+1&&a.startRow===i.startRow&&a.endRow===i.endRow?i.endColumn=Math.max(i.endColumn,a.endColumn):(n.push(i),i=a)}n.push(i)}return n}function S_(e){e.sort((r,s)=>r.startColumn-s.startColumn||r.startRow-s.startRow);const t={};for(const r of e)t[r.startColumn]||(t[r.startColumn]=[]),t[r.startColumn].push(r);const n=[];for(const r in t){const s=t[+r];s.sort((o,a)=>o.startRow-a.startRow);let i=s[0];for(let o=1;o<s.length;o++){const a=s[o];a.startRow<=i.endRow+1&&a.startColumn===i.startColumn&&a.endColumn===i.endColumn?i.endRow=Math.max(i.endRow,a.endRow):(n.push(i),i=a)}n.push(i)}return n}function O_(e){const t=_o(e),n=I_(t);return S_(n)}function v_(e,t){const n=[];return e.forEach(r=>{n.push(...tn.subtract(r,t))}),tn.mergeRanges(n)}function Yc(e,t){const n=Gc(e.startRow,e.endRow,t.startRow,t.endRow),r=Gc(e.startColumn,e.endColumn,t.startColumn,t.endColumn);if(!n||!r)return null;const[s,i]=n,[o,a]=r,l=w_(e.rangeType,t.rangeType,s,i,o,a);return{startRow:s,endRow:i,startColumn:o,endColumn:a,rangeType:l}}function Gc(e,t,n,r){const s=isNaN(e)?-1/0:e,i=isNaN(t)?1/0:t,o=isNaN(n)?-1/0:n,a=isNaN(r)?1/0:r,l=Math.max(s,o),c=Math.min(i,a);if(l<=c){const u=l===-1/0?Number.NaN:l,h=c===1/0?Number.NaN:c;return[u,h]}else return null}function w_(e,t,n,r,s,i){const o=e!==void 0?e:Vc(n,r,s,i),a=t!==void 0?t:Vc(n,r,s,i);return o===pe.ALL||a===pe.ALL?o===a?o:o===pe.ALL?a:o:o===a?o:(o===pe.NORMAL||a===pe.NORMAL,pe.NORMAL)}function Vc(e,t,n,r){const s=!isNaN(e)&&!isNaN(t),i=!isNaN(n)&&!isNaN(r);return s&&i?pe.NORMAL:s?pe.ROW:i?pe.COLUMN:pe.ALL}const Yt=class Yt{static clone(t){return t.rangeType!==void 0?{startRow:t.startRow,startColumn:t.startColumn,endRow:t.endRow,endColumn:t.endColumn,rangeType:t.rangeType}:{startRow:t.startRow,startColumn:t.startColumn,endRow:t.endRow,endColumn:t.endColumn}}static equals(t,n){return t==null||n==null?!1:t.endRow===n.endRow&&t.endColumn===n.endColumn&&t.startRow===n.startRow&&t.startColumn===n.startColumn&&(t.rangeType===n.rangeType||t.rangeType===void 0&&n.rangeType===pe.NORMAL||n.rangeType===void 0&&t.rangeType===pe.NORMAL)}static simpleRangesIntersect(t,n){const{startRow:r,endRow:s,startColumn:i,endColumn:o}=t,{startRow:a,endRow:l,startColumn:c,endColumn:u}=n,h=r<=l&&s>=a,d=i<=u&&o>=c;return h&&d}static intersects(t,n){if(t.rangeType===pe.ROW&&n.rangeType===pe.COLUMN||t.rangeType===pe.COLUMN&&n.rangeType===pe.ROW)return!0;if(t.rangeType===pe.ROW&&n.rangeType===pe.ROW)return t.startRow<=n.endRow&&t.endRow>=n.startRow;if(t.rangeType===pe.COLUMN&&n.rangeType===pe.COLUMN)return t.startColumn<=n.endColumn&&t.endColumn>=n.startColumn;const r=Math.floor(Number.MAX_SAFE_INTEGER/10),s=Number.isNaN(t.startRow)?0:t.startRow,i=Number.isNaN(t.endRow)?r:t.endRow,o=Number.isNaN(t.startColumn)?0:t.startColumn,a=Number.isNaN(t.endColumn)?r:t.endColumn,l=Number.isNaN(n.startRow)?0:n.startRow,c=Number.isNaN(n.endRow)?r:n.endRow,u=Number.isNaN(n.startColumn)?0:n.startColumn,h=Number.isNaN(n.endColumn)?r:n.endColumn,d=Math.abs(o+a-u-h),m=Math.abs(o-a)+Math.abs(u-h),_=Math.abs(s+i-l-c),p=Math.abs(s-i)+Math.abs(l-c);return d<=m&&_<=p}static doAnyRangesIntersect(t,n){const r=new Ms;return r.load(t.map(s=>({minX:s.startColumn,minY:s.startRow,maxX:s.endColumn,maxY:s.endRow}))),n.some(s=>r.search({minX:s.startColumn,minY:s.startRow,maxX:s.endColumn,maxY:s.endRow}).length>0)}static getIntersects(t,n){const r=t.startRow,s=t.endRow,i=t.startColumn,o=t.endColumn,a=n.startRow,l=n.endRow,c=n.startColumn,u=n.endColumn;let h,d,m,_;if(a<=s)a>=r?d=a:d=r;else return null;if(l>=r)l>=s?_=s:_=l;else return null;if(c<=o)c>i?h=c:h=i;else return null;if(u>=i)u>=o?m=o:m=u;else return null;return{startRow:d,endRow:_,startColumn:h,endColumn:m,rangeType:pe.NORMAL}}static contains(t,n){return t.startRow<=n.startRow&&t.endRow>=n.endRow&&t.startColumn<=n.startColumn&&t.endColumn>=n.endColumn}static realContain(t,n){return Yt.contains(t,n)&&(t.startRow<n.startRow||t.endRow>n.endRow||t.startColumn<n.startColumn||t.endColumn>n.endColumn)}static union(...t){return t.reduce((n,r)=>({startRow:Math.min(n.startRow,r.startRow),startColumn:Math.min(n.startColumn,r.startColumn),endRow:Math.max(n.endRow,r.endRow),endColumn:Math.max(n.endColumn,r.endColumn),rangeType:pe.NORMAL}),t[0])}static realUnion(...t){const n=t.some(i=>i.rangeType===pe.COLUMN),r=t.some(i=>i.rangeType===pe.ROW),s=Yt.union(...t);return{startColumn:r?Number.NaN:s.startColumn,endColumn:r?Number.NaN:s.endColumn,startRow:n?Number.NaN:s.startRow,endRow:n?Number.NaN:s.endRow,rangeType:r?pe.ROW:n?pe.COLUMN:pe.NORMAL}}static subtract(t,n){if(n.startRow>t.endRow||n.endRow<t.startRow||n.startColumn>t.endColumn||n.endColumn<t.startColumn)return[t];const r=[];n.startRow>=t.startRow&&r.push({startRow:t.startRow,startColumn:t.startColumn,endRow:n.startRow-1,endColumn:t.endColumn}),n.endRow<=t.endRow&&r.push({startRow:n.endRow+1,startColumn:t.startColumn,endRow:t.endRow,endColumn:t.endColumn});const s=Math.max(t.startRow,n.startRow),i=Math.min(t.endRow,n.endRow);return n.startColumn>=t.startColumn&&r.push({startRow:s,startColumn:t.startColumn,endRow:i,endColumn:n.startColumn-1}),n.endColumn<=t.endColumn&&r.push({startRow:s,startColumn:n.endColumn+1,endRow:i,endColumn:t.endColumn}),r.filter(a=>a.startRow<=a.endRow&&a.startColumn<=a.endColumn)}static mergeRanges(t){return O_(t)}static splitIntoGrid(t){return _o(t)}static subtractMulti(t,n){if(!n.length)return t;let r=t;return n.forEach(s=>{r=v_(r,s)}),r}static hasIntersectionBetweenTwoRect(t,n){return!(t.left>n.right||t.right<n.left||t.top>n.bottom||t.bottom<n.top)}static getIntersectionBetweenTwoRect(t,n){const r=Math.max(t.left,n.left),s=Math.min(t.right,n.right),i=Math.max(t.top,n.top),o=Math.min(t.bottom,n.bottom);return s<=r||o<=i?null:{left:r,right:s,top:i,bottom:o,width:s-r,height:o-i}}static sort(t){return t.sort((n,r)=>n.startRow-r.startRow||n.startColumn-r.startColumn)}};C(Yt,"getRelativeRange",(t,n)=>({startRow:t.startRow-n.startRow,endRow:t.endRow-t.startRow,startColumn:t.startColumn-n.startColumn,endColumn:t.endColumn-t.startColumn})),C(Yt,"getPositionRange",(t,n,r)=>({...r||{},startRow:r&&[Ne.ROW,Ne.ALL].includes(r.startAbsoluteRefType||0)?r.startRow:t.startRow+n.startRow,endRow:r&&[Ne.ROW,Ne.ALL].includes(r.endAbsoluteRefType||0)?r.endRow:t.endRow+t.startRow+n.startRow,startColumn:r&&[Ne.COLUMN,Ne.ALL].includes(r.startAbsoluteRefType||0)?r.startColumn:t.startColumn+n.startColumn,endColumn:r&&[Ne.COLUMN,Ne.ALL].includes(r.endAbsoluteRefType||0)?r.endColumn:t.endColumn+t.startColumn+n.startColumn})),C(Yt,"moveHorizontal",(t,n=0,r=0)=>({...t,startColumn:t.startColumn+n,endColumn:t.endColumn+n+r})),C(Yt,"moveVertical",(t,n=0,r=0)=>({...t,startRow:t.startRow+n,endRow:t.endRow+n+r})),C(Yt,"moveOffset",(t,n,r)=>{const s={...t};switch(t.startAbsoluteRefType){case Ne.ROW:s.startColumn+=n;break;case Ne.COLUMN:s.startRow+=r;break;case Ne.ALL:break;case Ne.NONE:default:s.startRow+=r,s.startColumn+=n;break}switch(t.endAbsoluteRefType){case Ne.ROW:s.endColumn+=n;break;case Ne.COLUMN:s.endRow+=r;break;case Ne.ALL:break;case Ne.NONE:default:s.endRow+=r,s.endColumn+=n;break}return s});let tn=Yt;function b_(e,t){if(e.length===0||e[0].length===0)return null;const n=new Array(e[0].length).fill(0);let r=0,s=null;for(let i=0;i<e.length;i++){for(let a=0;a<e[0].length;a++)n[a]=t(e[i][a])?n[a]+1:0;const o=A_(n);o.area>r&&(r=o.area,s={startColumn:o.start,startRow:i-o.height+1,endColumn:o.end,endRow:i})}return s}function A_(e){const t=[];let n=0,r={area:0,height:0,start:0,end:0},s=0;for(;s<e.length;)if(t.length===0||e[s]>=e[t[t.length-1]])t.push(s++);else{const i=e[t.pop()],o=t.length===0?s:s-t[t.length-1]-1;i*o>n&&(n=i*o,r={area:n,height:i,start:t.length===0?0:t[t.length-1]+1,end:s-1})}for(;t.length>0;){const i=e[t.pop()],o=t.length===0?s:s-t[t.length-1]-1;i*o>n&&(n=i*o,r={area:n,height:i,start:t.length===0?0:t[t.length-1]+1,end:s-1})}return r}function T_(e,t){xn.foreach(t,(n,r)=>{e[n][r]=void 0})}function y_(e,t){const n=e.toFullArray(),r=[];for(;;){const s=b_(n,t);if(!s)break;r.push(s),T_(n,s)}return r}class N_{constructor(t,n){C(this,"_values",[]);C(this,"_keys",[]);C(this,"_keyMaps",new Map);this._values=t,this._keys=n,t.forEach(r=>{this._initKeyMap(r)})}_initKeyMap(t){this._keys.forEach(n=>{const r=t[n],s=this._keyMaps.get(n)||new Map;s.set(r,t),this._keyMaps.set(n,s)})}getValue(t,n){const r=n||this._keys;for(let s=0;s<r.length;s++){const i=this._keyMaps.get(r[s]);if(i!=null&&i.has(t))return i.get(t)}return null}hasValue(t){for(let n=0;n<this._keys.length;n++){const r=this._keyMaps.get(this._keys[n]);if(r!=null&&r.has(t))return!0}return!1}addValue(t){this._values.push(t),this._initKeyMap(t)}setValue(t,n,r){const s=this.getValue(t);s&&Object.keys(s).includes(n)&&(s[n]=r)}deleteValue(t,n){const r=this.getValue(t,n);if(r){this._keys.forEach(i=>{const o=this._keyMaps.get(i),a=r[i];o==null||o.delete(a)});const s=this._values.findIndex(i=>i===r);this._values.splice(s,1)}}getValues(){return this._values}getKeyMap(t){var n;return[...((n=this._keyMaps.get(t))==null?void 0:n.keys())||[]]}clear(){this._values=[],this._keys=[],this._keyMaps.clear()}}function po(e,t,n,r){return{forEach(s){for(let i=e;i<=t;i++)for(let o=n;o<=r;o++)s(i,o)}}}function M_(e){if(e==null||e.length===0)return Number.NaN;const t=e.toLowerCase().split(""),n=t.length,r=o=>o.charCodeAt(0)-96;let s=0,i=0;for(let o=0;o<n;o++)i=r(t[o]),s+=i*26**(n-o-1);return s===0?Number.NaN:s-1}const Us=65,zc=90,L_=97;function D_(e){const t=zc-Us+1;let n="";for(;e>=0;)n=String.fromCharCode(e%t+Us)+n,e=Math.floor(e/t)-1;return n}function Kc(e,t){let n="";for(;t>0;)n+=e,t--;return n}function U_(e,t=!1){const n=zc-Us+1;let r=L_;t&&(r=Us);const s=String.fromCharCode(e%n+r),i=Math.floor(e/n)+1;return Kc(s,i)}function P_(e,t){return e.zIndex>t.zIndex?1:e.zIndex===t.zIndex?0:-1}function k_(e,t){return e.zIndex>t.zIndex?-1:e.zIndex===t.zIndex?0:1}function Ar(e="index",t=1){return(n,r)=>n[e]>r[e]?t:n[e]===r[e]?0:-t}var we=(e=>(e[e.UNIVER_UNKNOWN=0]="UNIVER_UNKNOWN",e[e.UNIVER_DOC=1]="UNIVER_DOC",e[e.UNIVER_SHEET=2]="UNIVER_SHEET",e[e.UNIVER_SLIDE=3]="UNIVER_SLIDE",e[e.UNIVER_PROJECT=4]="UNIVER_PROJECT",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e))(we||{}),kt=(e=>(e[e.Reader=0]="Reader",e[e.Editor=1]="Editor",e[e.Owner=2]="Owner",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e))(kt||{}),Eo=(e=>(e[e.SomeCollaborator=0]="SomeCollaborator",e[e.AllCollaborator=1]="AllCollaborator",e[e.OneSelf=2]="OneSelf",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e))(Eo||{});class Ps extends ze{}function F_(e=tt(6),t=ar.EN_US,n=""){return{id:e,locale:t,title:n,tableSource:{},drawings:{},drawingsOrder:[],headers:{},footers:{},body:{dataStream:`\r
1213
1213
  `,textRuns:[],customBlocks:[],tables:[],paragraphs:[{startIndex:0,paragraphStyle:{spaceAbove:{v:5},lineSpacing:1,spaceBelow:{v:0}}}],sectionBreaks:[{startIndex:1}]},documentStyle:{pageSize:{width:793.3333333333334,height:1122.6666666666667},documentFlavor:ho.TRADITIONAL,marginTop:50,marginBottom:50,marginRight:50,marginLeft:50,renderConfig:{zeroWidthParagraphBreak:ae.FALSE,vertexAngle:0,centerAngle:0,background:{rgb:"#ccc"}},autoHyphenation:ae.TRUE,doNotHyphenateCaps:ae.FALSE,consecutiveHyphenLimit:2,defaultHeaderId:"",defaultFooterId:"",evenPageHeaderId:"",evenPageFooterId:"",firstPageHeaderId:"",firstPageFooterId:"",evenAndOddHeaders:ae.FALSE,useFirstPageHeaderFooter:ae.FALSE,marginHeader:30,marginFooter:30},settings:{}}}var pn={},Tr={},ks={},Xc;function x_(){if(Xc)return ks;Xc=1,Object.defineProperty(ks,"__esModule",{value:!0});function e(r,s){if(Array.isArray(s))return!1;for(let i in r)if(!n(r[i],s[i]))return!1;for(let i in s)if(r[i]===void 0)return!1;return!0}function t(r,s){if(!Array.isArray(s)||r.length!==s.length)return!1;for(let i=0;i<r.length;i++)if(!n(r[i],s[i]))return!1;return!0}function n(r,s){return r===s?!0:r===null||s===null||typeof r!="object"||typeof s!="object"?!1:Array.isArray(r)?t(r,s):e(r,s)}return ks.default=n,ks}var Fs={},qc;function B_(){if(qc)return Fs;qc=1,Object.defineProperty(Fs,"__esModule",{value:!0});function e(t){if(t===null)return null;if(Array.isArray(t))return t.map(e);if(typeof t=="object"){const n={};for(let r in t)n[r]=e(t[r]);return n}else return t}return Fs.default=e,Fs}var Co={},Zc;function Jc(){return Zc||(Zc=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.eachChildOf=e.advancer=e.readCursor=e.writeCursor=e.WriteCursor=e.ReadCursor=e.isValidPathItem=void 0;function t(u,h){if(!u)throw new Error(h)}const n=u=>u!=null&&typeof u=="object"&&!Array.isArray(u),r=(u,h)=>typeof u==typeof h?u>h:typeof u=="string"&&typeof h=="number";function s(u,h){for(let d in u){const m=d;h.write(m,u[m])}}e.isValidPathItem=u=>typeof u=="number"||typeof u=="string"&&u!=="__proto__";class i{constructor(h=null){this.parents=[],this.indexes=[],this.lcIdx=-1,this.idx=-1,this.container=h}ascend(){t(this.parents.length===this.indexes.length/2),this.idx===0?this.parents.length?(this.lcIdx=this.indexes.pop(),this.container=this.parents.pop(),this.idx=this.indexes.pop()):(this.lcIdx=0,this.idx=-1):(t(this.idx>0),this.idx--,n(this.container[this.idx])&&this.idx--)}getPath(){const h=[];let d=this.container,m=this.parents.length-1,_=this.idx;for(;_>=0;)h.unshift(d[_]),_===0?(_=this.indexes[m*2],d=this.parents[m--]):_-=n(d[_-1])?2:1;return h}}class o extends i{get(){return this.container?this.container.slice(this.idx+1):null}getKey(){return t(this.container!=null,"Invalid call to getKey before cursor descended"),this.container[this.idx]}getComponent(){let h;return this.container&&this.container.length>this.idx+1&&n(h=this.container[this.idx+1])?h:null}descendFirst(){let h=this.idx+1;if(!this.container||h>=this.container.length||n(this.container[h])&&h+1>=this.container.length)return!1;n(this.container[h])&&h++;const d=this.container[h];return Array.isArray(d)?(this.indexes.push(this.idx),this.parents.push(this.container),this.indexes.push(h),this.idx=0,this.container=d):this.idx=h,!0}nextSibling(){if(t(this.parents.length===this.indexes.length/2),this.idx>0||this.parents.length===0)return!1;const h=this.indexes[this.indexes.length-1]+1,d=this.parents[this.parents.length-1];return h>=d.length?!1:(t(!isNaN(h)),this.indexes[this.indexes.length-1]=h,this.container=d[h],!0)}_init(h,d,m,_){this.container=h,this.idx=d,this.parents=m.slice(),this.indexes=_.slice()}clone(){const h=new o;return h._init(this.container,this.idx,this.parents,this.indexes),h}*[Symbol.iterator](){if(this.descendFirst()){do yield this.getKey();while(this.nextSibling());this.ascend()}}traverse(h,d){const m=this.getComponent();m&&d(m,h);for(const _ of this)h&&h.descend(_),this.traverse(h,d),h&&h.ascend()}eachPick(h,d){this.traverse(h,(m,_)=>{m.p!=null&&d(m.p,_)})}eachDrop(h,d){this.traverse(h,(m,_)=>{m.d!=null&&d(m.d,_)})}}e.ReadCursor=o;class a extends i{constructor(h=null){super(h),this.pendingDescent=[],this._op=h}flushDescent(){t(this.parents.length===this.indexes.length/2),this.container===null&&(this._op=this.container=[]);for(let h=0;h<this.pendingDescent.length;h++){const d=this.pendingDescent[h];let m=this.idx+1;if(m<this.container.length&&n(this.container[m])&&m++,t(m===this.container.length||!n(this.container[m])),m===this.container.length)this.container.push(d),this.idx=m;else if(this.container[m]===d)this.idx=m;else{if(!Array.isArray(this.container[m])){const _=this.container.splice(m,this.container.length-m);this.container.push(_),this.lcIdx>-1&&(this.lcIdx=m)}for(this.indexes.push(this.idx),this.parents.push(this.container),this.lcIdx!==-1&&(t(r(d,this.container[this.lcIdx][0])),m=this.lcIdx+1,this.lcIdx=-1);m<this.container.length&&r(d,this.container[m][0]);)m++;if(this.indexes.push(m),this.idx=0,m<this.container.length&&this.container[m][0]===d)this.container=this.container[m];else{const _=[d];this.container.splice(m,0,_),this.container=_}}}this.pendingDescent.length=0}reset(){this.lcIdx=-1}getComponent(){this.flushDescent();const h=this.idx+1;if(h<this.container.length&&n(this.container[h]))return this.container[h];{const d={};return this.container.splice(h,0,d),d}}write(h,d){const m=this.getComponent();t(m[h]==null||m[h]===d,"Internal consistency error: Overwritten component. File a bug"),m[h]=d}get(){return this._op}descend(h){if(!e.isValidPathItem(h))throw Error("Invalid JSON key");this.pendingDescent.push(h)}descendPath(h){return this.pendingDescent.push(...h),this}ascend(){this.pendingDescent.length?this.pendingDescent.pop():super.ascend()}mergeTree(h,d=s){if(h===null)return;if(t(Array.isArray(h)),h===this._op)throw Error("Cannot merge into my own tree");const m=this.lcIdx,_=this.parents.length;let p=0;for(let I=0;I<h.length;I++){const A=h[I];typeof A=="string"||typeof A=="number"?(p++,this.descend(A)):Array.isArray(A)?this.mergeTree(A,d):typeof A=="object"&&d(A,this)}for(;p--;)this.ascend();this.lcIdx=this.parents.length===_?m:-1}at(h,d){this.descendPath(h),d(this);for(let m=0;m<h.length;m++)this.ascend();return this}writeAtPath(h,d,m){return this.at(h,()=>this.write(d,m)),this.reset(),this}writeMove(h,d,m=0){return this.writeAtPath(h,"p",m).writeAtPath(d,"d",m)}getPath(){const h=super.getPath();return h.push(...this.pendingDescent),h}}e.WriteCursor=a,e.writeCursor=()=>new a,e.readCursor=u=>new o(u);function l(u,h,d){let m,_;_=m=u?u.descendFirst():!1;function p(I){let A;for(;_;){const B=A=u.getKey();if(I!=null){let x=!1;if(h&&typeof B=="number"&&(A=h(B,u.getComponent()),A<0&&(A=~A,x=!0)),r(A,I))return null;if(A===I&&!x)return u}d&&typeof A=="number"&&d(A,u.getComponent()),_=u.nextSibling()}return null}return p.end=()=>{m&&u.ascend()},p}e.advancer=l;function c(u,h,d){let m,_,p,I;for(m=_=u&&u.descendFirst(),p=I=h&&h.descendFirst();m||p;){let A=m?u.getKey():null,B=p?h.getKey():null;A!==null&&B!==null&&(r(B,A)?B=null:A!==B&&(A=null)),d(A==null?B:A,A!=null?u:null,B!=null?h:null),A!=null&&m&&(m=u.nextSibling()),B!=null&&p&&(p=h.nextSibling())}_&&u.ascend(),I&&h.ascend()}e.eachChildOf=c}(Co)),Co}var Ro={},Qc;function eu(){return Qc||(Qc=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ConflictType=void 0,function(t){t[t.RM_UNEXPECTED_CONTENT=1]="RM_UNEXPECTED_CONTENT",t[t.DROP_COLLISION=2]="DROP_COLLISION",t[t.BLACKHOLE=3]="BLACKHOLE"}(e.ConflictType||(e.ConflictType={}))}(Ro)),Ro}var wt={},En={},tu;function Io(){return tu||(tu=1,Object.defineProperty(En,"__esModule",{value:!0}),En.uniToStrPos=En.strPosToUni=void 0,En.strPosToUni=(e,t=e.length)=>{let n=0,r=0;for(;r<t;r++){const s=e.charCodeAt(r);s>=55296&&s<=57343&&(n++,r++)}if(r!==t)throw Error("Invalid offset - splits unicode bytes");return r-n},En.uniToStrPos=(e,t)=>{let n=0;for(;t>0;t--){const r=e.charCodeAt(n);n+=r>=55296&&r<=57343?2:1}return n}),En}var So={},nu;function Oo(){return nu||(nu=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.uniSlice=e.dlen=e.eachOp=void 0;const t=Io(),n=O=>{if(!Array.isArray(O))throw Error("Op must be an array of components");let R=null;for(let b=0;b<O.length;b++){const y=O[b];switch(typeof y){case"object":if(typeof y.d!="number"&&typeof y.d!="string")throw Error("Delete must be number or string");if(e.dlen(y.d)<=0)throw Error("Deletes must not be empty");break;case"string":if(!(y.length>0))throw Error("Inserts cannot be empty");break;case"number":if(!(y>0))throw Error("Skip components must be >0");if(typeof R=="number")throw Error("Adjacent skip components should be combined");break}R=y}if(typeof R=="number")throw Error("Op has a trailing skip")};function r(O,R){let b=0,y=0;for(let $=0;$<O.length;$++){const H=O[$];switch(R(H,b,y),typeof H){case"object":b+=e.dlen(H.d);break;case"string":y+=t.strPosToUni(H);break;case"number":b+=H,y+=H;break}}}e.eachOp=r;function s(O,R){const b=[],y=a(b);return r(O,($,H,g)=>{y(R($,H,g))}),h(b)}const i=O=>O,o=O=>s(O,i);e.dlen=O=>typeof O=="number"?O:t.strPosToUni(O);const a=O=>R=>{if(!(!R||R.d===0||R.d===""))if(O.length===0)O.push(R);else if(typeof R==typeof O[O.length-1])if(typeof R=="object"){const b=O[O.length-1];b.d=typeof b.d=="string"&&typeof R.d=="string"?b.d+R.d:e.dlen(b.d)+e.dlen(R.d)}else O[O.length-1]+=R;else O.push(R)},l=O=>typeof O=="number"?O:typeof O=="string"?t.strPosToUni(O):typeof O.d=="number"?O.d:t.strPosToUni(O.d);e.uniSlice=(O,R,b)=>{const y=t.uniToStrPos(O,R),$=b==null?1/0:t.uniToStrPos(O,b);return O.slice(y,$)};const c=(O,R,b)=>typeof O=="number"?b==null?O-R:Math.min(O,b)-R:e.uniSlice(O,R,b),u=O=>{let R=0,b=0;return{take:(H,g)=>{if(R===O.length)return H===-1?null:H;const P=O[R];let v;if(typeof P=="number")return H===-1||P-b<=H?(v=P-b,++R,b=0,v):(b+=H,H);if(typeof P=="string"){if(H===-1||g==="i"||t.strPosToUni(P.slice(b))<=H)return v=P.slice(b),++R,b=0,v;{const M=b+t.uniToStrPos(P.slice(b),H);return v=P.slice(b,M),b=M,v}}else{if(H===-1||g==="d"||e.dlen(P.d)-b<=H)return v={d:c(P.d,b)},++R,b=0,v;{let M=c(P.d,b,b+H);return b+=H,{d:M}}}},peek:()=>O[R]}},h=O=>(O.length>0&&typeof O[O.length-1]=="number"&&O.pop(),O);function d(O,R,b){if(b!=="left"&&b!=="right")throw Error("side ("+b+") must be 'left' or 'right'");n(O),n(R);const y=[],$=a(y),{take:H,peek:g}=u(O);for(let v=0;v<R.length;v++){const M=R[v];let T,w;switch(typeof M){case"number":for(T=M;T>0;)w=H(T,"i"),$(w),typeof w!="string"&&(T-=l(w));break;case"string":b==="left"&&typeof g()=="string"&&$(H(-1)),$(t.strPosToUni(M));break;case"object":for(T=e.dlen(M.d);T>0;)switch(w=H(T,"i"),typeof w){case"number":T-=w;break;case"string":$(w);break;case"object":T-=e.dlen(w.d)}break}}let P;for(;P=H(-1);)$(P);return h(y)}function m(O,R){n(O),n(R);const b=[],y=a(b),{take:$}=u(O);for(let g=0;g<R.length;g++){const P=R[g];let v,M;switch(typeof P){case"number":for(v=P;v>0;)M=$(v,"d"),y(M),typeof M!="object"&&(v-=l(M));break;case"string":y(P);break;case"object":v=e.dlen(P.d);let T=0;for(;T<v;)switch(M=$(v-T,"d"),typeof M){case"number":y({d:c(P.d,T,T+M)}),T+=M;break;case"string":T+=t.strPosToUni(M);break;case"object":y(M)}break}}let H;for(;H=$(-1);)y(H);return h(b)}const _=(O,R)=>{let b=0;for(let y=0;y<R.length&&O>b;y++){const $=R[y];switch(typeof $){case"number":{b+=$;break}case"string":const H=t.strPosToUni($);b+=H,O+=H;break;case"object":O-=Math.min(e.dlen($.d),O-b);break}}return O},p=(O,R)=>typeof O=="number"?_(O,R):O.map(b=>_(b,R));function I(O,R,b){return s(O,(y,$)=>typeof y=="object"&&typeof y.d=="number"?{d:b.slice(R,$,$+y.d)}:y)}function A(O){return s(O,R=>{switch(typeof R){case"object":if(typeof R.d=="number")throw Error("Cannot invert text op: Deleted characters missing from operation. makeInvertible must be called first.");return R.d;case"string":return{d:R};case"number":return R}})}function B(O){return s(O,R=>typeof R=="object"&&typeof R.d=="string"?{d:t.strPosToUni(R.d)}:R)}function x(O){let R=!0;return r(O,b=>{typeof b=="object"&&typeof b.d=="number"&&(R=!1)}),R}function Y(O){return{name:"text-unicode",uri:"http://sharejs.org/types/text-unicode",trim:h,normalize:o,checkOp:n,create(R=""){if(typeof R!="string")throw Error("Initial data must be a string");return O.create(R)},apply(R,b){n(b);const y=O.builder(R);for(let $=0;$<b.length;$++){const H=b[$];switch(typeof H){case"number":y.skip(H);break;case"string":y.append(H);break;case"object":y.del(e.dlen(H.d));break}}return y.build()},transform:d,compose:m,transformPosition:_,transformSelection:p,isInvertible:x,makeInvertible(R,b){return I(R,b,O)},stripInvertible:B,invert:A,invertWithDoc(R,b){return A(I(R,b,O))},isNoop:R=>R.length===0}}e.default=Y}(So)),So}var xs={},ru;function $_(){if(ru)return xs;ru=1,Object.defineProperty(xs,"__esModule",{value:!0});const e=Oo(),t=Io();function n(r,s){return{get:r,getLength(){return r().length},insert(i,o,a){const l=t.strPosToUni(r(),i);return s([l,o],a)},remove(i,o,a){const l=t.strPosToUni(r(),i);return s([l,{d:o}],a)},_onOp(i){e.eachOp(i,(o,a,l)=>{switch(typeof o){case"string":this.onInsert&&this.onInsert(l,o);break;case"object":const c=e.dlen(o.d);this.onRemove&&this.onRemove(l,c)}})},onInsert:null,onRemove:null}}return xs.default=n,n.provides={text:!0},xs}var su;function H_(){return su||(su=1,function(e){var t=wt&&wt.__createBinding||(Object.create?function(d,m,_,p){p===void 0&&(p=_),Object.defineProperty(d,p,{enumerable:!0,get:function(){return m[_]}})}:function(d,m,_,p){p===void 0&&(p=_),d[p]=m[_]}),n=wt&&wt.__setModuleDefault||(Object.create?function(d,m){Object.defineProperty(d,"default",{enumerable:!0,value:m})}:function(d,m){d.default=m}),r=wt&&wt.__importStar||function(d){if(d&&d.__esModule)return d;var m={};if(d!=null)for(var _ in d)Object.hasOwnProperty.call(d,_)&&t(m,d,_);return n(m,d),m},s=wt&&wt.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(e,"__esModule",{value:!0}),e.type=e.remove=e.insert=void 0;const i=Io(),o=r(Oo()),a=s($_()),l={create(d){return d},toString(d){return d},builder(d){if(typeof d!="string")throw Error("Invalid document snapshot: "+d);const m=[];return{skip(_){let p=i.uniToStrPos(d,_);if(p>d.length)throw Error("The op is too long for this document");m.push(d.slice(0,p)),d=d.slice(p)},append(_){m.push(_)},del(_){d=d.slice(i.uniToStrPos(d,_))},build(){return m.join("")+d}}},slice:o.uniSlice},c=o.default(l),u=Object.assign(Object.assign({},c),{api:a.default});e.type=u,e.insert=(d,m)=>m.length===0?[]:d===0?[m]:[d,m],e.remove=(d,m)=>o.dlen(m)===0?[]:d===0?[{d:m}]:[d,{d:m}];var h=Oo();Object.defineProperty(e,"makeType",{enumerable:!0,get:function(){return h.default}})}(wt)),wt}var iu;function W_(){return iu||(iu=1,function(e){var t=Tr&&Tr.__importDefault||function(S){return S&&S.__esModule?S:{default:S}};Object.defineProperty(e,"__esModule",{value:!0}),e.editOp=e.replaceOp=e.insertOp=e.moveOp=e.removeOp=e.type=void 0;const n=t(x_()),r=t(B_()),s=Jc(),i=eu();function o(S,U){if(!S)throw new Error(U)}e.type={name:"json1",uri:"http://sharejs.org/types/JSONv1",readCursor:s.readCursor,writeCursor:s.writeCursor,create:S=>S,isNoop:S=>S==null,setDebug(S){},registerSubtype:A,checkValidOp:$,normalize:H,apply:g,transformPosition:P,compose:v,tryTransform:D,transform:Q,makeInvertible:w,invert:M,invertWithDoc:N,RM_UNEXPECTED_CONTENT:i.ConflictType.RM_UNEXPECTED_CONTENT,DROP_COLLISION:i.ConflictType.DROP_COLLISION,BLACKHOLE:i.ConflictType.BLACKHOLE,transformNoConflict:(S,U,G)=>ue(()=>!0,S,U,G),typeAllowingConflictsPred:S=>Object.assign(Object.assign({},e.type),{transform:(U,G,V)=>ue(S,U,G,V)})};const a=S=>S?S.getComponent():null;function l(S){return S&&typeof S=="object"&&!Array.isArray(S)}const c=S=>Array.isArray(S)?S.slice():S!==null&&typeof S=="object"?Object.assign({},S):S,u=S=>S&&(S.p!=null||S.r!==void 0),h=S=>S&&(S.d!=null||S.i!==void 0);function d(S,U){return o(S!=null),typeof U=="number"?(o(Array.isArray(S),"Invalid key - child is not an array"),(S=S.slice()).splice(U,1)):(o(l(S),"Invalid key - child is not an object"),delete(S=Object.assign({},S))[U]),S}function m(S,U,G){return typeof U=="number"?(o(S!=null,"Container is missing for key"),o(Array.isArray(S),"Cannot use numerical key for object container"),o(S.length>=U,"Cannot insert into out of bounds index"),S.splice(U,0,G)):(o(l(S),"Cannot insert into missing item"),o(S[U]===void 0,"Trying to overwrite value at key. Your op needs to remove it first"),S[U]=G),G}e.removeOp=(S,U=!0)=>s.writeCursor().writeAtPath(S,"r",U).get(),e.moveOp=(S,U)=>s.writeCursor().writeMove(S,U).get(),e.insertOp=(S,U)=>s.writeCursor().writeAtPath(S,"i",U).get(),e.replaceOp=(S,U,G)=>s.writeCursor().at(S,V=>{V.write("r",U),V.write("i",G)}).get(),e.editOp=(S,U,G,V=!1)=>s.writeCursor().at(S,W=>R(W,U,G,V)).get();const _=(S,U)=>S!=null&&(typeof U=="number"?Array.isArray(S):typeof S=="object"),p=(S,U)=>_(S,U)?S[U]:void 0,I={};function A(S){let U=S.type?S.type:S;U.name&&(I[U.name]=U),U.uri&&(I[U.uri]=U)}const B=S=>{const U=I[S];if(U)return U;throw Error("Missing type: "+S)};A(H_());const x=(S,U)=>S+U;A({name:"number",apply:x,compose:x,invert:S=>-S,transform:S=>S});const Y=S=>S==null?null:S.et?B(S.et):S.es?I["text-unicode"]:S.ena!=null?I.number:null,O=S=>S.es?S.es:S.ena!=null?S.ena:S.e,R=(S,U,G,V=!1)=>{const[W,j]=typeof U=="string"?[B(U),U]:[U,U.name];!V&&W.isNoop&&W.isNoop(G)||(j==="number"?S.write("ena",G):j==="text-unicode"?S.write("es",G):(S.write("et",j),S.write("e",G)))};function b(S){o(typeof S=="number"),o(S>=0),o(S===(0|S))}function y(S){typeof S=="number"?b(S):o(typeof S=="string")}function $(S){if(S===null)return;const U=new Set,G=new Set,V=j=>{let ee=!0,te=!1;for(let k in j){const K=j[k];if(ee=!1,o(k==="p"||k==="r"||k==="d"||k==="i"||k==="e"||k==="es"||k==="ena"||k==="et","Invalid component item '"+k+"'"),k==="p")b(K),o(!U.has(K)),U.add(K),o(j.r===void 0);else if(k==="d")b(K),o(!G.has(K)),G.add(K),o(j.i===void 0);else if(k==="e"||k==="es"||k==="ena"){o(!te),te=!0;const q=Y(j);o(q,"Missing type in edit"),q.checkValidOp&&q.checkValidOp(O(j))}}o(!ee)},W=(j,ee,te)=>{if(!Array.isArray(j))throw Error("Op must be null or a list");if(j.length===0)throw Error("Empty descent");ee||y(j[0]);let k=1,K=0,q=0;for(let re=0;re<j.length;re++){const ge=j[re];if(o(ge!=null),Array.isArray(ge)){const Ee=W(ge,!1);if(K){const X=typeof q,de=typeof Ee;X===de?o(q<Ee,"descent keys are not in order"):o(X==="number"&&de==="string")}q=Ee,K++,k=3}else typeof ge=="object"?(o(k===1,`Prev not scalar - instead ${k}`),V(ge),k=2):(o(k!==3),y(ge),o(s.isValidPathItem(ge),"Invalid path key"),k=1)}return o(K!==1,"Operation makes multiple descents. Remove some []"),o(k===2||k===3),j[0]};W(S,!0),o(U.size===G.size,"Mismatched picks and drops in op");for(let j=0;j<U.size;j++)o(U.has(j)),o(G.has(j))}function H(S){let U=0,G=[];const V=s.writeCursor();return V.mergeTree(S,(W,j)=>{const ee=Y(W);if(ee){const k=O(W);R(j,ee,ee.normalize?ee.normalize(k):k)}for(const k of["r","p","i","d"])if(W[k]!==void 0){const K=k==="p"||k==="d"?(te=W[k],G[te]==null&&(G[te]=U++),G[te]):W[k];j.write(k,K)}var te}),V.get()}function g(S,U){if($(U),U===null)return S;const G=[];return function V(W,j){let ee=W,te=0,k={root:W},K=0,q=k,re="root";function ge(){for(;K<te;K++){let Ee=j[K];typeof Ee!="object"&&(o(_(q,re)),q=q[re]=c(q[re]),re=Ee)}}for(;te<j.length;te++){const Ee=j[te];if(Array.isArray(Ee)){const X=V(ee,Ee);X!==ee&&X!==void 0&&(ge(),ee=q[re]=X)}else if(typeof Ee=="object"){Ee.d!=null?(ge(),ee=m(q,re,G[Ee.d])):Ee.i!==void 0&&(ge(),ee=m(q,re,Ee.i));const X=Y(Ee);if(X)ge(),ee=q[re]=X.apply(ee,O(Ee));else if(Ee.e!==void 0)throw Error("Subtype "+Ee.et+" undefined")}else ee=p(ee,Ee)}return k.root}(S=function V(W,j){const ee=[];let te=0;for(;te<j.length;te++){const re=j[te];if(Array.isArray(re))break;typeof re!="object"&&(ee.push(W),W=p(W,re))}for(let re=j.length-1;re>=te;re--)W=V(W,j[re]);for(--te;te>=0;te--){const re=j[te];if(typeof re!="object"){const ge=ee.pop();W=W===p(ge,re)?ge:W===void 0?d(ge,re):(K=re,q=W,(k=c(k=ge))[K]=q,k)}else u(re)&&(o(W!==void 0,"Cannot pick up or remove undefined"),re.p!=null&&(G[re.p]=W),W=void 0)}var k,K,q;return W}(S,U),U)}function P(S,U){S=S.slice(),$(U);const G=s.readCursor(U);let V,W,j=!1;const ee=[];for(let k=0;;k++){const K=S[k],q=G.getComponent();if(q&&(q.r!==void 0?j=!0:q.p!=null&&(j=!1,V=q.p,W=k)),k>=S.length)break;let re=0;const ge=s.advancer(G,void 0,(X,de)=>{u(de)&&re++});ee.unshift(ge);const Ee=ge(K);if(typeof K=="number"&&(S[k]-=re),!Ee)break}if(ee.forEach(k=>k.end()),j)return null;const te=()=>{let k=0;if(V!=null){const K=G.getPath();k=K.length,S=K.concat(S.slice(W))}for(;k<S.length;k++){const K=S[k],q=a(G),re=Y(q);if(re){const X=O(q);re.transformPosition&&(S[k]=re.transformPosition(S[k],X));break}let ge=0;const Ee=s.advancer(G,(X,de)=>h(de)?~(X-ge):X-ge,(X,de)=>{h(de)&&ge++})(K);if(typeof K=="number"&&(S[k]+=ge),!Ee)break}};return V!=null?G.eachDrop(null,k=>{k===V&&te()}):te(),S}function v(S,U){if($(S),$(U),S==null)return U;if(U==null)return S;let G=0;const V=s.readCursor(S),W=s.readCursor(U),j=s.writeCursor(),ee=[],te=[],k=[],K=[],q=[],re=[],ge=new Set;V.traverse(null,X=>{X.p!=null&&(k[X.p]=V.clone())}),W.traverse(null,X=>{X.d!=null&&(K[X.d]=W.clone())});const Ee=s.writeCursor();return function X(de,Fe,Le,Oe,$e,Gt,rt,Qe){o(Fe||Le);const He=a(Fe),It=a(Le),Tt=!!It&&It.r!==void 0,On=!!He&&He.i!==void 0,St=He?He.d:null,ft=It?It.p:null,Vt=(Gt||Tt)&&ft==null;if(ft!=null)Oe=K[ft],rt=te[ft]=new s.WriteCursor;else if(It&&It.r!==void 0)Oe=null;else{const ie=a(Oe);ie&&ie.d!=null&&(Oe=null)}const Te=a(Oe);if(St!=null)if(de=k[St],Qe=ee[St]=new s.WriteCursor,Vt)Gt&&!Tt&&Qe.write("r",!0);else{const ie=q[St]=G++;rt.write("d",ie)}else if(He&&He.i!==void 0)de=null;else{const ie=a(de);ie&&ie.p!=null&&(de=null)}let ce;On?(o($e===void 0),ce=He.i):ce=$e;const Ie=(ft==null?!On||Gt||Tt:ce===void 0)?null:rt.getComponent();if(ft!=null){if(!($e!==void 0||On)){const ie=St!=null?q[St]:G++;re[ft]=ie,Qe.write("p",ie)}}else Tt&&(On||$e!==void 0||(It.r,Qe.write("r",It.r)));const he=Vt?null:Y(He),se=Y(Te);if((he||se)&&(he&&he.name,se&&se.name),he&&se){o(he===se);const ie=O(He),Se=O(Te),Xe=he.compose(ie,Se);R(rt,he,Xe),ge.add(Te)}else he?R(rt,he,O(He)):se&&(R(rt,se,O(Te)),ge.add(Te));const me=typeof ce=="object"&&ce!=null;let Ae=!1,be=0,ye=0,Ke=0,Ve=0,We=0;const nt=s.advancer(Oe,(ie,Se)=>h(Se)?Ve-ie-1:ie-Ve,(ie,Se)=>{h(Se)&&Ve++}),ve=s.advancer(de,(ie,Se)=>u(Se)?be-ie-1:ie-be,(ie,Se)=>{u(Se)&&be++});if(s.eachChildOf(Fe,Le,(ie,Se,Xe)=>{let it,zt,vn=ie,yt=ie,zr=ie;if(typeof ie=="number"){let et=ie+Ke;zt=nt(et),yt=et+Ve;let Ye=ie+ye;it=ve(Ye),h(a(zt))&&(it=null),vn=Ye+be,zr=ie+We,o(vn>=0,"p1PickKey is negative"),o(yt>=0,"p2DropKey is negative");const Nt=h(a(Se)),Kt=u(a(Xe));(Nt||Kt&&!Vt)&&We--,Nt&&ye--,Kt&&Ke--}else it=ve(ie),zt=nt(ie);Qe.descend(vn),rt.descend(yt);const Qn=me&&!h(a(Se))?ce[zr]:void 0,xt=X(it,Se,Xe,zt,Qn,Vt,rt,Qe);var Bt,_e,Be;me&&!Vt?Qn!==xt&&(Ae||(ce=Array.isArray(ce)?ce.slice():Object.assign({},ce),Ae=!0),Bt=ce,Be=xt,typeof(_e=zr)=="number"?(o(Array.isArray(Bt)),o(_e<Bt.length)):(o(!Array.isArray(Bt)),o(Bt[_e]!==void 0)),Be===void 0?typeof _e=="number"?Bt.splice(_e,1):delete Bt[_e]:Bt[_e]=Be):o(xt===void 0),rt.ascend(),Qe.ascend()}),ve.end(),nt.end(),Ie!=null)Ie.i=ce;else if(!Gt&&!Tt&&ft==null)return ce}(V,V.clone(),W,W.clone(),void 0,!1,j,Ee),j.reset(),j.mergeTree(Ee.get()),j.reset(),j.get(),ee.map(X=>X.get()),te.map(X=>X.get()),V.traverse(j,(X,de)=>{const Fe=X.p;if(Fe!=null){const Le=q[Fe];Le!=null&&de.write("p",Le);const Oe=ee[Fe];Oe&&Oe.get(),Oe&&de.mergeTree(Oe.get())}else X.r!==void 0&&de.write("r",X.r)}),j.reset(),j.get(),W.traverse(j,(X,de)=>{const Fe=X.d;if(Fe!=null){const Oe=re[Fe];Oe!=null&&de.write("d",Oe);const $e=te[Fe];$e&&de.mergeTree($e.get())}else X.i!==void 0&&de.write("i",X.i);const Le=Y(X);Le&&!ge.has(X)&&R(de,Le,O(X))}),j.get()}function M(S){if(S==null)return null;const U=new s.ReadCursor(S),G=new s.WriteCursor;let V;const W=[],j=[];return function ee(te,k,K){const q=te.getComponent();let re,ge=!1;if(q){q.p!=null&&(k.write("d",q.p),W[q.p]=te.clone()),q.r!==void 0&&k.write("i",q.r),q.d!=null&&(k.write("p",q.d),K=void 0),q.i!==void 0&&(K=re=q.i);const X=Y(q);X&&(K===void 0?(V||(V=new Set),V.add(q)):(O(q),K=X.apply(K,O(q)),ge=!0))}let Ee=0;for(const X of te){k.descend(X);const de=typeof X=="number"?X-Ee:X,Fe=p(K,de);h(te.getComponent())&&Ee++;const Le=ee(te,k,Fe);if(K!==void 0&&Le!==void 0){if(ge||(ge=!0,K=c(K)),!_(K,de))throw Error("Cannot modify child - invalid operation");K[de]=Le}k.ascend()}if(re===void 0)return ge?K:void 0;k.write("r",K)}(U,G,void 0),V&&(G.reset(),function ee(te,k,K){const q=k.getComponent();if(q){const X=q.d;if(X!=null&&(te=W[X],K=j[X]=s.writeCursor()),V.has(q)){const de=Y(q);if(!de.invert)throw Error(`Cannot invert subtype ${de.name}`);R(K,de,de.invert(O(q)))}}let re=0,ge=0;const Ee=s.advancer(te,(X,de)=>u(de)?re-X-1:X-re,(X,de)=>{u(de)&&re++});for(const X of k)if(typeof X=="number"){const de=X-ge,Fe=Ee(de),Le=de+re;K.descend(Le),ee(Fe,k,K),h(k.getComponent())&&ge++,K.ascend()}else K.descend(X),ee(Ee(X),k,K),K.ascend();Ee.end()}(U.clone(),U,G),j.length&&(G.reset(),U.traverse(G,(ee,te)=>{const k=ee.p;if(k!=null){const K=j[k];K&&K.get(),K&&te.mergeTree(K.get())}}))),G.get()}const T=(S,U)=>S.some(G=>typeof G=="object"&&(Array.isArray(G)?T(G,U):U(G)));function w(S,U){if(S==null||!T(S,k=>{var K;return k.r!==void 0||((K=Y(k))===null||K===void 0?void 0:K.makeInvertible)!=null}))return S;const G=new s.ReadCursor(S),V=new s.WriteCursor;let W=!1;const j=[],ee=[],te=(k,K,q)=>{const re=k.getComponent();let ge=!1;if(re){re.d!=null&&K.write("d",re.d),re.i!==void 0&&K.write("i",re.i);const X=re.p;if(X!=null&&(j[X]=k.clone(),o(q!==void 0,"Operation picks up at an invalid key"),ee[X]=q,K.write("p",re.p)),re.r!==void 0&&q===void 0)throw Error("Invalid doc / op in makeInvertible: removed item missing from doc");const de=Y(re);de&&(de.makeInvertible?W=!0:R(K,de,O(re),!0))}let Ee=0;for(const X of k){K.descend(X);const de=typeof X=="number"?X-Ee:X,Fe=p(q,de),Le=te(k,K,Fe);Fe!==Le&&(ge||(ge=!0,q=c(q)),Le===void 0?(q=d(q,de),typeof X=="number"&&Ee++):q[de]=Le),K.ascend()}return re&&(re.r!==void 0?(K.write("r",r.default(q)),q=void 0):re.p!=null&&(q=void 0)),q};return te(G,V,U),V.get(),W&&(V.reset(),function k(K,q,re,ge,Ee){const X=q.getComponent();if(X){X.i!==void 0?(ge=X.i,Ee=!0):X.d!=null&&(ge=ee[X.d],K=j[X.d],Ee=!1,X.d);let Oe=Y(X);if(Oe&&Oe.makeInvertible){const $e=O(X);R(re,Oe,Oe.makeInvertible($e,ge),!0)}}let de=0,Fe=0;const Le=s.advancer(K,(Oe,$e)=>u($e)?de-Oe-1:Oe-de,(Oe,$e)=>{u($e)&&de++});for(const Oe of q)if(typeof Oe=="number"){const $e=Oe-Fe,Gt=Le($e),rt=$e+de,Qe=p(ge,Ee?$e:rt);re.descend(Oe),k(Gt,q,re,Qe,Ee),h(q.getComponent())&&Fe++,re.ascend()}else{const $e=p(ge,Oe);re.descend(Oe),k(Le(Oe),q,re,$e,Ee),re.ascend()}Le.end()}(G.clone(),G,V,U,!1)),V.get()}function N(S,U){return M(w(S,U))}const L=S=>{if(S==null)return null;const U=S.slice();for(let G=0;G<S.length;G++){const V=U[G];Array.isArray(V)&&(U[G]=L(V))}return U};function D(S,U,G){o(G==="left"||G==="right","Direction must be left or right");const V=G==="left"?0:1;if(U==null)return{ok:!0,result:S};$(S),$(U);let W=null;const j=[],ee=[],te=[],k=[],K=[],q=[],re=[],ge=[],Ee=[],X=[],de=[],Fe=[],Le=[],Oe=[],$e=[];let Gt=0;const rt=s.readCursor(S),Qe=s.readCursor(U),He=s.writeCursor();if(function Te(ce,Ie=null,he){const se=a(Ie);se&&(se.r!==void 0?he=Ie.clone():se.p!=null&&(he=null,q[se.p]=ce.clone()));const me=ce.getComponent();let Ae;me&&(Ae=me.p)!=null&&(K[Ae]=Ie?Ie.clone():null,te[Ae]=ce.clone(),he&&(X[Ae]=!0,Ee[Ae]=he),se&&se.p!=null&&(Oe[Ae]=se.p));const be=s.advancer(Ie);for(const ye of ce)Te(ce,be(ye),he);be.end()}(Qe,rt,null),function Te(ce,Ie,he,se,me){const Ae=he.getComponent();let be,ye=!1;Ae&&((be=Ae.d)!=null?(k[be]=he.clone(),se!=null&&($e[se]==null&&($e[se]=[]),$e[se].push(be)),X[be],ce=K[be]||null,Ie=te[be]||null,X[be]?(me&&(de[be]=!0),me=Ee[be]||null):!me||V!==1&&Oe[be]!=null||W==null&&(W={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.removeOp(me.getPath()),op2:e.moveOp(Ie.getPath(),he.getPath())}),ye=!0):Ae.i!==void 0&&(ce=Ie=null,ye=!0,me&&W==null&&(W={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.removeOp(me.getPath()),op2:e.insertOp(he.getPath(),Ae.i)})));const Ke=a(ce);Ke&&(Ke.r!==void 0?me=ce.clone():Ke.p!=null&&(Ke.p,se=Ke.p,me=null));const Ve=Y(Ae);Ve&&me&&W==null&&(W={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.removeOp(me.getPath()),op2:e.editOp(he.getPath(),Ve,O(Ae),!0)});let We=0,nt=0;const ve=s.advancer(Ie,(Se,Xe)=>u(Xe)?We-Se-1:Se-We,(Se,Xe)=>{u(Xe)&&We++}),ie=s.advancer(ce);for(const Se of he)if(typeof Se=="number"){const Xe=Se-nt,it=ve(Xe);nt+=+Te(ie(Xe+We),it,he,se,me)}else{const Xe=ve(Se);Te(ie(Se),Xe,he,se,me)}return ve.end(),ie.end(),ye}(rt,Qe,Qe.clone(),null,null),k.map(Te=>Te&&Te.get()),W)return{ok:!1,conflict:W};de.map(Te=>!!Te);const It=[];let Tt=null;(function Te(ce,Ie,he,se,me){let Ae=!1;const be=a(Ie);if(u(be)){const ve=be.p;ve!=null?(he=k[ve],se=Fe[ve]=s.writeCursor(),Ae=!0,me=null):(he=null,me=Ie.clone())}else h(a(he))&&(he=null);const ye=ce.getComponent();if(ye){const ve=ye.p;ve!=null?(me&&(ge[ve]=me),It[ve]=me||V===1&&Ae?null:se.getComponent(),j[ve]=ce.clone(),he&&(re[ve]=he.clone())):ye.r!==void 0&&(me||se.write("r",!0),(me||Ae)&&(Tt==null&&(Tt=new Set),Tt.add(ye)))}let Ke=0,Ve=0;const We=s.advancer(Ie,void 0,(ve,ie)=>{u(ie)&&Ke++}),nt=s.advancer(he,(ve,ie)=>h(ie)?~(ve-Ve):ve-Ve,(ve,ie)=>{h(ie)&&Ve++});if(ce)for(const ve of ce)if(typeof ve=="string"){const ie=We(ve),Se=nt(ve);se.descend(ve),Te(ce,ie,Se,se,me),se.ascend()}else{const ie=We(ve),Se=ve-Ke,Xe=u(a(ie))?null:nt(Se),it=Se+Ve;o(it>=0),se.descend(it),Te(ce,ie,Xe,se,me),se.ascend()}We.end(),nt.end()})(rt,Qe,Qe.clone(),He,null),He.reset();let On=[];if(function Te(ce,Ie,he,se,me,Ae){o(Ie);const be=Ie.getComponent();let ye=a(se),Ke=!1;const Ve=(_e,Be,et)=>_e?e.moveOp(_e.getPath(),Be.getPath()):e.insertOp(Be.getPath(),et.i);if(h(be)){const _e=be.d;_e!=null&&(ee[_e]=Ie.clone());const Be=_e!=null?It[_e]:null;let et=!1;if(be.i!==void 0||_e!=null&&Be){let Ye;ye&&(ye.i!==void 0||(Ye=ye.d)!=null&&!X[Ye])&&(et=Ye!=null?_e!=null&&_e===Oe[Ye]:n.default(ye.i,be.i),et||Ye!=null&&V!==1&&Oe[Ye]!=null||W==null&&(W={type:i.ConflictType.DROP_COLLISION,op1:Ve(_e!=null?j[_e]:null,Ie,be),op2:Ve(Ye!=null?te[Ye]:null,se,ye)})),et||(Ae?W==null&&(W={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:Ve(_e!=null?j[_e]:null,Ie,be),op2:e.removeOp(Ae.getPath())}):(_e!=null?(On[Gt]=_e,me.write("d",Be.p=Gt++)):me.write("i",r.default(be.i)),Ke=!0))}else if(_e!=null&&!Be){const Ye=ge[_e];Ye&&(Ae=Ye.clone())}_e!=null?(ce=j[_e],he=q[_e],se=re[_e]):be.i!==void 0&&(ce=he=null,et||(se=null))}else u(a(ce))&&(ce=he=se=null);const We=a(ce),nt=a(he);if(u(nt)){const _e=nt.p;nt.r!==void 0&&(!We||We.r===void 0)||X[_e]?(se=null,Ae=he.clone()):_e!=null&&(se=k[_e],V!==1&&Oe[_e]!=null||((me=Le[_e])||(me=Le[_e]=s.writeCursor()),me.reset(),Ae=null))}else!h(be)&&h(ye)&&(se=null);ye=se!=null?se.getComponent():null;const ve=Y(be);if(ve){const _e=O(be);if(Ae)W==null&&(W={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.editOp(Ie.getPath(),ve,_e,!0),op2:e.removeOp(Ae.getPath())});else{const Be=Y(ye);let et;if(Be){if(ve!==Be)throw Error("Transforming incompatible types");const Ye=O(ye);et=ve.transform(_e,Ye,G)}else et=r.default(_e);R(me,ve,et)}}let ie=0,Se=0,Xe=0,it=0,zt=0,vn=0,yt=ce!=null&&ce.descendFirst(),zr=yt;const Qn=s.advancer(he,void 0,(_e,Be)=>{u(Be)&&Xe++});let xt=se!=null&&se.descendFirst(),Bt=xt;for(const _e of Ie)if(typeof _e=="number"){let Be;const et=h(Ie.getComponent()),Ye=_e-Se;{let ln;for(;yt&&typeof(ln=ce.getKey())=="number";){ln+=ie;const Mt=ce.getComponent(),er=u(Mt);if(ln>Ye||ln===Ye&&(!er||V===0&&et))break;if(er){ie--;const wn=Mt.p;Oe.includes(wn),Mt.d,a(Le[Mt.d]),u(a(Le[Mt.d])),(Mt.r===void 0||Tt&&Tt.has(Mt))&&(wn==null||!It[wn]||V!==1&&Oe.includes(wn))||zt--}yt=ce.nextSibling()}Be=yt&&ln===Ye?ce:null}const Nt=Ye-ie;let Kt=Qn(Nt);const da=Nt-Xe;let Qs=null;{let ln,Mt;for(;xt&&typeof(ln=se.getKey())=="number";){Mt=ln-it;const er=se.getComponent(),wn=h(er);if(Mt>da)break;if(Mt===da){if(!wn){Qs=se;break}{if(V===0&&et){Qs=se;break}const cn=Kt&&u(Kt.getComponent());if(V===0&&cn)break}}if(wn){const cn=er.d;X[cn],Oe[cn],er.i===void 0&&(X[cn]||Oe[cn]!=null&&V!==1)?(X[cn]||Oe[cn]!=null&&V===0)&&(it++,vn--):it++}xt=se.nextSibling()}}const Id=da+it+zt+vn;o(Id>=0,"trying to descend to a negative index"),me.descend(Id),et&&(Be=Kt=Qs=null,Se++),Te(Be,Ie,Kt,Qs,me,Ae)&&vn++,me.ascend()}else{let Be;for(;yt&&(Be=ce.getKey(),typeof Be!="string"||!(Be>_e||Be===_e));)yt=ce.nextSibling();const et=yt&&Be===_e?ce:null,Ye=Qn(_e);let Nt;for(;xt&&(Nt=se.getKey(),typeof Nt!="string"||!(Nt>_e||Nt===_e));)xt=se.nextSibling();const Kt=xt&&Nt===_e?se:null;me.descend(_e),Te(et,Ie,Ye,Kt,me,Ae),me.ascend()}return Qn.end(),zr&&ce.ascend(),Bt&&se.ascend(),Ke}(rt,rt.clone(),Qe,Qe.clone(),He,null),W)return{ok:!1,conflict:W};He.reset();const St=(Te,ce,Ie)=>Te.traverse(ce,(he,se)=>{he.d!=null&&Ie(he.d,Te,se)});(X.length||Fe.length)&&(St(Qe,He,(Te,ce,Ie)=>{X[Te]&&!de[Te]&&Ie.write("r",!0),Fe[Te]&&Ie.mergeTree(Fe[Te].get())}),He.reset());const ft=[],Vt=[];if((Le.length||X.length)&&!W){const Te=s.readCursor(L(He.get()));if(St(Te,null,(ce,Ie)=>{ft[ce]=Ie.clone()}),Le.forEach(ce=>{ce&&St(s.readCursor(ce.get()),null,(Ie,he)=>{ft[Ie]=he.clone()})}),function ce(Ie,he,se,me,Ae,be){const ye=a(he);if(ye&&u(ye))if(ye.p!=null){const ie=ye.p;ft[ie].getPath(),se=ft[ie],me=Vt[ie]=s.writeCursor()}else ye.r!==void 0&&(se=null);else h(a(se))&&(se=null);const Ke=Ie.getComponent();if(Ke){let ie;if((ie=Ke.d)!=null){const Se=Le[ie];Se&&(Se.get(),me.mergeTree(Se.get()),se=s.readCursor(Se.get()))}}let Ve=0,We=0;const nt=s.advancer(he,void 0,(ie,Se)=>{u(Se)&&Ve--}),ve=s.advancer(se,(ie,Se)=>h(Se)?-(ie-We)-1:ie-We,(ie,Se)=>{h(Se)&&We++});for(const ie of Ie)if(typeof ie=="number"){const Se=nt(ie),Xe=ie+Ve,it=ve(Xe),zt=Xe+We;me.descend(zt),ce(Ie,Se,it,me),me.ascend()}else me.descend(ie),ce(Ie,nt(ie),ve(ie),me),me.ascend();nt.end(),ve.end()}(Qe,Te,Te.clone(),He),He.reset(),W)return{ok:!1,conflict:W};if(He.get(),Vt.length){const ce=Vt.map(he=>he?he.get():null),Ie=s.readCursor(L(He.get()));if(St(Ie,He,(he,se,me)=>{const Ae=ce[he];Ae&&(me.mergeTree(Ae),ce[he]=null)}),ce.find(he=>he)){const he=s.writeCursor(),se=s.writeCursor();let me=0,Ae=0;ce.forEach(be=>{be!=null&&St(s.readCursor(be),null,ye=>{const Ke=On[ye];he.writeMove(j[Ke].getPath(),ee[Ke].getPath(),me++);const Ve=$e[Ke];Ve&&Ve.forEach(We=>{X[We]||V!==1&&Oe[We]!=null||se.writeMove(te[We].getPath(),k[We].getPath(),Ae++)})})}),W={type:i.ConflictType.BLACKHOLE,op1:he.get(),op2:se.get()}}}}return W?{ok:!1,conflict:W}:{ok:!0,result:He.get()}}const F=S=>{const U=new Error("Transform detected write conflict");throw U.conflict=S,U.type=U.name="writeConflict",U};function Q(S,U,G){const V=D(S,U,G);if(V.ok)return V.result;F(V.conflict)}const z=S=>{const U=s.writeCursor();return s.readCursor(S).traverse(U,(G,V)=>{(h(G)||Y(G))&&V.write("r",!0)}),U.get()},le=(S,U)=>{const{type:G,op1:V,op2:W}=S;switch(G){case i.ConflictType.DROP_COLLISION:return U==="left"?[null,z(W)]:[z(V),null];case i.ConflictType.RM_UNEXPECTED_CONTENT:let j=!1;return s.readCursor(V).traverse(null,ee=>{ee.r!==void 0&&(j=!0)}),j?[null,z(W)]:[z(V),null];case i.ConflictType.BLACKHOLE:return[z(V),z(W)];default:throw Error("Unrecognised conflict: "+G)}};function ue(S,U,G,V){let W=null;for(;;){const j=D(U,G,V);if(j.ok)return v(W,j.result);{const{conflict:ee}=j;S(ee)||F(ee);const[te,k]=le(ee,V);U=v(H(U),te),G=v(H(G),k),W=v(W,k)}}}}(Tr)),Tr}var ou;function j_(){return ou||(ou=1,function(e){var t=pn&&pn.__createBinding||(Object.create?function(i,o,a,l){l===void 0&&(l=a),Object.defineProperty(i,l,{enumerable:!0,get:function(){return o[a]}})}:function(i,o,a,l){l===void 0&&(l=a),i[l]=o[a]}),n=pn&&pn.__exportStar||function(i,o){for(var a in i)a!=="default"&&!o.hasOwnProperty(a)&&t(o,i,a)};Object.defineProperty(e,"__esModule",{value:!0}),n(W_(),e);var r=Jc();Object.defineProperty(e,"ReadCursor",{enumerable:!0,get:function(){return r.ReadCursor}}),Object.defineProperty(e,"WriteCursor",{enumerable:!0,get:function(){return r.WriteCursor}});var s=eu();Object.defineProperty(e,"ConflictType",{enumerable:!0,get:function(){return s.ConflictType}})}(pn)),pn}var at=j_();const Y_=Sd({__proto__:null,default:mt(at)},[at]);var J=(e=>(e.RETAIN="r",e.INSERT="i",e.DELETE="d",e))(J||{});function yr(e,t=!1){const n=[];for(const r of e){const{st:s,ed:i,ts:o}=r;if(r.sId===void 0&&delete r.sId,s===i||!t&&Z.isEmptyObject(o)&&r.sId==null)continue;if(n.length===0){n.push(r);continue}const a=n.pop();ml(r,a)&&Z.hasIntersectionBetweenTwoRanges(a.st,a.ed,r.st,r.ed)?n.push({...r,st:a.st,ed:i}):n.push(a,r)}return n}function au(e,t,n,r){var c;const{textRuns:s}=e;if(s==null)return;const i=[],o=s.length;let a=!1;const l=(c=t.textRuns)!=null?c:[];if(l.length)for(const u of l)u.st+=r,u.ed+=r;for(let u=0;u<o;u++){const h=s[u],{st:d,ed:m}=h;if(m<=r)i.push(h);else if(r>d&&r<m){a=!0;const _={...h,ed:r};i.push(_),l.length&&i.push(...l);const p={...h,st:r+n,ed:m+n};i.push(p)}else h.st+=n,h.ed+=n,a||(a=!0,i.push(...l)),i.push(h)}a||(a=!0,i.push(...l)),e.textRuns=yr(i)}function lu(e,t,n,r){const{paragraphs:s}=e;if(s==null)return;const{paragraphs:i}=t,o=[];for(let l=0,c=s.length;l<c;l++){const u=s[l],{startIndex:h}=u;h>=r&&(u.startIndex+=n),o.push(u.startIndex)}let a=-1;if(i){for(let l=0,c=i.length;l<c;l++){const u=i[l];u.startIndex+=r;const h=u.startIndex;a=o.indexOf(h)}a!==-1&&s.splice(a,1),s.push(...i),s.sort(Ar("startIndex"))}}function cu(e,t,n,r){const{sectionBreaks:s}=e;if(s==null)return;for(let o=0,a=s.length;o<a;o++){const l=s[o],{startIndex:c}=l;c>=r&&(l.startIndex+=n)}const i=t.sectionBreaks;if(i){for(let o=0,a=i.length;o<a;o++){const l=i[o];l.startIndex+=r}s.push(...i),s.sort(Ar("startIndex"))}}function uu(e,t,n,r){const{customBlocks:s=[]}=e;for(let o=0,a=s.length;o<a;o++){const l=s[o],{startIndex:c}=l;c>=r&&(l.startIndex+=n)}const i=t.customBlocks;if(i){for(let o=0,a=i.length;o<a;o++){const l=i[o];l.startIndex+=r}s.push(...i),s.sort(Ar("startIndex"))}s.length&&!e.customBlocks&&(e.customBlocks=s)}function hu(e,t,n,r){const{tables:s}=e;if(s==null)return;for(let o=0,a=s.length;o<a;o++){const l=s[o],{startIndex:c,endIndex:u}=l;c>r?(l.startIndex+=n,l.endIndex+=n):u>r&&(l.endIndex+=n)}const i=t.tables;if(i){for(let o=0,a=i.length;o<a;o++){const l=i[o];l.startIndex+=r,l.endIndex+=r}s.push(...i),s.sort(Ar("startIndex"))}}const du="$",fu=e=>e.split(du)[0];function vo(e){if(e.length<=1)return e;e.sort((s,i)=>s.startIndex-i.startIndex);const t=[];let n={...e[0]};n.rangeId=fu(n.rangeId);for(let s=1;s<e.length;s++){const i=e[s];i.rangeId=fu(i.rangeId),i.rangeId===n.rangeId&&Ia(n.properties,i.properties)&&n.endIndex+1>=i.startIndex?n.endIndex=i.endIndex:(t.push(n),n={...i})}t.push(n);const r=Object.create(null);for(let s=0,i=t.length;s<i;s++){const o=t[s],a=o.rangeId;r[a]?(o.rangeId=`${a}${du}${r[a]}`,r[a]=r[a]+1):r[a]=1}return t}function wo(e,t){const n=e.findIndex(s=>s.startIndex<t&&s.endIndex>=t),r=e[n];r&&e.splice(n,1,{rangeId:r.rangeId,rangeType:r.rangeType,startIndex:r.startIndex,endIndex:t-1,properties:{...r.properties}},{rangeId:r.rangeId,rangeType:r.rangeType,startIndex:t,endIndex:r.endIndex,properties:{...r.properties}})}function mu(e){if(e.length<=1)return e;e.sort((r,s)=>r.startIndex-s.startIndex);const t=[];let n={...e[0]};for(let r=1;r<e.length;r++){const s=e[r];s.id===n.id&&n.endIndex+1>=s.startIndex?n.endIndex=s.endIndex:(t.push(n),n={...s})}return t.push(n),t}function bo(e,t){e.filter(r=>r.startIndex<t&&r.endIndex>=t).forEach(r=>{const s=e.indexOf(r);e.splice(s,1,{id:r.id,type:r.type,startIndex:r.startIndex,endIndex:t-1},{id:r.id,type:r.type,startIndex:t,endIndex:r.endIndex})})}function G_(e,t,n,r){e.customRanges||(e.customRanges=[]);const{customRanges:s}=e;wo(s,r);for(let o=0,a=s.length;o<a;o++){const l=s[o],{startIndex:c}=l;c>=r&&(l.startIndex+=n,l.endIndex+=n)}const i=[];if(t.customRanges){for(let o=0,a=t.customRanges.length;o<a;o++){const l=t.customRanges[o];l.startIndex+=r,l.endIndex+=r,i.push(l)}s.push(...i)}e.customRanges=vo(s)}function V_(e,t,n,r){e.customDecorations||(e.customDecorations=[]);const{customDecorations:s}=e;bo(s,r);for(let o=0,a=s.length;o<a;o++){const l=s[o],{startIndex:c}=l;c>=r&&(l.startIndex+=n,l.endIndex+=n)}const i=[];if(t.customDecorations){for(let o=0,a=t.customDecorations.length;o<a;o++){const l=t.customDecorations[o];l.startIndex+=r,l.endIndex+=r,i.push(l)}s.push(...i)}e.customDecorations=mu(s)}function gu(e,t,n){const{textRuns:r}=e,s=n,i=n+t,o=[];if(r){const a=[];for(let l=0,c=r.length;l<c;l++){const u=r[l],{st:h,ed:d}=u;if(s<=h&&i>=d){o.push({...u,st:h-s,ed:d-s});continue}else h<=s&&d>=i?(o.push({...u,st:s-s,ed:i-s}),u.ed-=t):s>=h&&s<d?(o.push({...u,st:s-s,ed:d-s}),u.ed=s):i>h&&i<=d?(o.push({...u,st:h-s,ed:i-s}),u.st=i-t,u.ed-=t):h>=i&&(u.st-=t,u.ed-=t);a.push(u)}e.textRuns=a}return o.length===0&&o.push({st:0,ed:t,ts:{}}),o}function _u(e,t,n){const{paragraphs:r}=e,s=n,i=n+t,o=[];if(r){const a=[];for(let l=0,c=r.length;l<c;l++){const u=r[l],{startIndex:h}=u;if(h>=s&&h<i){o.push({...u,startIndex:h-n});continue}else h>=i&&(u.startIndex-=t);a.push(u)}e.paragraphs=a}return o}function pu(e,t,n){const{sectionBreaks:r}=e,s=n,i=n+t-1,o=[];if(r){const a=[];for(let l=0,c=r.length;l<c;l++){const u=r[l],{startIndex:h}=u;if(h>=s&&h<=i){o.push({...u,startIndex:h-n});continue}else h>i&&(u.startIndex-=t);a.push(u)}e.sectionBreaks=a}return o}function Eu(e,t,n){const{customBlocks:r=[]}=e,s=n,i=n+t-1,o=[];if(r){const a=[];for(let l=0,c=r.length;l<c;l++){const u=r[l],{startIndex:h}=u;if(h>=s&&h<=i){o.push({...u,startIndex:h-n});continue}else h>i&&(u.startIndex-=t);a.push(u)}e.customBlocks=a}return r.length&&!e.customBlocks&&(e.customBlocks=r),o}function Cu(e,t,n){const{tables:r}=e,s=n,i=n+t-1,o=[];if(r){const a=[];for(let l=0,c=r.length;l<c;l++){const u=r[l],{startIndex:h,endIndex:d}=u;if(s<=h&&i>=d){o.push({...u,startIndex:h-n,endIndex:d-n});continue}else if(h<=s&&d>=i){const m=Cs(h,d,s,i);if(m.length===0||(u.startIndex=m[0],u.endIndex=m[1],u.startIndex===u.endIndex))continue}else i<h&&(u.startIndex-=t,u.endIndex-=t);a.push(u)}e.tables=a}return o}function z_(e,t,n){const{customRanges:r}=e,s=n,i=n+t-1,o=[];if(r){const a=[];for(let l=0,c=r.length;l<c;l++){const u=r[l],{startIndex:h,endIndex:d}=u;if(h>=s&&d<=i){o.push(u);continue}else if(Math.max(s,h)<=Math.min(i,d)){const m=Cs(h,d,s,i);if(m.length===0)continue;u.startIndex=m[0],u.endIndex=m[1]}else i<h&&(u.startIndex-=t,u.endIndex-=t);a.push(u)}e.customRanges=vo(a)}return o}function K_(e,t,n,r=!0){const{customDecorations:s}=e,i=n,o=n+t-1,a=[];if(s){const l=[];for(let c=0,u=s.length;c<u;c++){const h=s[c],{startIndex:d,endIndex:m}=h;if(d>=i&&m<=o){a.push(h);continue}else if(Math.max(i,d)<=Math.min(o,m)){const _=Cs(d,m,i,o);if(_.length===0)continue;h.startIndex=_[0],h.endIndex=_[1]}else o<d&&r&&(h.startIndex-=t,h.endIndex-=t);l.push(h)}e.customDecorations=l}return a}var Ru=(e=>(e.ORDER_LIST_QUICK_1="1.",e.ORDER_LIST_QUICK_2="a)",e.ORDER_LIST_QUICK_3="a.",e.ORDER_LIST_QUICK_4="i.",e.ORDER_LIST_QUICK_5="A.",e.ORDER_LIST_QUICK_6="I.",e.ORDER_LIST_QUICK_7="01.",e.BULLET_LIST="*",e))(Ru||{}),Ft=(e=>(e.BULLET_LIST="BULLET_LIST",e.BULLET_LIST_1="BULLET_LIST_1",e.BULLET_LIST_2="BULLET_LIST_2",e.BULLET_LIST_3="BULLET_LIST_3",e.BULLET_LIST_4="BULLET_LIST_4",e.BULLET_LIST_5="BULLET_LIST_5",e.ORDER_LIST="ORDER_LIST",e.ORDER_LIST_1="ORDER_LIST_1",e.ORDER_LIST_2="ORDER_LIST_2",e.ORDER_LIST_3="ORDER_LIST_3",e.ORDER_LIST_4="ORDER_LIST_4",e.ORDER_LIST_5="ORDER_LIST_5",e.ORDER_LIST_QUICK_2="ORDER_LIST_QUICK_2",e.ORDER_LIST_QUICK_3="ORDER_LIST_QUICK_3",e.ORDER_LIST_QUICK_4="ORDER_LIST_QUICK_4",e.ORDER_LIST_QUICK_5="ORDER_LIST_QUICK_5",e.ORDER_LIST_QUICK_6="ORDER_LIST_QUICK_6",e.CHECK_LIST="CHECK_LIST",e.CHECK_LIST_CHECKED="CHECK_LIST_CHECKED",e))(Ft||{});const Bs={"a)":{glyphFormat:"%1)",glyphType:fe.DECIMAL},"1.":{glyphType:fe.DECIMAL},"a.":{glyphFormat:"%1.",glyphType:fe.LOWER_LETTER},"A.":{glyphType:fe.UPPER_LETTER},"i.":{glyphFormat:"%1.",glyphType:fe.LOWER_ROMAN},"I.":{glyphFormat:"%1.",glyphType:fe.UPPER_LETTER}},Hn=e=>[...e,...e,...e].map((t,n)=>({glyphFormat:` %${n+1}`,glyphSymbol:t,bulletAlignment:Or.START,textStyle:{fs:12},startNumber:0,paragraphProperties:{hanging:{v:21},indentStart:{v:21*n}}})),Wn=e=>e.map((t,n)=>({...t,bulletAlignment:Or.START,textStyle:{fs:12},startNumber:0,paragraphProperties:{hanging:{v:21},indentStart:{v:21*n}}})),Iu=(e,t)=>new Array(9).fill(0).map((n,r)=>({glyphFormat:` %${r+1}`,glyphSymbol:e,bulletAlignment:Or.START,textStyle:{fs:16},startNumber:0,paragraphProperties:{hanging:{v:21},indentStart:{v:21*r},textStyle:t}})),Nr={BULLET_LIST:{listType:"BULLET_LIST",nestingLevel:Hn(["●","○","■"])},BULLET_LIST_1:{listType:"BULLET_LIST",nestingLevel:Hn(["❖","➢","■"])},BULLET_LIST_2:{listType:"BULLET_LIST",nestingLevel:Hn(["✔","●","◆"])},BULLET_LIST_3:{listType:"BULLET_LIST",nestingLevel:Hn(["■","◆","○"])},BULLET_LIST_4:{listType:"BULLET_LIST",nestingLevel:Hn(["✧","○","■"])},BULLET_LIST_5:{listType:"BULLET_LIST",nestingLevel:Hn(["➢","○","◆"])},ORDER_LIST:{listType:"ORDER_LIST",nestingLevel:Wn([{glyphFormat:"%1.",glyphType:fe.DECIMAL},{glyphFormat:"%2.",glyphType:fe.LOWER_LETTER},{glyphFormat:"%3.",glyphType:fe.LOWER_ROMAN},{glyphFormat:"%4.",glyphType:fe.DECIMAL},{glyphFormat:"%5.",glyphType:fe.LOWER_LETTER},{glyphFormat:"%6.",glyphType:fe.LOWER_ROMAN},{glyphFormat:"%7.",glyphType:fe.DECIMAL},{glyphFormat:"%8.",glyphType:fe.LOWER_LETTER},{glyphFormat:"%9.",glyphType:fe.LOWER_ROMAN}])},ORDER_LIST_1:{listType:"ORDER_LIST",nestingLevel:Wn([{glyphFormat:"%1)",glyphType:fe.DECIMAL},{glyphFormat:"%2)",glyphType:fe.LOWER_LETTER},{glyphFormat:"%3)",glyphType:fe.LOWER_ROMAN},{glyphFormat:"%4)",glyphType:fe.DECIMAL},{glyphFormat:"%5)",glyphType:fe.LOWER_LETTER},{glyphFormat:"%6)",glyphType:fe.LOWER_ROMAN},{glyphFormat:"%7)",glyphType:fe.DECIMAL},{glyphFormat:"%8)",glyphType:fe.LOWER_LETTER},{glyphFormat:"%9)",glyphType:fe.LOWER_ROMAN}])},ORDER_LIST_2:{listType:"ORDER_LIST",nestingLevel:Wn(["%1.","%1.%2.","%1.%2.%3.","%1.%2.%3.%4.","%1.%2.%3.%4.%5.","%1.%2.%3.%4.%5.%6.","%1.%2.%3.%4.%5.%6.%7."].map(e=>({glyphFormat:e,glyphType:fe.DECIMAL})))},ORDER_LIST_3:{listType:"ORDER_LIST",nestingLevel:Wn([{glyphFormat:"%1.",glyphType:fe.UPPER_LETTER},{glyphFormat:"%2.",glyphType:fe.LOWER_LETTER},{glyphFormat:"%3.",glyphType:fe.LOWER_ROMAN},{glyphFormat:"%4.",glyphType:fe.UPPER_LETTER},{glyphFormat:"%5.",glyphType:fe.LOWER_LETTER},{glyphFormat:"%6.",glyphType:fe.LOWER_ROMAN},{glyphFormat:"%7.",glyphType:fe.UPPER_LETTER},{glyphFormat:"%8.",glyphType:fe.LOWER_LETTER},{glyphFormat:"%9.",glyphType:fe.LOWER_ROMAN}])},ORDER_LIST_4:{listType:"ORDER_LIST",nestingLevel:Wn([{glyphFormat:"%1.",glyphType:fe.UPPER_LETTER},{glyphFormat:"%2.",glyphType:fe.DECIMAL},{glyphFormat:"%3.",glyphType:fe.LOWER_ROMAN},{glyphFormat:"%4.",glyphType:fe.UPPER_LETTER},{glyphFormat:"%5.",glyphType:fe.DECIMAL},{glyphFormat:"%6.",glyphType:fe.LOWER_ROMAN},{glyphFormat:"%7.",glyphType:fe.UPPER_LETTER},{glyphFormat:"%8.",glyphType:fe.DECIMAL},{glyphFormat:"%9.",glyphType:fe.LOWER_ROMAN}])},ORDER_LIST_5:{listType:"ORDER_LIST",nestingLevel:Wn([{glyphFormat:"%1.",glyphType:fe.DECIMAL_ZERO},{glyphFormat:"%2.",glyphType:fe.LOWER_LETTER},{glyphFormat:"%3.",glyphType:fe.LOWER_ROMAN},{glyphFormat:"%4.",glyphType:fe.DECIMAL_ZERO},{glyphFormat:"%5.",glyphType:fe.LOWER_LETTER},{glyphFormat:"%6.",glyphType:fe.LOWER_ROMAN},{glyphFormat:"%7.",glyphType:fe.DECIMAL_ZERO},{glyphFormat:"%8.",glyphType:fe.LOWER_LETTER},{glyphFormat:"%9.",glyphType:fe.LOWER_ROMAN}])},CHECK_LIST:{listType:"CHECK_LIST",nestingLevel:Iu("☐")},CHECK_LIST_CHECKED:{listType:"CHECK_LIST_CHECKED",nestingLevel:Iu("☑",{st:{s:ae.TRUE}})}},$s=e=>{const{glyphFormat:t,glyphType:n}=e,r=Z.deepClone(Nr.ORDER_LIST);return r.nestingLevel[0].glyphFormat=t,r.nestingLevel[0].glyphType=n,r},X_={ORDER_LIST_QUICK_2:$s(Bs["a)"]),ORDER_LIST_QUICK_3:$s(Bs["a."]),ORDER_LIST_QUICK_4:$s(Bs["i."]),ORDER_LIST_QUICK_6:$s(Bs["I."])};Object.assign(Nr,X_);const q_={"1.":"ORDER_LIST","a)":"ORDER_LIST_QUICK_2","a.":"ORDER_LIST_QUICK_3","i.":"ORDER_LIST_QUICK_4","A.":"ORDER_LIST_3","I.":"ORDER_LIST_QUICK_6","01.":"ORDER_LIST_5","*":"BULLET_LIST"};function Z_(e,t,n,r,s){const i=J_(e,t,n,r,s),o=Q_(e,t,n,r,s),a=ep(e,t,n,r,s),l=tp(e,t,n,r,s),c=np(e,t,n,r,s),u=rp(e,t,n,r),h=sp(e,t,n,r,s);return{dataStream:"",textRuns:i,paragraphs:o,sectionBreaks:a,customBlocks:l,tables:c,customRanges:u,customDecorations:h}}function J_(e,t,n,r,s){const{textRuns:i}=e,{textRuns:o}=t;if(i==null||o==null)return;const a=gu(e,n,r);if(s!==Ce.REPLACE){const l=Su(o,a,s);t.textRuns=l}return au(e,t,n,r),a}function Su(e,t,n){if(t.length===0)return e;e=Z.deepClone(e),t=Z.deepClone(t);const r=[],s=e.length,i=t.length;let o=0,a=0,l=null;function c(){return l?(r.push(l),l=null,!0):!1}for(;o<s&&a<i;){const{st:m,ed:_,ts:p}=e[o],{st:I,ed:A,ts:B,sId:x}=t[a];let Y;if(n===Ce.COVER?Y={...B,...p}:Y={...p},_<I)c()||r.push(e[o]),o++;else if(A<m)c()||r.push(t[a]),a++;else{const O={st:Math.min(m,I),ed:Math.max(m,I),ts:m<I?{...p}:{...B},sId:m<I?void 0:x};O.ed>O.st&&r.push(O),r.push({st:Math.max(m,I),ed:Math.min(_,A),ts:Y,sId:x}),_<A?(o++,t[a].st=_,t[a].st===t[a].ed&&a++):(a++,e[o].st=A,e[o].st===e[o].ed&&o++);const R={st:Math.min(_,A),ed:Math.max(_,A),ts:_<A?{...B}:{...p},sId:_<A?x:void 0};l=R.ed>R.st?R:null}}c();const u=r[r.length-1],h=e[s-1],d=t[i-1];return u&&u.ed!==Math.max(h.ed,d.ed)&&(h.ed>d.ed?r.push(h):r.push(d)),yr(r)}function Q_(e,t,n,r,s){const{paragraphs:i}=e,{paragraphs:o}=t;if(i==null||o==null)return;const a=_u(e,n,r);if(s!==Ce.REPLACE){const l=[];for(const c of o){const{startIndex:u,paragraphStyle:h,bullet:d}=c;let m=[];for(const _ of a){const{startIndex:p,paragraphStyle:I,bullet:A}=_;let B,x;if(s===Ce.COVER?(B={...I,...h},x={listId:"",listType:Ft.BULLET_LIST,nestingLevel:0,textStyle:{},...A,...d}):(B={...h,...I},x={listId:"",listType:Ft.BULLET_LIST,nestingLevel:0,textStyle:{},...d,...A}),u===p){m.push({startIndex:u,paragraphStyle:B,bullet:x});break}}l.push(...m),m=[]}t.paragraphs=l}return lu(e,t,n,r),a}function ep(e,t,n,r,s){const{sectionBreaks:i}=e,{sectionBreaks:o}=t;if(i==null||o==null)return;const a=pu(e,n,r);if(s!==Ce.REPLACE){const l=[];for(const c of o){const{startIndex:u}=c;let h=[];for(const d of a){const{startIndex:m}=d;if(u===m){s===Ce.COVER?h.push({...d,...c}):h.push({...c,...d});break}}l.push(...h),h=[]}t.sectionBreaks=l}return cu(e,t,n,r),a}function tp(e,t,n,r,s){const{customBlocks:i=[]}=e,{customBlocks:o}=t;if(i==null||o==null)return;const a=Eu(e,n,r);if(s!==Ce.REPLACE){const l=[];for(const c of o){const{startIndex:u}=c;let h=[];for(const d of a){const{startIndex:m}=d;if(u===m){s===Ce.COVER?h.push({...d,...c}):h.push({...c,...d});break}}l.push(...h),h=[]}t.customBlocks=l}return uu(e,t,n,r),i.length&&!e.customBlocks&&(e.customBlocks=i),a}function np(e,t,n,r,s){const{tables:i}=e,{tables:o}=t;if(i==null||o==null)return;const a=Cu(e,n,r);if(s!==Ce.REPLACE){const l=[];for(const c of o){const{startIndex:u,endIndex:h}=c;let d=[];for(const m of a){const{startIndex:_,endIndex:p}=m;if(_>=u&&p<=h){s===Ce.COVER?d.push({...m,...c}):d.push({...c,...m});break}}l.push(...d),d=[]}t.tables=l}return hu(e,t,n,r),a}function rp(e,t,n,r,s){e.customRanges||(e.customRanges=[]),wo(e.customRanges,r),wo(e.customRanges,r+n);const i=r,o=r+n-1,{customRanges:a}=t,l=[],c=new Map;e.customRanges.forEach(h=>{const{startIndex:d,endIndex:m}=h;d>=i&&m<=o?c.set(h.rangeId,h):l.push(h)});const u=[];return a?(a.forEach(h=>{const{startIndex:d,endIndex:m}=h;l.push({...h,startIndex:d+r,endIndex:m+r})}),e.customRanges=vo(l),u):[]}function sp(e,t,n,r,s){e.customDecorations||(e.customDecorations=[]),bo(e.customDecorations,r),bo(e.customDecorations,r+n);const i=[],{customDecorations:o}=e,{customDecorations:a=[]}=t;if(s===Ce.REPLACE){for(let l=0;l<o.length;l++){const c=o[l],{startIndex:u,endIndex:h}=c;u>=r&&h<=r+n-1&&i.push(c)}a.forEach(l=>{const{startIndex:c,endIndex:u}=l;o.push({...l,startIndex:c+r,endIndex:u+r})})}else for(const l of a){const{id:c}=l;if(l.type===_n.DELETED){const u=o.filter(h=>h.id===c);u.length&&i.push(...u)}else o.push({...l,startIndex:l.startIndex+r,endIndex:l.endIndex+r})}for(const l of i){const{id:c}=l,u=o.findIndex(h=>h.id===c);u!==-1&&o.splice(u,1)}return e.customDecorations=mu(o),i}var Ao=(e=>(e[e.copy=0]="copy",e[e.cut=1]="cut",e))(Ao||{});function Hs(e,t,n,r=!0){const{textRuns:s}=e;if(s){const i=[];for(const o of s){const a=Z.deepClone(o),{st:l,ed:c}=a;Z.hasIntersectionBetweenTwoRanges(l,c,t,n)&&(t>=l&&t<=c?i.push({...a,st:t,ed:Math.min(n,c)}):n>=l&&n<=c?i.push({...a,st:Math.max(t,l),ed:n}):i.push(a))}return yr(i.map(o=>{const{st:a,ed:l}=o;return{...o,st:a-t,ed:l-t}}))}else if(r)return[{st:0,ed:n-t,ts:{}}]}function Ou(e,t,n){const{tables:r=[]}=e,s=[];for(const i of r){const o=Z.deepClone(i),{startIndex:a,endIndex:l}=o;a>=t&&l<=n&&s.push({...o,startIndex:a-t,endIndex:l-t})}return s}function vu(e,t,n){const{paragraphs:r=[]}=e,s=[];for(const i of r){const{startIndex:o}=i;if(o>=t&&o<n){const a=Z.deepClone(i);s.push(a)}}if(s.length)return s.map(i=>({...i,startIndex:i.startIndex-t}))}function ip(e,t,n){const{sectionBreaks:r=[]}=e,s=[];for(const i of r){const{startIndex:o}=i;o>=t&&o<=n&&s.push(Z.deepClone(i))}if(s.length)return s.map(i=>({...i,startIndex:i.startIndex-t}))}function wu(e,t,n){const{customBlocks:r=[]}=e,s=[];for(const i of r){const{startIndex:o}=i;o>=t&&o<n&&s.push(Z.deepClone(i))}if(s.length)return s.map(i=>({...i,startIndex:i.startIndex-t}))}function bt(e,t,n,r=!0,s=1){const{dataStream:i}=e,o={dataStream:i.slice(t,n)};o.textRuns=Hs(e,t,n,r);const a=Ou(e,t,n);if(a.length&&(o.tables=a),o.paragraphs=vu(e,t,n),s===1){const c=Au(e,t,n);c?o.customDecorations=c:r&&(o.customDecorations=[])}const{customRanges:l}=bu(e,t,n);return l?o.customRanges=l:r&&(o.customRanges=[]),o.customBlocks=wu(e,t,n),o}function op(e){const{dataStream:t,textRuns:n,paragraphs:r,customRanges:s,customDecorations:i,tables:o}=e;let a=0,l=0;s==null||s.forEach(u=>{u.startIndex<0&&(a=Math.max(a,-u.startIndex)),u.endIndex>t.length-1&&(l=Math.max(l,u.endIndex-t.length+1))});const c=`${t}`;return n&&(n[0]&&(n[0].st=n[0].st-a),n[n.length-1]&&(n[n.length-1].ed=n[n.length-1].ed+l)),n==null||n.forEach(u=>{u.st+=a,u.ed+=a}),r==null||r.forEach(u=>{u.startIndex+=a}),s==null||s.forEach(u=>{u.startIndex+=a,u.endIndex+=a}),i==null||i.forEach(u=>{u.startIndex+=a,u.endIndex+=l}),o==null||o.forEach(u=>{u.startIndex+=a,u.endIndex+=l}),{...e,dataStream:c,textRuns:n,paragraphs:r,customRanges:s,customDecorations:i,tables:o}}function bu(e,t,n){if(e.customRanges==null)return{};const{customRanges:r}=e;return{customRanges:r.filter(a=>Math.max(a.startIndex,t)<=Math.min(a.endIndex,n-1)).map(a=>({...a,startIndex:Math.max(a.startIndex,t),endIndex:Math.min(a.endIndex,n-1)})).map(a=>({...a,startIndex:a.startIndex-t,endIndex:a.endIndex-t})),leftOffset:0,rightOffset:0}}function Au(e,t,n){if(e.customDecorations==null)return;const{customDecorations:r=[]}=e,s=[];return r.forEach(i=>{if(Math.max(i.startIndex,t)<=Math.min(i.endIndex,n-1)){const o=Z.deepClone(i);s.push({...o,startIndex:Math.max(o.startIndex-t,0),endIndex:Math.min(o.endIndex,n-1)-t})}}),s}function ap(e,t,n){return e==null||t==null?e!=null?e:t:Su(e,t,n)}function lp(e,t,n){if(e==null||t==null)return e!=null?e:t;if(t.length===0||e.length===0)return e;if(t.length>1||e.length>1)throw new Error("Cannot cover multiple customRanges");return n===Ce.REPLACE?[{...e[0]}]:[{...t[0],...e[0]}]}function cp(e,t,n){return t.length===0||e.length===0||n===Ce.REPLACE?e:[...e,...t.filter(r=>!e.some(s=>r.id===s.id))]}function To(e,t,n=Ce.COVER){if(t.dataStream!=="")throw new Error("Cannot compose other body with non-empty dataStream");const r={dataStream:e.dataStream},{textRuns:s,paragraphs:i=[],customRanges:o,customDecorations:a=[]}=e,{textRuns:l,paragraphs:c=[],customRanges:u,customDecorations:h=[]}=t;r.textRuns=ap(l,s,n),r.customRanges=lp(u,o,n);const d=cp(h,a,n);d.length&&(r.customDecorations=d);const m=[];let _=0,p=0;for(;_<i.length&&p<c.length;){const I=i[_],A=c[p],{startIndex:B}=I,{startIndex:x}=A;B===x?(m.push(Z.deepMerge(I,A)),_++,p++):B<x?(m.push(Z.deepClone(I)),_++):(m.push(Z.deepClone(A)),p++)}return _<i.length&&m.push(...i.slice(_)),p<c.length&&m.push(...c.slice(p)),m.length&&(r.paragraphs=m),r}function up(e){const{body:t}=e;if(t==null)return!0;const{textRuns:n,paragraphs:r,customRanges:s,customBlocks:i,customDecorations:o,tables:a}=t;return n==null&&r==null&&s==null&&i==null&&o==null&&a==null}class jn{constructor(t){C(this,"_index",0);C(this,"_offset",0);this._actions=t}hasNext(){return this.peekLength()<Number.POSITIVE_INFINITY}next(t){t||(t=Number.POSITIVE_INFINITY);const n=this._actions[this._index];if(n){const r=this._offset,s=n.len;return t>=s-r?(t=s-r,this._index+=1,this._offset=0):this._offset+=t,n.t===J.DELETE||n.t===J.RETAIN&&n.body==null?Z.deepClone({...n,len:t}):Z.deepClone({...n,len:t,body:bt(n.body,r,r+t,!1)})}else return{t:J.RETAIN,len:Number.POSITIVE_INFINITY}}peek(){return this._actions[this._index]}peekLength(){return this._actions[this._index]?this._actions[this._index].len-this._offset:Number.POSITIVE_INFINITY}peekType(){const t=this._actions[this._index];return t?t.t:J.RETAIN}rest(){if(this.hasNext()){if(this._offset===0)return this._actions.slice(this._index);{const t=this._offset,n=this._index,r=this.next(),s=this._actions.slice(this._index);return this._offset=t,this._index=n,[r].concat(s)}}else return[]}}function Tu(e,t,n){const{dataStream:r}=e,s=n,i=n+t,o=gu(e,t,n),a=_u(e,t,n),l=pu(e,t,n),c=Eu(e,t,n),u=Cu(e,t,n),h=z_(e,t,n),d=K_(e,t,n);let m="";return r&&(e.dataStream=bl(r,s,i),m=r.slice(s,i)),{dataStream:m,textRuns:o,paragraphs:a,sectionBreaks:l,customBlocks:c,tables:u,customRanges:h,customDecorations:d}}function yu(e,t,n,r){e.dataStream=wl(e.dataStream,r,t.dataStream),au(e,t,n,r),lu(e,t,n,r),cu(e,t,n,r),uu(e,t,n,r),hu(e,t,n,r),G_(e,t,n,r),V_(e,t,n,r)}function hp(e,t,n,r,s=Ce.COVER){return Z_(e,t,n,r,s)}function dp(e,t,n){return t<=0?{dataStream:""}:Tu(e,t,n)}function fp(e,t,n,r){n!==0&&yu(e,t,n,r)}function mp(e,t){const n=new un;return n.reset(),t.forEach(r=>{const s=Z.deepClone(r);switch(s.t){case J.RETAIN:{const{coverType:i,body:o,len:a}=s;o!=null&&hp(e,o,a,n.cursor,i),n.moveCursor(a);break}case J.INSERT:{const{body:i,len:o}=s;fp(e,i,o,n.cursor),n.moveCursor(o);break}case J.DELETE:{const{len:i}=s;dp(e,i,n.cursor);break}default:throw new Error(`Unknown action type for action: ${s}.`)}}),e}function gp(e,t,n,r,s){if(e==null||t==null)return t;if(e.length===0||t.length===0)return[];t=Z.deepClone(t),e=Z.deepClone(e);const i=[],o=t.length,a=e.length;let l=0,c=0,u=null;function h(){return u?(i.push(u),u=null,!0):!1}for(;l<o&&c<a;){const{st:p,ed:I,ts:A}=t[l],{st:B,ed:x,ts:Y,sId:O}=e[c];let R={};if(s===0)R={...A},n===Ce.COVER&&r===Ce.REPLACE&&Y&&(R=Object.assign({},Y,R));else if(R={...A},n===Ce.REPLACE){if(r===Ce.REPLACE)R={...Y};else if(A&&Y){const b=Object.keys(A);for(const y of b)Y[y]&&delete R[y]}}else if(r===Ce.REPLACE){if(Y){const b=Object.keys(Y);for(const y of b)Y[y]!==void 0&&(R[y]=Y[y])}}else if(Y){const b=Object.keys(Y);for(const y of b)R[y]!==void 0&&delete R[y]}if(I<B)h()||i.push(t[l]),l++;else if(x<p)h()||i.push(e[c]),c++;else{const b={st:Math.min(p,B),ed:Math.max(p,B),ts:p<B?{...A}:{...Y}};b.ed>b.st&&i.push(),i.push({st:Math.max(p,B),ed:Math.min(I,x),ts:R,sId:O}),I<x?(l++,e[c].st=I,e[c].st===e[c].ed&&c++):(c++,t[l].st=x,t[l].st===t[l].ed&&l++);const y={st:Math.min(I,x),ed:Math.max(I,x),ts:I<x?{...Y}:{...A},sId:I<x?O:void 0};u=y.ed>y.st?y:null}}h();const d=i[i.length-1],m=t[o-1],_=e[a-1];return d.ed!==Math.max(m.ed,_.ed)&&(m.ed>_.ed?i.push(m):i.push(_)),yr(i,!0)}function _p(e,t,n,r,s){if(e==null||t==null)return t;if(e.length===0||t.length===0)return[];if(e.length>1||t.length>1)throw new Error("CustomRanges is only supported transform for length one now.");const i=e[0],o=t[0];if(n===Ce.REPLACE)return s===1?[Z.deepClone(i)]:[Z.deepClone(o)];if(r===Ce.REPLACE){const a=Z.deepClone(o);return s===1&&Object.assign(a,Z.deepClone(i)),[a]}else{const a=Z.deepClone(o);return s===1&&Object.assign(a,Z.deepClone(i)),[a]}}function Nu(e,t,n,r,s){const i={startIndex:t.startIndex};if(t.paragraphStyle&&(i.paragraphStyle=Z.deepClone(t.paragraphStyle),e.paragraphStyle)){if(n===Ce.REPLACE)if(r===Ce.REPLACE)s===1&&(i.paragraphStyle={...e.paragraphStyle});else if(s===1){const o=Object.keys(e.paragraphStyle);for(const a of o)e.paragraphStyle[a]!==void 0&&(i.paragraphStyle[a]=e.paragraphStyle[a])}else{const o=Object.keys(e.paragraphStyle);for(const a of o)i.paragraphStyle[a]===void 0&&(i.paragraphStyle[a]=e.paragraphStyle[a])}else if(r===Ce.REPLACE)if(s===1){const o=Object.keys(e.paragraphStyle);for(const a of o)e.paragraphStyle[a]!==void 0&&(i.paragraphStyle[a]=e.paragraphStyle[a])}else{const o=Object.keys(e.paragraphStyle);for(const a of o)i.paragraphStyle[a]===void 0&&(i.paragraphStyle[a]=e.paragraphStyle[a])}else if(s===1){const o=Object.keys(e.paragraphStyle);for(const a of o)i.paragraphStyle[a]&&delete i.paragraphStyle[a]}}return n===Ce.REPLACE&&r===Ce.REPLACE?i.bullet=s===1?Z.deepClone(e.bullet):Z.deepClone(t.bullet):e.bullet===void 0?i.bullet=Z.deepClone(t.bullet):n===Ce.REPLACE||r===Ce.REPLACE?i.bullet=s===0&&t.bullet?Z.deepClone(t.bullet):Z.deepClone(e.bullet):s===0&&t.bullet!==void 0&&(i.bullet=Z.deepClone(t.bullet)),i}function pp(e,t){if(e==null||t==null)return t;if(e.length===0||t.length===0)return Z.deepClone(t);const n=[];for(const r of t){const{id:s,type:i}=r;let o=!1;for(const a of e)if(a.id===s){(a.type===_n.DELETED||i===_n.DELETED)&&(o=!0,n.push({...r,type:_n.DELETED}));break}o||n.push(r)}return n}function Ep(e,t,n=!1){const{body:r,coverType:s=Ce.COVER}=e,{body:i,coverType:o=Ce.COVER}=t;if(r==null||r.dataStream!==""||i==null||i.dataStream!=="")throw new Error("Data stream is not supported in retain transform.");const a={dataStream:""},l=o,{textRuns:c,paragraphs:u=[],customRanges:h,customDecorations:d}=r,{textRuns:m,paragraphs:_=[],customRanges:p,customDecorations:I}=i,A=gp(c,m,s,o,n?1:0);A&&(a.textRuns=A);const B=_p(h,p,s,o,n?1:0);B&&(a.customRanges=B);const x=pp(d,I);x&&(a.customDecorations=x);const Y=[];let O=0,R=0;for(;O<u.length&&R<_.length;){const b=u[O],y=_[R],{startIndex:$}=b,{startIndex:H}=y;if($===H){let g={startIndex:$};n?g=Nu(b,y,s,o,1):g=Nu(b,y,s,o,0),Y.push(g),O++,R++}else $<H?O++:(Y.push(Z.deepClone(y)),R++)}return R<_.length&&Y.push(..._.slice(R)),Y.length&&(a.paragraphs=Y),{coverType:l,body:a}}function Mu(e){return Object.keys(e).length===1}const Zn=class Zn{constructor(){C(this,"_actions",[])}static apply(t,n){return mp(t,n)}static compose(t,n){const r=new jn(t),s=new jn(n),i=new Zn;for(;r.hasNext()||s.hasNext();)if(s.peekType()===J.INSERT)i.push(s.next());else if(r.peekType()===J.DELETE)i.push(r.next());else{const o=Math.min(r.peekLength(),s.peekLength()),a=r.next(o),l=s.next(o);if(a.t===J.INSERT&&l.t===J.RETAIN)l.body==null?i.push(a):i.push({...a,body:To(a.body,l.body,l.coverType)});else if(a.t===J.RETAIN&&l.t===J.RETAIN)if(a.body==null&&l.body==null)i.push(a.len!==Number.POSITIVE_INFINITY?a:l);else if(a.body&&l.body){const c=a.coverType===Ce.REPLACE||l.coverType===Ce.REPLACE?Ce.REPLACE:Ce.COVER;i.push({...a,t:J.RETAIN,coverType:c,body:To(a.body,l.body,l.coverType)})}else i.push(a.body?a:l);else a.t===J.RETAIN&&l.t===J.DELETE?i.push(l):a.t===J.INSERT&&(l.t,J.DELETE)}return i.trimEndUselessRetainAction(),i.serialize()}static transform(t,n,r="right"){return this._transform(n,t,r==="left"?"right":"left")}static _transform(t,n,r="right"){const s=new jn(t),i=new jn(n),o=new Zn;for(;s.hasNext()||i.hasNext();)if(s.peekType()===J.INSERT&&(r==="left"||i.peekType()!==J.INSERT)){const a=s.next();o.retain(a.len)}else if(i.peekType()===J.INSERT)o.push(i.next());else{const a=Math.min(s.peekLength(),i.peekLength()),l=s.next(a),c=i.next(a);if(l.t===J.DELETE)continue;if(c.t===J.DELETE){o.push(c);continue}if(l.body==null||c.body==null)o.push(c);else{const{coverType:u,body:h}=Ep(l,c,r==="left");o.push({...c,t:J.RETAIN,coverType:u,body:h})}}return o.trimEndUselessRetainAction(),o.serialize()}static transformPosition(t,n,r=!1){const s=new jn(t);let i=0;for(;s.hasNext()&&i<=n;){const o=s.peekLength(),a=s.peekType();if(s.next(),a===J.DELETE){n-=Math.min(o,n-i);continue}else a===J.INSERT&&(i<n||!r)&&(n+=o);i+=o}return n}static isNoop(t){return t.length===0}static invert(t){const n=[];for(const r of t)if(r.t===J.INSERT)n.push({t:J.DELETE,len:r.len,body:r.body});else if(r.t===J.DELETE){if(r.body==null)throw new Error("Can not invert DELETE action without body property, makeInvertible must be called first.");n.push({t:J.INSERT,body:r.body,len:r.len})}else if(r.body!=null){if(r.oldBody==null)throw new Error("Can not invert RETAIN action without oldBody property, makeInvertible must be called first.");n.push({t:J.RETAIN,body:r.oldBody,oldBody:r.body,len:r.len,coverType:Ce.REPLACE})}else n.push(r);return n}static makeInvertible(t,n){const r=[];let s=0;for(const i of t){if(i.t===J.DELETE&&(i.body==null||i.body&&i.body.dataStream.length!==i.len)){const o=bt(n,s,s+i.len,!1);i.len=o.dataStream.length,i.body=o}if(i.t===J.RETAIN&&i.body!=null){const o=bt(n,s,s+i.len,!0);i.oldBody={...o,dataStream:""},i.len=o.dataStream.length}r.push(i),i.t!==J.INSERT&&(s+=i.len)}return r}insert(t,n){const r={t:J.INSERT,body:n,len:t};return this.push(r),this}retain(t,n,r){const s={t:J.RETAIN,len:t};return n!=null&&(s.body=n),r!=null&&(s.coverType=r),this.push(s),this}delete(t){const n={t:J.DELETE,len:t};return this.push(n),this}empty(){return this._actions=[],this}serialize(){return this._actions}push(...t){if(t.length>1){for(const i of t)this.push(i);return this}let n=this._actions.length,r=this._actions[n-1];const s=Z.deepClone(t[0]);if(s.t===J.RETAIN&&s.len===0&&s.body==null)return this;if(typeof r=="object"){if(r.t===J.DELETE&&s.t===J.DELETE)return r.len+=s.len,this;if(r.t===J.DELETE&&s.t===J.INSERT&&(n-=1,r=this._actions[n-1],r==null))return this._actions.unshift(s),this;if(r.t===J.RETAIN&&s.t===J.RETAIN&&r.body==null&&s.body==null)return r.len+=s.len,this;if(r.t===J.INSERT&&Mu(r.body)&&s.t===J.INSERT&&Mu(s.body))return r.len+=s.len,r.body.dataStream+=s.body.dataStream,this}return n===this._actions.length?this._actions.push(s):this._actions.splice(n,0,s),this}trimEndUselessRetainAction(){let t=this._actions[this._actions.length-1];for(;t&&t.t===J.RETAIN&&up(t);)this._actions.pop(),t=this._actions[this._actions.length-1];return this}};C(Zn,"id","text-x"),C(Zn,"uri","https://github.com/dream-num/univer#text-x");let Me=Zn;Object.defineProperty(Me,"name",{value:"text-x"});const Jn=class Jn{static registerSubtype(t){var n;t==null||this._subTypes.has(t.name)&&((n=this._subTypes.get(t.name))==null?void 0:n.id)!==Me.id||(this._subTypes.set(t.name,t),at.type.registerSubtype(t))}static apply(t,n){if(!at.type.isNoop(n))return at.type.apply(t,n)}static compose(t,n){return at.type.compose(t,n)}static transform(t,n,r){return at.type.transform(t,n,r)}static transformPosition(t,n,r="right"){return t&&t.length===2&&t[0]==="body"&&t[1].et===Me.name?Me.transformPosition(t[1].e,n,r==="left"):n}static invertWithDoc(t,n){return at.type.invertWithDoc(t,n)}static isNoop(t){return at.type.isNoop(t)}static getInstance(){return this._instance==null&&(this._instance=new Jn),this._instance}removeOp(t,n){return at.removeOp(t,n)}moveOp(t,n){return at.moveOp(t,n)}insertOp(t,n){return at.insertOp(t,n)}replaceOp(t,n,r){return at.replaceOp(t,n,r)}editOp(t,n=["body"]){return at.editOp(n,Me.name,t)}};C(Jn,"uri","https://github.com/dream-num/univer#json-x"),C(Jn,"_subTypes",new Map),C(Jn,"_instance",null);let Wt=Jn;Wt.registerSubtype(Me);var Lu=(e=>(e.PARAGRAPH="PARAGRAPH",e.SECTION_BREAK="SECTION_BREAK",e.TABLE="TABLE",e.TABLE_ROW="TABLE_ROW",e.TABLE_CELL="TABLE_CELL",e.CUSTOM_BLOCK="CUSTOM_BLOCK",e))(Lu||{}),lt=(e=>(e.PARAGRAPH="\r",e.SECTION_BREAK=`
1214
1214
  `,e.TABLE_START="",e.TABLE_ROW_START="\x1B",e.TABLE_CELL_START="",e.TABLE_CELL_END="",e.TABLE_ROW_END="",e.TABLE_END="",e.CUSTOM_RANGE_START="",e.CUSTOM_RANGE_END="",e.COLUMN_BREAK="\v",e.PAGE_BREAK="\f",e.DOCS_END="\0",e.TAB=" ",e.CUSTOM_BLOCK="\b",e.LETTER="",e.SPACE=" ",e))(lt||{});function Cp(e){return`${e}`}const Rp=[lt.TABLE_START,lt.TABLE_ROW_START,lt.TABLE_CELL_START,lt.TABLE_CELL_END,lt.TABLE_ROW_END,lt.TABLE_END],Ws=e=>{const t=e.endsWith(`\r
1215
- `)?e.slice(0,-2):e;return Rp.reduce((n,r)=>n.replaceAll(r,""),t)},Ip=e=>e?Ws(e).replaceAll("\r","")==="":!0,Sp=e=>{const t=e.replace(/\n/g,"\r"),n=[],r=[];let s=0,i="";const o=(l,c=!0)=>{const u=t.slice(s,l);if(Z.isLegalUrl(u)){const h=tt(),d=`${u}`,m={startIndex:s,endIndex:s+d.length-1,rangeId:h,rangeType:en.HYPERLINK,properties:{url:e}};r.push(m),i+=d,s=l+1,c&&(i+="\r",n.push({startIndex:l}))}else i+=t.slice(s,l+1),s=l+1,c&&n.push({startIndex:l})};let a=0;for(let l=0;l<t.length;l++)t[l]==="\r"&&(o(l),a=l);return(a!==t.length-1||t.length===1)&&o(t.length,!1),{dataStream:i,paragraphs:n,customRanges:r}},yo={id:"default_doc",documentStyle:{}};class Op extends Ps{constructor(n){var r;super();C(this,"type",we.UNIVER_DOC);C(this,"_name$",new oe.BehaviorSubject(""));C(this,"name$",this._name$.asObservable());C(this,"snapshot");this.snapshot={...yo,...n},this._name$.next((r=this.snapshot.title)!=null?r:"No Title")}getUnitId(){throw new Error("Method not implemented.")}getRev(){var n;return(n=this.snapshot.rev)!=null?n:1}incrementRev(){this.snapshot.rev=this.getRev()+1}setRev(n){this.snapshot.rev=n}setName(n){this.snapshot.title=n,this._name$.next(n)}get drawings(){return this.snapshot.drawings}get documentStyle(){return this.snapshot.documentStyle}get lists(){return this.snapshot.lists}get zoomRatio(){var n;return((n=this.snapshot.settings)==null?void 0:n.zoomRatio)||1}resetDrawing(n,r){this.snapshot.drawings=n,this.snapshot.drawingsOrder=r}getBody(){return this.snapshot.body}getSnapshot(){return this.snapshot}getBulletPresetList(){var s;const n=(s=this.snapshot.lists)!=null?s:{};return{...Nr,...n}}updateDocumentId(n){this.snapshot.id=n}updateDocumentRenderConfig(n){const{documentStyle:r}=this.snapshot;r.renderConfig==null?r.renderConfig=n:r.renderConfig={...r.renderConfig,...n}}getDocumentStyle(){return this.snapshot.documentStyle}updateDocumentStyle(n){this.snapshot.documentStyle==null?this.snapshot.documentStyle=n:this.snapshot.documentStyle={...this.snapshot.documentStyle,...n}}updateDocumentDataMargin(n){const{t:r,l:s,b:i,r:o}=n,{documentStyle:a}=this.snapshot;r!=null&&(a.marginTop=r),s!=null&&(a.marginLeft=s),i!=null&&(a.marginBottom=i),o!=null&&(a.marginRight=o)}updateDocumentDataPageSize(n,r){const{documentStyle:s}=this.snapshot;if(!s.pageSize){n=n!=null?n:Number.POSITIVE_INFINITY,r=r!=null?r:Number.POSITIVE_INFINITY,s.pageSize={width:n,height:r};return}n!==void 0&&(s.pageSize.width=n),r!==void 0&&(s.pageSize.height=r)}updateDrawing(n,r){const{drawings:s}=this,{width:i,height:o,left:a,top:l}=r,c=s==null?void 0:s[n];if(!c)return;const u=c.docTransform;u.size.width=i,u.size.height=o,u.positionH.posOffset=a,u.positionV.posOffset=l}setZoomRatio(n=1){this.snapshot.settings==null?this.snapshot.settings={zoomRatio:n}:this.snapshot.settings.zoomRatio=1}setDisabled(n){this.snapshot.disabled=n}getDisabled(){return this.snapshot.disabled}getTitle(){return this.snapshot.title}}class At extends Op{constructor(n){var s,i;super(Z.isEmptyObject(n)?F_():n);C(this,"_unitId");C(this,"headerModelMap",new Map);C(this,"footerModelMap",new Map);C(this,"change$",new oe.BehaviorSubject(0));const r=6;this._unitId=(s=this.snapshot.id)!=null?s:tt(r),this._initializeHeaderFooterModel(),this._name$.next((i=this.snapshot.title)!=null?i:"")}dispose(){super.dispose(),this.headerModelMap.forEach(n=>{n.dispose()}),this.footerModelMap.forEach(n=>{n.dispose()}),this._name$.complete()}getDrawings(){return this.snapshot.drawings}getDrawingsOrder(){return this.snapshot.drawingsOrder}getCustomRanges(){var n;return(n=this.snapshot.body)==null?void 0:n.customRanges}getCustomDecorations(){var n;return(n=this.snapshot.body)==null?void 0:n.customDecorations}getSettings(){return this.snapshot.settings}reset(n){if(n.id&&n.id!==this._unitId)throw new Error("Cannot reset a document model with a different unit id!");this.snapshot={...yo,...n},this._initializeHeaderFooterModel(),this.change$.next(this.change$.value+1)}getSelfOrHeaderFooterModel(n){if(n!=null){if(this.headerModelMap.has(n))return this.headerModelMap.get(n);if(this.footerModelMap.has(n))return this.footerModelMap.get(n)}return this}getUnitId(){return this._unitId}apply(n){if(!Wt.isNoop(n))return this.snapshot=Wt.apply(this.snapshot,n),n!=null&&n.some(r=>Array.isArray(r)&&((r==null?void 0:r[0])==="headers"||(r==null?void 0:r[0])==="footers"))&&(this.headerModelMap.clear(),this.footerModelMap.clear(),this._initializeHeaderFooterModel()),this.change$.next(this.change$.value+1),this.snapshot}sliceBody(n,r,s=Ao.copy){const i=this.getBody();if(i!=null)return bt(i,n,r,!1,s)}_initializeHeaderFooterModel(){const{headers:n,footers:r}=this.getSnapshot();if(n)for(const s in n){const i=n[s];this.headerModelMap.set(s,new At(i)),this.headerModelMap.get(s).updateDocumentId(this.getUnitId())}if(r)for(const s in r){const i=r[s];this.footerModelMap.set(s,new At(i)),this.footerModelMap.get(s).updateDocumentId(this.getUnitId())}}updateDocumentId(n){super.updateDocumentId(n),this._unitId=n}getPlainText(){var n,r;return Ws((r=(n=this.getBody())==null?void 0:n.dataStream)!=null?r:"")}}function vp(e){const{ranges:t,id:n,type:r}=e,s=new Me;let i=0;for(let o=0;o<t.length;o++){const a=t[o],{startOffset:l,endOffset:c}=a;l>0&&s.push({t:J.RETAIN,len:l-i}),s.push({t:J.RETAIN,body:{dataStream:"",customDecorations:[{id:n,type:r,startIndex:0,endIndex:c-l-1}]},len:c-l}),i=c}return s}function wp(e){var u,h,d;const{id:t,segmentId:n,documentDataModel:r}=e,s=r==null?void 0:r.getBody();if(!r||!s)return!1;const i=(d=(h=(u=r.getSelfOrHeaderFooterModel(n))==null?void 0:u.getBody())==null?void 0:h.customDecorations)==null?void 0:d.find(m=>m.id===t);if(!i)return!1;const o=new Me,{startIndex:a,endIndex:l}=i,c=l-a+1;return o.push({t:J.RETAIN,len:a}),o.push({t:J.RETAIN,len:c,body:{dataStream:"",customDecorations:[{startIndex:0,endIndex:c-1,id:t,type:_n.DELETED}]}}),o}function Du(e,t,n,r){return e<=n&&t>=n||e>=n&&e<=r}function bp(e,t){const n=[];for(let r=0,s=t.length;r<s;r++){const i=t[r];e.collapsed?i.startIndex<e.startOffset&&e.startOffset<=i.endIndex&&n.push(i):Du(e.startOffset,e.endOffset-1,i.startIndex,i.endIndex)&&n.push(i)}return n}function Ap(e){return{...Z.deepClone(e),rangeId:tt()}}function Tp(e,t){const n=[];let r=e[0];for(const s of t)s<e[0]||s>e[1]||(r<s&&n.push([r,s-1]),r=s+1);return r<=e[1]&&n.push([r,e[1]]),n}function Uu(e,t,n,r){const s=[];for(let i=0,o=n.length;i<o;i++){const a=n[i];if((r===void 0||a.rangeType===r)&&Math.max(a.startIndex,e)<=Math.min(a.endIndex,t)&&s.push({...a}),a.startIndex>t)break}return s}function yp(e,t){var i,o,a,l,c;const n=Uu(e.startOffset,e.collapsed?e.startOffset:e.endOffset-1,(i=t.customRanges)!=null?i:[]),r=Math.min(e.startOffset,(a=(o=n[0])==null?void 0:o.startIndex)!=null?a:1/0),s=Math.max(e.endOffset,((c=(l=n[n.length-1])==null?void 0:l.endIndex)!=null?c:-1/0)+1);return{startOffset:r,endOffset:s,collapsed:r===s}}var No,Pu;function Np(){if(Pu)return No;Pu=1;var e=-1,t=1,n=0;function r(g,P,v,M,T){if(g===P)return g?[[n,g]]:[];if(v!=null){var w=$(g,P,v);if(w)return w}var N=a(g,P),L=g.substring(0,N);g=g.substring(N),P=P.substring(N),N=c(g,P);var D=g.substring(g.length-N);g=g.substring(0,g.length-N),P=P.substring(0,P.length-N);var F=s(g,P);return L&&F.unshift([n,L]),D&&F.push([n,D]),B(F,T),M&&h(F),F}function s(g,P){var v;if(!g)return[[t,P]];if(!P)return[[e,g]];var M=g.length>P.length?g:P,T=g.length>P.length?P:g,w=M.indexOf(T);if(w!==-1)return v=[[t,M.substring(0,w)],[n,T],[t,M.substring(w+T.length)]],g.length>P.length&&(v[0][0]=v[2][0]=e),v;if(T.length===1)return[[e,g],[t,P]];var N=u(g,P);if(N){var L=N[0],D=N[1],F=N[2],Q=N[3],z=N[4],le=r(L,F),ue=r(D,Q);return le.concat([[n,z]],ue)}return i(g,P)}function i(g,P){for(var v=g.length,M=P.length,T=Math.ceil((v+M)/2),w=T,N=2*T,L=new Array(N),D=new Array(N),F=0;F<N;F++)L[F]=-1,D[F]=-1;L[w+1]=0,D[w+1]=0;for(var Q=v-M,z=Q%2!==0,le=0,ue=0,S=0,U=0,G=0;G<T;G++){for(var V=-G+le;V<=G-ue;V+=2){var W=w+V,j;V===-G||V!==G&&L[W-1]<L[W+1]?j=L[W+1]:j=L[W-1]+1;for(var ee=j-V;j<v&&ee<M&&g.charAt(j)===P.charAt(ee);)j++,ee++;if(L[W]=j,j>v)ue+=2;else if(ee>M)le+=2;else if(z){var te=w+Q-V;if(te>=0&&te<N&&D[te]!==-1){var k=v-D[te];if(j>=k)return o(g,P,j,ee)}}}for(var K=-G+S;K<=G-U;K+=2){var te=w+K,k;K===-G||K!==G&&D[te-1]<D[te+1]?k=D[te+1]:k=D[te-1]+1;for(var q=k-K;k<v&&q<M&&g.charAt(v-k-1)===P.charAt(M-q-1);)k++,q++;if(D[te]=k,k>v)U+=2;else if(q>M)S+=2;else if(!z){var W=w+Q-K;if(W>=0&&W<N&&L[W]!==-1){var j=L[W],ee=w+j-W;if(k=v-k,j>=k)return o(g,P,j,ee)}}}}return[[e,g],[t,P]]}function o(g,P,v,M){var T=g.substring(0,v),w=P.substring(0,M),N=g.substring(v),L=P.substring(M),D=r(T,w),F=r(N,L);return D.concat(F)}function a(g,P){if(!g||!P||g.charAt(0)!==P.charAt(0))return 0;for(var v=0,M=Math.min(g.length,P.length),T=M,w=0;v<T;)g.substring(w,T)==P.substring(w,T)?(v=T,w=v):M=T,T=Math.floor((M-v)/2+v);return x(g.charCodeAt(T-1))&&T--,T}function l(g,P){var v=g.length,M=P.length;if(v==0||M==0)return 0;v>M?g=g.substring(v-M):v<M&&(P=P.substring(0,v));var T=Math.min(v,M);if(g==P)return T;for(var w=0,N=1;;){var L=g.substring(T-N),D=P.indexOf(L);if(D==-1)return w;N+=D,(D==0||g.substring(T-N)==P.substring(0,N))&&(w=N,N++)}}function c(g,P){if(!g||!P||g.slice(-1)!==P.slice(-1))return 0;for(var v=0,M=Math.min(g.length,P.length),T=M,w=0;v<T;)g.substring(g.length-T,g.length-w)==P.substring(P.length-T,P.length-w)?(v=T,w=v):M=T,T=Math.floor((M-v)/2+v);return Y(g.charCodeAt(g.length-T))&&T--,T}function u(g,P){var v=g.length>P.length?g:P,M=g.length>P.length?P:g;if(v.length<4||M.length*2<v.length)return null;function T(ue,S,U){for(var G=ue.substring(U,U+Math.floor(ue.length/4)),V=-1,W="",j,ee,te,k;(V=S.indexOf(G,V+1))!==-1;){var K=a(ue.substring(U),S.substring(V)),q=c(ue.substring(0,U),S.substring(0,V));W.length<q+K&&(W=S.substring(V-q,V)+S.substring(V,V+K),j=ue.substring(0,U-q),ee=ue.substring(U+K),te=S.substring(0,V-q),k=S.substring(V+K))}return W.length*2>=ue.length?[j,ee,te,k,W]:null}var w=T(v,M,Math.ceil(v.length/4)),N=T(v,M,Math.ceil(v.length/2)),L;if(!w&&!N)return null;N?w?L=w[4].length>N[4].length?w:N:L=N:L=w;var D,F,Q,z;g.length>P.length?(D=L[0],F=L[1],Q=L[2],z=L[3]):(Q=L[0],z=L[1],D=L[2],F=L[3]);var le=L[4];return[D,F,Q,z,le]}function h(g){for(var P=!1,v=[],M=0,T=null,w=0,N=0,L=0,D=0,F=0;w<g.length;)g[w][0]==n?(v[M++]=w,N=D,L=F,D=0,F=0,T=g[w][1]):(g[w][0]==t?D+=g[w][1].length:F+=g[w][1].length,T&&T.length<=Math.max(N,L)&&T.length<=Math.max(D,F)&&(g.splice(v[M-1],0,[e,T]),g[v[M-1]+1][0]=t,M--,M--,w=M>0?v[M-1]:-1,N=0,L=0,D=0,F=0,T=null,P=!0)),w++;for(P&&B(g),A(g),w=1;w<g.length;){if(g[w-1][0]==e&&g[w][0]==t){var Q=g[w-1][1],z=g[w][1],le=l(Q,z),ue=l(z,Q);le>=ue?(le>=Q.length/2||le>=z.length/2)&&(g.splice(w,0,[n,z.substring(0,le)]),g[w-1][1]=Q.substring(0,Q.length-le),g[w+1][1]=z.substring(le),w++):(ue>=Q.length/2||ue>=z.length/2)&&(g.splice(w,0,[n,Q.substring(0,ue)]),g[w-1][0]=t,g[w-1][1]=z.substring(0,z.length-ue),g[w+1][0]=e,g[w+1][1]=Q.substring(ue),w++),w++}w++}}var d=/[^a-zA-Z0-9]/,m=/\s/,_=/[\r\n]/,p=/\n\r?\n$/,I=/^\r?\n\r?\n/;function A(g){function P(ue,S){if(!ue||!S)return 6;var U=ue.charAt(ue.length-1),G=S.charAt(0),V=U.match(d),W=G.match(d),j=V&&U.match(m),ee=W&&G.match(m),te=j&&U.match(_),k=ee&&G.match(_),K=te&&ue.match(p),q=k&&S.match(I);return K||q?5:te||k?4:V&&!j&&ee?3:j||ee?2:V||W?1:0}for(var v=1;v<g.length-1;){if(g[v-1][0]==n&&g[v+1][0]==n){var M=g[v-1][1],T=g[v][1],w=g[v+1][1],N=c(M,T);if(N){var L=T.substring(T.length-N);M=M.substring(0,M.length-N),T=L+T.substring(0,T.length-N),w=L+w}for(var D=M,F=T,Q=w,z=P(M,T)+P(T,w);T.charAt(0)===w.charAt(0);){M+=T.charAt(0),T=T.substring(1)+w.charAt(0),w=w.substring(1);var le=P(M,T)+P(T,w);le>=z&&(z=le,D=M,F=T,Q=w)}g[v-1][1]!=D&&(D?g[v-1][1]=D:(g.splice(v-1,1),v--),g[v][1]=F,Q?g[v+1][1]=Q:(g.splice(v+1,1),v--))}v++}}function B(g,P){g.push([n,""]);for(var v=0,M=0,T=0,w="",N="",L;v<g.length;){if(v<g.length-1&&!g[v][1]){g.splice(v,1);continue}switch(g[v][0]){case t:T++,N+=g[v][1],v++;break;case e:M++,w+=g[v][1],v++;break;case n:var D=v-T-M-1;if(P){if(D>=0&&R(g[D][1])){var F=g[D][1].slice(-1);if(g[D][1]=g[D][1].slice(0,-1),w=F+w,N=F+N,!g[D][1]){g.splice(D,1),v--;var Q=D-1;g[Q]&&g[Q][0]===t&&(T++,N=g[Q][1]+N,Q--),g[Q]&&g[Q][0]===e&&(M++,w=g[Q][1]+w,Q--),D=Q}}if(O(g[v][1])){var F=g[v][1].charAt(0);g[v][1]=g[v][1].slice(1),w+=F,N+=F}}if(v<g.length-1&&!g[v][1]){g.splice(v,1);break}if(w.length>0||N.length>0){w.length>0&&N.length>0&&(L=a(N,w),L!==0&&(D>=0?g[D][1]+=N.substring(0,L):(g.splice(0,0,[n,N.substring(0,L)]),v++),N=N.substring(L),w=w.substring(L)),L=c(N,w),L!==0&&(g[v][1]=N.substring(N.length-L)+g[v][1],N=N.substring(0,N.length-L),w=w.substring(0,w.length-L)));var z=T+M;w.length===0&&N.length===0?(g.splice(v-z,z),v=v-z):w.length===0?(g.splice(v-z,z,[t,N]),v=v-z+1):N.length===0?(g.splice(v-z,z,[e,w]),v=v-z+1):(g.splice(v-z,z,[e,w],[t,N]),v=v-z+2)}v!==0&&g[v-1][0]===n?(g[v-1][1]+=g[v][1],g.splice(v,1)):v++,T=0,M=0,w="",N="";break}}g[g.length-1][1]===""&&g.pop();var le=!1;for(v=1;v<g.length-1;)g[v-1][0]===n&&g[v+1][0]===n&&(g[v][1].substring(g[v][1].length-g[v-1][1].length)===g[v-1][1]?(g[v][1]=g[v-1][1]+g[v][1].substring(0,g[v][1].length-g[v-1][1].length),g[v+1][1]=g[v-1][1]+g[v+1][1],g.splice(v-1,1),le=!0):g[v][1].substring(0,g[v+1][1].length)==g[v+1][1]&&(g[v-1][1]+=g[v+1][1],g[v][1]=g[v][1].substring(g[v+1][1].length)+g[v+1][1],g.splice(v+1,1),le=!0)),v++;le&&B(g,P)}function x(g){return g>=55296&&g<=56319}function Y(g){return g>=56320&&g<=57343}function O(g){return Y(g.charCodeAt(0))}function R(g){return x(g.charCodeAt(g.length-1))}function b(g){for(var P=[],v=0;v<g.length;v++)g[v][1].length>0&&P.push(g[v]);return P}function y(g,P,v,M){return R(g)||O(M)?null:b([[n,g],[e,P],[t,v],[n,M]])}function $(g,P,v){var M=typeof v=="number"?{index:v,length:0}:v.oldRange,T=typeof v=="number"?null:v.newRange,w=g.length,N=P.length;if(M.length===0&&(T===null||T.length===0)){var L=M.index,D=g.slice(0,L),F=g.slice(L),Q=T?T.index:null;e:{var z=L+N-w;if(Q!==null&&Q!==z||z<0||z>N)break e;var le=P.slice(0,z),ue=P.slice(z);if(ue!==F)break e;var S=Math.min(L,z),U=D.slice(0,S),G=le.slice(0,S);if(U!==G)break e;var V=D.slice(S),W=le.slice(S);return y(U,V,W,F)}e:{if(Q!==null&&Q!==L)break e;var j=L,le=P.slice(0,j),ue=P.slice(j);if(le!==D)break e;var ee=Math.min(w-j,N-j),te=F.slice(F.length-ee),k=ue.slice(ue.length-ee);if(te!==k)break e;var V=F.slice(0,F.length-ee),W=ue.slice(0,ue.length-ee);return y(D,V,W,te)}}if(M.length>0&&T&&T.length===0)e:{var U=g.slice(0,M.index),te=g.slice(M.index+M.length),S=U.length,ee=te.length;if(N<S+ee)break e;var G=P.slice(0,S),k=P.slice(N-ee);if(U!==G||te!==k)break e;var V=g.slice(S,w-ee),W=P.slice(S,N-ee);return y(U,V,W,te)}return null}function H(g,P,v,M){return r(g,P,v,M,!0)}return H.INSERT=t,H.DELETE=e,H.EQUAL=n,No=H,No}var Mp=Np();const Mo=mt(Mp);function Lp(e){var h,d,m;const{rangeId:t,segmentId:n,documentDataModel:r,insert:s}=e,i=(d=(h=r.getSelfOrHeaderFooterModel(n).getBody())==null?void 0:h.customRanges)==null?void 0:d.find(_=>_.rangeId===t);if(!i)return!1;const{startIndex:o,endIndex:a}=i,l=new Me,c=a-o+1;l.push({t:J.RETAIN,len:o}),l.push({t:J.RETAIN,len:c,body:{dataStream:"",customRanges:[]}}),s&&l.push({t:J.INSERT,body:s,len:s.dataStream.length});const u=a+1+((m=s==null?void 0:s.dataStream.length)!=null?m:0);return l.selections=[{startOffset:u,endOffset:u,collapsed:!0}],l}function Dp(e){const{ranges:t,rangeId:n,rangeType:r,wholeEntity:s,properties:i,body:o}=e;let a=0;const l=new Me;let c=!1;return t.forEach(u=>{var x,Y,O;const h=yp(u,o);if(!h||!o)return!1;const{startOffset:d,endOffset:m}=h,_=(x=o.customRanges)!=null?x:[],p=(R,b,y)=>{var v,M,T,w;const $=Uu(R,b,_,r),H=Math.min((M=(v=$[0])==null?void 0:v.startIndex)!=null?M:1/0,R),g=Math.max((w=(T=$[$.length-1])==null?void 0:T.endIndex)!=null?w:-1/0,b),P={rangeId:y?`${n}$${y}`:n,rangeType:r,startIndex:0,endIndex:g-H,wholeEntity:s,properties:{...i}};l.push({t:J.RETAIN,len:H-a}),l.push({t:J.RETAIN,len:g-H+1,body:{dataStream:"",customRanges:[P]},coverType:Ce.COVER}),a=g+1},I=((Y=o.paragraphs)!=null?Y:[]).filter(R=>R.startIndex<m&&R.startIndex>d),A=((O=o.customBlocks)!=null?O:[]).filter(R=>R.startIndex<m&&R.startIndex>d);Tp([d,m-1],[...I.map(R=>R.startIndex),...A.map(R=>R.startIndex)]).forEach(([R,b],y)=>p(R,b,y)),c=!0,l.selections=[{startOffset:h.endOffset,endOffset:h.endOffset,collapsed:!0}]}),c?l:!1}function ku(e,t,n=0,r=null,s=!0){e.sort((c,u)=>c.startOffset-u.startOffset);const i=[],{paragraphs:o=[]}=t,a=o==null?void 0:o.find(c=>c.startIndex>=e[0].startOffset&&c.startIndex<e[0].endOffset);let l=n;if(e.forEach(c=>{const{startOffset:u,endOffset:h}=c;u>l&&(i.push({t:J.RETAIN,len:u-l}),l=u),l<h&&(i.push({t:J.DELETE,len:h-l}),l=h)}),r&&i.push({t:J.INSERT,body:r,len:r.dataStream.length}),a&&s){const c=o.find(u=>u.startIndex-n>=e[e.length-1].endOffset-1);c&&(c.startIndex>l&&(i.push({t:J.RETAIN,len:c.startIndex-l}),l=c.startIndex),i.push({t:J.RETAIN,len:1,body:{dataStream:"",paragraphs:[{...c,startIndex:0,bullet:a==null?void 0:a.bullet}]},coverType:Ce.REPLACE}))}return i}function Up(e,t,n=0){const r=[];let s=n;return e.forEach(i=>{const{startOffset:o,endOffset:a}=i;o>s&&(r.push({t:J.RETAIN,len:o-s}),s=o),a>s&&(r.push({t:J.RETAIN,len:a-s,body:{...Z.deepClone(t),dataStream:""}}),s=a)}),r}const Pp=e=>{var h;const{selection:t,body:n,doc:r}=e,s=t.segmentId,i=(h=r.getSelfOrHeaderFooterModel(s))==null?void 0:h.getBody();if(!i)return!1;const o=t.collapsed?null:bt(i,t.startOffset,t.endOffset),a=Mo(o?o.dataStream:"",n.dataStream);let l=0;const c=a.map(([d,m])=>{switch(d){case 0:{const _={t:J.RETAIN,body:{...bt(n,l,l+m.length,!1),dataStream:""},len:m.length};return l+=m.length,_}case 1:{const _={t:J.INSERT,body:bt(n,l,l+m.length),len:m.length};return l+=m.length,_}default:return{t:J.DELETE,len:m.length}}}),u=new Me;return u.push({t:J.RETAIN,len:t.startOffset}),u.push(...c),u};function kp(e,t){return!!((e==null?void 0:e.length)===(t==null?void 0:t.length)&&(e!=null&&e.every((n,r)=>JSON.stringify(n)===JSON.stringify(t==null?void 0:t[r]))))}const Fp=e=>{var d;const{selection:t,body:n,doc:r,themeService:s}=e,i=t.segmentId,o=(d=r.getSelfOrHeaderFooterModel(i))==null?void 0:d.getBody();if(!o)return!1;const a=t.collapsed?null:bt(o,t.startOffset,t.endOffset),l=Mo(a?a.dataStream:"",n.dataStream);let c=0;const u=l.map(([m,_])=>{switch(m){case 0:{const p=Hs(n,c,c+_.length,!1),I=Hs(a,c,c+_.length,!1),A={t:J.RETAIN,body:kp(p,I)?void 0:{textRuns:p==null?void 0:p.map(B=>{var x,Y,O,R,b,y,$;return{...B,ts:{...B.ts,cl:(O=(Y=(x=B.ts)==null?void 0:x.cl)==null?void 0:Y.rgb)!=null&&O.includes(".")?{rgb:s.getColorFromTheme((y=(b=(R=B.ts)==null?void 0:R.cl)==null?void 0:b.rgb)!=null?y:"")}:($=B.ts)==null?void 0:$.cl}}}),dataStream:""},len:_.length};return c+=_.length,A}case 1:{const p={t:J.INSERT,body:bt(n,c,c+_.length),len:_.length};return c+=_.length,p}default:return{t:J.DELETE,len:_.length}}});if(u.every(m=>m.t===J.RETAIN&&!m.body))return!1;const h=new Me;return h.push({t:J.RETAIN,len:t.startOffset}),h.push(...u),h};function xp(e,t){const n=[],{customBlocks:r=[]}=e;for(const s of t){const{startOffset:i,endOffset:o}=s;if(!(i==null||o==null))for(const a of r){const{startIndex:l}=a;l>=i&&l<o&&n.push(a.blockId)}}return n}function Bp(e,t=""){if(!t)return["body"];const{headers:n,footers:r}=e.getSnapshot();if(n==null&&r==null)throw new Error("Document data model must have headers or footers when update by segment id");if((n==null?void 0:n[t])!=null)return["headers",t,"body"];if((r==null?void 0:r[t])!=null)return["footers",t,"body"];throw new Error("Segment id not found in headers or footers")}const $p=e=>{var p,I,A,B;const{selection:t,documentDataModel:n,drawings:r}=e,{collapsed:s,startOffset:i,segmentId:o}=t,a=new Me,l=Wt.getInstance(),c=[],u=n.getSelfOrHeaderFooterModel(o).getBody();if(!u)return!1;const h=(I=(p=n.getSnapshot().drawingsOrder)==null?void 0:p.length)!=null?I:0;let d=0;if(s)i>0&&a.push({t:J.RETAIN,len:i});else{const x=ku([t],u,0,null,!1);a.push(...x);const Y=xp(u,[t]),O=(A=n.getDrawings())!=null?A:{},R=(B=n.getDrawingsOrder())!=null?B:[],b=Y.sort((y,$)=>R.indexOf(y)>R.indexOf($)?-1:R.indexOf(y)<R.indexOf($)?1:0);if(b.length>0)for(const y of b){const $=O[y],H=R.indexOf(y);if($==null||H<0)continue;const g=l.removeOp(["drawings",y],$),P=l.removeOp(["drawingsOrder",H],y);c.push(g),c.push(P),d++}}a.push({t:J.INSERT,body:{dataStream:"\b".repeat(r.length),customBlocks:r.map((x,Y)=>({startIndex:Y,blockId:x.drawingId}))},len:r.length});const m=Bp(n,o),_=l.editOp(a.serialize(),m);c.push(_);for(const x of r){const{drawingId:Y}=x,O=l.insertOp(["drawings",Y],x),R=l.insertOp(["drawingsOrder",h-d],Y);c.push(O),c.push(R)}return c.reduce((x,Y)=>Wt.compose(x,Y),null)};function Hp(e,t){if(typeof t>"u")return{startOffset:e,endOffset:e,collapsed:!0};if(t<e)throw new Error(`Cannot make a doc selection when endOffset ${t} is less than startOffset ${e}.`);return{startOffset:e,endOffset:t,collapsed:e===t}}function Wp(e){const{startOffset:t,endOffset:n,collapsed:r}=e,s=Math.min(t,n),i=Math.max(t,n);return{startOffset:s,endOffset:i,collapsed:r}}function jp(e,t,n,r){return Math.max(e,n)<=Math.min(t,r)}function Lo(e,t,n,r){const{startOffset:s,endOffset:i}=e,o=r!=null?r:Uo(t,n),a=[];let l=-1;for(let c=0;c<o.length;c++){const u=o[c],{startIndex:h}=u;(s>l&&s<=h||i>l&&i<=h||h>=s&&h<=i)&&a.push(u),l=h}return a}function Do(e,t,n){const r=[],s=Uo(t,n);for(const i of e){const o=Lo(i,t,n,s);r.push(...o)}return r}const Yp=[lt.PARAGRAPH,lt.TABLE_START,lt.TABLE_END,lt.TABLE_ROW_START,lt.TABLE_CELL_START,lt.TABLE_CELL_END];function Uo(e,t){const n=[];for(let r=0;r<e.length;r++){const s=e[r],{startIndex:i}=s;let o=i-1;for(;!Yp.includes(t[o])&&o>=0;)o--;n.push({...s,paragraphStart:o+1,paragraphEnd:s.startIndex})}return n}const Gp=e=>{var h,d,m;const{paragraphs:t,segmentId:n,document:r}=e;let s=e.listType;const i=(d=(h=r.getSelfOrHeaderFooterModel(n).getBody())==null?void 0:h.paragraphs)!=null?d:[],o=t.every(_=>{var p;return((p=_.bullet)==null?void 0:p.listType.indexOf(s))===0});let l=tt(6);if(t.length===1){const _=i.indexOf(t[0]),p=i[_-1],I=i[_+1];p&&p.bullet&&p.bullet.listType.indexOf(s)===0?(l=p.bullet.listId,s!==Ft.CHECK_LIST&&(s=p.bullet.listType)):I&&I.bullet&&I.bullet.listType.indexOf(s)===0&&(l=I.bullet.listId,s!==Ft.CHECK_LIST&&(s=I.bullet.listType))}const c=new un;c.reset();const u=new Me;for(const _ of t){const{startIndex:p,paragraphStyle:I={},bullet:A}=_;u.push({t:J.RETAIN,len:p-c.cursor}),u.push({t:J.RETAIN,len:1,body:{dataStream:"",paragraphs:[o?{paragraphStyle:I,startIndex:0}:{startIndex:0,paragraphStyle:{...I},bullet:{nestingLevel:(m=A==null?void 0:A.nestingLevel)!=null?m:0,textStyle:{fs:20},listType:s,listId:l}}]},coverType:Ce.REPLACE}),c.moveCursorTo(p+1)}return u},Vp=e=>{var h;const{paragraphIndex:t,segmentId:n,document:r}=e,s=(h=r.getSelfOrHeaderFooterModel(n).getBody())==null?void 0:h.paragraphs;if(s==null)return!1;const i=s.find(d=>d.startIndex===t);if(!(i!=null&&i.bullet)||i.bullet.listType.indexOf(Ft.CHECK_LIST)===-1)return!1;const o=new un;o.reset();const a=new Me,{startIndex:l,paragraphStyle:c={}}=i,u=i.bullet.listType===Ft.CHECK_LIST?Ft.CHECK_LIST_CHECKED:Ft.CHECK_LIST;return a.push({t:J.RETAIN,len:l-o.cursor}),a.push({t:J.RETAIN,len:1,body:{dataStream:"",paragraphs:[{...i,paragraphStyle:c,startIndex:0,bullet:{...i.bullet,listType:u}}]},coverType:Ce.REPLACE}),o.moveCursorTo(l+1),a},zp=e=>{var u,h;const{paragraphs:t,listType:n,segmentId:r,document:s}=e;if(((u=s.getSelfOrHeaderFooterModel(r).getBody())==null?void 0:u.paragraphs)==null)return!1;const a=tt(6),l=new un;l.reset();const c=new Me;for(const d of t){const{startIndex:m,paragraphStyle:_={},bullet:p}=d;c.push({t:J.RETAIN,len:m-l.cursor}),c.push({t:J.RETAIN,len:1,body:{dataStream:"",paragraphs:[{startIndex:0,paragraphStyle:_,bullet:{nestingLevel:(h=p==null?void 0:p.nestingLevel)!=null?h:0,textStyle:(p==null?void 0:p.listType)===n?p.textStyle:{fs:20},listType:n,listId:a}}]},coverType:Ce.REPLACE}),l.moveCursorTo(m+1)}return c};function Kp(e,t){return t.some(n=>e.startIndex>n.startIndex&&e.startIndex<n.endIndex)}const Xp=e=>{var c,u,h;const{paragraphs:t,document:n,type:r}=e,s=new un;s.reset();const i=new Me,o=(c=n.getSnapshot().lists)!=null?c:{},a=(h=(u=n.getBody())==null?void 0:u.tables)!=null?h:[],l={...Nr,...o};for(const d of t){const{startIndex:m,paragraphStyle:_={},bullet:p}=d,I=Kp(d,a);if(i.push({t:J.RETAIN,len:m-s.cursor}),p){const A=p.listType;let B=l[A].nestingLevel.length-1;I&&(B=Math.min(B,2)),i.push({t:J.RETAIN,len:1,body:{dataStream:"",paragraphs:[{startIndex:0,paragraphStyle:{..._},bullet:{...p,nestingLevel:Math.max(Math.min(p.nestingLevel+r,B),0)}}]},coverType:Ce.REPLACE})}else i.push({t:J.RETAIN,len:1});s.moveCursorTo(m+1)}return i},qp=e=>{var I,A,B,x;const{textRanges:t,segmentId:n,document:r,style:s,paragraphTextRun:i,cursor:o,deleteLen:a,textX:l}=e,c=r.getSelfOrHeaderFooterModel(n),u=(A=(I=c.getBody())==null?void 0:I.paragraphs)!=null?A:[],h=(x=(B=c.getBody())==null?void 0:B.dataStream)!=null?x:"",d=Do(t,u,h),m=new un;o&&m.moveCursorTo(o);const _=l!=null?l:new Me;d.sort((Y,O)=>Y.startIndex-O.startIndex);const p=Math.max(0,d[0].paragraphStart-1);p>m.cursor&&(_.push({t:J.RETAIN,len:p-m.cursor}),m.moveCursorTo(p)),a&&_.push({t:J.DELETE,len:a});for(const Y of d){const{startIndex:O,paragraphStyle:R={}}=Y,b=O-m.cursor;_.push({t:J.RETAIN,len:b,...i?{body:{dataStream:"",textRuns:[{ts:i,st:0,ed:b}]},coverType:Ce.REPLACE}:null}),_.push({t:J.RETAIN,len:1,body:{dataStream:"",paragraphs:[{startIndex:0,paragraphStyle:{...R,...s}}]},coverType:Ce.REPLACE}),m.moveCursorTo(O+1)}return _};class Je{}C(Je,"customRange",{add:Dp,delete:Lp,copyCustomRange:Ap,getCustomRangesInterestsWithSelection:bp,isIntersecting:Du}),C(Je,"customDecoration",{add:vp,delete:wp}),C(Je,"selection",{replace:Pp,makeSelection:Hp,normalizeSelection:Wp,delete:ku,replaceTextRuns:Fp,retain:Up}),C(Je,"range",{isIntersects:jp,getParagraphsInRange:Lo,getParagraphsInRanges:Do}),C(Je,"transform",{getPlainText:Ws,fromPlainText:Sp,isEmptyDocument:Ip}),C(Je,"paragraph",{bullet:{set:zp,switch:Gp,toggleChecklist:Vp,changeNestLevel:Xp},style:{set:qp},util:{transform:Uo,getParagraphsInRange:Lo,getParagraphsInRanges:Do}}),C(Je,"drawing",{add:$p});function Zp(e,t,n,r){var c;if(t==="")return e;const s={id:"mock-id",body:e,documentStyle:{}},i=new At(s),o=t.length;let a;for(;(a=(r?i.getBody().dataStream:i.getBody().dataStream.toLowerCase()).indexOf(t))>=0;){const u=new Me,h=Wt.getInstance();if(a>0&&u.retain(a),n.length>0){const d=i.sliceBody(a,a+o),m={dataStream:n};if(Array.isArray(d==null?void 0:d.textRuns)&&d.textRuns.length&&(m.textRuns=[{...d.textRuns[0],st:0,ed:n.length}]),(c=d==null?void 0:d.customRanges)!=null&&c.length){const _=d.customRanges[0];m.customRanges=[{..._,startIndex:0,endIndex:n.length-1}]}u.insert(n.length,m)}u.delete(o),i.apply(h.editOp(u.serialize()))}const l=i.getBody();return i.dispose(),l}function Jp(e){if(e.customRanges||(e.customRanges=[]),!e.paragraphs){e.paragraphs=[];for(let t=0;t<e.dataStream.length;t++)e.dataStream[t]==="\r"&&e.paragraphs.push({startIndex:t})}return e.customBlocks||(e.customBlocks=[]),e.textRuns||(e.textRuns=[]),e.customDecorations||(e.customDecorations=[]),e.sectionBreaks||(e.sectionBreaks=[]),e.tables||(e.tables=[]),e}function Fu(e){var t;return e.body=Jp((t=e.body)!=null?t:{dataStream:""}),e.drawingsOrder||(e.drawingsOrder=[]),e.drawings||(e.drawings={}),e.documentStyle||(e.documentStyle={}),e}class Mr{constructor(t={}){C(this,"_style");this._style=t}static create(t={}){return new Mr(t)}get fontFamily(){return this._style.ff}get fontSize(){return this._style.fs}get italic(){return this._style.it===ae.TRUE}get bold(){return this._style.bl===ae.TRUE}get underline(){return this._style.ul&&rn.create(this._style.ul)}get bottomBorderLine(){return this._style.bbl&&rn.create(this._style.bbl)}get strikethrough(){return this._style.st&&rn.create(this._style.st)}get overline(){return this._style.ol&&rn.create(this._style.ol)}get background(){return this._style.bg}get border(){return this._style.bd}get color(){return this._style.cl}get verticalAlign(){return this._style.va}get numberFormat(){return this._style.n}copy(){return nn.create(Z.deepClone(this._style))}getValue(){return{...this._style}}}class nn extends Mr{static create(t={}){return new nn(t)}constructor(t={}){super(t)}setFontFamily(t){return this._style.ff=t,this}setFontSize(t){return this._style.fs=t,this}setItalic(t){return this._style.it=t?1:0,this}setBold(t){return this._style.bl=t?1:0,this}setUnderline(t){return this._style.ul=t.build(),this}setBottomBorderLine(t){return this._style.bbl=t.build(),this}setStrikethrough(t){return this._style.st=t.build(),this}setOverline(t){return this._style.ol=t.build(),this}setBackground(t){return this._style.bg=t,this}setBorder(t){return this._style.bd=t,this}setColor(t){return this._style.cl=t,this}setVerticalAlign(t){return this._style.va=t,this}copy(){return nn.create(Z.deepClone(this._style))}build(){return this.getValue()}}class rn{constructor(t={s:1}){C(this,"_decoration");this._decoration=t}static create(t={s:1}){return new rn(t)}get show(){return this._decoration.s===ae.TRUE}get followFontColor(){return this._decoration.c===ae.TRUE}get color(){return this._decoration.cl}get type(){return this._decoration.t}setShow(t){return this._decoration.s=t?1:0,this}setFollowFontColor(t){return this._decoration.c=t?1:0,this}setColor(t){return this._decoration.cl=t,this}setLineType(t){return this._decoration.t=t,this}copy(){return rn.create(Z.deepClone(this._decoration))}build(){return{...this._decoration}}}class Lr{constructor(t={}){C(this,"_style");this._style=t}static create(t={}){return new Lr(t)}get indentFirstLine(){return this._style.indentFirstLine}get hanging(){return this._style.hanging}get indentStart(){return this._style.indentStart}get tabStops(){return this._style.tabStops}get indentEnd(){return this._style.indentEnd}get textStyle(){return this._style.textStyle}get headingId(){return this._style.headingId}get namedStyleType(){return this._style.namedStyleType}get horizontalAlign(){return this._style.horizontalAlign}get lineSpacing(){return this._style.lineSpacing}get direction(){return this._style.direction}get spacingRule(){return this._style.spacingRule}get snapToGrid(){return this._style.snapToGrid}get spaceAbove(){return this._style.spaceAbove}get spaceBelow(){return this._style.spaceBelow}get borderBetween(){return this._style.borderBetween}get borderTop(){return this._style.borderTop}get borderBottom(){return this._style.borderBottom}get borderLeft(){return this._style.borderLeft}get borderRight(){return this._style.borderRight}get keepLines(){return this._style.keepLines===ae.TRUE}get keepNext(){return this._style.keepNext===ae.TRUE}get wordWrap(){return this._style.wordWrap===ae.TRUE}get widowControl(){return this._style.widowControl===ae.TRUE}get shading(){return this._style.shading}get suppressHyphenation(){return this._style.suppressHyphenation===ae.TRUE}copy(){return Dr.create(Z.deepClone(this._style))}getValue(){return this._style}}class Dr extends Lr{static create(t={}){return new Dr(t)}constructor(t={}){super(t)}setIndentFirstLine(t){return this._style.indentFirstLine=t,this}setHanging(t){return this._style.hanging=t,this}setIndentStart(t){return this._style.indentStart=t,this}setTabStops(t){return this._style.tabStops=t,this}setIndentEnd(t){return this._style.indentEnd=t,this}setTextStyle(t){return this._style.textStyle=t,this}setHeadingId(t){return this._style.headingId=t,this}setNamedStyleType(t){return this._style.namedStyleType=t,this}setHorizontalAlign(t){return this._style.horizontalAlign=t,this}setLineSpacing(t){return this._style.lineSpacing=t,this}setDirection(t){return this._style.direction=t,this}setSpacingRule(t){return this._style.spacingRule=t,this}setSnapToGrid(t){return this._style.snapToGrid=t?1:0,this}setSpaceAbove(t){return this._style.spaceAbove=t,this}setSpaceBelow(t){return this._style.spaceBelow=t,this}setBorderBetween(t){return this._style.borderBetween=t,this}setBorderTop(t){return this._style.borderTop=t,this}setBorderBottom(t){return this._style.borderBottom=t,this}setBorderLeft(t){return this._style.borderLeft=t,this}setBorderRight(t){return this._style.borderRight=t,this}setKeepLines(t){return this._style.keepLines=t?1:0,this}setKeepNext(t){return this._style.keepNext=t?1:0,this}setWordWrap(t){return this._style.wordWrap=t?1:0,this}setWidowControl(t){return this._style.widowControl=t?1:0,this}setShading(t){return this._style.shading=t,this}setSuppressHyphenation(t){return this._style.suppressHyphenation=t?1:0,this}copy(){return Dr.create(Z.deepClone(this._style))}build(){return this.getValue()}}class sn{constructor(t){C(this,"_data");if(!t.body)throw new Error("Invalid document data, body is required");this._data=Fu(t)}static create(t){return new sn(t)}static createByBody(t){return new sn({body:t,id:"d",documentStyle:{}})}copy(){return Cn.create(Z.deepClone(this._data))}slice(t,n){const{body:r,...s}=this._data;return Cn.create({...Z.deepClone(s),body:bt(r,t,n)})}toPlainText(){var t,n;return Je.transform.getPlainText((n=(t=this._data.body)==null?void 0:t.dataStream)!=null?n:"").replaceAll("\r",`
1215
+ `)?e.slice(0,-2):e;return Rp.reduce((n,r)=>n.replaceAll(r,""),t)},Ip=e=>e?Ws(e).replaceAll("\r","")==="":!0,Sp=e=>{const t=e.replace(/\n/g,"\r"),n=[],r=[];let s=0,i="";const o=(l,c=!0)=>{const u=t.slice(s,l);if(Z.isLegalUrl(u)){const h=tt(),d=`${u}`,m={startIndex:s,endIndex:s+d.length-1,rangeId:h,rangeType:en.HYPERLINK,properties:{url:e}};r.push(m),i+=d,s=l+1,c&&(i+="\r",n.push({startIndex:l}))}else i+=t.slice(s,l+1),s=l+1,c&&n.push({startIndex:l})};let a=0;for(let l=0;l<t.length;l++)t[l]==="\r"&&(o(l),a=l);return(a!==t.length-1||t.length===1)&&o(t.length,!1),{dataStream:i,paragraphs:n,customRanges:r}},yo={id:"default_doc",documentStyle:{}};class Op extends Ps{constructor(n){var r;super();C(this,"type",we.UNIVER_DOC);C(this,"_name$",new oe.BehaviorSubject(""));C(this,"name$",this._name$.asObservable());C(this,"snapshot");this.snapshot={...yo,...n},this._name$.next((r=this.snapshot.title)!=null?r:"No Title")}getUnitId(){throw new Error("Method not implemented.")}getRev(){var n;return(n=this.snapshot.rev)!=null?n:1}incrementRev(){this.snapshot.rev=this.getRev()+1}setRev(n){this.snapshot.rev=n}setName(n){this.snapshot.title=n,this._name$.next(n)}get drawings(){return this.snapshot.drawings}get documentStyle(){return this.snapshot.documentStyle}get lists(){return this.snapshot.lists}get zoomRatio(){var n;return((n=this.snapshot.settings)==null?void 0:n.zoomRatio)||1}resetDrawing(n,r){this.snapshot.drawings=n,this.snapshot.drawingsOrder=r}getBody(){return this.snapshot.body}getSnapshot(){return this.snapshot}getBulletPresetList(){var s;const n=(s=this.snapshot.lists)!=null?s:{};return{...Nr,...n}}updateDocumentId(n){this.snapshot.id=n}updateDocumentRenderConfig(n){const{documentStyle:r}=this.snapshot;r.renderConfig==null?r.renderConfig=n:r.renderConfig={...r.renderConfig,...n}}getDocumentStyle(){return this.snapshot.documentStyle}updateDocumentStyle(n){this.snapshot.documentStyle==null?this.snapshot.documentStyle=n:this.snapshot.documentStyle={...this.snapshot.documentStyle,...n}}updateDocumentDataMargin(n){const{t:r,l:s,b:i,r:o}=n,{documentStyle:a}=this.snapshot;r!=null&&(a.marginTop=r),s!=null&&(a.marginLeft=s),i!=null&&(a.marginBottom=i),o!=null&&(a.marginRight=o)}updateDocumentDataPageSize(n,r){const{documentStyle:s}=this.snapshot;if(!s.pageSize){s.pageSize={width:n!=null?n:Number.POSITIVE_INFINITY,height:r!=null?r:Number.POSITIVE_INFINITY};return}n!==void 0&&(s.pageSize.width=n),r!==void 0&&(s.pageSize.height=r)}updateDrawing(n,r){const{drawings:s}=this,{width:i,height:o,left:a,top:l}=r,c=s==null?void 0:s[n];if(!c)return;const u=c.docTransform;u.size.width=i,u.size.height=o,u.positionH.posOffset=a,u.positionV.posOffset=l}setZoomRatio(n=1){this.snapshot.settings?this.snapshot.settings.zoomRatio=n:this.snapshot.settings={zoomRatio:n}}setDisabled(n){this.snapshot.disabled=n}getDisabled(){return this.snapshot.disabled}getTitle(){return this.snapshot.title}}class At extends Op{constructor(n){var s,i;super(Z.isEmptyObject(n)?F_():n);C(this,"_unitId");C(this,"headerModelMap",new Map);C(this,"footerModelMap",new Map);C(this,"change$",new oe.BehaviorSubject(0));const r=6;this._unitId=(s=this.snapshot.id)!=null?s:tt(r),this._initializeHeaderFooterModel(),this._name$.next((i=this.snapshot.title)!=null?i:"")}dispose(){super.dispose(),this.headerModelMap.forEach(n=>{n.dispose()}),this.footerModelMap.forEach(n=>{n.dispose()}),this._name$.complete()}getDrawings(){return this.snapshot.drawings}getDrawingsOrder(){return this.snapshot.drawingsOrder}getCustomRanges(){var n;return(n=this.snapshot.body)==null?void 0:n.customRanges}getCustomDecorations(){var n;return(n=this.snapshot.body)==null?void 0:n.customDecorations}getSettings(){return this.snapshot.settings}reset(n){if(n.id&&n.id!==this._unitId)throw new Error("Cannot reset a document model with a different unit id!");this.snapshot={...yo,...n},this._initializeHeaderFooterModel(),this.change$.next(this.change$.value+1)}getSelfOrHeaderFooterModel(n){if(n!=null){if(this.headerModelMap.has(n))return this.headerModelMap.get(n);if(this.footerModelMap.has(n))return this.footerModelMap.get(n)}return this}getUnitId(){return this._unitId}apply(n){if(!Wt.isNoop(n))return this.snapshot=Wt.apply(this.snapshot,n),n!=null&&n.some(r=>Array.isArray(r)&&((r==null?void 0:r[0])==="headers"||(r==null?void 0:r[0])==="footers"))&&(this.headerModelMap.clear(),this.footerModelMap.clear(),this._initializeHeaderFooterModel()),this.change$.next(this.change$.value+1),this.snapshot}sliceBody(n,r,s=Ao.copy){const i=this.getBody();if(i!=null)return bt(i,n,r,!1,s)}_initializeHeaderFooterModel(){const{headers:n,footers:r}=this.getSnapshot();if(n)for(const s in n){const i=n[s];this.headerModelMap.set(s,new At(i)),this.headerModelMap.get(s).updateDocumentId(this.getUnitId())}if(r)for(const s in r){const i=r[s];this.footerModelMap.set(s,new At(i)),this.footerModelMap.get(s).updateDocumentId(this.getUnitId())}}updateDocumentId(n){super.updateDocumentId(n),this._unitId=n}getPlainText(){var n,r;return Ws((r=(n=this.getBody())==null?void 0:n.dataStream)!=null?r:"")}}function vp(e){const{ranges:t,id:n,type:r}=e,s=new Me;let i=0;for(let o=0;o<t.length;o++){const a=t[o],{startOffset:l,endOffset:c}=a;l>0&&s.push({t:J.RETAIN,len:l-i}),s.push({t:J.RETAIN,body:{dataStream:"",customDecorations:[{id:n,type:r,startIndex:0,endIndex:c-l-1}]},len:c-l}),i=c}return s}function wp(e){var u,h,d;const{id:t,segmentId:n,documentDataModel:r}=e,s=r==null?void 0:r.getBody();if(!r||!s)return!1;const i=(d=(h=(u=r.getSelfOrHeaderFooterModel(n))==null?void 0:u.getBody())==null?void 0:h.customDecorations)==null?void 0:d.find(m=>m.id===t);if(!i)return!1;const o=new Me,{startIndex:a,endIndex:l}=i,c=l-a+1;return o.push({t:J.RETAIN,len:a}),o.push({t:J.RETAIN,len:c,body:{dataStream:"",customDecorations:[{startIndex:0,endIndex:c-1,id:t,type:_n.DELETED}]}}),o}function Du(e,t,n,r){return e<=n&&t>=n||e>=n&&e<=r}function bp(e,t){const n=[];for(let r=0,s=t.length;r<s;r++){const i=t[r];e.collapsed?i.startIndex<e.startOffset&&e.startOffset<=i.endIndex&&n.push(i):Du(e.startOffset,e.endOffset-1,i.startIndex,i.endIndex)&&n.push(i)}return n}function Ap(e){return{...Z.deepClone(e),rangeId:tt()}}function Tp(e,t){const n=[];let r=e[0];for(const s of t)s<e[0]||s>e[1]||(r<s&&n.push([r,s-1]),r=s+1);return r<=e[1]&&n.push([r,e[1]]),n}function Uu(e,t,n,r){const s=[];for(let i=0,o=n.length;i<o;i++){const a=n[i];if((r===void 0||a.rangeType===r)&&Math.max(a.startIndex,e)<=Math.min(a.endIndex,t)&&s.push({...a}),a.startIndex>t)break}return s}function yp(e,t){var i,o,a,l,c;const n=Uu(e.startOffset,e.collapsed?e.startOffset:e.endOffset-1,(i=t.customRanges)!=null?i:[]),r=Math.min(e.startOffset,(a=(o=n[0])==null?void 0:o.startIndex)!=null?a:1/0),s=Math.max(e.endOffset,((c=(l=n[n.length-1])==null?void 0:l.endIndex)!=null?c:-1/0)+1);return{startOffset:r,endOffset:s,collapsed:r===s}}var No,Pu;function Np(){if(Pu)return No;Pu=1;var e=-1,t=1,n=0;function r(g,P,v,M,T){if(g===P)return g?[[n,g]]:[];if(v!=null){var w=$(g,P,v);if(w)return w}var N=a(g,P),L=g.substring(0,N);g=g.substring(N),P=P.substring(N),N=c(g,P);var D=g.substring(g.length-N);g=g.substring(0,g.length-N),P=P.substring(0,P.length-N);var F=s(g,P);return L&&F.unshift([n,L]),D&&F.push([n,D]),B(F,T),M&&h(F),F}function s(g,P){var v;if(!g)return[[t,P]];if(!P)return[[e,g]];var M=g.length>P.length?g:P,T=g.length>P.length?P:g,w=M.indexOf(T);if(w!==-1)return v=[[t,M.substring(0,w)],[n,T],[t,M.substring(w+T.length)]],g.length>P.length&&(v[0][0]=v[2][0]=e),v;if(T.length===1)return[[e,g],[t,P]];var N=u(g,P);if(N){var L=N[0],D=N[1],F=N[2],Q=N[3],z=N[4],le=r(L,F),ue=r(D,Q);return le.concat([[n,z]],ue)}return i(g,P)}function i(g,P){for(var v=g.length,M=P.length,T=Math.ceil((v+M)/2),w=T,N=2*T,L=new Array(N),D=new Array(N),F=0;F<N;F++)L[F]=-1,D[F]=-1;L[w+1]=0,D[w+1]=0;for(var Q=v-M,z=Q%2!==0,le=0,ue=0,S=0,U=0,G=0;G<T;G++){for(var V=-G+le;V<=G-ue;V+=2){var W=w+V,j;V===-G||V!==G&&L[W-1]<L[W+1]?j=L[W+1]:j=L[W-1]+1;for(var ee=j-V;j<v&&ee<M&&g.charAt(j)===P.charAt(ee);)j++,ee++;if(L[W]=j,j>v)ue+=2;else if(ee>M)le+=2;else if(z){var te=w+Q-V;if(te>=0&&te<N&&D[te]!==-1){var k=v-D[te];if(j>=k)return o(g,P,j,ee)}}}for(var K=-G+S;K<=G-U;K+=2){var te=w+K,k;K===-G||K!==G&&D[te-1]<D[te+1]?k=D[te+1]:k=D[te-1]+1;for(var q=k-K;k<v&&q<M&&g.charAt(v-k-1)===P.charAt(M-q-1);)k++,q++;if(D[te]=k,k>v)U+=2;else if(q>M)S+=2;else if(!z){var W=w+Q-K;if(W>=0&&W<N&&L[W]!==-1){var j=L[W],ee=w+j-W;if(k=v-k,j>=k)return o(g,P,j,ee)}}}}return[[e,g],[t,P]]}function o(g,P,v,M){var T=g.substring(0,v),w=P.substring(0,M),N=g.substring(v),L=P.substring(M),D=r(T,w),F=r(N,L);return D.concat(F)}function a(g,P){if(!g||!P||g.charAt(0)!==P.charAt(0))return 0;for(var v=0,M=Math.min(g.length,P.length),T=M,w=0;v<T;)g.substring(w,T)==P.substring(w,T)?(v=T,w=v):M=T,T=Math.floor((M-v)/2+v);return x(g.charCodeAt(T-1))&&T--,T}function l(g,P){var v=g.length,M=P.length;if(v==0||M==0)return 0;v>M?g=g.substring(v-M):v<M&&(P=P.substring(0,v));var T=Math.min(v,M);if(g==P)return T;for(var w=0,N=1;;){var L=g.substring(T-N),D=P.indexOf(L);if(D==-1)return w;N+=D,(D==0||g.substring(T-N)==P.substring(0,N))&&(w=N,N++)}}function c(g,P){if(!g||!P||g.slice(-1)!==P.slice(-1))return 0;for(var v=0,M=Math.min(g.length,P.length),T=M,w=0;v<T;)g.substring(g.length-T,g.length-w)==P.substring(P.length-T,P.length-w)?(v=T,w=v):M=T,T=Math.floor((M-v)/2+v);return Y(g.charCodeAt(g.length-T))&&T--,T}function u(g,P){var v=g.length>P.length?g:P,M=g.length>P.length?P:g;if(v.length<4||M.length*2<v.length)return null;function T(ue,S,U){for(var G=ue.substring(U,U+Math.floor(ue.length/4)),V=-1,W="",j,ee,te,k;(V=S.indexOf(G,V+1))!==-1;){var K=a(ue.substring(U),S.substring(V)),q=c(ue.substring(0,U),S.substring(0,V));W.length<q+K&&(W=S.substring(V-q,V)+S.substring(V,V+K),j=ue.substring(0,U-q),ee=ue.substring(U+K),te=S.substring(0,V-q),k=S.substring(V+K))}return W.length*2>=ue.length?[j,ee,te,k,W]:null}var w=T(v,M,Math.ceil(v.length/4)),N=T(v,M,Math.ceil(v.length/2)),L;if(!w&&!N)return null;N?w?L=w[4].length>N[4].length?w:N:L=N:L=w;var D,F,Q,z;g.length>P.length?(D=L[0],F=L[1],Q=L[2],z=L[3]):(Q=L[0],z=L[1],D=L[2],F=L[3]);var le=L[4];return[D,F,Q,z,le]}function h(g){for(var P=!1,v=[],M=0,T=null,w=0,N=0,L=0,D=0,F=0;w<g.length;)g[w][0]==n?(v[M++]=w,N=D,L=F,D=0,F=0,T=g[w][1]):(g[w][0]==t?D+=g[w][1].length:F+=g[w][1].length,T&&T.length<=Math.max(N,L)&&T.length<=Math.max(D,F)&&(g.splice(v[M-1],0,[e,T]),g[v[M-1]+1][0]=t,M--,M--,w=M>0?v[M-1]:-1,N=0,L=0,D=0,F=0,T=null,P=!0)),w++;for(P&&B(g),A(g),w=1;w<g.length;){if(g[w-1][0]==e&&g[w][0]==t){var Q=g[w-1][1],z=g[w][1],le=l(Q,z),ue=l(z,Q);le>=ue?(le>=Q.length/2||le>=z.length/2)&&(g.splice(w,0,[n,z.substring(0,le)]),g[w-1][1]=Q.substring(0,Q.length-le),g[w+1][1]=z.substring(le),w++):(ue>=Q.length/2||ue>=z.length/2)&&(g.splice(w,0,[n,Q.substring(0,ue)]),g[w-1][0]=t,g[w-1][1]=z.substring(0,z.length-ue),g[w+1][0]=e,g[w+1][1]=Q.substring(ue),w++),w++}w++}}var d=/[^a-zA-Z0-9]/,m=/\s/,_=/[\r\n]/,p=/\n\r?\n$/,I=/^\r?\n\r?\n/;function A(g){function P(ue,S){if(!ue||!S)return 6;var U=ue.charAt(ue.length-1),G=S.charAt(0),V=U.match(d),W=G.match(d),j=V&&U.match(m),ee=W&&G.match(m),te=j&&U.match(_),k=ee&&G.match(_),K=te&&ue.match(p),q=k&&S.match(I);return K||q?5:te||k?4:V&&!j&&ee?3:j||ee?2:V||W?1:0}for(var v=1;v<g.length-1;){if(g[v-1][0]==n&&g[v+1][0]==n){var M=g[v-1][1],T=g[v][1],w=g[v+1][1],N=c(M,T);if(N){var L=T.substring(T.length-N);M=M.substring(0,M.length-N),T=L+T.substring(0,T.length-N),w=L+w}for(var D=M,F=T,Q=w,z=P(M,T)+P(T,w);T.charAt(0)===w.charAt(0);){M+=T.charAt(0),T=T.substring(1)+w.charAt(0),w=w.substring(1);var le=P(M,T)+P(T,w);le>=z&&(z=le,D=M,F=T,Q=w)}g[v-1][1]!=D&&(D?g[v-1][1]=D:(g.splice(v-1,1),v--),g[v][1]=F,Q?g[v+1][1]=Q:(g.splice(v+1,1),v--))}v++}}function B(g,P){g.push([n,""]);for(var v=0,M=0,T=0,w="",N="",L;v<g.length;){if(v<g.length-1&&!g[v][1]){g.splice(v,1);continue}switch(g[v][0]){case t:T++,N+=g[v][1],v++;break;case e:M++,w+=g[v][1],v++;break;case n:var D=v-T-M-1;if(P){if(D>=0&&R(g[D][1])){var F=g[D][1].slice(-1);if(g[D][1]=g[D][1].slice(0,-1),w=F+w,N=F+N,!g[D][1]){g.splice(D,1),v--;var Q=D-1;g[Q]&&g[Q][0]===t&&(T++,N=g[Q][1]+N,Q--),g[Q]&&g[Q][0]===e&&(M++,w=g[Q][1]+w,Q--),D=Q}}if(O(g[v][1])){var F=g[v][1].charAt(0);g[v][1]=g[v][1].slice(1),w+=F,N+=F}}if(v<g.length-1&&!g[v][1]){g.splice(v,1);break}if(w.length>0||N.length>0){w.length>0&&N.length>0&&(L=a(N,w),L!==0&&(D>=0?g[D][1]+=N.substring(0,L):(g.splice(0,0,[n,N.substring(0,L)]),v++),N=N.substring(L),w=w.substring(L)),L=c(N,w),L!==0&&(g[v][1]=N.substring(N.length-L)+g[v][1],N=N.substring(0,N.length-L),w=w.substring(0,w.length-L)));var z=T+M;w.length===0&&N.length===0?(g.splice(v-z,z),v=v-z):w.length===0?(g.splice(v-z,z,[t,N]),v=v-z+1):N.length===0?(g.splice(v-z,z,[e,w]),v=v-z+1):(g.splice(v-z,z,[e,w],[t,N]),v=v-z+2)}v!==0&&g[v-1][0]===n?(g[v-1][1]+=g[v][1],g.splice(v,1)):v++,T=0,M=0,w="",N="";break}}g[g.length-1][1]===""&&g.pop();var le=!1;for(v=1;v<g.length-1;)g[v-1][0]===n&&g[v+1][0]===n&&(g[v][1].substring(g[v][1].length-g[v-1][1].length)===g[v-1][1]?(g[v][1]=g[v-1][1]+g[v][1].substring(0,g[v][1].length-g[v-1][1].length),g[v+1][1]=g[v-1][1]+g[v+1][1],g.splice(v-1,1),le=!0):g[v][1].substring(0,g[v+1][1].length)==g[v+1][1]&&(g[v-1][1]+=g[v+1][1],g[v][1]=g[v][1].substring(g[v+1][1].length)+g[v+1][1],g.splice(v+1,1),le=!0)),v++;le&&B(g,P)}function x(g){return g>=55296&&g<=56319}function Y(g){return g>=56320&&g<=57343}function O(g){return Y(g.charCodeAt(0))}function R(g){return x(g.charCodeAt(g.length-1))}function b(g){for(var P=[],v=0;v<g.length;v++)g[v][1].length>0&&P.push(g[v]);return P}function y(g,P,v,M){return R(g)||O(M)?null:b([[n,g],[e,P],[t,v],[n,M]])}function $(g,P,v){var M=typeof v=="number"?{index:v,length:0}:v.oldRange,T=typeof v=="number"?null:v.newRange,w=g.length,N=P.length;if(M.length===0&&(T===null||T.length===0)){var L=M.index,D=g.slice(0,L),F=g.slice(L),Q=T?T.index:null;e:{var z=L+N-w;if(Q!==null&&Q!==z||z<0||z>N)break e;var le=P.slice(0,z),ue=P.slice(z);if(ue!==F)break e;var S=Math.min(L,z),U=D.slice(0,S),G=le.slice(0,S);if(U!==G)break e;var V=D.slice(S),W=le.slice(S);return y(U,V,W,F)}e:{if(Q!==null&&Q!==L)break e;var j=L,le=P.slice(0,j),ue=P.slice(j);if(le!==D)break e;var ee=Math.min(w-j,N-j),te=F.slice(F.length-ee),k=ue.slice(ue.length-ee);if(te!==k)break e;var V=F.slice(0,F.length-ee),W=ue.slice(0,ue.length-ee);return y(D,V,W,te)}}if(M.length>0&&T&&T.length===0)e:{var U=g.slice(0,M.index),te=g.slice(M.index+M.length),S=U.length,ee=te.length;if(N<S+ee)break e;var G=P.slice(0,S),k=P.slice(N-ee);if(U!==G||te!==k)break e;var V=g.slice(S,w-ee),W=P.slice(S,N-ee);return y(U,V,W,te)}return null}function H(g,P,v,M){return r(g,P,v,M,!0)}return H.INSERT=t,H.DELETE=e,H.EQUAL=n,No=H,No}var Mp=Np();const Mo=mt(Mp);function Lp(e){var h,d,m;const{rangeId:t,segmentId:n,documentDataModel:r,insert:s}=e,i=(d=(h=r.getSelfOrHeaderFooterModel(n).getBody())==null?void 0:h.customRanges)==null?void 0:d.find(_=>_.rangeId===t);if(!i)return!1;const{startIndex:o,endIndex:a}=i,l=new Me,c=a-o+1;l.push({t:J.RETAIN,len:o}),l.push({t:J.RETAIN,len:c,body:{dataStream:"",customRanges:[]}}),s&&l.push({t:J.INSERT,body:s,len:s.dataStream.length});const u=a+1+((m=s==null?void 0:s.dataStream.length)!=null?m:0);return l.selections=[{startOffset:u,endOffset:u,collapsed:!0}],l}function Dp(e){const{ranges:t,rangeId:n,rangeType:r,wholeEntity:s,properties:i,body:o}=e;let a=0;const l=new Me;let c=!1;return t.forEach(u=>{var x,Y,O;const h=yp(u,o);if(!h||!o)return!1;const{startOffset:d,endOffset:m}=h,_=(x=o.customRanges)!=null?x:[],p=(R,b,y)=>{var v,M,T,w;const $=Uu(R,b,_,r),H=Math.min((M=(v=$[0])==null?void 0:v.startIndex)!=null?M:1/0,R),g=Math.max((w=(T=$[$.length-1])==null?void 0:T.endIndex)!=null?w:-1/0,b),P={rangeId:y?`${n}$${y}`:n,rangeType:r,startIndex:0,endIndex:g-H,wholeEntity:s,properties:{...i}};l.push({t:J.RETAIN,len:H-a}),l.push({t:J.RETAIN,len:g-H+1,body:{dataStream:"",customRanges:[P]},coverType:Ce.COVER}),a=g+1},I=((Y=o.paragraphs)!=null?Y:[]).filter(R=>R.startIndex<m&&R.startIndex>d),A=((O=o.customBlocks)!=null?O:[]).filter(R=>R.startIndex<m&&R.startIndex>d);Tp([d,m-1],[...I.map(R=>R.startIndex),...A.map(R=>R.startIndex)]).forEach(([R,b],y)=>p(R,b,y)),c=!0,l.selections=[{startOffset:h.endOffset,endOffset:h.endOffset,collapsed:!0}]}),c?l:!1}function ku(e,t,n=0,r=null,s=!0){e.sort((c,u)=>c.startOffset-u.startOffset);const i=[],{paragraphs:o=[]}=t,a=o==null?void 0:o.find(c=>c.startIndex>=e[0].startOffset&&c.startIndex<e[0].endOffset);let l=n;if(e.forEach(c=>{const{startOffset:u,endOffset:h}=c;u>l&&(i.push({t:J.RETAIN,len:u-l}),l=u),l<h&&(i.push({t:J.DELETE,len:h-l}),l=h)}),r&&i.push({t:J.INSERT,body:r,len:r.dataStream.length}),a&&s){const c=o.find(u=>u.startIndex-n>=e[e.length-1].endOffset-1);c&&(c.startIndex>l&&(i.push({t:J.RETAIN,len:c.startIndex-l}),l=c.startIndex),i.push({t:J.RETAIN,len:1,body:{dataStream:"",paragraphs:[{...c,startIndex:0,bullet:a==null?void 0:a.bullet}]},coverType:Ce.REPLACE}))}return i}function Up(e,t,n=0){const r=[];let s=n;return e.forEach(i=>{const{startOffset:o,endOffset:a}=i;o>s&&(r.push({t:J.RETAIN,len:o-s}),s=o),a>s&&(r.push({t:J.RETAIN,len:a-s,body:{...Z.deepClone(t),dataStream:""}}),s=a)}),r}const Pp=e=>{var h;const{selection:t,body:n,doc:r}=e,s=t.segmentId,i=(h=r.getSelfOrHeaderFooterModel(s))==null?void 0:h.getBody();if(!i)return!1;const o=t.collapsed?null:bt(i,t.startOffset,t.endOffset),a=Mo(o?o.dataStream:"",n.dataStream);let l=0;const c=a.map(([d,m])=>{switch(d){case 0:{const _={t:J.RETAIN,body:{...bt(n,l,l+m.length,!1),dataStream:""},len:m.length};return l+=m.length,_}case 1:{const _={t:J.INSERT,body:bt(n,l,l+m.length),len:m.length};return l+=m.length,_}default:return{t:J.DELETE,len:m.length}}}),u=new Me;return u.push({t:J.RETAIN,len:t.startOffset}),u.push(...c),u};function kp(e,t){return!!((e==null?void 0:e.length)===(t==null?void 0:t.length)&&(e!=null&&e.every((n,r)=>JSON.stringify(n)===JSON.stringify(t==null?void 0:t[r]))))}const Fp=e=>{var d;const{selection:t,body:n,doc:r,themeService:s}=e,i=t.segmentId,o=(d=r.getSelfOrHeaderFooterModel(i))==null?void 0:d.getBody();if(!o)return!1;const a=t.collapsed?null:bt(o,t.startOffset,t.endOffset),l=Mo(a?a.dataStream:"",n.dataStream);let c=0;const u=l.map(([m,_])=>{switch(m){case 0:{const p=Hs(n,c,c+_.length,!1),I=Hs(a,c,c+_.length,!1),A={t:J.RETAIN,body:kp(p,I)?void 0:{textRuns:p==null?void 0:p.map(B=>{var x,Y,O,R,b,y,$;return{...B,ts:{...B.ts,cl:(O=(Y=(x=B.ts)==null?void 0:x.cl)==null?void 0:Y.rgb)!=null&&O.includes(".")?{rgb:s.getColorFromTheme((y=(b=(R=B.ts)==null?void 0:R.cl)==null?void 0:b.rgb)!=null?y:"")}:($=B.ts)==null?void 0:$.cl}}}),dataStream:""},len:_.length};return c+=_.length,A}case 1:{const p={t:J.INSERT,body:bt(n,c,c+_.length),len:_.length};return c+=_.length,p}default:return{t:J.DELETE,len:_.length}}});if(u.every(m=>m.t===J.RETAIN&&!m.body))return!1;const h=new Me;return h.push({t:J.RETAIN,len:t.startOffset}),h.push(...u),h};function xp(e,t){const n=[],{customBlocks:r=[]}=e;for(const s of t){const{startOffset:i,endOffset:o}=s;if(!(i==null||o==null))for(const a of r){const{startIndex:l}=a;l>=i&&l<o&&n.push(a.blockId)}}return n}function Bp(e,t=""){if(!t)return["body"];const{headers:n,footers:r}=e.getSnapshot();if(n==null&&r==null)throw new Error("Document data model must have headers or footers when update by segment id");if((n==null?void 0:n[t])!=null)return["headers",t,"body"];if((r==null?void 0:r[t])!=null)return["footers",t,"body"];throw new Error("Segment id not found in headers or footers")}const $p=e=>{var p,I,A,B;const{selection:t,documentDataModel:n,drawings:r}=e,{collapsed:s,startOffset:i,segmentId:o}=t,a=new Me,l=Wt.getInstance(),c=[],u=n.getSelfOrHeaderFooterModel(o).getBody();if(!u)return!1;const h=(I=(p=n.getSnapshot().drawingsOrder)==null?void 0:p.length)!=null?I:0;let d=0;if(s)i>0&&a.push({t:J.RETAIN,len:i});else{const x=ku([t],u,0,null,!1);a.push(...x);const Y=xp(u,[t]),O=(A=n.getDrawings())!=null?A:{},R=(B=n.getDrawingsOrder())!=null?B:[],b=Y.sort((y,$)=>R.indexOf(y)>R.indexOf($)?-1:R.indexOf(y)<R.indexOf($)?1:0);if(b.length>0)for(const y of b){const $=O[y],H=R.indexOf(y);if($==null||H<0)continue;const g=l.removeOp(["drawings",y],$),P=l.removeOp(["drawingsOrder",H],y);c.push(g),c.push(P),d++}}a.push({t:J.INSERT,body:{dataStream:"\b".repeat(r.length),customBlocks:r.map((x,Y)=>({startIndex:Y,blockId:x.drawingId}))},len:r.length});const m=Bp(n,o),_=l.editOp(a.serialize(),m);c.push(_);for(const x of r){const{drawingId:Y}=x,O=l.insertOp(["drawings",Y],x),R=l.insertOp(["drawingsOrder",h-d],Y);c.push(O),c.push(R)}return c.reduce((x,Y)=>Wt.compose(x,Y),null)};function Hp(e,t){if(typeof t>"u")return{startOffset:e,endOffset:e,collapsed:!0};if(t<e)throw new Error(`Cannot make a doc selection when endOffset ${t} is less than startOffset ${e}.`);return{startOffset:e,endOffset:t,collapsed:e===t}}function Wp(e){const{startOffset:t,endOffset:n,collapsed:r}=e,s=Math.min(t,n),i=Math.max(t,n);return{startOffset:s,endOffset:i,collapsed:r}}function jp(e,t,n,r){return Math.max(e,n)<=Math.min(t,r)}function Lo(e,t,n,r){const{startOffset:s,endOffset:i}=e,o=r!=null?r:Uo(t,n),a=[];let l=-1;for(let c=0;c<o.length;c++){const u=o[c],{startIndex:h}=u;(s>l&&s<=h||i>l&&i<=h||h>=s&&h<=i)&&a.push(u),l=h}return a}function Do(e,t,n){const r=[],s=Uo(t,n);for(const i of e){const o=Lo(i,t,n,s);r.push(...o)}return r}const Yp=[lt.PARAGRAPH,lt.TABLE_START,lt.TABLE_END,lt.TABLE_ROW_START,lt.TABLE_CELL_START,lt.TABLE_CELL_END];function Uo(e,t){const n=[];for(let r=0;r<e.length;r++){const s=e[r],{startIndex:i}=s;let o=i-1;for(;!Yp.includes(t[o])&&o>=0;)o--;n.push({...s,paragraphStart:o+1,paragraphEnd:s.startIndex})}return n}const Gp=e=>{var h,d,m;const{paragraphs:t,segmentId:n,document:r}=e;let s=e.listType;const i=(d=(h=r.getSelfOrHeaderFooterModel(n).getBody())==null?void 0:h.paragraphs)!=null?d:[],o=t.every(_=>{var p;return((p=_.bullet)==null?void 0:p.listType.indexOf(s))===0});let l=tt(6);if(t.length===1){const _=i.indexOf(t[0]),p=i[_-1],I=i[_+1];p&&p.bullet&&p.bullet.listType.indexOf(s)===0?(l=p.bullet.listId,s!==Ft.CHECK_LIST&&(s=p.bullet.listType)):I&&I.bullet&&I.bullet.listType.indexOf(s)===0&&(l=I.bullet.listId,s!==Ft.CHECK_LIST&&(s=I.bullet.listType))}const c=new un;c.reset();const u=new Me;for(const _ of t){const{startIndex:p,paragraphStyle:I={},bullet:A}=_;u.push({t:J.RETAIN,len:p-c.cursor}),u.push({t:J.RETAIN,len:1,body:{dataStream:"",paragraphs:[o?{paragraphStyle:I,startIndex:0}:{startIndex:0,paragraphStyle:{...I},bullet:{nestingLevel:(m=A==null?void 0:A.nestingLevel)!=null?m:0,textStyle:{fs:20},listType:s,listId:l}}]},coverType:Ce.REPLACE}),c.moveCursorTo(p+1)}return u},Vp=e=>{var h;const{paragraphIndex:t,segmentId:n,document:r}=e,s=(h=r.getSelfOrHeaderFooterModel(n).getBody())==null?void 0:h.paragraphs;if(s==null)return!1;const i=s.find(d=>d.startIndex===t);if(!(i!=null&&i.bullet)||i.bullet.listType.indexOf(Ft.CHECK_LIST)===-1)return!1;const o=new un;o.reset();const a=new Me,{startIndex:l,paragraphStyle:c={}}=i,u=i.bullet.listType===Ft.CHECK_LIST?Ft.CHECK_LIST_CHECKED:Ft.CHECK_LIST;return a.push({t:J.RETAIN,len:l-o.cursor}),a.push({t:J.RETAIN,len:1,body:{dataStream:"",paragraphs:[{...i,paragraphStyle:c,startIndex:0,bullet:{...i.bullet,listType:u}}]},coverType:Ce.REPLACE}),o.moveCursorTo(l+1),a},zp=e=>{var u,h;const{paragraphs:t,listType:n,segmentId:r,document:s}=e;if(((u=s.getSelfOrHeaderFooterModel(r).getBody())==null?void 0:u.paragraphs)==null)return!1;const a=tt(6),l=new un;l.reset();const c=new Me;for(const d of t){const{startIndex:m,paragraphStyle:_={},bullet:p}=d;c.push({t:J.RETAIN,len:m-l.cursor}),c.push({t:J.RETAIN,len:1,body:{dataStream:"",paragraphs:[{startIndex:0,paragraphStyle:_,bullet:{nestingLevel:(h=p==null?void 0:p.nestingLevel)!=null?h:0,textStyle:(p==null?void 0:p.listType)===n?p.textStyle:{fs:20},listType:n,listId:a}}]},coverType:Ce.REPLACE}),l.moveCursorTo(m+1)}return c};function Kp(e,t){return t.some(n=>e.startIndex>n.startIndex&&e.startIndex<n.endIndex)}const Xp=e=>{var c,u,h;const{paragraphs:t,document:n,type:r}=e,s=new un;s.reset();const i=new Me,o=(c=n.getSnapshot().lists)!=null?c:{},a=(h=(u=n.getBody())==null?void 0:u.tables)!=null?h:[],l={...Nr,...o};for(const d of t){const{startIndex:m,paragraphStyle:_={},bullet:p}=d,I=Kp(d,a);if(i.push({t:J.RETAIN,len:m-s.cursor}),p){const A=p.listType;let B=l[A].nestingLevel.length-1;I&&(B=Math.min(B,2)),i.push({t:J.RETAIN,len:1,body:{dataStream:"",paragraphs:[{startIndex:0,paragraphStyle:{..._},bullet:{...p,nestingLevel:Math.max(Math.min(p.nestingLevel+r,B),0)}}]},coverType:Ce.REPLACE})}else i.push({t:J.RETAIN,len:1});s.moveCursorTo(m+1)}return i},qp=e=>{var I,A,B,x;const{textRanges:t,segmentId:n,document:r,style:s,paragraphTextRun:i,cursor:o,deleteLen:a,textX:l}=e,c=r.getSelfOrHeaderFooterModel(n),u=(A=(I=c.getBody())==null?void 0:I.paragraphs)!=null?A:[],h=(x=(B=c.getBody())==null?void 0:B.dataStream)!=null?x:"",d=Do(t,u,h),m=new un;o&&m.moveCursorTo(o);const _=l!=null?l:new Me;d.sort((Y,O)=>Y.startIndex-O.startIndex);const p=Math.max(0,d[0].paragraphStart-1);p>m.cursor&&(_.push({t:J.RETAIN,len:p-m.cursor}),m.moveCursorTo(p)),a&&_.push({t:J.DELETE,len:a});for(const Y of d){const{startIndex:O,paragraphStyle:R={}}=Y,b=O-m.cursor;_.push({t:J.RETAIN,len:b,...i?{body:{dataStream:"",textRuns:[{ts:i,st:0,ed:b}]},coverType:Ce.REPLACE}:null}),_.push({t:J.RETAIN,len:1,body:{dataStream:"",paragraphs:[{startIndex:0,paragraphStyle:{...R,...s}}]},coverType:Ce.REPLACE}),m.moveCursorTo(O+1)}return _};class Je{}C(Je,"customRange",{add:Dp,delete:Lp,copyCustomRange:Ap,getCustomRangesInterestsWithSelection:bp,isIntersecting:Du}),C(Je,"customDecoration",{add:vp,delete:wp}),C(Je,"selection",{replace:Pp,makeSelection:Hp,normalizeSelection:Wp,delete:ku,replaceTextRuns:Fp,retain:Up}),C(Je,"range",{isIntersects:jp,getParagraphsInRange:Lo,getParagraphsInRanges:Do}),C(Je,"transform",{getPlainText:Ws,fromPlainText:Sp,isEmptyDocument:Ip}),C(Je,"paragraph",{bullet:{set:zp,switch:Gp,toggleChecklist:Vp,changeNestLevel:Xp},style:{set:qp},util:{transform:Uo,getParagraphsInRange:Lo,getParagraphsInRanges:Do}}),C(Je,"drawing",{add:$p});function Zp(e,t,n,r){var c;if(t==="")return e;const s={id:"mock-id",body:e,documentStyle:{}},i=new At(s),o=t.length;let a;for(;(a=(r?i.getBody().dataStream:i.getBody().dataStream.toLowerCase()).indexOf(t))>=0;){const u=new Me,h=Wt.getInstance();if(a>0&&u.retain(a),n.length>0){const d=i.sliceBody(a,a+o),m={dataStream:n};if(Array.isArray(d==null?void 0:d.textRuns)&&d.textRuns.length&&(m.textRuns=[{...d.textRuns[0],st:0,ed:n.length}]),(c=d==null?void 0:d.customRanges)!=null&&c.length){const _=d.customRanges[0];m.customRanges=[{..._,startIndex:0,endIndex:n.length-1}]}u.insert(n.length,m)}u.delete(o),i.apply(h.editOp(u.serialize()))}const l=i.getBody();return i.dispose(),l}function Jp(e){if(e.customRanges||(e.customRanges=[]),!e.paragraphs){e.paragraphs=[];for(let t=0;t<e.dataStream.length;t++)e.dataStream[t]==="\r"&&e.paragraphs.push({startIndex:t})}return e.customBlocks||(e.customBlocks=[]),e.textRuns||(e.textRuns=[]),e.customDecorations||(e.customDecorations=[]),e.sectionBreaks||(e.sectionBreaks=[]),e.tables||(e.tables=[]),e}function Fu(e){var t;return e.body=Jp((t=e.body)!=null?t:{dataStream:""}),e.drawingsOrder||(e.drawingsOrder=[]),e.drawings||(e.drawings={}),e.documentStyle||(e.documentStyle={}),e}class Mr{constructor(t={}){C(this,"_style");this._style=t}static create(t={}){return new Mr(t)}get fontFamily(){return this._style.ff}get fontSize(){return this._style.fs}get italic(){return this._style.it===ae.TRUE}get bold(){return this._style.bl===ae.TRUE}get underline(){return this._style.ul&&rn.create(this._style.ul)}get bottomBorderLine(){return this._style.bbl&&rn.create(this._style.bbl)}get strikethrough(){return this._style.st&&rn.create(this._style.st)}get overline(){return this._style.ol&&rn.create(this._style.ol)}get background(){return this._style.bg}get border(){return this._style.bd}get color(){return this._style.cl}get verticalAlign(){return this._style.va}get numberFormat(){return this._style.n}copy(){return nn.create(Z.deepClone(this._style))}getValue(){return{...this._style}}}class nn extends Mr{static create(t={}){return new nn(t)}constructor(t={}){super(t)}setFontFamily(t){return this._style.ff=t,this}setFontSize(t){return this._style.fs=t,this}setItalic(t){return this._style.it=t?1:0,this}setBold(t){return this._style.bl=t?1:0,this}setUnderline(t){return this._style.ul=t.build(),this}setBottomBorderLine(t){return this._style.bbl=t.build(),this}setStrikethrough(t){return this._style.st=t.build(),this}setOverline(t){return this._style.ol=t.build(),this}setBackground(t){return this._style.bg=t,this}setBorder(t){return this._style.bd=t,this}setColor(t){return this._style.cl=t,this}setVerticalAlign(t){return this._style.va=t,this}copy(){return nn.create(Z.deepClone(this._style))}build(){return this.getValue()}}class rn{constructor(t={s:1}){C(this,"_decoration");this._decoration=t}static create(t={s:1}){return new rn(t)}get show(){return this._decoration.s===ae.TRUE}get followFontColor(){return this._decoration.c===ae.TRUE}get color(){return this._decoration.cl}get type(){return this._decoration.t}setShow(t){return this._decoration.s=t?1:0,this}setFollowFontColor(t){return this._decoration.c=t?1:0,this}setColor(t){return this._decoration.cl=t,this}setLineType(t){return this._decoration.t=t,this}copy(){return rn.create(Z.deepClone(this._decoration))}build(){return{...this._decoration}}}class Lr{constructor(t={}){C(this,"_style");this._style=t}static create(t={}){return new Lr(t)}get indentFirstLine(){return this._style.indentFirstLine}get hanging(){return this._style.hanging}get indentStart(){return this._style.indentStart}get tabStops(){return this._style.tabStops}get indentEnd(){return this._style.indentEnd}get textStyle(){return this._style.textStyle}get headingId(){return this._style.headingId}get namedStyleType(){return this._style.namedStyleType}get horizontalAlign(){return this._style.horizontalAlign}get lineSpacing(){return this._style.lineSpacing}get direction(){return this._style.direction}get spacingRule(){return this._style.spacingRule}get snapToGrid(){return this._style.snapToGrid}get spaceAbove(){return this._style.spaceAbove}get spaceBelow(){return this._style.spaceBelow}get borderBetween(){return this._style.borderBetween}get borderTop(){return this._style.borderTop}get borderBottom(){return this._style.borderBottom}get borderLeft(){return this._style.borderLeft}get borderRight(){return this._style.borderRight}get keepLines(){return this._style.keepLines===ae.TRUE}get keepNext(){return this._style.keepNext===ae.TRUE}get wordWrap(){return this._style.wordWrap===ae.TRUE}get widowControl(){return this._style.widowControl===ae.TRUE}get shading(){return this._style.shading}get suppressHyphenation(){return this._style.suppressHyphenation===ae.TRUE}copy(){return Dr.create(Z.deepClone(this._style))}getValue(){return this._style}}class Dr extends Lr{static create(t={}){return new Dr(t)}constructor(t={}){super(t)}setIndentFirstLine(t){return this._style.indentFirstLine=t,this}setHanging(t){return this._style.hanging=t,this}setIndentStart(t){return this._style.indentStart=t,this}setTabStops(t){return this._style.tabStops=t,this}setIndentEnd(t){return this._style.indentEnd=t,this}setTextStyle(t){return this._style.textStyle=t,this}setHeadingId(t){return this._style.headingId=t,this}setNamedStyleType(t){return this._style.namedStyleType=t,this}setHorizontalAlign(t){return this._style.horizontalAlign=t,this}setLineSpacing(t){return this._style.lineSpacing=t,this}setDirection(t){return this._style.direction=t,this}setSpacingRule(t){return this._style.spacingRule=t,this}setSnapToGrid(t){return this._style.snapToGrid=t?1:0,this}setSpaceAbove(t){return this._style.spaceAbove=t,this}setSpaceBelow(t){return this._style.spaceBelow=t,this}setBorderBetween(t){return this._style.borderBetween=t,this}setBorderTop(t){return this._style.borderTop=t,this}setBorderBottom(t){return this._style.borderBottom=t,this}setBorderLeft(t){return this._style.borderLeft=t,this}setBorderRight(t){return this._style.borderRight=t,this}setKeepLines(t){return this._style.keepLines=t?1:0,this}setKeepNext(t){return this._style.keepNext=t?1:0,this}setWordWrap(t){return this._style.wordWrap=t?1:0,this}setWidowControl(t){return this._style.widowControl=t?1:0,this}setShading(t){return this._style.shading=t,this}setSuppressHyphenation(t){return this._style.suppressHyphenation=t?1:0,this}copy(){return Dr.create(Z.deepClone(this._style))}build(){return this.getValue()}}class sn{constructor(t){C(this,"_data");if(!t.body)throw new Error("Invalid document data, body is required");this._data=Fu(t)}static create(t){return new sn(t)}static createByBody(t){return new sn({body:t,id:"d",documentStyle:{}})}copy(){return Cn.create(Z.deepClone(this._data))}slice(t,n){const{body:r,...s}=this._data;return Cn.create({...Z.deepClone(s),body:bt(r,t,n)})}toPlainText(){var t,n;return Je.transform.getPlainText((n=(t=this._data.body)==null?void 0:t.dataStream)!=null?n:"").replaceAll("\r",`
1216
1216
  `)}getParagraphStyle(){var t,n;return Lr.create((n=(t=this._data.body)==null?void 0:t.paragraphs)==null?void 0:n[0].paragraphStyle)}getParagraphBullet(){var t,n;return(n=(t=this._data.body)==null?void 0:t.paragraphs)==null?void 0:n[0].bullet}getParagraphs(){var r,s;const t=(s=(r=this._data.body)==null?void 0:r.paragraphs)!=null?s:[];let n=0;return t.map(i=>{const o=this.slice(n,i.startIndex);return n=i.startIndex,o})}getTextRuns(){var t,n;return((n=(t=this._data.body)==null?void 0:t.textRuns)!=null?n:[]).map(r=>({...r,ts:r.ts?Mr.create(r.ts):null}))}getLinks(){var t,n,r;return(r=(n=(t=this._data.body)==null?void 0:t.customRanges)==null?void 0:n.filter(s=>s.rangeType===en.HYPERLINK))!=null?r:[]}getData(){return this._data}}class Cn extends sn{constructor(n){super(n);C(this,"_doc");this._doc=new At(n)}static newEmptyData(){return Fu({id:"d",documentStyle:{},drawings:{},drawingsOrder:[],body:{dataStream:`\r
1217
- `,customBlocks:[],customRanges:[],paragraphs:[{startIndex:0}],textRuns:[],tables:[],sectionBreaks:[]}})}static create(n){return new Cn(n!=null?n:Cn.newEmptyData())}insertText(n,r,s){var u,h;let i=((h=(u=this._data.body)==null?void 0:u.dataStream.length)!=null?h:2)-2,o,a;if(typeof n=="string"?o=n:(i=Math.min(n,i),o=r),typeof r=="object"?a=r instanceof nn?r.build():r:a=s instanceof nn?s.build():s,!o)return this;const l={dataStream:o,textRuns:a?[{ts:a,st:i,ed:i+o.length}]:[]},c=Je.selection.replace({doc:this._doc,selection:{startOffset:i,endOffset:i,collapsed:!0},body:l});if(!c)throw new Error("Insert text failed, please check.");return Me.apply(this._doc.getBody(),c.serialize()),this}insertRichText(n,r){var a,l;let s=((l=(a=this._data.body)==null?void 0:a.dataStream.length)!=null?l:2)-2,i;typeof n=="object"?i=n instanceof sn?n.getData():n:(s=Math.min(n,s),i=r instanceof sn?r.getData():r);const o=Je.selection.replace({doc:this._doc,selection:{startOffset:s,endOffset:s,collapsed:!0},body:i.body});if(!o)throw new Error("Insert text failed, please check.");return Me.apply(this._doc.getBody(),o.serialize()),this}delete(n,r){if(r!==void 0){if(!r)return this;const s=Je.selection.delete([{startOffset:n,endOffset:n+r,collapsed:!0}],this._data.body);Me.apply(this._doc.getBody(),s)}return this}setStyle(n,r,s){const i={dataStream:"",textRuns:[{ts:s instanceof nn?s.build():s,st:0,ed:r-n}]},o=Je.selection.retain([{startOffset:n,endOffset:r,collapsed:!0}],i);return Me.apply(this._doc.getBody(),o),this}setLink(n,r,s){const i=Je.customRange.add({rangeType:en.HYPERLINK,rangeId:tt(),properties:{url:s},ranges:[{startOffset:n,endOffset:r,collapsed:!1}],body:this._data.body});if(!i)throw new Error("Insert text failed, please check.");return Me.apply(this._doc.getBody(),i.serialize()),this}cancelLink(n,r){if(typeof n=="string"){const s=Je.customRange.delete({rangeId:n,documentDataModel:this._doc});if(!s)throw new Error("Insert text failed, please check.");Me.apply(this._doc.getBody(),s.serialize())}else this.slice(n,r).getLinks().forEach(i=>{const o=Je.customRange.delete({rangeId:i.rangeId,documentDataModel:this._doc});if(!o)throw new Error("Insert text failed, please check.");Me.apply(this._doc.getBody(),o.serialize())});return this}updateLink(n,r){var i,o;const s=(o=(i=this._data.body)==null?void 0:i.customRanges)==null?void 0:o.find(a=>a.rangeId===n);if(!s)throw new Error("Link not found");return s.properties.url=r,this}insertParagraph(n,r){var o,a;let s,i;return typeof n=="object"?(s={dataStream:"\r",paragraphs:[{startIndex:0,paragraphStyle:n.build()}]},i=((a=(o=this._data.body)==null?void 0:o.dataStream.length)!=null?a:2)-2):(i=n,s={dataStream:"\r",paragraphs:[{startIndex:0,paragraphStyle:r==null?void 0:r.build()}]}),this.insertRichText(i,sn.create({body:s,id:"d",documentStyle:{}})),this}insertLink(n,r,s){let i="",o="";typeof n=="string"?(i=n,o=r):(i=r,o=s);const a=Cn.createByBody({dataStream:i,customRanges:[{rangeType:en.HYPERLINK,rangeId:tt(),properties:{url:o},startIndex:0,endIndex:i.length-1}]});return typeof n=="number"?this.insertRichText(n,a):this.insertRichText(a)}}const Qp="__default_document_sub_component_id20231101__";class xu{constructor(){C(this,"skipNextObservers",!1);C(this,"lastReturnValue");C(this,"isStopPropagation",!1)}stopPropagation(){this.isStopPropagation=!0}}class eE extends oe.Subject{constructor(){super(...arguments);C(this,"_sortedObservers",[])}subscribe(){throw new Error("[EventSubject]: please use `subscribeEvent` instead of `subscribe` method for `EventSubject`.")}next(){throw new Error("[EventSubject]: please use `emitEvent` instead of `next` method for `EventSubject`.")}unsubscribe(){super.unsubscribe(),this._sortedObservers.length=0}complete(){super.complete(),this._sortedObservers.length=0}subscribeEvent(n){let r;typeof n=="function"?r={next:([i,o])=>n(i,o)}:r=n;const s=super.subscribe(r);return this._sortedObservers.push(r),this._sortedObservers.sort((i,o)=>{var a,l;return((a=i.priority)!=null?a:0)-((l=o.priority)!=null?l:0)}),s.add(()=>this._sortedObservers=this._sortedObservers.filter(i=>i!==r)),s}clearObservers(){this._sortedObservers.forEach(n=>{var r;return(r=n.complete)==null?void 0:r.call(n)}),this._sortedObservers.length=0}emitEvent(n){var r;if(!this.closed){const s=new xu;s.lastReturnValue=n;for(const i of this._sortedObservers){const o=(r=i.next)==null?void 0:r.call(i,[n,s]);if(s.lastReturnValue=o,s.skipNextObservers)return{handled:!0,lastReturnValue:s.lastReturnValue,stopPropagation:s.isStopPropagation}}return{handled:this._sortedObservers.length>0,lastReturnValue:s.lastReturnValue,stopPropagation:s.isStopPropagation}}throw new Error("[EventSubject]: cannot emit event on a closed subject.")}}function tE(e){return new oe.Observable(t=>{const n=e.subscribeEvent(r=>{t.next(r)});return()=>n.unsubscribe()})}const js=Re.createIdentifier("core.resource-manager.service"),Po={[kt.Editor]:"Editor",[kt.Owner]:"Owner",[kt.Reader]:"Reader",[kt.UNRECOGNIZED]:"UNRECOGNIZED"},Ys=e=>e?{userID:`${Po[e]}_${tt(8)}`,name:Po[e],avatar:""}:{userID:"",name:"",avatar:"",anonymous:!0,canBindAnonymous:!1},nE=(e,t)=>e.startsWith(Po[t]);class Ur extends ze{constructor(){super(...arguments);C(this,"_model",new Map);C(this,"_userChange$",new oe.Subject);C(this,"userChange$",this._userChange$.asObservable());C(this,"_currentUser$",new oe.BehaviorSubject(Ys()));C(this,"currentUser$",this._currentUser$.asObservable())}dispose(){super.dispose(),this._model.clear(),this._userChange$.complete(),this._currentUser$.complete()}getCurrentUser(){return this._currentUser$.getValue()}setCurrentUser(n){this.addUser(n),this._currentUser$.next(n)}addUser(n){this._model.set(n.userID,n),this._userChange$.next({type:"add",user:n})}getUser(n,r){const s=this._model.get(n);if(s)return s;r&&r()}delete(n){const r=this.getUser(n);this._model.delete(n),r&&this._userChange$.next({type:"delete",user:r})}clear(){this._model.clear(),this._userChange$.next({type:"clear"})}list(){return Array.from(this._model.values())}}var rE=Object.getOwnPropertyDescriptor,sE=(e,t,n,r)=>{for(var s=r>1?void 0:r?rE(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=o(s)||s);return s},Bu=(e,t)=>(n,r)=>t(n,r,e);f.AuthzIoLocalService=class{constructor(t,n){C(this,"_permissionMap",new Map([]));this._resourceManagerService=t,this._userManagerService=n,this._initSnapshot(),this._initDefaultUser()}_initDefaultUser(){const t=this._userManagerService.getCurrentUser();t&&t.userID||this._userManagerService.setCurrentUser(Ys(kt.Owner))}_getRole(t){const n=this._userManagerService.getCurrentUser();return n?nE(n.userID,t):!1}_initSnapshot(){this._resourceManagerService.registerPluginResource({toJson:t=>{const n=[...this._permissionMap.keys()].reduce((r,s)=>{const i=this._permissionMap.get(s);return r[s]=i,r},{});return JSON.stringify(n)},parseJson:t=>JSON.parse(t),pluginName:"SHEET_AuthzIoMockService_PLUGIN",businesses:[we.UNIVER_SHEET,we.UNIVER_DOC,we.UNIVER_SLIDE],onLoad:(t,n)=>{for(const r in n)this._permissionMap.set(r,n[r])},onUnLoad:()=>{this._permissionMap.clear()}})}async create(t){return tt(8)}async allowed(t){return Promise.resolve([])}async batchAllowed(t){return Promise.resolve([])}async list(t){const n=[];return t.objectIDs.forEach(r=>{const s=this._permissionMap.get(r);if(s){const i={objectID:r,unitID:t.unitID,objectType:s.objectType,name:s.name,shareOn:!1,shareRole:kt.Owner,shareScope:-1,scope:{read:Eo.AllCollaborator,edit:Eo.AllCollaborator},creator:Ys(kt.Owner),strategies:[{action:6,role:1},{action:16,role:1},{action:17,role:1},{action:18,role:1},{action:19,role:1},{action:33,role:1},{action:34,role:1},{action:35,role:1},{action:36,role:1},{action:37,role:1},{action:38,role:1},{action:39,role:1},{action:40,role:1}],actions:t.actions.map(o=>({action:o,allowed:this._getRole(kt.Owner)||this._getRole(kt.Editor)}))};n.push(i)}}),n}async listCollaborators(){return[]}async listRoles(){return{roles:[],actions:[]}}async deleteCollaborator(){}async update(t){}async updateCollaborator(){}async createCollaborator(){}async putCollaborators(t){}},f.AuthzIoLocalService=sE([Bu(0,js),Bu(1,Re.Inject(Ur))],f.AuthzIoLocalService);const $u=Re.createIdentifier("IAuthzIoIoService");var Hu=typeof global=="object"&&global&&global.Object===Object&&global,iE=typeof self=="object"&&self&&self.Object===Object&&self,Rn=Hu||iE||Function("return this")(),Yn=Rn.Symbol,Wu=Object.prototype,oE=Wu.hasOwnProperty,aE=Wu.toString,Pr=Yn?Yn.toStringTag:void 0;function lE(e){var t=oE.call(e,Pr),n=e[Pr];try{e[Pr]=void 0;var r=!0}catch{}var s=aE.call(e);return r&&(t?e[Pr]=n:delete e[Pr]),s}var cE=Object.prototype,uE=cE.toString;function hE(e){return uE.call(e)}var dE="[object Null]",fE="[object Undefined]",ju=Yn?Yn.toStringTag:void 0;function kr(e){return e==null?e===void 0?fE:dE:ju&&ju in Object(e)?lE(e):hE(e)}function Gn(e){return e!=null&&typeof e=="object"}var mE="[object Symbol]";function Gs(e){return typeof e=="symbol"||Gn(e)&&kr(e)==mE}function gE(e,t){for(var n=-1,r=e==null?0:e.length,s=Array(r);++n<r;)s[n]=t(e[n],n,e);return s}var Vn=Array.isArray,Yu=Yn?Yn.prototype:void 0,Gu=Yu?Yu.toString:void 0;function Vu(e){if(typeof e=="string")return e;if(Vn(e))return gE(e,Vu)+"";if(Gs(e))return Gu?Gu.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var _E=/\s/;function pE(e){for(var t=e.length;t--&&_E.test(e.charAt(t)););return t}var EE=/^\s+/;function CE(e){return e&&e.slice(0,pE(e)+1).replace(EE,"")}function Ct(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var zu=NaN,RE=/^[-+]0x[0-9a-f]+$/i,IE=/^0b[01]+$/i,SE=/^0o[0-7]+$/i,OE=parseInt;function Ku(e){if(typeof e=="number")return e;if(Gs(e))return zu;if(Ct(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Ct(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=CE(e);var n=IE.test(e);return n||SE.test(e)?OE(e.slice(2),n?2:8):RE.test(e)?zu:+e}function Xu(e){return e}var vE="[object AsyncFunction]",wE="[object Function]",bE="[object GeneratorFunction]",AE="[object Proxy]";function ko(e){if(!Ct(e))return!1;var t=kr(e);return t==wE||t==bE||t==vE||t==AE}var Fo=Rn["__core-js_shared__"],qu=function(){var e=/[^.]+$/.exec(Fo&&Fo.keys&&Fo.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function TE(e){return!!qu&&qu in e}var yE=Function.prototype,NE=yE.toString;function ME(e){if(e!=null){try{return NE.call(e)}catch{}try{return e+""}catch{}}return""}var LE=/[\\^$.*+?()[\]{}|]/g,DE=/^\[object .+?Constructor\]$/,UE=Function.prototype,PE=Object.prototype,kE=UE.toString,FE=PE.hasOwnProperty,xE=RegExp("^"+kE.call(FE).replace(LE,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function BE(e){if(!Ct(e)||TE(e))return!1;var t=ko(e)?xE:DE;return t.test(ME(e))}function $E(e,t){return e==null?void 0:e[t]}function xo(e,t){var n=$E(e,t);return BE(n)?n:void 0}var Zu=Object.create,HE=function(){function e(){}return function(t){if(!Ct(t))return{};if(Zu)return Zu(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function WE(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function jE(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var YE=800,GE=16,VE=Date.now;function zE(e){var t=0,n=0;return function(){var r=VE(),s=GE-(r-n);if(n=r,s>0){if(++t>=YE)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function KE(e){return function(){return e}}var Vs=function(){try{var e=xo(Object,"defineProperty");return e({},"",{}),e}catch{}}(),XE=Vs?function(e,t){return Vs(e,"toString",{configurable:!0,enumerable:!1,value:KE(t),writable:!0})}:Xu,qE=zE(XE),ZE=9007199254740991,JE=/^(?:0|[1-9]\d*)$/;function Bo(e,t){var n=typeof e;return t=t==null?ZE:t,!!t&&(n=="number"||n!="symbol"&&JE.test(e))&&e>-1&&e%1==0&&e<t}function $o(e,t,n){t=="__proto__"&&Vs?Vs(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function zs(e,t){return e===t||e!==e&&t!==t}var QE=Object.prototype,e0=QE.hasOwnProperty;function Ju(e,t,n){var r=e[t];(!(e0.call(e,t)&&zs(r,n))||n===void 0&&!(t in e))&&$o(e,t,n)}function t0(e,t,n,r){var s=!n;n||(n={});for(var i=-1,o=t.length;++i<o;){var a=t[i],l=void 0;l===void 0&&(l=e[a]),s?$o(n,a,l):Ju(n,a,l)}return n}var Qu=Math.max;function n0(e,t,n){return t=Qu(t===void 0?e.length-1:t,0),function(){for(var r=arguments,s=-1,i=Qu(r.length-t,0),o=Array(i);++s<i;)o[s]=r[t+s];s=-1;for(var a=Array(t+1);++s<t;)a[s]=r[s];return a[t]=n(o),WE(e,this,a)}}function r0(e,t){return qE(n0(e,t,Xu),e+"")}var s0=9007199254740991;function eh(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=s0}function Ho(e){return e!=null&&eh(e.length)&&!ko(e)}function i0(e,t,n){if(!Ct(n))return!1;var r=typeof t;return(r=="number"?Ho(n)&&Bo(t,n.length):r=="string"&&t in n)?zs(n[t],e):!1}function th(e){return r0(function(t,n){var r=-1,s=n.length,i=s>1?n[s-1]:void 0,o=s>2?n[2]:void 0;for(i=e.length>3&&typeof i=="function"?(s--,i):void 0,o&&i0(n[0],n[1],o)&&(i=s<3?void 0:i,s=1),t=Object(t);++r<s;){var a=n[r];a&&e(t,a,r,i)}return t})}var o0=Object.prototype;function nh(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||o0;return e===n}function a0(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var l0="[object Arguments]";function rh(e){return Gn(e)&&kr(e)==l0}var sh=Object.prototype,c0=sh.hasOwnProperty,u0=sh.propertyIsEnumerable,Wo=rh(function(){return arguments}())?rh:function(e){return Gn(e)&&c0.call(e,"callee")&&!u0.call(e,"callee")};function h0(){return!1}var ih=typeof f=="object"&&f&&!f.nodeType&&f,oh=ih&&typeof module=="object"&&module&&!module.nodeType&&module,d0=oh&&oh.exports===ih,ah=d0?Rn.Buffer:void 0,f0=ah?ah.isBuffer:void 0,lh=f0||h0,m0="[object Arguments]",g0="[object Array]",_0="[object Boolean]",p0="[object Date]",E0="[object Error]",C0="[object Function]",R0="[object Map]",I0="[object Number]",S0="[object Object]",O0="[object RegExp]",v0="[object Set]",w0="[object String]",b0="[object WeakMap]",A0="[object ArrayBuffer]",T0="[object DataView]",y0="[object Float32Array]",N0="[object Float64Array]",M0="[object Int8Array]",L0="[object Int16Array]",D0="[object Int32Array]",U0="[object Uint8Array]",P0="[object Uint8ClampedArray]",k0="[object Uint16Array]",F0="[object Uint32Array]",xe={};xe[y0]=xe[N0]=xe[M0]=xe[L0]=xe[D0]=xe[U0]=xe[P0]=xe[k0]=xe[F0]=!0,xe[m0]=xe[g0]=xe[A0]=xe[_0]=xe[T0]=xe[p0]=xe[E0]=xe[C0]=xe[R0]=xe[I0]=xe[S0]=xe[O0]=xe[v0]=xe[w0]=xe[b0]=!1;function x0(e){return Gn(e)&&eh(e.length)&&!!xe[kr(e)]}function B0(e){return function(t){return e(t)}}var ch=typeof f=="object"&&f&&!f.nodeType&&f,Fr=ch&&typeof module=="object"&&module&&!module.nodeType&&module,$0=Fr&&Fr.exports===ch,jo=$0&&Hu.process,uh=function(){try{var e=Fr&&Fr.require&&Fr.require("util").types;return e||jo&&jo.binding&&jo.binding("util")}catch{}}(),hh=uh&&uh.isTypedArray,dh=hh?B0(hh):x0;function H0(e,t){var n=Vn(e),r=!n&&Wo(e),s=!n&&!r&&lh(e),i=!n&&!r&&!s&&dh(e),o=n||r||s||i,a=o?a0(e.length,String):[],l=a.length;for(var c in e)o&&(c=="length"||s&&(c=="offset"||c=="parent")||i&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Bo(c,l))||a.push(c);return a}function W0(e,t){return function(n){return e(t(n))}}function j0(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var Y0=Object.prototype,G0=Y0.hasOwnProperty;function V0(e){if(!Ct(e))return j0(e);var t=nh(e),n=[];for(var r in e)r=="constructor"&&(t||!G0.call(e,r))||n.push(r);return n}function fh(e){return Ho(e)?H0(e):V0(e)}var z0=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,K0=/^\w*$/;function X0(e,t){if(Vn(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||Gs(e)?!0:K0.test(e)||!z0.test(e)||t!=null&&e in Object(t)}var xr=xo(Object,"create");function q0(){this.__data__=xr?xr(null):{},this.size=0}function Z0(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var J0="__lodash_hash_undefined__",Q0=Object.prototype,eC=Q0.hasOwnProperty;function tC(e){var t=this.__data__;if(xr){var n=t[e];return n===J0?void 0:n}return eC.call(t,e)?t[e]:void 0}var nC=Object.prototype,rC=nC.hasOwnProperty;function sC(e){var t=this.__data__;return xr?t[e]!==void 0:rC.call(t,e)}var iC="__lodash_hash_undefined__";function oC(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=xr&&t===void 0?iC:t,this}function In(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}In.prototype.clear=q0,In.prototype.delete=Z0,In.prototype.get=tC,In.prototype.has=sC,In.prototype.set=oC;function aC(){this.__data__=[],this.size=0}function Ks(e,t){for(var n=e.length;n--;)if(zs(e[n][0],t))return n;return-1}var lC=Array.prototype,cC=lC.splice;function uC(e){var t=this.__data__,n=Ks(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():cC.call(t,n,1),--this.size,!0}function hC(e){var t=this.__data__,n=Ks(t,e);return n<0?void 0:t[n][1]}function dC(e){return Ks(this.__data__,e)>-1}function fC(e,t){var n=this.__data__,r=Ks(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function jt(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}jt.prototype.clear=aC,jt.prototype.delete=uC,jt.prototype.get=hC,jt.prototype.has=dC,jt.prototype.set=fC;var mh=xo(Rn,"Map");function mC(){this.size=0,this.__data__={hash:new In,map:new(mh||jt),string:new In}}function gC(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Xs(e,t){var n=e.__data__;return gC(t)?n[typeof t=="string"?"string":"hash"]:n.map}function _C(e){var t=Xs(this,e).delete(e);return this.size-=t?1:0,t}function pC(e){return Xs(this,e).get(e)}function EC(e){return Xs(this,e).has(e)}function CC(e,t){var n=Xs(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function on(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}on.prototype.clear=mC,on.prototype.delete=_C,on.prototype.get=pC,on.prototype.has=EC,on.prototype.set=CC;var RC="Expected a function";function Yo(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(RC);var n=function(){var r=arguments,s=t?t.apply(this,r):r[0],i=n.cache;if(i.has(s))return i.get(s);var o=e.apply(this,r);return n.cache=i.set(s,o)||i,o};return n.cache=new(Yo.Cache||on),n}Yo.Cache=on;var IC=500;function SC(e){var t=Yo(e,function(r){return n.size===IC&&n.clear(),r}),n=t.cache;return t}var OC=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,vC=/\\(\\)?/g,wC=SC(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(OC,function(n,r,s,i){t.push(s?i.replace(vC,"$1"):r||n)}),t});function bC(e){return e==null?"":Vu(e)}function gh(e,t){return Vn(e)?e:X0(e,t)?[e]:wC(bC(e))}function _h(e){if(typeof e=="string"||Gs(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function AC(e,t){t=gh(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[_h(t[n++])];return n&&n==r?e:void 0}function ph(e,t,n){var r=e==null?void 0:AC(e,t);return r===void 0?n:r}var Eh=W0(Object.getPrototypeOf,Object),TC="[object Object]",yC=Function.prototype,NC=Object.prototype,Ch=yC.toString,MC=NC.hasOwnProperty,LC=Ch.call(Object);function DC(e){if(!Gn(e)||kr(e)!=TC)return!1;var t=Eh(e);if(t===null)return!0;var n=MC.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Ch.call(n)==LC}function UC(){this.__data__=new jt,this.size=0}function PC(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function kC(e){return this.__data__.get(e)}function FC(e){return this.__data__.has(e)}var xC=200;function BC(e,t){var n=this.__data__;if(n instanceof jt){var r=n.__data__;if(!mh||r.length<xC-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new on(r)}return n.set(e,t),this.size=n.size,this}function zn(e){var t=this.__data__=new jt(e);this.size=t.size}zn.prototype.clear=UC,zn.prototype.delete=PC,zn.prototype.get=kC,zn.prototype.has=FC,zn.prototype.set=BC;var Rh=typeof f=="object"&&f&&!f.nodeType&&f,Ih=Rh&&typeof module=="object"&&module&&!module.nodeType&&module,$C=Ih&&Ih.exports===Rh,Sh=$C?Rn.Buffer:void 0;Sh&&Sh.allocUnsafe;function HC(e,t){return e.slice()}var Oh=Rn.Uint8Array;function WC(e){var t=new e.constructor(e.byteLength);return new Oh(t).set(new Oh(e)),t}function jC(e,t){var n=WC(e.buffer);return new e.constructor(n,e.byteOffset,e.length)}function YC(e){return typeof e.constructor=="function"&&!nh(e)?HE(Eh(e)):{}}function GC(e){return function(t,n,r){for(var s=-1,i=Object(t),o=r(t),a=o.length;a--;){var l=o[++s];if(n(i[l],l,i)===!1)break}return t}}var VC=GC(),Go=function(){return Rn.Date.now()},zC="Expected a function",KC=Math.max,XC=Math.min;function qC(e,t,n){var r,s,i,o,a,l,c=0,u=!1,h=!1,d=!0;if(typeof e!="function")throw new TypeError(zC);t=Ku(t)||0,Ct(n)&&(u=!!n.leading,h="maxWait"in n,i=h?KC(Ku(n.maxWait)||0,t):i,d="trailing"in n?!!n.trailing:d);function m(R){var b=r,y=s;return r=s=void 0,c=R,o=e.apply(y,b),o}function _(R){return c=R,a=setTimeout(A,t),u?m(R):o}function p(R){var b=R-l,y=R-c,$=t-b;return h?XC($,i-y):$}function I(R){var b=R-l,y=R-c;return l===void 0||b>=t||b<0||h&&y>=i}function A(){var R=Go();if(I(R))return B(R);a=setTimeout(A,p(R))}function B(R){return a=void 0,d&&r?m(R):(r=s=void 0,o)}function x(){a!==void 0&&clearTimeout(a),c=0,r=l=s=a=void 0}function Y(){return a===void 0?o:B(Go())}function O(){var R=Go(),b=I(R);if(r=arguments,s=this,l=R,b){if(a===void 0)return _(l);if(h)return clearTimeout(a),a=setTimeout(A,t),m(l)}return a===void 0&&(a=setTimeout(A,t)),o}return O.cancel=x,O.flush=Y,O}function Vo(e,t,n){(n!==void 0&&!zs(e[t],n)||n===void 0&&!(t in e))&&$o(e,t,n)}function ZC(e){return Gn(e)&&Ho(e)}function zo(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function JC(e){return t0(e,fh(e))}function QC(e,t,n,r,s,i,o){var a=zo(e,n),l=zo(t,n),c=o.get(l);if(c){Vo(e,n,c);return}var u=i?i(a,l,n+"",e,t,o):void 0,h=u===void 0;if(h){var d=Vn(l),m=!d&&lh(l),_=!d&&!m&&dh(l);u=l,d||m||_?Vn(a)?u=a:ZC(a)?u=jE(a):m?(h=!1,u=HC(l)):_?(h=!1,u=jC(l)):u=[]:DC(l)||Wo(l)?(u=a,Wo(a)?u=JC(a):(!Ct(a)||ko(a))&&(u=YC(l))):h=!1}h&&(o.set(l,u),s(u,l,r,i,o),o.delete(l)),Vo(e,n,u)}function Ko(e,t,n,r,s){e!==t&&VC(t,function(i,o){if(s||(s=new zn),Ct(i))QC(e,t,o,n,Ko,r,s);else{var a=r?r(zo(e,o),i,o+"",e,t,s):void 0;a===void 0&&(a=i),Vo(e,o,a)}},fh)}var eR=th(function(e,t,n,r){Ko(e,t,n,r)}),Xo=th(function(e,t,n){Ko(e,t,n)});function tR(e,t,n,r){if(!Ct(e))return e;t=gh(t,e);for(var s=-1,i=t.length,o=i-1,a=e;a!=null&&++s<i;){var l=_h(t[s]),c=n;if(l==="__proto__"||l==="constructor"||l==="prototype")return e;if(s!=o){var u=a[l];c=void 0,c===void 0&&(c=Ct(u)?u:Bo(t[s+1])?[]:{})}Ju(a,l,c),a=a[l]}return e}function nR(e,t,n){return e==null?e:tR(e,t,n)}const qo=Re.createIdentifier("univer.config-service");class vh{constructor(){C(this,"_configChanged$",new oe.Subject);C(this,"configChanged$",this._configChanged$.asObservable());C(this,"_config",new Map)}dispose(){this._config.clear(),this._configChanged$.complete()}getConfig(t){return this._config.get(t)}setConfig(t,n,r){var o;const{merge:s=!1}=r||{};let i=(o=this._config.get(t))!=null?o:{};s?i=Xo(i,n):i=n,this._config.set(t,i),this._configChanged$.next({[t]:i})}deleteConfig(t){return this._config.delete(t)}subscribeConfigValue$(t){return new oe.Observable(n=>{Object.prototype.hasOwnProperty.call(this._config,t)&&n.next(this._config.get(t));const r=this.configChanged$.pipe(oe.filter(s=>Object.prototype.hasOwnProperty.call(s,t))).subscribe(s=>n.next(s[t]));return()=>r.unsubscribe()})}}const Br="FOCUSING_UNIT",Kn="FOCUSING_SHEET",$r="FOCUSING_DOC",Hr="FOCUSING_SLIDE",rR="FOCUSING_EDITOR_BUT_HIDDEN",wh="EDITOR_ACTIVATED",sR="FOCUSING_EDITOR_INPUT_FORMULA",bh="FOCUSING_FX_BAR_EDITOR",iR="FOCUSING_UNIVER_EDITOR",oR="FOCUSING_EDITOR_INPUT_FORMULA",aR="FOCUSING_PANEL_EDITOR",lR="FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE",cR="FOCUSING_COMMON_DRAWINGS",uR="FORMULA_EDITOR_ACTIVATED";class Ah extends ze{constructor(){super(...arguments);C(this,"_error$",new oe.Subject);C(this,"error$",this._error$.asObservable())}dispose(){this._error$.complete()}emit(n){this._error$.next({errorKey:n})}}var Zo=(e=>(e.URL="URL",e.UUID="UUID",e.BASE64="BASE64",e))(Zo||{}),Th=(e=>(e.SUCCUSS="0",e.ERROR_EXCEED_SIZE="1",e.ERROR_IMAGE_TYPE="2",e.ERROR_UPLOAD_COUNT_LIMIT="3",e.ERROR_IMAGE="4",e))(Th||{});const Jo=Re.createIdentifier("core.image-io.service"),hR={version:"0.9.3"};function dR(e="",t=ar.ZH_CN,n=""){return{id:e,sheetOrder:[],name:n,appVersion:hR.version,locale:t,styles:{},sheets:{},resources:[]}}class yh{constructor(t={}){C(this,"_styles");C(this,"_cacheMap",new ur(1e5));this._styles=t,this._generateCacheMap()}each(t){return Object.entries(this._styles).forEach(t),this}search(t,n){if(this._cacheMap.has(n))return this._cacheMap.get(n);const r=this._getExistingStyleId(t);return r||"-1"}get(t){return typeof t!="string"?t:(t=String(t),this._styles[t])}add(t,n){const r=tt(6);return this._styles[r]=t,this._cacheMap.set(n,r),r}setValue(t){if(t==null)return;const n=JSON.stringify(t),r=this.search(t,n);return r!=="-1"?r:this.add(t,n)}toJSON(){return this._styles}getStyleByCell(t){let n;t&&Z.isObject(t.s)?n=t.s:n=(t==null?void 0:t.s)&&this.get(t.s);const r=t==null?void 0:t.interceptorStyle;return r?{...n,...r}:n}_generateCacheMap(){const{_styles:t,_cacheMap:n}=this;for(const r in t){const s=JSON.stringify(t[r]);n.set(s,r)}}_getExistingStyleId(t){const{_styles:n}=this;for(const r in n)if(Z.diffValue(n[r],t))return r;return null}}const fR=(e,t)=>t.length===e.length&&!e.some(n=>t.some(r=>!tn.equals(r,n))),mR=(e,t)=>t.length===e.length&&e.every((n,r)=>{const s=t[r];return s.unitId===n.unitId&&s.sheetId===n.sheetId&&tn.equals(n.range,s.range)}),Qo={t:0,b:2,l:2,r:2},gR=e=>({sbr:.6,sbo:e,spr:.6,spo:e}),Nh=90;function Wr(e,t,n={}){const r=e.length,{textRotation:s,paddingData:i,horizontalAlign:o=Ot.UNSPECIFIED,verticalAlign:a=hn.UNSPECIFIED,wrapStrategy:l=dn.UNSPECIFIED,cellValueType:c}=n,{t:u,r:h,b:d,l:m}=i||Qo,{vertexAngle:_,centerAngle:p}=Ph(s),I={id:"d",body:{dataStream:`${e}${_a}`,textRuns:[{ts:t,st:0,ed:r}],paragraphs:[{startIndex:r,paragraphStyle:{horizontalAlign:o}}],sectionBreaks:[{startIndex:r+1}]},documentStyle:{pageSize:{width:Number.POSITIVE_INFINITY,height:Number.POSITIVE_INFINITY},marginTop:u,marginBottom:d,marginRight:h,marginLeft:m,renderConfig:{horizontalAlign:o,verticalAlign:a,centerAngle:p,vertexAngle:_,wrapStrategy:l,cellValueType:c,zeroWidthParagraphBreak:1}},drawings:{},drawingsOrder:[]};return new At(I)}function _R(e){if(!e)return{};const{tr:t,td:n,ht:r,vt:s,tb:i,pd:o}=e;return{textRotation:t,textDirection:n,horizontalAlign:r,verticalAlign:s,wrapStrategy:i,paddingData:o}}function Mh(e){if(!e)return{};const{ff:t,fs:n,it:r,bl:s,ul:i,st:o,ol:a,cl:l}=e,c={};return t&&(c.ff=t),n&&(c.fs=n),r&&(c.it=r),s&&(c.bl=s),i&&(c.ul=i),o&&(c.st=o),a&&(c.ol=a),l&&(c.cl=l),c}function Lh(e,t,n){var i;const r=e.getBody();if((i=r.customRanges)!=null&&i.some(o=>o.rangeType===en.HYPERLINK))return;const s=Je.customRange.add({ranges:[{startOffset:0,endOffset:r.dataStream.length-1,collapsed:!1}],rangeId:n,rangeType:en.HYPERLINK,body:r,properties:{url:t,refId:n}});s&&Me.apply(r,s.serialize())}function Dh(e){return e!=null}const pR='"Helvetica Neue", Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Heiti SC", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif';function Uh(e){const t=st.ff,n=st.fs;if(!e){const h=`${n}pt ${t}`;return{fontCache:h,fontString:h,fontSize:n,originFontSize:n,fontFamily:t}}let r=kn.ITALIC;(e.it===0||e.it===void 0)&&(r=kn.NORMAL);let s=kn.BOLD;(e.bl===0||e.bl===void 0)&&(s=kn.NORMAL);let i=n;e.fs&&(i=Math.ceil(e.fs));let o=t;if(e.ff){let h=e.ff;h=h.replace(/"/g,"").replace(/'/g,""),h.indexOf(" ")>-1&&(h=`"${h}"`),h==null&&(h=t),o=h}const{va:a}=e;let l=i;if(a===$t.SUBSCRIPT||a===$t.SUPERSCRIPT){const h=ER(o,l),{sbr:d,spr:m}=h;l*=a===$t.SUBSCRIPT?d:m}const c=`${r} ${s} ${l}pt ${o}`,u=`${c}, ${pR} `;return{fontCache:c,fontString:u,fontSize:l,originFontSize:i,fontFamily:o}}function ER(e,t){return gR(t)}function Ph(e){const{a:t=0,v:n=ae.FALSE}=e||{a:0,v:ae.FALSE};let r=0,s=t;return n===ae.TRUE&&(r=Nh,s=Nh),{centerAngle:r,vertexAngle:s}}class CR{constructor(t,n){C(this,"_columnData",{});this._config=t,this._columnData=n}getColumnData(){return this._columnData}getColVisible(t){const{_columnData:n}=this,r=n[t];return r?r.hd!==ae.TRUE:!0}getColumnStyle(t){var n;return(n=this._columnData[t])==null?void 0:n.s}setColumnStyle(t,n){const r=this.getColumnOrCreate(t);r.s=n}getHiddenCols(t=0,n=this.getSize()-1){const r=[];let s=!1,i=-1;for(let o=t;o<=n;o++){const a=this.getColVisible(o);s&&a?(s=!1,r.push({rangeType:pe.COLUMN,startColumn:i,endColumn:o-1,startRow:0,endRow:0})):!s&&!a&&(s=!0,i=o)}return s&&r.push({startRow:0,endRow:0,startColumn:i,endColumn:n,rangeType:pe.COLUMN}),r}getVisibleCols(t=0,n=this.getSize()-1){const r=[];let s=!1,i=-1;for(let o=t;o<=n;o++){const a=this.getColVisible(o);s&&!a?(s=!1,r.push({rangeType:pe.COLUMN,startColumn:i,endColumn:o-1,startRow:0,endRow:0})):!s&&a&&(s=!0,i=o)}return s&&r.push({startRow:0,endRow:0,startColumn:i,endColumn:n,rangeType:pe.COLUMN}),r}getColumnDatas(t,n){const r={};let s=0;for(let i=t;i<t+n;i++){const o=this.getColumn(i);r[s]=o!=null?o:{w:this._config.defaultColumnWidth,hd:ae.FALSE},s++}return r}getSize(){return Zt(this._columnData)}getColumnWidth(t){var n,r;return(r=(n=this._columnData[t])==null?void 0:n.w)!=null?r:this._config.defaultColumnWidth}setColumnWidth(t,n){const r=this._columnData[t];n===this._config.defaultColumnWidth?r&&(delete r.w,Object.keys(r).length===0&&delete this._columnData[t]):this._columnData[t]=r?{...r,w:n}:{w:n}}getColumn(t){return this._columnData[t]}removeColumn(t){delete this._columnData[t]}getColumnOrCreate(t){const{_columnData:n}=this,r=n[t];if(r)return r;const s={};return this._columnData[t]=s,s}setCustomMetadata(t,n){const r=this.getColumn(t);r&&(r.custom=n)}getCustomMetadata(t){var n;return(n=this.getColumn(t))==null?void 0:n.custom}}const RR=2e3;class IR{constructor(t,n,r){C(this,"_rowData");this._config=t,this._viewModel=n,this._rowData=r}getRowData(){return this._rowData}getRowStyle(t){var n;return(n=this._rowData[t])==null?void 0:n.s}setRowStyle(t,n){const r=this.getRowOrCreate(t);r.s=n}getRowDatas(t,n){const r={};let s=0;for(let i=t;i<t+n;i++){const o=this.getRow(i);r[s]=o!=null?o:{h:this._config.defaultRowHeight,hd:ae.FALSE},s++}return r}getRowHeight(t,n=1){const{_rowData:r}=this,s=this._config;let i=0;for(let o=0;o<n;o++){const a=r[o+t]||{hd:ae.FALSE,h:s.defaultRowHeight},{ia:l,ah:c,h:u=s.defaultRowHeight}=a;i+=(l==null||l===ae.TRUE)&&typeof c=="number"?c:u}return i}setRowHeight(t,n){const r=this._rowData[t];if(n===this._config.defaultRowHeight)r&&(delete r.h,Object.keys(r).length===0&&delete this._rowData[t]);else{const s=Math.min(n,RR);this._rowData[t]=r?{...r,h:s}:{h:s}}}getRow(t){return this._rowData[t]}removeRow(t){delete this._rowData[t]}getRowOrCreate(t){const{_rowData:n}=this,r=n[t];if(r)return r;const s={};return n[t]=s,s}getHiddenRows(t=0,n=this.getSize()-1){const r=[];let s=!1,i=-1;for(let o=t;o<=n;o++){const a=this.getRowRawVisible(o);s&&a?(s=!1,r.push({startRow:i,endRow:o-1,startColumn:0,endColumn:0,rangeType:pe.ROW})):!s&&!a&&(s=!0,i=o)}return s&&r.push({startRow:i,endRow:n,startColumn:0,endColumn:0,rangeType:pe.ROW}),r}getVisibleRows(t=0,n=this.getSize()-1){const r=[];let s=!1,i=-1;for(let o=t;o<=n;o++){const a=this.getRowRawVisible(o);s&&!a?(s=!1,r.push({startRow:i,endRow:o-1,startColumn:0,endColumn:0,rangeType:pe.ROW})):!s&&a&&(s=!0,i=o)}return s&&r.push({startRow:i,endRow:n,startColumn:0,endColumn:0,rangeType:pe.ROW}),r}getRowRawVisible(t){const n=this.getRow(t);return n?n.hd!==ae.TRUE:!0}getSize(){return Zt(this._rowData)}setCustomMetadata(t,n){const r=this.getRow(t);r&&(r.custom=n)}getCustomMetadata(t){var n;return(n=this.getRow(t))==null?void 0:n.custom}}const SR="DEFAULT_WORKSHEET_ROW_COUNT",kh=1e3,OR="DEFAULT_WORKSHEET_COLUMN_COUNT",Fh=20,vR="DEFAULT_WORKSHEET_ROW_HEIGHT",xh=24,wR="DEFAULT_WORKSHEET_COLUMN_WIDTH",Bh=88,bR="DEFAULT_WORKSHEET_ROW_TITLE_WIDTH",$h=46,AR="DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT",Hh=20;function Wh(e){const t={name:"Sheet1",id:"sheet-01",tabColor:"",hidden:ae.FALSE,rowCount:kh,columnCount:Fh,zoomRatio:1,freeze:{xSplit:0,ySplit:0,startRow:-1,startColumn:-1},scrollTop:0,scrollLeft:0,defaultColumnWidth:Bh,defaultRowHeight:xh,mergeData:[],cellData:{},rowData:{},columnData:{},showGridlines:ae.TRUE,rowHeader:{width:$h,hidden:ae.FALSE},columnHeader:{height:Hh,hidden:ae.FALSE},rightToLeft:ae.FALSE};return Object.keys(t).forEach(n=>{const r=n;typeof e[r]>"u"&&(e[r]=t[r])}),e}class TR extends ze{constructor(n){super();C(this,"_cellCache",new Map);C(this,"_rowCache",new Map);C(this,"_columnCache",new Map);C(this,"_hasRow",!1);C(this,"_hasColumn",!1);C(this,"_hasAll",!1);C(this,"_allIndex",-1);C(this,"_mergeData");C(this,"_rangeMap",new ur(5e4));C(this,"_skeletonCache",new ur(5e4));this._init(n.concat())}_init(n){this._mergeData=n,this._createCache(n)}_clearCache(){this._cellCache.clear(),this._rowCache.clear(),this._columnCache.clear(),this._hasAll=!1,this._allIndex=-1,this._rangeMap.clear(),this._skeletonCache.clear(),this._hasColumn=!1,this._hasRow=!1}_createCache(n){let r=0;for(const s of n){const{rangeType:i}=s;i===pe.ROW?this._createRowCache(s,r):i===pe.COLUMN?this._createColumnCache(s,r):i===pe.ALL?this._createCellAllCache(r):this._createCellCache(s,r),r++}}rebuild(n){this._clearCache(),this._init(n.concat())}_createRowCache(n,r){const{startRow:s,endRow:i}=n;for(let o=s;o<=i;o++)this._rowCache.set(o,r),this._hasRow=!0}_createColumnCache(n,r){const{startColumn:s,endColumn:i}=n;for(let o=s;o<=i;o++)this._columnCache.set(o,r),this._hasColumn=!0}_createCellAllCache(n){this._hasAll=!0,this._allIndex=n}_createCellCache(n,r){for(let s=n.startRow;s<=n.endRow;s++){let i=this._cellCache.get(s);i==null&&(i=new Map,this._cellCache.set(s,i));for(let o=n.startColumn;o<=n.endColumn;o++)i.set(o,r)}}add(n){this._mergeData.push(n),this._clearCache(),this._createCache(this._mergeData)}remove(n,r){const s=this._getMergeDataIndex(n,r);s!==-1&&(this._mergeData.splice(s,1),this._clearCache(),this._createCache(this._mergeData))}getMergedCell(n,r){const s=this._getMergeDataIndex(n,r);return s!==-1?this._mergeData[s]:null}getMergeDataIndex(n,r){return this._getMergeDataIndex(n,r)}isRowContainsMergedCell(n){return this._hasAll||!Z.isEmptyObject(this._columnCache)?!0:this._mergeData.some(r=>r.startRow<=n&&n<=r.endRow)}isColumnContainsMergedCell(n){return this._hasAll||!Z.isEmptyObject(this._rowCache)?!0:this._mergeData.some(r=>r.startColumn<=n&&n<=r.endColumn)}getMergedCellRange(n,r,s,i){const o=[],a=`${n}-${r}-${s}-${i}`;if(this._rangeMap.has(a))return this._getRangeFromCache(a);let l=0;const c=[];for(const u of this._mergeData||[])tn.intersects(u,{startRow:n,endRow:s,startColumn:r,endColumn:i})&&(o.push({...u}),c.push(l)),l++;return this._rangeMap.set(a,c),o}getMergedCellRangeForSkeleton(n,r,s,i){const o=[],a=this._mergeData,l=`${n}-${r}-${s}-${i}`;if(this._skeletonCache.has(l))return this._getSkeletonRangeFromCache(l);const c=[];for(let u=0;u<a.length;u++){const{startRow:h,endRow:d,startColumn:m,endColumn:_}=a[u];for(let p=n;p<=s;p++){let I=!1;for(let A=r;A<=i;A++)if(p>=h&&p<=d&&A>=m&&A<=_){o.push({startRow:h,endRow:d,startColumn:m,endColumn:_}),c.push(u),I=!0;break}if(I)break}}return this._skeletonCache.set(l,c),o}_getRangeFromCache(n){const r=this._rangeMap.get(n)||[],s=[];for(const i of r)s.push({...this._mergeData[i]});return s}_getSkeletonRangeFromCache(n){const r=this._skeletonCache.get(n)||[],s=[];for(const i of r)s.push({...this._mergeData[i]});return s}_getMergeDataIndex(n,r){var i;if(this._hasAll)return this._allIndex;if(this._hasRow){const o=this._rowCache.get(n);if(o!==void 0)return o}if(this._hasColumn){const o=this._columnCache.get(r);if(o!==void 0)return o}const s=(i=this._cellCache.get(n))==null?void 0:i.get(r);return s!==void 0?s:-1}getMergeDataSnapshot(){return this._mergeData}dispose(){this._clearCache(),this._mergeData=[]}}class jh extends ze{constructor(n){super();C(this,"_cellContentInterceptor",null);C(this,"_rowFilteredInterceptor",null);this.getRawCell=n}dispose(){super.dispose(),this._cellContentInterceptor=null,this._rowFilteredInterceptor=null}getCell(n,r,s,i){return this._cellContentInterceptor?this._cellContentInterceptor.getCell(n,r,bn.Value|bn.Style,s,i):this.getRawCell(n,r)}getCellValueOnly(n,r){return this._cellContentInterceptor?this._cellContentInterceptor.getCell(n,r,bn.Value):this.getRawCell(n,r)}getCellStyleOnly(n,r){return this._cellContentInterceptor?this._cellContentInterceptor.getCell(n,r,bn.Style):this.getRawCell(n,r)}getRowFiltered(n){var r,s;return(s=(r=this._rowFilteredInterceptor)==null?void 0:r.getRowFiltered(n))!=null?s:!1}registerCellContentInterceptor(n){if(this._cellContentInterceptor)throw new Error("[SheetViewModel]: Interceptor already registered.");return this._cellContentInterceptor=n,je(()=>this._cellContentInterceptor=null)}registerRowFilteredInterceptor(n){if(this._rowFilteredInterceptor)throw new Error("[SheetViewModel]: Interceptor already registered.");return this._rowFilteredInterceptor=n,je(()=>this._rowFilteredInterceptor=null)}}const Yh={isDeepClone:!1,displayRawFormula:!1,ignoreTextRotation:!1};class jr{constructor(t,n,r){C(this,"_sheetId");C(this,"_snapshot");C(this,"_cellData");C(this,"_rowManager");C(this,"_columnManager");C(this,"_viewModel");C(this,"_spanModel");C(this,"_isRowStylePrecedeColumnStyle",!0);C(this,"_getCellHeight");var a;this.unitId=t,this._styles=r,this._snapshot=Wh(n);const{columnData:s,rowData:i,cellData:o}=this._snapshot;this._sheetId=(a=this._snapshot.id)!=null?a:tt(6),this._cellData=new ct(o),this._viewModel=new jh((l,c)=>this.getCellRaw(l,c)),this._rowManager=new IR(this._snapshot,this._viewModel,i),this._columnManager=new CR(this._snapshot,s),this._spanModel=new TR(this._snapshot.mergeData)}__interceptViewModel(t){t(this._viewModel)}__registerGetCellHeight(t){return this._getCellHeight=t,je(()=>{this._getCellHeight=null})}getSnapshot(){return this._snapshot}getCellHeight(t,n){return this._getCellHeight?this._getCellHeight(t,n):this._snapshot.defaultRowHeight}setMergeData(t){this._snapshot.mergeData=t,this.getSpanModel().rebuild(t)}getSpanModel(){return this._spanModel}setIsRowStylePrecedeColumnStyle(t){this._isRowStylePrecedeColumnStyle=t}getStyleDataByHash(t){return{...this._styles.get(t)}}setStyleData(t){return this._styles.setValue(t)}getColumnStyle(t,n=!1){return n?this._columnManager.getColumnStyle(t):this._styles.get(this._columnManager.getColumnStyle(t))}setColumnStyle(t,n){this._columnManager.setColumnStyle(t,n)}getRowStyle(t,n=!1){return n?this._rowManager.getRowStyle(t):this._styles.get(this._rowManager.getRowStyle(t))}setRowStyle(t,n){this._rowManager.setRowStyle(t,n)}getDefaultCellStyle(){return this._snapshot.defaultStyle}getDefaultCellStyleInternal(){const t=this._snapshot.defaultStyle;return this._styles.get(t)}setDefaultCellStyle(t){this._snapshot.defaultStyle=t}getCellStyle(t,n){const r=this.getCell(t,n);if(r){const s=r.s;return typeof s=="string"?this._styles.get(s):s}return null}getComposedCellStyle(t,n,r){const s=this.getDefaultCellStyleInternal(),i=this.getRowStyle(t),o=this.getColumnStyle(n),a=this.getCell(t,n),l=this._styles.getStyleByCell(a);return(r!=null?r:this._isRowStylePrecedeColumnStyle)?cr(s,o,i,a==null?void 0:a.themeStyle,l):cr(s,i,o,a==null?void 0:a.themeStyle,l)}getComposedCellStyleByCellData(t,n,r,s){const i=this.getDefaultCellStyleInternal(),o=this.getRowStyle(t),a=this.getColumnStyle(n),l=this._styles.getStyleByCell(r);return(s!=null?s:this._isRowStylePrecedeColumnStyle)?cr(i,a,o,r==null?void 0:r.themeStyle,l):cr(i,o,a,r==null?void 0:r.themeStyle,l)}getCellMatrix(){return this._cellData}getCellMatrixPrintRange(){const t=this.getCellMatrix(),n=this.getMergeData();let r=-1,s=-1,i=-1,o=-1,a=!1,l=!1;return t.forEach((c,u)=>{Object.keys(u).forEach(h=>{const d=+h,m=t.getValue(c,d),_=m!=null&&m.s?this._styles.get(m.s):null,p=(_==null?void 0:_.bd)&&(_.bd.b||_.bd.l||_.bd.r||_.bd.t||_.bd.bc_tr||_.bd.bl_tr||_.bd.ml_tr||_.bd.tl_bc||_.bd.tl_br||_.bd.tl_mr);(m&&(m.v||m.p)||_!=null&&_.bg||p)&&(a?r=Math.min(r,c):(r=c,a=!0),s=Math.max(s,c),l?i=Math.min(i,d):(l=!0,i=d),o=Math.max(o,d))})}),n.forEach(c=>{a?r=Math.min(r,c.startRow):(r=c.startRow,a=!0),s=Math.max(s,c.endRow),l?i=Math.min(i,c.startColumn):(i=c.startColumn,a=!0),o=Math.max(o,c.endColumn)}),!a||!l?null:{startColumn:i,startRow:r,endColumn:o,endRow:s}}getRowManager(){return this._rowManager}getUnitId(){return this.unitId}getSheetId(){return this._sheetId}getColumnManager(){return this._columnManager}getName(){return this._snapshot.name}clone(){const{_snapshot:t}=this,n=Z.deepClone(t);return new jr(this.unitId,n,this._styles)}getMergeData(){return this._spanModel.getMergeDataSnapshot()}getMergedCell(t,n){return this._spanModel.getMergedCell(t,n)}getMergedCellRange(t,n,r,s){return this._spanModel.getMergedCellRange(t,n,r,s)}isRowContainsMergedCell(t){return this._spanModel.isRowContainsMergedCell(t)}isColumnContainsMergedCell(t){return this._spanModel.isColumnContainsMergedCell(t)}getCellInfoInMergeData(t,n){const r=this.getMergedCell(t,n);let s=!1,i=!1,o=t,a=n,l=t,c=n;if(r){const{startRow:u,endRow:h,startColumn:d,endColumn:m}=r;t===u&&n===d?(o=h,a=m,l=u,c=d,i=!0):t>=u&&t<=h&&n>=d&&n<=m&&(o=h,a=m,l=u,c=d,s=!0)}return{actualRow:t,actualColumn:n,isMergedMainCell:i,isMerged:s,endRow:o,endColumn:a,startRow:l,startColumn:c}}getCell(t,n){return t<0||n<0?null:this._viewModel.getCell(t,n)}getCellValueOnly(t,n){return t<0||n<0?null:this._viewModel.getCellValueOnly(t,n)}getCellStyleOnly(t,n){return t<0||n<0?null:this._viewModel.getCellStyleOnly(t,n)}getCellRaw(t,n){return this.getCellMatrix().getValue(t,n)}getCellWithFilteredInterceptors(t,n,r,s){return this._viewModel.getCell(t,n,r,s)}getRowFiltered(t){return this._viewModel.getRowFiltered(t)}getRangeFilterRows(t){const n=[];for(let r=t.startRow;r<=t.endRow;r++)this.getRowFiltered(r)&&n.push(r);return n}getMatrixWithMergedCells(t,n,r,s,i=Tn.Raw){const o=this.getCellMatrix(),a=this._spanModel.getMergedCellRange(t,n,r,s),l=new ct;return po(t,r,n,s).forEach((c,u)=>{var d;let h;if(i===Tn.Raw)h=this.getCellRaw(c,u);else if(i===Tn.Intercepted)h=this.getCell(c,u);else if(i===Tn.Both){const m=this.getCellRaw(c,u);if(m){h={...m};const _=(d=this.getCell(c,u))==null?void 0:d.v;Dh(_)&&h&&(h.displayV=String(_))}}h&&l.setValue(c,u,h)}),a.forEach(c=>{const{startColumn:u,startRow:h,endColumn:d,endRow:m}=c;po(h,m,u,d).forEach((_,p)=>{_===h&&p===u&&l.setValue(_,p,{...o.getValue(_,p),rowSpan:m-h+1,colSpan:d-u+1}),(_!==h||p!==u)&&l.realDeleteValue(_,p)})}),l}getRange(t,n,r,s){return typeof t=="object"?new xn(this,t,{getStyles:()=>this._styles}):new xn(this,{startRow:t,startColumn:n,endColumn:s||n,endRow:r||t},{getStyles:()=>this._styles})}getScrollLeftTopFromSnapshot(){return{scrollLeft:this._snapshot.scrollLeft,scrollTop:this._snapshot.scrollTop}}getZoomRatio(){return this._snapshot.zoomRatio||1}getConfig(){return this._snapshot}getFreeze(){return this._snapshot.freeze}getMaxColumns(){const{_snapshot:t}=this,{columnCount:n}=t;return n}getMaxRows(){const{_snapshot:t}=this,{rowCount:n}=t;return n}getRowCount(){return this._snapshot.rowCount}setRowCount(t){this._snapshot.rowCount=t}getColumnCount(){return this._snapshot.columnCount}setColumnCount(t){this._snapshot.columnCount=t}isSheetHidden(){return this._snapshot.hidden}hasHiddenGridlines(){const{_snapshot:t}=this,{showGridlines:n}=t;return n===0}getGridlinesColor(){return this.getConfig().gridlinesColor}getTabColor(){const{_snapshot:t}=this,{tabColor:n}=t;return n}getColumnWidth(t){return this.getColumnManager().getColumnWidth(t)}getRowHeight(t){return this._viewModel.getRowFiltered(t)?0:this.getRowManager().getRowHeight(t)}isRowFiltered(t){return this._viewModel.getRowFiltered(t)}getRowVisible(t){return!this.isRowFiltered(t)&&this.getRowRawVisible(t)}getRowRawVisible(t){return this.getRowManager().getRowRawVisible(t)}getHiddenRows(t,n){const r=this.getMaxColumns()-1,s=this._rowManager.getHiddenRows(t,n);return s.forEach(i=>i.endColumn=r),s}getColVisible(t){return this._columnManager.getColVisible(t)}getHiddenCols(t,n){const r=this.getMaxRows()-1,s=this._columnManager.getHiddenCols(t,n);return s.forEach(i=>i.endRow=r),s}getVisibleRows(){const t=this.getRowCount();return this._rowManager.getVisibleRows(0,t-1)}getVisibleCols(){const t=this.getColumnCount();return this._columnManager.getVisibleCols(0,t-1)}isRightToLeft(){const{_snapshot:t}=this,{rightToLeft:n}=t;return n}getLastRowWithContent(){return this._cellData.getLength()-1}getLastColumnWithContent(){return this._cellData.getRange().endColumn}getDataRangeScope(){return this._cellData.getStartEndScope()}cellHasValue(t){return t&&(t.v!==void 0||t.f!==void 0||t.p!==void 0)}iterateByRow(t,n=!0){const{startRow:r,startColumn:s,endRow:i,endColumn:o}=t,a=this;return{[Symbol.iterator]:()=>{let l=r,c=s;return{next(){for(;;){if(c>o&&(l+=1,c=s),l>i)return{done:!0,value:void 0};const u=a.getCell(l,c),h=!u,d=a.getMergedCell(l,c);if(d){if(l!==d.startRow||c!==d.startColumn){c=d.endColumn+1;continue}if(h&&n){c=d.endColumn+1;continue}const _={row:l,col:c,value:u};return _.colSpan=d.endColumn-d.startColumn+1,_.rowSpan=d.endRow-d.startRow+1,c=d.endColumn+1,{done:!1,value:_}}if(h&&n)c+=1;else{const m={row:l,col:c,value:u};return c+=1,{done:!1,value:m}}}}}}}}iterateByColumn(t,n=!0,r=!0){const{startRow:s,startColumn:i,endRow:o,endColumn:a}=t,l=this;return{[Symbol.iterator]:()=>{let c=s,u=i;return{next(){for(;;){if(c>o&&(u+=1,c=s),u>a)return{done:!0,value:void 0};const h=l.getMergedCell(c,u);if(h){const _=c!==h.startRow,p=_||u!==h.startColumn;if(r&&p||!r&&_){c=h.endRow+1;continue}const I=l.getCell(h.startRow,h.startColumn);if(!I&&n){c=h.endRow+1;continue}const B={row:c,col:h.startColumn,value:I};return B.colSpan=h.endColumn-h.startColumn+1,B.rowSpan=h.endRow-h.startRow+1,c=h.endRow+1,{done:!1,value:B}}const d=l.getCell(c,u);if(!d&&n)c+=1;else{const _={row:c,col:u,value:d};return c+=1,{done:!1,value:_}}}}}}}}getCellDocumentModel(t,n,r=Yh){var p;if(!t)return;const{isDeepClone:s,displayRawFormula:i,ignoreTextRotation:o}={...Yh,...r};let a,l="document";const c=_R(n),u=o?st.tr:c.textRotation||st.tr;let h=c.horizontalAlign||st.ht;const d=c.verticalAlign||st.vt,m=c.wrapStrategy||st.tb,_=c.paddingData||Qo;if(t.f&&i)a=Wr(t.f.toString(),{},{verticalAlign:d}),h=st.ht;else if(t.p){const{centerAngle:I,vertexAngle:A}=Ph(u);a=this._updateConfigAndGetDocumentModel(s?Z.deepClone(t.p):t.p,h,_,{horizontalAlign:h,verticalAlign:d,centerAngle:I,vertexAngle:A,wrapStrategy:m,zeroWidthParagraphBreak:1})}else if(t.v!=null){const I=Mh(n);l=Uh(I).fontCache;let A=Gh(t);t.t===Xt.FORCE_STRING&&i&&(A=`'${A}`),a=Wr(A,I,{...c,textRotation:u,cellValueType:t.t})}return a&&t.linkUrl&&t.linkId&&Lh(a,t.linkUrl,t.linkId),{documentModel:a,fontString:l,textRotation:u,wrapStrategy:m,verticalAlign:d,horizontalAlign:h,paddingData:_,fill:(p=n==null?void 0:n.bg)==null?void 0:p.rgb}}_updateConfigAndGetDocumentModel(t,n,r,s){var o,a,l,c,u;if(!s||!((o=t.body)!=null&&o.dataStream))return;t.documentStyle||(t.documentStyle={}),t.documentStyle.marginTop=(a=r.t)!=null?a:0,t.documentStyle.marginBottom=(l=r.b)!=null?l:2,t.documentStyle.marginLeft=(c=r.l)!=null?c:2,t.documentStyle.marginRight=(u=r.r)!=null?u:2,t.documentStyle.pageSize={width:Number.POSITIVE_INFINITY,height:Number.POSITIVE_INFINITY},t.documentStyle.renderConfig={...t.documentStyle.renderConfig,...s};const i=t.body.paragraphs||[];for(const h of i)h.paragraphStyle||(h.paragraphStyle={}),h.paragraphStyle.horizontalAlign=n;return new At(t)}getBlankCellDocumentModel(t,n,r){const s=this.getComposedCellStyleByCellData(n,r,t),i=Mh(s),o=this.getCellDocumentModel(t,s,{ignoreTextRotation:!0});if(o!=null)return o.documentModel==null&&(o.documentModel=Wr("",i)),o;const a="";let l="document";const c=st.tr,u=st.ht,h=st.vt,d=st.tb,m=Qo;return l=Uh({}).fontCache,{documentModel:Wr(a,i),fontString:l,textRotation:c,wrapStrategy:d,verticalAlign:h,horizontalAlign:u,paddingData:m}}getCellDocumentModelWithFormula(t,n,r){const s=this.getComposedCellStyleByCellData(n,r,t);return this.getCellDocumentModel(t,s,{isDeepClone:!0,displayRawFormula:!0,ignoreTextRotation:!0})}getCustomMetadata(){return this._snapshot.custom}setCustomMetadata(t){this._snapshot.custom=t}}function Gh(e){var r,s;if(!e)return"";const t=(s=(r=e.p)==null?void 0:r.body)==null?void 0:s.dataStream;if(t)return Je.transform.getPlainText(t);const n=e.v;return typeof n=="string"?e.t===Xt.BOOLEAN?n.toUpperCase():n.replace(/[\r\n]/g,""):typeof n=="number"?e.t===Xt.BOOLEAN?n?"TRUE":"FALSE":n.toString():typeof n=="boolean"?n?"TRUE":"FALSE":""}function yR(e){if(e===null)return"";if(e!=null&&e.p){const t=e==null?void 0:e.p.body;if(t==null)return"";const n=t.dataStream;return Je.transform.getPlainText(n)}return e==null?void 0:e.v}var NR=Object.getOwnPropertyDescriptor,MR=(e,t,n,r)=>{for(var s=r>1?void 0:r?NR(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=o(s)||s);return s},LR=(e,t)=>(n,r)=>t(n,r,e);function DR(e,t){return`${e.getUnitId()}|${t.getSheetId()}`}f.Workbook=class extends Ps{constructor(n={},r){super();C(this,"type",we.UNIVER_SHEET);C(this,"_sheetCreated$",new oe.Subject);C(this,"sheetCreated$",this._sheetCreated$.asObservable());C(this,"_sheetDisposed$",new oe.Subject);C(this,"sheetDisposed$",this._sheetDisposed$.asObservable());C(this,"_activeSheet$",new oe.BehaviorSubject(null));C(this,"activeSheet$",this._activeSheet$.asObservable());C(this,"_worksheets");C(this,"_styles");C(this,"_snapshot");C(this,"_unitId");C(this,"_count");C(this,"_name$");C(this,"name$");this._logService=r;const s=dR();Z.isEmptyObject(n)?this._snapshot=s:this._snapshot=Z.commonExtend(s,n);const{styles:i}=this._snapshot;(this._snapshot.id==null||this._snapshot.id.length===0)&&(this._snapshot.id=tt(6)),this._unitId=this._snapshot.id,this._styles=new yh(i),this._count=1,this._worksheets=new Map,this._name$=new oe.BehaviorSubject(n.name||""),this.name$=this._name$.asObservable(),this._parseWorksheetSnapshots()}get _activeSheet(){return this._activeSheet$.getValue()}get name(){return this._name$.getValue()}static isIRangeType(n){return typeof n=="string"||"startRow"in n||"row"in n}dispose(){super.dispose(),this._sheetCreated$.complete(),this._sheetDisposed$.complete(),this._activeSheet$.complete(),this._name$.complete()}save(){return Z.deepClone(this._snapshot)}getSnapshot(){return this._snapshot}getName(){return this._snapshot.name}setName(n){this._name$.next(n),this._snapshot.name=n}getUnitId(){return this._unitId}getRev(){var n;return(n=this._snapshot.rev)!=null?n:1}incrementRev(){this._snapshot.rev=this.getRev()+1}setRev(n){this._snapshot.rev=n}addWorksheet(n,r,s){const{sheets:i,sheetOrder:o}=this._snapshot;if(i[n])return!1;i[n]=s,o.splice(r,0,n);const a=new jr(this._unitId,s,this._styles);return this._worksheets.set(n,a),this._sheetCreated$.next(a),!0}getSheetOrders(){return this._snapshot.sheetOrder}getWorksheets(){return this._worksheets}getActiveSpreadsheet(){return this}getStyles(){return this._styles}getConfig(){return this._snapshot}getIndexBySheetId(n){const{sheetOrder:r}=this._snapshot;return r.findIndex(s=>s===n)}getActiveSheet(n){if(!this._activeSheet&&typeof n>"u")throw new Error(`[Workbook]: no active Worksheet on Workbook ${this._unitId}!`);return this._activeSheet}ensureActiveSheet(){const n=this._activeSheet;if(n)return n;const r=this._snapshot.sheetOrder;for(let i=0,o=r.length;i<o;i++){const a=this._worksheets.get(r[i]);if(a&&a.isSheetHidden()!==ae.TRUE)return this.setActiveSheet(a),a}const s=this._worksheets.get(r[0]);return this.setActiveSheet(s),s}setActiveSheet(n){this._activeSheet$.next(n)}removeSheet(n){const r=this._worksheets.get(n);return r?(this._worksheets.delete(n),this._snapshot.sheetOrder.splice(this._snapshot.sheetOrder.indexOf(n),1),delete this._snapshot.sheets[n],this._sheetDisposed$.next(r),!0):!1}getActiveSheetIndex(){const{sheetOrder:n}=this._snapshot;return n.findIndex(r=>this._worksheets.get(r)===this._activeSheet)}getSheetSize(){return this._snapshot.sheetOrder.length}getSheets(){const{sheetOrder:n}=this._snapshot;return n.map(r=>this._worksheets.get(r))}getSheetsName(){const{sheetOrder:n}=this._snapshot,r=[];return n.forEach(s=>{const i=this._worksheets.get(s);i&&r.push(i.getName())}),r}getSheetIndex(n){const{sheetOrder:r}=this._snapshot;return r.findIndex(s=>n.getSheetId()===s)}getSheetBySheetName(n){const{sheetOrder:r}=this._snapshot,s=r.find(i=>this._worksheets.get(i).getName()===n);return this._worksheets.get(s)}getSheetBySheetId(n){return this._worksheets.get(n)}getSheetByIndex(n){const{sheetOrder:r}=this._snapshot;return this._worksheets.get(r[n])}getHiddenWorksheets(){return this.getSheets().filter(n=>n.getConfig().hidden===ae.TRUE).map(n=>n.getConfig().id)}getUnhiddenWorksheets(){return this.getSheets().filter(n=>n.getConfig().hidden!==ae.TRUE).map(n=>n.getConfig().id)}load(n){this._snapshot=n}checkSheetName(n){return this.getSheetsName().includes(n)}uniqueSheetName(n="Sheet1"){let r=n;for(;this.checkSheetName(r);)r=n+this._count,this._count++;return r}generateNewSheetName(n){let r=n+this._count;for(;this.checkSheetName(r);)r=n+this._count,this._count++;return r}_parseWorksheetSnapshots(){const{_snapshot:n,_worksheets:r}=this,{sheets:s,sheetOrder:i}=n;if(Z.isEmptyObject(s)){const o=tt();s[o]={id:o}}for(const o in s){const a=s[o],{name:l}=a;a.name=this.uniqueSheetName(l),a.name!==l&&this._logService.debug("[Workbook]",`The worksheet name ${l} is duplicated, we changed it to ${a.name}. Please fix the problem in your snapshot.`);const c=new jr(this._unitId,a,this._styles);r.set(o,c),i.includes(o)||i.push(o)}this.ensureActiveSheet()}getCustomMetadata(){return this._snapshot.custom}setCustomMetadata(n){this._snapshot.custom=n}},f.Workbook=MR([LR(1,_t)],f.Workbook);class ea extends Ps{constructor(n){var r;super();C(this,"type",we.UNIVER_SLIDE);C(this,"_activePage$",new oe.BehaviorSubject(null));C(this,"activePage$",this._activePage$.asObservable());C(this,"_name$");C(this,"name$");C(this,"_snapshot");C(this,"_unitId");this._snapshot={...Bc,...n},this._unitId=(r=this._snapshot.id)!=null?r:tt(6),this._name$=new oe.BehaviorSubject(this._snapshot.title),this.name$=this._name$.asObservable()}get _activePage(){var r,s;const n=this._activePage$.getValue();if(!n){const i=(r=this.getPageOrder())==null?void 0:r[0];return i?(s=this.getPages())==null?void 0:s[i]:null}return n}setName(n){var r;this._snapshot.title=n,this._name$.next(n),this._unitId=(r=this._snapshot.id)!=null?r:tt(6)}getRev(){return 0}incrementRev(){}setRev(n){}getSnapshot(){return this._snapshot}getUnitId(){return this._unitId}getPages(){var n;return(n=this._snapshot.body)==null?void 0:n.pages}getPageOrder(){var n;return(n=this._snapshot.body)==null?void 0:n.pageOrder}getPage(n){const r=this.getPages();return r==null?void 0:r[n]}getElementsByPage(n){var r;return(r=this.getPage(n))==null?void 0:r.pageElements}getElement(n,r){var s;return(s=this.getElementsByPage(n))==null?void 0:s[r]}getPageSize(){return this._snapshot.pageSize}getBlankPage(){const n=tt(6);return{id:n,pageType:fo.SLIDE,zIndex:10,title:n,description:"",pageBackgroundFill:{rgb:"rgb(255,255,255)"},pageElements:{}}}setActivePage(n){this._activePage$.next(n)}getActivePage(){return this._activePage}updatePage(n,r){this._snapshot.body&&(this._snapshot.body.pages[n]=r)}appendPage(n){var i;if(!this._snapshot.body)return;this._snapshot.body.pages[n.id]=n;const r=this._activePage,s=this._snapshot.body.pageOrder.indexOf((i=r==null?void 0:r.id)!=null?i:"");this._snapshot.body.pageOrder.splice(s+1,0,n.id)}}var UR=Object.getOwnPropertyDescriptor,PR=(e,t,n,r)=>{for(var s=r>1?void 0:r?UR(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=o(s)||s);return s},Vh=(e,t)=>(n,r)=>t(n,r,e);const Xn=Re.createIdentifier("univer.current");f.UniverInstanceService=class extends ze{constructor(n,r){super();C(this,"_unitsByType",new Map);C(this,"_createHandler");C(this,"_ctorByType",new Map);C(this,"_currentUnits",new Map);C(this,"_currentUnits$",new oe.BehaviorSubject(this._currentUnits));C(this,"currentUnits$",this._currentUnits$.asObservable());C(this,"_unitAdded$",new oe.Subject);C(this,"unitAdded$",this._unitAdded$.asObservable());C(this,"_unitDisposed$",new oe.Subject);C(this,"unitDisposed$",this._unitDisposed$.asObservable());C(this,"_focused$",new oe.BehaviorSubject(null));C(this,"focused$",this._focused$.asObservable());this._injector=n,this._contextService=r}dispose(){super.dispose(),this._focused$.complete()}__setCreateHandler(n){this._createHandler=n}createUnit(n,r,s){return this._createHandler(n,r,this._ctorByType.get(n),s)}registerCtorForType(n,r){return this._ctorByType.set(n,r),{dispose:()=>{this._ctorByType.delete(n)}}}getCurrentTypeOfUnit$(n){return this.currentUnits$.pipe(oe.map(r=>{var s;return(s=r.get(n))!=null?s:null}),oe.distinctUntilChanged())}getCurrentUnitForType(n){return this._currentUnits.get(n)}getCurrentUnitOfType(n){return this.getCurrentUnitForType(n)}setCurrentUnitForType(n){const r=this._getUnitById(n);if(!r)throw new Error(`[UniverInstanceService]: no document with unitId ${n}!`);this._currentUnits.set(r[1],r[0]),this._currentUnits$.next(this._currentUnits)}getTypeOfUnitAdded$(n){return this._unitAdded$.pipe(oe.filter(r=>r.type===n))}__addUnit(n,r){var a;const s=n.type;this._unitsByType.has(s)||this._unitsByType.set(s,[]);const i=this._unitsByType.get(s),o=n.getUnitId();if(i.findIndex(l=>l.getUnitId()===o)!==-1)throw new Error(`[UniverInstanceService]: cannot create a unit with the same unit id: ${o}.`);i.push(n),this._unitAdded$.next(n),((a=r==null?void 0:r.makeCurrent)==null||a)&&this.setCurrentUnitForType(n.getUnitId())}getTypeOfUnitDisposed$(n){return this.unitDisposed$.pipe(oe.filter(r=>r.type===n))}getUnit(n,r){var i;const s=(i=this._getUnitById(n))==null?void 0:i[0];return r&&(s==null?void 0:s.type)!==r?null:s}getCurrentUniverDocInstance(){return this.getCurrentUnitForType(we.UNIVER_DOC)}getUniverDocInstance(n){return this.getUnit(n,we.UNIVER_DOC)}getUniverSheetInstance(n){return this.getUnit(n,we.UNIVER_SHEET)}getAllUnitsForType(n){var r;return(r=this._unitsByType.get(n))!=null?r:[]}changeDoc(n,r){const s=this.getAllUnitsForType(we.UNIVER_DOC),i=s.find(o=>o.getUnitId()===n);if(i!=null){const o=s.indexOf(i);s.splice(o,1)}this.__addUnit(r)}get focused(){var r;const n=this._focused$.getValue();return n?(r=this._getUnitById(n))==null?void 0:r[0]:null}focusUnit(n){this._focused$.next(n),this.focused instanceof f.Workbook?(this._contextService.setContextValue(Br,!0),this._contextService.setContextValue($r,!1),this._contextService.setContextValue(Kn,!0),this._contextService.setContextValue(Hr,!1),this.setCurrentUnitForType(n)):this.focused instanceof At?(this._contextService.setContextValue(Br,!0),this._contextService.setContextValue($r,!0),this._contextService.setContextValue(Kn,!1),this._contextService.setContextValue(Hr,!1),this.setCurrentUnitForType(n)):this.focused instanceof ea?(this._contextService.setContextValue(Br,!0),this._contextService.setContextValue($r,!1),this._contextService.setContextValue(Kn,!1),this._contextService.setContextValue(Hr,!0),this.setCurrentUnitForType(n)):(this._contextService.setContextValue(Br,!1),this._contextService.setContextValue($r,!1),this._contextService.setContextValue(Kn,!1),this._contextService.setContextValue(Hr,!1))}getFocusedUnit(){return this.focused}getUnitType(n){const r=this._getUnitById(n);return r?r[1]:we.UNRECOGNIZED}disposeUnit(n){const r=this._getUnitById(n);if(!r)return!1;const[s,i]=r,o=this._unitsByType.get(i),a=o.indexOf(s);return o.splice(a,1),this._tryResetCurrentOnRemoval(n,i),this._tryResetFocusOnRemoval(n),this._unitDisposed$.next(s),!0}_tryResetCurrentOnRemoval(n,r){const s=this.getCurrentUnitForType(r);(s==null?void 0:s.getUnitId())===n&&(this._currentUnits.set(r,null),this._currentUnits$.next(this._currentUnits))}_tryResetFocusOnRemoval(n){var r;((r=this.focused)==null?void 0:r.getUnitId())===n&&this._focused$.next(null)}_getUnitById(n){for(const[r,s]of this._unitsByType){const i=s.find(o=>o.getUnitId()===n);if(i)return[i,r]}}},f.UniverInstanceService=PR([Vh(0,Re.Inject(Re.Injector)),Vh(1,An)],f.UniverInstanceService);var ke=(e=>(e[e.Starting=0]="Starting",e[e.Ready=1]="Ready",e[e.Rendered=2]="Rendered",e[e.Steady=3]="Steady",e))(ke||{});const zh={0:"Starting",1:"Ready",2:"Rendered",3:"Steady"};var kR=Object.getOwnPropertyDescriptor,FR=(e,t,n,r)=>{for(var s=r>1?void 0:r?kR(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=o(s)||s);return s},xR=(e,t)=>(n,r)=>t(n,r,e);class Kh extends Error{constructor(t){super(`[LifecycleService]: lifecycle stage "${zh[t]}" will never be reached!`),this.name="LifecycleUnreachableError"}}f.LifecycleService=class extends ze{constructor(n){super();C(this,"_lifecycle$",new oe.BehaviorSubject(ke.Starting));C(this,"lifecycle$",this._lifecycle$.asObservable());C(this,"_lock",!1);this._logService=n,this._reportProgress(ke.Starting)}get stage(){return this._lifecycle$.getValue()}set stage(n){if(this._lock)throw new Error("[LifecycleService]: cannot set new stage when related logic is all handled!");if(n<this.stage)throw new Error("[LifecycleService]: lifecycle stage cannot go backward!");n!==this.stage&&(this._lock=!0,this._reportProgress(n),this._lifecycle$.next(n),this._lock=!1)}dispose(){this._lifecycle$.complete(),super.dispose()}onStage(n){return oe.firstValueFrom(this.lifecycle$.pipe(oe.filter(r=>r>=n),li(r=>r===n),oe.map(()=>{}))).catch(r=>r.name==="EmptyError"?Promise.reject(new Kh(n)):Promise.reject(r))}subscribeWithPrevious(){return oe.merge(Xh(this.stage),this._lifecycle$.pipe(oe.skip(1))).pipe(li(n=>n===ke.Steady))}_reportProgress(n){this._logService.debug("[LifecycleService]",`lifecycle progressed to "${zh[n]}".`)}},f.LifecycleService=FR([xR(0,_t)],f.LifecycleService);function Xh(e){switch(e){case ke.Starting:return oe.of(ke.Starting);case ke.Ready:return oe.of(ke.Starting,ke.Ready);case ke.Rendered:return oe.of(ke.Starting,ke.Ready,ke.Rendered);default:return oe.of(ke.Starting,ke.Ready,ke.Rendered,ke.Steady)}}const BR=Re.createIdentifier("ILocalStorageService");class Sn extends ze{constructor(){super();C(this,"_currentLocale$",new oe.BehaviorSubject(ar.ZH_CN));C(this,"currentLocale$",this._currentLocale$.asObservable());C(this,"_locales",null);C(this,"localeChanged$",new oe.Subject);C(this,"t",(n,...r)=>{if(!this._locales)throw new Error("[LocaleService]: Locale not initialized");const s=n.split("."),i=this.resolveKeyPath(this._locales[this._currentLocale],s);if(typeof i=="string"){let o=i;return r.forEach((a,l)=>{o=o.replace(`{${l}}`,a)}),o}else return n});this.disposeWithMe(je(()=>{this._locales=null,this._currentLocale$.complete(),this.localeChanged$.complete()}))}get _currentLocale(){return this._currentLocale$.value}load(n){var r;this._locales=Xo((r=this._locales)!=null?r:{},n)}setLocale(n){this._currentLocale$.next(n),this.localeChanged$.next()}getLocales(){var n;return(n=this._locales)==null?void 0:n[this._currentLocale]}getCurrentLocale(){return this._currentLocale}resolveKeyPath(n,r){const s=r.shift();if(s&&n&&s in n){const i=n[s];return r.length>0&&(typeof i=="object"||Array.isArray(i))?this.resolveKeyPath(i,r):i}return null}}var $R=Object.getOwnPropertyDescriptor,HR=(e,t,n,r)=>{for(var s=r>1?void 0:r?$R(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=o(s)||s);return s},WR=(e,t)=>(n,r)=>t(n,r,e);f.MentionIOLocalService=class{constructor(t){this._userManagerService=t}async list(t){return{list:[{type:es.PERSON,mentions:[{objectType:es.PERSON,objectId:this._userManagerService.getCurrentUser().userID,label:this._userManagerService.getCurrentUser().name,metadata:{icon:this._userManagerService.getCurrentUser().avatar}}],metadata:{},title:"PEOPLE"}],page:t.page,size:t.size,total:1}}},f.MentionIOLocalService=HR([WR(0,Re.Inject(Ur))],f.MentionIOLocalService);const qh=Re.createIdentifier("univer.service.mention-io");var ta=(e=>(e.INIT="init",e.FETCHING="fetching",e.DONE="done",e))(ta||{});const Zh=Re.createIdentifier("univer.permission-service");class Jh extends ze{constructor(){super(...arguments);C(this,"_permissionPointMap",new Map);C(this,"_permissionPointUpdate$",new oe.Subject);C(this,"permissionPointUpdate$",this._permissionPointUpdate$.asObservable());C(this,"_showComponents",!0)}setShowComponents(n){this._showComponents=n}getShowComponents(){return this._showComponents}deletePermissionPoint(n){const r=this._permissionPointMap.get(n);r&&(r.complete(),this._permissionPointMap.delete(n))}addPermissionPoint(n){const r=n instanceof oe.BehaviorSubject,s=r?n.getValue():n;if(!s.id)return!1;if(this._permissionPointMap.get(s.id))throw new Error(`${s.id} PermissionPoint already exists`);return this._permissionPointMap.set(s.id,r?n:new oe.BehaviorSubject(s)),this._permissionPointUpdate$.next(s),!0}updatePermissionPoint(n,r){const s=this._permissionPointMap.get(n);if(!s)return;const i=s.getValue();i.value=r,i.status=ta.DONE,s.next(i),this._permissionPointUpdate$.next(i)}clearPermissionMap(){this._permissionPointMap.clear()}getPermissionPoint(n){const r=this._permissionPointMap.get(n);if(r)return r.getValue()}getPermissionPoint$(n){const r=this._permissionPointMap.get(n);if(r)return r}composePermission$(n){const r=n.map(s=>{var o;const i=(o=this._permissionPointMap)==null?void 0:o.get(s);if(!i)throw new Error(`[PermissionService]: ${s} permissionPoint does not exist!`);return i.asObservable()});return oe.combineLatest(r).pipe(Kr.map(s=>s))}composePermission(n){return n.map(s=>{var o;const i=(o=this._permissionPointMap)==null?void 0:o.get(s);if(!i)throw new Error(`[PermissionService]: ${s} permissionPoint does not exist!`);return i.getValue()})}getAllPermissionPoint(){const n=new Map;return this._permissionPointMap.forEach((r,s)=>{n.set(s,r)}),n}}function Qh(e,t){if(!t)return e;const n=[];for(const r of e){const s=t.find(([i])=>i===r[0]);if(s){if(s[1]===null)continue;n.push([r[0],s[1]])}else n.push(r)}return n}var jR=Object.getOwnPropertyDescriptor,YR=(e,t,n,r)=>{for(var s=r>1?void 0:r?jR(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=o(s)||s);return s},na=(e,t)=>(n,r)=>t(n,r,e);const GR=4,ed=Symbol("DependentOn");class ra extends ze{onStarting(){}onReady(){}onRendered(){}onSteady(){}getUnitType(){return this.constructor.type}getPluginName(){return this.constructor.pluginName}}C(ra,"pluginName"),C(ra,"type",we.UNIVER_UNKNOWN);class VR{constructor(){C(this,"_plugins",[])}addPlugin(t){this._plugins.push(t)}removePlugins(){const t=this._plugins.slice();return this._plugins.length=0,t}forEachPlugin(t){this._plugins.forEach(t)}}function zR(...e){return function(t){t[ed]=e}}f.PluginService=class{constructor(t,n,r){C(this,"_pluginRegistry",new Map);C(this,"_pluginStore",new VR);C(this,"_seenPlugins",new Set);C(this,"_loadedPlugins",new Set);C(this,"_loadedPluginTypes",new Set([we.UNIVER_UNKNOWN]));C(this,"_flushTimerByType",new Map);this._injector=t,this._lifecycleService=n,this._logService=r}dispose(){this._pluginStore.removePlugins().forEach(t=>t.dispose()),this._flushTimerByType.forEach(t=>clearTimeout(t))}registerPlugin(t,n){this._assertPluginValid(t);const r={plugin:t,options:n};this._pluginRegistry.set(t.pluginName,r),this._logService.debug("[PluginService]",`Plugin "${t.pluginName}" registered.`);const{type:s}=t;this._loadedPluginTypes.has(s)&&(s===we.UNIVER_UNKNOWN?this._loadFromPlugins([r]):this._flushType(s))}startPluginsForType(t){this._loadedPluginTypes.has(t)||this._loadPluginsForType(t)}_loadPluginsForType(t){const n=Array.from(this._pluginRegistry.keys()),r=[];n.forEach(s=>{const i=this._pluginRegistry.get(s);i.plugin.type===t&&r.push(i)}),this._loadFromPlugins(r),this._loadedPluginTypes.add(t)}_assertPluginValid(t){const{type:n,pluginName:r}=t;if(n===we.UNRECOGNIZED)throw new Error(`[PluginService]: invalid plugin type for ${t.name}. Please assign a "type" to your plugin.`);if(!r)throw new Error(`[PluginService]: no plugin name for ${t.name}. Please assign a "pluginName" to your plugin.`);if(this._seenPlugins.has(r))throw new Error(`[PluginService]: duplicated plugin name for "${r}". Maybe a plugin that dependents on "${r} has already registered it. In that case please register "${r}" before the that plugin.`);this._seenPlugins.add(t.pluginName)}_flushType(t){this._flushTimerByType.get(t)===void 0&&this._flushTimerByType.set(t,setTimeout(()=>{this._loadPluginsForType(t),this._flushTimerByType.delete(t)},GR))}_loadFromPlugins(t){const n=[],r=new Set,s=o=>{const{plugin:a}=o,{pluginName:l}=a;if(this._loadedPlugins.has(l)||r.has(l))return;r.add(l),this._pluginRegistry.delete(l);const c=a[ed];c&&c.forEach(u=>{const h=this._pluginRegistry.get(u.pluginName);if(h)s(h);else if(!this._seenPlugins.has(u.pluginName)&&!r.has(u.pluginName)){if(a.type===we.UNIVER_UNKNOWN&&u.type!==we.UNIVER_UNKNOWN)throw new Error(`[PluginService]: cannot register a plugin with Univer type that depends on a plugin with other type. The dependent is ${a.pluginName} and the dependency is ${u.pluginName}.`);a.type!==u.type&&u.type!==we.UNIVER_UNKNOWN&&this._logService.debug("[PluginService]",`Plugin "${l}" depends on "${u.pluginName}" which has different type.`),this._logService.debug("[PluginService]",`Plugin "${l}" depends on "${u.pluginName}" which is not registered. Univer will automatically register it with default configuration.`),this._assertPluginValid(u),s({plugin:u,options:void 0})}}),n.push(o)};t.forEach(o=>s(o));const i=n.map(o=>this._initPlugin(o.plugin,o.options));this._pluginsRunLifecycle(i)}_pluginsRunLifecycle(t){const n=this._lifecycleService.stage;if(Xh(n).subscribe(r=>this._runStage(t,r)),n!==ke.Steady){const r=this._lifecycleService.lifecycle$.pipe(oe.skip(1)).subscribe(s=>{this._runStage(t,s),s===ke.Steady&&r.unsubscribe()})}}_runStage(t,n){t.forEach(r=>{switch(n){case ke.Starting:r.onStarting();break;case ke.Ready:r.onReady();break;case ke.Rendered:r.onRendered();break;case ke.Steady:r.onSteady();break}})}_initPlugin(t,n){const r=this._injector.createInstance(t,n);return this._pluginStore.addPlugin(r),this._loadedPlugins.add(t.pluginName),this._logService.debug("[PluginService]",`Plugin "${r.getPluginName()}" loaded.`),r}},f.PluginService=YR([na(0,Re.Inject(Re.Injector)),na(1,Re.Inject(f.LifecycleService)),na(2,_t)],f.PluginService);const sa=Re.createIdentifier("resource-loader-service");var KR=Object.getOwnPropertyDescriptor,XR=(e,t,n,r)=>{for(var s=r>1?void 0:r?KR(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=o(s)||s);return s},qR=(e,t)=>(n,r)=>t(n,r,e);f.ResourceManagerService=class extends ze{constructor(n){super();C(this,"_resourceMap",new Map);C(this,"_register$",new oe.Subject);C(this,"register$",this._register$.asObservable());this._logService=n}getAllResourceHooks(){return[...this._resourceMap.values()]}getResources(n,r){return r?this.getResourcesByType(n,r):this.getAllResourceHooks().map(o=>{const a=o.toJson(n);return{name:o.pluginName,data:a}})}getResourcesByType(n,r){return this.getAllResourceHooks().filter(o=>o.businesses.includes(r)).map(o=>{const a=o.toJson(n);return{name:o.pluginName,data:a}})}registerPluginResource(n){const r=n.pluginName;if(this._resourceMap.has(r))throw new Error(`the pluginName is registered {${r}}`);return this._resourceMap.set(r,n),this._register$.next(n),je(()=>this._resourceMap.delete(r))}disposePluginResource(n){this._resourceMap.delete(n)}loadResources(n,r){this.getAllResourceHooks().forEach(s=>{var o;const i=(o=r==null?void 0:r.find(a=>a.name===s.pluginName))==null?void 0:o.data;if(i)try{const a=s.parseJson(i);s.onLoad(n,a)}catch(a){this._logService.error("[ResourceManagerService]","loadResources error",a)}})}unloadResources(n){this.getAllResourceHooks().forEach(r=>{r.onUnLoad(n)})}dispose(){this._register$.complete(),this._resourceMap.clear()}},f.ResourceManagerService=XR([qR(0,_t)],f.ResourceManagerService);class qs extends ze{constructor(){super();C(this,"_darkMode$",new oe.BehaviorSubject(!1));C(this,"darkMode$",this._darkMode$.asObservable());C(this,"_validColorCache",new Map);C(this,"_currentTheme",Xr.defaultTheme);C(this,"_currentTheme$",new oe.BehaviorSubject(this._currentTheme));C(this,"currentTheme$",this._currentTheme$.asObservable());this.disposeWithMe(je(()=>{this._currentTheme=Xr.defaultTheme,this._currentTheme$.complete(),this._darkMode$.complete()}))}get darkMode(){return this._darkMode$.getValue()}isValidThemeColor(n){if(this._validColorCache.has(n))return this._validColorCache.get(n);let r=!1;const s=n.split(".");if(s.length===1)r=n in Xr.defaultTheme;else if(s.length===2){const[i,o]=s;r=i in Xr.defaultTheme&&o in this._currentTheme[i]}return this._validColorCache.set(n,r),r}getCurrentTheme(){return this._currentTheme}setTheme(n){this._currentTheme=n,this._currentTheme$.next(n)}setDarkMode(n){this._darkMode$.next(n)}getColorFromTheme(n){return ph(this._currentTheme,n)}}var ZR=Object.getOwnPropertyDescriptor,JR=(e,t,n,r)=>{for(var s=r>1?void 0:r?ZR(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=o(s)||s);return s},ia=(e,t)=>(n,r)=>t(n,r,e);const Zs=Re.createIdentifier("univer.undo-redo.service"),QR=20;class td{dispose(){}async dispatchToHandlers(){return!1}}const nd="univer.command.redo",rd="univer.command.undo",sd=new class extends td{constructor(){super(...arguments);C(this,"type",rr.COMMAND);C(this,"id",rd)}handler(t){const n=t.get(Zs),r=n.pitchTopUndoElement();if(!r)return!1;const s=t.get(sr);return Qr(r.undoMutations,s)?(n.popUndoToRedo(),!0):!1}},id=new class extends td{constructor(){super(...arguments);C(this,"type",rr.COMMAND);C(this,"id",nd)}handler(t){const n=t.get(Zs),r=n.pitchTopRedoElement();if(!r)return!1;const s=t.get(sr);return Qr(r.redoMutations,s)?(n.popRedoToUndo(),!0):!1}};f.LocalUndoRedoService=class extends ze{constructor(n,r,s){super();C(this,"undoRedoStatus$");C(this,"_undoRedoStatus$",new oe.BehaviorSubject({undos:0,redos:0}));C(this,"_undoStacks",new Map);C(this,"_redoStacks",new Map);C(this,"_batchingStatus",new Map);this._univerInstanceService=n,this._commandService=r,this._contextService=s,this.undoRedoStatus$=this._undoRedoStatus$.asObservable(),this.disposeWithMe(this._commandService.registerCommand(sd)),this.disposeWithMe(this._commandService.registerCommand(id)),this.disposeWithMe(je(()=>this._undoRedoStatus$.complete())),this.disposeWithMe(je(this._univerInstanceService.focused$.subscribe(()=>this._updateStatus())))}pushUndoRedo(n){const{unitID:r}=n,s=this._getRedoStack(r,!0),i=this._getUndoStack(r,!0);if(s.length=0,this._batchingStatus.has(n.unitID)){const a=this._batchingStatus.get(n.unitID),l=this._pitchUndoElement(n.unitID);a===0||!l?(o(n),this._batchingStatus.set(n.unitID,1)):this._tryBatchingElements(l,n)}else o(n);function o(a){i.push(a),i.length>QR&&i.splice(0,1)}this._updateStatus()}clearUndoRedo(n){const r=this._getRedoStack(n);r&&(r.length=0);const s=this._getUndoStack(n);s&&(s.length=0),this._updateStatus()}pitchTopUndoElement(){const n=this._getFocusedUnitId();return this._pitchUndoElement(n)}pitchTopRedoElement(){const n=this._getFocusedUnitId();return this._pitchRedoElement(n)}_pitchUndoElement(n){const r=this._getUndoStack(n);return r!=null&&r.length?r[r.length-1]:null}_pitchRedoElement(n){const r=this._getRedoStack(n);return r!=null&&r.length?r[r.length-1]:null}popUndoToRedo(){const r=this._getUndoStackForFocused().pop();r&&(this._getRedoStackForFocused().push(r),this._updateStatus())}popRedoToUndo(){const r=this._getRedoStackForFocused().pop();r&&(this._getUndoStackForFocused().push(r),this._updateStatus())}rollback(n,r){const s=r||this._getFocusedUnitId(),i=this._getUndoStack(s),o=i==null?void 0:i[(i==null?void 0:i.length)-1];o&&o.id===n&&(i.pop(),Qr(o.undoMutations,this._commandService))}__tempBatchingUndoRedo(n){if(this._batchingStatus.has(n))throw new Error("[LocalUndoRedoService]: cannot batching undo redo twice at the same time!");return this._batchingStatus.set(n,0),je(()=>this._batchingStatus.delete(n))}_updateStatus(){var i,o;const n=this._getFocusedUnitId(),r=n&&((i=this._undoStacks.get(n))==null?void 0:i.length)||0,s=n&&((o=this._redoStacks.get(n))==null?void 0:o.length)||0;this._undoRedoStatus$.next({undos:r,redos:s})}_getUndoStack(n,r=!1){let s=this._undoStacks.get(n);return!s&&r&&(s=[],this._undoStacks.set(n,s)),s||null}_getRedoStack(n,r=!1){let s=this._redoStacks.get(n);return!s&&r&&(s=[],this._redoStacks.set(n,s)),s||null}_getUndoStackForFocused(){const n=this._getFocusedUnitId();if(!n)throw new Error("No focused univer instance!");return this._getUndoStack(n,!0)}_getRedoStackForFocused(){const n=this._getFocusedUnitId();if(!n)throw new Error("No focused univer instance!");return this._getRedoStack(n,!0)}_tryBatchingElements(n,r){n.redoMutations.push(...r.redoMutations),n.undoMutations.push(...r.undoMutations)}_getFocusedUnitId(){var o,a,l,c;let n="";const r=this._contextService.getContextValue(Kn),s=this._contextService.getContextValue(bh),i=this._contextService.getContextValue(wh);return r?s?n=ri:i?n=ni:n=(a=(o=this._univerInstanceService.getFocusedUnit())==null?void 0:o.getUnitId())!=null?a:"":n=(c=(l=this._univerInstanceService.getFocusedUnit())==null?void 0:l.getUnitId())!=null?c:"",n}},f.LocalUndoRedoService=JR([ia(0,Xn),ia(1,sr),ia(2,An)],f.LocalUndoRedoService);class od{constructor(t,n=100){C(this,"_imageCacheMap");this._injector=t,this._imageCacheMap=new ur(n)}_getImageCacheKey(t,n){return`${t}-${n}`}getImage(t,n,r,s){const i=this._getImageCacheKey(t,n),o=this._imageCacheMap.get(i);return o||((async()=>{const a=new Image,l=this._injector.has(Jo)?this._injector.get(Jo):null;if(t===Zo.UUID)try{a.src=await(l==null?void 0:l.getImage(n))||""}catch(c){console.error(c)}else a.src=n;a.onload=()=>{a.removeAttribute("data-error"),r==null||r()},a.onerror=()=>{a.setAttribute("data-error","true"),s==null||s()},this._imageCacheMap.set(i,a)})(),null)}}function eI(e){return!(e.length===0||e.length>31||e.startsWith("'")||e.endsWith("'")||/[:\\\/\?\*\[\]]/.test(e))}const ad=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],oa=1,Yr=8;class aa{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[n,r]=new Uint8Array(t,0,2);if(n!==219)throw new Error("Data does not appear to be in a KDBush format.");const s=r>>4;if(s!==oa)throw new Error(`Got v${s} data when expected v${oa}.`);const i=ad[r&15];if(!i)throw new Error("Unrecognized array type.");const[o]=new Uint16Array(t,2,1),[a]=new Uint32Array(t,4,1);return new aa(a,o,i,t)}constructor(t,n=64,r=Float64Array,s){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+n,2),65535),this.ArrayType=r,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;const i=ad.indexOf(this.ArrayType),o=t*2*this.ArrayType.BYTES_PER_ELEMENT,a=t*this.IndexArrayType.BYTES_PER_ELEMENT,l=(8-a%8)%8;if(i<0)throw new Error(`Unexpected typed array class: ${r}.`);s&&s instanceof ArrayBuffer?(this.data=s,this.ids=new this.IndexArrayType(this.data,Yr,t),this.coords=new this.ArrayType(this.data,Yr+a+l,t*2),this._pos=t*2,this._finished=!0):(this.data=new ArrayBuffer(Yr+o+a+l),this.ids=new this.IndexArrayType(this.data,Yr,t),this.coords=new this.ArrayType(this.data,Yr+a+l,t*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(oa<<4)+i]),new Uint16Array(this.data,2,1)[0]=n,new Uint32Array(this.data,4,1)[0]=t)}add(t,n){const r=this._pos>>1;return this.ids[r]=r,this.coords[this._pos++]=t,this.coords[this._pos++]=n,r}finish(){const t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return la(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,n,r,s){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:i,coords:o,nodeSize:a}=this,l=[0,i.length-1,0],c=[];for(;l.length;){const u=l.pop()||0,h=l.pop()||0,d=l.pop()||0;if(h-d<=a){for(let I=d;I<=h;I++){const A=o[2*I],B=o[2*I+1];A>=t&&A<=r&&B>=n&&B<=s&&c.push(i[I])}continue}const m=d+h>>1,_=o[2*m],p=o[2*m+1];_>=t&&_<=r&&p>=n&&p<=s&&c.push(i[m]),(u===0?t<=_:n<=p)&&(l.push(d),l.push(m-1),l.push(1-u)),(u===0?r>=_:s>=p)&&(l.push(m+1),l.push(h),l.push(1-u))}return c}within(t,n,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:s,coords:i,nodeSize:o}=this,a=[0,s.length-1,0],l=[],c=r*r;for(;a.length;){const u=a.pop()||0,h=a.pop()||0,d=a.pop()||0;if(h-d<=o){for(let I=d;I<=h;I++)cd(i[2*I],i[2*I+1],t,n)<=c&&l.push(s[I]);continue}const m=d+h>>1,_=i[2*m],p=i[2*m+1];cd(_,p,t,n)<=c&&l.push(s[m]),(u===0?t-r<=_:n-r<=p)&&(a.push(d),a.push(m-1),a.push(1-u)),(u===0?t+r>=_:n+r>=p)&&(a.push(m+1),a.push(h),a.push(1-u))}return l}}function la(e,t,n,r,s,i){if(s-r<=n)return;const o=r+s>>1;ld(e,t,o,r,s,i),la(e,t,n,r,o-1,1-i),la(e,t,n,o+1,s,1-i)}function ld(e,t,n,r,s,i){for(;s>r;){if(s-r>600){const c=s-r+1,u=n-r+1,h=Math.log(c),d=.5*Math.exp(2*h/3),m=.5*Math.sqrt(h*d*(c-d)/c)*(u-c/2<0?-1:1),_=Math.max(r,Math.floor(n-u*d/c+m)),p=Math.min(s,Math.floor(n+(c-u)*d/c+m));ld(e,t,n,_,p,i)}const o=t[2*n+i];let a=r,l=s;for(Gr(e,t,r,n),t[2*s+i]>o&&Gr(e,t,r,s);a<l;){for(Gr(e,t,a,l),a++,l--;t[2*a+i]<o;)a++;for(;t[2*l+i]>o;)l--}t[2*r+i]===o?Gr(e,t,r,l):(l++,Gr(e,t,l,s)),l<=n&&(r=l+1),n<=l&&(s=l-1)}}function Gr(e,t,n,r){ca(e,n,r),ca(t,2*n,2*r),ca(t,2*n+1,2*r+1)}function ca(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function cd(e,t,n,r){const s=e-n,i=t-r;return s*s+i*i}class tI{constructor(t=!1){C(this,"_tree",new Map);C(this,"_oneCellCache",new Map);C(this,"_kdTree",new Map);this._enableOneCellCache=t}dispose(){this.clear()}getTree(t,n){return this._tree.has(t)||this._tree.set(t,new Map),this._tree.get(t).has(n)||this._tree.get(t).set(n,new Ms),this._tree.get(t).get(n)}_getOneCellCache(t,n,r,s){return this._oneCellCache.has(t)||this._oneCellCache.set(t,new Map),this._oneCellCache.get(t).has(n)||this._oneCellCache.get(t).set(n,new Map),this._oneCellCache.get(t).get(n).has(r)||this._oneCellCache.get(t).get(n).set(r,new Map),this._oneCellCache.get(t).get(n).get(r).has(s)||this._oneCellCache.get(t).get(n).get(r).set(s,new Set),this._oneCellCache.get(t).get(n).get(r).get(s)}_removeOneCellCache(t,n,r,s,i){const o=this._oneCellCache.get(t);if(!o)return;const a=o.get(n);if(!a)return;const l=a.get(r);if(!l)return;const c=l.get(s);c&&c.delete(i)}_removeCellCacheByRange(t){const{unitId:n,sheetId:r,range:s,id:i}=t,o=this._oneCellCache.get(n);if(!o)return;const a=o.get(r);if(!a)return;const{startRow:l,startColumn:c,endRow:u,endColumn:h}=s;for(let d=l;d<=u;d++){const m=a.get(d);if(m)for(let _=c;_<=h;_++){const p=m.get(_);p&&p.delete(i)}}}_insertOneCellCache(t,n,r,s,i){this._getOneCellCache(t,n,r,s).add(i)}_getRdTreeItems(t){const n=[];for(const[r,s]of t)for(const[i,o]of s)n.push({x:i,y:r,ids:o});return n}_searchByOneCellCache(t){var _;const{unitId:n,sheetId:r,range:s}=t,{startRow:i,startColumn:o,endRow:a,endColumn:l}=s,c=(_=this._kdTree.get(n))==null?void 0:_.get(r);if(!c)return[];const{tree:u,items:h}=c,d=u.range(o,i,l,a),m=[];for(const p of d){const I=h[p];m.push(...Array.from(I.ids))}return m}openKdTree(){var t;for(const[n,r]of this._oneCellCache){this._kdTree.has(n)||this._kdTree.set(n,new Map);for(const[s,i]of r){const o=this._getRdTreeItems(i),a=new aa(o.length);(t=this._kdTree.get(n))==null||t.set(s,{tree:a,items:o});for(const l of o)a.add(l.x,l.y);a.finish()}}}closeKdTree(){var t;for(const[n,r]of this._oneCellCache)for(const[s,i]of r)(t=this._kdTree.get(n))==null||t.set(s,void 0)}insert(t){const{unitId:n,sheetId:r,range:s,id:i}=t;if(!n||n.length===0)return;let{startRow:o,endRow:a,startColumn:l,endColumn:c}=s;if(this._enableOneCellCache&&o===a&&l===c){this._insertOneCellCache(n,r,o,l,i);return}const u=this.getTree(n,r);Number.isNaN(o)&&(o=0),Number.isNaN(l)&&(l=0),Number.isNaN(a)&&(a=Number.POSITIVE_INFINITY),Number.isNaN(c)&&(c=Number.POSITIVE_INFINITY),u.insert({minX:l,minY:o,maxX:c,maxY:a,id:i})}bulkInsert(t){for(const n of t)this.insert(n)}*searchGenerator(t){var a;const{unitId:n,sheetId:r,range:s}=t;if(this._enableOneCellCache){const l=this._searchByOneCellCache(t);for(const c of l)yield c}const i=(a=this._tree.get(n))==null?void 0:a.get(r);if(!i)return;const o=i.search({minX:s.startColumn,minY:s.startRow,maxX:s.endColumn,maxY:s.endRow});for(const l of o)yield l.id}bulkSearch(t,n){const r=new Set;for(const s of t)for(const i of this.searchGenerator(s))(n==null?void 0:n.has(i))!==!0&&r.add(i);return r}removeById(t,n){var r,s;n?((r=this._tree.get(t))==null||r.delete(n),(s=this._oneCellCache.get(t))==null||s.delete(n)):(this._tree.delete(t),this._oneCellCache.delete(t))}_removeRTreeItem(t){const{unitId:n,sheetId:r,range:s,id:i}=t,o=this.getTree(n,r),a=o.search({minX:s.startColumn,minY:s.startRow,maxX:s.endColumn,maxY:s.endRow});for(let l=0;l<a.length;l++)a[l].id===i&&o.remove(a[l])}remove(t){const{unitId:n,sheetId:r,range:s,id:i}=t,{startRow:o,startColumn:a,endRow:l,endColumn:c}=s;this._enableOneCellCache?o===l&&a===c?this._removeOneCellCache(n,r,s.startRow,s.startColumn,i):(this._removeCellCacheByRange(t),this._removeRTreeItem(t)):this._removeRTreeItem(t)}bulkRemove(t){for(const n of t)this.remove(n)}clear(){this._tree.clear(),this._oneCellCache.clear()}toJSON(){const t={};return this._tree.forEach((n,r)=>{t[r]={},n.forEach((s,i)=>{t[r][i]=s.toJSON()})}),t}fromJSON(t){this._tree.clear();for(const n in t){this._tree.set(n,new Map);for(const r in t[n]){const s=new Ms;s.fromJSON(t[n][r]),this._tree.get(n).set(r,s)}}}}function nI(e){return new Promise(t=>setTimeout(t,e))}function rI(e=1){return new Promise(t=>{let n=0;const r=()=>{n++,n>=e?t():requestAnimationFrame(r)};requestAnimationFrame(r)})}var sI=Object.getOwnPropertyDescriptor,iI=(e,t,n,r)=>{for(var s=r>1?void 0:r?sI(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=o(s)||s);return s},oI=(e,t)=>(n,r)=>t(n,r,e);f.Skeleton=class extends ze{constructor(n){super();C(this,"_fontLocale");C(this,"_dirty",!0);this._localeService=n,this._localeInitial()}get dirty(){return this._dirty}getFontLocale(){return this._fontLocale}makeDirty(n){this._dirty=n}dispose(){super.dispose(),this._fontLocale=null}_localeInitial(){}},f.Skeleton=iI([oI(0,Re.Inject(Sn))],f.Skeleton);var aI=Object.getOwnPropertyDescriptor,lI=(e,t,n,r)=>{for(var s=r>1?void 0:r?aI(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=o(s)||s);return s},Js=(e,t)=>(n,r)=>t(n,r,e);f.SheetSkeleton=class extends f.Skeleton{constructor(n,r,s,i,o,a){super(s);C(this,"_worksheetData");C(this,"_renderRawFormula",!1);C(this,"_cellData");C(this,"_imageCacheMap");C(this,"_skipAutoHeightForMergedCells",!0);C(this,"_rowTotalHeight",0);C(this,"_columnTotalWidth",0);C(this,"_rowHeaderWidth",0);C(this,"_columnHeaderHeight",0);C(this,"_rowHeightAccumulation",[]);C(this,"_columnWidthAccumulation",[]);C(this,"_marginTop",0);C(this,"_marginLeft",0);C(this,"_scaleX");C(this,"_scaleY");C(this,"_scrollX");C(this,"_scrollY");this.worksheet=n,this._styles=r,this._contextService=i,this._configService=o,this._injector=a,this._worksheetData=this.worksheet.getConfig(),this._cellData=this.worksheet.getCellMatrix(),this._imageCacheMap=new od(this._injector),this.initConfig()}initConfig(){var n,r;this._skipAutoHeightForMergedCells=!((n=this._configService.getConfig(Ea))!=null&&n),this.worksheet.setIsRowStylePrecedeColumnStyle((r=this._configService.getConfig(pa))!=null?r:!1)}resetCache(){}getWorksheetConfig(){return this._worksheetData}getLocation(){return[this.worksheet.getUnitId(),this.worksheet.getSheetId()]}set columnHeaderHeight(n){this._columnHeaderHeight=n,this._worksheetData.columnHeader.height=n}set rowHeaderWidth(n){this._rowHeaderWidth=n,this._worksheetData.rowHeader.width=n}get rowHeightAccumulation(){return this._rowHeightAccumulation}get rowTotalHeight(){return this._rowTotalHeight}get columnWidthAccumulation(){return this._columnWidthAccumulation}get columnTotalWidth(){return this._columnTotalWidth}get rowHeaderWidth(){return this._rowHeaderWidth}get columnHeaderHeight(){return this._columnHeaderHeight}setMarginLeft(n){this._marginLeft=n}setMarginTop(n){this._marginTop=n}setScale(n,r){this._updateLayout(),this._scaleX=n,this._scaleY=r||n,this._updateLayout()}setScroll(n,r){Z.isDefine(n)&&(this._scrollX=n),Z.isDefine(r)&&(this._scrollY=r)}get scrollX(){return this._scrollX}get scrollY(){return this._scrollY}get scaleX(){return this._scaleX}get scaleY(){return this._scaleY}get rowHeaderWidthAndMarginLeft(){return this.rowHeaderWidth+this._marginLeft}get columnHeaderHeightAndMarginTop(){return this.columnHeaderHeight+this._marginTop}get imageCacheMap(){return this._imageCacheMap}_generateRowMatrixCache(n,r,s){let i=0;const o=[],a=r;for(let l=0;l<n;l++){let c=s;if(this.worksheet.getRowFiltered(l))c=0;else if(a[l]!=null){const u=a[l];if(!u)continue;const{h=s,ah:d,ia:m}=u;(m==null||m===ae.TRUE)&&typeof d=="number"?c=d:c=h,u.hd===ae.TRUE&&(c=0)}i+=c,o.push(i)}return{rowTotalHeight:i,rowHeightAccumulation:o}}_generateColumnMatrixCache(n,r,s){let i=0;const o=[],a=r;for(let l=0;l<n;l++){let c=s;if(a[l]!=null){const u=a[l];if(!u)continue;u.w!=null&&(c=u.w),u.hd===ae.TRUE&&(c=0)}i+=c,o.push(i)}return{columnTotalWidth:i,columnWidthAccumulation:o}}intersectMergeRange(n,r){return!!this.worksheet.getMergedCell(n,r)}_getOverflowBound(n,r,s,i,o=Ot.LEFT){let a=0;if(r>s){const l=this._columnWidthAccumulation.length-1;for(let c=r;c>=s;c--){const u=c,h=this.worksheet.getCell(n,u);if(!pi(h)&&u!==r||this.intersectMergeRange(n,u))return u===r?u:u+1>l?l:u+1;const{startX:d,endX:m}=qn(n,u,this.rowHeightAccumulation,this.columnWidthAccumulation);if(o===Ot.CENTER&&u===r?a+=(m-d)/2:a+=m-d,i<a)return u}return r}for(let l=r;l<=s;l++){const c=l,u=this.worksheet.getCell(n,c);if(!pi(u)&&c!==r||this.intersectMergeRange(n,c))return c===r?c:c-1<0?0:c-1;const{startX:h,endX:d}=qn(n,c,this.rowHeightAccumulation,this.columnWidthAccumulation);if(o===Ot.CENTER&&c===r?a+=(d-h)/2:a+=d-h,i<a)return c}return s}_updateLayout(){if(!this.dirty)return;const{rowData:n,columnData:r,defaultRowHeight:s,defaultColumnWidth:i,rowCount:o,columnCount:a,rowHeader:l,columnHeader:c}=this._worksheetData,{rowTotalHeight:u,rowHeightAccumulation:h}=this._generateRowMatrixCache(o,n,s),{columnTotalWidth:d,columnWidthAccumulation:m}=this._generateColumnMatrixCache(a,r,i);this._rowHeaderWidth=l.hidden!==ae.TRUE?this._dynamicallyUpdateRowHeaderWidth(l):0,this._columnHeaderHeight=c.hidden!==ae.TRUE?c.height:0,this._rowTotalHeight=u,this._rowHeightAccumulation=h,this._columnTotalWidth=d,this._columnWidthAccumulation=m,this.makeDirty(!1)}calculate(){return this.resetCache(),this._updateLayout(),this}resetRangeCache(n){}_dynamicallyUpdateRowHeaderWidth(n){const s=`${this.worksheet.getRowCount()}`.length*8;return Math.max(n.width,s)}_hasUnMergedCellInRow(n,r,s){if(!this.worksheet.getMergeData())return!1;for(let o=r;o<=s;o++){const{isMerged:a,isMergedMainCell:l}=this.worksheet.getCellInfoInMergeData(n,o);if(!a&&!l)return!0}return!1}expandRangeByMerge(n){let{startRow:r,startColumn:s,endRow:i,endColumn:o}=n;const a=this._worksheetData.mergeData;if(!a)return{startRow:r,startColumn:s,endRow:i,endColumn:o};let l=!0;const c=new ct;for(;l;){l=!1;for(let u=0;u<a.length;u++){const{startRow:h,startColumn:d,endRow:m,endColumn:_}=a[u];if(c.getValue(h,d))continue;Yc({startColumn:s,startRow:r,endColumn:o,endRow:i},{startColumn:d,startRow:h,endColumn:_,endRow:m})&&(r=Math.min(r,h),s=Math.min(s,d),i=Math.max(i,m),o=Math.max(o,_),c.setValue(h,d,!0),l=!0)}}return{startRow:r,startColumn:s,endRow:i,endColumn:o}}getColumnCount(){return this._columnWidthAccumulation.length}getRowCount(){return this._rowHeightAccumulation.length}_getCellMergeInfo(n,r){return this.worksheet.getCellInfoInMergeData(n,r)}getNoMergeCellPositionByIndex(n,r,s=!0){return this.getNoMergeCellWithCoordByIndex(n,r,s)}getNoMergeCellWithCoordByIndex(n,r,s=!0){const{rowHeightAccumulation:i,columnWidthAccumulation:o,rowHeaderWidthAndMarginLeft:a,columnHeaderHeightAndMarginTop:l}=this;let{startY:c,endY:u,startX:h,endX:d}=qn(n,r,i,o);return s&&(c+=l,u+=l,h+=a,d+=a),{startY:c,endY:u,startX:h,endX:d}}getNoMergeCellPositionByIndexWithNoHeader(n,r){const{rowHeightAccumulation:s,columnWidthAccumulation:i}=this,{startY:o,endY:a,startX:l,endX:c}=qn(n,r,s,i);return{startY:o,endY:a,startX:l,endX:c}}getRowIndexByOffsetY(n,r,s,i){var l;const{rowHeightAccumulation:o}=this;n=hd(n,r,s,this.columnHeaderHeightAndMarginTop);let a=ir(o,n,i==null?void 0:i.firstMatch);return i!=null&&i.closeFirst&&Math.abs(o[a]-n)<Math.abs(n-((l=o[a-1])!=null?l:0))&&(a=a+1),a}getColumnIndexByOffsetX(n,r,s,i){var c;const o=ud(n,r,s,this.rowHeaderWidthAndMarginLeft),{columnWidthAccumulation:a}=this;let l=ir(a,o,i==null?void 0:i.firstMatch);return i!=null&&i.closeFirst&&Math.abs(a[l]-o)<Math.abs(o-((c=a[l-1])!=null?c:0))&&(l=l+1),l}getCellIndexByOffset(n,r,s,i,o,a){const l=this.getRowIndexByOffsetY(r,i,o,a),c=this.getColumnIndexByOffsetX(n,s,o,a);return{row:l,column:c}}getCellByOffset(n,r,s,i,o){const a=this==null?void 0:this.getCellIndexByOffset(n,r,s,i,o,{firstMatch:!0});return a?this.worksheet.getCellInfoInMergeData(a.row,a.column):null}getCellWithCoordByIndex(n,r,s=!0){const{rowHeightAccumulation:i,columnWidthAccumulation:o,rowHeaderWidthAndMarginLeft:a,columnHeaderHeightAndMarginTop:l}=this,c=qn(n,r,i,o,this.worksheet.getCellInfoInMergeData(n,r)),{isMerged:u,isMergedMainCell:h}=c;let{startY:d,endY:m,startX:_,endX:p,mergeInfo:I}=c,A=a,B=l;return s===!1&&(A=0,B=0),d+=B,m+=B,_+=A,p+=A,I.startY+=B,I.endY+=B,I.startX+=A,I.endX+=A,{actualRow:n,actualColumn:r,startX:_,startY:d,endX:p,endY:m,isMerged:u,isMergedMainCell:h,mergeInfo:I}}getCellWithCoordByOffset(n,r,s,i,o,a){const{row:l,column:c}=this.getCellIndexByOffset(n,r,s,i,o,a);return this.getCellWithCoordByIndex(l,c)}getOffsetByColumn(n){const{columnWidthAccumulation:r,rowHeaderWidthAndMarginLeft:s}=this,i=r.length-1,o=r[n];return o!=null?o+s:n<0?s:r[i]+s}getOffsetByRow(n){const{rowHeightAccumulation:r,columnHeaderHeightAndMarginTop:s}=this,i=r.length-1,o=r[n];return o!=null?o+s:n<0?s:r[i]+s}getOffsetRelativeToRowCol(n,r){const s=ir(this.columnWidthAccumulation,n);let i=0;s===0?i=n:i=n-this._columnWidthAccumulation[s-1];const o=ir(this.rowHeightAccumulation,r);let a=0;return o===0?a=r:a=r-this._rowHeightAccumulation[o-1],{row:o,column:s,columnOffset:i,rowOffset:a}}_updateConfigAndGetDocumentModel(n,r,s,i){var a,l,c,u,h;if(!i||!((a=n.body)!=null&&a.dataStream))return;n.documentStyle||(n.documentStyle={}),n.documentStyle.marginTop=(l=s.t)!=null?l:0,n.documentStyle.marginBottom=(c=s.b)!=null?c:2,n.documentStyle.marginLeft=(u=s.l)!=null?u:2,n.documentStyle.marginRight=(h=s.r)!=null?h:2,n.documentStyle.pageSize={width:Number.POSITIVE_INFINITY,height:Number.POSITIVE_INFINITY},n.documentStyle.renderConfig={...n.documentStyle.renderConfig,...i};const o=n.body.paragraphs||[];for(const d of o)d.paragraphStyle||(d.paragraphStyle={}),d.paragraphStyle.horizontalAlign=r;return new At(n)}dispose(){super.dispose(),this._rowHeightAccumulation=[],this._columnWidthAccumulation=[],this._rowTotalHeight=0,this._columnTotalWidth=0,this._rowHeaderWidth=0,this._columnHeaderHeight=0,this._worksheetData=null,this._cellData=null,this._styles=null}},f.SheetSkeleton=lI([Js(2,Re.Inject(Sn)),Js(3,An),Js(4,qo),Js(5,Re.Inject(Re.Injector))],f.SheetSkeleton);function ua(e,t,n,r){const s=e-1,i=t-1,o=n[s]||0;let a=n[e];a==null&&(a=n[n.length-1]);const l=r[i]||0;let c=r[t];return c==null&&(c=r[r.length-1]),{startY:o,endY:a,startX:l,endX:c}}function cI(e,t,n,r){return ua(e,t,n,r)}function qn(e,t,n,r,s){e=Z.clamp(e,0,n.length-1),t=Z.clamp(t,0,r.length-1);let{startY:i,endY:o,startX:a,endX:l}=ua(e,t,n,r);if(!s)return{startY:i,endY:o,startX:a,endX:l,isMerged:!1,isMergedMainCell:!1,actualRow:e,actualColumn:t,mergeInfo:{startY:i,endY:o,startX:a,endX:l,startRow:e,startColumn:t,endRow:e,endColumn:t}};const{isMerged:c,isMergedMainCell:u,startRow:h,startColumn:d,endRow:m,endColumn:_}=s;let p={startRow:h,startColumn:d,endRow:m,endColumn:_,startY:i,endY:o,startX:a,endX:l};const I=n.length-1,A=r.length-1;if(c&&h!==-1&&d!==-1){const B=n[h-1]||0,x=n[m]||n[I],Y=r[d-1]||0,O=r[_]||r[A];p={...p,startY:B,endY:x,startX:Y,endX:O}}else if(!c&&m!==-1&&_!==-1){const B=n[m]||n[I],x=r[_]||r[A];p={...p,startY:i,endY:B,startX:a,endX:x}}return{isMerged:c,isMergedMainCell:u,actualRow:e,actualColumn:t,startY:i,endY:o,startX:a,endX:l,mergeInfo:p}}function ud(e,t,n,r){const{x:s}=n;return e/t+s-r}function hd(e,t,n,r){const{y:s}=n;return e=e/t+s-r,e}const uI=["script","style","meta","comment","link"];var dd=(e=>(e[e.INFO=0]="INFO",e[e.STOP=1]="STOP",e[e.WARNING=2]="WARNING",e))(dd||{}),fd=(e=>(e[e.DISABLED=0]="DISABLED",e[e.FULL_ALPHA=1]="FULL_ALPHA",e[e.FULL_HANGUL=2]="FULL_HANGUL",e[e.FULL_KATAKANA=3]="FULL_KATAKANA",e[e.HALF_ALPHA=4]="HALF_ALPHA",e[e.HALF_HANGUL=5]="HALF_HANGUL",e[e.HALF_KATAKANA=6]="HALF_KATAKANA",e[e.HIRAGANA=7]="HIRAGANA",e[e.NO_CONTROL=8]="NO_CONTROL",e[e.OFF=9]="OFF",e[e.ON=10]="ON",e))(fd||{}),md=(e=>(e.BETWEEN="between",e.EQUAL="equal",e.GREATER_THAN="greaterThan",e.GREATER_THAN_OR_EQUAL="greaterThanOrEqual",e.LESS_THAN="lessThan",e.LESS_THAN_OR_EQUAL="lessThanOrEqual",e.NOT_BETWEEN="notBetween",e.NOT_EQUAL="notEqual",e))(md||{}),gd=(e=>(e[e.TEXT=0]="TEXT",e[e.ARROW=1]="ARROW",e[e.CUSTOM=2]="CUSTOM",e))(gd||{}),_d=(e=>(e.VALID="valid",e.INVALID="invalid",e.VALIDATING="validating",e))(_d||{}),pd=(e=>(e.CUSTOM="custom",e.LIST="list",e.LIST_MULTIPLE="listMultiple",e.NONE="none",e.TEXT_LENGTH="textLength",e.DATE="date",e.TIME="time",e.WHOLE="whole",e.DECIMAL="decimal",e.CHECKBOX="checkbox",e.ANY="any",e))(pd||{}),hI=Object.getOwnPropertyDescriptor,dI=(e,t,n,r)=>{for(var s=r>1?void 0:r?hI(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=o(s)||s);return s},Ed=(e,t)=>(n,r)=>t(n,r,e);let ha=class extends ze{constructor(e,t){super(),this._resourceManagerService=e,this._univerInstanceService=t,this._init()}_init(){const e=n=>{n.businesses.forEach(r=>{switch(r){case we.UNRECOGNIZED:case we.UNIVER_UNKNOWN:case we.UNIVER_SLIDE:case we.UNIVER_DOC:{this._univerInstanceService.getAllUnitsForType(we.UNIVER_DOC).forEach(s=>{const o=(s.getSnapshot().resources||[]).find(a=>a.name===n.pluginName);if(o)try{const a=n.parseJson(o.data);n.onLoad(s.getUnitId(),a)}catch{console.error(`Load Document{${s.getUnitId()}} Resources{${n.pluginName}} Data Error.`)}});break}case we.UNIVER_SHEET:this._univerInstanceService.getAllUnitsForType(we.UNIVER_SHEET).forEach(s=>{const o=(s.getSnapshot().resources||[]).find(a=>a.name===n.pluginName);if(o)try{const a=n.parseJson(o.data);n.onLoad(s.getUnitId(),a)}catch{console.error(`Load Workbook{${s.getUnitId()}} Resources{${n.pluginName}} Data Error.`)}})}})};this._resourceManagerService.getAllResourceHooks().forEach(n=>e(n)),this.disposeWithMe(this._resourceManagerService.register$.subscribe(n=>e(n))),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitAdded$(we.UNIVER_SHEET).subscribe(n=>{this._resourceManagerService.loadResources(n.getUnitId(),n.getSnapshot().resources)})),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitAdded$(we.UNIVER_DOC).subscribe(n=>{const r=n.getUnitId();Ca(r)||this._resourceManagerService.loadResources(n.getUnitId(),n.getSnapshot().resources)})),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitDisposed$(we.UNIVER_SHEET).subscribe(n=>{this._resourceManagerService.unloadResources(n.getUnitId())})),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitDisposed$(we.UNIVER_DOC).subscribe(n=>{this._resourceManagerService.unloadResources(n.getUnitId())}))}saveUnit(e){const t=this._univerInstanceService.getUnit(e);if(!t)return null;const n=this._resourceManagerService.getResources(e,t.type),r=Z.deepClone(t.getSnapshot());return r.resources=n,r}};ha=dI([Ed(0,Re.Inject(js)),Ed(1,Re.Inject(Xn))],ha);class fI{constructor(t={},n){C(this,"_startedTypes",new Set);C(this,"_injector");C(this,"_disposingCallbacks",new Jr);const r=this._injector=mI(n,t==null?void 0:t.override),{theme:s,darkMode:i,locale:o,locales:a,logLevel:l}=t;s&&this._injector.get(qs).setTheme(s),i&&this._injector.get(qs).setDarkMode(i),a&&this._injector.get(Sn).load(a),o&&this._injector.get(Sn).setLocale(o),l&&this._injector.get(_t).setLogLevel(l),this._init(r)}get _univerInstanceService(){return this._injector.get(Xn)}get _pluginService(){return this._injector.get(f.PluginService)}__getInjector(){return this._injector}onDispose(t){const n=this._disposingCallbacks.add(je(t));return je(()=>n.dispose(!0))}dispose(){this._disposingCallbacks.dispose(),this._injector.dispose()}setLocale(t){this._injector.get(Sn).setLocale(t)}createUnit(t,n){return this._univerInstanceService.createUnit(t,n)}createUniverSheet(t){return this._injector.get(_t).warn("[Univer]","Univer.createUniverSheet is deprecated, use createUnit instead"),this._univerInstanceService.createUnit(we.UNIVER_SHEET,t)}createUniverDoc(t){return this._injector.get(_t).warn("[Univer]","Univer.createUniverDoc is deprecated, use createUnit instead"),this._univerInstanceService.createUnit(we.UNIVER_DOC,t)}createUniverSlide(t){return this._injector.get(_t).warn("[Univer]","Univer.createUniverSlide is deprecated, use createUnit instead"),this._univerInstanceService.createUnit(we.UNIVER_SLIDE,t)}_init(t){this._univerInstanceService.registerCtorForType(we.UNIVER_SHEET,f.Workbook),this._univerInstanceService.registerCtorForType(we.UNIVER_DOC,At),this._univerInstanceService.registerCtorForType(we.UNIVER_SLIDE,ea);const n=t.get(Xn);n.__setCreateHandler((r,s,i,o)=>{if(!this._startedTypes.has(r)){this._pluginService.startPluginsForType(r),this._startedTypes.add(r);const l=t.createInstance(i,s);return n.__addUnit(l,o),this._tryProgressToReady(),l}const a=t.createInstance(i,s);return n.__addUnit(a,o),a})}_tryProgressToReady(){this._injector.get(f.LifecycleService).stage<ke.Ready&&(this._injector.get(f.LifecycleService).stage=ke.Ready)}registerPlugin(t,n){this._pluginService.registerPlugin(t,n)}}function mI(e,t){const n=Qh([[Ah],[Sn],[qs],[f.LifecycleService],[f.PluginService],[Ur],[Xn,{useClass:f.UniverInstanceService}],[Zh,{useClass:Jh}],[_t,{useClass:Ma,lazy:!0}],[sr,{useClass:f.CommandService}],[Zs,{useClass:f.LocalUndoRedoService,lazy:!0}],[qo,{useClass:vh}],[An,{useClass:ya}],[js,{useClass:f.ResourceManagerService,lazy:!0}],[sa,{useClass:ha,lazy:!0}],[$u,{useClass:f.AuthzIoLocalService}],[qh,{useClass:f.MentionIOLocalService,lazy:!0}]],t),r=e?e.createChild(n):new Re.Injector(n);return Ra(r,[[Ur],[sa]]),r}bd(),f.ABCToNumber=M_,f.AUTO_HEIGHT_FOR_MERGED_CELLS=Ea,f.AbsoluteRefType=Ne,f.ActionIterator=jn,f.AlignTypeH=Mc,f.AlignTypeV=Lc,f.ArrangeTypeEnum=Pc,f.ArrowsAndMarkersShapes=Xa,f.AsyncInterceptorManager=zd,f.AsyncLock=kd,f.AutoFillSeries=xa,f.BaselineOffset=$t,f.BasicShapes=Ka,f.BlockType=hc,f.BooleanNumber=ae,f.BorderStyleTypes=Ue,f.BorderType=Ba,f.BuildTextUtils=Je,f.BulletAlignment=Or,f.COLORS=hi,f.CanceledError=Hd,f.CellModeEnum=Tn,f.CellValueType=Xt,f.Color=fn,f.ColorBuilder=is,f.ColorKit=vt,f.ColorType=pt,f.ColumnSeparatorType=mc,f.CommandType=rr,f.CommonHideTypes=$a,f.ConfigService=vh,f.ContextService=ya,f.CopyPasteType=Ha,f.CustomCommandExecutionError=qr,f.CustomDecorationType=_n,f.CustomRangeType=en,f.DEFAULT_CELL=a_,f.DEFAULT_DOC=yo,f.DEFAULT_DOCUMENT_SUB_COMPONENT_ID=Qp,f.DEFAULT_EMPTY_DOCUMENT_VALUE=_a,f.DEFAULT_NUMBER_FORMAT=lc,f.DEFAULT_RANGE=i_,f.DEFAULT_RANGE_ARRAY=s_,f.DEFAULT_SELECTION=o_,f.DEFAULT_SLIDE=Bc,f.DEFAULT_STYLES=st,f.DEFAULT_TEXT_FORMAT=oc,f.DEFAULT_TEXT_FORMAT_EXCEL=ac,f.DEFAULT_WORKSHEET_COLUMN_COUNT=Fh,f.DEFAULT_WORKSHEET_COLUMN_COUNT_KEY=OR,f.DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT=Hh,f.DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT_KEY=AR,f.DEFAULT_WORKSHEET_COLUMN_WIDTH=Bh,f.DEFAULT_WORKSHEET_COLUMN_WIDTH_KEY=wR,f.DEFAULT_WORKSHEET_ROW_COUNT=kh,f.DEFAULT_WORKSHEET_ROW_COUNT_KEY=SR,f.DEFAULT_WORKSHEET_ROW_HEIGHT=xh,f.DEFAULT_WORKSHEET_ROW_HEIGHT_KEY=vR,f.DEFAULT_WORKSHEET_ROW_TITLE_WIDTH=$h,f.DEFAULT_WORKSHEET_ROW_TITLE_WIDTH_KEY=bR,f.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY=ri,f.DOCS_NORMAL_EDITOR_UNIT_ID_KEY=ni,f.DOCS_ZEN_EDITOR_UNIT_ID_KEY=ga,f.DOC_DRAWING_PRINTING_COMPONENT_KEY=d_,f.DOC_RANGE_TYPE=ul,f.DashStyleType=Rc,f.DataStreamTreeNodeType=Lu,f.DataStreamTreeTokenType=lt,f.DataValidationErrorStyle=dd,f.DataValidationImeMode=fd,f.DataValidationOperator=md,f.DataValidationRenderMode=gd,f.DataValidationStatus=_d,f.DataValidationType=pd,f.DeleteDirection=Wa,f.DependentOn=zR,f.DesktopLogService=Ma,f.DeveloperMetadataVisibility=ja,f.Dimension=Ya,f.Direction=Ga,f.Disposable=ze,f.DisposableCollection=Jr,f.DocStyleType=cc,f.DocumentDataModel=At,f.DocumentFlavor=ho,f.DrawingTypeEnum=kc,f.EDITOR_ACTIVATED=wh,f.EXTENSION_NAMES=$c,f.ErrorService=Ah,f.EventState=xu,f.EventSubject=eE,f.FOCUSING_COMMON_DRAWINGS=cR,f.FOCUSING_DOC=$r,f.FOCUSING_EDITOR_BUT_HIDDEN=rR,f.FOCUSING_EDITOR_INPUT_FORMULA=sR,f.FOCUSING_EDITOR_STANDALONE=oR,f.FOCUSING_FX_BAR_EDITOR=bh,f.FOCUSING_PANEL_EDITOR=aR,f.FOCUSING_SHEET=Kn,f.FOCUSING_SLIDE=Hr,f.FOCUSING_UNIT=Br,f.FOCUSING_UNIVER_EDITOR=iR,f.FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE=lR,f.FORMULA_EDITOR_ACTIVATED=uR,f.FollowNumberWithType=uc,f.FontItalic=ts,f.FontStyleType=kn,f.FontWeight=ns,f.GridType=dc,f.HLSColor=il,f.HorizontalAlign=Ot,f.IAuthzIoService=$u,f.ICommandService=sr,f.IConfigService=qo,f.IContextService=An,f.IImageIoService=Jo,f.ILocalStorageService=BR,f.ILogService=_t,f.IMentionIOService=qh,f.IPermissionService=Zh,f.IResourceLoaderService=sa,f.IResourceManagerService=js,f.IS_ROW_STYLE_PRECEDE_COLUMN_STYLE=pa,f.IUndoRedoService=Zs,f.IUniverInstanceService=Xn,f.ImageCacheMap=od,f.ImageSourceType=Zo,f.ImageUploadStatusType=Th,f.InterceptorEffectEnum=bn,f.InterceptorManager=Yd,f.InterpolationPointType=Va,f.JSON1=Y_,f.JSONX=Wt,f.LRUHelper=hr,f.LRUMap=ur,f.LifecycleStages=ke,f.LifecycleUnreachableError=Kh,f.ListGlyphType=fe,f.LocaleService=Sn,f.LocaleType=ar,f.LogLevel=Na,f.MOVE_BUFFER_VALUE=or,f.MemoryCursor=un,f.MentionType=es,f.NAMED_STYLE_MAP=c_,f.NAMED_STYLE_SPACE_MAP=u_,f.NamedStyleType=qe,f.NilCommand=Da,f.NumberUnitType=Nc,f.ObjectMatrix=ct,f.ObjectRelativeFromH=Tc,f.ObjectRelativeFromV=yc,f.OtherShapes=qa,f.PAGE_SIZE=f_,f.PAPER_TYPES=r_,f.PRESET_LIST_TYPE=Nr,f.PRINT_CHART_COMPONENT_KEY=h_,f.PageElementType=Fc,f.PageOrientType=Uc,f.PageType=fo,f.PaperType=dt,f.ParagraphElementType=_c,f.ParagraphStyleBuilder=Dr,f.ParagraphStyleValue=Lr,f.PermissionService=Jh,f.PermissionStatus=ta,f.Plugin=ra,f.PositionedObjectLayoutType=Ec,f.PresetListType=Ft,f.ProtectionType=za,f.QuickListType=Ru,f.QuickListTypeMap=q_,f.RANGE_DIRECTION=cl,f.RANGE_TYPE=pe,f.RBush=Ms,f.RCDisposable=hf,f.RGBA_PAREN=Hf,f.RGB_PAREN=$f,f.ROTATE_BUFFER_VALUE=Fa,f.RTree=tI,f.Range=xn,f.Rectangle=tn,f.RedoCommand=id,f.RedoCommandId=nd,f.RefAlias=N_,f.Registry=oi,f.RegistryAsMap=ai,f.RelativeDate=Ja,f.RelativeSlideLink=xc,f.RgbColor=os,f.RichTextBuilder=Cn,f.RichTextValue=sn,f.RxDisposable=uf,f.SHEET_EDITOR_UNITS=l_,f.SectionType=fc,f.SheetTypes=Qa,f.SheetViewModel=jh,f.SliceBodyType=Ao,f.SlideDataModel=ea,f.SpacingRule=Cc,f.SpecialShapes=Za,f.Styles=yh,f.THEME_COLORS=sl,f.TabStopAlignment=Ic,f.TableAlignmentType=Oc,f.TableLayoutType=vc,f.TableRowHeightRule=bc,f.TableSizeType=Sc,f.TableTextWrapType=wc,f.TextDecoration=el,f.TextDecorationBuilder=rn,f.TextDirection=lr,f.TextDirectionType=gc,f.TextStyleBuilder=nn,f.TextStyleValue=Mr,f.TextX=Me,f.TextXActionType=J,f.ThemeColor=as,f.ThemeColorType=ot,f.ThemeColors=rs,f.ThemeService=qs,f.Tools=Z,f.UndoCommand=sd,f.UndoCommandId=rd,f.UnitModel=Ps,f.Univer=fI,f.UniverInstanceType=we,f.UpdateDocsAttributeType=Ce,f.UserManagerService=Ur,f.VerticalAlign=hn,f.VerticalAlignmentType=Ac,f.Worksheet=jr,f.WrapStrategy=dn,f.WrapTextType=pc,f.addLinkToDocumentModel=Lh,f.afterInitApply=If,f.afterTime=Cf,f.awaitTime=nI,f.binSearchFirstGreaterThanTarget=ka,f.binarySearchArray=Sf,f.bufferDebounceTime=Ef,f.cellToRange=pm,f.characterSpacingControlType=Dc,f.checkForSubstrings=Cm,f.checkIfMove=vf,f.checkParagraphHasBullet=tg,f.checkParagraphHasIndent=ng,f.checkParagraphHasIndentByStyle=vl,f.codeToBlob=Of,f.composeBody=To,f.composeInterceptors=Sa,f.composeStyles=cr,f.concatMatrixArray=om,f.convertBodyToHtml=Bf,f.convertCellToRange=hl,f.convertObservableToBehaviorSubject=Rf,f.covertCellValue=Ei,f.covertCellValues=Em,f.covertTextRunToHtml=ui,f.createAsyncInterceptorKey=Gd,f.createDefaultUser=Ys,f.createDocumentModelWithStyle=Wr,f.createInterceptorKey=jd,f.createInternalEditorID=Bd,f.createRowColIter=po,f.dayjs=Ht,f.debounce=qC,f.dedupe=Ad,f.dedupeBy=Td,f.deepCompare=Ci,f.delayAnimationFrame=rI,f.deleteContent=bl,f.extractPureTextFromCell=Gh,f.fromCallback=Ua,f.fromEventSubject=tE,f.fromObservable=cf,f.generateRandomId=tt,f.get=ph,f.getArrayLength=Zt,f.getBodySlice=bt,f.getBodySliceHtml=ss,f.getBorderStyleType=mm,f.getCellCoordByIndexSimple=ua,f.getCellInfoInMergeData=sm,f.getCellPositionByIndexSimple=cI,f.getCellValueType=tm,f.getCellWithCoordByIndexCore=qn,f.getColorStyle=Dt,f.getCustomBlockSlice=wu,f.getCustomDecorationSlice=Au,f.getCustomRangeSlice=bu,f.getDocsUpdateBody=gm,f.getIntersectRange=Yc,f.getOriginCellValue=yR,f.getParagraphsSlice=vu,f.getPlainText=Ws,f.getReverseDirection=wf,f.getSectionBreakSlice=ip,f.getTableSlice=Ou,f.getTextRunSlice=Hs,f.getTransformOffsetX=ud,f.getTransformOffsetY=hd,f.getWorksheetUID=DR,f.groupBy=Md,f.handleStyleToString=fm,f.hashAlgorithm=sg,f.horizontalLineSegmentsSubtraction=Cs,f.insertMatrixArray=mi,f.insertTextToContent=wl,f.invertColorByHSL=Qd,f.invertColorByMatrix=tf,f.isBlackColor=Qf,f.isBooleanString=xd,f.isCellCoverable=pi,f.isCellV=ll,f.isDefaultFormat=t_,f.isEmptyCell=dl,f.isFormulaId=dm,f.isFormulaString=fl,f.isICellData=al,f.isInternalEditorID=Ca,f.isNodeEnv=xf,f.isNotNullOrUndefined=Dh,f.isNullCell=nm,f.isNumeric=ba,f.isPatternEqualWithoutDecimal=n_,f.isRangesEqual=fR,f.isRealNum=rg,f.isSafeNumeric=rf,f.isSameStyleTextRun=ml,f.isTextFormat=e_,f.isUnitRangesEqual=mR,f.isValidRange=_m,f.isWhiteColor=em,f.makeArray=Ld,f.makeCellRangeToRangeData=hm,f.makeCellToSelection=um,f.makeCustomRangeStream=Cp,f.mapObjectMatrix=im,f.merge=Xo,f.mergeOverrideWithDependencies=Qh,f.mergeSets=af,f.mergeWith=eR,f.mergeWorksheetSnapshotWithDefault=Wh,f.mixinClass=nf,f.moveMatrixArray=_i,f.moveRangeByOffset=R_,f.nameCharacterCheck=eI,f.normalizeBody=op,f.normalizeTextRuns=yr,f.numberToABC=D_,f.numberToListABC=U_,f.numfmt=Qg,f.queryObjectMatrix=y_,f.registerDependencies=$d,f.remove=tr,f.repeatStringNumTimes=Kc,f.replaceInDocumentBody=Zp,f.requestImmediateMacroTask=of,f.rotate=Nd,f.searchArray=ir,f.searchInOrderedArray=Pa,f.selectionToArray=rm,f.sequence=Ta,f.sequenceAsync=Aa,f.sequenceExecute=Qr,f.sequenceExecuteAsync=pf,f.set=nR,f.shallowEqual=Ia,f.skipParseTagNames=uI,f.sliceMatrixArray=am,f.sortRules=P_,f.sortRulesByDesc=k_,f.sortRulesFactory=Ar,f.spliceArray=gi,f.splitIntoGrid=_o,f.takeAfter=li,f.textDiff=Mo,f.throttle=Wd,f.toDisposable=je,f.touchDependencies=Ra,f.updateAttributeByDelete=Tu,f.updateAttributeByInsert=yu,f.willLoseNumericPrecision=sf,Object.keys(Re).forEach(e=>{e!=="default"&&!Object.prototype.hasOwnProperty.call(f,e)&&Object.defineProperty(f,e,{enumerable:!0,get:()=>Re[e]})}),Object.defineProperty(f,Symbol.toStringTag,{value:"Module"})});
1217
+ `,customBlocks:[],customRanges:[],paragraphs:[{startIndex:0}],textRuns:[],tables:[],sectionBreaks:[]}})}static create(n){return new Cn(n!=null?n:Cn.newEmptyData())}insertText(n,r,s){var u,h;let i=((h=(u=this._data.body)==null?void 0:u.dataStream.length)!=null?h:2)-2,o,a;if(typeof n=="string"?o=n:(i=Math.min(n,i),o=r),typeof r=="object"?a=r instanceof nn?r.build():r:a=s instanceof nn?s.build():s,!o)return this;const l={dataStream:o,textRuns:a?[{ts:a,st:i,ed:i+o.length}]:[]},c=Je.selection.replace({doc:this._doc,selection:{startOffset:i,endOffset:i,collapsed:!0},body:l});if(!c)throw new Error("Insert text failed, please check.");return Me.apply(this._doc.getBody(),c.serialize()),this}insertRichText(n,r){var a,l;let s=((l=(a=this._data.body)==null?void 0:a.dataStream.length)!=null?l:2)-2,i;typeof n=="object"?i=n instanceof sn?n.getData():n:(s=Math.min(n,s),i=r instanceof sn?r.getData():r);const o=Je.selection.replace({doc:this._doc,selection:{startOffset:s,endOffset:s,collapsed:!0},body:i.body});if(!o)throw new Error("Insert text failed, please check.");return Me.apply(this._doc.getBody(),o.serialize()),this}delete(n,r){if(r!==void 0){if(!r)return this;const s=Je.selection.delete([{startOffset:n,endOffset:n+r,collapsed:!0}],this._data.body);Me.apply(this._doc.getBody(),s)}return this}setStyle(n,r,s){const i={dataStream:"",textRuns:[{ts:s instanceof nn?s.build():s,st:0,ed:r-n}]},o=Je.selection.retain([{startOffset:n,endOffset:r,collapsed:!0}],i);return Me.apply(this._doc.getBody(),o),this}setLink(n,r,s){const i=Je.customRange.add({rangeType:en.HYPERLINK,rangeId:tt(),properties:{url:s},ranges:[{startOffset:n,endOffset:r,collapsed:!1}],body:this._data.body});if(!i)throw new Error("Insert text failed, please check.");return Me.apply(this._doc.getBody(),i.serialize()),this}cancelLink(n,r){if(typeof n=="string"){const s=Je.customRange.delete({rangeId:n,documentDataModel:this._doc});if(!s)throw new Error("Insert text failed, please check.");Me.apply(this._doc.getBody(),s.serialize())}else this.slice(n,r).getLinks().forEach(i=>{const o=Je.customRange.delete({rangeId:i.rangeId,documentDataModel:this._doc});if(!o)throw new Error("Insert text failed, please check.");Me.apply(this._doc.getBody(),o.serialize())});return this}updateLink(n,r){var i,o;const s=(o=(i=this._data.body)==null?void 0:i.customRanges)==null?void 0:o.find(a=>a.rangeId===n);if(!s)throw new Error("Link not found");return s.properties.url=r,this}insertParagraph(n,r){var o,a;let s,i;return typeof n=="object"?(s={dataStream:"\r",paragraphs:[{startIndex:0,paragraphStyle:n.build()}]},i=((a=(o=this._data.body)==null?void 0:o.dataStream.length)!=null?a:2)-2):(i=n,s={dataStream:"\r",paragraphs:[{startIndex:0,paragraphStyle:r==null?void 0:r.build()}]}),this.insertRichText(i,sn.create({body:s,id:"d",documentStyle:{}})),this}insertLink(n,r,s){let i="",o="";typeof n=="string"?(i=n,o=r):(i=r,o=s);const a=Cn.createByBody({dataStream:i,customRanges:[{rangeType:en.HYPERLINK,rangeId:tt(),properties:{url:o},startIndex:0,endIndex:i.length-1}]});return typeof n=="number"?this.insertRichText(n,a):this.insertRichText(a)}}const Qp="__default_document_sub_component_id20231101__";class xu{constructor(){C(this,"skipNextObservers",!1);C(this,"lastReturnValue");C(this,"isStopPropagation",!1)}stopPropagation(){this.isStopPropagation=!0}}class eE extends oe.Subject{constructor(){super(...arguments);C(this,"_sortedObservers",[])}subscribe(){throw new Error("[EventSubject]: please use `subscribeEvent` instead of `subscribe` method for `EventSubject`.")}next(){throw new Error("[EventSubject]: please use `emitEvent` instead of `next` method for `EventSubject`.")}unsubscribe(){super.unsubscribe(),this._sortedObservers.length=0}complete(){super.complete(),this._sortedObservers.length=0}subscribeEvent(n){let r;typeof n=="function"?r={next:([i,o])=>n(i,o)}:r=n;const s=super.subscribe(r);return this._sortedObservers.push(r),this._sortedObservers.sort((i,o)=>{var a,l;return((a=i.priority)!=null?a:0)-((l=o.priority)!=null?l:0)}),s.add(()=>this._sortedObservers=this._sortedObservers.filter(i=>i!==r)),s}clearObservers(){this._sortedObservers.forEach(n=>{var r;return(r=n.complete)==null?void 0:r.call(n)}),this._sortedObservers.length=0}emitEvent(n){var r;if(!this.closed){const s=new xu;s.lastReturnValue=n;for(const i of this._sortedObservers){const o=(r=i.next)==null?void 0:r.call(i,[n,s]);if(s.lastReturnValue=o,s.skipNextObservers)return{handled:!0,lastReturnValue:s.lastReturnValue,stopPropagation:s.isStopPropagation}}return{handled:this._sortedObservers.length>0,lastReturnValue:s.lastReturnValue,stopPropagation:s.isStopPropagation}}throw new Error("[EventSubject]: cannot emit event on a closed subject.")}}function tE(e){return new oe.Observable(t=>{const n=e.subscribeEvent(r=>{t.next(r)});return()=>n.unsubscribe()})}const js=Re.createIdentifier("core.resource-manager.service"),Po={[kt.Editor]:"Editor",[kt.Owner]:"Owner",[kt.Reader]:"Reader",[kt.UNRECOGNIZED]:"UNRECOGNIZED"},Ys=e=>e?{userID:`${Po[e]}_${tt(8)}`,name:Po[e],avatar:""}:{userID:"",name:"",avatar:"",anonymous:!0,canBindAnonymous:!1},nE=(e,t)=>e.startsWith(Po[t]);class Ur extends ze{constructor(){super(...arguments);C(this,"_model",new Map);C(this,"_userChange$",new oe.Subject);C(this,"userChange$",this._userChange$.asObservable());C(this,"_currentUser$",new oe.BehaviorSubject(Ys()));C(this,"currentUser$",this._currentUser$.asObservable())}dispose(){super.dispose(),this._model.clear(),this._userChange$.complete(),this._currentUser$.complete()}getCurrentUser(){return this._currentUser$.getValue()}setCurrentUser(n){this.addUser(n),this._currentUser$.next(n)}addUser(n){this._model.set(n.userID,n),this._userChange$.next({type:"add",user:n})}getUser(n,r){const s=this._model.get(n);if(s)return s;r&&r()}delete(n){const r=this.getUser(n);this._model.delete(n),r&&this._userChange$.next({type:"delete",user:r})}clear(){this._model.clear(),this._userChange$.next({type:"clear"})}list(){return Array.from(this._model.values())}}var rE=Object.getOwnPropertyDescriptor,sE=(e,t,n,r)=>{for(var s=r>1?void 0:r?rE(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=o(s)||s);return s},Bu=(e,t)=>(n,r)=>t(n,r,e);f.AuthzIoLocalService=class{constructor(t,n){C(this,"_permissionMap",new Map([]));this._resourceManagerService=t,this._userManagerService=n,this._initSnapshot(),this._initDefaultUser()}_initDefaultUser(){const t=this._userManagerService.getCurrentUser();t&&t.userID||this._userManagerService.setCurrentUser(Ys(kt.Owner))}_getRole(t){const n=this._userManagerService.getCurrentUser();return n?nE(n.userID,t):!1}_initSnapshot(){this._resourceManagerService.registerPluginResource({toJson:t=>{const n=[...this._permissionMap.keys()].reduce((r,s)=>{const i=this._permissionMap.get(s);return r[s]=i,r},{});return JSON.stringify(n)},parseJson:t=>JSON.parse(t),pluginName:"SHEET_AuthzIoMockService_PLUGIN",businesses:[we.UNIVER_SHEET,we.UNIVER_DOC,we.UNIVER_SLIDE],onLoad:(t,n)=>{for(const r in n)this._permissionMap.set(r,n[r])},onUnLoad:()=>{this._permissionMap.clear()}})}async create(t){return tt(8)}async allowed(t){return Promise.resolve([])}async batchAllowed(t){return Promise.resolve([])}async list(t){const n=[];return t.objectIDs.forEach(r=>{const s=this._permissionMap.get(r);if(s){const i={objectID:r,unitID:t.unitID,objectType:s.objectType,name:s.name,shareOn:!1,shareRole:kt.Owner,shareScope:-1,scope:{read:Eo.AllCollaborator,edit:Eo.AllCollaborator},creator:Ys(kt.Owner),strategies:[{action:6,role:1},{action:16,role:1},{action:17,role:1},{action:18,role:1},{action:19,role:1},{action:33,role:1},{action:34,role:1},{action:35,role:1},{action:36,role:1},{action:37,role:1},{action:38,role:1},{action:39,role:1},{action:40,role:1}],actions:t.actions.map(o=>({action:o,allowed:this._getRole(kt.Owner)||this._getRole(kt.Editor)}))};n.push(i)}}),n}async listCollaborators(){return[]}async listRoles(){return{roles:[],actions:[]}}async deleteCollaborator(){}async update(t){}async updateCollaborator(){}async createCollaborator(){}async putCollaborators(t){}},f.AuthzIoLocalService=sE([Bu(0,js),Bu(1,Re.Inject(Ur))],f.AuthzIoLocalService);const $u=Re.createIdentifier("IAuthzIoIoService");var Hu=typeof global=="object"&&global&&global.Object===Object&&global,iE=typeof self=="object"&&self&&self.Object===Object&&self,Rn=Hu||iE||Function("return this")(),Yn=Rn.Symbol,Wu=Object.prototype,oE=Wu.hasOwnProperty,aE=Wu.toString,Pr=Yn?Yn.toStringTag:void 0;function lE(e){var t=oE.call(e,Pr),n=e[Pr];try{e[Pr]=void 0;var r=!0}catch{}var s=aE.call(e);return r&&(t?e[Pr]=n:delete e[Pr]),s}var cE=Object.prototype,uE=cE.toString;function hE(e){return uE.call(e)}var dE="[object Null]",fE="[object Undefined]",ju=Yn?Yn.toStringTag:void 0;function kr(e){return e==null?e===void 0?fE:dE:ju&&ju in Object(e)?lE(e):hE(e)}function Gn(e){return e!=null&&typeof e=="object"}var mE="[object Symbol]";function Gs(e){return typeof e=="symbol"||Gn(e)&&kr(e)==mE}function gE(e,t){for(var n=-1,r=e==null?0:e.length,s=Array(r);++n<r;)s[n]=t(e[n],n,e);return s}var Vn=Array.isArray,Yu=Yn?Yn.prototype:void 0,Gu=Yu?Yu.toString:void 0;function Vu(e){if(typeof e=="string")return e;if(Vn(e))return gE(e,Vu)+"";if(Gs(e))return Gu?Gu.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var _E=/\s/;function pE(e){for(var t=e.length;t--&&_E.test(e.charAt(t)););return t}var EE=/^\s+/;function CE(e){return e&&e.slice(0,pE(e)+1).replace(EE,"")}function Ct(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var zu=NaN,RE=/^[-+]0x[0-9a-f]+$/i,IE=/^0b[01]+$/i,SE=/^0o[0-7]+$/i,OE=parseInt;function Ku(e){if(typeof e=="number")return e;if(Gs(e))return zu;if(Ct(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Ct(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=CE(e);var n=IE.test(e);return n||SE.test(e)?OE(e.slice(2),n?2:8):RE.test(e)?zu:+e}function Xu(e){return e}var vE="[object AsyncFunction]",wE="[object Function]",bE="[object GeneratorFunction]",AE="[object Proxy]";function ko(e){if(!Ct(e))return!1;var t=kr(e);return t==wE||t==bE||t==vE||t==AE}var Fo=Rn["__core-js_shared__"],qu=function(){var e=/[^.]+$/.exec(Fo&&Fo.keys&&Fo.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function TE(e){return!!qu&&qu in e}var yE=Function.prototype,NE=yE.toString;function ME(e){if(e!=null){try{return NE.call(e)}catch{}try{return e+""}catch{}}return""}var LE=/[\\^$.*+?()[\]{}|]/g,DE=/^\[object .+?Constructor\]$/,UE=Function.prototype,PE=Object.prototype,kE=UE.toString,FE=PE.hasOwnProperty,xE=RegExp("^"+kE.call(FE).replace(LE,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function BE(e){if(!Ct(e)||TE(e))return!1;var t=ko(e)?xE:DE;return t.test(ME(e))}function $E(e,t){return e==null?void 0:e[t]}function xo(e,t){var n=$E(e,t);return BE(n)?n:void 0}var Zu=Object.create,HE=function(){function e(){}return function(t){if(!Ct(t))return{};if(Zu)return Zu(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function WE(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function jE(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var YE=800,GE=16,VE=Date.now;function zE(e){var t=0,n=0;return function(){var r=VE(),s=GE-(r-n);if(n=r,s>0){if(++t>=YE)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function KE(e){return function(){return e}}var Vs=function(){try{var e=xo(Object,"defineProperty");return e({},"",{}),e}catch{}}(),XE=Vs?function(e,t){return Vs(e,"toString",{configurable:!0,enumerable:!1,value:KE(t),writable:!0})}:Xu,qE=zE(XE),ZE=9007199254740991,JE=/^(?:0|[1-9]\d*)$/;function Bo(e,t){var n=typeof e;return t=t==null?ZE:t,!!t&&(n=="number"||n!="symbol"&&JE.test(e))&&e>-1&&e%1==0&&e<t}function $o(e,t,n){t=="__proto__"&&Vs?Vs(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function zs(e,t){return e===t||e!==e&&t!==t}var QE=Object.prototype,e0=QE.hasOwnProperty;function Ju(e,t,n){var r=e[t];(!(e0.call(e,t)&&zs(r,n))||n===void 0&&!(t in e))&&$o(e,t,n)}function t0(e,t,n,r){var s=!n;n||(n={});for(var i=-1,o=t.length;++i<o;){var a=t[i],l=void 0;l===void 0&&(l=e[a]),s?$o(n,a,l):Ju(n,a,l)}return n}var Qu=Math.max;function n0(e,t,n){return t=Qu(t===void 0?e.length-1:t,0),function(){for(var r=arguments,s=-1,i=Qu(r.length-t,0),o=Array(i);++s<i;)o[s]=r[t+s];s=-1;for(var a=Array(t+1);++s<t;)a[s]=r[s];return a[t]=n(o),WE(e,this,a)}}function r0(e,t){return qE(n0(e,t,Xu),e+"")}var s0=9007199254740991;function eh(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=s0}function Ho(e){return e!=null&&eh(e.length)&&!ko(e)}function i0(e,t,n){if(!Ct(n))return!1;var r=typeof t;return(r=="number"?Ho(n)&&Bo(t,n.length):r=="string"&&t in n)?zs(n[t],e):!1}function th(e){return r0(function(t,n){var r=-1,s=n.length,i=s>1?n[s-1]:void 0,o=s>2?n[2]:void 0;for(i=e.length>3&&typeof i=="function"?(s--,i):void 0,o&&i0(n[0],n[1],o)&&(i=s<3?void 0:i,s=1),t=Object(t);++r<s;){var a=n[r];a&&e(t,a,r,i)}return t})}var o0=Object.prototype;function nh(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||o0;return e===n}function a0(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var l0="[object Arguments]";function rh(e){return Gn(e)&&kr(e)==l0}var sh=Object.prototype,c0=sh.hasOwnProperty,u0=sh.propertyIsEnumerable,Wo=rh(function(){return arguments}())?rh:function(e){return Gn(e)&&c0.call(e,"callee")&&!u0.call(e,"callee")};function h0(){return!1}var ih=typeof f=="object"&&f&&!f.nodeType&&f,oh=ih&&typeof module=="object"&&module&&!module.nodeType&&module,d0=oh&&oh.exports===ih,ah=d0?Rn.Buffer:void 0,f0=ah?ah.isBuffer:void 0,lh=f0||h0,m0="[object Arguments]",g0="[object Array]",_0="[object Boolean]",p0="[object Date]",E0="[object Error]",C0="[object Function]",R0="[object Map]",I0="[object Number]",S0="[object Object]",O0="[object RegExp]",v0="[object Set]",w0="[object String]",b0="[object WeakMap]",A0="[object ArrayBuffer]",T0="[object DataView]",y0="[object Float32Array]",N0="[object Float64Array]",M0="[object Int8Array]",L0="[object Int16Array]",D0="[object Int32Array]",U0="[object Uint8Array]",P0="[object Uint8ClampedArray]",k0="[object Uint16Array]",F0="[object Uint32Array]",xe={};xe[y0]=xe[N0]=xe[M0]=xe[L0]=xe[D0]=xe[U0]=xe[P0]=xe[k0]=xe[F0]=!0,xe[m0]=xe[g0]=xe[A0]=xe[_0]=xe[T0]=xe[p0]=xe[E0]=xe[C0]=xe[R0]=xe[I0]=xe[S0]=xe[O0]=xe[v0]=xe[w0]=xe[b0]=!1;function x0(e){return Gn(e)&&eh(e.length)&&!!xe[kr(e)]}function B0(e){return function(t){return e(t)}}var ch=typeof f=="object"&&f&&!f.nodeType&&f,Fr=ch&&typeof module=="object"&&module&&!module.nodeType&&module,$0=Fr&&Fr.exports===ch,jo=$0&&Hu.process,uh=function(){try{var e=Fr&&Fr.require&&Fr.require("util").types;return e||jo&&jo.binding&&jo.binding("util")}catch{}}(),hh=uh&&uh.isTypedArray,dh=hh?B0(hh):x0;function H0(e,t){var n=Vn(e),r=!n&&Wo(e),s=!n&&!r&&lh(e),i=!n&&!r&&!s&&dh(e),o=n||r||s||i,a=o?a0(e.length,String):[],l=a.length;for(var c in e)o&&(c=="length"||s&&(c=="offset"||c=="parent")||i&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Bo(c,l))||a.push(c);return a}function W0(e,t){return function(n){return e(t(n))}}function j0(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var Y0=Object.prototype,G0=Y0.hasOwnProperty;function V0(e){if(!Ct(e))return j0(e);var t=nh(e),n=[];for(var r in e)r=="constructor"&&(t||!G0.call(e,r))||n.push(r);return n}function fh(e){return Ho(e)?H0(e):V0(e)}var z0=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,K0=/^\w*$/;function X0(e,t){if(Vn(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||Gs(e)?!0:K0.test(e)||!z0.test(e)||t!=null&&e in Object(t)}var xr=xo(Object,"create");function q0(){this.__data__=xr?xr(null):{},this.size=0}function Z0(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var J0="__lodash_hash_undefined__",Q0=Object.prototype,eC=Q0.hasOwnProperty;function tC(e){var t=this.__data__;if(xr){var n=t[e];return n===J0?void 0:n}return eC.call(t,e)?t[e]:void 0}var nC=Object.prototype,rC=nC.hasOwnProperty;function sC(e){var t=this.__data__;return xr?t[e]!==void 0:rC.call(t,e)}var iC="__lodash_hash_undefined__";function oC(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=xr&&t===void 0?iC:t,this}function In(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}In.prototype.clear=q0,In.prototype.delete=Z0,In.prototype.get=tC,In.prototype.has=sC,In.prototype.set=oC;function aC(){this.__data__=[],this.size=0}function Ks(e,t){for(var n=e.length;n--;)if(zs(e[n][0],t))return n;return-1}var lC=Array.prototype,cC=lC.splice;function uC(e){var t=this.__data__,n=Ks(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():cC.call(t,n,1),--this.size,!0}function hC(e){var t=this.__data__,n=Ks(t,e);return n<0?void 0:t[n][1]}function dC(e){return Ks(this.__data__,e)>-1}function fC(e,t){var n=this.__data__,r=Ks(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function jt(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}jt.prototype.clear=aC,jt.prototype.delete=uC,jt.prototype.get=hC,jt.prototype.has=dC,jt.prototype.set=fC;var mh=xo(Rn,"Map");function mC(){this.size=0,this.__data__={hash:new In,map:new(mh||jt),string:new In}}function gC(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Xs(e,t){var n=e.__data__;return gC(t)?n[typeof t=="string"?"string":"hash"]:n.map}function _C(e){var t=Xs(this,e).delete(e);return this.size-=t?1:0,t}function pC(e){return Xs(this,e).get(e)}function EC(e){return Xs(this,e).has(e)}function CC(e,t){var n=Xs(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function on(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}on.prototype.clear=mC,on.prototype.delete=_C,on.prototype.get=pC,on.prototype.has=EC,on.prototype.set=CC;var RC="Expected a function";function Yo(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(RC);var n=function(){var r=arguments,s=t?t.apply(this,r):r[0],i=n.cache;if(i.has(s))return i.get(s);var o=e.apply(this,r);return n.cache=i.set(s,o)||i,o};return n.cache=new(Yo.Cache||on),n}Yo.Cache=on;var IC=500;function SC(e){var t=Yo(e,function(r){return n.size===IC&&n.clear(),r}),n=t.cache;return t}var OC=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,vC=/\\(\\)?/g,wC=SC(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(OC,function(n,r,s,i){t.push(s?i.replace(vC,"$1"):r||n)}),t});function bC(e){return e==null?"":Vu(e)}function gh(e,t){return Vn(e)?e:X0(e,t)?[e]:wC(bC(e))}function _h(e){if(typeof e=="string"||Gs(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function AC(e,t){t=gh(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[_h(t[n++])];return n&&n==r?e:void 0}function ph(e,t,n){var r=e==null?void 0:AC(e,t);return r===void 0?n:r}var Eh=W0(Object.getPrototypeOf,Object),TC="[object Object]",yC=Function.prototype,NC=Object.prototype,Ch=yC.toString,MC=NC.hasOwnProperty,LC=Ch.call(Object);function DC(e){if(!Gn(e)||kr(e)!=TC)return!1;var t=Eh(e);if(t===null)return!0;var n=MC.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Ch.call(n)==LC}function UC(){this.__data__=new jt,this.size=0}function PC(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function kC(e){return this.__data__.get(e)}function FC(e){return this.__data__.has(e)}var xC=200;function BC(e,t){var n=this.__data__;if(n instanceof jt){var r=n.__data__;if(!mh||r.length<xC-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new on(r)}return n.set(e,t),this.size=n.size,this}function zn(e){var t=this.__data__=new jt(e);this.size=t.size}zn.prototype.clear=UC,zn.prototype.delete=PC,zn.prototype.get=kC,zn.prototype.has=FC,zn.prototype.set=BC;var Rh=typeof f=="object"&&f&&!f.nodeType&&f,Ih=Rh&&typeof module=="object"&&module&&!module.nodeType&&module,$C=Ih&&Ih.exports===Rh,Sh=$C?Rn.Buffer:void 0;Sh&&Sh.allocUnsafe;function HC(e,t){return e.slice()}var Oh=Rn.Uint8Array;function WC(e){var t=new e.constructor(e.byteLength);return new Oh(t).set(new Oh(e)),t}function jC(e,t){var n=WC(e.buffer);return new e.constructor(n,e.byteOffset,e.length)}function YC(e){return typeof e.constructor=="function"&&!nh(e)?HE(Eh(e)):{}}function GC(e){return function(t,n,r){for(var s=-1,i=Object(t),o=r(t),a=o.length;a--;){var l=o[++s];if(n(i[l],l,i)===!1)break}return t}}var VC=GC(),Go=function(){return Rn.Date.now()},zC="Expected a function",KC=Math.max,XC=Math.min;function qC(e,t,n){var r,s,i,o,a,l,c=0,u=!1,h=!1,d=!0;if(typeof e!="function")throw new TypeError(zC);t=Ku(t)||0,Ct(n)&&(u=!!n.leading,h="maxWait"in n,i=h?KC(Ku(n.maxWait)||0,t):i,d="trailing"in n?!!n.trailing:d);function m(R){var b=r,y=s;return r=s=void 0,c=R,o=e.apply(y,b),o}function _(R){return c=R,a=setTimeout(A,t),u?m(R):o}function p(R){var b=R-l,y=R-c,$=t-b;return h?XC($,i-y):$}function I(R){var b=R-l,y=R-c;return l===void 0||b>=t||b<0||h&&y>=i}function A(){var R=Go();if(I(R))return B(R);a=setTimeout(A,p(R))}function B(R){return a=void 0,d&&r?m(R):(r=s=void 0,o)}function x(){a!==void 0&&clearTimeout(a),c=0,r=l=s=a=void 0}function Y(){return a===void 0?o:B(Go())}function O(){var R=Go(),b=I(R);if(r=arguments,s=this,l=R,b){if(a===void 0)return _(l);if(h)return clearTimeout(a),a=setTimeout(A,t),m(l)}return a===void 0&&(a=setTimeout(A,t)),o}return O.cancel=x,O.flush=Y,O}function Vo(e,t,n){(n!==void 0&&!zs(e[t],n)||n===void 0&&!(t in e))&&$o(e,t,n)}function ZC(e){return Gn(e)&&Ho(e)}function zo(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function JC(e){return t0(e,fh(e))}function QC(e,t,n,r,s,i,o){var a=zo(e,n),l=zo(t,n),c=o.get(l);if(c){Vo(e,n,c);return}var u=i?i(a,l,n+"",e,t,o):void 0,h=u===void 0;if(h){var d=Vn(l),m=!d&&lh(l),_=!d&&!m&&dh(l);u=l,d||m||_?Vn(a)?u=a:ZC(a)?u=jE(a):m?(h=!1,u=HC(l)):_?(h=!1,u=jC(l)):u=[]:DC(l)||Wo(l)?(u=a,Wo(a)?u=JC(a):(!Ct(a)||ko(a))&&(u=YC(l))):h=!1}h&&(o.set(l,u),s(u,l,r,i,o),o.delete(l)),Vo(e,n,u)}function Ko(e,t,n,r,s){e!==t&&VC(t,function(i,o){if(s||(s=new zn),Ct(i))QC(e,t,o,n,Ko,r,s);else{var a=r?r(zo(e,o),i,o+"",e,t,s):void 0;a===void 0&&(a=i),Vo(e,o,a)}},fh)}var eR=th(function(e,t,n,r){Ko(e,t,n,r)}),Xo=th(function(e,t,n){Ko(e,t,n)});function tR(e,t,n,r){if(!Ct(e))return e;t=gh(t,e);for(var s=-1,i=t.length,o=i-1,a=e;a!=null&&++s<i;){var l=_h(t[s]),c=n;if(l==="__proto__"||l==="constructor"||l==="prototype")return e;if(s!=o){var u=a[l];c=void 0,c===void 0&&(c=Ct(u)?u:Bo(t[s+1])?[]:{})}Ju(a,l,c),a=a[l]}return e}function nR(e,t,n){return e==null?e:tR(e,t,n)}const qo=Re.createIdentifier("univer.config-service");class vh{constructor(){C(this,"_configChanged$",new oe.Subject);C(this,"configChanged$",this._configChanged$.asObservable());C(this,"_config",new Map)}dispose(){this._config.clear(),this._configChanged$.complete()}getConfig(t){return this._config.get(t)}setConfig(t,n,r){var o;const{merge:s=!1}=r||{};let i=(o=this._config.get(t))!=null?o:{};s?i=Xo(i,n):i=n,this._config.set(t,i),this._configChanged$.next({[t]:i})}deleteConfig(t){return this._config.delete(t)}subscribeConfigValue$(t){return new oe.Observable(n=>{Object.prototype.hasOwnProperty.call(this._config,t)&&n.next(this._config.get(t));const r=this.configChanged$.pipe(oe.filter(s=>Object.prototype.hasOwnProperty.call(s,t))).subscribe(s=>n.next(s[t]));return()=>r.unsubscribe()})}}const Br="FOCUSING_UNIT",Kn="FOCUSING_SHEET",$r="FOCUSING_DOC",Hr="FOCUSING_SLIDE",rR="FOCUSING_EDITOR_BUT_HIDDEN",wh="EDITOR_ACTIVATED",sR="FOCUSING_EDITOR_INPUT_FORMULA",bh="FOCUSING_FX_BAR_EDITOR",iR="FOCUSING_UNIVER_EDITOR",oR="FOCUSING_EDITOR_INPUT_FORMULA",aR="FOCUSING_PANEL_EDITOR",lR="FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE",cR="FOCUSING_COMMON_DRAWINGS",uR="FORMULA_EDITOR_ACTIVATED";class Ah extends ze{constructor(){super(...arguments);C(this,"_error$",new oe.Subject);C(this,"error$",this._error$.asObservable())}dispose(){this._error$.complete()}emit(n){this._error$.next({errorKey:n})}}var Zo=(e=>(e.URL="URL",e.UUID="UUID",e.BASE64="BASE64",e))(Zo||{}),Th=(e=>(e.SUCCUSS="0",e.ERROR_EXCEED_SIZE="1",e.ERROR_IMAGE_TYPE="2",e.ERROR_UPLOAD_COUNT_LIMIT="3",e.ERROR_IMAGE="4",e))(Th||{});const Jo=Re.createIdentifier("core.image-io.service"),hR={version:"0.9.4"};function dR(e="",t=ar.ZH_CN,n=""){return{id:e,sheetOrder:[],name:n,appVersion:hR.version,locale:t,styles:{},sheets:{},resources:[]}}class yh{constructor(t={}){C(this,"_styles");C(this,"_cacheMap",new ur(1e5));this._styles=t,this._generateCacheMap()}each(t){return Object.entries(this._styles).forEach(t),this}search(t,n){if(this._cacheMap.has(n))return this._cacheMap.get(n);const r=this._getExistingStyleId(t);return r||"-1"}get(t){return typeof t!="string"?t:(t=String(t),this._styles[t])}add(t,n){const r=tt(6);return this._styles[r]=t,this._cacheMap.set(n,r),r}setValue(t){if(t==null)return;const n=JSON.stringify(t),r=this.search(t,n);return r!=="-1"?r:this.add(t,n)}toJSON(){return this._styles}getStyleByCell(t){let n;t&&Z.isObject(t.s)?n=t.s:n=(t==null?void 0:t.s)&&this.get(t.s);const r=t==null?void 0:t.interceptorStyle;return r?{...n,...r}:n}_generateCacheMap(){const{_styles:t,_cacheMap:n}=this;for(const r in t){const s=JSON.stringify(t[r]);n.set(s,r)}}_getExistingStyleId(t){const{_styles:n}=this;for(const r in n)if(Z.diffValue(n[r],t))return r;return null}}const fR=(e,t)=>t.length===e.length&&!e.some(n=>t.some(r=>!tn.equals(r,n))),mR=(e,t)=>t.length===e.length&&e.every((n,r)=>{const s=t[r];return s.unitId===n.unitId&&s.sheetId===n.sheetId&&tn.equals(n.range,s.range)}),Qo={t:0,b:2,l:2,r:2},gR=e=>({sbr:.6,sbo:e,spr:.6,spo:e}),Nh=90;function Wr(e,t,n={}){const r=e.length,{textRotation:s,paddingData:i,horizontalAlign:o=Ot.UNSPECIFIED,verticalAlign:a=hn.UNSPECIFIED,wrapStrategy:l=dn.UNSPECIFIED,cellValueType:c}=n,{t:u,r:h,b:d,l:m}=i||Qo,{vertexAngle:_,centerAngle:p}=Ph(s),I={id:"d",body:{dataStream:`${e}${_a}`,textRuns:[{ts:t,st:0,ed:r}],paragraphs:[{startIndex:r,paragraphStyle:{horizontalAlign:o}}],sectionBreaks:[{startIndex:r+1}]},documentStyle:{pageSize:{width:Number.POSITIVE_INFINITY,height:Number.POSITIVE_INFINITY},marginTop:u,marginBottom:d,marginRight:h,marginLeft:m,renderConfig:{horizontalAlign:o,verticalAlign:a,centerAngle:p,vertexAngle:_,wrapStrategy:l,cellValueType:c,zeroWidthParagraphBreak:1}},drawings:{},drawingsOrder:[]};return new At(I)}function _R(e){if(!e)return{};const{tr:t,td:n,ht:r,vt:s,tb:i,pd:o}=e;return{textRotation:t,textDirection:n,horizontalAlign:r,verticalAlign:s,wrapStrategy:i,paddingData:o}}function Mh(e){if(!e)return{};const{ff:t,fs:n,it:r,bl:s,ul:i,st:o,ol:a,cl:l}=e,c={};return t&&(c.ff=t),n&&(c.fs=n),r&&(c.it=r),s&&(c.bl=s),i&&(c.ul=i),o&&(c.st=o),a&&(c.ol=a),l&&(c.cl=l),c}function Lh(e,t,n){var i;const r=e.getBody();if((i=r.customRanges)!=null&&i.some(o=>o.rangeType===en.HYPERLINK))return;const s=Je.customRange.add({ranges:[{startOffset:0,endOffset:r.dataStream.length-1,collapsed:!1}],rangeId:n,rangeType:en.HYPERLINK,body:r,properties:{url:t,refId:n}});s&&Me.apply(r,s.serialize())}function Dh(e){return e!=null}const pR='"Helvetica Neue", Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Heiti SC", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif';function Uh(e){const t=st.ff,n=st.fs;if(!e){const h=`${n}pt ${t}`;return{fontCache:h,fontString:h,fontSize:n,originFontSize:n,fontFamily:t}}let r=kn.ITALIC;(e.it===0||e.it===void 0)&&(r=kn.NORMAL);let s=kn.BOLD;(e.bl===0||e.bl===void 0)&&(s=kn.NORMAL);let i=n;e.fs&&(i=Math.ceil(e.fs));let o=t;if(e.ff){let h=e.ff;h=h.replace(/"/g,"").replace(/'/g,""),h.indexOf(" ")>-1&&(h=`"${h}"`),h==null&&(h=t),o=h}const{va:a}=e;let l=i;if(a===$t.SUBSCRIPT||a===$t.SUPERSCRIPT){const h=ER(o,l),{sbr:d,spr:m}=h;l*=a===$t.SUBSCRIPT?d:m}const c=`${r} ${s} ${l}pt ${o}`,u=`${c}, ${pR} `;return{fontCache:c,fontString:u,fontSize:l,originFontSize:i,fontFamily:o}}function ER(e,t){return gR(t)}function Ph(e){const{a:t=0,v:n=ae.FALSE}=e||{a:0,v:ae.FALSE};let r=0,s=t;return n===ae.TRUE&&(r=Nh,s=Nh),{centerAngle:r,vertexAngle:s}}class CR{constructor(t,n){C(this,"_columnData",{});this._config=t,this._columnData=n}getColumnData(){return this._columnData}getColVisible(t){const{_columnData:n}=this,r=n[t];return r?r.hd!==ae.TRUE:!0}getColumnStyle(t){var n;return(n=this._columnData[t])==null?void 0:n.s}setColumnStyle(t,n){const r=this.getColumnOrCreate(t);r.s=n}getHiddenCols(t=0,n=this.getSize()-1){const r=[];let s=!1,i=-1;for(let o=t;o<=n;o++){const a=this.getColVisible(o);s&&a?(s=!1,r.push({rangeType:pe.COLUMN,startColumn:i,endColumn:o-1,startRow:0,endRow:0})):!s&&!a&&(s=!0,i=o)}return s&&r.push({startRow:0,endRow:0,startColumn:i,endColumn:n,rangeType:pe.COLUMN}),r}getVisibleCols(t=0,n=this.getSize()-1){const r=[];let s=!1,i=-1;for(let o=t;o<=n;o++){const a=this.getColVisible(o);s&&!a?(s=!1,r.push({rangeType:pe.COLUMN,startColumn:i,endColumn:o-1,startRow:0,endRow:0})):!s&&a&&(s=!0,i=o)}return s&&r.push({startRow:0,endRow:0,startColumn:i,endColumn:n,rangeType:pe.COLUMN}),r}getColumnDatas(t,n){const r={};let s=0;for(let i=t;i<t+n;i++){const o=this.getColumn(i);r[s]=o!=null?o:{w:this._config.defaultColumnWidth,hd:ae.FALSE},s++}return r}getSize(){return Zt(this._columnData)}getColumnWidth(t){var n,r;return(r=(n=this._columnData[t])==null?void 0:n.w)!=null?r:this._config.defaultColumnWidth}setColumnWidth(t,n){const r=this._columnData[t];n===this._config.defaultColumnWidth?r&&(delete r.w,Object.keys(r).length===0&&delete this._columnData[t]):this._columnData[t]=r?{...r,w:n}:{w:n}}getColumn(t){return this._columnData[t]}removeColumn(t){delete this._columnData[t]}getColumnOrCreate(t){const{_columnData:n}=this,r=n[t];if(r)return r;const s={};return this._columnData[t]=s,s}setCustomMetadata(t,n){const r=this.getColumn(t);r&&(r.custom=n)}getCustomMetadata(t){var n;return(n=this.getColumn(t))==null?void 0:n.custom}}const RR=2e3;class IR{constructor(t,n,r){C(this,"_rowData");this._config=t,this._viewModel=n,this._rowData=r}getRowData(){return this._rowData}getRowStyle(t){var n;return(n=this._rowData[t])==null?void 0:n.s}setRowStyle(t,n){const r=this.getRowOrCreate(t);r.s=n}getRowDatas(t,n){const r={};let s=0;for(let i=t;i<t+n;i++){const o=this.getRow(i);r[s]=o!=null?o:{h:this._config.defaultRowHeight,hd:ae.FALSE},s++}return r}getRowHeight(t,n=1){const{_rowData:r}=this,s=this._config;let i=0;for(let o=0;o<n;o++){const a=r[o+t]||{hd:ae.FALSE,h:s.defaultRowHeight},{ia:l,ah:c,h:u=s.defaultRowHeight}=a;i+=(l==null||l===ae.TRUE)&&typeof c=="number"?c:u}return i}setRowHeight(t,n){const r=this._rowData[t];if(n===this._config.defaultRowHeight)r&&(delete r.h,Object.keys(r).length===0&&delete this._rowData[t]);else{const s=Math.min(n,RR);this._rowData[t]=r?{...r,h:s}:{h:s}}}getRow(t){return this._rowData[t]}removeRow(t){delete this._rowData[t]}getRowOrCreate(t){const{_rowData:n}=this,r=n[t];if(r)return r;const s={};return n[t]=s,s}getHiddenRows(t=0,n=this.getSize()-1){const r=[];let s=!1,i=-1;for(let o=t;o<=n;o++){const a=this.getRowRawVisible(o);s&&a?(s=!1,r.push({startRow:i,endRow:o-1,startColumn:0,endColumn:0,rangeType:pe.ROW})):!s&&!a&&(s=!0,i=o)}return s&&r.push({startRow:i,endRow:n,startColumn:0,endColumn:0,rangeType:pe.ROW}),r}getVisibleRows(t=0,n=this.getSize()-1){const r=[];let s=!1,i=-1;for(let o=t;o<=n;o++){const a=this.getRowRawVisible(o);s&&!a?(s=!1,r.push({startRow:i,endRow:o-1,startColumn:0,endColumn:0,rangeType:pe.ROW})):!s&&a&&(s=!0,i=o)}return s&&r.push({startRow:i,endRow:n,startColumn:0,endColumn:0,rangeType:pe.ROW}),r}getRowRawVisible(t){const n=this.getRow(t);return n?n.hd!==ae.TRUE:!0}getSize(){return Zt(this._rowData)}setCustomMetadata(t,n){const r=this.getRow(t);r&&(r.custom=n)}getCustomMetadata(t){var n;return(n=this.getRow(t))==null?void 0:n.custom}}const SR="DEFAULT_WORKSHEET_ROW_COUNT",kh=1e3,OR="DEFAULT_WORKSHEET_COLUMN_COUNT",Fh=20,vR="DEFAULT_WORKSHEET_ROW_HEIGHT",xh=24,wR="DEFAULT_WORKSHEET_COLUMN_WIDTH",Bh=88,bR="DEFAULT_WORKSHEET_ROW_TITLE_WIDTH",$h=46,AR="DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT",Hh=20;function Wh(e){const t={name:"Sheet1",id:"sheet-01",tabColor:"",hidden:ae.FALSE,rowCount:kh,columnCount:Fh,zoomRatio:1,freeze:{xSplit:0,ySplit:0,startRow:-1,startColumn:-1},scrollTop:0,scrollLeft:0,defaultColumnWidth:Bh,defaultRowHeight:xh,mergeData:[],cellData:{},rowData:{},columnData:{},showGridlines:ae.TRUE,rowHeader:{width:$h,hidden:ae.FALSE},columnHeader:{height:Hh,hidden:ae.FALSE},rightToLeft:ae.FALSE};return Object.keys(t).forEach(n=>{const r=n;typeof e[r]>"u"&&(e[r]=t[r])}),e}class TR extends ze{constructor(n){super();C(this,"_cellCache",new Map);C(this,"_rowCache",new Map);C(this,"_columnCache",new Map);C(this,"_hasRow",!1);C(this,"_hasColumn",!1);C(this,"_hasAll",!1);C(this,"_allIndex",-1);C(this,"_mergeData");C(this,"_rangeMap",new ur(5e4));C(this,"_skeletonCache",new ur(5e4));this._init(n.concat())}_init(n){this._mergeData=n,this._createCache(n)}_clearCache(){this._cellCache.clear(),this._rowCache.clear(),this._columnCache.clear(),this._hasAll=!1,this._allIndex=-1,this._rangeMap.clear(),this._skeletonCache.clear(),this._hasColumn=!1,this._hasRow=!1}_createCache(n){let r=0;for(const s of n){const{rangeType:i}=s;i===pe.ROW?this._createRowCache(s,r):i===pe.COLUMN?this._createColumnCache(s,r):i===pe.ALL?this._createCellAllCache(r):this._createCellCache(s,r),r++}}rebuild(n){this._clearCache(),this._init(n.concat())}_createRowCache(n,r){const{startRow:s,endRow:i}=n;for(let o=s;o<=i;o++)this._rowCache.set(o,r),this._hasRow=!0}_createColumnCache(n,r){const{startColumn:s,endColumn:i}=n;for(let o=s;o<=i;o++)this._columnCache.set(o,r),this._hasColumn=!0}_createCellAllCache(n){this._hasAll=!0,this._allIndex=n}_createCellCache(n,r){for(let s=n.startRow;s<=n.endRow;s++){let i=this._cellCache.get(s);i==null&&(i=new Map,this._cellCache.set(s,i));for(let o=n.startColumn;o<=n.endColumn;o++)i.set(o,r)}}add(n){this._mergeData.push(n),this._clearCache(),this._createCache(this._mergeData)}remove(n,r){const s=this._getMergeDataIndex(n,r);s!==-1&&(this._mergeData.splice(s,1),this._clearCache(),this._createCache(this._mergeData))}getMergedCell(n,r){const s=this._getMergeDataIndex(n,r);return s!==-1?this._mergeData[s]:null}getMergeDataIndex(n,r){return this._getMergeDataIndex(n,r)}isRowContainsMergedCell(n){return this._hasAll||!Z.isEmptyObject(this._columnCache)?!0:this._mergeData.some(r=>r.startRow<=n&&n<=r.endRow)}isColumnContainsMergedCell(n){return this._hasAll||!Z.isEmptyObject(this._rowCache)?!0:this._mergeData.some(r=>r.startColumn<=n&&n<=r.endColumn)}getMergedCellRange(n,r,s,i){const o=[],a=`${n}-${r}-${s}-${i}`;if(this._rangeMap.has(a))return this._getRangeFromCache(a);let l=0;const c=[];for(const u of this._mergeData||[])tn.intersects(u,{startRow:n,endRow:s,startColumn:r,endColumn:i})&&(o.push({...u}),c.push(l)),l++;return this._rangeMap.set(a,c),o}getMergedCellRangeForSkeleton(n,r,s,i){const o=[],a=this._mergeData,l=`${n}-${r}-${s}-${i}`;if(this._skeletonCache.has(l))return this._getSkeletonRangeFromCache(l);const c=[];for(let u=0;u<a.length;u++){const{startRow:h,endRow:d,startColumn:m,endColumn:_}=a[u];for(let p=n;p<=s;p++){let I=!1;for(let A=r;A<=i;A++)if(p>=h&&p<=d&&A>=m&&A<=_){o.push({startRow:h,endRow:d,startColumn:m,endColumn:_}),c.push(u),I=!0;break}if(I)break}}return this._skeletonCache.set(l,c),o}_getRangeFromCache(n){const r=this._rangeMap.get(n)||[],s=[];for(const i of r)s.push({...this._mergeData[i]});return s}_getSkeletonRangeFromCache(n){const r=this._skeletonCache.get(n)||[],s=[];for(const i of r)s.push({...this._mergeData[i]});return s}_getMergeDataIndex(n,r){var i;if(this._hasAll)return this._allIndex;if(this._hasRow){const o=this._rowCache.get(n);if(o!==void 0)return o}if(this._hasColumn){const o=this._columnCache.get(r);if(o!==void 0)return o}const s=(i=this._cellCache.get(n))==null?void 0:i.get(r);return s!==void 0?s:-1}getMergeDataSnapshot(){return this._mergeData}dispose(){this._clearCache(),this._mergeData=[]}}class jh extends ze{constructor(n){super();C(this,"_cellContentInterceptor",null);C(this,"_rowFilteredInterceptor",null);this.getRawCell=n}dispose(){super.dispose(),this._cellContentInterceptor=null,this._rowFilteredInterceptor=null}getCell(n,r,s,i){return this._cellContentInterceptor?this._cellContentInterceptor.getCell(n,r,bn.Value|bn.Style,s,i):this.getRawCell(n,r)}getCellValueOnly(n,r){return this._cellContentInterceptor?this._cellContentInterceptor.getCell(n,r,bn.Value):this.getRawCell(n,r)}getCellStyleOnly(n,r){return this._cellContentInterceptor?this._cellContentInterceptor.getCell(n,r,bn.Style):this.getRawCell(n,r)}getRowFiltered(n){var r,s;return(s=(r=this._rowFilteredInterceptor)==null?void 0:r.getRowFiltered(n))!=null?s:!1}registerCellContentInterceptor(n){if(this._cellContentInterceptor)throw new Error("[SheetViewModel]: Interceptor already registered.");return this._cellContentInterceptor=n,je(()=>this._cellContentInterceptor=null)}registerRowFilteredInterceptor(n){if(this._rowFilteredInterceptor)throw new Error("[SheetViewModel]: Interceptor already registered.");return this._rowFilteredInterceptor=n,je(()=>this._rowFilteredInterceptor=null)}}const Yh={isDeepClone:!1,displayRawFormula:!1,ignoreTextRotation:!1};class jr{constructor(t,n,r){C(this,"_sheetId");C(this,"_snapshot");C(this,"_cellData");C(this,"_rowManager");C(this,"_columnManager");C(this,"_viewModel");C(this,"_spanModel");C(this,"_isRowStylePrecedeColumnStyle",!0);C(this,"_getCellHeight");var a;this.unitId=t,this._styles=r,this._snapshot=Wh(n);const{columnData:s,rowData:i,cellData:o}=this._snapshot;this._sheetId=(a=this._snapshot.id)!=null?a:tt(6),this._cellData=new ct(o),this._viewModel=new jh((l,c)=>this.getCellRaw(l,c)),this._rowManager=new IR(this._snapshot,this._viewModel,i),this._columnManager=new CR(this._snapshot,s),this._spanModel=new TR(this._snapshot.mergeData)}__interceptViewModel(t){t(this._viewModel)}__registerGetCellHeight(t){return this._getCellHeight=t,je(()=>{this._getCellHeight=null})}getSnapshot(){return this._snapshot}getCellHeight(t,n){return this._getCellHeight?this._getCellHeight(t,n):this._snapshot.defaultRowHeight}setMergeData(t){this._snapshot.mergeData=t,this.getSpanModel().rebuild(t)}getSpanModel(){return this._spanModel}setIsRowStylePrecedeColumnStyle(t){this._isRowStylePrecedeColumnStyle=t}getStyleDataByHash(t){return{...this._styles.get(t)}}setStyleData(t){return this._styles.setValue(t)}getColumnStyle(t,n=!1){return n?this._columnManager.getColumnStyle(t):this._styles.get(this._columnManager.getColumnStyle(t))}setColumnStyle(t,n){this._columnManager.setColumnStyle(t,n)}getRowStyle(t,n=!1){return n?this._rowManager.getRowStyle(t):this._styles.get(this._rowManager.getRowStyle(t))}setRowStyle(t,n){this._rowManager.setRowStyle(t,n)}getDefaultCellStyle(){return this._snapshot.defaultStyle}getDefaultCellStyleInternal(){const t=this._snapshot.defaultStyle;return this._styles.get(t)}setDefaultCellStyle(t){this._snapshot.defaultStyle=t}getCellStyle(t,n){const r=this.getCell(t,n);if(r){const s=r.s;return typeof s=="string"?this._styles.get(s):s}return null}getComposedCellStyle(t,n,r){const s=this.getDefaultCellStyleInternal(),i=this.getRowStyle(t),o=this.getColumnStyle(n),a=this.getCell(t,n),l=this._styles.getStyleByCell(a);return(r!=null?r:this._isRowStylePrecedeColumnStyle)?cr(s,o,i,a==null?void 0:a.themeStyle,l):cr(s,i,o,a==null?void 0:a.themeStyle,l)}getComposedCellStyleByCellData(t,n,r,s){const i=this.getDefaultCellStyleInternal(),o=this.getRowStyle(t),a=this.getColumnStyle(n),l=this._styles.getStyleByCell(r);return(s!=null?s:this._isRowStylePrecedeColumnStyle)?cr(i,a,o,r==null?void 0:r.themeStyle,l):cr(i,o,a,r==null?void 0:r.themeStyle,l)}getCellMatrix(){return this._cellData}getCellMatrixPrintRange(){const t=this.getCellMatrix(),n=this.getMergeData();let r=-1,s=-1,i=-1,o=-1,a=!1,l=!1;return t.forEach((c,u)=>{Object.keys(u).forEach(h=>{const d=+h,m=t.getValue(c,d),_=m!=null&&m.s?this._styles.get(m.s):null,p=(_==null?void 0:_.bd)&&(_.bd.b||_.bd.l||_.bd.r||_.bd.t||_.bd.bc_tr||_.bd.bl_tr||_.bd.ml_tr||_.bd.tl_bc||_.bd.tl_br||_.bd.tl_mr);(m&&(m.v||m.p)||_!=null&&_.bg||p)&&(a?r=Math.min(r,c):(r=c,a=!0),s=Math.max(s,c),l?i=Math.min(i,d):(l=!0,i=d),o=Math.max(o,d))})}),n.forEach(c=>{a?r=Math.min(r,c.startRow):(r=c.startRow,a=!0),s=Math.max(s,c.endRow),l?i=Math.min(i,c.startColumn):(i=c.startColumn,a=!0),o=Math.max(o,c.endColumn)}),!a||!l?null:{startColumn:i,startRow:r,endColumn:o,endRow:s}}getRowManager(){return this._rowManager}getUnitId(){return this.unitId}getSheetId(){return this._sheetId}getColumnManager(){return this._columnManager}getName(){return this._snapshot.name}clone(){const{_snapshot:t}=this,n=Z.deepClone(t);return new jr(this.unitId,n,this._styles)}getMergeData(){return this._spanModel.getMergeDataSnapshot()}getMergedCell(t,n){return this._spanModel.getMergedCell(t,n)}getMergedCellRange(t,n,r,s){return this._spanModel.getMergedCellRange(t,n,r,s)}isRowContainsMergedCell(t){return this._spanModel.isRowContainsMergedCell(t)}isColumnContainsMergedCell(t){return this._spanModel.isColumnContainsMergedCell(t)}getCellInfoInMergeData(t,n){const r=this.getMergedCell(t,n);let s=!1,i=!1,o=t,a=n,l=t,c=n;if(r){const{startRow:u,endRow:h,startColumn:d,endColumn:m}=r;t===u&&n===d?(o=h,a=m,l=u,c=d,i=!0):t>=u&&t<=h&&n>=d&&n<=m&&(o=h,a=m,l=u,c=d,s=!0)}return{actualRow:t,actualColumn:n,isMergedMainCell:i,isMerged:s,endRow:o,endColumn:a,startRow:l,startColumn:c}}getCell(t,n){return t<0||n<0?null:this._viewModel.getCell(t,n)}getCellValueOnly(t,n){return t<0||n<0?null:this._viewModel.getCellValueOnly(t,n)}getCellStyleOnly(t,n){return t<0||n<0?null:this._viewModel.getCellStyleOnly(t,n)}getCellRaw(t,n){return this.getCellMatrix().getValue(t,n)}getCellWithFilteredInterceptors(t,n,r,s){return this._viewModel.getCell(t,n,r,s)}getRowFiltered(t){return this._viewModel.getRowFiltered(t)}getRangeFilterRows(t){const n=[];for(let r=t.startRow;r<=t.endRow;r++)this.getRowFiltered(r)&&n.push(r);return n}getMatrixWithMergedCells(t,n,r,s,i=Tn.Raw){const o=this.getCellMatrix(),a=this._spanModel.getMergedCellRange(t,n,r,s),l=new ct;return po(t,r,n,s).forEach((c,u)=>{var d;let h;if(i===Tn.Raw)h=this.getCellRaw(c,u);else if(i===Tn.Intercepted)h=this.getCell(c,u);else if(i===Tn.Both){const m=this.getCellRaw(c,u);if(m){h={...m};const _=(d=this.getCell(c,u))==null?void 0:d.v;Dh(_)&&h&&(h.displayV=String(_))}}h&&l.setValue(c,u,h)}),a.forEach(c=>{const{startColumn:u,startRow:h,endColumn:d,endRow:m}=c;po(h,m,u,d).forEach((_,p)=>{_===h&&p===u&&l.setValue(_,p,{...o.getValue(_,p),rowSpan:m-h+1,colSpan:d-u+1}),(_!==h||p!==u)&&l.realDeleteValue(_,p)})}),l}getRange(t,n,r,s){return typeof t=="object"?new xn(this,t,{getStyles:()=>this._styles}):new xn(this,{startRow:t,startColumn:n,endColumn:s||n,endRow:r||t},{getStyles:()=>this._styles})}getScrollLeftTopFromSnapshot(){return{scrollLeft:this._snapshot.scrollLeft,scrollTop:this._snapshot.scrollTop}}getZoomRatio(){return this._snapshot.zoomRatio||1}getConfig(){return this._snapshot}getFreeze(){return this._snapshot.freeze}getMaxColumns(){const{_snapshot:t}=this,{columnCount:n}=t;return n}getMaxRows(){const{_snapshot:t}=this,{rowCount:n}=t;return n}getRowCount(){return this._snapshot.rowCount}setRowCount(t){this._snapshot.rowCount=t}getColumnCount(){return this._snapshot.columnCount}setColumnCount(t){this._snapshot.columnCount=t}isSheetHidden(){return this._snapshot.hidden}hasHiddenGridlines(){const{_snapshot:t}=this,{showGridlines:n}=t;return n===0}getGridlinesColor(){return this.getConfig().gridlinesColor}getTabColor(){const{_snapshot:t}=this,{tabColor:n}=t;return n}getColumnWidth(t){return this.getColumnManager().getColumnWidth(t)}getRowHeight(t){return this._viewModel.getRowFiltered(t)?0:this.getRowManager().getRowHeight(t)}isRowFiltered(t){return this._viewModel.getRowFiltered(t)}getRowVisible(t){return!this.isRowFiltered(t)&&this.getRowRawVisible(t)}getRowRawVisible(t){return this.getRowManager().getRowRawVisible(t)}getHiddenRows(t,n){const r=this.getMaxColumns()-1,s=this._rowManager.getHiddenRows(t,n);return s.forEach(i=>i.endColumn=r),s}getColVisible(t){return this._columnManager.getColVisible(t)}getHiddenCols(t,n){const r=this.getMaxRows()-1,s=this._columnManager.getHiddenCols(t,n);return s.forEach(i=>i.endRow=r),s}getVisibleRows(){const t=this.getRowCount();return this._rowManager.getVisibleRows(0,t-1)}getVisibleCols(){const t=this.getColumnCount();return this._columnManager.getVisibleCols(0,t-1)}isRightToLeft(){const{_snapshot:t}=this,{rightToLeft:n}=t;return n}getLastRowWithContent(){return this._cellData.getLength()-1}getLastColumnWithContent(){return this._cellData.getRange().endColumn}getDataRangeScope(){return this._cellData.getStartEndScope()}cellHasValue(t){return t&&(t.v!==void 0||t.f!==void 0||t.p!==void 0)}iterateByRow(t,n=!0){const{startRow:r,startColumn:s,endRow:i,endColumn:o}=t,a=this;return{[Symbol.iterator]:()=>{let l=r,c=s;return{next(){for(;;){if(c>o&&(l+=1,c=s),l>i)return{done:!0,value:void 0};const u=a.getCell(l,c),h=!u,d=a.getMergedCell(l,c);if(d){if(l!==d.startRow||c!==d.startColumn){c=d.endColumn+1;continue}if(h&&n){c=d.endColumn+1;continue}const _={row:l,col:c,value:u};return _.colSpan=d.endColumn-d.startColumn+1,_.rowSpan=d.endRow-d.startRow+1,c=d.endColumn+1,{done:!1,value:_}}if(h&&n)c+=1;else{const m={row:l,col:c,value:u};return c+=1,{done:!1,value:m}}}}}}}}iterateByColumn(t,n=!0,r=!0){const{startRow:s,startColumn:i,endRow:o,endColumn:a}=t,l=this;return{[Symbol.iterator]:()=>{let c=s,u=i;return{next(){for(;;){if(c>o&&(u+=1,c=s),u>a)return{done:!0,value:void 0};const h=l.getMergedCell(c,u);if(h){const _=c!==h.startRow,p=_||u!==h.startColumn;if(r&&p||!r&&_){c=h.endRow+1;continue}const I=l.getCell(h.startRow,h.startColumn);if(!I&&n){c=h.endRow+1;continue}const B={row:c,col:h.startColumn,value:I};return B.colSpan=h.endColumn-h.startColumn+1,B.rowSpan=h.endRow-h.startRow+1,c=h.endRow+1,{done:!1,value:B}}const d=l.getCell(c,u);if(!d&&n)c+=1;else{const _={row:c,col:u,value:d};return c+=1,{done:!1,value:_}}}}}}}}getCellDocumentModel(t,n,r=Yh){var p;if(!t)return;const{isDeepClone:s,displayRawFormula:i,ignoreTextRotation:o}={...Yh,...r};let a,l="document";const c=_R(n),u=o?st.tr:c.textRotation||st.tr;let h=c.horizontalAlign||st.ht;const d=c.verticalAlign||st.vt,m=c.wrapStrategy||st.tb,_=c.paddingData||Qo;if(t.f&&i)a=Wr(t.f.toString(),{},{verticalAlign:d}),h=st.ht;else if(t.p){const{centerAngle:I,vertexAngle:A}=Ph(u);a=this._updateConfigAndGetDocumentModel(s?Z.deepClone(t.p):t.p,h,_,{horizontalAlign:h,verticalAlign:d,centerAngle:I,vertexAngle:A,wrapStrategy:m,zeroWidthParagraphBreak:1})}else if(t.v!=null){const I=Mh(n);l=Uh(I).fontCache;let A=Gh(t);t.t===Xt.FORCE_STRING&&i&&(A=`'${A}`),a=Wr(A,I,{...c,textRotation:u,cellValueType:t.t})}return a&&t.linkUrl&&t.linkId&&Lh(a,t.linkUrl,t.linkId),{documentModel:a,fontString:l,textRotation:u,wrapStrategy:m,verticalAlign:d,horizontalAlign:h,paddingData:_,fill:(p=n==null?void 0:n.bg)==null?void 0:p.rgb}}_updateConfigAndGetDocumentModel(t,n,r,s){var o,a,l,c,u;if(!s||!((o=t.body)!=null&&o.dataStream))return;t.documentStyle||(t.documentStyle={}),t.documentStyle.marginTop=(a=r.t)!=null?a:0,t.documentStyle.marginBottom=(l=r.b)!=null?l:2,t.documentStyle.marginLeft=(c=r.l)!=null?c:2,t.documentStyle.marginRight=(u=r.r)!=null?u:2,t.documentStyle.pageSize={width:Number.POSITIVE_INFINITY,height:Number.POSITIVE_INFINITY},t.documentStyle.renderConfig={...t.documentStyle.renderConfig,...s};const i=t.body.paragraphs||[];for(const h of i)h.paragraphStyle||(h.paragraphStyle={}),h.paragraphStyle.horizontalAlign=n;return new At(t)}getBlankCellDocumentModel(t,n,r){const s=this.getComposedCellStyleByCellData(n,r,t),i=Mh(s),o=this.getCellDocumentModel(t,s,{ignoreTextRotation:!0});if(o!=null)return o.documentModel==null&&(o.documentModel=Wr("",i)),o;const a="";let l="document";const c=st.tr,u=st.ht,h=st.vt,d=st.tb,m=Qo;return l=Uh({}).fontCache,{documentModel:Wr(a,i),fontString:l,textRotation:c,wrapStrategy:d,verticalAlign:h,horizontalAlign:u,paddingData:m}}getCellDocumentModelWithFormula(t,n,r){const s=this.getComposedCellStyleByCellData(n,r,t);return this.getCellDocumentModel(t,s,{isDeepClone:!0,displayRawFormula:!0,ignoreTextRotation:!0})}getCustomMetadata(){return this._snapshot.custom}setCustomMetadata(t){this._snapshot.custom=t}}function Gh(e){var r,s;if(!e)return"";const t=(s=(r=e.p)==null?void 0:r.body)==null?void 0:s.dataStream;if(t)return Je.transform.getPlainText(t);const n=e.v;return typeof n=="string"?e.t===Xt.BOOLEAN?n.toUpperCase():n.replace(/[\r\n]/g,""):typeof n=="number"?e.t===Xt.BOOLEAN?n?"TRUE":"FALSE":n.toString():typeof n=="boolean"?n?"TRUE":"FALSE":""}function yR(e){if(e===null)return"";if(e!=null&&e.p){const t=e==null?void 0:e.p.body;if(t==null)return"";const n=t.dataStream;return Je.transform.getPlainText(n)}return e==null?void 0:e.v}var NR=Object.getOwnPropertyDescriptor,MR=(e,t,n,r)=>{for(var s=r>1?void 0:r?NR(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=o(s)||s);return s},LR=(e,t)=>(n,r)=>t(n,r,e);function DR(e,t){return`${e.getUnitId()}|${t.getSheetId()}`}f.Workbook=class extends Ps{constructor(n={},r){super();C(this,"type",we.UNIVER_SHEET);C(this,"_sheetCreated$",new oe.Subject);C(this,"sheetCreated$",this._sheetCreated$.asObservable());C(this,"_sheetDisposed$",new oe.Subject);C(this,"sheetDisposed$",this._sheetDisposed$.asObservable());C(this,"_activeSheet$",new oe.BehaviorSubject(null));C(this,"activeSheet$",this._activeSheet$.asObservable());C(this,"_worksheets");C(this,"_styles");C(this,"_snapshot");C(this,"_unitId");C(this,"_count");C(this,"_name$");C(this,"name$");this._logService=r;const s=dR();Z.isEmptyObject(n)?this._snapshot=s:this._snapshot=Z.commonExtend(s,n);const{styles:i}=this._snapshot;(this._snapshot.id==null||this._snapshot.id.length===0)&&(this._snapshot.id=tt(6)),this._unitId=this._snapshot.id,this._styles=new yh(i),this._count=1,this._worksheets=new Map,this._name$=new oe.BehaviorSubject(n.name||""),this.name$=this._name$.asObservable(),this._parseWorksheetSnapshots()}get _activeSheet(){return this._activeSheet$.getValue()}get name(){return this._name$.getValue()}static isIRangeType(n){return typeof n=="string"||"startRow"in n||"row"in n}dispose(){super.dispose(),this._sheetCreated$.complete(),this._sheetDisposed$.complete(),this._activeSheet$.complete(),this._name$.complete()}save(){return Z.deepClone(this._snapshot)}getSnapshot(){return this._snapshot}getName(){return this._snapshot.name}setName(n){this._name$.next(n),this._snapshot.name=n}getUnitId(){return this._unitId}getRev(){var n;return(n=this._snapshot.rev)!=null?n:1}incrementRev(){this._snapshot.rev=this.getRev()+1}setRev(n){this._snapshot.rev=n}addWorksheet(n,r,s){const{sheets:i,sheetOrder:o}=this._snapshot;if(i[n])return!1;i[n]=s,o.splice(r,0,n);const a=new jr(this._unitId,s,this._styles);return this._worksheets.set(n,a),this._sheetCreated$.next(a),!0}getSheetOrders(){return this._snapshot.sheetOrder}getWorksheets(){return this._worksheets}getActiveSpreadsheet(){return this}getStyles(){return this._styles}getConfig(){return this._snapshot}getIndexBySheetId(n){const{sheetOrder:r}=this._snapshot;return r.findIndex(s=>s===n)}getActiveSheet(n){if(!this._activeSheet&&typeof n>"u")throw new Error(`[Workbook]: no active Worksheet on Workbook ${this._unitId}!`);return this._activeSheet}ensureActiveSheet(){const n=this._activeSheet;if(n)return n;const r=this._snapshot.sheetOrder;for(let i=0,o=r.length;i<o;i++){const a=this._worksheets.get(r[i]);if(a&&a.isSheetHidden()!==ae.TRUE)return this.setActiveSheet(a),a}const s=this._worksheets.get(r[0]);return this.setActiveSheet(s),s}setActiveSheet(n){this._activeSheet$.next(n)}removeSheet(n){const r=this._worksheets.get(n);return r?(this._worksheets.delete(n),this._snapshot.sheetOrder.splice(this._snapshot.sheetOrder.indexOf(n),1),delete this._snapshot.sheets[n],this._sheetDisposed$.next(r),!0):!1}getActiveSheetIndex(){const{sheetOrder:n}=this._snapshot;return n.findIndex(r=>this._worksheets.get(r)===this._activeSheet)}getSheetSize(){return this._snapshot.sheetOrder.length}getSheets(){const{sheetOrder:n}=this._snapshot;return n.map(r=>this._worksheets.get(r))}getSheetsName(){const{sheetOrder:n}=this._snapshot,r=[];return n.forEach(s=>{const i=this._worksheets.get(s);i&&r.push(i.getName())}),r}getSheetIndex(n){const{sheetOrder:r}=this._snapshot;return r.findIndex(s=>n.getSheetId()===s)}getSheetBySheetName(n){const{sheetOrder:r}=this._snapshot,s=r.find(i=>this._worksheets.get(i).getName()===n);return this._worksheets.get(s)}getSheetBySheetId(n){return this._worksheets.get(n)}getSheetByIndex(n){const{sheetOrder:r}=this._snapshot;return this._worksheets.get(r[n])}getHiddenWorksheets(){return this.getSheets().filter(n=>n.getConfig().hidden===ae.TRUE).map(n=>n.getConfig().id)}getUnhiddenWorksheets(){return this.getSheets().filter(n=>n.getConfig().hidden!==ae.TRUE).map(n=>n.getConfig().id)}load(n){this._snapshot=n}checkSheetName(n){return this.getSheetsName().includes(n)}uniqueSheetName(n="Sheet1"){let r=n;for(;this.checkSheetName(r);)r=n+this._count,this._count++;return r}generateNewSheetName(n){let r=n+this._count;for(;this.checkSheetName(r);)r=n+this._count,this._count++;return r}_parseWorksheetSnapshots(){const{_snapshot:n,_worksheets:r}=this,{sheets:s,sheetOrder:i}=n;if(Z.isEmptyObject(s)){const o=tt();s[o]={id:o}}for(const o in s){const a=s[o],{name:l}=a;a.name=this.uniqueSheetName(l),a.name!==l&&this._logService.debug("[Workbook]",`The worksheet name ${l} is duplicated, we changed it to ${a.name}. Please fix the problem in your snapshot.`);const c=new jr(this._unitId,a,this._styles);r.set(o,c),i.includes(o)||i.push(o)}this.ensureActiveSheet()}getCustomMetadata(){return this._snapshot.custom}setCustomMetadata(n){this._snapshot.custom=n}},f.Workbook=MR([LR(1,_t)],f.Workbook);class ea extends Ps{constructor(n){var r;super();C(this,"type",we.UNIVER_SLIDE);C(this,"_activePage$",new oe.BehaviorSubject(null));C(this,"activePage$",this._activePage$.asObservable());C(this,"_name$");C(this,"name$");C(this,"_snapshot");C(this,"_unitId");this._snapshot={...Bc,...n},this._unitId=(r=this._snapshot.id)!=null?r:tt(6),this._name$=new oe.BehaviorSubject(this._snapshot.title),this.name$=this._name$.asObservable()}get _activePage(){var r,s;const n=this._activePage$.getValue();if(!n){const i=(r=this.getPageOrder())==null?void 0:r[0];return i?(s=this.getPages())==null?void 0:s[i]:null}return n}setName(n){var r;this._snapshot.title=n,this._name$.next(n),this._unitId=(r=this._snapshot.id)!=null?r:tt(6)}getRev(){return 0}incrementRev(){}setRev(n){}getSnapshot(){return this._snapshot}getUnitId(){return this._unitId}getPages(){var n;return(n=this._snapshot.body)==null?void 0:n.pages}getPageOrder(){var n;return(n=this._snapshot.body)==null?void 0:n.pageOrder}getPage(n){const r=this.getPages();return r==null?void 0:r[n]}getElementsByPage(n){var r;return(r=this.getPage(n))==null?void 0:r.pageElements}getElement(n,r){var s;return(s=this.getElementsByPage(n))==null?void 0:s[r]}getPageSize(){return this._snapshot.pageSize}getBlankPage(){const n=tt(6);return{id:n,pageType:fo.SLIDE,zIndex:10,title:n,description:"",pageBackgroundFill:{rgb:"rgb(255,255,255)"},pageElements:{}}}setActivePage(n){this._activePage$.next(n)}getActivePage(){return this._activePage}updatePage(n,r){this._snapshot.body&&(this._snapshot.body.pages[n]=r)}appendPage(n){var i;if(!this._snapshot.body)return;this._snapshot.body.pages[n.id]=n;const r=this._activePage,s=this._snapshot.body.pageOrder.indexOf((i=r==null?void 0:r.id)!=null?i:"");this._snapshot.body.pageOrder.splice(s+1,0,n.id)}}var UR=Object.getOwnPropertyDescriptor,PR=(e,t,n,r)=>{for(var s=r>1?void 0:r?UR(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=o(s)||s);return s},Vh=(e,t)=>(n,r)=>t(n,r,e);const Xn=Re.createIdentifier("univer.current");f.UniverInstanceService=class extends ze{constructor(n,r){super();C(this,"_unitsByType",new Map);C(this,"_createHandler");C(this,"_ctorByType",new Map);C(this,"_currentUnits",new Map);C(this,"_currentUnits$",new oe.BehaviorSubject(this._currentUnits));C(this,"currentUnits$",this._currentUnits$.asObservable());C(this,"_unitAdded$",new oe.Subject);C(this,"unitAdded$",this._unitAdded$.asObservable());C(this,"_unitDisposed$",new oe.Subject);C(this,"unitDisposed$",this._unitDisposed$.asObservable());C(this,"_focused$",new oe.BehaviorSubject(null));C(this,"focused$",this._focused$.asObservable());this._injector=n,this._contextService=r}dispose(){super.dispose(),this._focused$.complete()}__setCreateHandler(n){this._createHandler=n}createUnit(n,r,s){return this._createHandler(n,r,this._ctorByType.get(n),s)}registerCtorForType(n,r){return this._ctorByType.set(n,r),{dispose:()=>{this._ctorByType.delete(n)}}}getCurrentTypeOfUnit$(n){return this.currentUnits$.pipe(oe.map(r=>{var s;return(s=r.get(n))!=null?s:null}),oe.distinctUntilChanged())}getCurrentUnitForType(n){return this._currentUnits.get(n)}getCurrentUnitOfType(n){return this.getCurrentUnitForType(n)}setCurrentUnitForType(n){const r=this._getUnitById(n);if(!r)throw new Error(`[UniverInstanceService]: no document with unitId ${n}!`);this._currentUnits.set(r[1],r[0]),this._currentUnits$.next(this._currentUnits)}getTypeOfUnitAdded$(n){return this._unitAdded$.pipe(oe.filter(r=>r.type===n))}__addUnit(n,r){var a;const s=n.type;this._unitsByType.has(s)||this._unitsByType.set(s,[]);const i=this._unitsByType.get(s),o=n.getUnitId();if(i.findIndex(l=>l.getUnitId()===o)!==-1)throw new Error(`[UniverInstanceService]: cannot create a unit with the same unit id: ${o}.`);i.push(n),this._unitAdded$.next(n),((a=r==null?void 0:r.makeCurrent)==null||a)&&this.setCurrentUnitForType(n.getUnitId())}getTypeOfUnitDisposed$(n){return this.unitDisposed$.pipe(oe.filter(r=>r.type===n))}getUnit(n,r){var i;const s=(i=this._getUnitById(n))==null?void 0:i[0];return r&&(s==null?void 0:s.type)!==r?null:s}getCurrentUniverDocInstance(){return this.getCurrentUnitForType(we.UNIVER_DOC)}getUniverDocInstance(n){return this.getUnit(n,we.UNIVER_DOC)}getUniverSheetInstance(n){return this.getUnit(n,we.UNIVER_SHEET)}getAllUnitsForType(n){var r;return(r=this._unitsByType.get(n))!=null?r:[]}changeDoc(n,r){const s=this.getAllUnitsForType(we.UNIVER_DOC),i=s.find(o=>o.getUnitId()===n);if(i!=null){const o=s.indexOf(i);s.splice(o,1)}this.__addUnit(r)}get focused(){var r;const n=this._focused$.getValue();return n?(r=this._getUnitById(n))==null?void 0:r[0]:null}focusUnit(n){this._focused$.next(n),this.focused instanceof f.Workbook?(this._contextService.setContextValue(Br,!0),this._contextService.setContextValue($r,!1),this._contextService.setContextValue(Kn,!0),this._contextService.setContextValue(Hr,!1),this.setCurrentUnitForType(n)):this.focused instanceof At?(this._contextService.setContextValue(Br,!0),this._contextService.setContextValue($r,!0),this._contextService.setContextValue(Kn,!1),this._contextService.setContextValue(Hr,!1),this.setCurrentUnitForType(n)):this.focused instanceof ea?(this._contextService.setContextValue(Br,!0),this._contextService.setContextValue($r,!1),this._contextService.setContextValue(Kn,!1),this._contextService.setContextValue(Hr,!0),this.setCurrentUnitForType(n)):(this._contextService.setContextValue(Br,!1),this._contextService.setContextValue($r,!1),this._contextService.setContextValue(Kn,!1),this._contextService.setContextValue(Hr,!1))}getFocusedUnit(){return this.focused}getUnitType(n){const r=this._getUnitById(n);return r?r[1]:we.UNRECOGNIZED}disposeUnit(n){const r=this._getUnitById(n);if(!r)return!1;const[s,i]=r,o=this._unitsByType.get(i),a=o.indexOf(s);return o.splice(a,1),this._tryResetCurrentOnRemoval(n,i),this._tryResetFocusOnRemoval(n),this._unitDisposed$.next(s),!0}_tryResetCurrentOnRemoval(n,r){const s=this.getCurrentUnitForType(r);(s==null?void 0:s.getUnitId())===n&&(this._currentUnits.set(r,null),this._currentUnits$.next(this._currentUnits))}_tryResetFocusOnRemoval(n){var r;((r=this.focused)==null?void 0:r.getUnitId())===n&&this._focused$.next(null)}_getUnitById(n){for(const[r,s]of this._unitsByType){const i=s.find(o=>o.getUnitId()===n);if(i)return[i,r]}}},f.UniverInstanceService=PR([Vh(0,Re.Inject(Re.Injector)),Vh(1,An)],f.UniverInstanceService);var ke=(e=>(e[e.Starting=0]="Starting",e[e.Ready=1]="Ready",e[e.Rendered=2]="Rendered",e[e.Steady=3]="Steady",e))(ke||{});const zh={0:"Starting",1:"Ready",2:"Rendered",3:"Steady"};var kR=Object.getOwnPropertyDescriptor,FR=(e,t,n,r)=>{for(var s=r>1?void 0:r?kR(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=o(s)||s);return s},xR=(e,t)=>(n,r)=>t(n,r,e);class Kh extends Error{constructor(t){super(`[LifecycleService]: lifecycle stage "${zh[t]}" will never be reached!`),this.name="LifecycleUnreachableError"}}f.LifecycleService=class extends ze{constructor(n){super();C(this,"_lifecycle$",new oe.BehaviorSubject(ke.Starting));C(this,"lifecycle$",this._lifecycle$.asObservable());C(this,"_lock",!1);this._logService=n,this._reportProgress(ke.Starting)}get stage(){return this._lifecycle$.getValue()}set stage(n){if(this._lock)throw new Error("[LifecycleService]: cannot set new stage when related logic is all handled!");if(n<this.stage)throw new Error("[LifecycleService]: lifecycle stage cannot go backward!");n!==this.stage&&(this._lock=!0,this._reportProgress(n),this._lifecycle$.next(n),this._lock=!1)}dispose(){this._lifecycle$.complete(),super.dispose()}onStage(n){return oe.firstValueFrom(this.lifecycle$.pipe(oe.filter(r=>r>=n),li(r=>r===n),oe.map(()=>{}))).catch(r=>r.name==="EmptyError"?Promise.reject(new Kh(n)):Promise.reject(r))}subscribeWithPrevious(){return oe.merge(Xh(this.stage),this._lifecycle$.pipe(oe.skip(1))).pipe(li(n=>n===ke.Steady))}_reportProgress(n){this._logService.debug("[LifecycleService]",`lifecycle progressed to "${zh[n]}".`)}},f.LifecycleService=FR([xR(0,_t)],f.LifecycleService);function Xh(e){switch(e){case ke.Starting:return oe.of(ke.Starting);case ke.Ready:return oe.of(ke.Starting,ke.Ready);case ke.Rendered:return oe.of(ke.Starting,ke.Ready,ke.Rendered);default:return oe.of(ke.Starting,ke.Ready,ke.Rendered,ke.Steady)}}const BR=Re.createIdentifier("ILocalStorageService");class Sn extends ze{constructor(){super();C(this,"_currentLocale$",new oe.BehaviorSubject(ar.ZH_CN));C(this,"currentLocale$",this._currentLocale$.asObservable());C(this,"_locales",null);C(this,"localeChanged$",new oe.Subject);C(this,"t",(n,...r)=>{if(!this._locales)throw new Error("[LocaleService]: Locale not initialized");const s=n.split("."),i=this.resolveKeyPath(this._locales[this._currentLocale],s);if(typeof i=="string"){let o=i;return r.forEach((a,l)=>{o=o.replace(`{${l}}`,a)}),o}else return n});this.disposeWithMe(je(()=>{this._locales=null,this._currentLocale$.complete(),this.localeChanged$.complete()}))}get _currentLocale(){return this._currentLocale$.value}load(n){var r;this._locales=Xo((r=this._locales)!=null?r:{},n)}setLocale(n){this._currentLocale$.next(n),this.localeChanged$.next()}getLocales(){var n;return(n=this._locales)==null?void 0:n[this._currentLocale]}getCurrentLocale(){return this._currentLocale}resolveKeyPath(n,r){const s=r.shift();if(s&&n&&s in n){const i=n[s];return r.length>0&&(typeof i=="object"||Array.isArray(i))?this.resolveKeyPath(i,r):i}return null}}var $R=Object.getOwnPropertyDescriptor,HR=(e,t,n,r)=>{for(var s=r>1?void 0:r?$R(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=o(s)||s);return s},WR=(e,t)=>(n,r)=>t(n,r,e);f.MentionIOLocalService=class{constructor(t){this._userManagerService=t}async list(t){return{list:[{type:es.PERSON,mentions:[{objectType:es.PERSON,objectId:this._userManagerService.getCurrentUser().userID,label:this._userManagerService.getCurrentUser().name,metadata:{icon:this._userManagerService.getCurrentUser().avatar}}],metadata:{},title:"PEOPLE"}],page:t.page,size:t.size,total:1}}},f.MentionIOLocalService=HR([WR(0,Re.Inject(Ur))],f.MentionIOLocalService);const qh=Re.createIdentifier("univer.service.mention-io");var ta=(e=>(e.INIT="init",e.FETCHING="fetching",e.DONE="done",e))(ta||{});const Zh=Re.createIdentifier("univer.permission-service");class Jh extends ze{constructor(){super(...arguments);C(this,"_permissionPointMap",new Map);C(this,"_permissionPointUpdate$",new oe.Subject);C(this,"permissionPointUpdate$",this._permissionPointUpdate$.asObservable());C(this,"_showComponents",!0)}setShowComponents(n){this._showComponents=n}getShowComponents(){return this._showComponents}deletePermissionPoint(n){const r=this._permissionPointMap.get(n);r&&(r.complete(),this._permissionPointMap.delete(n))}addPermissionPoint(n){const r=n instanceof oe.BehaviorSubject,s=r?n.getValue():n;if(!s.id)return!1;if(this._permissionPointMap.get(s.id))throw new Error(`${s.id} PermissionPoint already exists`);return this._permissionPointMap.set(s.id,r?n:new oe.BehaviorSubject(s)),this._permissionPointUpdate$.next(s),!0}updatePermissionPoint(n,r){const s=this._permissionPointMap.get(n);if(!s)return;const i=s.getValue();i.value=r,i.status=ta.DONE,s.next(i),this._permissionPointUpdate$.next(i)}clearPermissionMap(){this._permissionPointMap.clear()}getPermissionPoint(n){const r=this._permissionPointMap.get(n);if(r)return r.getValue()}getPermissionPoint$(n){const r=this._permissionPointMap.get(n);if(r)return r}composePermission$(n){const r=n.map(s=>{var o;const i=(o=this._permissionPointMap)==null?void 0:o.get(s);if(!i)throw new Error(`[PermissionService]: ${s} permissionPoint does not exist!`);return i.asObservable()});return oe.combineLatest(r).pipe(Kr.map(s=>s))}composePermission(n){return n.map(s=>{var o;const i=(o=this._permissionPointMap)==null?void 0:o.get(s);if(!i)throw new Error(`[PermissionService]: ${s} permissionPoint does not exist!`);return i.getValue()})}getAllPermissionPoint(){const n=new Map;return this._permissionPointMap.forEach((r,s)=>{n.set(s,r)}),n}}function Qh(e,t){if(!t)return e;const n=[];for(const r of e){const s=t.find(([i])=>i===r[0]);if(s){if(s[1]===null)continue;n.push([r[0],s[1]])}else n.push(r)}return n}var jR=Object.getOwnPropertyDescriptor,YR=(e,t,n,r)=>{for(var s=r>1?void 0:r?jR(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=o(s)||s);return s},na=(e,t)=>(n,r)=>t(n,r,e);const GR=4,ed=Symbol("DependentOn");class ra extends ze{onStarting(){}onReady(){}onRendered(){}onSteady(){}getUnitType(){return this.constructor.type}getPluginName(){return this.constructor.pluginName}}C(ra,"pluginName"),C(ra,"type",we.UNIVER_UNKNOWN);class VR{constructor(){C(this,"_plugins",[])}addPlugin(t){this._plugins.push(t)}removePlugins(){const t=this._plugins.slice();return this._plugins.length=0,t}forEachPlugin(t){this._plugins.forEach(t)}}function zR(...e){return function(t){t[ed]=e}}f.PluginService=class{constructor(t,n,r){C(this,"_pluginRegistry",new Map);C(this,"_pluginStore",new VR);C(this,"_seenPlugins",new Set);C(this,"_loadedPlugins",new Set);C(this,"_loadedPluginTypes",new Set([we.UNIVER_UNKNOWN]));C(this,"_flushTimerByType",new Map);this._injector=t,this._lifecycleService=n,this._logService=r}dispose(){this._pluginStore.removePlugins().forEach(t=>t.dispose()),this._flushTimerByType.forEach(t=>clearTimeout(t))}registerPlugin(t,n){this._assertPluginValid(t);const r={plugin:t,options:n};this._pluginRegistry.set(t.pluginName,r),this._logService.debug("[PluginService]",`Plugin "${t.pluginName}" registered.`);const{type:s}=t;this._loadedPluginTypes.has(s)&&(s===we.UNIVER_UNKNOWN?this._loadFromPlugins([r]):this._flushType(s))}startPluginsForType(t){this._loadedPluginTypes.has(t)||this._loadPluginsForType(t)}_loadPluginsForType(t){const n=Array.from(this._pluginRegistry.keys()),r=[];n.forEach(s=>{const i=this._pluginRegistry.get(s);i.plugin.type===t&&r.push(i)}),this._loadFromPlugins(r),this._loadedPluginTypes.add(t)}_assertPluginValid(t){const{type:n,pluginName:r}=t;if(n===we.UNRECOGNIZED)throw new Error(`[PluginService]: invalid plugin type for ${t.name}. Please assign a "type" to your plugin.`);if(!r)throw new Error(`[PluginService]: no plugin name for ${t.name}. Please assign a "pluginName" to your plugin.`);if(this._seenPlugins.has(r))throw new Error(`[PluginService]: duplicated plugin name for "${r}". Maybe a plugin that dependents on "${r} has already registered it. In that case please register "${r}" before the that plugin.`);this._seenPlugins.add(t.pluginName)}_flushType(t){this._flushTimerByType.get(t)===void 0&&this._flushTimerByType.set(t,setTimeout(()=>{this._loadPluginsForType(t),this._flushTimerByType.delete(t)},GR))}_loadFromPlugins(t){const n=[],r=new Set,s=o=>{const{plugin:a}=o,{pluginName:l}=a;if(this._loadedPlugins.has(l)||r.has(l))return;r.add(l),this._pluginRegistry.delete(l);const c=a[ed];c&&c.forEach(u=>{const h=this._pluginRegistry.get(u.pluginName);if(h)s(h);else if(!this._seenPlugins.has(u.pluginName)&&!r.has(u.pluginName)){if(a.type===we.UNIVER_UNKNOWN&&u.type!==we.UNIVER_UNKNOWN)throw new Error(`[PluginService]: cannot register a plugin with Univer type that depends on a plugin with other type. The dependent is ${a.pluginName} and the dependency is ${u.pluginName}.`);a.type!==u.type&&u.type!==we.UNIVER_UNKNOWN&&this._logService.debug("[PluginService]",`Plugin "${l}" depends on "${u.pluginName}" which has different type.`),this._logService.debug("[PluginService]",`Plugin "${l}" depends on "${u.pluginName}" which is not registered. Univer will automatically register it with default configuration.`),this._assertPluginValid(u),s({plugin:u,options:void 0})}}),n.push(o)};t.forEach(o=>s(o));const i=n.map(o=>this._initPlugin(o.plugin,o.options));this._pluginsRunLifecycle(i)}_pluginsRunLifecycle(t){const n=this._lifecycleService.stage;if(Xh(n).subscribe(r=>this._runStage(t,r)),n!==ke.Steady){const r=this._lifecycleService.lifecycle$.pipe(oe.skip(1)).subscribe(s=>{this._runStage(t,s),s===ke.Steady&&r.unsubscribe()})}}_runStage(t,n){t.forEach(r=>{switch(n){case ke.Starting:r.onStarting();break;case ke.Ready:r.onReady();break;case ke.Rendered:r.onRendered();break;case ke.Steady:r.onSteady();break}})}_initPlugin(t,n){const r=this._injector.createInstance(t,n);return this._pluginStore.addPlugin(r),this._loadedPlugins.add(t.pluginName),this._logService.debug("[PluginService]",`Plugin "${r.getPluginName()}" loaded.`),r}},f.PluginService=YR([na(0,Re.Inject(Re.Injector)),na(1,Re.Inject(f.LifecycleService)),na(2,_t)],f.PluginService);const sa=Re.createIdentifier("resource-loader-service");var KR=Object.getOwnPropertyDescriptor,XR=(e,t,n,r)=>{for(var s=r>1?void 0:r?KR(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=o(s)||s);return s},qR=(e,t)=>(n,r)=>t(n,r,e);f.ResourceManagerService=class extends ze{constructor(n){super();C(this,"_resourceMap",new Map);C(this,"_register$",new oe.Subject);C(this,"register$",this._register$.asObservable());this._logService=n}getAllResourceHooks(){return[...this._resourceMap.values()]}getResources(n,r){return r?this.getResourcesByType(n,r):this.getAllResourceHooks().map(o=>{const a=o.toJson(n);return{name:o.pluginName,data:a}})}getResourcesByType(n,r){return this.getAllResourceHooks().filter(o=>o.businesses.includes(r)).map(o=>{const a=o.toJson(n);return{name:o.pluginName,data:a}})}registerPluginResource(n){const r=n.pluginName;if(this._resourceMap.has(r))throw new Error(`the pluginName is registered {${r}}`);return this._resourceMap.set(r,n),this._register$.next(n),je(()=>this._resourceMap.delete(r))}disposePluginResource(n){this._resourceMap.delete(n)}loadResources(n,r){this.getAllResourceHooks().forEach(s=>{var o;const i=(o=r==null?void 0:r.find(a=>a.name===s.pluginName))==null?void 0:o.data;if(i)try{const a=s.parseJson(i);s.onLoad(n,a)}catch(a){this._logService.error("[ResourceManagerService]","loadResources error",a)}})}unloadResources(n){this.getAllResourceHooks().forEach(r=>{r.onUnLoad(n)})}dispose(){this._register$.complete(),this._resourceMap.clear()}},f.ResourceManagerService=XR([qR(0,_t)],f.ResourceManagerService);class qs extends ze{constructor(){super();C(this,"_darkMode$",new oe.BehaviorSubject(!1));C(this,"darkMode$",this._darkMode$.asObservable());C(this,"_validColorCache",new Map);C(this,"_currentTheme",Xr.defaultTheme);C(this,"_currentTheme$",new oe.BehaviorSubject(this._currentTheme));C(this,"currentTheme$",this._currentTheme$.asObservable());this.disposeWithMe(je(()=>{this._currentTheme=Xr.defaultTheme,this._currentTheme$.complete(),this._darkMode$.complete()}))}get darkMode(){return this._darkMode$.getValue()}isValidThemeColor(n){if(this._validColorCache.has(n))return this._validColorCache.get(n);let r=!1;const s=n.split(".");if(s.length===1)r=n in Xr.defaultTheme;else if(s.length===2){const[i,o]=s;r=i in Xr.defaultTheme&&o in this._currentTheme[i]}return this._validColorCache.set(n,r),r}getCurrentTheme(){return this._currentTheme}setTheme(n){this._currentTheme=n,this._currentTheme$.next(n)}setDarkMode(n){this._darkMode$.next(n)}getColorFromTheme(n){return ph(this._currentTheme,n)}}var ZR=Object.getOwnPropertyDescriptor,JR=(e,t,n,r)=>{for(var s=r>1?void 0:r?ZR(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=o(s)||s);return s},ia=(e,t)=>(n,r)=>t(n,r,e);const Zs=Re.createIdentifier("univer.undo-redo.service"),QR=20;class td{dispose(){}async dispatchToHandlers(){return!1}}const nd="univer.command.redo",rd="univer.command.undo",sd=new class extends td{constructor(){super(...arguments);C(this,"type",rr.COMMAND);C(this,"id",rd)}handler(t){const n=t.get(Zs),r=n.pitchTopUndoElement();if(!r)return!1;const s=t.get(sr);return Qr(r.undoMutations,s)?(n.popUndoToRedo(),!0):!1}},id=new class extends td{constructor(){super(...arguments);C(this,"type",rr.COMMAND);C(this,"id",nd)}handler(t){const n=t.get(Zs),r=n.pitchTopRedoElement();if(!r)return!1;const s=t.get(sr);return Qr(r.redoMutations,s)?(n.popRedoToUndo(),!0):!1}};f.LocalUndoRedoService=class extends ze{constructor(n,r,s){super();C(this,"undoRedoStatus$");C(this,"_undoRedoStatus$",new oe.BehaviorSubject({undos:0,redos:0}));C(this,"_undoStacks",new Map);C(this,"_redoStacks",new Map);C(this,"_batchingStatus",new Map);this._univerInstanceService=n,this._commandService=r,this._contextService=s,this.undoRedoStatus$=this._undoRedoStatus$.asObservable(),this.disposeWithMe(this._commandService.registerCommand(sd)),this.disposeWithMe(this._commandService.registerCommand(id)),this.disposeWithMe(je(()=>this._undoRedoStatus$.complete())),this.disposeWithMe(je(this._univerInstanceService.focused$.subscribe(()=>this._updateStatus())))}pushUndoRedo(n){const{unitID:r}=n,s=this._getRedoStack(r,!0),i=this._getUndoStack(r,!0);if(s.length=0,this._batchingStatus.has(n.unitID)){const a=this._batchingStatus.get(n.unitID),l=this._pitchUndoElement(n.unitID);a===0||!l?(o(n),this._batchingStatus.set(n.unitID,1)):this._tryBatchingElements(l,n)}else o(n);function o(a){i.push(a),i.length>QR&&i.splice(0,1)}this._updateStatus()}clearUndoRedo(n){const r=this._getRedoStack(n);r&&(r.length=0);const s=this._getUndoStack(n);s&&(s.length=0),this._updateStatus()}pitchTopUndoElement(){const n=this._getFocusedUnitId();return this._pitchUndoElement(n)}pitchTopRedoElement(){const n=this._getFocusedUnitId();return this._pitchRedoElement(n)}_pitchUndoElement(n){const r=this._getUndoStack(n);return r!=null&&r.length?r[r.length-1]:null}_pitchRedoElement(n){const r=this._getRedoStack(n);return r!=null&&r.length?r[r.length-1]:null}popUndoToRedo(){const r=this._getUndoStackForFocused().pop();r&&(this._getRedoStackForFocused().push(r),this._updateStatus())}popRedoToUndo(){const r=this._getRedoStackForFocused().pop();r&&(this._getUndoStackForFocused().push(r),this._updateStatus())}rollback(n,r){const s=r||this._getFocusedUnitId(),i=this._getUndoStack(s),o=i==null?void 0:i[(i==null?void 0:i.length)-1];o&&o.id===n&&(i.pop(),Qr(o.undoMutations,this._commandService))}__tempBatchingUndoRedo(n){if(this._batchingStatus.has(n))throw new Error("[LocalUndoRedoService]: cannot batching undo redo twice at the same time!");return this._batchingStatus.set(n,0),je(()=>this._batchingStatus.delete(n))}_updateStatus(){var i,o;const n=this._getFocusedUnitId(),r=n&&((i=this._undoStacks.get(n))==null?void 0:i.length)||0,s=n&&((o=this._redoStacks.get(n))==null?void 0:o.length)||0;this._undoRedoStatus$.next({undos:r,redos:s})}_getUndoStack(n,r=!1){let s=this._undoStacks.get(n);return!s&&r&&(s=[],this._undoStacks.set(n,s)),s||null}_getRedoStack(n,r=!1){let s=this._redoStacks.get(n);return!s&&r&&(s=[],this._redoStacks.set(n,s)),s||null}_getUndoStackForFocused(){const n=this._getFocusedUnitId();if(!n)throw new Error("No focused univer instance!");return this._getUndoStack(n,!0)}_getRedoStackForFocused(){const n=this._getFocusedUnitId();if(!n)throw new Error("No focused univer instance!");return this._getRedoStack(n,!0)}_tryBatchingElements(n,r){n.redoMutations.push(...r.redoMutations),n.undoMutations.push(...r.undoMutations)}_getFocusedUnitId(){var o,a,l,c;let n="";const r=this._contextService.getContextValue(Kn),s=this._contextService.getContextValue(bh),i=this._contextService.getContextValue(wh);return r?s?n=ri:i?n=ni:n=(a=(o=this._univerInstanceService.getFocusedUnit())==null?void 0:o.getUnitId())!=null?a:"":n=(c=(l=this._univerInstanceService.getFocusedUnit())==null?void 0:l.getUnitId())!=null?c:"",n}},f.LocalUndoRedoService=JR([ia(0,Xn),ia(1,sr),ia(2,An)],f.LocalUndoRedoService);class od{constructor(t,n=100){C(this,"_imageCacheMap");this._injector=t,this._imageCacheMap=new ur(n)}_getImageCacheKey(t,n){return`${t}-${n}`}getImage(t,n,r,s){const i=this._getImageCacheKey(t,n),o=this._imageCacheMap.get(i);return o||((async()=>{const a=new Image,l=this._injector.has(Jo)?this._injector.get(Jo):null;if(t===Zo.UUID)try{a.src=await(l==null?void 0:l.getImage(n))||""}catch(c){console.error(c)}else a.src=n;a.onload=()=>{a.removeAttribute("data-error"),r==null||r()},a.onerror=()=>{a.setAttribute("data-error","true"),s==null||s()},this._imageCacheMap.set(i,a)})(),null)}}function eI(e){return!(e.length===0||e.length>31||e.startsWith("'")||e.endsWith("'")||/[:\\\/\?\*\[\]]/.test(e))}const ad=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],oa=1,Yr=8;class aa{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[n,r]=new Uint8Array(t,0,2);if(n!==219)throw new Error("Data does not appear to be in a KDBush format.");const s=r>>4;if(s!==oa)throw new Error(`Got v${s} data when expected v${oa}.`);const i=ad[r&15];if(!i)throw new Error("Unrecognized array type.");const[o]=new Uint16Array(t,2,1),[a]=new Uint32Array(t,4,1);return new aa(a,o,i,t)}constructor(t,n=64,r=Float64Array,s){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+n,2),65535),this.ArrayType=r,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;const i=ad.indexOf(this.ArrayType),o=t*2*this.ArrayType.BYTES_PER_ELEMENT,a=t*this.IndexArrayType.BYTES_PER_ELEMENT,l=(8-a%8)%8;if(i<0)throw new Error(`Unexpected typed array class: ${r}.`);s&&s instanceof ArrayBuffer?(this.data=s,this.ids=new this.IndexArrayType(this.data,Yr,t),this.coords=new this.ArrayType(this.data,Yr+a+l,t*2),this._pos=t*2,this._finished=!0):(this.data=new ArrayBuffer(Yr+o+a+l),this.ids=new this.IndexArrayType(this.data,Yr,t),this.coords=new this.ArrayType(this.data,Yr+a+l,t*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(oa<<4)+i]),new Uint16Array(this.data,2,1)[0]=n,new Uint32Array(this.data,4,1)[0]=t)}add(t,n){const r=this._pos>>1;return this.ids[r]=r,this.coords[this._pos++]=t,this.coords[this._pos++]=n,r}finish(){const t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return la(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,n,r,s){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:i,coords:o,nodeSize:a}=this,l=[0,i.length-1,0],c=[];for(;l.length;){const u=l.pop()||0,h=l.pop()||0,d=l.pop()||0;if(h-d<=a){for(let I=d;I<=h;I++){const A=o[2*I],B=o[2*I+1];A>=t&&A<=r&&B>=n&&B<=s&&c.push(i[I])}continue}const m=d+h>>1,_=o[2*m],p=o[2*m+1];_>=t&&_<=r&&p>=n&&p<=s&&c.push(i[m]),(u===0?t<=_:n<=p)&&(l.push(d),l.push(m-1),l.push(1-u)),(u===0?r>=_:s>=p)&&(l.push(m+1),l.push(h),l.push(1-u))}return c}within(t,n,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:s,coords:i,nodeSize:o}=this,a=[0,s.length-1,0],l=[],c=r*r;for(;a.length;){const u=a.pop()||0,h=a.pop()||0,d=a.pop()||0;if(h-d<=o){for(let I=d;I<=h;I++)cd(i[2*I],i[2*I+1],t,n)<=c&&l.push(s[I]);continue}const m=d+h>>1,_=i[2*m],p=i[2*m+1];cd(_,p,t,n)<=c&&l.push(s[m]),(u===0?t-r<=_:n-r<=p)&&(a.push(d),a.push(m-1),a.push(1-u)),(u===0?t+r>=_:n+r>=p)&&(a.push(m+1),a.push(h),a.push(1-u))}return l}}function la(e,t,n,r,s,i){if(s-r<=n)return;const o=r+s>>1;ld(e,t,o,r,s,i),la(e,t,n,r,o-1,1-i),la(e,t,n,o+1,s,1-i)}function ld(e,t,n,r,s,i){for(;s>r;){if(s-r>600){const c=s-r+1,u=n-r+1,h=Math.log(c),d=.5*Math.exp(2*h/3),m=.5*Math.sqrt(h*d*(c-d)/c)*(u-c/2<0?-1:1),_=Math.max(r,Math.floor(n-u*d/c+m)),p=Math.min(s,Math.floor(n+(c-u)*d/c+m));ld(e,t,n,_,p,i)}const o=t[2*n+i];let a=r,l=s;for(Gr(e,t,r,n),t[2*s+i]>o&&Gr(e,t,r,s);a<l;){for(Gr(e,t,a,l),a++,l--;t[2*a+i]<o;)a++;for(;t[2*l+i]>o;)l--}t[2*r+i]===o?Gr(e,t,r,l):(l++,Gr(e,t,l,s)),l<=n&&(r=l+1),n<=l&&(s=l-1)}}function Gr(e,t,n,r){ca(e,n,r),ca(t,2*n,2*r),ca(t,2*n+1,2*r+1)}function ca(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function cd(e,t,n,r){const s=e-n,i=t-r;return s*s+i*i}class tI{constructor(t=!1){C(this,"_tree",new Map);C(this,"_oneCellCache",new Map);C(this,"_kdTree",new Map);this._enableOneCellCache=t}dispose(){this.clear()}getTree(t,n){return this._tree.has(t)||this._tree.set(t,new Map),this._tree.get(t).has(n)||this._tree.get(t).set(n,new Ms),this._tree.get(t).get(n)}_getOneCellCache(t,n,r,s){return this._oneCellCache.has(t)||this._oneCellCache.set(t,new Map),this._oneCellCache.get(t).has(n)||this._oneCellCache.get(t).set(n,new Map),this._oneCellCache.get(t).get(n).has(r)||this._oneCellCache.get(t).get(n).set(r,new Map),this._oneCellCache.get(t).get(n).get(r).has(s)||this._oneCellCache.get(t).get(n).get(r).set(s,new Set),this._oneCellCache.get(t).get(n).get(r).get(s)}_removeOneCellCache(t,n,r,s,i){const o=this._oneCellCache.get(t);if(!o)return;const a=o.get(n);if(!a)return;const l=a.get(r);if(!l)return;const c=l.get(s);c&&c.delete(i)}_removeCellCacheByRange(t){const{unitId:n,sheetId:r,range:s,id:i}=t,o=this._oneCellCache.get(n);if(!o)return;const a=o.get(r);if(!a)return;const{startRow:l,startColumn:c,endRow:u,endColumn:h}=s;for(let d=l;d<=u;d++){const m=a.get(d);if(m)for(let _=c;_<=h;_++){const p=m.get(_);p&&p.delete(i)}}}_insertOneCellCache(t,n,r,s,i){this._getOneCellCache(t,n,r,s).add(i)}_getRdTreeItems(t){const n=[];for(const[r,s]of t)for(const[i,o]of s)n.push({x:i,y:r,ids:o});return n}_searchByOneCellCache(t){var _;const{unitId:n,sheetId:r,range:s}=t,{startRow:i,startColumn:o,endRow:a,endColumn:l}=s,c=(_=this._kdTree.get(n))==null?void 0:_.get(r);if(!c)return[];const{tree:u,items:h}=c,d=u.range(o,i,l,a),m=[];for(const p of d){const I=h[p];m.push(...Array.from(I.ids))}return m}openKdTree(){var t;for(const[n,r]of this._oneCellCache){this._kdTree.has(n)||this._kdTree.set(n,new Map);for(const[s,i]of r){const o=this._getRdTreeItems(i),a=new aa(o.length);(t=this._kdTree.get(n))==null||t.set(s,{tree:a,items:o});for(const l of o)a.add(l.x,l.y);a.finish()}}}closeKdTree(){var t;for(const[n,r]of this._oneCellCache)for(const[s,i]of r)(t=this._kdTree.get(n))==null||t.set(s,void 0)}insert(t){const{unitId:n,sheetId:r,range:s,id:i}=t;if(!n||n.length===0)return;let{startRow:o,endRow:a,startColumn:l,endColumn:c}=s;if(this._enableOneCellCache&&o===a&&l===c){this._insertOneCellCache(n,r,o,l,i);return}const u=this.getTree(n,r);Number.isNaN(o)&&(o=0),Number.isNaN(l)&&(l=0),Number.isNaN(a)&&(a=Number.POSITIVE_INFINITY),Number.isNaN(c)&&(c=Number.POSITIVE_INFINITY),u.insert({minX:l,minY:o,maxX:c,maxY:a,id:i})}bulkInsert(t){for(const n of t)this.insert(n)}*searchGenerator(t){var a;const{unitId:n,sheetId:r,range:s}=t;if(this._enableOneCellCache){const l=this._searchByOneCellCache(t);for(const c of l)yield c}const i=(a=this._tree.get(n))==null?void 0:a.get(r);if(!i)return;const o=i.search({minX:s.startColumn,minY:s.startRow,maxX:s.endColumn,maxY:s.endRow});for(const l of o)yield l.id}bulkSearch(t,n){const r=new Set;for(const s of t)for(const i of this.searchGenerator(s))(n==null?void 0:n.has(i))!==!0&&r.add(i);return r}removeById(t,n){var r,s;n?((r=this._tree.get(t))==null||r.delete(n),(s=this._oneCellCache.get(t))==null||s.delete(n)):(this._tree.delete(t),this._oneCellCache.delete(t))}_removeRTreeItem(t){const{unitId:n,sheetId:r,range:s,id:i}=t,o=this.getTree(n,r),a=o.search({minX:s.startColumn,minY:s.startRow,maxX:s.endColumn,maxY:s.endRow});for(let l=0;l<a.length;l++)a[l].id===i&&o.remove(a[l])}remove(t){const{unitId:n,sheetId:r,range:s,id:i}=t,{startRow:o,startColumn:a,endRow:l,endColumn:c}=s;this._enableOneCellCache?o===l&&a===c?this._removeOneCellCache(n,r,s.startRow,s.startColumn,i):(this._removeCellCacheByRange(t),this._removeRTreeItem(t)):this._removeRTreeItem(t)}bulkRemove(t){for(const n of t)this.remove(n)}clear(){this._tree.clear(),this._oneCellCache.clear()}toJSON(){const t={};return this._tree.forEach((n,r)=>{t[r]={},n.forEach((s,i)=>{t[r][i]=s.toJSON()})}),t}fromJSON(t){this._tree.clear();for(const n in t){this._tree.set(n,new Map);for(const r in t[n]){const s=new Ms;s.fromJSON(t[n][r]),this._tree.get(n).set(r,s)}}}}function nI(e){return new Promise(t=>setTimeout(t,e))}function rI(e=1){return new Promise(t=>{let n=0;const r=()=>{n++,n>=e?t():requestAnimationFrame(r)};requestAnimationFrame(r)})}var sI=Object.getOwnPropertyDescriptor,iI=(e,t,n,r)=>{for(var s=r>1?void 0:r?sI(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=o(s)||s);return s},oI=(e,t)=>(n,r)=>t(n,r,e);f.Skeleton=class extends ze{constructor(n){super();C(this,"_fontLocale");C(this,"_dirty",!0);this._localeService=n,this._localeInitial()}get dirty(){return this._dirty}getFontLocale(){return this._fontLocale}makeDirty(n){this._dirty=n}dispose(){super.dispose(),this._fontLocale=null}_localeInitial(){}},f.Skeleton=iI([oI(0,Re.Inject(Sn))],f.Skeleton);var aI=Object.getOwnPropertyDescriptor,lI=(e,t,n,r)=>{for(var s=r>1?void 0:r?aI(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=o(s)||s);return s},Js=(e,t)=>(n,r)=>t(n,r,e);f.SheetSkeleton=class extends f.Skeleton{constructor(n,r,s,i,o,a){super(s);C(this,"_worksheetData");C(this,"_renderRawFormula",!1);C(this,"_cellData");C(this,"_imageCacheMap");C(this,"_skipAutoHeightForMergedCells",!0);C(this,"_rowTotalHeight",0);C(this,"_columnTotalWidth",0);C(this,"_rowHeaderWidth",0);C(this,"_columnHeaderHeight",0);C(this,"_rowHeightAccumulation",[]);C(this,"_columnWidthAccumulation",[]);C(this,"_marginTop",0);C(this,"_marginLeft",0);C(this,"_scaleX");C(this,"_scaleY");C(this,"_scrollX");C(this,"_scrollY");this.worksheet=n,this._styles=r,this._contextService=i,this._configService=o,this._injector=a,this._worksheetData=this.worksheet.getConfig(),this._cellData=this.worksheet.getCellMatrix(),this._imageCacheMap=new od(this._injector),this.initConfig()}initConfig(){var n,r;this._skipAutoHeightForMergedCells=!((n=this._configService.getConfig(Ea))!=null&&n),this.worksheet.setIsRowStylePrecedeColumnStyle((r=this._configService.getConfig(pa))!=null?r:!1)}resetCache(){}getWorksheetConfig(){return this._worksheetData}getLocation(){return[this.worksheet.getUnitId(),this.worksheet.getSheetId()]}set columnHeaderHeight(n){this._columnHeaderHeight=n,this._worksheetData.columnHeader.height=n}set rowHeaderWidth(n){this._rowHeaderWidth=n,this._worksheetData.rowHeader.width=n}get rowHeightAccumulation(){return this._rowHeightAccumulation}get rowTotalHeight(){return this._rowTotalHeight}get columnWidthAccumulation(){return this._columnWidthAccumulation}get columnTotalWidth(){return this._columnTotalWidth}get rowHeaderWidth(){return this._rowHeaderWidth}get columnHeaderHeight(){return this._columnHeaderHeight}setMarginLeft(n){this._marginLeft=n}setMarginTop(n){this._marginTop=n}setScale(n,r){this._updateLayout(),this._scaleX=n,this._scaleY=r||n,this._updateLayout()}setScroll(n,r){Z.isDefine(n)&&(this._scrollX=n),Z.isDefine(r)&&(this._scrollY=r)}get scrollX(){return this._scrollX}get scrollY(){return this._scrollY}get scaleX(){return this._scaleX}get scaleY(){return this._scaleY}get rowHeaderWidthAndMarginLeft(){return this.rowHeaderWidth+this._marginLeft}get columnHeaderHeightAndMarginTop(){return this.columnHeaderHeight+this._marginTop}get imageCacheMap(){return this._imageCacheMap}_generateRowMatrixCache(n,r,s){let i=0;const o=[],a=r;for(let l=0;l<n;l++){let c=s;if(this.worksheet.getRowFiltered(l))c=0;else if(a[l]!=null){const u=a[l];if(!u)continue;const{h=s,ah:d,ia:m}=u;(m==null||m===ae.TRUE)&&typeof d=="number"?c=d:c=h,u.hd===ae.TRUE&&(c=0)}i+=c,o.push(i)}return{rowTotalHeight:i,rowHeightAccumulation:o}}_generateColumnMatrixCache(n,r,s){let i=0;const o=[],a=r;for(let l=0;l<n;l++){let c=s;if(a[l]!=null){const u=a[l];if(!u)continue;u.w!=null&&(c=u.w),u.hd===ae.TRUE&&(c=0)}i+=c,o.push(i)}return{columnTotalWidth:i,columnWidthAccumulation:o}}intersectMergeRange(n,r){return!!this.worksheet.getMergedCell(n,r)}_getOverflowBound(n,r,s,i,o=Ot.LEFT){let a=0;if(r>s){const l=this._columnWidthAccumulation.length-1;for(let c=r;c>=s;c--){const u=c,h=this.worksheet.getCell(n,u);if(!pi(h)&&u!==r||this.intersectMergeRange(n,u))return u===r?u:u+1>l?l:u+1;const{startX:d,endX:m}=qn(n,u,this.rowHeightAccumulation,this.columnWidthAccumulation);if(o===Ot.CENTER&&u===r?a+=(m-d)/2:a+=m-d,i<a)return u}return r}for(let l=r;l<=s;l++){const c=l,u=this.worksheet.getCell(n,c);if(!pi(u)&&c!==r||this.intersectMergeRange(n,c))return c===r?c:c-1<0?0:c-1;const{startX:h,endX:d}=qn(n,c,this.rowHeightAccumulation,this.columnWidthAccumulation);if(o===Ot.CENTER&&c===r?a+=(d-h)/2:a+=d-h,i<a)return c}return s}_updateLayout(){if(!this.dirty)return;const{rowData:n,columnData:r,defaultRowHeight:s,defaultColumnWidth:i,rowCount:o,columnCount:a,rowHeader:l,columnHeader:c}=this._worksheetData,{rowTotalHeight:u,rowHeightAccumulation:h}=this._generateRowMatrixCache(o,n,s),{columnTotalWidth:d,columnWidthAccumulation:m}=this._generateColumnMatrixCache(a,r,i);this._rowHeaderWidth=l.hidden!==ae.TRUE?this._dynamicallyUpdateRowHeaderWidth(l):0,this._columnHeaderHeight=c.hidden!==ae.TRUE?c.height:0,this._rowTotalHeight=u,this._rowHeightAccumulation=h,this._columnTotalWidth=d,this._columnWidthAccumulation=m,this.makeDirty(!1)}calculate(){return this.resetCache(),this._updateLayout(),this}resetRangeCache(n){}_dynamicallyUpdateRowHeaderWidth(n){const s=`${this.worksheet.getRowCount()}`.length*8;return Math.max(n.width,s)}_hasUnMergedCellInRow(n,r,s){if(!this.worksheet.getMergeData())return!1;for(let o=r;o<=s;o++){const{isMerged:a,isMergedMainCell:l}=this.worksheet.getCellInfoInMergeData(n,o);if(!a&&!l)return!0}return!1}expandRangeByMerge(n){let{startRow:r,startColumn:s,endRow:i,endColumn:o}=n;const a=this._worksheetData.mergeData;if(!a)return{startRow:r,startColumn:s,endRow:i,endColumn:o};let l=!0;const c=new ct;for(;l;){l=!1;for(let u=0;u<a.length;u++){const{startRow:h,startColumn:d,endRow:m,endColumn:_}=a[u];if(c.getValue(h,d))continue;Yc({startColumn:s,startRow:r,endColumn:o,endRow:i},{startColumn:d,startRow:h,endColumn:_,endRow:m})&&(r=Math.min(r,h),s=Math.min(s,d),i=Math.max(i,m),o=Math.max(o,_),c.setValue(h,d,!0),l=!0)}}return{startRow:r,startColumn:s,endRow:i,endColumn:o}}getColumnCount(){return this._columnWidthAccumulation.length}getRowCount(){return this._rowHeightAccumulation.length}_getCellMergeInfo(n,r){return this.worksheet.getCellInfoInMergeData(n,r)}getNoMergeCellPositionByIndex(n,r,s=!0){return this.getNoMergeCellWithCoordByIndex(n,r,s)}getNoMergeCellWithCoordByIndex(n,r,s=!0){const{rowHeightAccumulation:i,columnWidthAccumulation:o,rowHeaderWidthAndMarginLeft:a,columnHeaderHeightAndMarginTop:l}=this;let{startY:c,endY:u,startX:h,endX:d}=qn(n,r,i,o);return s&&(c+=l,u+=l,h+=a,d+=a),{startY:c,endY:u,startX:h,endX:d}}getNoMergeCellPositionByIndexWithNoHeader(n,r){const{rowHeightAccumulation:s,columnWidthAccumulation:i}=this,{startY:o,endY:a,startX:l,endX:c}=qn(n,r,s,i);return{startY:o,endY:a,startX:l,endX:c}}getRowIndexByOffsetY(n,r,s,i){var l;const{rowHeightAccumulation:o}=this;n=hd(n,r,s,this.columnHeaderHeightAndMarginTop);let a=ir(o,n,i==null?void 0:i.firstMatch);return i!=null&&i.closeFirst&&Math.abs(o[a]-n)<Math.abs(n-((l=o[a-1])!=null?l:0))&&(a=a+1),a}getColumnIndexByOffsetX(n,r,s,i){var c;const o=ud(n,r,s,this.rowHeaderWidthAndMarginLeft),{columnWidthAccumulation:a}=this;let l=ir(a,o,i==null?void 0:i.firstMatch);return i!=null&&i.closeFirst&&Math.abs(a[l]-o)<Math.abs(o-((c=a[l-1])!=null?c:0))&&(l=l+1),l}getCellIndexByOffset(n,r,s,i,o,a){const l=this.getRowIndexByOffsetY(r,i,o,a),c=this.getColumnIndexByOffsetX(n,s,o,a);return{row:l,column:c}}getCellByOffset(n,r,s,i,o){const a=this==null?void 0:this.getCellIndexByOffset(n,r,s,i,o,{firstMatch:!0});return a?this.worksheet.getCellInfoInMergeData(a.row,a.column):null}getCellWithCoordByIndex(n,r,s=!0){const{rowHeightAccumulation:i,columnWidthAccumulation:o,rowHeaderWidthAndMarginLeft:a,columnHeaderHeightAndMarginTop:l}=this,c=qn(n,r,i,o,this.worksheet.getCellInfoInMergeData(n,r)),{isMerged:u,isMergedMainCell:h}=c;let{startY:d,endY:m,startX:_,endX:p,mergeInfo:I}=c,A=a,B=l;return s===!1&&(A=0,B=0),d+=B,m+=B,_+=A,p+=A,I.startY+=B,I.endY+=B,I.startX+=A,I.endX+=A,{actualRow:n,actualColumn:r,startX:_,startY:d,endX:p,endY:m,isMerged:u,isMergedMainCell:h,mergeInfo:I}}getCellWithCoordByOffset(n,r,s,i,o,a){const{row:l,column:c}=this.getCellIndexByOffset(n,r,s,i,o,a);return this.getCellWithCoordByIndex(l,c)}getOffsetByColumn(n){const{columnWidthAccumulation:r,rowHeaderWidthAndMarginLeft:s}=this,i=r.length-1,o=r[n];return o!=null?o+s:n<0?s:r[i]+s}getOffsetByRow(n){const{rowHeightAccumulation:r,columnHeaderHeightAndMarginTop:s}=this,i=r.length-1,o=r[n];return o!=null?o+s:n<0?s:r[i]+s}getOffsetRelativeToRowCol(n,r){const s=ir(this.columnWidthAccumulation,n);let i=0;s===0?i=n:i=n-this._columnWidthAccumulation[s-1];const o=ir(this.rowHeightAccumulation,r);let a=0;return o===0?a=r:a=r-this._rowHeightAccumulation[o-1],{row:o,column:s,columnOffset:i,rowOffset:a}}_updateConfigAndGetDocumentModel(n,r,s,i){var a,l,c,u,h;if(!i||!((a=n.body)!=null&&a.dataStream))return;n.documentStyle||(n.documentStyle={}),n.documentStyle.marginTop=(l=s.t)!=null?l:0,n.documentStyle.marginBottom=(c=s.b)!=null?c:2,n.documentStyle.marginLeft=(u=s.l)!=null?u:2,n.documentStyle.marginRight=(h=s.r)!=null?h:2,n.documentStyle.pageSize={width:Number.POSITIVE_INFINITY,height:Number.POSITIVE_INFINITY},n.documentStyle.renderConfig={...n.documentStyle.renderConfig,...i};const o=n.body.paragraphs||[];for(const d of o)d.paragraphStyle||(d.paragraphStyle={}),d.paragraphStyle.horizontalAlign=r;return new At(n)}dispose(){super.dispose(),this._rowHeightAccumulation=[],this._columnWidthAccumulation=[],this._rowTotalHeight=0,this._columnTotalWidth=0,this._rowHeaderWidth=0,this._columnHeaderHeight=0,this._worksheetData=null,this._cellData=null,this._styles=null}},f.SheetSkeleton=lI([Js(2,Re.Inject(Sn)),Js(3,An),Js(4,qo),Js(5,Re.Inject(Re.Injector))],f.SheetSkeleton);function ua(e,t,n,r){const s=e-1,i=t-1,o=n[s]||0;let a=n[e];a==null&&(a=n[n.length-1]);const l=r[i]||0;let c=r[t];return c==null&&(c=r[r.length-1]),{startY:o,endY:a,startX:l,endX:c}}function cI(e,t,n,r){return ua(e,t,n,r)}function qn(e,t,n,r,s){e=Z.clamp(e,0,n.length-1),t=Z.clamp(t,0,r.length-1);let{startY:i,endY:o,startX:a,endX:l}=ua(e,t,n,r);if(!s)return{startY:i,endY:o,startX:a,endX:l,isMerged:!1,isMergedMainCell:!1,actualRow:e,actualColumn:t,mergeInfo:{startY:i,endY:o,startX:a,endX:l,startRow:e,startColumn:t,endRow:e,endColumn:t}};const{isMerged:c,isMergedMainCell:u,startRow:h,startColumn:d,endRow:m,endColumn:_}=s;let p={startRow:h,startColumn:d,endRow:m,endColumn:_,startY:i,endY:o,startX:a,endX:l};const I=n.length-1,A=r.length-1;if(c&&h!==-1&&d!==-1){const B=n[h-1]||0,x=n[m]||n[I],Y=r[d-1]||0,O=r[_]||r[A];p={...p,startY:B,endY:x,startX:Y,endX:O}}else if(!c&&m!==-1&&_!==-1){const B=n[m]||n[I],x=r[_]||r[A];p={...p,startY:i,endY:B,startX:a,endX:x}}return{isMerged:c,isMergedMainCell:u,actualRow:e,actualColumn:t,startY:i,endY:o,startX:a,endX:l,mergeInfo:p}}function ud(e,t,n,r){const{x:s}=n;return e/t+s-r}function hd(e,t,n,r){const{y:s}=n;return e=e/t+s-r,e}const uI=["script","style","meta","comment","link"];var dd=(e=>(e[e.INFO=0]="INFO",e[e.STOP=1]="STOP",e[e.WARNING=2]="WARNING",e))(dd||{}),fd=(e=>(e[e.DISABLED=0]="DISABLED",e[e.FULL_ALPHA=1]="FULL_ALPHA",e[e.FULL_HANGUL=2]="FULL_HANGUL",e[e.FULL_KATAKANA=3]="FULL_KATAKANA",e[e.HALF_ALPHA=4]="HALF_ALPHA",e[e.HALF_HANGUL=5]="HALF_HANGUL",e[e.HALF_KATAKANA=6]="HALF_KATAKANA",e[e.HIRAGANA=7]="HIRAGANA",e[e.NO_CONTROL=8]="NO_CONTROL",e[e.OFF=9]="OFF",e[e.ON=10]="ON",e))(fd||{}),md=(e=>(e.BETWEEN="between",e.EQUAL="equal",e.GREATER_THAN="greaterThan",e.GREATER_THAN_OR_EQUAL="greaterThanOrEqual",e.LESS_THAN="lessThan",e.LESS_THAN_OR_EQUAL="lessThanOrEqual",e.NOT_BETWEEN="notBetween",e.NOT_EQUAL="notEqual",e))(md||{}),gd=(e=>(e[e.TEXT=0]="TEXT",e[e.ARROW=1]="ARROW",e[e.CUSTOM=2]="CUSTOM",e))(gd||{}),_d=(e=>(e.VALID="valid",e.INVALID="invalid",e.VALIDATING="validating",e))(_d||{}),pd=(e=>(e.CUSTOM="custom",e.LIST="list",e.LIST_MULTIPLE="listMultiple",e.NONE="none",e.TEXT_LENGTH="textLength",e.DATE="date",e.TIME="time",e.WHOLE="whole",e.DECIMAL="decimal",e.CHECKBOX="checkbox",e.ANY="any",e))(pd||{}),hI=Object.getOwnPropertyDescriptor,dI=(e,t,n,r)=>{for(var s=r>1?void 0:r?hI(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=o(s)||s);return s},Ed=(e,t)=>(n,r)=>t(n,r,e);let ha=class extends ze{constructor(e,t){super(),this._resourceManagerService=e,this._univerInstanceService=t,this._init()}_init(){const e=n=>{n.businesses.forEach(r=>{switch(r){case we.UNRECOGNIZED:case we.UNIVER_UNKNOWN:case we.UNIVER_SLIDE:case we.UNIVER_DOC:{this._univerInstanceService.getAllUnitsForType(we.UNIVER_DOC).forEach(s=>{const o=(s.getSnapshot().resources||[]).find(a=>a.name===n.pluginName);if(o)try{const a=n.parseJson(o.data);n.onLoad(s.getUnitId(),a)}catch{console.error(`Load Document{${s.getUnitId()}} Resources{${n.pluginName}} Data Error.`)}});break}case we.UNIVER_SHEET:this._univerInstanceService.getAllUnitsForType(we.UNIVER_SHEET).forEach(s=>{const o=(s.getSnapshot().resources||[]).find(a=>a.name===n.pluginName);if(o)try{const a=n.parseJson(o.data);n.onLoad(s.getUnitId(),a)}catch{console.error(`Load Workbook{${s.getUnitId()}} Resources{${n.pluginName}} Data Error.`)}})}})};this._resourceManagerService.getAllResourceHooks().forEach(n=>e(n)),this.disposeWithMe(this._resourceManagerService.register$.subscribe(n=>e(n))),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitAdded$(we.UNIVER_SHEET).subscribe(n=>{this._resourceManagerService.loadResources(n.getUnitId(),n.getSnapshot().resources)})),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitAdded$(we.UNIVER_DOC).subscribe(n=>{const r=n.getUnitId();Ca(r)||this._resourceManagerService.loadResources(n.getUnitId(),n.getSnapshot().resources)})),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitDisposed$(we.UNIVER_SHEET).subscribe(n=>{this._resourceManagerService.unloadResources(n.getUnitId())})),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitDisposed$(we.UNIVER_DOC).subscribe(n=>{this._resourceManagerService.unloadResources(n.getUnitId())}))}saveUnit(e){const t=this._univerInstanceService.getUnit(e);if(!t)return null;const n=this._resourceManagerService.getResources(e,t.type),r=Z.deepClone(t.getSnapshot());return r.resources=n,r}};ha=dI([Ed(0,Re.Inject(js)),Ed(1,Re.Inject(Xn))],ha);class fI{constructor(t={},n){C(this,"_startedTypes",new Set);C(this,"_injector");C(this,"_disposingCallbacks",new Jr);const r=this._injector=mI(n,t==null?void 0:t.override),{theme:s,darkMode:i,locale:o,locales:a,logLevel:l}=t;s&&this._injector.get(qs).setTheme(s),i&&this._injector.get(qs).setDarkMode(i),a&&this._injector.get(Sn).load(a),o&&this._injector.get(Sn).setLocale(o),l&&this._injector.get(_t).setLogLevel(l),this._init(r)}get _univerInstanceService(){return this._injector.get(Xn)}get _pluginService(){return this._injector.get(f.PluginService)}__getInjector(){return this._injector}onDispose(t){const n=this._disposingCallbacks.add(je(t));return je(()=>n.dispose(!0))}dispose(){this._disposingCallbacks.dispose(),this._injector.dispose()}setLocale(t){this._injector.get(Sn).setLocale(t)}createUnit(t,n){return this._univerInstanceService.createUnit(t,n)}createUniverSheet(t){return this._injector.get(_t).warn("[Univer]","Univer.createUniverSheet is deprecated, use createUnit instead"),this._univerInstanceService.createUnit(we.UNIVER_SHEET,t)}createUniverDoc(t){return this._injector.get(_t).warn("[Univer]","Univer.createUniverDoc is deprecated, use createUnit instead"),this._univerInstanceService.createUnit(we.UNIVER_DOC,t)}createUniverSlide(t){return this._injector.get(_t).warn("[Univer]","Univer.createUniverSlide is deprecated, use createUnit instead"),this._univerInstanceService.createUnit(we.UNIVER_SLIDE,t)}_init(t){this._univerInstanceService.registerCtorForType(we.UNIVER_SHEET,f.Workbook),this._univerInstanceService.registerCtorForType(we.UNIVER_DOC,At),this._univerInstanceService.registerCtorForType(we.UNIVER_SLIDE,ea);const n=t.get(Xn);n.__setCreateHandler((r,s,i,o)=>{if(!this._startedTypes.has(r)){this._pluginService.startPluginsForType(r),this._startedTypes.add(r);const l=t.createInstance(i,s);return n.__addUnit(l,o),this._tryProgressToReady(),l}const a=t.createInstance(i,s);return n.__addUnit(a,o),a})}_tryProgressToReady(){this._injector.get(f.LifecycleService).stage<ke.Ready&&(this._injector.get(f.LifecycleService).stage=ke.Ready)}registerPlugin(t,n){this._pluginService.registerPlugin(t,n)}}function mI(e,t){const n=Qh([[Ah],[Sn],[qs],[f.LifecycleService],[f.PluginService],[Ur],[Xn,{useClass:f.UniverInstanceService}],[Zh,{useClass:Jh}],[_t,{useClass:Ma,lazy:!0}],[sr,{useClass:f.CommandService}],[Zs,{useClass:f.LocalUndoRedoService,lazy:!0}],[qo,{useClass:vh}],[An,{useClass:ya}],[js,{useClass:f.ResourceManagerService,lazy:!0}],[sa,{useClass:ha,lazy:!0}],[$u,{useClass:f.AuthzIoLocalService}],[qh,{useClass:f.MentionIOLocalService,lazy:!0}]],t),r=e?e.createChild(n):new Re.Injector(n);return Ra(r,[[Ur],[sa]]),r}bd(),f.ABCToNumber=M_,f.AUTO_HEIGHT_FOR_MERGED_CELLS=Ea,f.AbsoluteRefType=Ne,f.ActionIterator=jn,f.AlignTypeH=Mc,f.AlignTypeV=Lc,f.ArrangeTypeEnum=Pc,f.ArrowsAndMarkersShapes=Xa,f.AsyncInterceptorManager=zd,f.AsyncLock=kd,f.AutoFillSeries=xa,f.BaselineOffset=$t,f.BasicShapes=Ka,f.BlockType=hc,f.BooleanNumber=ae,f.BorderStyleTypes=Ue,f.BorderType=Ba,f.BuildTextUtils=Je,f.BulletAlignment=Or,f.COLORS=hi,f.CanceledError=Hd,f.CellModeEnum=Tn,f.CellValueType=Xt,f.Color=fn,f.ColorBuilder=is,f.ColorKit=vt,f.ColorType=pt,f.ColumnSeparatorType=mc,f.CommandType=rr,f.CommonHideTypes=$a,f.ConfigService=vh,f.ContextService=ya,f.CopyPasteType=Ha,f.CustomCommandExecutionError=qr,f.CustomDecorationType=_n,f.CustomRangeType=en,f.DEFAULT_CELL=a_,f.DEFAULT_DOC=yo,f.DEFAULT_DOCUMENT_SUB_COMPONENT_ID=Qp,f.DEFAULT_EMPTY_DOCUMENT_VALUE=_a,f.DEFAULT_NUMBER_FORMAT=lc,f.DEFAULT_RANGE=i_,f.DEFAULT_RANGE_ARRAY=s_,f.DEFAULT_SELECTION=o_,f.DEFAULT_SLIDE=Bc,f.DEFAULT_STYLES=st,f.DEFAULT_TEXT_FORMAT=oc,f.DEFAULT_TEXT_FORMAT_EXCEL=ac,f.DEFAULT_WORKSHEET_COLUMN_COUNT=Fh,f.DEFAULT_WORKSHEET_COLUMN_COUNT_KEY=OR,f.DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT=Hh,f.DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT_KEY=AR,f.DEFAULT_WORKSHEET_COLUMN_WIDTH=Bh,f.DEFAULT_WORKSHEET_COLUMN_WIDTH_KEY=wR,f.DEFAULT_WORKSHEET_ROW_COUNT=kh,f.DEFAULT_WORKSHEET_ROW_COUNT_KEY=SR,f.DEFAULT_WORKSHEET_ROW_HEIGHT=xh,f.DEFAULT_WORKSHEET_ROW_HEIGHT_KEY=vR,f.DEFAULT_WORKSHEET_ROW_TITLE_WIDTH=$h,f.DEFAULT_WORKSHEET_ROW_TITLE_WIDTH_KEY=bR,f.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY=ri,f.DOCS_NORMAL_EDITOR_UNIT_ID_KEY=ni,f.DOCS_ZEN_EDITOR_UNIT_ID_KEY=ga,f.DOC_DRAWING_PRINTING_COMPONENT_KEY=d_,f.DOC_RANGE_TYPE=ul,f.DashStyleType=Rc,f.DataStreamTreeNodeType=Lu,f.DataStreamTreeTokenType=lt,f.DataValidationErrorStyle=dd,f.DataValidationImeMode=fd,f.DataValidationOperator=md,f.DataValidationRenderMode=gd,f.DataValidationStatus=_d,f.DataValidationType=pd,f.DeleteDirection=Wa,f.DependentOn=zR,f.DesktopLogService=Ma,f.DeveloperMetadataVisibility=ja,f.Dimension=Ya,f.Direction=Ga,f.Disposable=ze,f.DisposableCollection=Jr,f.DocStyleType=cc,f.DocumentDataModel=At,f.DocumentFlavor=ho,f.DrawingTypeEnum=kc,f.EDITOR_ACTIVATED=wh,f.EXTENSION_NAMES=$c,f.ErrorService=Ah,f.EventState=xu,f.EventSubject=eE,f.FOCUSING_COMMON_DRAWINGS=cR,f.FOCUSING_DOC=$r,f.FOCUSING_EDITOR_BUT_HIDDEN=rR,f.FOCUSING_EDITOR_INPUT_FORMULA=sR,f.FOCUSING_EDITOR_STANDALONE=oR,f.FOCUSING_FX_BAR_EDITOR=bh,f.FOCUSING_PANEL_EDITOR=aR,f.FOCUSING_SHEET=Kn,f.FOCUSING_SLIDE=Hr,f.FOCUSING_UNIT=Br,f.FOCUSING_UNIVER_EDITOR=iR,f.FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE=lR,f.FORMULA_EDITOR_ACTIVATED=uR,f.FollowNumberWithType=uc,f.FontItalic=ts,f.FontStyleType=kn,f.FontWeight=ns,f.GridType=dc,f.HLSColor=il,f.HorizontalAlign=Ot,f.IAuthzIoService=$u,f.ICommandService=sr,f.IConfigService=qo,f.IContextService=An,f.IImageIoService=Jo,f.ILocalStorageService=BR,f.ILogService=_t,f.IMentionIOService=qh,f.IPermissionService=Zh,f.IResourceLoaderService=sa,f.IResourceManagerService=js,f.IS_ROW_STYLE_PRECEDE_COLUMN_STYLE=pa,f.IUndoRedoService=Zs,f.IUniverInstanceService=Xn,f.ImageCacheMap=od,f.ImageSourceType=Zo,f.ImageUploadStatusType=Th,f.InterceptorEffectEnum=bn,f.InterceptorManager=Yd,f.InterpolationPointType=Va,f.JSON1=Y_,f.JSONX=Wt,f.LRUHelper=hr,f.LRUMap=ur,f.LifecycleStages=ke,f.LifecycleUnreachableError=Kh,f.ListGlyphType=fe,f.LocaleService=Sn,f.LocaleType=ar,f.LogLevel=Na,f.MOVE_BUFFER_VALUE=or,f.MemoryCursor=un,f.MentionType=es,f.NAMED_STYLE_MAP=c_,f.NAMED_STYLE_SPACE_MAP=u_,f.NamedStyleType=qe,f.NilCommand=Da,f.NumberUnitType=Nc,f.ObjectMatrix=ct,f.ObjectRelativeFromH=Tc,f.ObjectRelativeFromV=yc,f.OtherShapes=qa,f.PAGE_SIZE=f_,f.PAPER_TYPES=r_,f.PRESET_LIST_TYPE=Nr,f.PRINT_CHART_COMPONENT_KEY=h_,f.PageElementType=Fc,f.PageOrientType=Uc,f.PageType=fo,f.PaperType=dt,f.ParagraphElementType=_c,f.ParagraphStyleBuilder=Dr,f.ParagraphStyleValue=Lr,f.PermissionService=Jh,f.PermissionStatus=ta,f.Plugin=ra,f.PositionedObjectLayoutType=Ec,f.PresetListType=Ft,f.ProtectionType=za,f.QuickListType=Ru,f.QuickListTypeMap=q_,f.RANGE_DIRECTION=cl,f.RANGE_TYPE=pe,f.RBush=Ms,f.RCDisposable=hf,f.RGBA_PAREN=Hf,f.RGB_PAREN=$f,f.ROTATE_BUFFER_VALUE=Fa,f.RTree=tI,f.Range=xn,f.Rectangle=tn,f.RedoCommand=id,f.RedoCommandId=nd,f.RefAlias=N_,f.Registry=oi,f.RegistryAsMap=ai,f.RelativeDate=Ja,f.RelativeSlideLink=xc,f.RgbColor=os,f.RichTextBuilder=Cn,f.RichTextValue=sn,f.RxDisposable=uf,f.SHEET_EDITOR_UNITS=l_,f.SectionType=fc,f.SheetTypes=Qa,f.SheetViewModel=jh,f.SliceBodyType=Ao,f.SlideDataModel=ea,f.SpacingRule=Cc,f.SpecialShapes=Za,f.Styles=yh,f.THEME_COLORS=sl,f.TabStopAlignment=Ic,f.TableAlignmentType=Oc,f.TableLayoutType=vc,f.TableRowHeightRule=bc,f.TableSizeType=Sc,f.TableTextWrapType=wc,f.TextDecoration=el,f.TextDecorationBuilder=rn,f.TextDirection=lr,f.TextDirectionType=gc,f.TextStyleBuilder=nn,f.TextStyleValue=Mr,f.TextX=Me,f.TextXActionType=J,f.ThemeColor=as,f.ThemeColorType=ot,f.ThemeColors=rs,f.ThemeService=qs,f.Tools=Z,f.UndoCommand=sd,f.UndoCommandId=rd,f.UnitModel=Ps,f.Univer=fI,f.UniverInstanceType=we,f.UpdateDocsAttributeType=Ce,f.UserManagerService=Ur,f.VerticalAlign=hn,f.VerticalAlignmentType=Ac,f.Worksheet=jr,f.WrapStrategy=dn,f.WrapTextType=pc,f.addLinkToDocumentModel=Lh,f.afterInitApply=If,f.afterTime=Cf,f.awaitTime=nI,f.binSearchFirstGreaterThanTarget=ka,f.binarySearchArray=Sf,f.bufferDebounceTime=Ef,f.cellToRange=pm,f.characterSpacingControlType=Dc,f.checkForSubstrings=Cm,f.checkIfMove=vf,f.checkParagraphHasBullet=tg,f.checkParagraphHasIndent=ng,f.checkParagraphHasIndentByStyle=vl,f.codeToBlob=Of,f.composeBody=To,f.composeInterceptors=Sa,f.composeStyles=cr,f.concatMatrixArray=om,f.convertBodyToHtml=Bf,f.convertCellToRange=hl,f.convertObservableToBehaviorSubject=Rf,f.covertCellValue=Ei,f.covertCellValues=Em,f.covertTextRunToHtml=ui,f.createAsyncInterceptorKey=Gd,f.createDefaultUser=Ys,f.createDocumentModelWithStyle=Wr,f.createInterceptorKey=jd,f.createInternalEditorID=Bd,f.createRowColIter=po,f.dayjs=Ht,f.debounce=qC,f.dedupe=Ad,f.dedupeBy=Td,f.deepCompare=Ci,f.delayAnimationFrame=rI,f.deleteContent=bl,f.extractPureTextFromCell=Gh,f.fromCallback=Ua,f.fromEventSubject=tE,f.fromObservable=cf,f.generateRandomId=tt,f.get=ph,f.getArrayLength=Zt,f.getBodySlice=bt,f.getBodySliceHtml=ss,f.getBorderStyleType=mm,f.getCellCoordByIndexSimple=ua,f.getCellInfoInMergeData=sm,f.getCellPositionByIndexSimple=cI,f.getCellValueType=tm,f.getCellWithCoordByIndexCore=qn,f.getColorStyle=Dt,f.getCustomBlockSlice=wu,f.getCustomDecorationSlice=Au,f.getCustomRangeSlice=bu,f.getDocsUpdateBody=gm,f.getIntersectRange=Yc,f.getOriginCellValue=yR,f.getParagraphsSlice=vu,f.getPlainText=Ws,f.getReverseDirection=wf,f.getSectionBreakSlice=ip,f.getTableSlice=Ou,f.getTextRunSlice=Hs,f.getTransformOffsetX=ud,f.getTransformOffsetY=hd,f.getWorksheetUID=DR,f.groupBy=Md,f.handleStyleToString=fm,f.hashAlgorithm=sg,f.horizontalLineSegmentsSubtraction=Cs,f.insertMatrixArray=mi,f.insertTextToContent=wl,f.invertColorByHSL=Qd,f.invertColorByMatrix=tf,f.isBlackColor=Qf,f.isBooleanString=xd,f.isCellCoverable=pi,f.isCellV=ll,f.isDefaultFormat=t_,f.isEmptyCell=dl,f.isFormulaId=dm,f.isFormulaString=fl,f.isICellData=al,f.isInternalEditorID=Ca,f.isNodeEnv=xf,f.isNotNullOrUndefined=Dh,f.isNullCell=nm,f.isNumeric=ba,f.isPatternEqualWithoutDecimal=n_,f.isRangesEqual=fR,f.isRealNum=rg,f.isSafeNumeric=rf,f.isSameStyleTextRun=ml,f.isTextFormat=e_,f.isUnitRangesEqual=mR,f.isValidRange=_m,f.isWhiteColor=em,f.makeArray=Ld,f.makeCellRangeToRangeData=hm,f.makeCellToSelection=um,f.makeCustomRangeStream=Cp,f.mapObjectMatrix=im,f.merge=Xo,f.mergeOverrideWithDependencies=Qh,f.mergeSets=af,f.mergeWith=eR,f.mergeWorksheetSnapshotWithDefault=Wh,f.mixinClass=nf,f.moveMatrixArray=_i,f.moveRangeByOffset=R_,f.nameCharacterCheck=eI,f.normalizeBody=op,f.normalizeTextRuns=yr,f.numberToABC=D_,f.numberToListABC=U_,f.numfmt=Qg,f.queryObjectMatrix=y_,f.registerDependencies=$d,f.remove=tr,f.repeatStringNumTimes=Kc,f.replaceInDocumentBody=Zp,f.requestImmediateMacroTask=of,f.rotate=Nd,f.searchArray=ir,f.searchInOrderedArray=Pa,f.selectionToArray=rm,f.sequence=Ta,f.sequenceAsync=Aa,f.sequenceExecute=Qr,f.sequenceExecuteAsync=pf,f.set=nR,f.shallowEqual=Ia,f.skipParseTagNames=uI,f.sliceMatrixArray=am,f.sortRules=P_,f.sortRulesByDesc=k_,f.sortRulesFactory=Ar,f.spliceArray=gi,f.splitIntoGrid=_o,f.takeAfter=li,f.textDiff=Mo,f.throttle=Wd,f.toDisposable=je,f.touchDependencies=Ra,f.updateAttributeByDelete=Tu,f.updateAttributeByInsert=yu,f.willLoseNumericPrecision=sf,Object.keys(Re).forEach(e=>{e!=="default"&&!Object.prototype.hasOwnProperty.call(f,e)&&Object.defineProperty(f,e,{enumerable:!0,get:()=>Re[e]})}),Object.defineProperty(f,Symbol.toStringTag,{value:"Module"})});
1218
1218
 
1219
1219
 
1220
1220
  // @univerjs/core/facade
@@ -1239,15 +1239,15 @@ exports.useUpdateBinder = useUpdateBinder;
1239
1239
 
1240
1240
 
1241
1241
  // @univerjs/design/index
1242
- (function(me,D){typeof exports=="object"&&typeof module<"u"?D(exports,require("react"),require("react-dom"),require("react/jsx-runtime"),require("react-dom/client"),require("@univerjs/themes")):typeof define=="function"&&define.amd?define(["exports","react","react-dom","react/jsx-runtime","react-dom/client","@univerjs/themes"],D):(me=typeof globalThis<"u"?globalThis:me||self,D(me.UniverDesign={},me.React,me.ReactDOM,me.React,me.ReactDOM,me.UniverThemes))})(this,function(me,D,It,P,jp,Pu){"use strict";function Du(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const d=Du(D),ku=Du(It);var vn=function(){return vn=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},vn.apply(this,arguments)},Yp=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},At=D.forwardRef(function(e,t){var n=e.icon,r=e.id,o=e.className,a=e.extend,i=Yp(e,["icon","id","className","extend"]),s="univerjs-icon univerjs-icon-".concat(r," ").concat(o||"").trim(),u=D.useRef("_".concat(Gp()));return _u(n,"".concat(r),{defIds:n.defIds,idSuffix:u.current},vn({ref:t,className:s},i),a)});function _u(e,t,n,r,o){return D.createElement(e.tag,vn(vn({key:t},Up(e,n,o)),r),(qp(e,n).children||[]).map(function(a,i){return _u(a,"".concat(t,"-").concat(e.tag,"-").concat(i),n,void 0,o)}))}function Up(e,t,n){var r=vn({},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(a){var i=a[0],s=a[1];i==="mask"&&typeof s=="string"&&(r[i]=s.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(a){var i=a[0],s=a[1];typeof s=="string"&&(r[i]=s.replace(/url\(#(.*)\)/,"url(#$1".concat(t.idSuffix,")")))})),r}function qp(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)?vn(vn({},e),{children:e.children.map(function(o){return typeof o.attrs.id=="string"&&r&&r.includes(o.attrs.id)?vn(vn({},o),{attrs:vn(vn({},o.attrs),{id:o.attrs.id+t.idSuffix})}):o})}):e}function Gp(){return Math.random().toString(36).substring(2,8)}At.displayName="UniverIcon";var Kp={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 17 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M8.87598 11.8327C8.87598 11.5013 9.14461 11.2327 9.47598 11.2327H11.476C11.8073 11.2327 12.076 11.5013 12.076 11.8327C12.076 12.164 11.8073 12.4327 11.476 12.4327H9.47598C9.14461 12.4327 8.87598 12.164 8.87598 11.8327Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M4.80898 11.2327C4.47761 11.2327 4.20898 11.5013 4.20898 11.8327C4.20898 12.164 4.47761 12.4327 4.80898 12.4327H6.80898C7.14036 12.4327 7.40898 12.164 7.40898 11.8327C7.40898 11.5013 7.14036 11.2327 6.80898 11.2327H4.80898Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M8.87598 9.16592C8.87598 8.83455 9.14461 8.56592 9.47598 8.56592H11.476C11.8073 8.56592 12.076 8.83455 12.076 9.16592C12.076 9.49729 11.8073 9.76592 11.476 9.76592H9.47598C9.14461 9.76592 8.87598 9.49729 8.87598 9.16592Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M4.80898 8.56592C4.47761 8.56592 4.20898 8.83455 4.20898 9.16592C4.20898 9.49729 4.47761 9.76592 4.80898 9.76592H6.80898C7.14036 9.76592 7.40898 9.49729 7.40898 9.16592C7.40898 8.83455 7.14036 8.56592 6.80898 8.56592H4.80898Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M6.00615 1.69985C6.00615 1.36848 5.73752 1.09985 5.40615 1.09985C5.07478 1.09985 4.80615 1.36848 4.80615 1.69985V2.34009H3.64248C2.20654 2.34009 1.04248 3.50415 1.04248 4.94009V12.3C1.04248 13.7359 2.20654 14.9 3.64248 14.9H12.6425C14.0784 14.9 15.2425 13.7359 15.2425 12.3V4.94009C15.2425 3.50415 14.0784 2.34009 12.6425 2.34009H11.4798V1.69985C11.4798 1.36848 11.2112 1.09985 10.8798 1.09985C10.5484 1.09985 10.2798 1.36848 10.2798 1.69985V2.34009H6.00615V1.69985ZM14.0425 5.97021V4.94009C14.0425 4.16689 13.4157 3.54009 12.6425 3.54009H11.4798V4.09985C11.4798 4.43122 11.2112 4.69985 10.8798 4.69985C10.5484 4.69985 10.2798 4.43122 10.2798 4.09985V3.54009H6.00615V4.09985C6.00615 4.43122 5.73752 4.69985 5.40615 4.69985C5.07478 4.69985 4.80615 4.43122 4.80615 4.09985V3.54009H3.64248C2.86928 3.54009 2.24248 4.16689 2.24248 4.94009V5.97021H14.0425ZM2.24248 7.17021H14.0425V12.3C14.0425 13.0731 13.4157 13.7 12.6425 13.7H3.64248C2.86928 13.7 2.24248 13.0732 2.24248 12.3V7.17021Z",fillRule:"evenodd",clipRule:"evenodd"}}]},Ji=D.forwardRef(function(e,t){return D.createElement(At,Object.assign({},e,{id:"calendar-icon",ref:t,icon:Kp}))});Ji.displayName="CalendarIcon";var Xp={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"}}]},Rr=D.forwardRef(function(e,t){return D.createElement(At,Object.assign({},e,{id:"check-mark-icon",ref:t,icon:Xp}))});Rr.displayName="CheckMarkIcon";var Zp={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:"M3.71274 2.86421C3.47843 2.6299 3.09853 2.6299 2.86421 2.86421C2.6299 3.09853 2.6299 3.47843 2.86421 3.71274L7.15154 8.00007L2.86421 12.2874C2.6299 12.5217 2.6299 12.9016 2.86421 13.1359C3.09853 13.3702 3.47843 13.3702 3.71274 13.1359L8.00007 8.84859L12.2874 13.1359C12.5217 13.3702 12.9016 13.3702 13.1359 13.1359C13.3702 12.9016 13.3702 12.5217 13.1359 12.2874L8.84859 8.00007L13.1359 3.71274C13.3702 3.47843 13.3702 3.09853 13.1359 2.86421C12.9016 2.6299 12.5217 2.6299 12.2874 2.86421L8.00007 7.15154L3.71274 2.86421Z"}}]},ua=D.forwardRef(function(e,t){return D.createElement(At,Object.assign({},e,{id:"close-icon",ref:t,icon:Zp}))});ua.displayName="CloseIcon";var Qp={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M10.5547 14.1884C10.2599 14.5214 9.74019 14.5214 9.4454 14.1884L3.71321 7.71335C3.29002 7.23532 3.6294 6.48161 4.26784 6.48161L15.7322 6.48161C16.3707 6.48161 16.7101 7.23532 16.2869 7.71335L10.5547 14.1884Z"}}]},Nu=D.forwardRef(function(e,t){return D.createElement(At,Object.assign({},e,{id:"down-icon",ref:t,icon:Qp}))});Nu.displayName="DownIcon";var Jp={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.85869 12.9216C8.38445 13.4708 7.61555 13.4708 7.14131 12.9216L0.358114 5.06726C-0.406895 4.18144 0.134916 2.66683 1.2168 2.66683L14.7832 2.66683C15.8651 2.66683 16.4069 4.18144 15.6419 5.06726L8.85869 12.9216Z"}}]},Ou=D.forwardRef(function(e,t){return D.createElement(At,Object.assign({},e,{id:"dropdown-icon",ref:t,icon:Jp}))});Ou.displayName="DropdownIcon";var eg={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:"M15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1C11.866 1 15 4.13401 15 8ZM10.3097 5.69014C10.544 5.92445 10.544 6.30435 10.3097 6.53867L8.84843 7.9999L10.3099 9.46137C10.5442 9.69569 10.5442 10.0756 10.3099 10.3099C10.0756 10.5442 9.69569 10.5442 9.46137 10.3099L7.9999 8.84843L6.53842 10.3099C6.30411 10.5442 5.92421 10.5442 5.6899 10.3099C5.45558 10.0756 5.45558 9.69569 5.6899 9.46137L7.15137 7.9999L5.69014 6.53867C5.45583 6.30435 5.45583 5.92445 5.69014 5.69014C5.92445 5.45583 6.30435 5.45583 6.53867 5.69014L7.9999 7.15137L9.46113 5.69014C9.69544 5.45583 10.0753 5.45583 10.3097 5.69014Z",fillRule:"evenodd",clipRule:"evenodd"}}]},Tu=D.forwardRef(function(e,t){return D.createElement(At,Object.assign({},e,{id:"error-icon",ref:t,icon:eg}))});Tu.displayName="ErrorIcon";var tg={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.4216 4.46432L15.6036 7.6463C15.7988 7.84156 15.7988 8.15814 15.6036 8.3534L12.4216 11.5354C12.2263 11.7306 11.9097 11.7306 11.7145 11.5354C11.5192 11.3401 11.5192 11.0235 11.7145 10.8283L14.0429 8.49985H0.75C0.473858 8.49985 0.25 8.27599 0.25 7.99985C0.25 7.72371 0.473857 7.49985 0.749999 7.49985H14.0429L11.7145 5.17142C11.5192 4.97616 11.5192 4.65958 11.7145 4.46432C11.9097 4.26906 12.2263 4.26906 12.4216 4.46432Z",fillRule:"evenodd",clipRule:"evenodd"}}]},Iu=D.forwardRef(function(e,t){return D.createElement(At,Object.assign({},e,{id:"guide-icon",ref:t,icon:tg}))});Iu.displayName="GuideIcon";var ng={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.00016 1.33203C6.68162 1.33203 5.39269 1.72302 4.29636 2.45557C3.20004 3.18811 2.34555 4.2293 1.84097 5.44747C1.33638 6.66565 1.20436 8.00609 1.4616 9.2993C1.71883 10.5925 2.35377 11.7804 3.28612 12.7127C4.21847 13.6451 5.40636 14.28 6.69956 14.5373C7.99277 14.7945 9.33321 14.6625 10.5514 14.1579C11.7696 13.6533 12.8108 12.7988 13.5433 11.7025C14.2758 10.6062 14.6668 9.31724 14.6668 7.9987C14.6649 6.23118 13.9619 4.53662 12.7121 3.2868C11.4622 2.03697 9.76768 1.33397 8.00016 1.33203ZM7.66683 3.9987C7.86461 3.9987 8.05795 4.05735 8.2224 4.16723C8.38685 4.27711 8.51502 4.43329 8.59071 4.61601C8.6664 4.79874 8.6862 4.99981 8.64762 5.19379C8.60903 5.38777 8.51379 5.56595 8.37394 5.7058C8.23409 5.84566 8.0559 5.9409 7.86192 5.97948C7.66794 6.01807 7.46687 5.99826 7.28415 5.92258C7.10142 5.84689 6.94524 5.71872 6.83536 5.55427C6.72548 5.38982 6.66683 5.19648 6.66683 4.9987C6.66683 4.73348 6.77219 4.47913 6.95972 4.29159C7.14726 4.10405 7.40162 3.9987 7.66683 3.9987ZM9.3335 11.332H6.66683C6.49002 11.332 6.32045 11.2618 6.19543 11.1368C6.0704 11.0117 6.00016 10.8422 6.00016 10.6654C6.00016 10.4886 6.0704 10.319 6.19543 10.194C6.32045 10.0689 6.49002 9.9987 6.66683 9.9987H7.3335V7.9987H6.66683C6.49002 7.9987 6.32045 7.92846 6.19543 7.80343C6.0704 7.67841 6.00016 7.50884 6.00016 7.33203C6.00016 7.15522 6.0704 6.98565 6.19543 6.86063C6.32045 6.7356 6.49002 6.66536 6.66683 6.66536H8.00016C8.17698 6.66536 8.34655 6.7356 8.47157 6.86063C8.59659 6.98565 8.66683 7.15522 8.66683 7.33203V9.9987H9.3335C9.51031 9.9987 9.67988 10.0689 9.8049 10.194C9.92993 10.319 10.0002 10.4886 10.0002 10.6654C10.0002 10.8422 9.92993 11.0117 9.8049 11.1368C9.67988 11.2618 9.51031 11.332 9.3335 11.332Z"}}]},Ru=D.forwardRef(function(e,t){return D.createElement(At,Object.assign({},e,{id:"info-icon",ref:t,icon:ng}))});Ru.displayName="InfoIcon";var rg={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:"#0B9EFB",d:"M8.79993 14.0166C8.79993 14.4585 8.44176 14.8166 7.99993 14.8166C4.23529 14.8166 1.18345 11.7648 1.18345 8.00017C1.18345 4.23554 4.23529 1.18369 7.99993 1.1837C11.7646 1.1837 14.8164 4.23554 14.8164 8.00017C14.8164 8.442 14.4582 8.80017 14.0164 8.80017C13.5746 8.80017 13.2164 8.442 13.2164 8.00017C13.2164 5.11919 10.8809 2.7837 7.99993 2.7837C5.11895 2.7837 2.78345 5.11919 2.78345 8.00017C2.78345 10.8812 5.11895 13.2166 7.99993 13.2166C8.44176 13.2166 8.79993 13.5748 8.79993 14.0166Z",fillOpacity:.2,fillRule:"evenodd",clipRule:"evenodd"}},{tag:"path",attrs:{fill:"#0B9EFB",d:"M7.20007 1.98384C7.20007 1.54201 7.55824 1.18384 8.00007 1.18384C11.7647 1.18384 14.8165 4.23568 14.8165 8.00032C14.8165 11.765 11.7647 14.8168 8.00007 14.8168C4.23543 14.8168 1.18359 11.765 1.18359 8.00032C1.18359 7.55849 1.54177 7.20031 1.98359 7.20031C2.42542 7.20031 2.78359 7.55849 2.78359 8.00032C2.78359 10.8813 5.11909 13.2168 8.00007 13.2168C10.8811 13.2168 13.2165 10.8813 13.2165 8.00032C13.2165 5.11933 10.8811 2.78384 8.00007 2.78384C7.55824 2.78384 7.20007 2.42567 7.20007 1.98384Z",fillRule:"evenodd",clipRule:"evenodd"}}]},Au=D.forwardRef(function(e,t){return D.createElement(At,Object.assign({},e,{id:"loading-multi-icon",ref:t,icon:rg}))});Au.displayName="LoadingMultiIcon";var og={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"}}]},es=D.forwardRef(function(e,t){return D.createElement(At,Object.assign({},e,{id:"more-down-icon",ref:t,icon:og}))});es.displayName="MoreDownIcon";var ag={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 17 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M10.3536 12.3536C10.1583 12.5488 9.84171 12.5488 9.64645 12.3536L6.64645 9.35355C6.45118 9.15829 6.45118 8.84171 6.64645 8.64645L9.64645 5.64645C9.84171 5.45118 10.1583 5.45118 10.3536 5.64645C10.5488 5.84171 10.5488 6.15829 10.3536 6.35355L7.70711 9L10.3536 11.6464C10.5488 11.8417 10.5488 12.1583 10.3536 12.3536Z",fillRule:"evenodd",clipRule:"evenodd"}}]},Lu=D.forwardRef(function(e,t){return D.createElement(At,Object.assign({},e,{id:"more-left-icon",ref:t,icon:ag}))});Lu.displayName="MoreLeftIcon";var ig={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:"M6.14645 4.64645C6.34171 4.45118 6.65829 4.45118 6.85355 4.64645L9.85355 7.64645C10.0488 7.84171 10.0488 8.15829 9.85355 8.35355L6.85355 11.3536C6.65829 11.5488 6.34171 11.5488 6.14645 11.3536C5.95118 11.1583 5.95118 10.8417 6.14645 10.6464L8.79289 8L6.14645 5.35355C5.95118 5.15829 5.95118 4.84171 6.14645 4.64645Z",fillRule:"evenodd",clipRule:"evenodd"}}]},ts=D.forwardRef(function(e,t){return D.createElement(At,Object.assign({},e,{id:"more-right-icon",ref:t,icon:ig}))});ts.displayName="MoreRightIcon";var sg={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:"M4.64645 9.85355C4.45118 9.65829 4.45118 9.34171 4.64645 9.14645L7.64645 6.14645C7.84171 5.95118 8.15829 5.95118 8.35355 6.14645L11.3536 9.14645C11.5488 9.34171 11.5488 9.65829 11.3536 9.85355C11.1583 10.0488 10.8417 10.0488 10.6464 9.85355L8 7.20711L5.35355 9.85355C5.15829 10.0488 4.84171 10.0488 4.64645 9.85355Z",fillRule:"evenodd",clipRule:"evenodd"}}]},$u=D.forwardRef(function(e,t){return D.createElement(At,Object.assign({},e,{id:"more-up-icon",ref:t,icon:sg}))});$u.displayName="MoreUpIcon";var lg={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.65252 5.41446C5.86681 5.53124 6.00016 5.75579 6.00016 5.99984V9.99984C6.00016 10.368 5.70168 10.6665 5.3335 10.6665C4.96531 10.6665 4.66683 10.368 4.66683 9.99984V7.22312L4.36151 7.42005C4.05209 7.61961 3.63948 7.53056 3.43992 7.22115C3.24035 6.91173 3.3294 6.49912 3.63882 6.29956L4.97215 5.43959C5.17724 5.30731 5.43822 5.29767 5.65252 5.41446Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M12.3335 5.99984C12.3335 5.75579 12.2001 5.53124 11.9858 5.41446C11.7716 5.29767 11.5106 5.30731 11.3055 5.43959L9.97215 6.29956C9.66274 6.49912 9.57368 6.91173 9.77325 7.22115C9.97281 7.53056 10.3854 7.61961 10.6948 7.42005L11.0002 7.22312V9.99984C11.0002 10.368 11.2986 10.6665 11.6668 10.6665C12.035 10.6665 12.3335 10.368 12.3335 9.99984V5.99984Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M8.00008 5.99984C8.36827 5.99984 8.66675 6.29831 8.66675 6.6665V6.99984C8.66675 7.36803 8.36827 7.6665 8.00008 7.6665C7.63189 7.6665 7.33341 7.36803 7.33341 6.99984V6.6665C7.33341 6.29831 7.63189 5.99984 8.00008 5.99984Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M8.66675 8.99984C8.66675 8.63165 8.36827 8.33317 8.00008 8.33317C7.63189 8.33317 7.33341 8.63165 7.33341 8.99984V9.33317C7.33341 9.70136 7.63189 9.99984 8.00008 9.99984C8.36827 9.99984 8.66675 9.70136 8.66675 9.33317V8.99984Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M0.666748 2.99984C0.666748 2.26346 1.2637 1.6665 2.00008 1.6665H14.0001C14.7365 1.6665 15.3334 2.26346 15.3334 2.99984V12.9998C15.3334 13.7362 14.7365 14.3332 14.0001 14.3332H2.00008C1.26371 14.3332 0.666748 13.7362 0.666748 12.9998V2.99984ZM14.0001 2.99984H2.00008V12.9998H14.0001V2.99984Z",fillRule:"evenodd",clipRule:"evenodd"}}]},Fu=D.forwardRef(function(e,t){return D.createElement(At,Object.assign({},e,{id:"one-to-one-icon",ref:t,icon:lg}))});Fu.displayName="OneToOneIcon";var ug={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 15C11.866 15 15 11.866 15 8C15 4.13401 11.866 1 8 1C4.13401 1 1 4.13401 1 8C1 11.866 4.13401 15 8 15ZM11.7245 6.42417C11.9588 6.18985 11.9588 5.80995 11.7245 5.57564C11.4901 5.34132 11.1102 5.34132 10.8759 5.57564L7.3002 9.15137L5.72446 7.57564C5.49014 7.34132 5.11025 7.34132 4.87593 7.57564C4.64162 7.80995 4.64162 8.18985 4.87593 8.42417L6.87593 10.4242C7.11025 10.6585 7.49014 10.6585 7.72446 10.4242L11.7245 6.42417Z",fillRule:"evenodd",clipRule:"evenodd"}}]},zu=D.forwardRef(function(e,t){return D.createElement(At,Object.assign({},e,{id:"success-icon",ref:t,icon:ug}))});zu.displayName="SuccessIcon";var cg={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:"M15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1C11.866 1 15 4.13401 15 8ZM8.00008 12.3671C8.46031 12.3671 8.83342 11.994 8.83342 11.5338C8.83342 11.0735 8.46031 10.7004 8.00008 10.7004C7.53985 10.7004 7.16675 11.0735 7.16675 11.5338C7.16675 11.994 7.53985 12.3671 8.00008 12.3671ZM8.5999 4.4335C8.5999 4.10213 8.33127 3.8335 7.9999 3.8335C7.66853 3.8335 7.3999 4.10213 7.3999 4.4335V9.36683C7.3999 9.6982 7.66853 9.96683 7.9999 9.96683C8.33127 9.96683 8.5999 9.6982 8.5999 9.36683V4.4335Z",fillRule:"evenodd",clipRule:"evenodd"}}]},Hu=D.forwardRef(function(e,t){return D.createElement(At,Object.assign({},e,{id:"warning-icon",ref:t,icon:cg}))});Hu.displayName="WarningIcon";var dg={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.04883 5.38216C8.04883 5.01397 7.75035 4.71549 7.38216 4.71549C7.01397 4.71549 6.71549 5.01397 6.71549 5.38216V6.71897L5.3865 6.7207C5.01831 6.72117 4.72022 7.02004 4.7207 7.38823C4.72118 7.75642 5.02005 8.05451 5.38824 8.05403L6.71549 8.0523V9.38216C6.71549 9.75035 7.01397 10.0488 7.38216 10.0488C7.75035 10.0488 8.04883 9.75035 8.04883 9.38216V8.05056L9.38304 8.04883C9.75123 8.04835 10.0493 7.74948 10.0488 7.38129C10.0484 7.0131 9.74949 6.71502 9.3813 6.7155L8.04883 6.71723V5.38216Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M7.38216 1.04883C3.88437 1.04883 1.04883 3.88437 1.04883 7.38216C1.04883 10.88 3.88437 13.7155 7.38216 13.7155C8.89089 13.7155 10.2764 13.1879 11.3643 12.3072L13.813 14.7559C14.0733 15.0162 14.4954 15.0162 14.7558 14.7559C15.0161 14.4955 15.0161 14.0734 14.7558 13.8131L12.3071 11.3644C13.1879 10.2765 13.7155 8.89095 13.7155 7.38216C13.7155 3.88437 10.88 1.04883 7.38216 1.04883ZM2.38216 7.38216C2.38216 4.62075 4.62075 2.38216 7.38216 2.38216C10.1436 2.38216 12.3822 4.62075 12.3822 7.38216C12.3822 10.1436 10.1436 12.3822 7.38216 12.3822C4.62075 12.3822 2.38216 10.1436 2.38216 7.38216Z",fillRule:"evenodd",clipRule:"evenodd"}}]},Vu=D.forwardRef(function(e,t){return D.createElement(At,Object.assign({},e,{id:"zoom-in-icon",ref:t,icon:dg}))});Vu.displayName="ZoomInIcon";var fg={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:"M4.71549 7.38216C4.71549 7.01397 5.01397 6.71549 5.38216 6.71549H9.38216C9.75035 6.71549 10.0488 7.01397 10.0488 7.38216C10.0488 7.75035 9.75035 8.04883 9.38216 8.04883H5.38216C5.01397 8.04883 4.71549 7.75035 4.71549 7.38216Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M1.04883 7.38216C1.04883 3.88437 3.88437 1.04883 7.38216 1.04883C10.88 1.04883 13.7155 3.88437 13.7155 7.38216C13.7155 8.89095 13.1879 10.2765 12.3071 11.3644L14.7558 13.8131C15.0161 14.0734 15.0161 14.4955 14.7558 14.7559C14.4954 15.0162 14.0733 15.0162 13.813 14.7559L11.3643 12.3072C10.2764 13.1879 8.89089 13.7155 7.38216 13.7155C3.88437 13.7155 1.04883 10.88 1.04883 7.38216ZM7.38216 2.38216C4.62075 2.38216 2.38216 4.62075 2.38216 7.38216C2.38216 10.1436 4.62075 12.3822 7.38216 12.3822C10.1436 12.3822 12.3822 10.1436 12.3822 7.38216C12.3822 4.62075 10.1436 2.38216 7.38216 2.38216Z",fillRule:"evenodd",clipRule:"evenodd"}}]},Wu=D.forwardRef(function(e,t){return D.createElement(At,Object.assign({},e,{id:"zoom-out-icon",ref:t,icon:fg}))});Wu.displayName="ZoomOutIcon";function Bu(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Bu(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function ju(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Bu(e))&&(r&&(r+=" "),r+=t);return r}const ns="-",vg=e=>{const t=hg(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{const s=i.split(ns);return s[0]===""&&s.length!==1&&s.shift(),Yu(s,t)||mg(i)},getConflictingClassGroupIds:(i,s)=>{const u=n[i]||[];return s&&r[i]?[...u,...r[i]]:u}}},Yu=(e,t)=>{var i;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?Yu(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const a=e.join(ns);return(i=t.validators.find(({validator:s})=>s(a)))==null?void 0:i.classGroupId},Uu=/^\[(.+)\]$/,mg=e=>{if(Uu.test(e)){const t=Uu.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},hg=e=>{const{theme:t,classGroups:n}=e,r={nextPart:new Map,validators:[]};for(const o in n)rs(n[o],r,o,t);return r},rs=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const a=o===""?t:qu(t,o);a.classGroupId=n;return}if(typeof o=="function"){if(pg(o)){rs(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([a,i])=>{rs(i,qu(t,a),n,r)})})},qu=(e,t)=>{let n=e;return t.split(ns).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},pg=e=>e.isThemeGetter,gg=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(a,i)=>{n.set(a,i),t++,t>e&&(t=0,r=n,n=new Map)};return{get(a){let i=n.get(a);if(i!==void 0)return i;if((i=r.get(a))!==void 0)return o(a,i),i},set(a,i){n.has(a)?n.set(a,i):o(a,i)}}},os="!",as=":",yg=as.length,bg=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=o=>{const a=[];let i=0,s=0,u=0,c;for(let y=0;y<o.length;y++){let w=o[y];if(i===0&&s===0){if(w===as){a.push(o.slice(u,y)),u=y+yg;continue}if(w==="/"){c=y;continue}}w==="["?i++:w==="]"?i--:w==="("?s++:w===")"&&s--}const f=a.length===0?o:o.substring(u),l=wg(f),h=l!==f,m=c&&c>u?c-u:void 0;return{modifiers:a,hasImportantModifier:h,baseClassName:l,maybePostfixModifierPosition:m}};if(t){const o=t+as,a=r;r=i=>i.startsWith(o)?a(i.substring(o.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:i,maybePostfixModifierPosition:void 0}}if(n){const o=r;r=a=>n({className:a,parseClassName:o})}return r},wg=e=>e.endsWith(os)?e.substring(0,e.length-1):e.startsWith(os)?e.substring(1):e,Cg=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(r=>[r,!0]));return r=>{if(r.length<=1)return r;const o=[];let a=[];return r.forEach(i=>{i[0]==="["||t[i]?(o.push(...a.sort(),i),a=[]):a.push(i)}),o.push(...a.sort()),o}},xg=e=>({cache:gg(e.cacheSize),parseClassName:bg(e),sortModifiers:Cg(e),...vg(e)}),Sg=/\s+/,Eg=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:a}=t,i=[],s=e.trim().split(Sg);let u="";for(let c=s.length-1;c>=0;c-=1){const f=s[c],{isExternal:l,modifiers:h,hasImportantModifier:m,baseClassName:y,maybePostfixModifierPosition:w}=n(f);if(l){u=f+(u.length>0?" "+u:u);continue}let v=!!w,p=r(v?y.substring(0,w):y);if(!p){if(!v){u=f+(u.length>0?" "+u:u);continue}if(p=r(y),!p){u=f+(u.length>0?" "+u:u);continue}v=!1}const g=a(h).join(":"),b=m?g+os:g,C=b+p;if(i.includes(C))continue;i.push(C);const x=o(p,v);for(let S=0;S<x.length;++S){const E=x[S];i.push(b+E)}u=f+(u.length>0?" "+u:u)}return u};function Mg(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Gu(t))&&(r&&(r+=" "),r+=n);return r}const Gu=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Gu(e[r]))&&(n&&(n+=" "),n+=t);return n};function Pg(e,...t){let n,r,o,a=i;function i(u){const c=t.reduce((f,l)=>l(f),e());return n=xg(c),r=n.cache.get,o=n.cache.set,a=s,s(u)}function s(u){const c=r(u);if(c)return c;const f=Eg(u,n);return o(u,f),f}return function(){return a(Mg.apply(null,arguments))}}const Lt=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Ku=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Xu=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Dg=/^\d+\/\d+$/,kg=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,_g=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Ng=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Og=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Tg=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ar=e=>Dg.test(e),et=e=>!!e&&!Number.isNaN(Number(e)),Jn=e=>!!e&&Number.isInteger(Number(e)),is=e=>e.endsWith("%")&&et(e.slice(0,-1)),Vn=e=>kg.test(e),Ig=()=>!0,Rg=e=>_g.test(e)&&!Ng.test(e),Zu=()=>!1,Ag=e=>Og.test(e),Lg=e=>Tg.test(e),$g=e=>!De(e)&&!ke(e),Fg=e=>Lr(e,nc,Zu),De=e=>Ku.test(e),br=e=>Lr(e,rc,Rg),ss=e=>Lr(e,Bg,et),Qu=e=>Lr(e,ec,Zu),zg=e=>Lr(e,tc,Lg),ca=e=>Lr(e,oc,Ag),ke=e=>Xu.test(e),vo=e=>$r(e,rc),Hg=e=>$r(e,jg),Ju=e=>$r(e,ec),Vg=e=>$r(e,nc),Wg=e=>$r(e,tc),da=e=>$r(e,oc,!0),Lr=(e,t,n)=>{const r=Ku.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},$r=(e,t,n=!1)=>{const r=Xu.exec(e);return r?r[1]?t(r[1]):n:!1},ec=e=>e==="position"||e==="percentage",tc=e=>e==="image"||e==="url",nc=e=>e==="length"||e==="size"||e==="bg-size",rc=e=>e==="length",Bg=e=>e==="number",jg=e=>e==="family-name",oc=e=>e==="shadow",Yg=Pg(()=>{const e=Lt("color"),t=Lt("font"),n=Lt("text"),r=Lt("font-weight"),o=Lt("tracking"),a=Lt("leading"),i=Lt("breakpoint"),s=Lt("container"),u=Lt("spacing"),c=Lt("radius"),f=Lt("shadow"),l=Lt("inset-shadow"),h=Lt("text-shadow"),m=Lt("drop-shadow"),y=Lt("blur"),w=Lt("perspective"),v=Lt("aspect"),p=Lt("ease"),g=Lt("animate"),b=()=>["auto","avoid","all","avoid-page","page","left","right","column"],C=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],x=()=>[...C(),ke,De],S=()=>["auto","hidden","clip","visible","scroll"],E=()=>["auto","contain","none"],M=()=>[ke,De,u],k=()=>[Ar,"full","auto",...M()],T=()=>[Jn,"none","subgrid",ke,De],R=()=>["auto",{span:["full",Jn,ke,De]},Jn,ke,De],F=()=>[Jn,"auto",ke,De],V=()=>["auto","min","max","fr",ke,De],$=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],L=()=>["start","end","center","stretch","center-safe","end-safe"],N=()=>["auto",...M()],H=()=>[Ar,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...M()],_=()=>[e,ke,De],z=()=>[...C(),Ju,Qu,{position:[ke,De]}],B=()=>["no-repeat",{repeat:["","x","y","space","round"]}],A=()=>["auto","cover","contain",Vg,Fg,{size:[ke,De]}],j=()=>[is,vo,br],Y=()=>["","none","full",c,ke,De],U=()=>["",et,vo,br],ne=()=>["solid","dashed","dotted","double"],te=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],J=()=>[et,is,Ju,Qu],G=()=>["","none",y,ke,De],q=()=>["none",et,ke,De],Z=()=>["none",et,ke,De],O=()=>[et,ke,De],I=()=>[Ar,"full",...M()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Vn],breakpoint:[Vn],color:[Ig],container:[Vn],"drop-shadow":[Vn],ease:["in","out","in-out"],font:[$g],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Vn],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Vn],shadow:[Vn],spacing:["px",et],text:[Vn],"text-shadow":[Vn],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ar,De,ke,v]}],container:["container"],columns:[{columns:[et,De,ke,s]}],"break-after":[{"break-after":b()}],"break-before":[{"break-before":b()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:E()}],"overscroll-x":[{"overscroll-x":E()}],"overscroll-y":[{"overscroll-y":E()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:k()}],"inset-x":[{"inset-x":k()}],"inset-y":[{"inset-y":k()}],start:[{start:k()}],end:[{end:k()}],top:[{top:k()}],right:[{right:k()}],bottom:[{bottom:k()}],left:[{left:k()}],visibility:["visible","invisible","collapse"],z:[{z:[Jn,"auto",ke,De]}],basis:[{basis:[Ar,"full","auto",s,...M()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[et,Ar,"auto","initial","none",De]}],grow:[{grow:["",et,ke,De]}],shrink:[{shrink:["",et,ke,De]}],order:[{order:[Jn,"first","last","none",ke,De]}],"grid-cols":[{"grid-cols":T()}],"col-start-end":[{col:R()}],"col-start":[{"col-start":F()}],"col-end":[{"col-end":F()}],"grid-rows":[{"grid-rows":T()}],"row-start-end":[{row:R()}],"row-start":[{"row-start":F()}],"row-end":[{"row-end":F()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":V()}],"auto-rows":[{"auto-rows":V()}],gap:[{gap:M()}],"gap-x":[{"gap-x":M()}],"gap-y":[{"gap-y":M()}],"justify-content":[{justify:[...$(),"normal"]}],"justify-items":[{"justify-items":[...L(),"normal"]}],"justify-self":[{"justify-self":["auto",...L()]}],"align-content":[{content:["normal",...$()]}],"align-items":[{items:[...L(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...L(),{baseline:["","last"]}]}],"place-content":[{"place-content":$()}],"place-items":[{"place-items":[...L(),"baseline"]}],"place-self":[{"place-self":["auto",...L()]}],p:[{p:M()}],px:[{px:M()}],py:[{py:M()}],ps:[{ps:M()}],pe:[{pe:M()}],pt:[{pt:M()}],pr:[{pr:M()}],pb:[{pb:M()}],pl:[{pl:M()}],m:[{m:N()}],mx:[{mx:N()}],my:[{my:N()}],ms:[{ms:N()}],me:[{me:N()}],mt:[{mt:N()}],mr:[{mr:N()}],mb:[{mb:N()}],ml:[{ml:N()}],"space-x":[{"space-x":M()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":M()}],"space-y-reverse":["space-y-reverse"],size:[{size:H()}],w:[{w:[s,"screen",...H()]}],"min-w":[{"min-w":[s,"screen","none",...H()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[i]},...H()]}],h:[{h:["screen","lh",...H()]}],"min-h":[{"min-h":["screen","lh","none",...H()]}],"max-h":[{"max-h":["screen","lh",...H()]}],"font-size":[{text:["base",n,vo,br]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,ke,ss]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",is,De]}],"font-family":[{font:[Hg,De,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,ke,De]}],"line-clamp":[{"line-clamp":[et,"none",ke,ss]}],leading:[{leading:[a,...M()]}],"list-image":[{"list-image":["none",ke,De]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ke,De]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:_()}],"text-color":[{text:_()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ne(),"wavy"]}],"text-decoration-thickness":[{decoration:[et,"from-font","auto",ke,br]}],"text-decoration-color":[{decoration:_()}],"underline-offset":[{"underline-offset":[et,"auto",ke,De]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:M()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ke,De]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ke,De]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:z()}],"bg-repeat":[{bg:B()}],"bg-size":[{bg:A()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Jn,ke,De],radial:["",ke,De],conic:[Jn,ke,De]},Wg,zg]}],"bg-color":[{bg:_()}],"gradient-from-pos":[{from:j()}],"gradient-via-pos":[{via:j()}],"gradient-to-pos":[{to:j()}],"gradient-from":[{from:_()}],"gradient-via":[{via:_()}],"gradient-to":[{to:_()}],rounded:[{rounded:Y()}],"rounded-s":[{"rounded-s":Y()}],"rounded-e":[{"rounded-e":Y()}],"rounded-t":[{"rounded-t":Y()}],"rounded-r":[{"rounded-r":Y()}],"rounded-b":[{"rounded-b":Y()}],"rounded-l":[{"rounded-l":Y()}],"rounded-ss":[{"rounded-ss":Y()}],"rounded-se":[{"rounded-se":Y()}],"rounded-ee":[{"rounded-ee":Y()}],"rounded-es":[{"rounded-es":Y()}],"rounded-tl":[{"rounded-tl":Y()}],"rounded-tr":[{"rounded-tr":Y()}],"rounded-br":[{"rounded-br":Y()}],"rounded-bl":[{"rounded-bl":Y()}],"border-w":[{border:U()}],"border-w-x":[{"border-x":U()}],"border-w-y":[{"border-y":U()}],"border-w-s":[{"border-s":U()}],"border-w-e":[{"border-e":U()}],"border-w-t":[{"border-t":U()}],"border-w-r":[{"border-r":U()}],"border-w-b":[{"border-b":U()}],"border-w-l":[{"border-l":U()}],"divide-x":[{"divide-x":U()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":U()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ne(),"hidden","none"]}],"divide-style":[{divide:[...ne(),"hidden","none"]}],"border-color":[{border:_()}],"border-color-x":[{"border-x":_()}],"border-color-y":[{"border-y":_()}],"border-color-s":[{"border-s":_()}],"border-color-e":[{"border-e":_()}],"border-color-t":[{"border-t":_()}],"border-color-r":[{"border-r":_()}],"border-color-b":[{"border-b":_()}],"border-color-l":[{"border-l":_()}],"divide-color":[{divide:_()}],"outline-style":[{outline:[...ne(),"none","hidden"]}],"outline-offset":[{"outline-offset":[et,ke,De]}],"outline-w":[{outline:["",et,vo,br]}],"outline-color":[{outline:_()}],shadow:[{shadow:["","none",f,da,ca]}],"shadow-color":[{shadow:_()}],"inset-shadow":[{"inset-shadow":["none",l,da,ca]}],"inset-shadow-color":[{"inset-shadow":_()}],"ring-w":[{ring:U()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:_()}],"ring-offset-w":[{"ring-offset":[et,br]}],"ring-offset-color":[{"ring-offset":_()}],"inset-ring-w":[{"inset-ring":U()}],"inset-ring-color":[{"inset-ring":_()}],"text-shadow":[{"text-shadow":["none",h,da,ca]}],"text-shadow-color":[{"text-shadow":_()}],opacity:[{opacity:[et,ke,De]}],"mix-blend":[{"mix-blend":[...te(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":te()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[et]}],"mask-image-linear-from-pos":[{"mask-linear-from":J()}],"mask-image-linear-to-pos":[{"mask-linear-to":J()}],"mask-image-linear-from-color":[{"mask-linear-from":_()}],"mask-image-linear-to-color":[{"mask-linear-to":_()}],"mask-image-t-from-pos":[{"mask-t-from":J()}],"mask-image-t-to-pos":[{"mask-t-to":J()}],"mask-image-t-from-color":[{"mask-t-from":_()}],"mask-image-t-to-color":[{"mask-t-to":_()}],"mask-image-r-from-pos":[{"mask-r-from":J()}],"mask-image-r-to-pos":[{"mask-r-to":J()}],"mask-image-r-from-color":[{"mask-r-from":_()}],"mask-image-r-to-color":[{"mask-r-to":_()}],"mask-image-b-from-pos":[{"mask-b-from":J()}],"mask-image-b-to-pos":[{"mask-b-to":J()}],"mask-image-b-from-color":[{"mask-b-from":_()}],"mask-image-b-to-color":[{"mask-b-to":_()}],"mask-image-l-from-pos":[{"mask-l-from":J()}],"mask-image-l-to-pos":[{"mask-l-to":J()}],"mask-image-l-from-color":[{"mask-l-from":_()}],"mask-image-l-to-color":[{"mask-l-to":_()}],"mask-image-x-from-pos":[{"mask-x-from":J()}],"mask-image-x-to-pos":[{"mask-x-to":J()}],"mask-image-x-from-color":[{"mask-x-from":_()}],"mask-image-x-to-color":[{"mask-x-to":_()}],"mask-image-y-from-pos":[{"mask-y-from":J()}],"mask-image-y-to-pos":[{"mask-y-to":J()}],"mask-image-y-from-color":[{"mask-y-from":_()}],"mask-image-y-to-color":[{"mask-y-to":_()}],"mask-image-radial":[{"mask-radial":[ke,De]}],"mask-image-radial-from-pos":[{"mask-radial-from":J()}],"mask-image-radial-to-pos":[{"mask-radial-to":J()}],"mask-image-radial-from-color":[{"mask-radial-from":_()}],"mask-image-radial-to-color":[{"mask-radial-to":_()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":C()}],"mask-image-conic-pos":[{"mask-conic":[et]}],"mask-image-conic-from-pos":[{"mask-conic-from":J()}],"mask-image-conic-to-pos":[{"mask-conic-to":J()}],"mask-image-conic-from-color":[{"mask-conic-from":_()}],"mask-image-conic-to-color":[{"mask-conic-to":_()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:z()}],"mask-repeat":[{mask:B()}],"mask-size":[{mask:A()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ke,De]}],filter:[{filter:["","none",ke,De]}],blur:[{blur:G()}],brightness:[{brightness:[et,ke,De]}],contrast:[{contrast:[et,ke,De]}],"drop-shadow":[{"drop-shadow":["","none",m,da,ca]}],"drop-shadow-color":[{"drop-shadow":_()}],grayscale:[{grayscale:["",et,ke,De]}],"hue-rotate":[{"hue-rotate":[et,ke,De]}],invert:[{invert:["",et,ke,De]}],saturate:[{saturate:[et,ke,De]}],sepia:[{sepia:["",et,ke,De]}],"backdrop-filter":[{"backdrop-filter":["","none",ke,De]}],"backdrop-blur":[{"backdrop-blur":G()}],"backdrop-brightness":[{"backdrop-brightness":[et,ke,De]}],"backdrop-contrast":[{"backdrop-contrast":[et,ke,De]}],"backdrop-grayscale":[{"backdrop-grayscale":["",et,ke,De]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[et,ke,De]}],"backdrop-invert":[{"backdrop-invert":["",et,ke,De]}],"backdrop-opacity":[{"backdrop-opacity":[et,ke,De]}],"backdrop-saturate":[{"backdrop-saturate":[et,ke,De]}],"backdrop-sepia":[{"backdrop-sepia":["",et,ke,De]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":M()}],"border-spacing-x":[{"border-spacing-x":M()}],"border-spacing-y":[{"border-spacing-y":M()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ke,De]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[et,"initial",ke,De]}],ease:[{ease:["linear","initial",p,ke,De]}],delay:[{delay:[et,ke,De]}],animate:[{animate:["none",g,ke,De]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,ke,De]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:q()}],"rotate-x":[{"rotate-x":q()}],"rotate-y":[{"rotate-y":q()}],"rotate-z":[{"rotate-z":q()}],scale:[{scale:Z()}],"scale-x":[{"scale-x":Z()}],"scale-y":[{"scale-y":Z()}],"scale-z":[{"scale-z":Z()}],"scale-3d":["scale-3d"],skew:[{skew:O()}],"skew-x":[{"skew-x":O()}],"skew-y":[{"skew-y":O()}],transform:[{transform:[ke,De,"","none","gpu","cpu"]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:I()}],"translate-x":[{"translate-x":I()}],"translate-y":[{"translate-y":I()}],"translate-z":[{"translate-z":I()}],"translate-none":["translate-none"],accent:[{accent:_()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:_()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ke,De]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ke,De]}],fill:[{fill:["none",..._()]}],"stroke-w":[{stroke:[et,vo,br,ss]}],stroke:[{stroke:["none",..._()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function Se(...e){return Yg(ju(e))}function Ug(e){const{className:t,items:n}=e,[r,o]=D.useState(null),a=i=>{o(r===i?null:i)};return P.jsx("div",{"data-u-comp":"accordion",className:Se("univer-divide-x-0 univer-divide-y univer-divide-solid univer-divide-gray-200 dark:!univer-divide-gray-600",t),children:n.map((i,s)=>P.jsxs("div",{children:[P.jsxs("button",{className:"univer-box-border univer-flex univer-w-full univer-cursor-pointer univer-items-center univer-gap-1.5 univer-border-none univer-bg-transparent univer-p-4 univer-text-left univer-text-gray-700 hover:univer-text-gray-900 focus:univer-outline-none dark:!univer-text-gray-200 dark:hover:!univer-text-white",type:"button",onClick:()=>a(s),children:[P.jsx(Nu,{className:Se("univer-size-2.5 univer-flex-shrink-0 univer-transition-transform",{"-univer-rotate-90":r!==s,"univer-rotate-0":r===s})}),P.jsx("span",{className:"univer-font-medium",children:i.label})]}),P.jsx("div",{className:Se("univer-overflow-hidden univer-transition-[max-height,opacity] univer-duration-500 univer-ease-in-out",{"univer-max-h-screen":r===s,"univer-max-h-0":r!==s}),children:P.jsx("div",{className:"univer-box-border univer-px-4 univer-py-1.5",children:i.children})})]},s))})}const ac=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,ic=ju,ls=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return ic(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:a}=t,i=Object.keys(o).map(c=>{const f=n==null?void 0:n[c],l=a==null?void 0:a[c];if(f===null)return null;const h=ac(f)||ac(l);return o[c][h]}),s=n&&Object.entries(n).reduce((c,f)=>{let[l,h]=f;return h===void 0||(c[l]=h),c},{}),u=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,f)=>{let{class:l,className:h,...m}=f;return Object.entries(m).every(y=>{let[w,v]=y;return Array.isArray(v)?v.includes({...a,...s}[w]):{...a,...s}[w]===v})?[...c,l,h]:c},[]);return ic(e,i,u,n==null?void 0:n.class,n==null?void 0:n.className)},qg=ls(`
1242
+ (function(ve,D){typeof exports=="object"&&typeof module<"u"?D(exports,require("react"),require("react-dom"),require("react/jsx-runtime"),require("react-dom/client"),require("@univerjs/themes")):typeof define=="function"&&define.amd?define(["exports","react","react-dom","react/jsx-runtime","react-dom/client","@univerjs/themes"],D):(ve=typeof globalThis<"u"?globalThis:ve||self,D(ve.UniverDesign={},ve.React,ve.ReactDOM,ve.React,ve.ReactDOM,ve.UniverThemes))})(this,function(ve,D,It,P,jp,Pu){"use strict";function Du(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const f=Du(D),ku=Du(It);var vn=function(){return vn=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},vn.apply(this,arguments)},Yp=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},At=D.forwardRef(function(e,t){var n=e.icon,r=e.id,o=e.className,a=e.extend,i=Yp(e,["icon","id","className","extend"]),s="univerjs-icon univerjs-icon-".concat(r," ").concat(o||"").trim(),u=D.useRef("_".concat(Gp()));return Nu(n,"".concat(r),{defIds:n.defIds,idSuffix:u.current},vn({ref:t,className:s},i),a)});function Nu(e,t,n,r,o){return D.createElement(e.tag,vn(vn({key:t},Up(e,n,o)),r),(qp(e,n).children||[]).map(function(a,i){return Nu(a,"".concat(t,"-").concat(e.tag,"-").concat(i),n,void 0,o)}))}function Up(e,t,n){var r=vn({},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(a){var i=a[0],s=a[1];i==="mask"&&typeof s=="string"&&(r[i]=s.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(a){var i=a[0],s=a[1];typeof s=="string"&&(r[i]=s.replace(/url\(#(.*)\)/,"url(#$1".concat(t.idSuffix,")")))})),r}function qp(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)?vn(vn({},e),{children:e.children.map(function(o){return typeof o.attrs.id=="string"&&r&&r.includes(o.attrs.id)?vn(vn({},o),{attrs:vn(vn({},o.attrs),{id:o.attrs.id+t.idSuffix})}):o})}):e}function Gp(){return Math.random().toString(36).substring(2,8)}At.displayName="UniverIcon";var Kp={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 17 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M8.87598 11.8327C8.87598 11.5013 9.14461 11.2327 9.47598 11.2327H11.476C11.8073 11.2327 12.076 11.5013 12.076 11.8327C12.076 12.164 11.8073 12.4327 11.476 12.4327H9.47598C9.14461 12.4327 8.87598 12.164 8.87598 11.8327Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M4.80898 11.2327C4.47761 11.2327 4.20898 11.5013 4.20898 11.8327C4.20898 12.164 4.47761 12.4327 4.80898 12.4327H6.80898C7.14036 12.4327 7.40898 12.164 7.40898 11.8327C7.40898 11.5013 7.14036 11.2327 6.80898 11.2327H4.80898Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M8.87598 9.16592C8.87598 8.83455 9.14461 8.56592 9.47598 8.56592H11.476C11.8073 8.56592 12.076 8.83455 12.076 9.16592C12.076 9.49729 11.8073 9.76592 11.476 9.76592H9.47598C9.14461 9.76592 8.87598 9.49729 8.87598 9.16592Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M4.80898 8.56592C4.47761 8.56592 4.20898 8.83455 4.20898 9.16592C4.20898 9.49729 4.47761 9.76592 4.80898 9.76592H6.80898C7.14036 9.76592 7.40898 9.49729 7.40898 9.16592C7.40898 8.83455 7.14036 8.56592 6.80898 8.56592H4.80898Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M6.00615 1.69985C6.00615 1.36848 5.73752 1.09985 5.40615 1.09985C5.07478 1.09985 4.80615 1.36848 4.80615 1.69985V2.34009H3.64248C2.20654 2.34009 1.04248 3.50415 1.04248 4.94009V12.3C1.04248 13.7359 2.20654 14.9 3.64248 14.9H12.6425C14.0784 14.9 15.2425 13.7359 15.2425 12.3V4.94009C15.2425 3.50415 14.0784 2.34009 12.6425 2.34009H11.4798V1.69985C11.4798 1.36848 11.2112 1.09985 10.8798 1.09985C10.5484 1.09985 10.2798 1.36848 10.2798 1.69985V2.34009H6.00615V1.69985ZM14.0425 5.97021V4.94009C14.0425 4.16689 13.4157 3.54009 12.6425 3.54009H11.4798V4.09985C11.4798 4.43122 11.2112 4.69985 10.8798 4.69985C10.5484 4.69985 10.2798 4.43122 10.2798 4.09985V3.54009H6.00615V4.09985C6.00615 4.43122 5.73752 4.69985 5.40615 4.69985C5.07478 4.69985 4.80615 4.43122 4.80615 4.09985V3.54009H3.64248C2.86928 3.54009 2.24248 4.16689 2.24248 4.94009V5.97021H14.0425ZM2.24248 7.17021H14.0425V12.3C14.0425 13.0731 13.4157 13.7 12.6425 13.7H3.64248C2.86928 13.7 2.24248 13.0732 2.24248 12.3V7.17021Z",fillRule:"evenodd",clipRule:"evenodd"}}]},Ji=D.forwardRef(function(e,t){return D.createElement(At,Object.assign({},e,{id:"calendar-icon",ref:t,icon:Kp}))});Ji.displayName="CalendarIcon";var Xp={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"}}]},Rr=D.forwardRef(function(e,t){return D.createElement(At,Object.assign({},e,{id:"check-mark-icon",ref:t,icon:Xp}))});Rr.displayName="CheckMarkIcon";var Zp={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:"M3.71274 2.86421C3.47843 2.6299 3.09853 2.6299 2.86421 2.86421C2.6299 3.09853 2.6299 3.47843 2.86421 3.71274L7.15154 8.00007L2.86421 12.2874C2.6299 12.5217 2.6299 12.9016 2.86421 13.1359C3.09853 13.3702 3.47843 13.3702 3.71274 13.1359L8.00007 8.84859L12.2874 13.1359C12.5217 13.3702 12.9016 13.3702 13.1359 13.1359C13.3702 12.9016 13.3702 12.5217 13.1359 12.2874L8.84859 8.00007L13.1359 3.71274C13.3702 3.47843 13.3702 3.09853 13.1359 2.86421C12.9016 2.6299 12.5217 2.6299 12.2874 2.86421L8.00007 7.15154L3.71274 2.86421Z"}}]},ua=D.forwardRef(function(e,t){return D.createElement(At,Object.assign({},e,{id:"close-icon",ref:t,icon:Zp}))});ua.displayName="CloseIcon";var Qp={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M10.5547 14.1884C10.2599 14.5214 9.74019 14.5214 9.4454 14.1884L3.71321 7.71335C3.29002 7.23532 3.6294 6.48161 4.26784 6.48161L15.7322 6.48161C16.3707 6.48161 16.7101 7.23532 16.2869 7.71335L10.5547 14.1884Z"}}]},_u=D.forwardRef(function(e,t){return D.createElement(At,Object.assign({},e,{id:"down-icon",ref:t,icon:Qp}))});_u.displayName="DownIcon";var Jp={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.85869 12.9216C8.38445 13.4708 7.61555 13.4708 7.14131 12.9216L0.358114 5.06726C-0.406895 4.18144 0.134916 2.66683 1.2168 2.66683L14.7832 2.66683C15.8651 2.66683 16.4069 4.18144 15.6419 5.06726L8.85869 12.9216Z"}}]},Ou=D.forwardRef(function(e,t){return D.createElement(At,Object.assign({},e,{id:"dropdown-icon",ref:t,icon:Jp}))});Ou.displayName="DropdownIcon";var eg={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:"M15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1C11.866 1 15 4.13401 15 8ZM10.3097 5.69014C10.544 5.92445 10.544 6.30435 10.3097 6.53867L8.84843 7.9999L10.3099 9.46137C10.5442 9.69569 10.5442 10.0756 10.3099 10.3099C10.0756 10.5442 9.69569 10.5442 9.46137 10.3099L7.9999 8.84843L6.53842 10.3099C6.30411 10.5442 5.92421 10.5442 5.6899 10.3099C5.45558 10.0756 5.45558 9.69569 5.6899 9.46137L7.15137 7.9999L5.69014 6.53867C5.45583 6.30435 5.45583 5.92445 5.69014 5.69014C5.92445 5.45583 6.30435 5.45583 6.53867 5.69014L7.9999 7.15137L9.46113 5.69014C9.69544 5.45583 10.0753 5.45583 10.3097 5.69014Z",fillRule:"evenodd",clipRule:"evenodd"}}]},Tu=D.forwardRef(function(e,t){return D.createElement(At,Object.assign({},e,{id:"error-icon",ref:t,icon:eg}))});Tu.displayName="ErrorIcon";var tg={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.4216 4.46432L15.6036 7.6463C15.7988 7.84156 15.7988 8.15814 15.6036 8.3534L12.4216 11.5354C12.2263 11.7306 11.9097 11.7306 11.7145 11.5354C11.5192 11.3401 11.5192 11.0235 11.7145 10.8283L14.0429 8.49985H0.75C0.473858 8.49985 0.25 8.27599 0.25 7.99985C0.25 7.72371 0.473857 7.49985 0.749999 7.49985H14.0429L11.7145 5.17142C11.5192 4.97616 11.5192 4.65958 11.7145 4.46432C11.9097 4.26906 12.2263 4.26906 12.4216 4.46432Z",fillRule:"evenodd",clipRule:"evenodd"}}]},Iu=D.forwardRef(function(e,t){return D.createElement(At,Object.assign({},e,{id:"guide-icon",ref:t,icon:tg}))});Iu.displayName="GuideIcon";var ng={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.00016 1.33203C6.68162 1.33203 5.39269 1.72302 4.29636 2.45557C3.20004 3.18811 2.34555 4.2293 1.84097 5.44747C1.33638 6.66565 1.20436 8.00609 1.4616 9.2993C1.71883 10.5925 2.35377 11.7804 3.28612 12.7127C4.21847 13.6451 5.40636 14.28 6.69956 14.5373C7.99277 14.7945 9.33321 14.6625 10.5514 14.1579C11.7696 13.6533 12.8108 12.7988 13.5433 11.7025C14.2758 10.6062 14.6668 9.31724 14.6668 7.9987C14.6649 6.23118 13.9619 4.53662 12.7121 3.2868C11.4622 2.03697 9.76768 1.33397 8.00016 1.33203ZM7.66683 3.9987C7.86461 3.9987 8.05795 4.05735 8.2224 4.16723C8.38685 4.27711 8.51502 4.43329 8.59071 4.61601C8.6664 4.79874 8.6862 4.99981 8.64762 5.19379C8.60903 5.38777 8.51379 5.56595 8.37394 5.7058C8.23409 5.84566 8.0559 5.9409 7.86192 5.97948C7.66794 6.01807 7.46687 5.99826 7.28415 5.92258C7.10142 5.84689 6.94524 5.71872 6.83536 5.55427C6.72548 5.38982 6.66683 5.19648 6.66683 4.9987C6.66683 4.73348 6.77219 4.47913 6.95972 4.29159C7.14726 4.10405 7.40162 3.9987 7.66683 3.9987ZM9.3335 11.332H6.66683C6.49002 11.332 6.32045 11.2618 6.19543 11.1368C6.0704 11.0117 6.00016 10.8422 6.00016 10.6654C6.00016 10.4886 6.0704 10.319 6.19543 10.194C6.32045 10.0689 6.49002 9.9987 6.66683 9.9987H7.3335V7.9987H6.66683C6.49002 7.9987 6.32045 7.92846 6.19543 7.80343C6.0704 7.67841 6.00016 7.50884 6.00016 7.33203C6.00016 7.15522 6.0704 6.98565 6.19543 6.86063C6.32045 6.7356 6.49002 6.66536 6.66683 6.66536H8.00016C8.17698 6.66536 8.34655 6.7356 8.47157 6.86063C8.59659 6.98565 8.66683 7.15522 8.66683 7.33203V9.9987H9.3335C9.51031 9.9987 9.67988 10.0689 9.8049 10.194C9.92993 10.319 10.0002 10.4886 10.0002 10.6654C10.0002 10.8422 9.92993 11.0117 9.8049 11.1368C9.67988 11.2618 9.51031 11.332 9.3335 11.332Z"}}]},Ru=D.forwardRef(function(e,t){return D.createElement(At,Object.assign({},e,{id:"info-icon",ref:t,icon:ng}))});Ru.displayName="InfoIcon";var rg={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:"#0B9EFB",d:"M8.79993 14.0166C8.79993 14.4585 8.44176 14.8166 7.99993 14.8166C4.23529 14.8166 1.18345 11.7648 1.18345 8.00017C1.18345 4.23554 4.23529 1.18369 7.99993 1.1837C11.7646 1.1837 14.8164 4.23554 14.8164 8.00017C14.8164 8.442 14.4582 8.80017 14.0164 8.80017C13.5746 8.80017 13.2164 8.442 13.2164 8.00017C13.2164 5.11919 10.8809 2.7837 7.99993 2.7837C5.11895 2.7837 2.78345 5.11919 2.78345 8.00017C2.78345 10.8812 5.11895 13.2166 7.99993 13.2166C8.44176 13.2166 8.79993 13.5748 8.79993 14.0166Z",fillOpacity:.2,fillRule:"evenodd",clipRule:"evenodd"}},{tag:"path",attrs:{fill:"#0B9EFB",d:"M7.20007 1.98384C7.20007 1.54201 7.55824 1.18384 8.00007 1.18384C11.7647 1.18384 14.8165 4.23568 14.8165 8.00032C14.8165 11.765 11.7647 14.8168 8.00007 14.8168C4.23543 14.8168 1.18359 11.765 1.18359 8.00032C1.18359 7.55849 1.54177 7.20031 1.98359 7.20031C2.42542 7.20031 2.78359 7.55849 2.78359 8.00032C2.78359 10.8813 5.11909 13.2168 8.00007 13.2168C10.8811 13.2168 13.2165 10.8813 13.2165 8.00032C13.2165 5.11933 10.8811 2.78384 8.00007 2.78384C7.55824 2.78384 7.20007 2.42567 7.20007 1.98384Z",fillRule:"evenodd",clipRule:"evenodd"}}]},Au=D.forwardRef(function(e,t){return D.createElement(At,Object.assign({},e,{id:"loading-multi-icon",ref:t,icon:rg}))});Au.displayName="LoadingMultiIcon";var og={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"}}]},es=D.forwardRef(function(e,t){return D.createElement(At,Object.assign({},e,{id:"more-down-icon",ref:t,icon:og}))});es.displayName="MoreDownIcon";var ag={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 17 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M10.3536 12.3536C10.1583 12.5488 9.84171 12.5488 9.64645 12.3536L6.64645 9.35355C6.45118 9.15829 6.45118 8.84171 6.64645 8.64645L9.64645 5.64645C9.84171 5.45118 10.1583 5.45118 10.3536 5.64645C10.5488 5.84171 10.5488 6.15829 10.3536 6.35355L7.70711 9L10.3536 11.6464C10.5488 11.8417 10.5488 12.1583 10.3536 12.3536Z",fillRule:"evenodd",clipRule:"evenodd"}}]},Lu=D.forwardRef(function(e,t){return D.createElement(At,Object.assign({},e,{id:"more-left-icon",ref:t,icon:ag}))});Lu.displayName="MoreLeftIcon";var ig={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:"M6.14645 4.64645C6.34171 4.45118 6.65829 4.45118 6.85355 4.64645L9.85355 7.64645C10.0488 7.84171 10.0488 8.15829 9.85355 8.35355L6.85355 11.3536C6.65829 11.5488 6.34171 11.5488 6.14645 11.3536C5.95118 11.1583 5.95118 10.8417 6.14645 10.6464L8.79289 8L6.14645 5.35355C5.95118 5.15829 5.95118 4.84171 6.14645 4.64645Z",fillRule:"evenodd",clipRule:"evenodd"}}]},ts=D.forwardRef(function(e,t){return D.createElement(At,Object.assign({},e,{id:"more-right-icon",ref:t,icon:ig}))});ts.displayName="MoreRightIcon";var sg={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:"M4.64645 9.85355C4.45118 9.65829 4.45118 9.34171 4.64645 9.14645L7.64645 6.14645C7.84171 5.95118 8.15829 5.95118 8.35355 6.14645L11.3536 9.14645C11.5488 9.34171 11.5488 9.65829 11.3536 9.85355C11.1583 10.0488 10.8417 10.0488 10.6464 9.85355L8 7.20711L5.35355 9.85355C5.15829 10.0488 4.84171 10.0488 4.64645 9.85355Z",fillRule:"evenodd",clipRule:"evenodd"}}]},$u=D.forwardRef(function(e,t){return D.createElement(At,Object.assign({},e,{id:"more-up-icon",ref:t,icon:sg}))});$u.displayName="MoreUpIcon";var lg={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.65252 5.41446C5.86681 5.53124 6.00016 5.75579 6.00016 5.99984V9.99984C6.00016 10.368 5.70168 10.6665 5.3335 10.6665C4.96531 10.6665 4.66683 10.368 4.66683 9.99984V7.22312L4.36151 7.42005C4.05209 7.61961 3.63948 7.53056 3.43992 7.22115C3.24035 6.91173 3.3294 6.49912 3.63882 6.29956L4.97215 5.43959C5.17724 5.30731 5.43822 5.29767 5.65252 5.41446Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M12.3335 5.99984C12.3335 5.75579 12.2001 5.53124 11.9858 5.41446C11.7716 5.29767 11.5106 5.30731 11.3055 5.43959L9.97215 6.29956C9.66274 6.49912 9.57368 6.91173 9.77325 7.22115C9.97281 7.53056 10.3854 7.61961 10.6948 7.42005L11.0002 7.22312V9.99984C11.0002 10.368 11.2986 10.6665 11.6668 10.6665C12.035 10.6665 12.3335 10.368 12.3335 9.99984V5.99984Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M8.00008 5.99984C8.36827 5.99984 8.66675 6.29831 8.66675 6.6665V6.99984C8.66675 7.36803 8.36827 7.6665 8.00008 7.6665C7.63189 7.6665 7.33341 7.36803 7.33341 6.99984V6.6665C7.33341 6.29831 7.63189 5.99984 8.00008 5.99984Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M8.66675 8.99984C8.66675 8.63165 8.36827 8.33317 8.00008 8.33317C7.63189 8.33317 7.33341 8.63165 7.33341 8.99984V9.33317C7.33341 9.70136 7.63189 9.99984 8.00008 9.99984C8.36827 9.99984 8.66675 9.70136 8.66675 9.33317V8.99984Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M0.666748 2.99984C0.666748 2.26346 1.2637 1.6665 2.00008 1.6665H14.0001C14.7365 1.6665 15.3334 2.26346 15.3334 2.99984V12.9998C15.3334 13.7362 14.7365 14.3332 14.0001 14.3332H2.00008C1.26371 14.3332 0.666748 13.7362 0.666748 12.9998V2.99984ZM14.0001 2.99984H2.00008V12.9998H14.0001V2.99984Z",fillRule:"evenodd",clipRule:"evenodd"}}]},Fu=D.forwardRef(function(e,t){return D.createElement(At,Object.assign({},e,{id:"one-to-one-icon",ref:t,icon:lg}))});Fu.displayName="OneToOneIcon";var ug={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 15C11.866 15 15 11.866 15 8C15 4.13401 11.866 1 8 1C4.13401 1 1 4.13401 1 8C1 11.866 4.13401 15 8 15ZM11.7245 6.42417C11.9588 6.18985 11.9588 5.80995 11.7245 5.57564C11.4901 5.34132 11.1102 5.34132 10.8759 5.57564L7.3002 9.15137L5.72446 7.57564C5.49014 7.34132 5.11025 7.34132 4.87593 7.57564C4.64162 7.80995 4.64162 8.18985 4.87593 8.42417L6.87593 10.4242C7.11025 10.6585 7.49014 10.6585 7.72446 10.4242L11.7245 6.42417Z",fillRule:"evenodd",clipRule:"evenodd"}}]},zu=D.forwardRef(function(e,t){return D.createElement(At,Object.assign({},e,{id:"success-icon",ref:t,icon:ug}))});zu.displayName="SuccessIcon";var cg={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:"M15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1C11.866 1 15 4.13401 15 8ZM8.00008 12.3671C8.46031 12.3671 8.83342 11.994 8.83342 11.5338C8.83342 11.0735 8.46031 10.7004 8.00008 10.7004C7.53985 10.7004 7.16675 11.0735 7.16675 11.5338C7.16675 11.994 7.53985 12.3671 8.00008 12.3671ZM8.5999 4.4335C8.5999 4.10213 8.33127 3.8335 7.9999 3.8335C7.66853 3.8335 7.3999 4.10213 7.3999 4.4335V9.36683C7.3999 9.6982 7.66853 9.96683 7.9999 9.96683C8.33127 9.96683 8.5999 9.6982 8.5999 9.36683V4.4335Z",fillRule:"evenodd",clipRule:"evenodd"}}]},Hu=D.forwardRef(function(e,t){return D.createElement(At,Object.assign({},e,{id:"warning-icon",ref:t,icon:cg}))});Hu.displayName="WarningIcon";var dg={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.04883 5.38216C8.04883 5.01397 7.75035 4.71549 7.38216 4.71549C7.01397 4.71549 6.71549 5.01397 6.71549 5.38216V6.71897L5.3865 6.7207C5.01831 6.72117 4.72022 7.02004 4.7207 7.38823C4.72118 7.75642 5.02005 8.05451 5.38824 8.05403L6.71549 8.0523V9.38216C6.71549 9.75035 7.01397 10.0488 7.38216 10.0488C7.75035 10.0488 8.04883 9.75035 8.04883 9.38216V8.05056L9.38304 8.04883C9.75123 8.04835 10.0493 7.74948 10.0488 7.38129C10.0484 7.0131 9.74949 6.71502 9.3813 6.7155L8.04883 6.71723V5.38216Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M7.38216 1.04883C3.88437 1.04883 1.04883 3.88437 1.04883 7.38216C1.04883 10.88 3.88437 13.7155 7.38216 13.7155C8.89089 13.7155 10.2764 13.1879 11.3643 12.3072L13.813 14.7559C14.0733 15.0162 14.4954 15.0162 14.7558 14.7559C15.0161 14.4955 15.0161 14.0734 14.7558 13.8131L12.3071 11.3644C13.1879 10.2765 13.7155 8.89095 13.7155 7.38216C13.7155 3.88437 10.88 1.04883 7.38216 1.04883ZM2.38216 7.38216C2.38216 4.62075 4.62075 2.38216 7.38216 2.38216C10.1436 2.38216 12.3822 4.62075 12.3822 7.38216C12.3822 10.1436 10.1436 12.3822 7.38216 12.3822C4.62075 12.3822 2.38216 10.1436 2.38216 7.38216Z",fillRule:"evenodd",clipRule:"evenodd"}}]},Vu=D.forwardRef(function(e,t){return D.createElement(At,Object.assign({},e,{id:"zoom-in-icon",ref:t,icon:dg}))});Vu.displayName="ZoomInIcon";var fg={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:"M4.71549 7.38216C4.71549 7.01397 5.01397 6.71549 5.38216 6.71549H9.38216C9.75035 6.71549 10.0488 7.01397 10.0488 7.38216C10.0488 7.75035 9.75035 8.04883 9.38216 8.04883H5.38216C5.01397 8.04883 4.71549 7.75035 4.71549 7.38216Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M1.04883 7.38216C1.04883 3.88437 3.88437 1.04883 7.38216 1.04883C10.88 1.04883 13.7155 3.88437 13.7155 7.38216C13.7155 8.89095 13.1879 10.2765 12.3071 11.3644L14.7558 13.8131C15.0161 14.0734 15.0161 14.4955 14.7558 14.7559C14.4954 15.0162 14.0733 15.0162 13.813 14.7559L11.3643 12.3072C10.2764 13.1879 8.89089 13.7155 7.38216 13.7155C3.88437 13.7155 1.04883 10.88 1.04883 7.38216ZM7.38216 2.38216C4.62075 2.38216 2.38216 4.62075 2.38216 7.38216C2.38216 10.1436 4.62075 12.3822 7.38216 12.3822C10.1436 12.3822 12.3822 10.1436 12.3822 7.38216C12.3822 4.62075 10.1436 2.38216 7.38216 2.38216Z",fillRule:"evenodd",clipRule:"evenodd"}}]},Wu=D.forwardRef(function(e,t){return D.createElement(At,Object.assign({},e,{id:"zoom-out-icon",ref:t,icon:fg}))});Wu.displayName="ZoomOutIcon";function Bu(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Bu(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function ju(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Bu(e))&&(r&&(r+=" "),r+=t);return r}const ns="-",vg=e=>{const t=hg(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{const s=i.split(ns);return s[0]===""&&s.length!==1&&s.shift(),Yu(s,t)||mg(i)},getConflictingClassGroupIds:(i,s)=>{const u=n[i]||[];return s&&r[i]?[...u,...r[i]]:u}}},Yu=(e,t)=>{var i;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?Yu(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const a=e.join(ns);return(i=t.validators.find(({validator:s})=>s(a)))==null?void 0:i.classGroupId},Uu=/^\[(.+)\]$/,mg=e=>{if(Uu.test(e)){const t=Uu.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},hg=e=>{const{theme:t,classGroups:n}=e,r={nextPart:new Map,validators:[]};for(const o in n)rs(n[o],r,o,t);return r},rs=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const a=o===""?t:qu(t,o);a.classGroupId=n;return}if(typeof o=="function"){if(pg(o)){rs(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([a,i])=>{rs(i,qu(t,a),n,r)})})},qu=(e,t)=>{let n=e;return t.split(ns).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},pg=e=>e.isThemeGetter,gg=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(a,i)=>{n.set(a,i),t++,t>e&&(t=0,r=n,n=new Map)};return{get(a){let i=n.get(a);if(i!==void 0)return i;if((i=r.get(a))!==void 0)return o(a,i),i},set(a,i){n.has(a)?n.set(a,i):o(a,i)}}},os="!",as=":",yg=as.length,bg=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=o=>{const a=[];let i=0,s=0,u=0,c;for(let y=0;y<o.length;y++){let w=o[y];if(i===0&&s===0){if(w===as){a.push(o.slice(u,y)),u=y+yg;continue}if(w==="/"){c=y;continue}}w==="["?i++:w==="]"?i--:w==="("?s++:w===")"&&s--}const d=a.length===0?o:o.substring(u),l=wg(d),h=l!==d,m=c&&c>u?c-u:void 0;return{modifiers:a,hasImportantModifier:h,baseClassName:l,maybePostfixModifierPosition:m}};if(t){const o=t+as,a=r;r=i=>i.startsWith(o)?a(i.substring(o.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:i,maybePostfixModifierPosition:void 0}}if(n){const o=r;r=a=>n({className:a,parseClassName:o})}return r},wg=e=>e.endsWith(os)?e.substring(0,e.length-1):e.startsWith(os)?e.substring(1):e,Cg=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(r=>[r,!0]));return r=>{if(r.length<=1)return r;const o=[];let a=[];return r.forEach(i=>{i[0]==="["||t[i]?(o.push(...a.sort(),i),a=[]):a.push(i)}),o.push(...a.sort()),o}},xg=e=>({cache:gg(e.cacheSize),parseClassName:bg(e),sortModifiers:Cg(e),...vg(e)}),Sg=/\s+/,Eg=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:a}=t,i=[],s=e.trim().split(Sg);let u="";for(let c=s.length-1;c>=0;c-=1){const d=s[c],{isExternal:l,modifiers:h,hasImportantModifier:m,baseClassName:y,maybePostfixModifierPosition:w}=n(d);if(l){u=d+(u.length>0?" "+u:u);continue}let v=!!w,p=r(v?y.substring(0,w):y);if(!p){if(!v){u=d+(u.length>0?" "+u:u);continue}if(p=r(y),!p){u=d+(u.length>0?" "+u:u);continue}v=!1}const g=a(h).join(":"),b=m?g+os:g,C=b+p;if(i.includes(C))continue;i.push(C);const x=o(p,v);for(let S=0;S<x.length;++S){const E=x[S];i.push(b+E)}u=d+(u.length>0?" "+u:u)}return u};function Mg(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Gu(t))&&(r&&(r+=" "),r+=n);return r}const Gu=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Gu(e[r]))&&(n&&(n+=" "),n+=t);return n};function Pg(e,...t){let n,r,o,a=i;function i(u){const c=t.reduce((d,l)=>l(d),e());return n=xg(c),r=n.cache.get,o=n.cache.set,a=s,s(u)}function s(u){const c=r(u);if(c)return c;const d=Eg(u,n);return o(u,d),d}return function(){return a(Mg.apply(null,arguments))}}const Lt=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Ku=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Xu=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Dg=/^\d+\/\d+$/,kg=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ng=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,_g=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Og=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Tg=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ar=e=>Dg.test(e),et=e=>!!e&&!Number.isNaN(Number(e)),Jn=e=>!!e&&Number.isInteger(Number(e)),is=e=>e.endsWith("%")&&et(e.slice(0,-1)),Vn=e=>kg.test(e),Ig=()=>!0,Rg=e=>Ng.test(e)&&!_g.test(e),Zu=()=>!1,Ag=e=>Og.test(e),Lg=e=>Tg.test(e),$g=e=>!De(e)&&!ke(e),Fg=e=>Lr(e,nc,Zu),De=e=>Ku.test(e),wr=e=>Lr(e,rc,Rg),ss=e=>Lr(e,Bg,et),Qu=e=>Lr(e,ec,Zu),zg=e=>Lr(e,tc,Lg),ca=e=>Lr(e,oc,Ag),ke=e=>Xu.test(e),vo=e=>$r(e,rc),Hg=e=>$r(e,jg),Ju=e=>$r(e,ec),Vg=e=>$r(e,nc),Wg=e=>$r(e,tc),da=e=>$r(e,oc,!0),Lr=(e,t,n)=>{const r=Ku.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},$r=(e,t,n=!1)=>{const r=Xu.exec(e);return r?r[1]?t(r[1]):n:!1},ec=e=>e==="position"||e==="percentage",tc=e=>e==="image"||e==="url",nc=e=>e==="length"||e==="size"||e==="bg-size",rc=e=>e==="length",Bg=e=>e==="number",jg=e=>e==="family-name",oc=e=>e==="shadow",Yg=Pg(()=>{const e=Lt("color"),t=Lt("font"),n=Lt("text"),r=Lt("font-weight"),o=Lt("tracking"),a=Lt("leading"),i=Lt("breakpoint"),s=Lt("container"),u=Lt("spacing"),c=Lt("radius"),d=Lt("shadow"),l=Lt("inset-shadow"),h=Lt("text-shadow"),m=Lt("drop-shadow"),y=Lt("blur"),w=Lt("perspective"),v=Lt("aspect"),p=Lt("ease"),g=Lt("animate"),b=()=>["auto","avoid","all","avoid-page","page","left","right","column"],C=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],x=()=>[...C(),ke,De],S=()=>["auto","hidden","clip","visible","scroll"],E=()=>["auto","contain","none"],M=()=>[ke,De,u],k=()=>[Ar,"full","auto",...M()],T=()=>[Jn,"none","subgrid",ke,De],R=()=>["auto",{span:["full",Jn,ke,De]},Jn,ke,De],F=()=>[Jn,"auto",ke,De],V=()=>["auto","min","max","fr",ke,De],$=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],L=()=>["start","end","center","stretch","center-safe","end-safe"],_=()=>["auto",...M()],H=()=>[Ar,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...M()],N=()=>[e,ke,De],z=()=>[...C(),Ju,Qu,{position:[ke,De]}],B=()=>["no-repeat",{repeat:["","x","y","space","round"]}],A=()=>["auto","cover","contain",Vg,Fg,{size:[ke,De]}],j=()=>[is,vo,wr],Y=()=>["","none","full",c,ke,De],U=()=>["",et,vo,wr],ne=()=>["solid","dashed","dotted","double"],te=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],J=()=>[et,is,Ju,Qu],G=()=>["","none",y,ke,De],q=()=>["none",et,ke,De],Z=()=>["none",et,ke,De],O=()=>[et,ke,De],I=()=>[Ar,"full",...M()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Vn],breakpoint:[Vn],color:[Ig],container:[Vn],"drop-shadow":[Vn],ease:["in","out","in-out"],font:[$g],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Vn],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Vn],shadow:[Vn],spacing:["px",et],text:[Vn],"text-shadow":[Vn],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ar,De,ke,v]}],container:["container"],columns:[{columns:[et,De,ke,s]}],"break-after":[{"break-after":b()}],"break-before":[{"break-before":b()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:E()}],"overscroll-x":[{"overscroll-x":E()}],"overscroll-y":[{"overscroll-y":E()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:k()}],"inset-x":[{"inset-x":k()}],"inset-y":[{"inset-y":k()}],start:[{start:k()}],end:[{end:k()}],top:[{top:k()}],right:[{right:k()}],bottom:[{bottom:k()}],left:[{left:k()}],visibility:["visible","invisible","collapse"],z:[{z:[Jn,"auto",ke,De]}],basis:[{basis:[Ar,"full","auto",s,...M()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[et,Ar,"auto","initial","none",De]}],grow:[{grow:["",et,ke,De]}],shrink:[{shrink:["",et,ke,De]}],order:[{order:[Jn,"first","last","none",ke,De]}],"grid-cols":[{"grid-cols":T()}],"col-start-end":[{col:R()}],"col-start":[{"col-start":F()}],"col-end":[{"col-end":F()}],"grid-rows":[{"grid-rows":T()}],"row-start-end":[{row:R()}],"row-start":[{"row-start":F()}],"row-end":[{"row-end":F()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":V()}],"auto-rows":[{"auto-rows":V()}],gap:[{gap:M()}],"gap-x":[{"gap-x":M()}],"gap-y":[{"gap-y":M()}],"justify-content":[{justify:[...$(),"normal"]}],"justify-items":[{"justify-items":[...L(),"normal"]}],"justify-self":[{"justify-self":["auto",...L()]}],"align-content":[{content:["normal",...$()]}],"align-items":[{items:[...L(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...L(),{baseline:["","last"]}]}],"place-content":[{"place-content":$()}],"place-items":[{"place-items":[...L(),"baseline"]}],"place-self":[{"place-self":["auto",...L()]}],p:[{p:M()}],px:[{px:M()}],py:[{py:M()}],ps:[{ps:M()}],pe:[{pe:M()}],pt:[{pt:M()}],pr:[{pr:M()}],pb:[{pb:M()}],pl:[{pl:M()}],m:[{m:_()}],mx:[{mx:_()}],my:[{my:_()}],ms:[{ms:_()}],me:[{me:_()}],mt:[{mt:_()}],mr:[{mr:_()}],mb:[{mb:_()}],ml:[{ml:_()}],"space-x":[{"space-x":M()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":M()}],"space-y-reverse":["space-y-reverse"],size:[{size:H()}],w:[{w:[s,"screen",...H()]}],"min-w":[{"min-w":[s,"screen","none",...H()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[i]},...H()]}],h:[{h:["screen","lh",...H()]}],"min-h":[{"min-h":["screen","lh","none",...H()]}],"max-h":[{"max-h":["screen","lh",...H()]}],"font-size":[{text:["base",n,vo,wr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,ke,ss]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",is,De]}],"font-family":[{font:[Hg,De,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,ke,De]}],"line-clamp":[{"line-clamp":[et,"none",ke,ss]}],leading:[{leading:[a,...M()]}],"list-image":[{"list-image":["none",ke,De]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ke,De]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:N()}],"text-color":[{text:N()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ne(),"wavy"]}],"text-decoration-thickness":[{decoration:[et,"from-font","auto",ke,wr]}],"text-decoration-color":[{decoration:N()}],"underline-offset":[{"underline-offset":[et,"auto",ke,De]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:M()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ke,De]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ke,De]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:z()}],"bg-repeat":[{bg:B()}],"bg-size":[{bg:A()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Jn,ke,De],radial:["",ke,De],conic:[Jn,ke,De]},Wg,zg]}],"bg-color":[{bg:N()}],"gradient-from-pos":[{from:j()}],"gradient-via-pos":[{via:j()}],"gradient-to-pos":[{to:j()}],"gradient-from":[{from:N()}],"gradient-via":[{via:N()}],"gradient-to":[{to:N()}],rounded:[{rounded:Y()}],"rounded-s":[{"rounded-s":Y()}],"rounded-e":[{"rounded-e":Y()}],"rounded-t":[{"rounded-t":Y()}],"rounded-r":[{"rounded-r":Y()}],"rounded-b":[{"rounded-b":Y()}],"rounded-l":[{"rounded-l":Y()}],"rounded-ss":[{"rounded-ss":Y()}],"rounded-se":[{"rounded-se":Y()}],"rounded-ee":[{"rounded-ee":Y()}],"rounded-es":[{"rounded-es":Y()}],"rounded-tl":[{"rounded-tl":Y()}],"rounded-tr":[{"rounded-tr":Y()}],"rounded-br":[{"rounded-br":Y()}],"rounded-bl":[{"rounded-bl":Y()}],"border-w":[{border:U()}],"border-w-x":[{"border-x":U()}],"border-w-y":[{"border-y":U()}],"border-w-s":[{"border-s":U()}],"border-w-e":[{"border-e":U()}],"border-w-t":[{"border-t":U()}],"border-w-r":[{"border-r":U()}],"border-w-b":[{"border-b":U()}],"border-w-l":[{"border-l":U()}],"divide-x":[{"divide-x":U()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":U()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ne(),"hidden","none"]}],"divide-style":[{divide:[...ne(),"hidden","none"]}],"border-color":[{border:N()}],"border-color-x":[{"border-x":N()}],"border-color-y":[{"border-y":N()}],"border-color-s":[{"border-s":N()}],"border-color-e":[{"border-e":N()}],"border-color-t":[{"border-t":N()}],"border-color-r":[{"border-r":N()}],"border-color-b":[{"border-b":N()}],"border-color-l":[{"border-l":N()}],"divide-color":[{divide:N()}],"outline-style":[{outline:[...ne(),"none","hidden"]}],"outline-offset":[{"outline-offset":[et,ke,De]}],"outline-w":[{outline:["",et,vo,wr]}],"outline-color":[{outline:N()}],shadow:[{shadow:["","none",d,da,ca]}],"shadow-color":[{shadow:N()}],"inset-shadow":[{"inset-shadow":["none",l,da,ca]}],"inset-shadow-color":[{"inset-shadow":N()}],"ring-w":[{ring:U()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:N()}],"ring-offset-w":[{"ring-offset":[et,wr]}],"ring-offset-color":[{"ring-offset":N()}],"inset-ring-w":[{"inset-ring":U()}],"inset-ring-color":[{"inset-ring":N()}],"text-shadow":[{"text-shadow":["none",h,da,ca]}],"text-shadow-color":[{"text-shadow":N()}],opacity:[{opacity:[et,ke,De]}],"mix-blend":[{"mix-blend":[...te(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":te()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[et]}],"mask-image-linear-from-pos":[{"mask-linear-from":J()}],"mask-image-linear-to-pos":[{"mask-linear-to":J()}],"mask-image-linear-from-color":[{"mask-linear-from":N()}],"mask-image-linear-to-color":[{"mask-linear-to":N()}],"mask-image-t-from-pos":[{"mask-t-from":J()}],"mask-image-t-to-pos":[{"mask-t-to":J()}],"mask-image-t-from-color":[{"mask-t-from":N()}],"mask-image-t-to-color":[{"mask-t-to":N()}],"mask-image-r-from-pos":[{"mask-r-from":J()}],"mask-image-r-to-pos":[{"mask-r-to":J()}],"mask-image-r-from-color":[{"mask-r-from":N()}],"mask-image-r-to-color":[{"mask-r-to":N()}],"mask-image-b-from-pos":[{"mask-b-from":J()}],"mask-image-b-to-pos":[{"mask-b-to":J()}],"mask-image-b-from-color":[{"mask-b-from":N()}],"mask-image-b-to-color":[{"mask-b-to":N()}],"mask-image-l-from-pos":[{"mask-l-from":J()}],"mask-image-l-to-pos":[{"mask-l-to":J()}],"mask-image-l-from-color":[{"mask-l-from":N()}],"mask-image-l-to-color":[{"mask-l-to":N()}],"mask-image-x-from-pos":[{"mask-x-from":J()}],"mask-image-x-to-pos":[{"mask-x-to":J()}],"mask-image-x-from-color":[{"mask-x-from":N()}],"mask-image-x-to-color":[{"mask-x-to":N()}],"mask-image-y-from-pos":[{"mask-y-from":J()}],"mask-image-y-to-pos":[{"mask-y-to":J()}],"mask-image-y-from-color":[{"mask-y-from":N()}],"mask-image-y-to-color":[{"mask-y-to":N()}],"mask-image-radial":[{"mask-radial":[ke,De]}],"mask-image-radial-from-pos":[{"mask-radial-from":J()}],"mask-image-radial-to-pos":[{"mask-radial-to":J()}],"mask-image-radial-from-color":[{"mask-radial-from":N()}],"mask-image-radial-to-color":[{"mask-radial-to":N()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":C()}],"mask-image-conic-pos":[{"mask-conic":[et]}],"mask-image-conic-from-pos":[{"mask-conic-from":J()}],"mask-image-conic-to-pos":[{"mask-conic-to":J()}],"mask-image-conic-from-color":[{"mask-conic-from":N()}],"mask-image-conic-to-color":[{"mask-conic-to":N()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:z()}],"mask-repeat":[{mask:B()}],"mask-size":[{mask:A()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ke,De]}],filter:[{filter:["","none",ke,De]}],blur:[{blur:G()}],brightness:[{brightness:[et,ke,De]}],contrast:[{contrast:[et,ke,De]}],"drop-shadow":[{"drop-shadow":["","none",m,da,ca]}],"drop-shadow-color":[{"drop-shadow":N()}],grayscale:[{grayscale:["",et,ke,De]}],"hue-rotate":[{"hue-rotate":[et,ke,De]}],invert:[{invert:["",et,ke,De]}],saturate:[{saturate:[et,ke,De]}],sepia:[{sepia:["",et,ke,De]}],"backdrop-filter":[{"backdrop-filter":["","none",ke,De]}],"backdrop-blur":[{"backdrop-blur":G()}],"backdrop-brightness":[{"backdrop-brightness":[et,ke,De]}],"backdrop-contrast":[{"backdrop-contrast":[et,ke,De]}],"backdrop-grayscale":[{"backdrop-grayscale":["",et,ke,De]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[et,ke,De]}],"backdrop-invert":[{"backdrop-invert":["",et,ke,De]}],"backdrop-opacity":[{"backdrop-opacity":[et,ke,De]}],"backdrop-saturate":[{"backdrop-saturate":[et,ke,De]}],"backdrop-sepia":[{"backdrop-sepia":["",et,ke,De]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":M()}],"border-spacing-x":[{"border-spacing-x":M()}],"border-spacing-y":[{"border-spacing-y":M()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ke,De]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[et,"initial",ke,De]}],ease:[{ease:["linear","initial",p,ke,De]}],delay:[{delay:[et,ke,De]}],animate:[{animate:["none",g,ke,De]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,ke,De]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:q()}],"rotate-x":[{"rotate-x":q()}],"rotate-y":[{"rotate-y":q()}],"rotate-z":[{"rotate-z":q()}],scale:[{scale:Z()}],"scale-x":[{"scale-x":Z()}],"scale-y":[{"scale-y":Z()}],"scale-z":[{"scale-z":Z()}],"scale-3d":["scale-3d"],skew:[{skew:O()}],"skew-x":[{"skew-x":O()}],"skew-y":[{"skew-y":O()}],transform:[{transform:[ke,De,"","none","gpu","cpu"]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:I()}],"translate-x":[{"translate-x":I()}],"translate-y":[{"translate-y":I()}],"translate-z":[{"translate-z":I()}],"translate-none":["translate-none"],accent:[{accent:N()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:N()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ke,De]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ke,De]}],fill:[{fill:["none",...N()]}],"stroke-w":[{stroke:[et,vo,wr,ss]}],stroke:[{stroke:["none",...N()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function xe(...e){return Yg(ju(e))}function Ug(e){const{className:t,items:n}=e,[r,o]=D.useState(null),a=i=>{o(r===i?null:i)};return P.jsx("div",{"data-u-comp":"accordion",className:xe("univer-divide-x-0 univer-divide-y univer-divide-solid univer-divide-gray-200 dark:!univer-divide-gray-600",t),children:n.map((i,s)=>P.jsxs("div",{children:[P.jsxs("button",{className:"univer-box-border univer-flex univer-w-full univer-cursor-pointer univer-items-center univer-gap-1.5 univer-border-none univer-bg-transparent univer-p-4 univer-text-left univer-text-gray-700 hover:univer-text-gray-900 focus:univer-outline-none dark:!univer-text-gray-200 dark:hover:!univer-text-white",type:"button",onClick:()=>a(s),children:[P.jsx(_u,{className:xe("univer-size-2.5 univer-flex-shrink-0 univer-transition-transform",{"-univer-rotate-90":r!==s,"univer-rotate-0":r===s})}),P.jsx("span",{className:"univer-font-medium",children:i.label})]}),P.jsx("div",{className:xe("univer-overflow-hidden univer-transition-[max-height,opacity] univer-duration-500 univer-ease-in-out",{"univer-max-h-screen":r===s,"univer-max-h-0":r!==s}),children:P.jsx("div",{className:"univer-box-border univer-px-4 univer-py-1.5",children:i.children})})]},s))})}const ac=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,ic=ju,ls=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return ic(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:a}=t,i=Object.keys(o).map(c=>{const d=n==null?void 0:n[c],l=a==null?void 0:a[c];if(d===null)return null;const h=ac(d)||ac(l);return o[c][h]}),s=n&&Object.entries(n).reduce((c,d)=>{let[l,h]=d;return h===void 0||(c[l]=h),c},{}),u=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,d)=>{let{class:l,className:h,...m}=d;return Object.entries(m).every(y=>{let[w,v]=y;return Array.isArray(v)?v.includes({...a,...s}[w]):{...a,...s}[w]===v})?[...c,l,h]:c},[]);return ic(e,i,u,n==null?void 0:n.class,n==null?void 0:n.className)},qg=ls(`
1243
1243
  univer-relative univer-inline-block univer-overflow-hidden univer-whitespace-nowrap univer-bg-gray-200
1244
1244
  univer-text-center univer-align-middle univer-text-white
1245
- `,{variants:{shape:{circle:"univer-rounded-full",square:"univer-rounded"},size:{middle:"univer-size-9 univer-leading-9",small:"univer-size-7 univer-leading-7"}},defaultVariants:{shape:"circle",size:"middle"}});function Gg(e){const{children:t,className:n,style:r,title:o,alt:a,shape:i="circle",size:s="middle",src:u,fit:c="fill",onError:f,onLoad:l}=e,h=typeof s=="number"?{width:`${s}px`,height:`${s}px`,lineHeight:`${s}px`}:{},m={objectFit:c};return P.jsxs("span",{className:Se(qg({shape:i,size:typeof s=="number"?"middle":s}),{"univer-bg-transparent":u},n),style:{...h,...r,...u&&m},children:[u&&P.jsx("img",{className:"univer-block univer-size-full",src:u,title:o,alt:a,onError:f,onLoad:l}),t]})}function sc(e){const{className:t,children:n,closable:r=!1,onClose:o}=e;return P.jsxs("span",{"data-u-comp":"badge",className:Se(`
1245
+ `,{variants:{shape:{circle:"univer-rounded-full",square:"univer-rounded"},size:{middle:"univer-size-9 univer-leading-9",small:"univer-size-7 univer-leading-7"}},defaultVariants:{shape:"circle",size:"middle"}});function Gg(e){const{children:t,className:n,style:r,title:o,alt:a,shape:i="circle",size:s="middle",src:u,fit:c="fill",onError:d,onLoad:l}=e,h=typeof s=="number"?{width:`${s}px`,height:`${s}px`,lineHeight:`${s}px`}:{},m={objectFit:c};return P.jsxs("span",{className:xe(qg({shape:i,size:typeof s=="number"?"middle":s}),{"univer-bg-transparent":u},n),style:{...h,...r,...u&&m},children:[u&&P.jsx("img",{className:"univer-block univer-size-full",src:u,title:o,alt:a,onError:d,onLoad:l}),t]})}function sc(e){const{className:t,children:n,closable:r=!1,onClose:o}=e;return P.jsxs("span",{"data-u-comp":"badge",className:xe(`
1246
1246
  univer-box-border univer-inline-flex univer-items-center univer-gap-1 univer-truncate
1247
1247
  univer-rounded-md univer-border univer-border-solid univer-border-gray-100 univer-bg-gray-100
1248
1248
  univer-px-2.5 univer-py-0.5 univer-text-xs univer-font-medium univer-text-gray-900
1249
1249
  dark:!univer-border-gray-500 dark:!univer-bg-gray-700 dark:!univer-text-gray-300
1250
- `,t),children:[P.jsx("span",{className:"univer-flex-1 univer-truncate",children:n}),r&&P.jsx("a",{className:"univer-flex univer-cursor-pointer univer-items-center univer-justify-center univer-transition-opacity hover:univer-opacity-70",onClick:o,children:P.jsx(ua,{className:"univer-text-current"})})]})}function lc(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function fa(...e){return t=>{let n=!1;const r=e.map(o=>{const a=lc(o,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let o=0;o<r.length;o++){const a=r[o];typeof a=="function"?a():lc(e[o],null)}}}}function Pt(...e){return d.useCallback(fa(...e),e)}function wr(e){const t=Xg(e),n=d.forwardRef((r,o)=>{const{children:a,...i}=r,s=d.Children.toArray(a),u=s.find(Qg);if(u){const c=u.props.children,f=s.map(l=>l===u?d.Children.count(c)>1?d.Children.only(null):d.isValidElement(c)?c.props.children:null:l);return P.jsx(t,{...i,ref:o,children:d.isValidElement(c)?d.cloneElement(c,void 0,f):null})}return P.jsx(t,{...i,ref:o,children:a})});return n.displayName=`${e}.Slot`,n}var Kg=wr("Slot");function Xg(e){const t=d.forwardRef((n,r)=>{const{children:o,...a}=n;if(d.isValidElement(o)){const i=e0(o),s=Jg(a,o.props);return o.type!==d.Fragment&&(s.ref=r?fa(r,i):i),d.cloneElement(o,s)}return d.Children.count(o)>1?d.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var uc=Symbol("radix.slottable");function Zg(e){const t=({children:n})=>P.jsx(P.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=uc,t}function Qg(e){return d.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===uc}function Jg(e,t){const n={...t};for(const r in t){const o=e[r],a=t[r];/^on[A-Z]/.test(r)?o&&a?n[r]=(...s)=>{const u=a(...s);return o(...s),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...a}:r==="className"&&(n[r]=[o,a].filter(Boolean).join(" "))}return{...e,...n}}function e0(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const t0=ls(`
1250
+ `,t),children:[P.jsx("span",{className:"univer-flex-1 univer-truncate",children:n}),r&&P.jsx("a",{className:"univer-flex univer-cursor-pointer univer-items-center univer-justify-center univer-transition-opacity hover:univer-opacity-70",onClick:o,children:P.jsx(ua,{className:"univer-text-current"})})]})}function lc(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function fa(...e){return t=>{let n=!1;const r=e.map(o=>{const a=lc(o,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let o=0;o<r.length;o++){const a=r[o];typeof a=="function"?a():lc(e[o],null)}}}}function Pt(...e){return f.useCallback(fa(...e),e)}function Cr(e){const t=Xg(e),n=f.forwardRef((r,o)=>{const{children:a,...i}=r,s=f.Children.toArray(a),u=s.find(Qg);if(u){const c=u.props.children,d=s.map(l=>l===u?f.Children.count(c)>1?f.Children.only(null):f.isValidElement(c)?c.props.children:null:l);return P.jsx(t,{...i,ref:o,children:f.isValidElement(c)?f.cloneElement(c,void 0,d):null})}return P.jsx(t,{...i,ref:o,children:a})});return n.displayName=`${e}.Slot`,n}var Kg=Cr("Slot");function Xg(e){const t=f.forwardRef((n,r)=>{const{children:o,...a}=n;if(f.isValidElement(o)){const i=e0(o),s=Jg(a,o.props);return o.type!==f.Fragment&&(s.ref=r?fa(r,i):i),f.cloneElement(o,s)}return f.Children.count(o)>1?f.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var uc=Symbol("radix.slottable");function Zg(e){const t=({children:n})=>P.jsx(P.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=uc,t}function Qg(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===uc}function Jg(e,t){const n={...t};for(const r in t){const o=e[r],a=t[r];/^on[A-Z]/.test(r)?o&&a?n[r]=(...s)=>{const u=a(...s);return o(...s),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...a}:r==="className"&&(n[r]=[o,a].filter(Boolean).join(" "))}return{...e,...n}}function e0(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const t0=ls(`
1251
1251
  univer-box-border univer-inline-flex univer-cursor-pointer univer-select-none univer-items-center
1252
1252
  univer-justify-center univer-gap-2 univer-whitespace-nowrap univer-rounded-md univer-border univer-border-solid
1253
1253
  univer-text-sm univer-font-medium univer-transition-colors
@@ -1277,7 +1277,7 @@ exports.useUpdateBinder = useUpdateBinder;
1277
1277
  univer-underline-offset-4
1278
1278
  hover:univer-text-primary-500 hover:univer-underline
1279
1279
  active:univer-text-primary-700
1280
- `},size:{small:"univer-h-6 univer-rounded-md univer-px-1.5 univer-text-xs",middle:"univer-h-8 univer-rounded-lg univer-px-2 univer-text-sm",large:"univer-h-10 univer-rounded-lg univer-px-3 univer-text-sm"}},defaultVariants:{variant:"default",size:"middle"}}),kn=D.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},a)=>{const i=r?Kg:"button";return P.jsx(i,{className:Se(t0({variant:t,size:n,className:e})),ref:a,"data-u-comp":"button",...o})});kn.displayName="Button";const n0=({className:e,orientation:t="horizontal",children:n})=>{const r=D.Children.count(n),o=t==="horizontal",a=t==="vertical";return P.jsx("div",{className:Se("univer-grid",{"univer-grid-flow-row":a,"univer-w-fit":a},e),children:D.Children.map(n,(i,s)=>{const u=s===0,c=s===r-1;return D.cloneElement(i,{className:Se({"!univer-rounded-l-none":o&&!u,"!univer-rounded-r-none":o&&!c,"!univer-border-l-0":o&&!u,"!univer-rounded-t-none":a&&!u,"!univer-rounded-b-none":a&&!c,"!univer-border-t-0":a&&!u},i.props.className)})})})},Cr="univer-scrollbar-thin univer-scrollbar-track-gray-50 univer-scrollbar-thumb-gray-300 dark:!univer-scrollbar-track-gray-900 dark:!univer-scrollbar-thumb-gray-700",Fr="univer-border-gray-200 dark:!univer-border-gray-600 univer-border-solid",yn=Se(Fr,"univer-border"),r0=Se(Fr,"univer-border-l univer-border-b univer-border-0"),o0=Se(Fr,"univer-border-l univer-border-0"),a0=Se(Fr,"univer-border-t univer-border-0"),i0=Se(Fr,"univer-border-b univer-border-0"),s0=Se(Fr,"univer-border-r univer-border-0"),l0="univer-divide-gray-200 dark:!univer-divide-gray-600 univer-divide-y univer-divide-x-0 univer-divide-solid",u0="univer-divide-gray-200 dark:!univer-divide-gray-600 univer-divide-x univer-divide-y-0 univer-divide-solid";function va(){return typeof window<"u"&&typeof document<"u"}const mn=D.createContext({mountContainer:va()?document.body:null});function c0(e){const{children:t,locale:n,mountContainer:r}=e,o=D.useMemo(()=>({locale:n,mountContainer:r}),[n,r]);return P.jsx(mn.Provider,{value:o,children:t})}function cc({emptyText:e}){return P.jsx("section",{className:"univer-h-8 univer-px-2 univer-pr-32 univer-text-sm/8 univer-text-gray-600 dark:!univer-text-gray-200",children:e})}function d0(e){const{value:t,options:n=[],onChange:r,contentClassName:o,wrapperClassName:a}=e,{locale:i}=D.useContext(mn),s=D.useMemo(()=>{const c=[n];return t.forEach((f,l)=>{const h=c[l].find(m=>m.value===f);h!=null&&h.children&&c.push(h.children)}),c},[t]);function u(c,f){if(f===t[c])return;if(t[c+1]){const h=t.slice(0,c+1);h[c]=f,r(h);return}const l=[...t];l[c]=f,r(l)}return P.jsxs("section",{"data-u-comp":"cascader-list",className:Se("univer-overflow-auto-y univer-grid univer-h-full univer-max-h-80 univer-grid-flow-col univer-rounded univer-py-2 univer-text-gray-900 dark:!univer-text-white [&>ul:not(:last-child)]:univer-border-0 [&>ul:not(:last-child)]:univer-border-r [&>ul:not(:last-child)]:univer-border-solid [&>ul:not(:last-child)]:univer-border-r-gray-200",yn,Cr,a),children:[s.map((c,f)=>c.length?P.jsx("ul",{className:Se("univer-m-0 univer-h-full univer-max-h-full univer-list-none univer-overflow-auto univer-px-2",Cr,o),children:c.map(l=>P.jsx("li",{children:P.jsxs("a",{className:Se("univer-relative univer-block univer-h-8 univer-cursor-pointer univer-rounded univer-text-sm/8",{"univer-px-7":f>0,"univer-px-1.5":f===0,"univer-bg-gray-200 dark:!univer-bg-gray-600":l.value===t[f]}),onClick:()=>u(f,l.value),children:[f>0&&P.jsx("span",{className:"univer-absolute univer-left-2 univer-flex univer-h-full univer-items-center",children:l.value===t[f]&&P.jsx(Rr,{className:"univer-text-primary-600"})}),P.jsx("span",{children:l.label})]})},l.value))},f):P.jsx(cc,{emptyText:i==null?void 0:i.CascaderList.empty},f)),t.length<=0&&P.jsx(cc,{emptyText:i==null?void 0:i.CascaderList.empty})]})}function f0(e){const{children:t,className:n,style:r,value:o,disabled:a,direction:i="horizontal",onChange:s}=e,u=c=>{o.includes(c)?s(o.filter(f=>f!==c)):s([...o,c])};return P.jsx("div",{className:Se("univer-flex univer-gap-2",{"univer-flex-col":i==="vertical"},n),style:r,children:D.Children.map(t,(c,f)=>D.isValidElement(c)?D.cloneElement(c,{key:f,children:c.props.children,checked:c.props.value?o.includes(c.props.value):!1,disabled:a!=null?a:c.props.disabled,onChange:u}):c)})}function dc(e){const{children:t,className:n,style:r,checked:o=!1,indeterminate:a=!1,value:i,disabled:s=!1,onChange:u,contentClassName:c}=e,f=D.useRef(null);function l(h){var m,y;if(h.stopPropagation(),!(!u||s))if(typeof i<"u")u==null||u(i);else{const w=(y=(m=f==null?void 0:f.current)==null?void 0:m.checked)!=null?y:!1;u==null||u(w)}}return P.jsxs("label",{"data-u-comp":"checkbox",className:Se("univer-box-border univer-inline-flex univer-items-center univer-gap-2 univer-text-sm",{"univer-cursor-pointer univer-text-gray-900 dark:!univer-text-white":!s,"univer-text-gray-400":s},n),style:r,children:[P.jsxs("span",{className:"univer-relative univer-block",children:[P.jsx("input",{ref:f,className:"univer-absolute univer-size-0 univer-opacity-0",type:"checkbox",checked:o,disabled:s,onChange:l}),P.jsxs("span",{className:Se("univer-relative univer-box-border univer-flex univer-size-4 univer-items-center univer-justify-center univer-overflow-hidden univer-rounded univer-border univer-border-solid univer-transition-colors",{"univer-opacity-50":s,"univer-border-primary-600 univer-bg-primary-600":o||a,"univer-border-gray-300 univer-bg-gray-50 dark:!univer-border-gray-500 dark:!univer-bg-gray-600":!o&&!a}),children:[o&&P.jsx(Rr,{className:"univer-absolute univer-left-1/2 univer-top-1/2 univer-block univer-size-3 -univer-translate-x-1/2 -univer-translate-y-1/2 univer-text-white"}),a&&!o&&P.jsx("span",{className:"univer-absolute univer-left-1/2 univer-top-1/2 univer-block univer-h-0.5 univer-w-2.5 -univer-translate-x-1/2 -univer-translate-y-1/2 univer-rounded univer-bg-white"})]})]}),P.jsx("span",{className:Se("univer-select-none",c),children:t})]})}function Ie(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function v0(e,t){const n=d.createContext(t),r=a=>{const{children:i,...s}=a,u=d.useMemo(()=>s,Object.values(s));return P.jsx(n.Provider,{value:u,children:i})};r.displayName=e+"Provider";function o(a){const i=d.useContext(n);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${a}\` must be used within \`${e}\``)}return[r,o]}function Wn(e,t=[]){let n=[];function r(a,i){const s=d.createContext(i),u=n.length;n=[...n,i];const c=l=>{var p;const{scope:h,children:m,...y}=l,w=((p=h==null?void 0:h[e])==null?void 0:p[u])||s,v=d.useMemo(()=>y,Object.values(y));return P.jsx(w.Provider,{value:v,children:m})};c.displayName=a+"Provider";function f(l,h){var w;const m=((w=h==null?void 0:h[e])==null?void 0:w[u])||s,y=d.useContext(m);if(y)return y;if(i!==void 0)return i;throw new Error(`\`${l}\` must be used within \`${a}\``)}return[c,f]}const o=()=>{const a=n.map(i=>d.createContext(i));return function(s){const u=(s==null?void 0:s[e])||a;return d.useMemo(()=>({[`__scope${e}`]:{...s,[e]:u}}),[s,u])}};return o.scopeName=e,[r,m0(o,...t)]}function m0(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(a){const i=r.reduce((s,{useScope:u,scopeName:c})=>{const l=u(a)[`__scope${c}`];return{...s,...l}},{});return d.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}var er=globalThis!=null&&globalThis.document?d.useLayoutEffect:()=>{},h0=d[" useId ".trim().toString()]||(()=>{}),p0=0;function _n(e){const[t,n]=d.useState(h0());return er(()=>{n(r=>r!=null?r:String(p0++))},[e]),e||(t?`radix-${t}`:"")}var g0=d[" useInsertionEffect ".trim().toString()]||er;function xr({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,a,i]=y0({defaultProp:t,onChange:n}),s=e!==void 0,u=s?e:o;{const f=d.useRef(e!==void 0);d.useEffect(()=>{const l=f.current;l!==s&&console.warn(`${r} is changing from ${l?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=s},[s,r])}const c=d.useCallback(f=>{var l;if(s){const h=b0(f)?f(e):f;h!==e&&((l=i.current)==null||l.call(i,h))}else a(f)},[s,e,a,i]);return[u,c]}function y0({defaultProp:e,onChange:t}){const[n,r]=d.useState(e),o=d.useRef(n),a=d.useRef(t);return g0(()=>{a.current=t},[t]),d.useEffect(()=>{var i;o.current!==n&&((i=a.current)==null||i.call(a,n),o.current=n)},[n,o]),[n,r,a]}function b0(e){return typeof e=="function"}var w0=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],gt=w0.reduce((e,t)=>{const n=wr(`Primitive.${t}`),r=d.forwardRef((o,a)=>{const{asChild:i,...s}=o,u=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),P.jsx(u,{...s,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function fc(e,t){e&&ku.flushSync(()=>e.dispatchEvent(t))}function Nn(e){const t=d.useRef(e);return d.useEffect(()=>{t.current=e}),d.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function C0(e,t=globalThis==null?void 0:globalThis.document){const n=Nn(e);d.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var x0="DismissableLayer",us="dismissableLayer.update",S0="dismissableLayer.pointerDownOutside",E0="dismissableLayer.focusOutside",vc,mc=d.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),zr=d.forwardRef((e,t)=>{var E;const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:a,onInteractOutside:i,onDismiss:s,...u}=e,c=d.useContext(mc),[f,l]=d.useState(null),h=(E=f==null?void 0:f.ownerDocument)!=null?E:globalThis==null?void 0:globalThis.document,[,m]=d.useState({}),y=Pt(t,M=>l(M)),w=Array.from(c.layers),[v]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),p=w.indexOf(v),g=f?w.indexOf(f):-1,b=c.layersWithOutsidePointerEventsDisabled.size>0,C=g>=p,x=D0(M=>{const k=M.target,T=[...c.branches].some(R=>R.contains(k));!C||T||(o==null||o(M),i==null||i(M),M.defaultPrevented||s==null||s())},h),S=k0(M=>{const k=M.target;[...c.branches].some(R=>R.contains(k))||(a==null||a(M),i==null||i(M),M.defaultPrevented||s==null||s())},h);return C0(M=>{g===c.layers.size-1&&(r==null||r(M),!M.defaultPrevented&&s&&(M.preventDefault(),s()))},h),d.useEffect(()=>{if(f)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(vc=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(f)),c.layers.add(f),hc(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=vc)}},[f,h,n,c]),d.useEffect(()=>()=>{f&&(c.layers.delete(f),c.layersWithOutsidePointerEventsDisabled.delete(f),hc())},[f,c]),d.useEffect(()=>{const M=()=>m({});return document.addEventListener(us,M),()=>document.removeEventListener(us,M)},[]),P.jsx(gt.div,{...u,ref:y,style:{pointerEvents:b?C?"auto":"none":void 0,...e.style},onFocusCapture:Ie(e.onFocusCapture,S.onFocusCapture),onBlurCapture:Ie(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:Ie(e.onPointerDownCapture,x.onPointerDownCapture)})});zr.displayName=x0;var M0="DismissableLayerBranch",P0=d.forwardRef((e,t)=>{const n=d.useContext(mc),r=d.useRef(null),o=Pt(t,r);return d.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),P.jsx(gt.div,{...e,ref:o})});P0.displayName=M0;function D0(e,t=globalThis==null?void 0:globalThis.document){const n=Nn(e),r=d.useRef(!1),o=d.useRef(()=>{});return d.useEffect(()=>{const a=s=>{if(s.target&&!r.current){let u=function(){pc(S0,n,c,{discrete:!0})};const c={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=u,t.addEventListener("click",o.current,{once:!0})):u()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",a),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function k0(e,t=globalThis==null?void 0:globalThis.document){const n=Nn(e),r=d.useRef(!1);return d.useEffect(()=>{const o=a=>{a.target&&!r.current&&pc(E0,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function hc(){const e=new CustomEvent(us);document.dispatchEvent(e)}function pc(e,t,n,{discrete:r}){const o=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?fc(o,a):o.dispatchEvent(a)}var cs="focusScope.autoFocusOnMount",ds="focusScope.autoFocusOnUnmount",gc={bubbles:!1,cancelable:!0},_0="FocusScope",ma=d.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:a,...i}=e,[s,u]=d.useState(null),c=Nn(o),f=Nn(a),l=d.useRef(null),h=Pt(t,w=>u(w)),m=d.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;d.useEffect(()=>{if(r){let w=function(b){if(m.paused||!s)return;const C=b.target;s.contains(C)?l.current=C:tr(l.current,{select:!0})},v=function(b){if(m.paused||!s)return;const C=b.relatedTarget;C!==null&&(s.contains(C)||tr(l.current,{select:!0}))},p=function(b){if(document.activeElement===document.body)for(const x of b)x.removedNodes.length>0&&tr(s)};document.addEventListener("focusin",w),document.addEventListener("focusout",v);const g=new MutationObserver(p);return s&&g.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",v),g.disconnect()}}},[r,s,m.paused]),d.useEffect(()=>{if(s){wc.add(m);const w=document.activeElement;if(!s.contains(w)){const p=new CustomEvent(cs,gc);s.addEventListener(cs,c),s.dispatchEvent(p),p.defaultPrevented||(N0(A0(yc(s)),{select:!0}),document.activeElement===w&&tr(s))}return()=>{s.removeEventListener(cs,c),setTimeout(()=>{const p=new CustomEvent(ds,gc);s.addEventListener(ds,f),s.dispatchEvent(p),p.defaultPrevented||tr(w!=null?w:document.body,{select:!0}),s.removeEventListener(ds,f),wc.remove(m)},0)}}},[s,c,f,m]);const y=d.useCallback(w=>{if(!n&&!r||m.paused)return;const v=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,p=document.activeElement;if(v&&p){const g=w.currentTarget,[b,C]=O0(g);b&&C?!w.shiftKey&&p===C?(w.preventDefault(),n&&tr(b,{select:!0})):w.shiftKey&&p===b&&(w.preventDefault(),n&&tr(C,{select:!0})):p===g&&w.preventDefault()}},[n,r,m.paused]);return P.jsx(gt.div,{tabIndex:-1,...i,ref:h,onKeyDown:y})});ma.displayName=_0;function N0(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(tr(r,{select:t}),document.activeElement!==n)return}function O0(e){const t=yc(e),n=bc(t,e),r=bc(t.reverse(),e);return[n,r]}function yc(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function bc(e,t){for(const n of e)if(!T0(n,{upTo:t}))return n}function T0(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function I0(e){return e instanceof HTMLInputElement&&"select"in e}function tr(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&I0(e)&&t&&e.select()}}var wc=R0();function R0(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Cc(e,t),e.unshift(t)},remove(t){var n;e=Cc(e,t),(n=e[0])==null||n.resume()}}}function Cc(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function A0(e){return e.filter(t=>t.tagName!=="A")}var L0="Portal",Hr=d.forwardRef((e,t)=>{var s;const{container:n,...r}=e,[o,a]=d.useState(!1);er(()=>a(!0),[]);const i=n||o&&((s=globalThis==null?void 0:globalThis.document)==null?void 0:s.body);return i?It.createPortal(P.jsx(gt.div,{...r,ref:t}),i):null});Hr.displayName=L0;function $0(e,t){return d.useReducer((n,r)=>{const o=t[n][r];return o!=null?o:n},e)}var on=e=>{const{present:t,children:n}=e,r=F0(t),o=typeof n=="function"?n({present:r.isPresent}):d.Children.only(n),a=Pt(r.ref,z0(o));return typeof n=="function"||r.isPresent?d.cloneElement(o,{ref:a}):null};on.displayName="Presence";function F0(e){const[t,n]=d.useState(),r=d.useRef(null),o=d.useRef(e),a=d.useRef("none"),i=e?"mounted":"unmounted",[s,u]=$0(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return d.useEffect(()=>{const c=ha(r.current);a.current=s==="mounted"?c:"none"},[s]),er(()=>{const c=r.current,f=o.current;if(f!==e){const h=a.current,m=ha(c);e?u("MOUNT"):m==="none"||(c==null?void 0:c.display)==="none"?u("UNMOUNT"):u(f&&h!==m?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,u]),er(()=>{var c;if(t){let f;const l=(c=t.ownerDocument.defaultView)!=null?c:window,h=y=>{const v=ha(r.current).includes(y.animationName);if(y.target===t&&v&&(u("ANIMATION_END"),!o.current)){const p=t.style.animationFillMode;t.style.animationFillMode="forwards",f=l.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=p)})}},m=y=>{y.target===t&&(a.current=ha(r.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{l.clearTimeout(f),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:d.useCallback(c=>{r.current=c?getComputedStyle(c):null,n(c)},[])}}function ha(e){return(e==null?void 0:e.animationName)||"none"}function z0(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var fs=0;function vs(){d.useEffect(()=>{var t,n;const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(t=e[0])!=null?t:xc()),document.body.insertAdjacentElement("beforeend",(n=e[1])!=null?n:xc()),fs++,()=>{fs===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),fs--}},[])}function xc(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var On=function(){return On=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},On.apply(this,arguments)};function Sc(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}function H0(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,a;r<o;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var pa="right-scroll-bar-position",ga="width-before-scroll-bar",V0="with-scroll-bars-hidden",W0="--removed-body-scroll-bar-size";function ms(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function B0(e,t){var n=D.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var j0=typeof window<"u"?d.useLayoutEffect:d.useEffect,Ec=new WeakMap;function Y0(e,t){var n=B0(null,function(r){return e.forEach(function(o){return ms(o,r)})});return j0(function(){var r=Ec.get(n);if(r){var o=new Set(r),a=new Set(e),i=n.current;o.forEach(function(s){a.has(s)||ms(s,null)}),a.forEach(function(s){o.has(s)||ms(s,i)})}Ec.set(n,e)},[e]),n}function U0(e){return e}function q0(e,t){t===void 0&&(t=U0);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(a){var i=t(a,r);return n.push(i),function(){n=n.filter(function(s){return s!==i})}},assignSyncMedium:function(a){for(r=!0;n.length;){var i=n;n=[],i.forEach(a)}n={push:function(s){return a(s)},filter:function(){return n}}},assignMedium:function(a){r=!0;var i=[];if(n.length){var s=n;n=[],s.forEach(a),i=n}var u=function(){var f=i;i=[],f.forEach(a)},c=function(){return Promise.resolve().then(u)};c(),n={push:function(f){i.push(f),c()},filter:function(f){return i=i.filter(f),n}}}};return o}function G0(e){e===void 0&&(e={});var t=q0(null);return t.options=On({async:!0,ssr:!1},e),t}var Mc=function(e){var t=e.sideCar,n=Sc(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return d.createElement(r,On({},n))};Mc.isSideCarExport=!0;function K0(e,t){return e.useMedium(t),Mc}var Pc=G0(),hs=function(){},ya=d.forwardRef(function(e,t){var n=d.useRef(null),r=d.useState({onScrollCapture:hs,onWheelCapture:hs,onTouchMoveCapture:hs}),o=r[0],a=r[1],i=e.forwardProps,s=e.children,u=e.className,c=e.removeScrollBar,f=e.enabled,l=e.shards,h=e.sideCar,m=e.noIsolation,y=e.inert,w=e.allowPinchZoom,v=e.as,p=v===void 0?"div":v,g=e.gapMode,b=Sc(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=h,x=Y0([n,t]),S=On(On({},b),o);return d.createElement(d.Fragment,null,f&&d.createElement(C,{sideCar:Pc,removeScrollBar:c,shards:l,noIsolation:m,inert:y,setCallbacks:a,allowPinchZoom:!!w,lockRef:n,gapMode:g}),i?d.cloneElement(d.Children.only(s),On(On({},S),{ref:x})):d.createElement(p,On({},S,{className:u,ref:x}),s))});ya.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},ya.classNames={fullWidth:ga,zeroRight:pa};var X0=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Z0(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=X0();return t&&e.setAttribute("nonce",t),e}function Q0(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function J0(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var ey=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Z0())&&(Q0(t,n),J0(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},ty=function(){var e=ey();return function(t,n){d.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Dc=function(){var e=ty(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},ny={left:0,top:0,right:0,gap:0},ps=function(e){return parseInt(e||"",10)||0},ry=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[ps(n),ps(r),ps(o)]},oy=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return ny;var t=ry(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},ay=Dc(),Vr="data-scroll-locked",iy=function(e,t,n,r){var o=e.left,a=e.top,i=e.right,s=e.gap;return n===void 0&&(n="margin"),`
1280
+ `},size:{small:"univer-h-6 univer-rounded-md univer-px-1.5 univer-text-xs",middle:"univer-h-8 univer-rounded-lg univer-px-2 univer-text-sm",large:"univer-h-10 univer-rounded-lg univer-px-3 univer-text-sm"}},defaultVariants:{variant:"default",size:"middle"}}),kn=D.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},a)=>{const i=r?Kg:"button";return P.jsx(i,{className:xe(t0({variant:t,size:n,className:e})),ref:a,"data-u-comp":"button",...o})});kn.displayName="Button";const n0=({className:e,orientation:t="horizontal",children:n})=>{const r=D.Children.count(n),o=t==="horizontal",a=t==="vertical";return P.jsx("div",{className:xe("univer-grid",{"univer-grid-flow-row":a,"univer-w-fit":a},e),children:D.Children.map(n,(i,s)=>{const u=s===0,c=s===r-1;return D.cloneElement(i,{className:xe({"!univer-rounded-l-none":o&&!u,"!univer-rounded-r-none":o&&!c,"!univer-border-l-0":o&&!u,"!univer-rounded-t-none":a&&!u,"!univer-rounded-b-none":a&&!c,"!univer-border-t-0":a&&!u},i.props.className)})})})},er="univer-scrollbar-thin univer-scrollbar-track-gray-50 univer-scrollbar-thumb-gray-300 dark:!univer-scrollbar-track-gray-900 dark:!univer-scrollbar-thumb-gray-700",Fr="univer-border-gray-200 dark:!univer-border-gray-600 univer-border-solid",mn=xe(Fr,"univer-border"),r0=xe(Fr,"univer-border-l univer-border-b univer-border-0"),o0=xe(Fr,"univer-border-l univer-border-0"),a0=xe(Fr,"univer-border-t univer-border-0"),i0=xe(Fr,"univer-border-b univer-border-0"),s0=xe(Fr,"univer-border-r univer-border-0"),l0="univer-divide-gray-200 dark:!univer-divide-gray-600 univer-divide-y univer-divide-x-0 univer-divide-solid",u0="univer-divide-gray-200 dark:!univer-divide-gray-600 univer-divide-x univer-divide-y-0 univer-divide-solid";function va(){return typeof window<"u"&&typeof document<"u"}const hn=D.createContext({mountContainer:va()?document.body:null});function c0(e){const{children:t,locale:n,mountContainer:r}=e,o=D.useMemo(()=>({locale:n,mountContainer:r}),[n,r]);return P.jsx(hn.Provider,{value:o,children:t})}function cc({emptyText:e}){return P.jsx("section",{className:"univer-h-8 univer-px-2 univer-pr-32 univer-text-sm/8 univer-text-gray-600 dark:!univer-text-gray-200",children:e})}function d0(e){const{value:t,options:n=[],onChange:r,contentClassName:o,wrapperClassName:a}=e,{locale:i}=D.useContext(hn),s=D.useMemo(()=>{const c=[n];return t.forEach((d,l)=>{const h=c[l].find(m=>m.value===d);h!=null&&h.children&&c.push(h.children)}),c},[t]);function u(c,d){if(d===t[c])return;if(t[c+1]){const h=t.slice(0,c+1);h[c]=d,r(h);return}const l=[...t];l[c]=d,r(l)}return P.jsxs("section",{"data-u-comp":"cascader-list",className:xe("univer-overflow-auto-y univer-grid univer-h-full univer-max-h-80 univer-grid-flow-col univer-rounded univer-py-2 univer-text-gray-900 dark:!univer-text-white [&>ul:not(:last-child)]:univer-border-0 [&>ul:not(:last-child)]:univer-border-r [&>ul:not(:last-child)]:univer-border-solid [&>ul:not(:last-child)]:univer-border-r-gray-200",mn,er,a),children:[s.map((c,d)=>c.length?P.jsx("ul",{className:xe("univer-m-0 univer-h-full univer-max-h-full univer-list-none univer-overflow-auto univer-px-2",er,o),children:c.map(l=>P.jsx("li",{children:P.jsxs("a",{className:xe("univer-relative univer-block univer-h-8 univer-cursor-pointer univer-rounded univer-text-sm/8",{"univer-px-7":d>0,"univer-px-1.5":d===0,"univer-bg-gray-200 dark:!univer-bg-gray-600":l.value===t[d]}),onClick:()=>u(d,l.value),children:[d>0&&P.jsx("span",{className:"univer-absolute univer-left-2 univer-flex univer-h-full univer-items-center",children:l.value===t[d]&&P.jsx(Rr,{className:"univer-text-primary-600"})}),P.jsx("span",{children:l.label})]})},l.value))},d):P.jsx(cc,{emptyText:i==null?void 0:i.CascaderList.empty},d)),t.length<=0&&P.jsx(cc,{emptyText:i==null?void 0:i.CascaderList.empty})]})}function f0(e){const{children:t,className:n,style:r,value:o,disabled:a,direction:i="horizontal",onChange:s}=e,u=c=>{o.includes(c)?s(o.filter(d=>d!==c)):s([...o,c])};return P.jsx("div",{className:xe("univer-flex univer-gap-2",{"univer-flex-col":i==="vertical"},n),style:r,children:D.Children.map(t,(c,d)=>D.isValidElement(c)?D.cloneElement(c,{key:d,children:c.props.children,checked:c.props.value?o.includes(c.props.value):!1,disabled:a!=null?a:c.props.disabled,onChange:u}):c)})}function dc(e){const{children:t,className:n,style:r,checked:o=!1,indeterminate:a=!1,value:i,disabled:s=!1,onChange:u,contentClassName:c}=e,d=D.useRef(null);function l(h){var m,y;if(h.stopPropagation(),!(!u||s))if(typeof i<"u")u==null||u(i);else{const w=(y=(m=d==null?void 0:d.current)==null?void 0:m.checked)!=null?y:!1;u==null||u(w)}}return P.jsxs("label",{"data-u-comp":"checkbox",className:xe("univer-box-border univer-inline-flex univer-items-center univer-gap-2 univer-text-sm",{"univer-cursor-pointer univer-text-gray-900 dark:!univer-text-white":!s,"univer-text-gray-400":s},n),style:r,children:[P.jsxs("span",{className:"univer-relative univer-block",children:[P.jsx("input",{ref:d,className:"univer-absolute univer-size-0 univer-opacity-0",type:"checkbox",checked:o,disabled:s,onChange:l}),P.jsxs("span",{className:xe("univer-relative univer-box-border univer-flex univer-size-4 univer-items-center univer-justify-center univer-overflow-hidden univer-rounded univer-border univer-border-solid univer-transition-colors",{"univer-opacity-50":s,"univer-border-primary-600 univer-bg-primary-600":o||a,"univer-border-gray-300 univer-bg-gray-50 dark:!univer-border-gray-500 dark:!univer-bg-gray-600":!o&&!a}),children:[o&&P.jsx(Rr,{className:"univer-absolute univer-left-1/2 univer-top-1/2 univer-block univer-size-3 -univer-translate-x-1/2 -univer-translate-y-1/2 univer-text-white"}),a&&!o&&P.jsx("span",{className:"univer-absolute univer-left-1/2 univer-top-1/2 univer-block univer-h-0.5 univer-w-2.5 -univer-translate-x-1/2 -univer-translate-y-1/2 univer-rounded univer-bg-white"})]})]}),P.jsx("span",{className:xe("univer-select-none",c),children:t})]})}function Ie(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function v0(e,t){const n=f.createContext(t),r=a=>{const{children:i,...s}=a,u=f.useMemo(()=>s,Object.values(s));return P.jsx(n.Provider,{value:u,children:i})};r.displayName=e+"Provider";function o(a){const i=f.useContext(n);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${a}\` must be used within \`${e}\``)}return[r,o]}function Wn(e,t=[]){let n=[];function r(a,i){const s=f.createContext(i),u=n.length;n=[...n,i];const c=l=>{var p;const{scope:h,children:m,...y}=l,w=((p=h==null?void 0:h[e])==null?void 0:p[u])||s,v=f.useMemo(()=>y,Object.values(y));return P.jsx(w.Provider,{value:v,children:m})};c.displayName=a+"Provider";function d(l,h){var w;const m=((w=h==null?void 0:h[e])==null?void 0:w[u])||s,y=f.useContext(m);if(y)return y;if(i!==void 0)return i;throw new Error(`\`${l}\` must be used within \`${a}\``)}return[c,d]}const o=()=>{const a=n.map(i=>f.createContext(i));return function(s){const u=(s==null?void 0:s[e])||a;return f.useMemo(()=>({[`__scope${e}`]:{...s,[e]:u}}),[s,u])}};return o.scopeName=e,[r,m0(o,...t)]}function m0(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(a){const i=r.reduce((s,{useScope:u,scopeName:c})=>{const l=u(a)[`__scope${c}`];return{...s,...l}},{});return f.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}var tr=globalThis!=null&&globalThis.document?f.useLayoutEffect:()=>{},h0=f[" useId ".trim().toString()]||(()=>{}),p0=0;function Nn(e){const[t,n]=f.useState(h0());return tr(()=>{n(r=>r!=null?r:String(p0++))},[e]),e||(t?`radix-${t}`:"")}var g0=f[" useInsertionEffect ".trim().toString()]||tr;function xr({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,a,i]=y0({defaultProp:t,onChange:n}),s=e!==void 0,u=s?e:o;{const d=f.useRef(e!==void 0);f.useEffect(()=>{const l=d.current;l!==s&&console.warn(`${r} is changing from ${l?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=s},[s,r])}const c=f.useCallback(d=>{var l;if(s){const h=b0(d)?d(e):d;h!==e&&((l=i.current)==null||l.call(i,h))}else a(d)},[s,e,a,i]);return[u,c]}function y0({defaultProp:e,onChange:t}){const[n,r]=f.useState(e),o=f.useRef(n),a=f.useRef(t);return g0(()=>{a.current=t},[t]),f.useEffect(()=>{var i;o.current!==n&&((i=a.current)==null||i.call(a,n),o.current=n)},[n,o]),[n,r,a]}function b0(e){return typeof e=="function"}var w0=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],gt=w0.reduce((e,t)=>{const n=Cr(`Primitive.${t}`),r=f.forwardRef((o,a)=>{const{asChild:i,...s}=o,u=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),P.jsx(u,{...s,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function fc(e,t){e&&ku.flushSync(()=>e.dispatchEvent(t))}function _n(e){const t=f.useRef(e);return f.useEffect(()=>{t.current=e}),f.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function C0(e,t=globalThis==null?void 0:globalThis.document){const n=_n(e);f.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var x0="DismissableLayer",us="dismissableLayer.update",S0="dismissableLayer.pointerDownOutside",E0="dismissableLayer.focusOutside",vc,mc=f.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),zr=f.forwardRef((e,t)=>{var E;const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:a,onInteractOutside:i,onDismiss:s,...u}=e,c=f.useContext(mc),[d,l]=f.useState(null),h=(E=d==null?void 0:d.ownerDocument)!=null?E:globalThis==null?void 0:globalThis.document,[,m]=f.useState({}),y=Pt(t,M=>l(M)),w=Array.from(c.layers),[v]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),p=w.indexOf(v),g=d?w.indexOf(d):-1,b=c.layersWithOutsidePointerEventsDisabled.size>0,C=g>=p,x=D0(M=>{const k=M.target,T=[...c.branches].some(R=>R.contains(k));!C||T||(o==null||o(M),i==null||i(M),M.defaultPrevented||s==null||s())},h),S=k0(M=>{const k=M.target;[...c.branches].some(R=>R.contains(k))||(a==null||a(M),i==null||i(M),M.defaultPrevented||s==null||s())},h);return C0(M=>{g===c.layers.size-1&&(r==null||r(M),!M.defaultPrevented&&s&&(M.preventDefault(),s()))},h),f.useEffect(()=>{if(d)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(vc=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(d)),c.layers.add(d),hc(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=vc)}},[d,h,n,c]),f.useEffect(()=>()=>{d&&(c.layers.delete(d),c.layersWithOutsidePointerEventsDisabled.delete(d),hc())},[d,c]),f.useEffect(()=>{const M=()=>m({});return document.addEventListener(us,M),()=>document.removeEventListener(us,M)},[]),P.jsx(gt.div,{...u,ref:y,style:{pointerEvents:b?C?"auto":"none":void 0,...e.style},onFocusCapture:Ie(e.onFocusCapture,S.onFocusCapture),onBlurCapture:Ie(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:Ie(e.onPointerDownCapture,x.onPointerDownCapture)})});zr.displayName=x0;var M0="DismissableLayerBranch",P0=f.forwardRef((e,t)=>{const n=f.useContext(mc),r=f.useRef(null),o=Pt(t,r);return f.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),P.jsx(gt.div,{...e,ref:o})});P0.displayName=M0;function D0(e,t=globalThis==null?void 0:globalThis.document){const n=_n(e),r=f.useRef(!1),o=f.useRef(()=>{});return f.useEffect(()=>{const a=s=>{if(s.target&&!r.current){let u=function(){pc(S0,n,c,{discrete:!0})};const c={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=u,t.addEventListener("click",o.current,{once:!0})):u()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",a),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function k0(e,t=globalThis==null?void 0:globalThis.document){const n=_n(e),r=f.useRef(!1);return f.useEffect(()=>{const o=a=>{a.target&&!r.current&&pc(E0,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function hc(){const e=new CustomEvent(us);document.dispatchEvent(e)}function pc(e,t,n,{discrete:r}){const o=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?fc(o,a):o.dispatchEvent(a)}var cs="focusScope.autoFocusOnMount",ds="focusScope.autoFocusOnUnmount",gc={bubbles:!1,cancelable:!0},N0="FocusScope",ma=f.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:a,...i}=e,[s,u]=f.useState(null),c=_n(o),d=_n(a),l=f.useRef(null),h=Pt(t,w=>u(w)),m=f.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;f.useEffect(()=>{if(r){let w=function(b){if(m.paused||!s)return;const C=b.target;s.contains(C)?l.current=C:nr(l.current,{select:!0})},v=function(b){if(m.paused||!s)return;const C=b.relatedTarget;C!==null&&(s.contains(C)||nr(l.current,{select:!0}))},p=function(b){if(document.activeElement===document.body)for(const x of b)x.removedNodes.length>0&&nr(s)};document.addEventListener("focusin",w),document.addEventListener("focusout",v);const g=new MutationObserver(p);return s&&g.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",v),g.disconnect()}}},[r,s,m.paused]),f.useEffect(()=>{if(s){wc.add(m);const w=document.activeElement;if(!s.contains(w)){const p=new CustomEvent(cs,gc);s.addEventListener(cs,c),s.dispatchEvent(p),p.defaultPrevented||(_0(A0(yc(s)),{select:!0}),document.activeElement===w&&nr(s))}return()=>{s.removeEventListener(cs,c),setTimeout(()=>{const p=new CustomEvent(ds,gc);s.addEventListener(ds,d),s.dispatchEvent(p),p.defaultPrevented||nr(w!=null?w:document.body,{select:!0}),s.removeEventListener(ds,d),wc.remove(m)},0)}}},[s,c,d,m]);const y=f.useCallback(w=>{if(!n&&!r||m.paused)return;const v=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,p=document.activeElement;if(v&&p){const g=w.currentTarget,[b,C]=O0(g);b&&C?!w.shiftKey&&p===C?(w.preventDefault(),n&&nr(b,{select:!0})):w.shiftKey&&p===b&&(w.preventDefault(),n&&nr(C,{select:!0})):p===g&&w.preventDefault()}},[n,r,m.paused]);return P.jsx(gt.div,{tabIndex:-1,...i,ref:h,onKeyDown:y})});ma.displayName=N0;function _0(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(nr(r,{select:t}),document.activeElement!==n)return}function O0(e){const t=yc(e),n=bc(t,e),r=bc(t.reverse(),e);return[n,r]}function yc(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function bc(e,t){for(const n of e)if(!T0(n,{upTo:t}))return n}function T0(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function I0(e){return e instanceof HTMLInputElement&&"select"in e}function nr(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&I0(e)&&t&&e.select()}}var wc=R0();function R0(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Cc(e,t),e.unshift(t)},remove(t){var n;e=Cc(e,t),(n=e[0])==null||n.resume()}}}function Cc(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function A0(e){return e.filter(t=>t.tagName!=="A")}var L0="Portal",Hr=f.forwardRef((e,t)=>{var s;const{container:n,...r}=e,[o,a]=f.useState(!1);tr(()=>a(!0),[]);const i=n||o&&((s=globalThis==null?void 0:globalThis.document)==null?void 0:s.body);return i?It.createPortal(P.jsx(gt.div,{...r,ref:t}),i):null});Hr.displayName=L0;function $0(e,t){return f.useReducer((n,r)=>{const o=t[n][r];return o!=null?o:n},e)}var on=e=>{const{present:t,children:n}=e,r=F0(t),o=typeof n=="function"?n({present:r.isPresent}):f.Children.only(n),a=Pt(r.ref,z0(o));return typeof n=="function"||r.isPresent?f.cloneElement(o,{ref:a}):null};on.displayName="Presence";function F0(e){const[t,n]=f.useState(),r=f.useRef(null),o=f.useRef(e),a=f.useRef("none"),i=e?"mounted":"unmounted",[s,u]=$0(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return f.useEffect(()=>{const c=ha(r.current);a.current=s==="mounted"?c:"none"},[s]),tr(()=>{const c=r.current,d=o.current;if(d!==e){const h=a.current,m=ha(c);e?u("MOUNT"):m==="none"||(c==null?void 0:c.display)==="none"?u("UNMOUNT"):u(d&&h!==m?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,u]),tr(()=>{var c;if(t){let d;const l=(c=t.ownerDocument.defaultView)!=null?c:window,h=y=>{const v=ha(r.current).includes(y.animationName);if(y.target===t&&v&&(u("ANIMATION_END"),!o.current)){const p=t.style.animationFillMode;t.style.animationFillMode="forwards",d=l.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=p)})}},m=y=>{y.target===t&&(a.current=ha(r.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{l.clearTimeout(d),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:f.useCallback(c=>{r.current=c?getComputedStyle(c):null,n(c)},[])}}function ha(e){return(e==null?void 0:e.animationName)||"none"}function z0(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var fs=0;function vs(){f.useEffect(()=>{var t,n;const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(t=e[0])!=null?t:xc()),document.body.insertAdjacentElement("beforeend",(n=e[1])!=null?n:xc()),fs++,()=>{fs===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),fs--}},[])}function xc(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var On=function(){return On=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},On.apply(this,arguments)};function Sc(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}function H0(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,a;r<o;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var pa="right-scroll-bar-position",ga="width-before-scroll-bar",V0="with-scroll-bars-hidden",W0="--removed-body-scroll-bar-size";function ms(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function B0(e,t){var n=D.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var j0=typeof window<"u"?f.useLayoutEffect:f.useEffect,Ec=new WeakMap;function Y0(e,t){var n=B0(null,function(r){return e.forEach(function(o){return ms(o,r)})});return j0(function(){var r=Ec.get(n);if(r){var o=new Set(r),a=new Set(e),i=n.current;o.forEach(function(s){a.has(s)||ms(s,null)}),a.forEach(function(s){o.has(s)||ms(s,i)})}Ec.set(n,e)},[e]),n}function U0(e){return e}function q0(e,t){t===void 0&&(t=U0);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(a){var i=t(a,r);return n.push(i),function(){n=n.filter(function(s){return s!==i})}},assignSyncMedium:function(a){for(r=!0;n.length;){var i=n;n=[],i.forEach(a)}n={push:function(s){return a(s)},filter:function(){return n}}},assignMedium:function(a){r=!0;var i=[];if(n.length){var s=n;n=[],s.forEach(a),i=n}var u=function(){var d=i;i=[],d.forEach(a)},c=function(){return Promise.resolve().then(u)};c(),n={push:function(d){i.push(d),c()},filter:function(d){return i=i.filter(d),n}}}};return o}function G0(e){e===void 0&&(e={});var t=q0(null);return t.options=On({async:!0,ssr:!1},e),t}var Mc=function(e){var t=e.sideCar,n=Sc(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return f.createElement(r,On({},n))};Mc.isSideCarExport=!0;function K0(e,t){return e.useMedium(t),Mc}var Pc=G0(),hs=function(){},ya=f.forwardRef(function(e,t){var n=f.useRef(null),r=f.useState({onScrollCapture:hs,onWheelCapture:hs,onTouchMoveCapture:hs}),o=r[0],a=r[1],i=e.forwardProps,s=e.children,u=e.className,c=e.removeScrollBar,d=e.enabled,l=e.shards,h=e.sideCar,m=e.noIsolation,y=e.inert,w=e.allowPinchZoom,v=e.as,p=v===void 0?"div":v,g=e.gapMode,b=Sc(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=h,x=Y0([n,t]),S=On(On({},b),o);return f.createElement(f.Fragment,null,d&&f.createElement(C,{sideCar:Pc,removeScrollBar:c,shards:l,noIsolation:m,inert:y,setCallbacks:a,allowPinchZoom:!!w,lockRef:n,gapMode:g}),i?f.cloneElement(f.Children.only(s),On(On({},S),{ref:x})):f.createElement(p,On({},S,{className:u,ref:x}),s))});ya.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},ya.classNames={fullWidth:ga,zeroRight:pa};var X0=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Z0(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=X0();return t&&e.setAttribute("nonce",t),e}function Q0(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function J0(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var ey=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Z0())&&(Q0(t,n),J0(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},ty=function(){var e=ey();return function(t,n){f.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Dc=function(){var e=ty(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},ny={left:0,top:0,right:0,gap:0},ps=function(e){return parseInt(e||"",10)||0},ry=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[ps(n),ps(r),ps(o)]},oy=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return ny;var t=ry(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},ay=Dc(),Vr="data-scroll-locked",iy=function(e,t,n,r){var o=e.left,a=e.top,i=e.right,s=e.gap;return n===void 0&&(n="margin"),`
1281
1281
  .`.concat(V0,` {
1282
1282
  overflow: hidden `).concat(r,`;
1283
1283
  padding-right: `).concat(s,"px ").concat(r,`;
@@ -1314,18 +1314,18 @@ exports.useUpdateBinder = useUpdateBinder;
1314
1314
  body[`).concat(Vr,`] {
1315
1315
  `).concat(W0,": ").concat(s,`px;
1316
1316
  }
1317
- `)},kc=function(){var e=parseInt(document.body.getAttribute(Vr)||"0",10);return isFinite(e)?e:0},sy=function(){d.useEffect(function(){return document.body.setAttribute(Vr,(kc()+1).toString()),function(){var e=kc()-1;e<=0?document.body.removeAttribute(Vr):document.body.setAttribute(Vr,e.toString())}},[])},ly=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;sy();var a=d.useMemo(function(){return oy(o)},[o]);return d.createElement(ay,{styles:iy(a,!t,o,n?"":"!important")})},gs=!1;if(typeof window<"u")try{var ba=Object.defineProperty({},"passive",{get:function(){return gs=!0,!0}});window.addEventListener("test",ba,ba),window.removeEventListener("test",ba,ba)}catch{gs=!1}var Wr=gs?{passive:!1}:!1,uy=function(e){return e.tagName==="TEXTAREA"},_c=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!uy(e)&&n[t]==="visible")},cy=function(e){return _c(e,"overflowY")},dy=function(e){return _c(e,"overflowX")},Nc=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=Oc(e,r);if(o){var a=Tc(e,r),i=a[1],s=a[2];if(i>s)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},fy=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},vy=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Oc=function(e,t){return e==="v"?cy(t):dy(t)},Tc=function(e,t){return e==="v"?fy(t):vy(t)},my=function(e,t){return e==="h"&&t==="rtl"?-1:1},hy=function(e,t,n,r,o){var a=my(e,window.getComputedStyle(t).direction),i=a*r,s=n.target,u=t.contains(s),c=!1,f=i>0,l=0,h=0;do{var m=Tc(e,s),y=m[0],w=m[1],v=m[2],p=w-v-a*y;(y||p)&&Oc(e,s)&&(l+=p,h+=y),s instanceof ShadowRoot?s=s.host:s=s.parentNode}while(!u&&s!==document.body||u&&(t.contains(s)||t===s));return(f&&Math.abs(l)<1||!f&&Math.abs(h)<1)&&(c=!0),c},wa=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Ic=function(e){return[e.deltaX,e.deltaY]},Rc=function(e){return e&&"current"in e?e.current:e},py=function(e,t){return e[0]===t[0]&&e[1]===t[1]},gy=function(e){return`
1317
+ `)},kc=function(){var e=parseInt(document.body.getAttribute(Vr)||"0",10);return isFinite(e)?e:0},sy=function(){f.useEffect(function(){return document.body.setAttribute(Vr,(kc()+1).toString()),function(){var e=kc()-1;e<=0?document.body.removeAttribute(Vr):document.body.setAttribute(Vr,e.toString())}},[])},ly=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;sy();var a=f.useMemo(function(){return oy(o)},[o]);return f.createElement(ay,{styles:iy(a,!t,o,n?"":"!important")})},gs=!1;if(typeof window<"u")try{var ba=Object.defineProperty({},"passive",{get:function(){return gs=!0,!0}});window.addEventListener("test",ba,ba),window.removeEventListener("test",ba,ba)}catch{gs=!1}var Wr=gs?{passive:!1}:!1,uy=function(e){return e.tagName==="TEXTAREA"},Nc=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!uy(e)&&n[t]==="visible")},cy=function(e){return Nc(e,"overflowY")},dy=function(e){return Nc(e,"overflowX")},_c=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=Oc(e,r);if(o){var a=Tc(e,r),i=a[1],s=a[2];if(i>s)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},fy=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},vy=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Oc=function(e,t){return e==="v"?cy(t):dy(t)},Tc=function(e,t){return e==="v"?fy(t):vy(t)},my=function(e,t){return e==="h"&&t==="rtl"?-1:1},hy=function(e,t,n,r,o){var a=my(e,window.getComputedStyle(t).direction),i=a*r,s=n.target,u=t.contains(s),c=!1,d=i>0,l=0,h=0;do{var m=Tc(e,s),y=m[0],w=m[1],v=m[2],p=w-v-a*y;(y||p)&&Oc(e,s)&&(l+=p,h+=y),s instanceof ShadowRoot?s=s.host:s=s.parentNode}while(!u&&s!==document.body||u&&(t.contains(s)||t===s));return(d&&Math.abs(l)<1||!d&&Math.abs(h)<1)&&(c=!0),c},wa=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Ic=function(e){return[e.deltaX,e.deltaY]},Rc=function(e){return e&&"current"in e?e.current:e},py=function(e,t){return e[0]===t[0]&&e[1]===t[1]},gy=function(e){return`
1318
1318
  .block-interactivity-`.concat(e,` {pointer-events: none;}
1319
1319
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
1320
- `)},yy=0,Br=[];function by(e){var t=d.useRef([]),n=d.useRef([0,0]),r=d.useRef(),o=d.useState(yy++)[0],a=d.useState(Dc)[0],i=d.useRef(e);d.useEffect(function(){i.current=e},[e]),d.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var w=H0([e.lockRef.current],(e.shards||[]).map(Rc),!0).filter(Boolean);return w.forEach(function(v){return v.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),w.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var s=d.useCallback(function(w,v){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!i.current.allowPinchZoom;var p=wa(w),g=n.current,b="deltaX"in w?w.deltaX:g[0]-p[0],C="deltaY"in w?w.deltaY:g[1]-p[1],x,S=w.target,E=Math.abs(b)>Math.abs(C)?"h":"v";if("touches"in w&&E==="h"&&S.type==="range")return!1;var M=Nc(E,S);if(!M)return!0;if(M?x=E:(x=E==="v"?"h":"v",M=Nc(E,S)),!M)return!1;if(!r.current&&"changedTouches"in w&&(b||C)&&(r.current=x),!x)return!0;var k=r.current||x;return hy(k,v,w,k==="h"?b:C)},[]),u=d.useCallback(function(w){var v=w;if(!(!Br.length||Br[Br.length-1]!==a)){var p="deltaY"in v?Ic(v):wa(v),g=t.current.filter(function(x){return x.name===v.type&&(x.target===v.target||v.target===x.shadowParent)&&py(x.delta,p)})[0];if(g&&g.should){v.cancelable&&v.preventDefault();return}if(!g){var b=(i.current.shards||[]).map(Rc).filter(Boolean).filter(function(x){return x.contains(v.target)}),C=b.length>0?s(v,b[0]):!i.current.noIsolation;C&&v.cancelable&&v.preventDefault()}}},[]),c=d.useCallback(function(w,v,p,g){var b={name:w,delta:v,target:p,should:g,shadowParent:wy(p)};t.current.push(b),setTimeout(function(){t.current=t.current.filter(function(C){return C!==b})},1)},[]),f=d.useCallback(function(w){n.current=wa(w),r.current=void 0},[]),l=d.useCallback(function(w){c(w.type,Ic(w),w.target,s(w,e.lockRef.current))},[]),h=d.useCallback(function(w){c(w.type,wa(w),w.target,s(w,e.lockRef.current))},[]);d.useEffect(function(){return Br.push(a),e.setCallbacks({onScrollCapture:l,onWheelCapture:l,onTouchMoveCapture:h}),document.addEventListener("wheel",u,Wr),document.addEventListener("touchmove",u,Wr),document.addEventListener("touchstart",f,Wr),function(){Br=Br.filter(function(w){return w!==a}),document.removeEventListener("wheel",u,Wr),document.removeEventListener("touchmove",u,Wr),document.removeEventListener("touchstart",f,Wr)}},[]);var m=e.removeScrollBar,y=e.inert;return d.createElement(d.Fragment,null,y?d.createElement(a,{styles:gy(o)}):null,m?d.createElement(ly,{gapMode:e.gapMode}):null)}function wy(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Cy=K0(Pc,by);var Ca=d.forwardRef(function(e,t){return d.createElement(ya,On({},e,{ref:t,sideCar:Cy}))});Ca.classNames=ya.classNames;var xy=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},jr=new WeakMap,xa=new WeakMap,Sa={},ys=0,Ac=function(e){return e&&(e.host||Ac(e.parentNode))},Sy=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Ac(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Ey=function(e,t,n,r){var o=Sy(t,Array.isArray(e)?e:[e]);Sa[n]||(Sa[n]=new WeakMap);var a=Sa[n],i=[],s=new Set,u=new Set(o),c=function(l){!l||s.has(l)||(s.add(l),c(l.parentNode))};o.forEach(c);var f=function(l){!l||u.has(l)||Array.prototype.forEach.call(l.children,function(h){if(s.has(h))f(h);else try{var m=h.getAttribute(r),y=m!==null&&m!=="false",w=(jr.get(h)||0)+1,v=(a.get(h)||0)+1;jr.set(h,w),a.set(h,v),i.push(h),w===1&&y&&xa.set(h,!0),v===1&&h.setAttribute(n,"true"),y||h.setAttribute(r,"true")}catch(p){console.error("aria-hidden: cannot operate on ",h,p)}})};return f(t),s.clear(),ys++,function(){i.forEach(function(l){var h=jr.get(l)-1,m=a.get(l)-1;jr.set(l,h),a.set(l,m),h||(xa.has(l)||l.removeAttribute(r),xa.delete(l)),m||l.removeAttribute(n)}),ys--,ys||(jr=new WeakMap,jr=new WeakMap,xa=new WeakMap,Sa={})}},bs=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=xy(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),Ey(r,o,n,"aria-hidden")):function(){return null}},Ea="Dialog",[Lc,_D]=Wn(Ea),[My,bn]=Lc(Ea),$c=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:a,modal:i=!0}=e,s=d.useRef(null),u=d.useRef(null),[c,f]=xr({prop:r,defaultProp:o!=null?o:!1,onChange:a,caller:Ea});return P.jsx(My,{scope:t,triggerRef:s,contentRef:u,contentId:_n(),titleId:_n(),descriptionId:_n(),open:c,onOpenChange:f,onOpenToggle:d.useCallback(()=>f(l=>!l),[f]),modal:i,children:n})};$c.displayName=Ea;var Fc="DialogTrigger",Py=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=bn(Fc,n),a=Pt(t,o.triggerRef);return P.jsx(gt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":xs(o.open),...r,ref:a,onClick:Ie(e.onClick,o.onOpenToggle)})});Py.displayName=Fc;var ws="DialogPortal",[Dy,zc]=Lc(ws,{forceMount:void 0}),Hc=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,a=bn(ws,t);return P.jsx(Dy,{scope:t,forceMount:n,children:d.Children.map(r,i=>P.jsx(on,{present:n||a.open,children:P.jsx(Hr,{asChild:!0,container:o,children:i})}))})};Hc.displayName=ws;var Ma="DialogOverlay",Vc=d.forwardRef((e,t)=>{const n=zc(Ma,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,a=bn(Ma,e.__scopeDialog);return a.modal?P.jsx(on,{present:r||a.open,children:P.jsx(_y,{...o,ref:t})}):null});Vc.displayName=Ma;var ky=wr("DialogOverlay.RemoveScroll"),_y=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=bn(Ma,n);return P.jsx(Ca,{as:ky,allowPinchZoom:!0,shards:[o.contentRef],children:P.jsx(gt.div,{"data-state":xs(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Sr="DialogContent",Wc=d.forwardRef((e,t)=>{const n=zc(Sr,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,a=bn(Sr,e.__scopeDialog);return P.jsx(on,{present:r||a.open,children:a.modal?P.jsx(Ny,{...o,ref:t}):P.jsx(Oy,{...o,ref:t})})});Wc.displayName=Sr;var Ny=d.forwardRef((e,t)=>{const n=bn(Sr,e.__scopeDialog),r=d.useRef(null),o=Pt(t,n.contentRef,r);return d.useEffect(()=>{const a=r.current;if(a)return bs(a)},[]),P.jsx(Bc,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ie(e.onCloseAutoFocus,a=>{var i;a.preventDefault(),(i=n.triggerRef.current)==null||i.focus()}),onPointerDownOutside:Ie(e.onPointerDownOutside,a=>{const i=a.detail.originalEvent,s=i.button===0&&i.ctrlKey===!0;(i.button===2||s)&&a.preventDefault()}),onFocusOutside:Ie(e.onFocusOutside,a=>a.preventDefault())})}),Oy=d.forwardRef((e,t)=>{const n=bn(Sr,e.__scopeDialog),r=d.useRef(!1),o=d.useRef(!1);return P.jsx(Bc,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var i,s;(i=e.onCloseAutoFocus)==null||i.call(e,a),a.defaultPrevented||(r.current||(s=n.triggerRef.current)==null||s.focus(),a.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:a=>{var u,c;(u=e.onInteractOutside)==null||u.call(e,a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=a.target;((c=n.triggerRef.current)==null?void 0:c.contains(i))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&o.current&&a.preventDefault()}})}),Bc=d.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:a,...i}=e,s=bn(Sr,n),u=d.useRef(null),c=Pt(t,u);return vs(),P.jsxs(P.Fragment,{children:[P.jsx(ma,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:a,children:P.jsx(zr,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":xs(s.open),...i,ref:c,onDismiss:()=>s.onOpenChange(!1)})}),P.jsxs(P.Fragment,{children:[P.jsx(Ty,{titleId:s.titleId}),P.jsx(Ry,{contentRef:u,descriptionId:s.descriptionId})]})]})}),Cs="DialogTitle",jc=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=bn(Cs,n);return P.jsx(gt.h2,{id:o.titleId,...r,ref:t})});jc.displayName=Cs;var Yc="DialogDescription",Uc=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=bn(Yc,n);return P.jsx(gt.p,{id:o.descriptionId,...r,ref:t})});Uc.displayName=Yc;var qc="DialogClose",Gc=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=bn(qc,n);return P.jsx(gt.button,{type:"button",...r,ref:t,onClick:Ie(e.onClick,()=>o.onOpenChange(!1))})});Gc.displayName=qc;function xs(e){return e?"open":"closed"}var Kc="DialogTitleWarning",[ND,Xc]=v0(Kc,{contentName:Sr,titleName:Cs,docsSlug:"dialog"}),Ty=({titleId:e})=>{const t=Xc(Kc),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
1320
+ `)},yy=0,Br=[];function by(e){var t=f.useRef([]),n=f.useRef([0,0]),r=f.useRef(),o=f.useState(yy++)[0],a=f.useState(Dc)[0],i=f.useRef(e);f.useEffect(function(){i.current=e},[e]),f.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var w=H0([e.lockRef.current],(e.shards||[]).map(Rc),!0).filter(Boolean);return w.forEach(function(v){return v.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),w.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var s=f.useCallback(function(w,v){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!i.current.allowPinchZoom;var p=wa(w),g=n.current,b="deltaX"in w?w.deltaX:g[0]-p[0],C="deltaY"in w?w.deltaY:g[1]-p[1],x,S=w.target,E=Math.abs(b)>Math.abs(C)?"h":"v";if("touches"in w&&E==="h"&&S.type==="range")return!1;var M=_c(E,S);if(!M)return!0;if(M?x=E:(x=E==="v"?"h":"v",M=_c(E,S)),!M)return!1;if(!r.current&&"changedTouches"in w&&(b||C)&&(r.current=x),!x)return!0;var k=r.current||x;return hy(k,v,w,k==="h"?b:C)},[]),u=f.useCallback(function(w){var v=w;if(!(!Br.length||Br[Br.length-1]!==a)){var p="deltaY"in v?Ic(v):wa(v),g=t.current.filter(function(x){return x.name===v.type&&(x.target===v.target||v.target===x.shadowParent)&&py(x.delta,p)})[0];if(g&&g.should){v.cancelable&&v.preventDefault();return}if(!g){var b=(i.current.shards||[]).map(Rc).filter(Boolean).filter(function(x){return x.contains(v.target)}),C=b.length>0?s(v,b[0]):!i.current.noIsolation;C&&v.cancelable&&v.preventDefault()}}},[]),c=f.useCallback(function(w,v,p,g){var b={name:w,delta:v,target:p,should:g,shadowParent:wy(p)};t.current.push(b),setTimeout(function(){t.current=t.current.filter(function(C){return C!==b})},1)},[]),d=f.useCallback(function(w){n.current=wa(w),r.current=void 0},[]),l=f.useCallback(function(w){c(w.type,Ic(w),w.target,s(w,e.lockRef.current))},[]),h=f.useCallback(function(w){c(w.type,wa(w),w.target,s(w,e.lockRef.current))},[]);f.useEffect(function(){return Br.push(a),e.setCallbacks({onScrollCapture:l,onWheelCapture:l,onTouchMoveCapture:h}),document.addEventListener("wheel",u,Wr),document.addEventListener("touchmove",u,Wr),document.addEventListener("touchstart",d,Wr),function(){Br=Br.filter(function(w){return w!==a}),document.removeEventListener("wheel",u,Wr),document.removeEventListener("touchmove",u,Wr),document.removeEventListener("touchstart",d,Wr)}},[]);var m=e.removeScrollBar,y=e.inert;return f.createElement(f.Fragment,null,y?f.createElement(a,{styles:gy(o)}):null,m?f.createElement(ly,{gapMode:e.gapMode}):null)}function wy(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Cy=K0(Pc,by);var Ca=f.forwardRef(function(e,t){return f.createElement(ya,On({},e,{ref:t,sideCar:Cy}))});Ca.classNames=ya.classNames;var xy=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},jr=new WeakMap,xa=new WeakMap,Sa={},ys=0,Ac=function(e){return e&&(e.host||Ac(e.parentNode))},Sy=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Ac(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Ey=function(e,t,n,r){var o=Sy(t,Array.isArray(e)?e:[e]);Sa[n]||(Sa[n]=new WeakMap);var a=Sa[n],i=[],s=new Set,u=new Set(o),c=function(l){!l||s.has(l)||(s.add(l),c(l.parentNode))};o.forEach(c);var d=function(l){!l||u.has(l)||Array.prototype.forEach.call(l.children,function(h){if(s.has(h))d(h);else try{var m=h.getAttribute(r),y=m!==null&&m!=="false",w=(jr.get(h)||0)+1,v=(a.get(h)||0)+1;jr.set(h,w),a.set(h,v),i.push(h),w===1&&y&&xa.set(h,!0),v===1&&h.setAttribute(n,"true"),y||h.setAttribute(r,"true")}catch(p){console.error("aria-hidden: cannot operate on ",h,p)}})};return d(t),s.clear(),ys++,function(){i.forEach(function(l){var h=jr.get(l)-1,m=a.get(l)-1;jr.set(l,h),a.set(l,m),h||(xa.has(l)||l.removeAttribute(r),xa.delete(l)),m||l.removeAttribute(n)}),ys--,ys||(jr=new WeakMap,jr=new WeakMap,xa=new WeakMap,Sa={})}},bs=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=xy(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),Ey(r,o,n,"aria-hidden")):function(){return null}},Ea="Dialog",[Lc,_D]=Wn(Ea),[My,bn]=Lc(Ea),$c=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:a,modal:i=!0}=e,s=f.useRef(null),u=f.useRef(null),[c,d]=xr({prop:r,defaultProp:o!=null?o:!1,onChange:a,caller:Ea});return P.jsx(My,{scope:t,triggerRef:s,contentRef:u,contentId:Nn(),titleId:Nn(),descriptionId:Nn(),open:c,onOpenChange:d,onOpenToggle:f.useCallback(()=>d(l=>!l),[d]),modal:i,children:n})};$c.displayName=Ea;var Fc="DialogTrigger",Py=f.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=bn(Fc,n),a=Pt(t,o.triggerRef);return P.jsx(gt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":xs(o.open),...r,ref:a,onClick:Ie(e.onClick,o.onOpenToggle)})});Py.displayName=Fc;var ws="DialogPortal",[Dy,zc]=Lc(ws,{forceMount:void 0}),Hc=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,a=bn(ws,t);return P.jsx(Dy,{scope:t,forceMount:n,children:f.Children.map(r,i=>P.jsx(on,{present:n||a.open,children:P.jsx(Hr,{asChild:!0,container:o,children:i})}))})};Hc.displayName=ws;var Ma="DialogOverlay",Vc=f.forwardRef((e,t)=>{const n=zc(Ma,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,a=bn(Ma,e.__scopeDialog);return a.modal?P.jsx(on,{present:r||a.open,children:P.jsx(Ny,{...o,ref:t})}):null});Vc.displayName=Ma;var ky=Cr("DialogOverlay.RemoveScroll"),Ny=f.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=bn(Ma,n);return P.jsx(Ca,{as:ky,allowPinchZoom:!0,shards:[o.contentRef],children:P.jsx(gt.div,{"data-state":xs(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Sr="DialogContent",Wc=f.forwardRef((e,t)=>{const n=zc(Sr,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,a=bn(Sr,e.__scopeDialog);return P.jsx(on,{present:r||a.open,children:a.modal?P.jsx(_y,{...o,ref:t}):P.jsx(Oy,{...o,ref:t})})});Wc.displayName=Sr;var _y=f.forwardRef((e,t)=>{const n=bn(Sr,e.__scopeDialog),r=f.useRef(null),o=Pt(t,n.contentRef,r);return f.useEffect(()=>{const a=r.current;if(a)return bs(a)},[]),P.jsx(Bc,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ie(e.onCloseAutoFocus,a=>{var i;a.preventDefault(),(i=n.triggerRef.current)==null||i.focus()}),onPointerDownOutside:Ie(e.onPointerDownOutside,a=>{const i=a.detail.originalEvent,s=i.button===0&&i.ctrlKey===!0;(i.button===2||s)&&a.preventDefault()}),onFocusOutside:Ie(e.onFocusOutside,a=>a.preventDefault())})}),Oy=f.forwardRef((e,t)=>{const n=bn(Sr,e.__scopeDialog),r=f.useRef(!1),o=f.useRef(!1);return P.jsx(Bc,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var i,s;(i=e.onCloseAutoFocus)==null||i.call(e,a),a.defaultPrevented||(r.current||(s=n.triggerRef.current)==null||s.focus(),a.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:a=>{var u,c;(u=e.onInteractOutside)==null||u.call(e,a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=a.target;((c=n.triggerRef.current)==null?void 0:c.contains(i))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&o.current&&a.preventDefault()}})}),Bc=f.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:a,...i}=e,s=bn(Sr,n),u=f.useRef(null),c=Pt(t,u);return vs(),P.jsxs(P.Fragment,{children:[P.jsx(ma,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:a,children:P.jsx(zr,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":xs(s.open),...i,ref:c,onDismiss:()=>s.onOpenChange(!1)})}),P.jsxs(P.Fragment,{children:[P.jsx(Ty,{titleId:s.titleId}),P.jsx(Ry,{contentRef:u,descriptionId:s.descriptionId})]})]})}),Cs="DialogTitle",jc=f.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=bn(Cs,n);return P.jsx(gt.h2,{id:o.titleId,...r,ref:t})});jc.displayName=Cs;var Yc="DialogDescription",Uc=f.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=bn(Yc,n);return P.jsx(gt.p,{id:o.descriptionId,...r,ref:t})});Uc.displayName=Yc;var qc="DialogClose",Gc=f.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=bn(qc,n);return P.jsx(gt.button,{type:"button",...r,ref:t,onClick:Ie(e.onClick,()=>o.onOpenChange(!1))})});Gc.displayName=qc;function xs(e){return e?"open":"closed"}var Kc="DialogTitleWarning",[OD,Xc]=v0(Kc,{contentName:Sr,titleName:Cs,docsSlug:"dialog"}),Ty=({titleId:e})=>{const t=Xc(Kc),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
1321
1321
 
1322
1322
  If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
1323
1323
 
1324
- For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return d.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Iy="DialogDescriptionWarning",Ry=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Xc(Iy).contentName}}.`;return d.useEffect(()=>{var a;const o=(a=e.current)==null?void 0:a.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Ay=$c,Ly=Hc,Zc=Vc,Qc=Wc,Jc=jc,ed=Uc,$y=Gc;const Fy=Ay,zy=Ly,td=D.forwardRef(({className:e,...t},n)=>P.jsx(Zc,{ref:n,className:Se(`
1324
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return f.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Iy="DialogDescriptionWarning",Ry=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Xc(Iy).contentName}}.`;return f.useEffect(()=>{var a;const o=(a=e.current)==null?void 0:a.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Ay=$c,Ly=Hc,Zc=Vc,Qc=Wc,Jc=jc,ed=Uc,$y=Gc;const Fy=Ay,zy=Ly,td=D.forwardRef(({className:e,...t},n)=>P.jsx(Zc,{ref:n,className:xe(`
1325
1325
  univer-bg-black/80 univer-fixed univer-inset-0 univer-z-[1050]
1326
1326
  data-[state=open]:univer-animate-in data-[state=open]:univer-fade-in-0
1327
1327
  data-[state=closed]:univer-animate-out data-[state=closed]:univer-fade-out-0
1328
- `,e),...t}));td.displayName=Zc.displayName;const nd=D.forwardRef(({className:e,children:t,closable:n=!0,onClickClose:r,...o},a)=>P.jsxs(zy,{children:[P.jsx(td,{}),P.jsxs(Qc,{ref:a,className:Se(`
1328
+ `,e),...t}));td.displayName=Zc.displayName;const nd=D.forwardRef(({className:e,children:t,closable:n=!0,onClickClose:r,...o},a)=>P.jsxs(zy,{children:[P.jsx(td,{}),P.jsxs(Qc,{ref:a,className:xe(`
1329
1329
  data-[state=open]:univer-animate-in data-[state=open]:univer-fade-in-0
1330
1330
  data-[state=open]:univer-zoom-in-95 data-[state=open]:univer-slide-in-from-left-1/2
1331
1331
  data-[state=open]:univer-slide-in-from-top-[48%]
@@ -1337,26 +1337,26 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
1337
1337
  univer-bg-white univer-px-6 univer-py-4 univer-text-gray-500 univer-shadow-md univer-duration-200
1338
1338
  sm:!univer-rounded-lg
1339
1339
  dark:!univer-bg-gray-700 dark:!univer-text-gray-400
1340
- `,yn,e),...o,children:[t,n&&P.jsxs($y,{className:"univer-absolute univer-right-4 univer-top-4 univer-size-6 univer-cursor-pointer univer-rounded-sm univer-border-none univer-bg-transparent univer-p-0 univer-transition-opacity hover:univer-opacity-100 disabled:univer-pointer-events-none",onClick:r,children:[P.jsx(ua,{className:"univer-size-4 univer-text-gray-400"}),P.jsx("span",{className:"univer-sr-only",children:"Close"})]})]})]}));nd.displayName=Qc.displayName;const rd=({className:e,...t})=>P.jsx("div",{className:Se(`
1340
+ `,mn,e),...o,children:[t,n&&P.jsxs($y,{className:"univer-absolute univer-right-4 univer-top-4 univer-size-6 univer-cursor-pointer univer-rounded-sm univer-border-none univer-bg-transparent univer-p-0 univer-transition-opacity hover:univer-opacity-100 disabled:univer-pointer-events-none",onClick:r,children:[P.jsx(ua,{className:"univer-size-4 univer-text-gray-400"}),P.jsx("span",{className:"univer-sr-only",children:"Close"})]})]})]}));nd.displayName=Qc.displayName;const rd=({className:e,...t})=>P.jsx("div",{className:xe(`
1341
1341
  univer-flex univer-flex-col univer-space-y-1.5 univer-text-center
1342
1342
  sm:!univer-text-left
1343
- `,e),...t});rd.displayName="DialogHeader";const od=({className:e,...t})=>P.jsx("div",{className:Se(`
1343
+ `,e),...t});rd.displayName="DialogHeader";const od=({className:e,...t})=>P.jsx("div",{className:xe(`
1344
1344
  univer-flex univer-flex-col-reverse
1345
1345
  sm:!univer-flex-row sm:!univer-justify-end sm:!univer-space-x-2
1346
- `,e),...t});od.displayName="DialogFooter";const ad=D.forwardRef(({className:e,...t},n)=>P.jsx(Jc,{ref:n,className:Se(`
1346
+ `,e),...t});od.displayName="DialogFooter";const ad=D.forwardRef(({className:e,...t},n)=>P.jsx(Jc,{ref:n,className:xe(`
1347
1347
  univer-my-0 univer-text-lg univer-font-semibold univer-leading-none univer-tracking-tight
1348
1348
  univer-text-gray-900
1349
1349
  dark:!univer-text-white
1350
- `,e),...t}));ad.displayName=Jc.displayName;const id=D.forwardRef(({className:e,...t},n)=>P.jsx(ed,{ref:n,className:Se("univer-text-sm univer-text-gray-500",e),...t}));id.displayName=ed.displayName;function Hy(e={}){const t=D.useCallback(()=>{const{innerWidth:v,innerHeight:p}=window;return{x:Math.max(0,(v-0)/2),y:Math.max(0,(p-0)/2)}},[]),{defaultPosition:n=t(),enabled:r=!1}=e,[o,a]=D.useState(n),[i,s]=D.useState(!1),u=D.useRef(null),c=D.useRef({x:0,y:0}),f=D.useRef({x:0,y:0}),l=D.useRef(!1);D.useEffect(()=>{if(!u.current||l.current||e.defaultPosition)return;const{width:v,height:p}=u.current.getBoundingClientRect(),{innerWidth:g,innerHeight:b}=window,C=Math.max(0,(g-v)/2),x=Math.max(0,(b-p)/2);a({x:C,y:x}),c.current={x:C,y:x},l.current=!0},[e.defaultPosition]);const h=D.useCallback((v,p)=>{if(!u.current)return{x:v,y:p};const g=u.current.getBoundingClientRect(),{clientWidth:b,clientHeight:C}=document.documentElement;let x=c.current.x+(v-f.current.x),S=c.current.y+(p-f.current.y);return x<0&&(x=0),S<0&&(S=0),x+g.width>b&&(x=b-g.width),S+g.height>C&&(S=C-g.height),{x,y:S}},[]),m=D.useCallback(v=>{r&&(v.preventDefault(),v.stopPropagation(),c.current={...o},f.current={x:v.clientX,y:v.clientY},s(!0),document.body.style.userSelect="none")},[r,o]),y=D.useCallback(v=>{if(!i)return;v.preventDefault(),v.stopPropagation();const p=h(v.clientX,v.clientY);a(p)},[i,h]),w=D.useCallback(()=>{s(!1),document.body.style.userSelect=""},[]);return D.useEffect(()=>{if(r)return document.addEventListener("mousemove",y),document.addEventListener("mouseup",w),()=>{document.removeEventListener("mousemove",y),document.removeEventListener("mouseup",w)}},[r,y,w]),{position:o,isDragging:i,elementRef:u,setElementRef:v=>{if(u.current=v,v&&!l.current&&!e.defaultPosition){const{width:p,height:g}=v.getBoundingClientRect(),{innerWidth:b,innerHeight:C}=window,x=Math.max(0,(b-p)/2),S=Math.max(0,(C-g)/2);a({x,y:S}),c.current={x,y:S},l.current=!0}},handleMouseDown:m}}function Ss(e){var $,L,N,H;const{className:t,children:n,style:r,open:o=!1,title:a,width:i,draggable:s=!1,defaultPosition:u,destroyOnClose:c=!1,footer:f,mask:l=!0,keyboard:h=!0,closable:m=!0,maskClosable:y=!0,showOk:w,showCancel:v,onOpenChange:p,onClose:g,onOk:b,onCancel:C}=e,{locale:x}=D.useContext(mn),{position:S,isDragging:E,setElementRef:M,handleMouseDown:k}=Hy({defaultPosition:u,enabled:s}),T=f!=null?f:w||v?P.jsxs("div",{className:"univer-flex univer-justify-end univer-gap-2",children:[v&&P.jsx(kn,{onClick:C,children:(L=($=x==null?void 0:x.Confirm)==null?void 0:$.cancel)!=null?L:"Cancel"}),w&&P.jsx(kn,{variant:"primary",onClick:b,children:(H=(N=x==null?void 0:x.Confirm)==null?void 0:N.confirm)!=null?H:"OK"})]}):null,R=D.useCallback(_=>{_&&s&&M(_)},[s,M]),F=D.useCallback(_=>{!y&&!_||(p==null||p(_),_||g==null||g())},[g,p]);function V(){p==null||p(!1),g==null||g()}return P.jsx(Fy,{open:o,onOpenChange:F,modal:l!==!1,children:P.jsxs(nd,{ref:R,className:Se(t,{"!univer-animate-none":s}),style:{...r,width:i?typeof i=="number"?`${i}px`:i:void 0,...s?{position:"absolute",margin:0,left:0,top:0,transform:`translate(${S.x}px, ${S.y}px)`,transition:E?"none":void 0,cursor:E?"grabbing":void 0}:{}},closable:m,onClickClose:V,children:[P.jsxs(rd,{className:Se({"!univer-hidden":!a}),"data-drag-handle":s?"true":void 0,style:{cursor:s?"grab":void 0,userSelect:s?"none":void 0,touchAction:s?"none":void 0},onMouseDown:s?k:void 0,children:[P.jsx(ad,{children:a}),P.jsx(id,{className:"univer-hidden"})]}),n,T&&P.jsx(od,{children:T})]})})}const Pa=(e,t,n)=>{t=t/100,n=n/100;const r=n*t,o=r*(1-Math.abs(e/60%2-1)),a=n-r;let i=0,s=0,u=0;return e>=0&&e<60?(i=r,s=o,u=0):e>=60&&e<120?(i=o,s=r,u=0):e>=120&&e<180?(i=0,s=r,u=o):e>=180&&e<240?(i=0,s=o,u=r):e>=240&&e<300?(i=o,s=0,u=r):e>=300&&e<360&&(i=r,s=0,u=o),[Math.round((i+a)*255),Math.round((s+a)*255),Math.round((u+a)*255)]},sd=(e,t,n)=>{const r=o=>o.toString(16).padStart(2,"0");return`#${r(e)}${r(t)}${r(n)}`},ld=(e,t,n)=>{e/=255,t/=255,n/=255;const r=Math.max(e,t,n),o=Math.min(e,t,n),a=r-o;let i=0,s=0;const u=r;return r!==0&&(s=a/r),a!==0&&(r===e?i=(t-n)/a+(t<n?6:0):r===t?i=(n-e)/a+2:r===n&&(i=(e-t)/a+4),i*=60),[i,s*100,u*100]},Es=e=>{const[t,n,r]=e.match(/\w\w/g).map(o=>Number.parseInt(o,16));return ld(t,n,r)},Da=(e,t,n)=>{const[r,o,a]=Pa(e,t,n);return sd(r,o,a)};function Vy({hsv:e,onChange:t}){const[n,r]=D.useState(""),o=D.useMemo(()=>Da(e[0],e[1],e[2]),[e]);D.useEffect(()=>{r(o.replace(/^#/,""))},[o]);const a=u=>/^[0-9A-Fa-f]{6}$/.test(u),i=u=>{const c=u.target.value.trim();if(!(c.length>6)&&!(c!==""&&!/^[0-9A-Fa-f]*$/.test(c))&&(r(c),a(c))){const f=Es(c);f&&t&&t(...f)}},s=()=>{a(n)||r(o.replace(/^#/,""))};return P.jsxs(P.Fragment,{children:[P.jsx("input",{className:"univer-w-full univer-px-2 !univer-pl-4 univer-uppercase focus:univer-border-primary-500 focus:univer-outline-none",value:n,onChange:i,onBlur:s,maxLength:6,spellCheck:!1}),P.jsx("span",{className:"univer-absolute univer-left-1.5 univer-top-1/2 -univer-translate-y-1/2 univer-text-sm univer-text-gray-400",children:"#"})]})}function Wy({hsv:e,onChange:t}){const[n,r]=D.useState({r:0,g:0,b:0});D.useEffect(()=>{const[i,s,u]=Pa(e[0],e[1],e[2]);r({r:Math.round(i),g:Math.round(s),b:Math.round(u)})},[e]);const o=(i,s)=>{if(s!==""&&!/^\d*$/.test(s))return;const u=s===""?0:Number.parseInt(s,10);if(u>255)return;const c={...n,[i]:u};if(r(c),t){const f=ld(c.r,c.g,c.b);t(...f)}},a=()=>{const[i,s,u]=Pa(e[0],e[1],e[2]);r({r:Math.round(i),g:Math.round(s),b:Math.round(u)})};return P.jsxs("div",{className:"univer-flex univer-items-center univer-gap-2 [&>input]:univer-w-11",children:[P.jsx("input",{value:n.r,onChange:i=>o("r",i.target.value),onBlur:a,maxLength:3}),P.jsx("input",{value:n.g,onChange:i=>o("g",i.target.value),onBlur:a,maxLength:3}),P.jsx("input",{value:n.b,onChange:i=>o("b",i.target.value),onBlur:a,maxLength:3})]})}function By({hsv:e,onChange:t}){return P.jsx("div",{className:"dark:![&_input]:univer-border-gray-600 dark:![&_input]:univer-text-white univer-flex univer-gap-2 [&_input]:univer-box-border [&_input]:univer-flex [&_input]:univer-h-7 [&_input]:univer-items-center [&_input]:univer-rounded [&_input]:univer-border [&_input]:univer-border-solid [&_input]:univer-border-gray-200 [&_input]:univer-bg-transparent [&_input]:univer-px-1.5 [&_input]:univer-text-sm [&_input]:univer-text-gray-700 [&_input]:univer-outline-none",children:P.jsxs("div",{className:"univer-relative univer-flex univer-flex-1 univer-gap-2",children:[P.jsx(Vy,{hsv:e,onChange:t}),P.jsx(Wy,{hsv:e,onChange:t})]})})}const jy=[["#FFFFFF","#E1EFFE","#FDE8E8","#FEECDC","#FFF4B9","#DEF7EC","#D5F5F6","#EDEBFE","#FCE8F3"],["#CDD0D8","#A4CAFE","#F8B4B4","#FDBA8C","#FAC815","#84E1BC","#7EDCE2","#CABFFD","#F8B4D9"],["#979DAC","#3F83F8","#F05252","#FF5A1F","#D49D0F","#0DA471","#0694A2","#9061F9","#E74694"],["#414657","#1A56DB","#C81E1E","#B43403","#9A6D15","#046C4E","#036672","#6C2BD9","#BF125D"],["#000000","#233876","#771D1D","#771D1D","#634312","#014737","#014451","#4A1D96","#751A3D"]];function Yy({hsv:e,onChange:t}){const n=D.useCallback(o=>{const[a,i,s]=Es(o);t(a,i,s)},[t]),r=Da(e[0],e[1],e[2]);return P.jsx("div",{"data-u-comp":"color-picker-presets",className:"univer-grid univer-content-center univer-gap-2",children:jy.map((o,a)=>P.jsx("div",{className:"univer-grid univer-grid-flow-col univer-items-center univer-justify-between univer-gap-2",children:o.map((i,s)=>P.jsx("button",{type:"button",className:Se("univer-box-border univer-h-5 univer-w-5 univer-cursor-pointer univer-rounded-full univer-border univer-border-solid univer-border-transparent univer-bg-gray-300 univer-transition-shadow",{"univer-ring-2 univer-ring-offset-2 univer-ring-offset-white dark:!univer-ring-primary-600 dark:!univer-ring-offset-gray-600":i.toUpperCase()===r.toUpperCase(),"!univer-border-gray-200":a===0&&s===0}),style:{backgroundColor:i},onClick:()=>n(i)},s))},a))})}function Uy({hsv:e,onChange:t,onChanged:n}){const r=D.useRef(null),o=D.useRef(null),[a,i]=D.useState(!1);D.useEffect(()=>{const l=r.current;if(!l)return;const h=l.getContext("2d");if(!h)return;const m=h.createLinearGradient(0,0,l.width,0);m.addColorStop(0,`hsl(${e[0]}, 0%, 50%)`),m.addColorStop(1,`hsl(${e[0]}, 100%, 50%)`),h.fillStyle=m,h.fillRect(0,0,l.width,l.height);const y=h.createLinearGradient(0,0,0,l.height);y.addColorStop(0,"rgba(255, 255, 255, 0)"),y.addColorStop(1,"rgba(0, 0, 0, 1)"),h.fillStyle=y,h.fillRect(0,0,l.width,l.height)},[e]);const s=l=>{l.stopPropagation();const h=r.current;if(!h)return;const m=h.getBoundingClientRect(),y=Math.max(0,Math.min(l.clientX-m.left,m.width)),w=Math.max(0,Math.min(l.clientY-m.top,m.height)),v=y/m.width*100,p=100-w/m.height*100;t(e[0],v,p)},u=D.useCallback(()=>{i(!1)},[e]);function c(){n==null||n(e[0],e[1],e[2])}D.useEffect(()=>{var l;return(l=o.current)==null||l.addEventListener("mouseup",c),window.addEventListener("pointerup",u),window.addEventListener("mouseup",u),()=>{var h;(h=o.current)==null||h.removeEventListener("mouseup",c),window.removeEventListener("pointerup",u),window.removeEventListener("mouseup",u)}},[e]);const f=()=>{var p,g,b,C;const m=(g=(p=o.current)==null?void 0:p.clientWidth)!=null?g:0,y=(C=(b=o.current)==null?void 0:b.clientHeight)!=null?C:0,w=e[1]/100*m-8,v=(100-e[2])/100*y-8;return{transform:`translate(${w}px, ${v}px)`,transition:a?"none":"transform 0.1s ease-out"}};return D.useEffect(()=>{const l=()=>{i(!1)};return window.addEventListener("pointerup",l),window.addEventListener("mouseup",l),()=>{window.removeEventListener("pointerup",l),window.removeEventListener("mouseup",l)}},[]),P.jsxs("div",{"data-u-comp":"color-picker-spectrum",ref:o,className:"univer-relative univer-overflow-hidden",children:[P.jsx("canvas",{ref:r,className:"univer-h-full univer-w-full univer-cursor-crosshair univer-rounded",onPointerDown:l=>{i(!0),s(l)},onPointerMove:l=>a&&s(l)}),P.jsx("div",{className:"univer-pointer-events-none univer-absolute univer-left-0 univer-top-0 univer-size-4 univer-rounded-full univer-border-2 univer-border-white univer-shadow-md univer-ring-2 univer-ring-white univer-will-change-transform",style:f()})]})}function qy({hsv:e,onChange:t,onChanged:n}){const[r,o]=D.useState(!1),a=D.useRef(null),i=D.useRef(null),s=D.useMemo(()=>{var h,m;return(m=(h=i.current)==null?void 0:h.clientWidth)!=null?m:0},[]),u=D.useCallback(h=>{const m=a.current;if(!m)return;const y=m.getBoundingClientRect(),w=y.width-s,v=Math.max(0,Math.min(h-y.left,w)),p=Math.round(v/w*360);t(p,e[1],e[2])},[e,s,t]),c=D.useCallback(h=>{h.stopPropagation(),r&&u(h.clientX)},[r,u]),f=D.useCallback(()=>{o(!1),n==null||n(e[0],e[1],e[2])},[e,n]);D.useEffect(()=>(r&&(window.addEventListener("pointermove",c),window.addEventListener("pointerup",f),window.addEventListener("mouseup",f)),()=>{window.removeEventListener("pointermove",c),window.removeEventListener("pointerup",f),window.removeEventListener("mouseup",f)}),[r,c,f]);const l=()=>{var m;return`${Math.min(Math.max(e[0],0),360)/360*(100-s/((m=a.current)==null?void 0:m.clientWidth)*100)}%`};return P.jsx("div",{"data-u-comp":"color-picker-hue-slider",className:"univer-relative univer-w-full univer-select-none",children:P.jsx("div",{ref:a,className:"univer-relative univer-h-2 univer-w-full univer-cursor-pointer univer-rounded-full univer-shadow-inner",style:{background:`linear-gradient(to right,
1350
+ `,e),...t}));ad.displayName=Jc.displayName;const id=D.forwardRef(({className:e,...t},n)=>P.jsx(ed,{ref:n,className:xe("univer-text-sm univer-text-gray-500",e),...t}));id.displayName=ed.displayName;function Hy(e={}){const t=D.useCallback(()=>{const{innerWidth:v,innerHeight:p}=window;return{x:Math.max(0,(v-0)/2),y:Math.max(0,(p-0)/2)}},[]),{defaultPosition:n=t(),enabled:r=!1}=e,[o,a]=D.useState(n),[i,s]=D.useState(!1),u=D.useRef(null),c=D.useRef({x:0,y:0}),d=D.useRef({x:0,y:0}),l=D.useRef(!1);D.useEffect(()=>{if(!u.current||l.current||e.defaultPosition)return;const{width:v,height:p}=u.current.getBoundingClientRect(),{innerWidth:g,innerHeight:b}=window,C=Math.max(0,(g-v)/2),x=Math.max(0,(b-p)/2);a({x:C,y:x}),c.current={x:C,y:x},l.current=!0},[e.defaultPosition]);const h=D.useCallback((v,p)=>{if(!u.current)return{x:v,y:p};const g=u.current.getBoundingClientRect(),{clientWidth:b,clientHeight:C}=document.documentElement;let x=c.current.x+(v-d.current.x),S=c.current.y+(p-d.current.y);return x<0&&(x=0),S<0&&(S=0),x+g.width>b&&(x=b-g.width),S+g.height>C&&(S=C-g.height),{x,y:S}},[]),m=D.useCallback(v=>{r&&(v.preventDefault(),v.stopPropagation(),c.current={...o},d.current={x:v.clientX,y:v.clientY},s(!0),document.body.style.userSelect="none")},[r,o]),y=D.useCallback(v=>{if(!i)return;v.preventDefault(),v.stopPropagation();const p=h(v.clientX,v.clientY);a(p)},[i,h]),w=D.useCallback(()=>{s(!1),document.body.style.userSelect=""},[]);return D.useEffect(()=>{if(r)return document.addEventListener("mousemove",y),document.addEventListener("mouseup",w),()=>{document.removeEventListener("mousemove",y),document.removeEventListener("mouseup",w)}},[r,y,w]),{position:o,isDragging:i,elementRef:u,setElementRef:v=>{if(u.current=v,v&&!l.current&&!e.defaultPosition){const{width:p,height:g}=v.getBoundingClientRect(),{innerWidth:b,innerHeight:C}=window,x=Math.max(0,(b-p)/2),S=Math.max(0,(C-g)/2);a({x,y:S}),c.current={x,y:S},l.current=!0}},handleMouseDown:m}}function Ss(e){var $,L,_,H;const{className:t,children:n,style:r,open:o=!1,title:a,width:i,draggable:s=!1,defaultPosition:u,destroyOnClose:c=!1,footer:d,mask:l=!0,keyboard:h=!0,closable:m=!0,maskClosable:y=!0,showOk:w,showCancel:v,onOpenChange:p,onClose:g,onOk:b,onCancel:C}=e,{locale:x}=D.useContext(hn),{position:S,isDragging:E,setElementRef:M,handleMouseDown:k}=Hy({defaultPosition:u,enabled:s}),T=d!=null?d:w||v?P.jsxs("div",{className:"univer-flex univer-justify-end univer-gap-2",children:[v&&P.jsx(kn,{onClick:C,children:(L=($=x==null?void 0:x.Confirm)==null?void 0:$.cancel)!=null?L:"Cancel"}),w&&P.jsx(kn,{variant:"primary",onClick:b,children:(H=(_=x==null?void 0:x.Confirm)==null?void 0:_.confirm)!=null?H:"OK"})]}):null,R=D.useCallback(N=>{N&&s&&M(N)},[s,M]),F=D.useCallback(N=>{!y&&!N||(p==null||p(N),N||g==null||g())},[g,p]);function V(){p==null||p(!1),g==null||g()}return P.jsx(Fy,{open:o,onOpenChange:F,modal:l!==!1,children:P.jsxs(nd,{ref:R,className:xe(t,{"!univer-animate-none":s}),style:{...r,width:i?typeof i=="number"?`${i}px`:i:void 0,...s?{position:"absolute",margin:0,left:0,top:0,transform:`translate(${S.x}px, ${S.y}px)`,transition:E?"none":void 0,cursor:E?"grabbing":void 0}:{}},closable:m,onClickClose:V,children:[P.jsxs(rd,{className:xe({"!univer-hidden":!a}),"data-drag-handle":s?"true":void 0,style:{cursor:s?"grab":void 0,userSelect:s?"none":void 0,touchAction:s?"none":void 0},onMouseDown:s?k:void 0,children:[P.jsx(ad,{children:a}),P.jsx(id,{className:"univer-hidden"})]}),n,T&&P.jsx(od,{children:T})]})})}const Pa=(e,t,n)=>{t=t/100,n=n/100;const r=n*t,o=r*(1-Math.abs(e/60%2-1)),a=n-r;let i=0,s=0,u=0;return e>=0&&e<60?(i=r,s=o,u=0):e>=60&&e<120?(i=o,s=r,u=0):e>=120&&e<180?(i=0,s=r,u=o):e>=180&&e<240?(i=0,s=o,u=r):e>=240&&e<300?(i=o,s=0,u=r):e>=300&&e<360&&(i=r,s=0,u=o),[Math.round((i+a)*255),Math.round((s+a)*255),Math.round((u+a)*255)]},sd=(e,t,n)=>{const r=o=>o.toString(16).padStart(2,"0");return`#${r(e)}${r(t)}${r(n)}`},ld=(e,t,n)=>{e/=255,t/=255,n/=255;const r=Math.max(e,t,n),o=Math.min(e,t,n),a=r-o;let i=0,s=0;const u=r;return r!==0&&(s=a/r),a!==0&&(r===e?i=(t-n)/a+(t<n?6:0):r===t?i=(n-e)/a+2:r===n&&(i=(e-t)/a+4),i*=60),[i,s*100,u*100]},Es=e=>{const[t,n,r]=e.match(/\w\w/g).map(o=>Number.parseInt(o,16));return ld(t,n,r)},Da=(e,t,n)=>{const[r,o,a]=Pa(e,t,n);return sd(r,o,a)};function Vy({hsv:e,onChange:t}){const[n,r]=D.useState(""),o=D.useMemo(()=>Da(e[0],e[1],e[2]),[e]);D.useEffect(()=>{r(o.replace(/^#/,""))},[o]);const a=u=>/^[0-9A-Fa-f]{6}$/.test(u),i=u=>{const c=u.target.value.trim();if(!(c.length>6)&&!(c!==""&&!/^[0-9A-Fa-f]*$/.test(c))&&(r(c),a(c))){const d=Es(c);d&&t&&t(...d)}},s=()=>{a(n)||r(o.replace(/^#/,""))};return P.jsxs(P.Fragment,{children:[P.jsx("input",{className:"univer-w-full univer-px-2 !univer-pl-4 univer-uppercase focus:univer-border-primary-500 focus:univer-outline-none",value:n,onChange:i,onBlur:s,maxLength:6,spellCheck:!1}),P.jsx("span",{className:"univer-absolute univer-left-1.5 univer-top-1/2 -univer-translate-y-1/2 univer-text-sm univer-text-gray-400",children:"#"})]})}function Wy({hsv:e,onChange:t}){const[n,r]=D.useState({r:0,g:0,b:0});D.useEffect(()=>{const[i,s,u]=Pa(e[0],e[1],e[2]);r({r:Math.round(i),g:Math.round(s),b:Math.round(u)})},[e]);const o=(i,s)=>{if(s!==""&&!/^\d*$/.test(s))return;const u=s===""?0:Number.parseInt(s,10);if(u>255)return;const c={...n,[i]:u};if(r(c),t){const d=ld(c.r,c.g,c.b);t(...d)}},a=()=>{const[i,s,u]=Pa(e[0],e[1],e[2]);r({r:Math.round(i),g:Math.round(s),b:Math.round(u)})};return P.jsxs("div",{className:"univer-flex univer-items-center univer-gap-2 [&>input]:univer-w-11",children:[P.jsx("input",{value:n.r,onChange:i=>o("r",i.target.value),onBlur:a,maxLength:3}),P.jsx("input",{value:n.g,onChange:i=>o("g",i.target.value),onBlur:a,maxLength:3}),P.jsx("input",{value:n.b,onChange:i=>o("b",i.target.value),onBlur:a,maxLength:3})]})}function By({hsv:e,onChange:t}){return P.jsx("div",{className:"dark:![&_input]:univer-border-gray-600 dark:![&_input]:univer-text-white univer-flex univer-gap-2 [&_input]:univer-box-border [&_input]:univer-flex [&_input]:univer-h-7 [&_input]:univer-items-center [&_input]:univer-rounded [&_input]:univer-border [&_input]:univer-border-solid [&_input]:univer-border-gray-200 [&_input]:univer-bg-transparent [&_input]:univer-px-1.5 [&_input]:univer-text-sm [&_input]:univer-text-gray-700 [&_input]:univer-outline-none",children:P.jsxs("div",{className:"univer-relative univer-flex univer-flex-1 univer-gap-2",children:[P.jsx(Vy,{hsv:e,onChange:t}),P.jsx(Wy,{hsv:e,onChange:t})]})})}const jy=[["#FFFFFF","#E1EFFE","#FDE8E8","#FEECDC","#FFF4B9","#DEF7EC","#D5F5F6","#EDEBFE","#FCE8F3"],["#CDD0D8","#A4CAFE","#F8B4B4","#FDBA8C","#FAC815","#84E1BC","#7EDCE2","#CABFFD","#F8B4D9"],["#979DAC","#3F83F8","#F05252","#FF5A1F","#D49D0F","#0DA471","#0694A2","#9061F9","#E74694"],["#414657","#1A56DB","#C81E1E","#B43403","#9A6D15","#046C4E","#036672","#6C2BD9","#BF125D"],["#000000","#233876","#771D1D","#771D1D","#634312","#014737","#014451","#4A1D96","#751A3D"]];function Yy({hsv:e,onChange:t}){const n=D.useCallback(o=>{const[a,i,s]=Es(o);t(a,i,s)},[t]),r=Da(e[0],e[1],e[2]);return P.jsx("div",{"data-u-comp":"color-picker-presets",className:"univer-grid univer-content-center univer-gap-2",children:jy.map((o,a)=>P.jsx("div",{className:"univer-grid univer-grid-flow-col univer-items-center univer-justify-between univer-gap-2",children:o.map((i,s)=>P.jsx("button",{type:"button",className:xe("univer-box-border univer-h-5 univer-w-5 univer-cursor-pointer univer-rounded-full univer-border univer-border-solid univer-border-transparent univer-bg-gray-300 univer-transition-shadow",{"univer-ring-2 univer-ring-offset-2 univer-ring-offset-white dark:!univer-ring-primary-600 dark:!univer-ring-offset-gray-600":i.toUpperCase()===r.toUpperCase(),"!univer-border-gray-200":a===0&&s===0}),style:{backgroundColor:i},onClick:()=>n(i)},s))},a))})}function Uy({hsv:e,onChange:t,onChanged:n}){const r=D.useRef(null),o=D.useRef(null),[a,i]=D.useState(!1);D.useEffect(()=>{const l=r.current;if(!l)return;const h=l.getContext("2d");if(!h)return;const m=h.createLinearGradient(0,0,l.width,0);m.addColorStop(0,`hsl(${e[0]}, 0%, 50%)`),m.addColorStop(1,`hsl(${e[0]}, 100%, 50%)`),h.fillStyle=m,h.fillRect(0,0,l.width,l.height);const y=h.createLinearGradient(0,0,0,l.height);y.addColorStop(0,"rgba(255, 255, 255, 0)"),y.addColorStop(1,"rgba(0, 0, 0, 1)"),h.fillStyle=y,h.fillRect(0,0,l.width,l.height)},[e]);const s=l=>{l.stopPropagation();const h=r.current;if(!h)return;const m=h.getBoundingClientRect(),y=Math.max(0,Math.min(l.clientX-m.left,m.width)),w=Math.max(0,Math.min(l.clientY-m.top,m.height)),v=y/m.width*100,p=100-w/m.height*100;t(e[0],v,p)},u=D.useCallback(()=>{i(!1)},[e]);function c(){n==null||n(e[0],e[1],e[2])}D.useEffect(()=>{var l;return(l=o.current)==null||l.addEventListener("mouseup",c),window.addEventListener("pointerup",u),window.addEventListener("mouseup",u),()=>{var h;(h=o.current)==null||h.removeEventListener("mouseup",c),window.removeEventListener("pointerup",u),window.removeEventListener("mouseup",u)}},[e]);const d=()=>{var p,g,b,C;const m=(g=(p=o.current)==null?void 0:p.clientWidth)!=null?g:0,y=(C=(b=o.current)==null?void 0:b.clientHeight)!=null?C:0,w=e[1]/100*m-8,v=(100-e[2])/100*y-8;return{transform:`translate(${w}px, ${v}px)`,transition:a?"none":"transform 0.1s ease-out"}};return D.useEffect(()=>{const l=()=>{i(!1)};return window.addEventListener("pointerup",l),window.addEventListener("mouseup",l),()=>{window.removeEventListener("pointerup",l),window.removeEventListener("mouseup",l)}},[]),P.jsxs("div",{"data-u-comp":"color-picker-spectrum",ref:o,className:"univer-relative univer-overflow-hidden",children:[P.jsx("canvas",{ref:r,className:"univer-h-full univer-w-full univer-cursor-crosshair univer-rounded",onPointerDown:l=>{i(!0),s(l)},onPointerMove:l=>a&&s(l)}),P.jsx("div",{className:"univer-pointer-events-none univer-absolute univer-left-0 univer-top-0 univer-size-4 univer-rounded-full univer-border-2 univer-border-white univer-shadow-md univer-ring-2 univer-ring-white univer-will-change-transform",style:d()})]})}function qy({hsv:e,onChange:t,onChanged:n}){const[r,o]=D.useState(!1),a=D.useRef(null),i=D.useRef(null),s=D.useMemo(()=>{var h,m;return(m=(h=i.current)==null?void 0:h.clientWidth)!=null?m:0},[]),u=D.useCallback(h=>{const m=a.current;if(!m)return;const y=m.getBoundingClientRect(),w=y.width-s,v=Math.max(0,Math.min(h-y.left,w)),p=Math.round(v/w*360);t(p,e[1],e[2])},[e,s,t]),c=D.useCallback(h=>{h.stopPropagation(),r&&u(h.clientX)},[r,u]),d=D.useCallback(()=>{o(!1),n==null||n(e[0],e[1],e[2])},[e,n]);D.useEffect(()=>(r&&(window.addEventListener("pointermove",c),window.addEventListener("pointerup",d),window.addEventListener("mouseup",d)),()=>{window.removeEventListener("pointermove",c),window.removeEventListener("pointerup",d),window.removeEventListener("mouseup",d)}),[r,c,d]);const l=()=>{var m;return`${Math.min(Math.max(e[0],0),360)/360*(100-s/((m=a.current)==null?void 0:m.clientWidth)*100)}%`};return P.jsx("div",{"data-u-comp":"color-picker-hue-slider",className:"univer-relative univer-w-full univer-select-none",children:P.jsx("div",{ref:a,className:"univer-relative univer-h-2 univer-w-full univer-cursor-pointer univer-rounded-full univer-shadow-inner",style:{background:`linear-gradient(to right,
1351
1351
  hsl(0, 100%, 50%),
1352
1352
  hsl(60, 100%, 50%),
1353
1353
  hsl(120, 100%, 50%),
1354
1354
  hsl(180, 100%, 50%),
1355
1355
  hsl(240, 100%, 50%),
1356
1356
  hsl(300, 100%, 50%),
1357
- hsl(360, 100%, 50%))`},onPointerDown:h=>{o(!0),u(h.clientX)},children:P.jsx("div",{ref:i,className:"univer-absolute univer-top-1/2 univer-box-border univer-size-2 univer-rounded-full univer-bg-transparent univer-shadow-md univer-ring-2 univer-ring-white univer-transition-transform univer-duration-75 univer-will-change-transform",style:{left:l(),transform:"translateY(-50%)",transition:r?"none":"all 0.1s ease-out"}})})})}const Gy=D.memo(Uy),Ky=D.memo(qy),Xy=D.memo(By),Zy=D.memo(Yy);function Qy({format:e="hex",value:t="#000000",onChange:n}){if(!va)return null;const{locale:r}=D.useContext(mn),[o,a]=D.useState([0,100,100]),[i,s]=D.useState(!1),u=D.useCallback((h,m,y)=>Pa(h,m,y),[]);D.useEffect(()=>{try{if(e==="hex"){const[h,m,y]=t?Es(t):o;a([h,m,y])}}catch(h){console.error("Invalid value:",h)}},[t]);function c(h,m,y){a([h,m,y])}function f(h,m,y){const[w,v,p]=u(h,m,y);if(e==="hex"){const g=sd(w,v,p);n==null||n(g)}}function l(){const[h,m,y]=o,w=Da(h,m,y);n==null||n(w),s(!1)}return P.jsxs("div",{"data-u-comp":"color-picker",className:"univer-cursor-default univer-space-y-2 univer-rounded-lg univer-bg-white dark:!univer-bg-gray-700",onClick:h=>h.stopPropagation(),children:[P.jsx(Zy,{hsv:o,onChange:(h,m,y)=>{c(h,m,y),f(h,m,y)}}),P.jsx("div",{className:"univer-flex univer-h-7 univer-items-center",children:P.jsx("a",{className:"univer-cursor-pointer univer-gap-2 univer-text-sm univer-text-gray-900 univer-transition-opacity hover:univer-opacity-80 dark:!univer-text-white",onClick:()=>s(!0),children:r==null?void 0:r.ColorPicker.more})}),P.jsx(Ss,{className:"!univer-w-fit !univer-p-2.5",closable:!1,maskClosable:!1,open:i,onOpenChange:s,children:P.jsxs("div",{className:"univer-grid univer-w-64 univer-gap-2",children:[P.jsx(Gy,{hsv:o,onChange:c}),P.jsxs("div",{className:"univer-flex univer-items-center univer-gap-2",children:[P.jsx("div",{className:"univer-size-6 univer-flex-shrink-0 univer-rounded-sm",style:{backgroundColor:Da(...o)}}),P.jsx(Ky,{hsv:o,onChange:c})]}),P.jsx(Xy,{hsv:o,onChange:c}),P.jsxs("footer",{className:"univer-flex univer-items-center univer-justify-end univer-gap-2",children:[P.jsx(kn,{onClick:()=>s(!1),children:r==null?void 0:r.ColorPicker.cancel}),P.jsx(kn,{variant:"primary",onClick:l,children:r==null?void 0:r.ColorPicker.confirm})]})]})})]})}function Jy(e){const{locale:t,cancelText:n,confirmText:r,onClose:o,onConfirm:a}=e;return P.jsxs("footer",{className:"univer-flex univer-items-center univer-justify-end univer-gap-2",children:[P.jsx(kn,{onClick:o,children:n!=null?n:t==null?void 0:t.Confirm.cancel}),P.jsx(kn,{variant:"primary",onClick:a,children:r!=null?r:t==null?void 0:t.Confirm.confirm})]})}function eb(e){const{children:t,visible:n=!1,title:r,cancelText:o,confirmText:a,width:i,onClose:s,onConfirm:u}=e,{locale:c}=D.useContext(mn);return P.jsx(Ss,{open:n,title:r,maskClosable:!1,footer:P.jsx(Jy,{locale:c,cancelText:o,confirmText:a,onClose:s,onConfirm:u}),onClose:s,width:i,children:t})}function Ne(){return Ne=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ne.apply(null,arguments)}function Ms(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function tb(e){if(Array.isArray(e))return Ms(e)}function nb(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ud(e,t){if(e){if(typeof e=="string")return Ms(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ms(e,t):void 0}}function rb(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
1358
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wt(e){return tb(e)||nb(e)||ud(e)||rb()}function Ct(e){"@babel/helpers - typeof";return Ct=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ct(e)}function ob(e,t){if(Ct(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ct(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function cd(e){var t=ob(e,"string");return Ct(t)=="symbol"?t:t+""}function ce(e,t,n){return(t=cd(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function re(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?dd(Object(n),!0).forEach(function(r){ce(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dd(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ab(e){if(Array.isArray(e))return e}function ib(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,o,a,i,s=[],u=!0,c=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);u=!0);}catch(f){c=!0,o=f}finally{try{if(!u&&n.return!=null&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return s}}function sb(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1359
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function X(e,t){return ab(e)||ib(e,t)||ud(e,t)||sb()}function ct(e){var t=d.useRef();t.current=e;var n=d.useCallback(function(){for(var r,o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];return(r=t.current)===null||r===void 0?void 0:r.call.apply(r,[t].concat(a))},[]);return n}function Bn(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var fd=Bn()?d.useLayoutEffect:d.useEffect,ht=function(t,n){var r=d.useRef(!0);fd(function(){return t(r.current)},n),fd(function(){return r.current=!1,function(){r.current=!0}},[])},Ps=function(t,n){ht(function(r){if(!r)return t()},n)};function mo(e){var t=d.useRef(!1),n=d.useState(e),r=X(n,2),o=r[0],a=r[1];d.useEffect(function(){return t.current=!1,function(){t.current=!0}},[]);function i(s,u){u&&t.current||a(s)}return[o,i]}function Ds(e){return e!==void 0}function ln(e,t){var n=t||{},r=n.defaultValue,o=n.value,a=n.onChange,i=n.postState,s=mo(function(){return Ds(o)?o:Ds(r)?typeof r=="function"?r():r:typeof e=="function"?e():e}),u=X(s,2),c=u[0],f=u[1],l=o!==void 0?o:c,h=i?i(l):l,m=ct(a),y=mo([l]),w=X(y,2),v=w[0],p=w[1];Ps(function(){var b=v[0];c!==b&&m(c,b)},[v]),Ps(function(){Ds(o)||f(o)},[o]);var g=ct(function(b,C){f(b,C),p([l],C)});return[h,g]}function ks(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function vd(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function r(){var o=!1;try{o=this instanceof r}catch{}return o?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}),n}var _s={exports:{}},vt={};/**
1357
+ hsl(360, 100%, 50%))`},onPointerDown:h=>{o(!0),u(h.clientX)},children:P.jsx("div",{ref:i,className:"univer-absolute univer-top-1/2 univer-box-border univer-size-2 univer-rounded-full univer-bg-transparent univer-shadow-md univer-ring-2 univer-ring-white univer-transition-transform univer-duration-75 univer-will-change-transform",style:{left:l(),transform:"translateY(-50%)",transition:r?"none":"all 0.1s ease-out"}})})})}const Gy=D.memo(Uy),Ky=D.memo(qy),Xy=D.memo(By),Zy=D.memo(Yy);function Qy({format:e="hex",value:t="#000000",onChange:n}){if(!va)return null;const{locale:r}=D.useContext(hn),[o,a]=D.useState([0,100,100]),[i,s]=D.useState(!1),u=D.useCallback((h,m,y)=>Pa(h,m,y),[]);D.useEffect(()=>{try{if(e==="hex"){const[h,m,y]=t?Es(t):o;a([h,m,y])}}catch(h){console.error("Invalid value:",h)}},[t]);function c(h,m,y){a([h,m,y])}function d(h,m,y){const[w,v,p]=u(h,m,y);if(e==="hex"){const g=sd(w,v,p);n==null||n(g)}}function l(){const[h,m,y]=o,w=Da(h,m,y);n==null||n(w),s(!1)}return P.jsxs("div",{"data-u-comp":"color-picker",className:"univer-cursor-default univer-space-y-2 univer-rounded-lg univer-bg-white dark:!univer-bg-gray-700",onClick:h=>h.stopPropagation(),children:[P.jsx(Zy,{hsv:o,onChange:(h,m,y)=>{c(h,m,y),d(h,m,y)}}),P.jsx("div",{className:"univer-flex univer-h-7 univer-items-center",children:P.jsx("a",{className:"univer-cursor-pointer univer-gap-2 univer-text-sm univer-text-gray-900 univer-transition-opacity hover:univer-opacity-80 dark:!univer-text-white",onClick:()=>s(!0),children:r==null?void 0:r.ColorPicker.more})}),P.jsx(Ss,{className:"!univer-w-fit !univer-p-2.5",closable:!1,maskClosable:!1,open:i,onOpenChange:s,children:P.jsxs("div",{className:"univer-grid univer-w-64 univer-gap-2",children:[P.jsx(Gy,{hsv:o,onChange:c}),P.jsxs("div",{className:"univer-flex univer-items-center univer-gap-2",children:[P.jsx("div",{className:"univer-size-6 univer-flex-shrink-0 univer-rounded-sm",style:{backgroundColor:Da(...o)}}),P.jsx(Ky,{hsv:o,onChange:c})]}),P.jsx(Xy,{hsv:o,onChange:c}),P.jsxs("footer",{className:"univer-flex univer-items-center univer-justify-end univer-gap-2",children:[P.jsx(kn,{onClick:()=>s(!1),children:r==null?void 0:r.ColorPicker.cancel}),P.jsx(kn,{variant:"primary",onClick:l,children:r==null?void 0:r.ColorPicker.confirm})]})]})})]})}function Jy(e){const{locale:t,cancelText:n,confirmText:r,onClose:o,onConfirm:a}=e;return P.jsxs("footer",{className:"univer-flex univer-items-center univer-justify-end univer-gap-2",children:[P.jsx(kn,{onClick:o,children:n!=null?n:t==null?void 0:t.Confirm.cancel}),P.jsx(kn,{variant:"primary",onClick:a,children:r!=null?r:t==null?void 0:t.Confirm.confirm})]})}function eb(e){const{children:t,visible:n=!1,title:r,cancelText:o,confirmText:a,width:i,onClose:s,onConfirm:u}=e,{locale:c}=D.useContext(hn);return P.jsx(Ss,{open:n,title:r,maskClosable:!1,footer:P.jsx(Jy,{locale:c,cancelText:o,confirmText:a,onClose:s,onConfirm:u}),onClose:s,width:i,children:t})}function _e(){return _e=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_e.apply(null,arguments)}function Ms(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function tb(e){if(Array.isArray(e))return Ms(e)}function nb(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ud(e,t){if(e){if(typeof e=="string")return Ms(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ms(e,t):void 0}}function rb(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
1358
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wt(e){return tb(e)||nb(e)||ud(e)||rb()}function Ct(e){"@babel/helpers - typeof";return Ct=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ct(e)}function ob(e,t){if(Ct(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ct(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function cd(e){var t=ob(e,"string");return Ct(t)=="symbol"?t:t+""}function ce(e,t,n){return(t=cd(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function re(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?dd(Object(n),!0).forEach(function(r){ce(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dd(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ab(e){if(Array.isArray(e))return e}function ib(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,o,a,i,s=[],u=!0,c=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);u=!0);}catch(d){c=!0,o=d}finally{try{if(!u&&n.return!=null&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return s}}function sb(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1359
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function X(e,t){return ab(e)||ib(e,t)||ud(e,t)||sb()}function ct(e){var t=f.useRef();t.current=e;var n=f.useCallback(function(){for(var r,o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];return(r=t.current)===null||r===void 0?void 0:r.call.apply(r,[t].concat(a))},[]);return n}function Bn(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var fd=Bn()?f.useLayoutEffect:f.useEffect,ht=function(t,n){var r=f.useRef(!0);fd(function(){return t(r.current)},n),fd(function(){return r.current=!1,function(){r.current=!0}},[])},Ps=function(t,n){ht(function(r){if(!r)return t()},n)};function mo(e){var t=f.useRef(!1),n=f.useState(e),r=X(n,2),o=r[0],a=r[1];f.useEffect(function(){return t.current=!1,function(){t.current=!0}},[]);function i(s,u){u&&t.current||a(s)}return[o,i]}function Ds(e){return e!==void 0}function ln(e,t){var n=t||{},r=n.defaultValue,o=n.value,a=n.onChange,i=n.postState,s=mo(function(){return Ds(o)?o:Ds(r)?typeof r=="function"?r():r:typeof e=="function"?e():e}),u=X(s,2),c=u[0],d=u[1],l=o!==void 0?o:c,h=i?i(l):l,m=ct(a),y=mo([l]),w=X(y,2),v=w[0],p=w[1];Ps(function(){var b=v[0];c!==b&&m(c,b)},[v]),Ps(function(){Ds(o)||d(o)},[o]);var g=ct(function(b,C){d(b,C),p([l],C)});return[h,g]}function ks(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function vd(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function r(){var o=!1;try{o=this instanceof r}catch{}return o?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}),n}var Ns={exports:{}},vt={};/**
1360
1360
  * @license React
1361
1361
  * react-is.production.min.js
1362
1362
  *
@@ -1364,7 +1364,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1364
1364
  *
1365
1365
  * This source code is licensed under the MIT license found in the
1366
1366
  * LICENSE file in the root directory of this source tree.
1367
- */var md;function lb(){if(md)return vt;md=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),i=Symbol.for("react.context"),s=Symbol.for("react.server_context"),u=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),l=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),m=Symbol.for("react.offscreen"),y;y=Symbol.for("react.module.reference");function w(v){if(typeof v=="object"&&v!==null){var p=v.$$typeof;switch(p){case e:switch(v=v.type,v){case n:case o:case r:case c:case f:return v;default:switch(v=v&&v.$$typeof,v){case s:case i:case u:case h:case l:case a:return v;default:return p}}case t:return p}}}return vt.ContextConsumer=i,vt.ContextProvider=a,vt.Element=e,vt.ForwardRef=u,vt.Fragment=n,vt.Lazy=h,vt.Memo=l,vt.Portal=t,vt.Profiler=o,vt.StrictMode=r,vt.Suspense=c,vt.SuspenseList=f,vt.isAsyncMode=function(){return!1},vt.isConcurrentMode=function(){return!1},vt.isContextConsumer=function(v){return w(v)===i},vt.isContextProvider=function(v){return w(v)===a},vt.isElement=function(v){return typeof v=="object"&&v!==null&&v.$$typeof===e},vt.isForwardRef=function(v){return w(v)===u},vt.isFragment=function(v){return w(v)===n},vt.isLazy=function(v){return w(v)===h},vt.isMemo=function(v){return w(v)===l},vt.isPortal=function(v){return w(v)===t},vt.isProfiler=function(v){return w(v)===o},vt.isStrictMode=function(v){return w(v)===r},vt.isSuspense=function(v){return w(v)===c},vt.isSuspenseList=function(v){return w(v)===f},vt.isValidElementType=function(v){return typeof v=="string"||typeof v=="function"||v===n||v===o||v===r||v===c||v===f||v===m||typeof v=="object"&&v!==null&&(v.$$typeof===h||v.$$typeof===l||v.$$typeof===a||v.$$typeof===i||v.$$typeof===u||v.$$typeof===y||v.getModuleId!==void 0)},vt.typeOf=w,vt}var hd;function ub(){return hd||(hd=1,_s.exports=lb()),_s.exports}var Ns=ub();function pd(e,t,n){var r=d.useRef({});return(!("value"in r.current)||n(r.current.condition,t))&&(r.current.value=e(),r.current.condition=t),r.current.value}var cb=Symbol.for("react.element"),db=Symbol.for("react.transitional.element"),fb=Symbol.for("react.fragment");function gd(e){return e&&Ct(e)==="object"&&(e.$$typeof===cb||e.$$typeof===db)&&e.type===fb}var vb=Number(D.version.split(".")[0]),Os=function(t,n){typeof t=="function"?t(n):Ct(t)==="object"&&t&&"current"in t&&(t.current=n)},ka=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=n.filter(Boolean);return o.length<=1?o[0]:function(a){n.forEach(function(i){Os(i,a)})}},_a=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return pd(function(){return ka.apply(void 0,n)},n,function(o,a){return o.length!==a.length||o.every(function(i,s){return i!==a[s]})})},Yr=function(t){var n,r;if(!t)return!1;if(yd(t)&&vb>=19)return!0;var o=Ns.isMemo(t)?t.type.type:t.type;return!(typeof o=="function"&&!((n=o.prototype)!==null&&n!==void 0&&n.render)&&o.$$typeof!==Ns.ForwardRef||typeof t=="function"&&!((r=t.prototype)!==null&&r!==void 0&&r.render)&&t.$$typeof!==Ns.ForwardRef)};function yd(e){return D.isValidElement(e)&&!gd(e)}var ho=function(t){if(t&&yd(t)){var n=t;return n.props.propertyIsEnumerable("ref")?n.props.ref:n.ref}return null},Ts={},mb=function(t){};function hb(e,t){}function pb(e,t){}function gb(){Ts={}}function bd(e,t,n){!t&&!Ts[n]&&(e(!1,n),Ts[n]=!0)}function Er(e,t){bd(hb,e,t)}function yb(e,t){bd(pb,e,t)}Er.preMessage=mb,Er.resetWarned=gb,Er.noteOnce=yb;function po(e,t){var n=Object.assign({},e);return Array.isArray(t)&&t.forEach(function(r){delete n[r]}),n}var bb=`accept acceptCharset accessKey action allowFullScreen allowTransparency
1367
+ */var md;function lb(){if(md)return vt;md=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),i=Symbol.for("react.context"),s=Symbol.for("react.server_context"),u=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),l=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),m=Symbol.for("react.offscreen"),y;y=Symbol.for("react.module.reference");function w(v){if(typeof v=="object"&&v!==null){var p=v.$$typeof;switch(p){case e:switch(v=v.type,v){case n:case o:case r:case c:case d:return v;default:switch(v=v&&v.$$typeof,v){case s:case i:case u:case h:case l:case a:return v;default:return p}}case t:return p}}}return vt.ContextConsumer=i,vt.ContextProvider=a,vt.Element=e,vt.ForwardRef=u,vt.Fragment=n,vt.Lazy=h,vt.Memo=l,vt.Portal=t,vt.Profiler=o,vt.StrictMode=r,vt.Suspense=c,vt.SuspenseList=d,vt.isAsyncMode=function(){return!1},vt.isConcurrentMode=function(){return!1},vt.isContextConsumer=function(v){return w(v)===i},vt.isContextProvider=function(v){return w(v)===a},vt.isElement=function(v){return typeof v=="object"&&v!==null&&v.$$typeof===e},vt.isForwardRef=function(v){return w(v)===u},vt.isFragment=function(v){return w(v)===n},vt.isLazy=function(v){return w(v)===h},vt.isMemo=function(v){return w(v)===l},vt.isPortal=function(v){return w(v)===t},vt.isProfiler=function(v){return w(v)===o},vt.isStrictMode=function(v){return w(v)===r},vt.isSuspense=function(v){return w(v)===c},vt.isSuspenseList=function(v){return w(v)===d},vt.isValidElementType=function(v){return typeof v=="string"||typeof v=="function"||v===n||v===o||v===r||v===c||v===d||v===m||typeof v=="object"&&v!==null&&(v.$$typeof===h||v.$$typeof===l||v.$$typeof===a||v.$$typeof===i||v.$$typeof===u||v.$$typeof===y||v.getModuleId!==void 0)},vt.typeOf=w,vt}var hd;function ub(){return hd||(hd=1,Ns.exports=lb()),Ns.exports}var _s=ub();function pd(e,t,n){var r=f.useRef({});return(!("value"in r.current)||n(r.current.condition,t))&&(r.current.value=e(),r.current.condition=t),r.current.value}var cb=Symbol.for("react.element"),db=Symbol.for("react.transitional.element"),fb=Symbol.for("react.fragment");function gd(e){return e&&Ct(e)==="object"&&(e.$$typeof===cb||e.$$typeof===db)&&e.type===fb}var vb=Number(D.version.split(".")[0]),Os=function(t,n){typeof t=="function"?t(n):Ct(t)==="object"&&t&&"current"in t&&(t.current=n)},ka=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=n.filter(Boolean);return o.length<=1?o[0]:function(a){n.forEach(function(i){Os(i,a)})}},Na=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return pd(function(){return ka.apply(void 0,n)},n,function(o,a){return o.length!==a.length||o.every(function(i,s){return i!==a[s]})})},Yr=function(t){var n,r;if(!t)return!1;if(yd(t)&&vb>=19)return!0;var o=_s.isMemo(t)?t.type.type:t.type;return!(typeof o=="function"&&!((n=o.prototype)!==null&&n!==void 0&&n.render)&&o.$$typeof!==_s.ForwardRef||typeof t=="function"&&!((r=t.prototype)!==null&&r!==void 0&&r.render)&&t.$$typeof!==_s.ForwardRef)};function yd(e){return D.isValidElement(e)&&!gd(e)}var ho=function(t){if(t&&yd(t)){var n=t;return n.props.propertyIsEnumerable("ref")?n.props.ref:n.ref}return null},Ts={},mb=function(t){};function hb(e,t){}function pb(e,t){}function gb(){Ts={}}function bd(e,t,n){!t&&!Ts[n]&&(e(!1,n),Ts[n]=!0)}function Er(e,t){bd(hb,e,t)}function yb(e,t){bd(pb,e,t)}Er.preMessage=mb,Er.resetWarned=gb,Er.noteOnce=yb;function po(e,t){var n=Object.assign({},e);return Array.isArray(t)&&t.forEach(function(r){delete n[r]}),n}var bb=`accept acceptCharset accessKey action allowFullScreen allowTransparency
1368
1368
  alt async autoComplete autoFocus autoPlay capture cellPadding cellSpacing challenge
1369
1369
  charSet checked classID className colSpan cols content contentEditable contextMenu
1370
1370
  controls coords crossOrigin data dateTime default defer dir disabled download draggable
@@ -1381,28 +1381,28 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1381
1381
  onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel
1382
1382
  onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough
1383
1383
  onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata
1384
- onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError`,Cb="".concat(bb," ").concat(wb).split(/[\s\n]+/),xb="aria-",Sb="data-";function wd(e,t){return e.indexOf(t)===0}function Is(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n;t===!1?n={aria:!0,data:!0,attr:!0}:t===!0?n={aria:!0}:n=re({},t);var r={};return Object.keys(e).forEach(function(o){(n.aria&&(o==="role"||wd(o,xb))||n.data&&wd(o,Sb)||n.attr&&Cb.includes(o))&&(r[o]=e[o])}),r}function Rs(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function pt(e,t){if(e==null)return{};var n,r,o=Rs(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var Cd=d.createContext(null),xd=[];function Eb(e,t){var n=d.useState(function(){if(!Bn())return null;var y=document.createElement("div");return y}),r=X(n,1),o=r[0],a=d.useRef(!1),i=d.useContext(Cd),s=d.useState(xd),u=X(s,2),c=u[0],f=u[1],l=i||(a.current?void 0:function(y){f(function(w){var v=[y].concat(wt(w));return v})});function h(){o.parentElement||document.body.appendChild(o),a.current=!0}function m(){var y;(y=o.parentElement)===null||y===void 0||y.removeChild(o),a.current=!1}return ht(function(){return e?i?i(h):h():m(),m},[e]),ht(function(){c.length&&(c.forEach(function(y){return y()}),f(xd))},[c]),[o,l]}function Mb(e,t){if(!e)return!1;if(e.contains)return e.contains(t);for(var n=t;n;){if(n===e)return!0;n=n.parentNode}return!1}var Sd="data-rc-order",Ed="data-rc-priority",Pb="rc-util-key",As=new Map;function Md(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.mark;return t?t.startsWith("data-")?t:"data-".concat(t):Pb}function Na(e){if(e.attachTo)return e.attachTo;var t=document.querySelector("head");return t||document.body}function Db(e){return e==="queue"?"prependQueue":e?"prepend":"append"}function Ls(e){return Array.from((As.get(e)||e).children).filter(function(t){return t.tagName==="STYLE"})}function Pd(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Bn())return null;var n=t.csp,r=t.prepend,o=t.priority,a=o===void 0?0:o,i=Db(r),s=i==="prependQueue",u=document.createElement("style");u.setAttribute(Sd,i),s&&a&&u.setAttribute(Ed,"".concat(a)),n!=null&&n.nonce&&(u.nonce=n==null?void 0:n.nonce),u.innerHTML=e;var c=Na(t),f=c.firstChild;if(r){if(s){var l=(t.styles||Ls(c)).filter(function(h){if(!["prepend","prependQueue"].includes(h.getAttribute(Sd)))return!1;var m=Number(h.getAttribute(Ed)||0);return a>=m});if(l.length)return c.insertBefore(u,l[l.length-1].nextSibling),u}c.insertBefore(u,f)}else c.appendChild(u);return u}function Dd(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=Na(t);return(t.styles||Ls(n)).find(function(r){return r.getAttribute(Md(t))===e})}function $s(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=Dd(e,t);if(n){var r=Na(t);r.removeChild(n)}}function kb(e,t){var n=As.get(e);if(!n||!Mb(document,n)){var r=Pd("",t),o=r.parentNode;As.set(e,o),e.removeChild(r)}}function kd(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=Na(n),o=Ls(r),a=re(re({},n),{},{styles:o});kb(r,a);var i=Dd(t,a);if(i){var s,u;if((s=a.csp)!==null&&s!==void 0&&s.nonce&&i.nonce!==((u=a.csp)===null||u===void 0?void 0:u.nonce)){var c;i.nonce=(c=a.csp)===null||c===void 0?void 0:c.nonce}return i.innerHTML!==e&&(i.innerHTML=e),i}var f=Pd(e,a);return f.setAttribute(Md(a),t),f}function _b(e){var t="rc-scrollbar-measure-".concat(Math.random().toString(36).substring(7)),n=document.createElement("div");n.id=t;var r=n.style;r.position="absolute",r.left="0",r.top="0",r.width="100px",r.height="100px",r.overflow="scroll";var o,a;if(e){var i=getComputedStyle(e);r.scrollbarColor=i.scrollbarColor,r.scrollbarWidth=i.scrollbarWidth;var s=getComputedStyle(e,"::-webkit-scrollbar"),u=parseInt(s.width,10),c=parseInt(s.height,10);try{var f=u?"width: ".concat(s.width,";"):"",l=c?"height: ".concat(s.height,";"):"";kd(`
1384
+ onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError`,Cb="".concat(bb," ").concat(wb).split(/[\s\n]+/),xb="aria-",Sb="data-";function wd(e,t){return e.indexOf(t)===0}function Is(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n;t===!1?n={aria:!0,data:!0,attr:!0}:t===!0?n={aria:!0}:n=re({},t);var r={};return Object.keys(e).forEach(function(o){(n.aria&&(o==="role"||wd(o,xb))||n.data&&wd(o,Sb)||n.attr&&Cb.includes(o))&&(r[o]=e[o])}),r}function Rs(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function pt(e,t){if(e==null)return{};var n,r,o=Rs(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var Cd=f.createContext(null),xd=[];function Eb(e,t){var n=f.useState(function(){if(!Bn())return null;var y=document.createElement("div");return y}),r=X(n,1),o=r[0],a=f.useRef(!1),i=f.useContext(Cd),s=f.useState(xd),u=X(s,2),c=u[0],d=u[1],l=i||(a.current?void 0:function(y){d(function(w){var v=[y].concat(wt(w));return v})});function h(){o.parentElement||document.body.appendChild(o),a.current=!0}function m(){var y;(y=o.parentElement)===null||y===void 0||y.removeChild(o),a.current=!1}return ht(function(){return e?i?i(h):h():m(),m},[e]),ht(function(){c.length&&(c.forEach(function(y){return y()}),d(xd))},[c]),[o,l]}function Mb(e,t){if(!e)return!1;if(e.contains)return e.contains(t);for(var n=t;n;){if(n===e)return!0;n=n.parentNode}return!1}var Sd="data-rc-order",Ed="data-rc-priority",Pb="rc-util-key",As=new Map;function Md(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.mark;return t?t.startsWith("data-")?t:"data-".concat(t):Pb}function _a(e){if(e.attachTo)return e.attachTo;var t=document.querySelector("head");return t||document.body}function Db(e){return e==="queue"?"prependQueue":e?"prepend":"append"}function Ls(e){return Array.from((As.get(e)||e).children).filter(function(t){return t.tagName==="STYLE"})}function Pd(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Bn())return null;var n=t.csp,r=t.prepend,o=t.priority,a=o===void 0?0:o,i=Db(r),s=i==="prependQueue",u=document.createElement("style");u.setAttribute(Sd,i),s&&a&&u.setAttribute(Ed,"".concat(a)),n!=null&&n.nonce&&(u.nonce=n==null?void 0:n.nonce),u.innerHTML=e;var c=_a(t),d=c.firstChild;if(r){if(s){var l=(t.styles||Ls(c)).filter(function(h){if(!["prepend","prependQueue"].includes(h.getAttribute(Sd)))return!1;var m=Number(h.getAttribute(Ed)||0);return a>=m});if(l.length)return c.insertBefore(u,l[l.length-1].nextSibling),u}c.insertBefore(u,d)}else c.appendChild(u);return u}function Dd(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=_a(t);return(t.styles||Ls(n)).find(function(r){return r.getAttribute(Md(t))===e})}function $s(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=Dd(e,t);if(n){var r=_a(t);r.removeChild(n)}}function kb(e,t){var n=As.get(e);if(!n||!Mb(document,n)){var r=Pd("",t),o=r.parentNode;As.set(e,o),e.removeChild(r)}}function kd(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=_a(n),o=Ls(r),a=re(re({},n),{},{styles:o});kb(r,a);var i=Dd(t,a);if(i){var s,u;if((s=a.csp)!==null&&s!==void 0&&s.nonce&&i.nonce!==((u=a.csp)===null||u===void 0?void 0:u.nonce)){var c;i.nonce=(c=a.csp)===null||c===void 0?void 0:c.nonce}return i.innerHTML!==e&&(i.innerHTML=e),i}var d=Pd(e,a);return d.setAttribute(Md(a),t),d}function Nb(e){var t="rc-scrollbar-measure-".concat(Math.random().toString(36).substring(7)),n=document.createElement("div");n.id=t;var r=n.style;r.position="absolute",r.left="0",r.top="0",r.width="100px",r.height="100px",r.overflow="scroll";var o,a;if(e){var i=getComputedStyle(e);r.scrollbarColor=i.scrollbarColor,r.scrollbarWidth=i.scrollbarWidth;var s=getComputedStyle(e,"::-webkit-scrollbar"),u=parseInt(s.width,10),c=parseInt(s.height,10);try{var d=u?"width: ".concat(s.width,";"):"",l=c?"height: ".concat(s.height,";"):"";kd(`
1385
1385
  #`.concat(t,`::-webkit-scrollbar {
1386
- `).concat(f,`
1386
+ `).concat(d,`
1387
1387
  `).concat(l,`
1388
- }`),t)}catch(y){console.error(y),o=u,a=c}}document.body.appendChild(n);var h=e&&o&&!isNaN(o)?o:n.offsetWidth-n.clientWidth,m=e&&a&&!isNaN(a)?a:n.offsetHeight-n.clientHeight;return document.body.removeChild(n),$s(t),{width:h,height:m}}function Nb(e){return typeof document>"u"||!e||!(e instanceof Element)?{width:0,height:0}:_b(e)}function Ob(){return document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth}var Tb="rc-util-locker-".concat(Date.now()),_d=0;function Ib(e){var t=!!e,n=d.useState(function(){return _d+=1,"".concat(Tb,"_").concat(_d)}),r=X(n,1),o=r[0];ht(function(){if(t){var a=Nb(document.body).width,i=Ob();kd(`
1388
+ }`),t)}catch(y){console.error(y),o=u,a=c}}document.body.appendChild(n);var h=e&&o&&!isNaN(o)?o:n.offsetWidth-n.clientWidth,m=e&&a&&!isNaN(a)?a:n.offsetHeight-n.clientHeight;return document.body.removeChild(n),$s(t),{width:h,height:m}}function _b(e){return typeof document>"u"||!e||!(e instanceof Element)?{width:0,height:0}:Nb(e)}function Ob(){return document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth}var Tb="rc-util-locker-".concat(Date.now()),Nd=0;function Ib(e){var t=!!e,n=f.useState(function(){return Nd+=1,"".concat(Tb,"_").concat(Nd)}),r=X(n,1),o=r[0];ht(function(){if(t){var a=_b(document.body).width,i=Ob();kd(`
1389
1389
  html body {
1390
1390
  overflow-y: hidden;
1391
1391
  `.concat(i?"width: calc(100% - ".concat(a,"px);"):"",`
1392
- }`),o)}else $s(o);return function(){$s(o)}},[t,o])}var Rb=!1;function Ab(e){return Rb}var Nd=function(t){return t===!1?!1:!Bn()||!t?null:typeof t=="string"?document.querySelector(t):typeof t=="function"?t():t},Od=d.forwardRef(function(e,t){var n=e.open,r=e.autoLock,o=e.getContainer;e.debug;var a=e.autoDestroy,i=a===void 0?!0:a,s=e.children,u=d.useState(n),c=X(u,2),f=c[0],l=c[1],h=f||n;d.useEffect(function(){(i||n)&&l(n)},[n,i]);var m=d.useState(function(){return Nd(o)}),y=X(m,2),w=y[0],v=y[1];d.useEffect(function(){var R=Nd(o);v(R!=null?R:null)});var p=Eb(h&&!w),g=X(p,2),b=g[0],C=g[1],x=w!=null?w:b;Ib(r&&n&&Bn()&&(x===b||x===document.body));var S=null;if(s&&Yr(s)&&t){var E=s;S=E.ref}var M=_a(S,t);if(!h||!Bn()||w===void 0)return null;var k=x===!1||Ab(),T=s;return t&&(T=d.cloneElement(s,{ref:M})),d.createElement(Cd.Provider,{value:C},k?T:It.createPortal(T,x))}),Fs={exports:{}};/*!
1392
+ }`),o)}else $s(o);return function(){$s(o)}},[t,o])}var Rb=!1;function Ab(e){return Rb}var _d=function(t){return t===!1?!1:!Bn()||!t?null:typeof t=="string"?document.querySelector(t):typeof t=="function"?t():t},Od=f.forwardRef(function(e,t){var n=e.open,r=e.autoLock,o=e.getContainer;e.debug;var a=e.autoDestroy,i=a===void 0?!0:a,s=e.children,u=f.useState(n),c=X(u,2),d=c[0],l=c[1],h=d||n;f.useEffect(function(){(i||n)&&l(n)},[n,i]);var m=f.useState(function(){return _d(o)}),y=X(m,2),w=y[0],v=y[1];f.useEffect(function(){var R=_d(o);v(R!=null?R:null)});var p=Eb(h&&!w),g=X(p,2),b=g[0],C=g[1],x=w!=null?w:b;Ib(r&&n&&Bn()&&(x===b||x===document.body));var S=null;if(s&&Yr(s)&&t){var E=s;S=E.ref}var M=Na(S,t);if(!h||!Bn()||w===void 0)return null;var k=x===!1||Ab(),T=s;return t&&(T=f.cloneElement(s,{ref:M})),f.createElement(Cd.Provider,{value:C},k?T:It.createPortal(T,x))}),Fs={exports:{}};/*!
1393
1393
  Copyright (c) 2018 Jed Watson.
1394
1394
  Licensed under the MIT License (MIT), see
1395
1395
  http://jedwatson.github.io/classnames
1396
- */var Td;function Lb(){return Td||(Td=1,function(e){(function(){var t={}.hasOwnProperty;function n(){for(var a="",i=0;i<arguments.length;i++){var s=arguments[i];s&&(a=o(a,r(s)))}return a}function r(a){if(typeof a=="string"||typeof a=="number")return a;if(typeof a!="object")return"";if(Array.isArray(a))return n.apply(null,a);if(a.toString!==Object.prototype.toString&&!a.toString.toString().includes("[native code]"))return a.toString();var i="";for(var s in a)t.call(a,s)&&a[s]&&(i=o(i,s));return i}function o(a,i){return i?a?a+" "+i:a+i:a}e.exports?(n.default=n,e.exports=n):window.classNames=n})()}(Fs)),Fs.exports}var $b=Lb();const Xe=ks($b);function Oa(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=[];return D.Children.forEach(e,function(r){r==null&&!t.keepEmpty||(Array.isArray(r)?n=n.concat(Oa(r)):gd(r)&&r.props?n=n.concat(Oa(r.props.children,t)):n.push(r))}),n}function go(e){return e instanceof HTMLElement||e instanceof SVGElement}function Fb(e){return e&&Ct(e)==="object"&&go(e.nativeElement)?e.nativeElement:go(e)?e:null}function Ta(e){var t=Fb(e);if(t)return t;if(e instanceof D.Component){var n;return(n=It.findDOMNode)===null||n===void 0?void 0:n.call(It,e)}return null}var zs=d.createContext(null);function zb(e){var t=e.children,n=e.onBatchResize,r=d.useRef(0),o=d.useRef([]),a=d.useContext(zs),i=d.useCallback(function(s,u,c){r.current+=1;var f=r.current;o.current.push({size:s,element:u,data:c}),Promise.resolve().then(function(){f===r.current&&(n==null||n(o.current),o.current=[])}),a==null||a(s,u,c)},[n,a]);return d.createElement(zs.Provider,{value:i},t)}var Id=function(){if(typeof Map<"u")return Map;function e(t,n){var r=-1;return t.some(function(o,a){return o[0]===n?(r=a,!0):!1}),r}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(n){var r=e(this.__entries__,n),o=this.__entries__[r];return o&&o[1]},t.prototype.set=function(n,r){var o=e(this.__entries__,n);~o?this.__entries__[o][1]=r:this.__entries__.push([n,r])},t.prototype.delete=function(n){var r=this.__entries__,o=e(r,n);~o&&r.splice(o,1)},t.prototype.has=function(n){return!!~e(this.__entries__,n)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(n,r){r===void 0&&(r=null);for(var o=0,a=this.__entries__;o<a.length;o++){var i=a[o];n.call(r,i[1],i[0])}},t}()}(),Hs=typeof window<"u"&&typeof document<"u"&&window.document===document,Ia=function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()}(),Hb=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Ia):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),Vb=2;function Wb(e,t){var n=!1,r=!1,o=0;function a(){n&&(n=!1,e()),r&&s()}function i(){Hb(a)}function s(){var u=Date.now();if(n){if(u-o<Vb)return;r=!0}else n=!0,r=!1,setTimeout(i,t);o=u}return s}var Bb=20,jb=["top","right","bottom","left","width","height","size","weight"],Yb=typeof MutationObserver<"u",Ub=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=Wb(this.refresh.bind(this),Bb)}return e.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},e.prototype.removeObserver=function(t){var n=this.observers_,r=n.indexOf(t);~r&&n.splice(r,1),!n.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){var t=this.updateObservers_();t&&this.refresh()},e.prototype.updateObservers_=function(){var t=this.observers_.filter(function(n){return n.gatherActive(),n.hasActive()});return t.forEach(function(n){return n.broadcastActive()}),t.length>0},e.prototype.connect_=function(){!Hs||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Yb?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!Hs||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var n=t.propertyName,r=n===void 0?"":n,o=jb.some(function(a){return!!~r.indexOf(a)});o&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),Rd=function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n++){var o=r[n];Object.defineProperty(e,o,{value:t[o],enumerable:!1,writable:!1,configurable:!0})}return e},Ur=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||Ia},Ad=Aa(0,0,0,0);function Ra(e){return parseFloat(e)||0}function Ld(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce(function(r,o){var a=e["border-"+o+"-width"];return r+Ra(a)},0)}function qb(e){for(var t=["top","right","bottom","left"],n={},r=0,o=t;r<o.length;r++){var a=o[r],i=e["padding-"+a];n[a]=Ra(i)}return n}function Gb(e){var t=e.getBBox();return Aa(0,0,t.width,t.height)}function Kb(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return Ad;var r=Ur(e).getComputedStyle(e),o=qb(r),a=o.left+o.right,i=o.top+o.bottom,s=Ra(r.width),u=Ra(r.height);if(r.boxSizing==="border-box"&&(Math.round(s+a)!==t&&(s-=Ld(r,"left","right")+a),Math.round(u+i)!==n&&(u-=Ld(r,"top","bottom")+i)),!Zb(e)){var c=Math.round(s+a)-t,f=Math.round(u+i)-n;Math.abs(c)!==1&&(s-=c),Math.abs(f)!==1&&(u-=f)}return Aa(o.left,o.top,s,u)}var Xb=function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof Ur(e).SVGGraphicsElement}:function(e){return e instanceof Ur(e).SVGElement&&typeof e.getBBox=="function"}}();function Zb(e){return e===Ur(e).document.documentElement}function Qb(e){return Hs?Xb(e)?Gb(e):Kb(e):Ad}function Jb(e){var t=e.x,n=e.y,r=e.width,o=e.height,a=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,i=Object.create(a.prototype);return Rd(i,{x:t,y:n,width:r,height:o,top:n,right:t+r,bottom:o+n,left:t}),i}function Aa(e,t,n,r){return{x:e,y:t,width:n,height:r}}var e1=function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Aa(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=Qb(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},e}(),t1=function(){function e(t,n){var r=Jb(n);Rd(this,{target:t,contentRect:r})}return e}(),n1=function(){function e(t,n,r){if(this.activeObservations_=[],this.observations_=new Id,typeof t!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=n,this.callbackCtx_=r}return e.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof Ur(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new e1(t)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof Ur(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)&&(n.delete(t),n.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&t.activeObservations_.push(n)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,n=this.activeObservations_.map(function(r){return new t1(r.target,r.broadcastRect())});this.callback_.call(t,n,t),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),$d=typeof WeakMap<"u"?new WeakMap:new Id,Fd=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=Ub.getInstance(),r=new n1(t,n,this);$d.set(this,r)}return e}();["observe","unobserve","disconnect"].forEach(function(e){Fd.prototype[e]=function(){var t;return(t=$d.get(this))[e].apply(t,arguments)}});var zd=function(){return typeof Ia.ResizeObserver<"u"?Ia.ResizeObserver:Fd}();const r1=Object.freeze(Object.defineProperty({__proto__:null,default:zd},Symbol.toStringTag,{value:"Module"}));var nr=new Map;function o1(e){e.forEach(function(t){var n,r=t.target;(n=nr.get(r))===null||n===void 0||n.forEach(function(o){return o(r)})})}var Hd=new zd(o1);function a1(e,t){nr.has(e)||(nr.set(e,new Set),Hd.observe(e)),nr.get(e).add(t)}function i1(e,t){nr.has(e)&&(nr.get(e).delete(t),nr.get(e).size||(Hd.unobserve(e),nr.delete(e)))}function qr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Vd(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,cd(r.key),r)}}function Gr(e,t,n){return t&&Vd(e.prototype,t),n&&Vd(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function La(e,t){return La=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},La(e,t)}function $a(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&La(e,t)}function Fa(e){return Fa=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Fa(e)}function Wd(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Wd=function(){return!!e})()}function Vs(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function s1(e,t){if(t&&(Ct(t)=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Vs(e)}function za(e){var t=Wd();return function(){var n,r=Fa(e);if(t){var o=Fa(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return s1(this,n)}}var l1=function(e){$a(n,e);var t=za(n);function n(){return qr(this,n),t.apply(this,arguments)}return Gr(n,[{key:"render",value:function(){return this.props.children}}]),n}(d.Component);function u1(e,t){var n=e.children,r=e.disabled,o=d.useRef(null),a=d.useRef(null),i=d.useContext(zs),s=typeof n=="function",u=s?n(o):n,c=d.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),f=!s&&d.isValidElement(u)&&Yr(u),l=f?ho(u):null,h=_a(l,o),m=function(){var p;return Ta(o.current)||(o.current&&Ct(o.current)==="object"?Ta((p=o.current)===null||p===void 0?void 0:p.nativeElement):null)||Ta(a.current)};d.useImperativeHandle(t,function(){return m()});var y=d.useRef(e);y.current=e;var w=d.useCallback(function(v){var p=y.current,g=p.onResize,b=p.data,C=v.getBoundingClientRect(),x=C.width,S=C.height,E=v.offsetWidth,M=v.offsetHeight,k=Math.floor(x),T=Math.floor(S);if(c.current.width!==k||c.current.height!==T||c.current.offsetWidth!==E||c.current.offsetHeight!==M){var R={width:k,height:T,offsetWidth:E,offsetHeight:M};c.current=R;var F=E===Math.round(x)?x:E,V=M===Math.round(S)?S:M,$=re(re({},R),{},{offsetWidth:F,offsetHeight:V});i==null||i($,v,b),g&&Promise.resolve().then(function(){g($,v)})}},[]);return d.useEffect(function(){var v=m();return v&&!r&&a1(v,w),function(){return i1(v,w)}},[o.current,r]),d.createElement(l1,{ref:a},f?d.cloneElement(u,{ref:h}):u)}var c1=d.forwardRef(u1),d1="rc-observer-key";function f1(e,t){var n=e.children,r=typeof n=="function"?[n]:Oa(n);return r.map(function(o,a){var i=(o==null?void 0:o.key)||"".concat(d1,"-").concat(a);return d.createElement(c1,Ne({},e,{key:i,ref:a===0?t:void 0}),o)})}var jn=d.forwardRef(f1);jn.Collection=zb;function Bd(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}function v1(e){return Bd(e)instanceof ShadowRoot}function Ws(e){return v1(e)?Bd(e):null}function m1(){var e=re({},d);return e.useId}var jd=0,Yd=m1();const h1=Yd?function(t){var n=Yd();return t||n}:function(t){var n=d.useState("ssr-id"),r=X(n,2),o=r[0],a=r[1];return d.useEffect(function(){var i=jd;jd+=1,a("rc_unique_".concat(i))},[]),t||o},p1=function(){if(typeof navigator>"u"||typeof window>"u")return!1;var e=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(e==null?void 0:e.substr(0,4))};var g1=d.createContext({}),y1=function(e){$a(n,e);var t=za(n);function n(){return qr(this,n),t.apply(this,arguments)}return Gr(n,[{key:"render",value:function(){return this.props.children}}]),n}(d.Component);function b1(e){var t=d.useReducer(function(s){return s+1},0),n=X(t,2),r=n[1],o=d.useRef(e),a=ct(function(){return o.current}),i=ct(function(s){o.current=typeof s=="function"?s(o.current):s,r()});return[a,i]}var rr="none",Ha="appear",Va="enter",Wa="leave",Ud="none",wn="prepare",Kr="start",Xr="active",Bs="end",qd="prepared";function Gd(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit".concat(e)]="webkit".concat(t),n["Moz".concat(e)]="moz".concat(t),n["ms".concat(e)]="MS".concat(t),n["O".concat(e)]="o".concat(t.toLowerCase()),n}function w1(e,t){var n={animationend:Gd("Animation","AnimationEnd"),transitionend:Gd("Transition","TransitionEnd")};return e&&("AnimationEvent"in t||delete n.animationend.animation,"TransitionEvent"in t||delete n.transitionend.transition),n}var C1=w1(Bn(),typeof window<"u"?window:{}),Kd={};if(Bn()){var x1=document.createElement("div");Kd=x1.style}var Ba={};function Xd(e){if(Ba[e])return Ba[e];var t=C1[e];if(t)for(var n=Object.keys(t),r=n.length,o=0;o<r;o+=1){var a=n[o];if(Object.prototype.hasOwnProperty.call(t,a)&&a in Kd)return Ba[e]=t[a],Ba[e]}return""}var Zd=Xd("animationend"),Qd=Xd("transitionend"),Jd=!!(Zd&&Qd),ef=Zd||"animationend",tf=Qd||"transitionend";function nf(e,t){if(!e)return null;if(Ct(e)==="object"){var n=t.replace(/-\w/g,function(r){return r[1].toUpperCase()});return e[n]}return"".concat(e,"-").concat(t)}const S1=function(e){var t=D.useRef();function n(o){o&&(o.removeEventListener(tf,e),o.removeEventListener(ef,e))}function r(o){t.current&&t.current!==o&&n(t.current),o&&o!==t.current&&(o.addEventListener(tf,e),o.addEventListener(ef,e),t.current=o)}return d.useEffect(function(){return function(){n(t.current)}},[]),[r,n]};var rf=Bn()?D.useLayoutEffect:D.useEffect,of=function(t){return+setTimeout(t,16)},af=function(t){return clearTimeout(t)};typeof window<"u"&&"requestAnimationFrame"in window&&(of=function(t){return window.requestAnimationFrame(t)},af=function(t){return window.cancelAnimationFrame(t)});var sf=0,js=new Map;function lf(e){js.delete(e)}var mt=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;sf+=1;var r=sf;function o(a){if(a===0)lf(r),t();else{var i=of(function(){o(a-1)});js.set(r,i)}}return o(n),r};mt.cancel=function(e){var t=js.get(e);return lf(e),af(t)};const E1=function(){var e=d.useRef(null);function t(){mt.cancel(e.current)}function n(r){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;t();var a=mt(function(){o<=1?r({isCanceled:function(){return a!==e.current}}):n(r,o-1)});e.current=a}return d.useEffect(function(){return function(){t()}},[]),[n,t]};var M1=[wn,Kr,Xr,Bs],P1=[wn,qd],uf=!1,D1=!0;function cf(e){return e===Xr||e===Bs}const k1=function(e,t,n){var r=mo(Ud),o=X(r,2),a=o[0],i=o[1],s=E1(),u=X(s,2),c=u[0],f=u[1];function l(){i(wn,!0)}var h=t?P1:M1;return rf(function(){if(a!==Ud&&a!==Bs){var m=h.indexOf(a),y=h[m+1],w=n(a);w===uf?i(y,!0):y&&c(function(v){function p(){v.isCanceled()||i(y,!0)}w===!0?p():Promise.resolve(w).then(p)})}},[e,a]),d.useEffect(function(){return function(){f()}},[]),[l,a]};function _1(e,t,n,r){var o=r.motionEnter,a=o===void 0?!0:o,i=r.motionAppear,s=i===void 0?!0:i,u=r.motionLeave,c=u===void 0?!0:u,f=r.motionDeadline,l=r.motionLeaveImmediately,h=r.onAppearPrepare,m=r.onEnterPrepare,y=r.onLeavePrepare,w=r.onAppearStart,v=r.onEnterStart,p=r.onLeaveStart,g=r.onAppearActive,b=r.onEnterActive,C=r.onLeaveActive,x=r.onAppearEnd,S=r.onEnterEnd,E=r.onLeaveEnd,M=r.onVisibleChanged,k=mo(),T=X(k,2),R=T[0],F=T[1],V=b1(rr),$=X(V,2),L=$[0],N=$[1],H=mo(null),_=X(H,2),z=_[0],B=_[1],A=L(),j=D.useRef(!1),Y=D.useRef(null);function U(){return n()}var ne=D.useRef(!1);function te(){N(rr),B(null,!0)}var J=ct(function(ye){var de=L();if(de!==rr){var se=U();if(!(ye&&!ye.deadline&&ye.target!==se)){var He=ne.current,Le;de===Ha&&He?Le=x==null?void 0:x(se,ye):de===Va&&He?Le=S==null?void 0:S(se,ye):de===Wa&&He&&(Le=E==null?void 0:E(se,ye)),He&&Le!==!1&&te()}}}),G=S1(J),q=X(G,1),Z=q[0],O=function(de){switch(de){case Ha:return ce(ce(ce({},wn,h),Kr,w),Xr,g);case Va:return ce(ce(ce({},wn,m),Kr,v),Xr,b);case Wa:return ce(ce(ce({},wn,y),Kr,p),Xr,C);default:return{}}},I=d.useMemo(function(){return O(A)},[A]),W=k1(A,!e,function(ye){if(ye===wn){var de=I[wn];return de?de(U()):uf}if(Q in I){var se;B(((se=I[Q])===null||se===void 0?void 0:se.call(I,U(),null))||null)}return Q===Xr&&A!==rr&&(Z(U()),f>0&&(clearTimeout(Y.current),Y.current=setTimeout(function(){J({deadline:!0})},f))),Q===qd&&te(),D1}),K=X(W,2),oe=K[0],Q=K[1],ae=cf(Q);ne.current=ae;var ee=D.useRef(null);rf(function(){if(!(j.current&&ee.current===t)){F(t);var ye=j.current;j.current=!0;var de;!ye&&t&&s&&(de=Ha),ye&&t&&a&&(de=Va),(ye&&!t&&c||!ye&&l&&!t&&c)&&(de=Wa);var se=O(de);de&&(e||se[wn])?(N(de),oe()):N(rr),ee.current=t}},[t]),D.useEffect(function(){(A===Ha&&!s||A===Va&&!a||A===Wa&&!c)&&N(rr)},[s,a,c]),D.useEffect(function(){return function(){j.current=!1,clearTimeout(Y.current)}},[]);var ie=d.useRef(!1);D.useEffect(function(){R&&(ie.current=!0),R!==void 0&&A===rr&&((ie.current||R)&&(M==null||M(R)),ie.current=!0)},[R,A]);var ve=z;return I[wn]&&Q===Kr&&(ve=re({transition:"none"},ve)),[A,Q,ve,R!=null?R:t]}function N1(e){var t=e;Ct(e)==="object"&&(t=e.transitionSupport);function n(o,a){return!!(o.motionName&&t&&a!==!1)}var r=d.forwardRef(function(o,a){var i=o.visible,s=i===void 0?!0:i,u=o.removeOnLeave,c=u===void 0?!0:u,f=o.forceRender,l=o.children,h=o.motionName,m=o.leavedClassName,y=o.eventProps,w=d.useContext(g1),v=w.motion,p=n(o,v),g=D.useRef(),b=D.useRef();function C(){try{return g.current instanceof HTMLElement?g.current:Ta(b.current)}catch{return null}}var x=_1(p,s,C,o),S=X(x,4),E=S[0],M=S[1],k=S[2],T=S[3],R=d.useRef(T);T&&(R.current=!0);var F=d.useCallback(function(_){g.current=_,Os(a,_)},[a]),V,$=re(re({},y),{},{visible:s});if(!l)V=null;else if(E===rr)T?V=l(re({},$),F):!c&&R.current&&m?V=l(re(re({},$),{},{className:m}),F):f||!c&&!m?V=l(re(re({},$),{},{style:{display:"none"}}),F):V=null;else{var L;M===wn?L="prepare":cf(M)?L="active":M===Kr&&(L="start");var N=nf(h,"".concat(E,"-").concat(L));V=l(re(re({},$),{},{className:Xe(nf(h,E),ce(ce({},N,N&&L),h,typeof h=="string")),style:k}),F)}if(d.isValidElement(V)&&Yr(V)){var H=ho(V);H||(V=d.cloneElement(V,{ref:F}))}return d.createElement(y1,{ref:b},V)});return r.displayName="CSSMotion",r}const ja=N1(Jd);var Ys="add",Us="keep",qs="remove",Gs="removed";function O1(e){var t;return e&&Ct(e)==="object"&&"key"in e?t=e:t={key:e},re(re({},t),{},{key:String(t.key)})}function Ks(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return e.map(O1)}function T1(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=[],r=0,o=t.length,a=Ks(e),i=Ks(t);a.forEach(function(c){for(var f=!1,l=r;l<o;l+=1){var h=i[l];if(h.key===c.key){r<l&&(n=n.concat(i.slice(r,l).map(function(m){return re(re({},m),{},{status:Ys})})),r=l),n.push(re(re({},h),{},{status:Us})),r+=1,f=!0;break}}f||n.push(re(re({},c),{},{status:qs}))}),r<o&&(n=n.concat(i.slice(r).map(function(c){return re(re({},c),{},{status:Ys})})));var s={};n.forEach(function(c){var f=c.key;s[f]=(s[f]||0)+1});var u=Object.keys(s).filter(function(c){return s[c]>1});return u.forEach(function(c){n=n.filter(function(f){var l=f.key,h=f.status;return l!==c||h!==qs}),n.forEach(function(f){f.key===c&&(f.status=Us)})}),n}var I1=["component","children","onVisibleChanged","onAllRemoved"],R1=["status"],A1=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearPrepare","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function L1(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ja,n=function(r){$a(a,r);var o=za(a);function a(){var i;qr(this,a);for(var s=arguments.length,u=new Array(s),c=0;c<s;c++)u[c]=arguments[c];return i=o.call.apply(o,[this].concat(u)),ce(Vs(i),"state",{keyEntities:[]}),ce(Vs(i),"removeKey",function(f){i.setState(function(l){var h=l.keyEntities.map(function(m){return m.key!==f?m:re(re({},m),{},{status:Gs})});return{keyEntities:h}},function(){var l=i.state.keyEntities,h=l.filter(function(m){var y=m.status;return y!==Gs}).length;h===0&&i.props.onAllRemoved&&i.props.onAllRemoved()})}),i}return Gr(a,[{key:"render",value:function(){var s=this,u=this.state.keyEntities,c=this.props,f=c.component,l=c.children,h=c.onVisibleChanged;c.onAllRemoved;var m=pt(c,I1),y=f||d.Fragment,w={};return A1.forEach(function(v){w[v]=m[v],delete m[v]}),delete m.keys,d.createElement(y,m,u.map(function(v,p){var g=v.status,b=pt(v,R1),C=g===Ys||g===Us;return d.createElement(t,Ne({},w,{key:b.key,visible:C,eventProps:b,onVisibleChanged:function(S){h==null||h(S,{key:b.key}),S||s.removeKey(b.key)}}),function(x,S){return l(re(re({},x),{},{index:p}),S)})}))}}],[{key:"getDerivedStateFromProps",value:function(s,u){var c=s.keys,f=u.keyEntities,l=Ks(c),h=T1(f,l);return{keyEntities:h.filter(function(m){var y=f.find(function(w){var v=w.key;return m.key===v});return!(y&&y.status===Gs&&m.status===qs)})}}}]),a}(d.Component);return ce(n,"defaultProps",{component:"div"}),n}L1(Jd);function $1(e){var t=e.prefixCls,n=e.align,r=e.arrow,o=e.arrowPos,a=r||{},i=a.className,s=a.content,u=o.x,c=u===void 0?0:u,f=o.y,l=f===void 0?0:f,h=d.useRef();if(!n||!n.points)return null;var m={position:"absolute"};if(n.autoArrow!==!1){var y=n.points[0],w=n.points[1],v=y[0],p=y[1],g=w[0],b=w[1];v===g||!["t","b"].includes(v)?m.top=l:v==="t"?m.top=0:m.bottom=0,p===b||!["l","r"].includes(p)?m.left=c:p==="l"?m.left=0:m.right=0}return d.createElement("div",{ref:h,className:Xe("".concat(t,"-arrow"),i),style:m},s)}function F1(e){var t=e.prefixCls,n=e.open,r=e.zIndex,o=e.mask,a=e.motion;return o?d.createElement(ja,Ne({},a,{motionAppear:!0,visible:n,removeOnLeave:!0}),function(i){var s=i.className;return d.createElement("div",{style:{zIndex:r},className:Xe("".concat(t,"-mask"),s)})}):null}var z1=d.memo(function(e){var t=e.children;return t},function(e,t){return t.cache}),H1=d.forwardRef(function(e,t){var n=e.popup,r=e.className,o=e.prefixCls,a=e.style,i=e.target,s=e.onVisibleChanged,u=e.open,c=e.keepDom,f=e.fresh,l=e.onClick,h=e.mask,m=e.arrow,y=e.arrowPos,w=e.align,v=e.motion,p=e.maskMotion,g=e.forceRender,b=e.getPopupContainer,C=e.autoDestroy,x=e.portal,S=e.zIndex,E=e.onMouseEnter,M=e.onMouseLeave,k=e.onPointerEnter,T=e.onPointerDownCapture,R=e.ready,F=e.offsetX,V=e.offsetY,$=e.offsetR,L=e.offsetB,N=e.onAlign,H=e.onPrepare,_=e.stretch,z=e.targetWidth,B=e.targetHeight,A=typeof n=="function"?n():n,j=u||c,Y=(b==null?void 0:b.length)>0,U=d.useState(!b||!Y),ne=X(U,2),te=ne[0],J=ne[1];if(ht(function(){!te&&Y&&i&&J(!0)},[te,Y,i]),!te)return null;var G="auto",q={left:"-1000vw",top:"-1000vh",right:G,bottom:G};if(R||!u){var Z,O=w.points,I=w.dynamicInset||((Z=w._experimental)===null||Z===void 0?void 0:Z.dynamicInset),W=I&&O[0][1]==="r",K=I&&O[0][0]==="b";W?(q.right=$,q.left=G):(q.left=F,q.right=G),K?(q.bottom=L,q.top=G):(q.top=V,q.bottom=G)}var oe={};return _&&(_.includes("height")&&B?oe.height=B:_.includes("minHeight")&&B&&(oe.minHeight=B),_.includes("width")&&z?oe.width=z:_.includes("minWidth")&&z&&(oe.minWidth=z)),u||(oe.pointerEvents="none"),d.createElement(x,{open:g||j,getContainer:b&&function(){return b(i)},autoDestroy:C},d.createElement(F1,{prefixCls:o,open:u,zIndex:S,mask:h,motion:p}),d.createElement(jn,{onResize:N,disabled:!u},function(Q){return d.createElement(ja,Ne({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:g,leavedClassName:"".concat(o,"-hidden")},v,{onAppearPrepare:H,onEnterPrepare:H,visible:u,onVisibleChanged:function(ee){var ie;v==null||(ie=v.onVisibleChanged)===null||ie===void 0||ie.call(v,ee),s(ee)}}),function(ae,ee){var ie=ae.className,ve=ae.style,ye=Xe(o,ie,r);return d.createElement("div",{ref:ka(Q,t,ee),className:ye,style:re(re(re(re({"--arrow-x":"".concat(y.x||0,"px"),"--arrow-y":"".concat(y.y||0,"px")},q),oe),ve),{},{boxSizing:"border-box",zIndex:S},a),onMouseEnter:E,onMouseLeave:M,onPointerEnter:k,onClick:l,onPointerDownCapture:T},m&&d.createElement($1,{prefixCls:o,arrow:m,arrowPos:y,align:w}),d.createElement(z1,{cache:!u&&!f},A))})}))}),V1=d.forwardRef(function(e,t){var n=e.children,r=e.getTriggerDOMNode,o=Yr(n),a=d.useCallback(function(s){Os(t,r?r(s):s)},[r]),i=_a(a,ho(n));return o?d.cloneElement(n,{ref:i}):n}),df=d.createContext(null);function ff(e){return e?Array.isArray(e)?e:[e]:[]}function W1(e,t,n,r){return d.useMemo(function(){var o=ff(n!=null?n:t),a=ff(r!=null?r:t),i=new Set(o),s=new Set(a);return e&&(i.has("hover")&&(i.delete("hover"),i.add("click")),s.has("hover")&&(s.delete("hover"),s.add("click"))),[i,s]},[e,t,n,r])}const Xs=function(e){if(!e)return!1;if(e instanceof Element){if(e.offsetParent)return!0;if(e.getBBox){var t=e.getBBox(),n=t.width,r=t.height;if(n||r)return!0}if(e.getBoundingClientRect){var o=e.getBoundingClientRect(),a=o.width,i=o.height;if(a||i)return!0}}return!1};function B1(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0;return n?e[0]===t[0]:e[0]===t[0]&&e[1]===t[1]}function j1(e,t,n,r){for(var o=n.points,a=Object.keys(e),i=0;i<a.length;i+=1){var s,u=a[i];if(B1((s=e[u])===null||s===void 0?void 0:s.points,o,r))return"".concat(t,"-placement-").concat(u)}return""}function vf(e,t,n,r){return t||(n?{motionName:"".concat(e,"-").concat(n)}:r?{motionName:r}:null)}function yo(e){return e.ownerDocument.defaultView}function Zs(e){for(var t=[],n=e==null?void 0:e.parentElement,r=["hidden","scroll","clip","auto"];n;){var o=yo(n).getComputedStyle(n),a=o.overflowX,i=o.overflowY,s=o.overflow;[a,i,s].some(function(u){return r.includes(u)})&&t.push(n),n=n.parentElement}return t}function bo(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;return Number.isNaN(e)?t:e}function wo(e){return bo(parseFloat(e),0)}function mf(e,t){var n=re({},e);return(t||[]).forEach(function(r){if(!(r instanceof HTMLBodyElement||r instanceof HTMLHtmlElement)){var o=yo(r).getComputedStyle(r),a=o.overflow,i=o.overflowClipMargin,s=o.borderTopWidth,u=o.borderBottomWidth,c=o.borderLeftWidth,f=o.borderRightWidth,l=r.getBoundingClientRect(),h=r.offsetHeight,m=r.clientHeight,y=r.offsetWidth,w=r.clientWidth,v=wo(s),p=wo(u),g=wo(c),b=wo(f),C=bo(Math.round(l.width/y*1e3)/1e3),x=bo(Math.round(l.height/h*1e3)/1e3),S=(y-w-g-b)*C,E=(h-m-v-p)*x,M=v*x,k=p*x,T=g*C,R=b*C,F=0,V=0;if(a==="clip"){var $=wo(i);F=$*C,V=$*x}var L=l.x+T-F,N=l.y+M-V,H=L+l.width+2*F-T-R-S,_=N+l.height+2*V-M-k-E;n.left=Math.max(n.left,L),n.top=Math.max(n.top,N),n.right=Math.min(n.right,H),n.bottom=Math.min(n.bottom,_)}}),n}function hf(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n="".concat(t),r=n.match(/^(.*)\%$/);return r?e*(parseFloat(r[1])/100):parseFloat(n)}function pf(e,t){var n=t||[],r=X(n,2),o=r[0],a=r[1];return[hf(e.width,o),hf(e.height,a)]}function gf(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return[e[0],e[1]]}function Zr(e,t){var n=t[0],r=t[1],o,a;return n==="t"?a=e.y:n==="b"?a=e.y+e.height:a=e.y+e.height/2,r==="l"?o=e.x:r==="r"?o=e.x+e.width:o=e.x+e.width/2,{x:o,y:a}}function or(e,t){var n={t:"b",b:"t",l:"r",r:"l"};return e.map(function(r,o){return o===t?n[r]||"c":r}).join("")}function Y1(e,t,n,r,o,a,i){var s=d.useState({ready:!1,offsetX:0,offsetY:0,offsetR:0,offsetB:0,arrowX:0,arrowY:0,scaleX:1,scaleY:1,align:o[r]||{}}),u=X(s,2),c=u[0],f=u[1],l=d.useRef(0),h=d.useMemo(function(){return t?Zs(t):[]},[t]),m=d.useRef({}),y=function(){m.current={}};e||y();var w=ct(function(){if(t&&n&&e){let at=function(pr,gr){var yr=arguments.length>2&&arguments[2]!==void 0?arguments[2]:He,la=U.x+pr,Xi=U.y+gr,xu=la+W,Su=Xi+I,Eu=Math.max(la,yr.left),_e=Math.max(Xi,yr.top),je=Math.min(xu,yr.right),St=Math.min(Su,yr.bottom);return Math.max(0,(je-Eu)*(St-_e))},Dt=function(){Et=U.y+pe,Bt=Et+I,bt=U.x+xe,sn=bt+W};var g,b,C,x,S=t,E=S.ownerDocument,M=yo(S),k=M.getComputedStyle(S),T=k.width,R=k.height,F=k.position,V=S.style.left,$=S.style.top,L=S.style.right,N=S.style.bottom,H=S.style.overflow,_=re(re({},o[r]),a),z=E.createElement("div");(g=S.parentElement)===null||g===void 0||g.appendChild(z),z.style.left="".concat(S.offsetLeft,"px"),z.style.top="".concat(S.offsetTop,"px"),z.style.position=F,z.style.height="".concat(S.offsetHeight,"px"),z.style.width="".concat(S.offsetWidth,"px"),S.style.left="0",S.style.top="0",S.style.right="auto",S.style.bottom="auto",S.style.overflow="hidden";var B;if(Array.isArray(n))B={x:n[0],y:n[1],width:0,height:0};else{var A,j,Y=n.getBoundingClientRect();Y.x=(A=Y.x)!==null&&A!==void 0?A:Y.left,Y.y=(j=Y.y)!==null&&j!==void 0?j:Y.top,B={x:Y.x,y:Y.y,width:Y.width,height:Y.height}}var U=S.getBoundingClientRect();U.x=(b=U.x)!==null&&b!==void 0?b:U.left,U.y=(C=U.y)!==null&&C!==void 0?C:U.top;var ne=E.documentElement,te=ne.clientWidth,J=ne.clientHeight,G=ne.scrollWidth,q=ne.scrollHeight,Z=ne.scrollTop,O=ne.scrollLeft,I=U.height,W=U.width,K=B.height,oe=B.width,Q={left:0,top:0,right:te,bottom:J},ae={left:-O,top:-Z,right:G-O,bottom:q-Z},ee=_.htmlRegion,ie="visible",ve="visibleFirst";ee!=="scroll"&&ee!==ve&&(ee=ie);var ye=ee===ve,de=mf(ae,h),se=mf(Q,h),He=ee===ie?se:de,Le=ye?se:He;S.style.left="auto",S.style.top="auto",S.style.right="0",S.style.bottom="0";var ge=S.getBoundingClientRect();S.style.left=V,S.style.top=$,S.style.right=L,S.style.bottom=N,S.style.overflow=H,(x=S.parentElement)===null||x===void 0||x.removeChild(z);var Ye=bo(Math.round(W/parseFloat(T)*1e3)/1e3),Fe=bo(Math.round(I/parseFloat(R)*1e3)/1e3);if(Ye===0||Fe===0||go(n)&&!Xs(n))return;var ze=_.offset,Ge=_.targetOffset,Ke=pf(U,ze),Ee=X(Ke,2),$e=Ee[0],le=Ee[1],fe=pf(B,Ge),Pe=X(fe,2),ue=Pe[0],he=Pe[1];B.x-=ue,B.y-=he;var Ue=_.points||[],Je=X(Ue,2),nt=Je[0],yt=Je[1],tt=gf(yt),be=gf(nt),We=Zr(B,tt),Oe=Zr(U,be),Ce=re({},_),xe=We.x-Oe.x+$e,pe=We.y-Oe.y+le,Ve=at(xe,pe),dt=at(xe,pe,se),ut=Zr(B,["t","l"]),rt=Zr(U,["t","l"]),Jt=Zr(B,["b","r"]),xt=Zr(U,["b","r"]),Vt=_.overflow||{},en=Vt.adjustX,dn=Vt.adjustY,Wt=Vt.shiftX,Nt=Vt.shiftY,Kt=function(gr){return typeof gr=="boolean"?gr:gr>=0},Et,Bt,bt,sn;Dt();var Ot=Kt(dn),fn=be[0]===tt[0];if(Ot&&be[0]==="t"&&(Bt>Le.bottom||m.current.bt)){var we=pe;fn?we-=I-K:we=ut.y-xt.y-le;var Me=at(xe,we),Be=at(xe,we,se);Me>Ve||Me===Ve&&(!ye||Be>=dt)?(m.current.bt=!0,pe=we,le=-le,Ce.points=[or(be,0),or(tt,0)]):m.current.bt=!1}if(Ot&&be[0]==="b"&&(Et<Le.top||m.current.tb)){var qe=pe;fn?qe+=I-K:qe=Jt.y-rt.y-le;var it=at(xe,qe),Ft=at(xe,qe,se);it>Ve||it===Ve&&(!ye||Ft>=dt)?(m.current.tb=!0,pe=qe,le=-le,Ce.points=[or(be,0),or(tt,0)]):m.current.tb=!1}var Rt=Kt(en),tn=be[1]===tt[1];if(Rt&&be[1]==="l"&&(sn>Le.right||m.current.rl)){var nn=xe;tn?nn-=W-oe:nn=ut.x-xt.x-$e;var Xt=at(nn,pe),zt=at(nn,pe,se);Xt>Ve||Xt===Ve&&(!ye||zt>=dt)?(m.current.rl=!0,xe=nn,$e=-$e,Ce.points=[or(be,1),or(tt,1)]):m.current.rl=!1}if(Rt&&be[1]==="r"&&(bt<Le.left||m.current.lr)){var rn=xe;tn?rn+=W-oe:rn=Jt.x-rt.x-$e;var zn=at(rn,pe),Hn=at(rn,pe,se);zn>Ve||zn===Ve&&(!ye||Hn>=dt)?(m.current.lr=!0,xe=rn,$e=-$e,Ce.points=[or(be,1),or(tt,1)]):m.current.lr=!1}Dt();var jt=Wt===!0?0:Wt;typeof jt=="number"&&(bt<se.left&&(xe-=bt-se.left-$e,B.x+oe<se.left+jt&&(xe+=B.x-se.left+oe-jt)),sn>se.right&&(xe-=sn-se.right-$e,B.x>se.right-jt&&(xe+=B.x-se.right+jt)));var Yt=Nt===!0?0:Nt;typeof Yt=="number"&&(Et<se.top&&(pe-=Et-se.top-le,B.y+K<se.top+Yt&&(pe+=B.y-se.top+K-Yt)),Bt>se.bottom&&(pe-=Bt-se.bottom-le,B.y>se.bottom-Yt&&(pe+=B.y-se.bottom+Yt)));var pn=U.x+xe,gn=pn+W,Zt=U.y+pe,Xn=Zt+I,ft=B.x,ot=ft+oe,lt=B.y,Tt=lt+K,Te=Math.max(pn,ft),Re=Math.min(gn,ot),Mt=(Te+Re)/2,Qt=Mt-pn,Pn=Math.max(Zt,lt),Zn=Math.min(Xn,Tt),Dn=(Pn+Zn)/2,Qn=Dn-Zt;i==null||i(t,Ce);var Ze=ge.right-U.x-(xe+U.width),Ae=ge.bottom-U.y-(pe+U.height);Ye===1&&(xe=Math.round(xe),Ze=Math.round(Ze)),Fe===1&&(pe=Math.round(pe),Ae=Math.round(Ae));var Qe={ready:!0,offsetX:xe/Ye,offsetY:pe/Fe,offsetR:Ze/Ye,offsetB:Ae/Fe,arrowX:Qt/Ye,arrowY:Qn/Fe,scaleX:Ye,scaleY:Fe,align:Ce};f(Qe)}}),v=function(){l.current+=1;var b=l.current;Promise.resolve().then(function(){l.current===b&&w()})},p=function(){f(function(b){return re(re({},b),{},{ready:!1})})};return ht(p,[r]),ht(function(){e||p()},[e]),[c.ready,c.offsetX,c.offsetY,c.offsetR,c.offsetB,c.arrowX,c.arrowY,c.scaleX,c.scaleY,c.align,v]}function U1(e,t,n,r,o){ht(function(){if(e&&t&&n){let l=function(){r(),o()};var a=t,i=n,s=Zs(a),u=Zs(i),c=yo(i),f=new Set([c].concat(wt(s),wt(u)));return f.forEach(function(h){h.addEventListener("scroll",l,{passive:!0})}),c.addEventListener("resize",l,{passive:!0}),r(),function(){f.forEach(function(h){h.removeEventListener("scroll",l),c.removeEventListener("resize",l)})}}},[e,t,n])}function q1(e,t,n,r,o,a,i,s){var u=d.useRef(e);u.current=e;var c=d.useRef(!1);d.useEffect(function(){if(t&&r&&(!o||a)){var l=function(){c.current=!1},h=function(v){var p;u.current&&!i(((p=v.composedPath)===null||p===void 0||(p=p.call(v))===null||p===void 0?void 0:p[0])||v.target)&&!c.current&&s(!1)},m=yo(r);m.addEventListener("pointerdown",l,!0),m.addEventListener("mousedown",h,!0),m.addEventListener("contextmenu",h,!0);var y=Ws(n);return y&&(y.addEventListener("mousedown",h,!0),y.addEventListener("contextmenu",h,!0)),function(){m.removeEventListener("pointerdown",l,!0),m.removeEventListener("mousedown",h,!0),m.removeEventListener("contextmenu",h,!0),y&&(y.removeEventListener("mousedown",h,!0),y.removeEventListener("contextmenu",h,!0))}}},[t,n,r,o,a]);function f(){c.current=!0}return f}var G1=["prefixCls","children","action","showAction","hideAction","popupVisible","defaultPopupVisible","onPopupVisibleChange","afterPopupVisibleChange","mouseEnterDelay","mouseLeaveDelay","focusDelay","blurDelay","mask","maskClosable","getPopupContainer","forceRender","autoDestroy","destroyPopupOnHide","popup","popupClassName","popupStyle","popupPlacement","builtinPlacements","popupAlign","zIndex","stretch","getPopupClassNameFromAlign","fresh","alignPoint","onPopupClick","onPopupAlign","arrow","popupMotion","maskMotion","popupTransitionName","popupAnimation","maskTransitionName","maskAnimation","className","getTriggerDOMNode"];function K1(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Od,t=d.forwardRef(function(n,r){var o=n.prefixCls,a=o===void 0?"rc-trigger-popup":o,i=n.children,s=n.action,u=s===void 0?"hover":s,c=n.showAction,f=n.hideAction,l=n.popupVisible,h=n.defaultPopupVisible,m=n.onPopupVisibleChange,y=n.afterPopupVisibleChange,w=n.mouseEnterDelay,v=n.mouseLeaveDelay,p=v===void 0?.1:v,g=n.focusDelay,b=n.blurDelay,C=n.mask,x=n.maskClosable,S=x===void 0?!0:x,E=n.getPopupContainer,M=n.forceRender,k=n.autoDestroy,T=n.destroyPopupOnHide,R=n.popup,F=n.popupClassName,V=n.popupStyle,$=n.popupPlacement,L=n.builtinPlacements,N=L===void 0?{}:L,H=n.popupAlign,_=n.zIndex,z=n.stretch,B=n.getPopupClassNameFromAlign,A=n.fresh,j=n.alignPoint,Y=n.onPopupClick,U=n.onPopupAlign,ne=n.arrow,te=n.popupMotion,J=n.maskMotion,G=n.popupTransitionName,q=n.popupAnimation,Z=n.maskTransitionName,O=n.maskAnimation,I=n.className,W=n.getTriggerDOMNode,K=pt(n,G1),oe=k||T||!1,Q=d.useState(!1),ae=X(Q,2),ee=ae[0],ie=ae[1];ht(function(){ie(p1())},[]);var ve=d.useRef({}),ye=d.useContext(df),de=d.useMemo(function(){return{registerSubPopup:function(je,St){ve.current[je]=St,ye==null||ye.registerSubPopup(je,St)}}},[ye]),se=h1(),He=d.useState(null),Le=X(He,2),ge=Le[0],Ye=Le[1],Fe=d.useRef(null),ze=ct(function(_e){Fe.current=_e,go(_e)&&ge!==_e&&Ye(_e),ye==null||ye.registerSubPopup(se,_e)}),Ge=d.useState(null),Ke=X(Ge,2),Ee=Ke[0],$e=Ke[1],le=d.useRef(null),fe=ct(function(_e){go(_e)&&Ee!==_e&&($e(_e),le.current=_e)}),Pe=d.Children.only(i),ue=(Pe==null?void 0:Pe.props)||{},he={},Ue=ct(function(_e){var je,St,Ht=Ee;return(Ht==null?void 0:Ht.contains(_e))||((je=Ws(Ht))===null||je===void 0?void 0:je.host)===_e||_e===Ht||(ge==null?void 0:ge.contains(_e))||((St=Ws(ge))===null||St===void 0?void 0:St.host)===_e||_e===ge||Object.values(ve.current).some(function(kt){return(kt==null?void 0:kt.contains(_e))||_e===kt})}),Je=vf(a,te,q,G),nt=vf(a,J,O,Z),yt=d.useState(h||!1),tt=X(yt,2),be=tt[0],We=tt[1],Oe=l!=null?l:be,Ce=ct(function(_e){l===void 0&&We(_e)});ht(function(){We(l||!1)},[l]);var xe=d.useRef(Oe);xe.current=Oe;var pe=d.useRef([]);pe.current=[];var Ve=ct(function(_e){var je;Ce(_e),((je=pe.current[pe.current.length-1])!==null&&je!==void 0?je:Oe)!==_e&&(pe.current.push(_e),m==null||m(_e))}),dt=d.useRef(),ut=function(){clearTimeout(dt.current)},rt=function(je){var St=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;ut(),St===0?Ve(je):dt.current=setTimeout(function(){Ve(je)},St*1e3)};d.useEffect(function(){return ut},[]);var Jt=d.useState(!1),xt=X(Jt,2),Vt=xt[0],en=xt[1];ht(function(_e){(!_e||Oe)&&en(!0)},[Oe]);var dn=d.useState(null),Wt=X(dn,2),Nt=Wt[0],Kt=Wt[1],Et=d.useState(null),Bt=X(Et,2),bt=Bt[0],sn=Bt[1],Ot=function(je){sn([je.clientX,je.clientY])},fn=Y1(Oe,ge,j&&bt!==null?bt:Ee,$,N,H,U),we=X(fn,11),Me=we[0],Be=we[1],qe=we[2],it=we[3],Ft=we[4],Rt=we[5],tn=we[6],nn=we[7],Xt=we[8],zt=we[9],rn=we[10],zn=W1(ee,u,c,f),Hn=X(zn,2),jt=Hn[0],Yt=Hn[1],pn=jt.has("click"),gn=Yt.has("click")||Yt.has("contextMenu"),Zt=ct(function(){Vt||rn()}),Xn=function(){xe.current&&j&&gn&&rt(!1)};U1(Oe,Ee,ge,Zt,Xn),ht(function(){Zt()},[bt,$]),ht(function(){Oe&&!(N!=null&&N[$])&&Zt()},[JSON.stringify(H)]);var ft=d.useMemo(function(){var _e=j1(N,a,zt,j);return Xe(_e,B==null?void 0:B(zt))},[zt,B,N,a,j]);d.useImperativeHandle(r,function(){return{nativeElement:le.current,popupElement:Fe.current,forceAlign:Zt}});var ot=d.useState(0),lt=X(ot,2),Tt=lt[0],Te=lt[1],Re=d.useState(0),Mt=X(Re,2),Qt=Mt[0],Pn=Mt[1],Zn=function(){if(z&&Ee){var je=Ee.getBoundingClientRect();Te(je.width),Pn(je.height)}},Dn=function(){Zn(),Zt()},Qn=function(je){en(!1),rn(),y==null||y(je)},Ze=function(){return new Promise(function(je){Zn(),Kt(function(){return je})})};ht(function(){Nt&&(rn(),Nt(),Kt(null))},[Nt]);function Ae(_e,je,St,Ht){he[_e]=function(kt){var Zi;Ht==null||Ht(kt),rt(je,St);for(var Mu=arguments.length,Bp=new Array(Mu>1?Mu-1:0),Qi=1;Qi<Mu;Qi++)Bp[Qi-1]=arguments[Qi];(Zi=ue[_e])===null||Zi===void 0||Zi.call.apply(Zi,[ue,kt].concat(Bp))}}(pn||gn)&&(he.onClick=function(_e){var je;xe.current&&gn?rt(!1):!xe.current&&pn&&(Ot(_e),rt(!0));for(var St=arguments.length,Ht=new Array(St>1?St-1:0),kt=1;kt<St;kt++)Ht[kt-1]=arguments[kt];(je=ue.onClick)===null||je===void 0||je.call.apply(je,[ue,_e].concat(Ht))});var Qe=q1(Oe,gn,Ee,ge,C,S,Ue,rt),at=jt.has("hover"),Dt=Yt.has("hover"),pr,gr;at&&(Ae("onMouseEnter",!0,w,function(_e){Ot(_e)}),Ae("onPointerEnter",!0,w,function(_e){Ot(_e)}),pr=function(je){(Oe||Vt)&&ge!==null&&ge!==void 0&&ge.contains(je.target)&&rt(!0,w)},j&&(he.onMouseMove=function(_e){var je;(je=ue.onMouseMove)===null||je===void 0||je.call(ue,_e)})),Dt&&(Ae("onMouseLeave",!1,p),Ae("onPointerLeave",!1,p),gr=function(){rt(!1,p)}),jt.has("focus")&&Ae("onFocus",!0,g),Yt.has("focus")&&Ae("onBlur",!1,b),jt.has("contextMenu")&&(he.onContextMenu=function(_e){var je;xe.current&&Yt.has("contextMenu")?rt(!1):(Ot(_e),rt(!0)),_e.preventDefault();for(var St=arguments.length,Ht=new Array(St>1?St-1:0),kt=1;kt<St;kt++)Ht[kt-1]=arguments[kt];(je=ue.onContextMenu)===null||je===void 0||je.call.apply(je,[ue,_e].concat(Ht))}),I&&(he.className=Xe(ue.className,I));var yr=re(re({},ue),he),la={},Xi=["onContextMenu","onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur"];Xi.forEach(function(_e){K[_e]&&(la[_e]=function(){for(var je,St=arguments.length,Ht=new Array(St),kt=0;kt<St;kt++)Ht[kt]=arguments[kt];(je=yr[_e])===null||je===void 0||je.call.apply(je,[yr].concat(Ht)),K[_e].apply(K,Ht)})});var xu=d.cloneElement(Pe,re(re({},yr),la)),Su={x:Rt,y:tn},Eu=ne?re({},ne!==!0?ne:{}):null;return d.createElement(d.Fragment,null,d.createElement(jn,{disabled:!Oe,ref:fe,onResize:Dn},d.createElement(V1,{getTriggerDOMNode:W},xu)),d.createElement(df.Provider,{value:de},d.createElement(H1,{portal:e,ref:ze,prefixCls:a,popup:R,className:Xe(F,ft),style:V,target:Ee,onMouseEnter:pr,onMouseLeave:gr,onPointerEnter:pr,zIndex:_,open:Oe,keepDom:Vt,fresh:A,onClick:Y,onPointerDownCapture:Qe,mask:C,motion:Je,maskMotion:nt,onVisibleChanged:Qn,onPrepare:Ze,forceRender:M,autoDestroy:oe,getPopupContainer:E,align:zt,arrow:Eu,arrowPos:Su,ready:Me,offsetX:Be,offsetY:qe,offsetR:it,offsetB:Ft,onAlign:Zt,stretch:z,targetWidth:Tt/nn,targetHeight:Qt/Xt})))});return t}const Qs=K1(Od);function X1(e,t){return e!==void 0?e:t?"bottomRight":"bottomLeft"}var Cn=d.createContext(null),Z1={bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:1,adjustY:1}},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:1,adjustY:1}},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:0,adjustY:1}},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:0,adjustY:1}}};function yf(e){var t=e.popupElement,n=e.popupStyle,r=e.popupClassName,o=e.popupAlign,a=e.transitionName,i=e.getPopupContainer,s=e.children,u=e.range,c=e.placement,f=e.builtinPlacements,l=f===void 0?Z1:f,h=e.direction,m=e.visible,y=e.onClose,w=d.useContext(Cn),v=w.prefixCls,p="".concat(v,"-dropdown"),g=X1(c,h==="rtl");return d.createElement(Qs,{showAction:[],hideAction:["click"],popupPlacement:g,builtinPlacements:l,prefixCls:p,popupTransitionName:a,popup:t,popupAlign:o,popupVisible:m,popupClassName:Xe(r,ce(ce({},"".concat(p,"-range"),u),"".concat(p,"-rtl"),h==="rtl")),popupStyle:n,stretch:"minWidth",getPopupContainer:i,onPopupVisibleChange:function(C){C||y()}},s)}function Js(e,t){for(var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"0",r=String(e);r.length<t;)r="".concat(n).concat(r);return r}function Mr(e){return e==null?[]:Array.isArray(e)?e:[e]}function Co(e,t,n){var r=wt(e);return r[t]=n,r}function Ya(e,t){var n={},r=t||Object.keys(e);return r.forEach(function(o){e[o]!==void 0&&(n[o]=e[o])}),n}function bf(e,t,n){if(n)return n;switch(e){case"time":return t.fieldTimeFormat;case"datetime":return t.fieldDateTimeFormat;case"month":return t.fieldMonthFormat;case"year":return t.fieldYearFormat;case"quarter":return t.fieldQuarterFormat;case"week":return t.fieldWeekFormat;default:return t.fieldDateFormat}}function wf(e,t,n){var r=n!==void 0?n:t[t.length-1],o=t.find(function(a){return e[a]});return r!==o?e[o]:void 0}function Cf(e){return Ya(e,["placement","builtinPlacements","popupAlign","getPopupContainer","transitionName","direction"])}function el(e,t,n,r){var o=d.useMemo(function(){return e||function(i,s){var u=i;return t&&s.type==="date"?t(u,s.today):n&&s.type==="month"?n(u,s.locale):s.originNode}},[e,n,t]),a=d.useCallback(function(i,s){return o(i,re(re({},s),{},{range:r}))},[o,r]);return a}function xf(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],r=d.useState([!1,!1]),o=X(r,2),a=o[0],i=o[1],s=function(f,l){i(function(h){return Co(h,l,f)})},u=d.useMemo(function(){return a.map(function(c,f){if(c)return!0;var l=e[f];return l?!!(!n[f]&&!l||l&&t(l,{activeIndex:f})):!1})},[e,a,t,n]);return[u,s]}function Sf(e,t,n,r,o){var a="",i=[];return e&&i.push(o?"hh":"HH"),t&&i.push("mm"),n&&i.push("ss"),a=i.join(":"),r&&(a+=".SSS"),o&&(a+=" A"),a}function Q1(e,t,n,r,o,a){var i=e.fieldDateTimeFormat,s=e.fieldDateFormat,u=e.fieldTimeFormat,c=e.fieldMonthFormat,f=e.fieldYearFormat,l=e.fieldWeekFormat,h=e.fieldQuarterFormat,m=e.yearFormat,y=e.cellYearFormat,w=e.cellQuarterFormat,v=e.dayFormat,p=e.cellDateFormat,g=Sf(t,n,r,o,a);return re(re({},e),{},{fieldDateTimeFormat:i||"YYYY-MM-DD ".concat(g),fieldDateFormat:s||"YYYY-MM-DD",fieldTimeFormat:u||g,fieldMonthFormat:c||"YYYY-MM",fieldYearFormat:f||"YYYY",fieldWeekFormat:l||"gggg-wo",fieldQuarterFormat:h||"YYYY-[Q]Q",yearFormat:m||"YYYY",cellYearFormat:y||"YYYY",cellQuarterFormat:w||"[Q]Q",cellDateFormat:p||v||"D"})}function Ef(e,t){var n=t.showHour,r=t.showMinute,o=t.showSecond,a=t.showMillisecond,i=t.use12Hours;return D.useMemo(function(){return Q1(e,n,r,o,a,i)},[e,n,r,o,a,i])}function xo(e,t,n){return n!=null?n:t.some(function(r){return e.includes(r)})}var J1=["showNow","showHour","showMinute","showSecond","showMillisecond","use12Hours","hourStep","minuteStep","secondStep","millisecondStep","hideDisabledOptions","defaultValue","disabledHours","disabledMinutes","disabledSeconds","disabledMilliseconds","disabledTime","changeOnScroll","defaultOpenValue"];function ew(e){var t=Ya(e,J1),n=e.format,r=e.picker,o=null;return n&&(o=n,Array.isArray(o)&&(o=o[0]),o=Ct(o)==="object"?o.format:o),r==="time"&&(t.format=o),[t,o]}function tw(e){return e&&typeof e=="string"}function Mf(e,t,n,r){return[e,t,n,r].some(function(o){return o!==void 0})}function Pf(e,t,n,r,o){var a=t,i=n,s=r;if(!e&&!a&&!i&&!s&&!o)a=!0,i=!0,s=!0;else if(e){var u,c,f,l=[a,i,s].some(function(y){return y===!1}),h=[a,i,s].some(function(y){return y===!0}),m=l?!0:!h;a=(u=a)!==null&&u!==void 0?u:m,i=(c=i)!==null&&c!==void 0?c:m,s=(f=s)!==null&&f!==void 0?f:m}return[a,i,s,o]}function Df(e){var t=e.showTime,n=ew(e),r=X(n,2),o=r[0],a=r[1],i=t&&Ct(t)==="object"?t:{},s=re(re({defaultOpenValue:i.defaultOpenValue||i.defaultValue},o),i),u=s.showMillisecond,c=s.showHour,f=s.showMinute,l=s.showSecond,h=Mf(c,f,l,u),m=Pf(h,c,f,l,u),y=X(m,3);return c=y[0],f=y[1],l=y[2],[s,re(re({},s),{},{showHour:c,showMinute:f,showSecond:l,showMillisecond:u}),s.format,a]}function kf(e,t,n,r,o){var a=e==="time";if(e==="datetime"||a){for(var i=r,s=bf(e,o,null),u=s,c=[t,n],f=0;f<c.length;f+=1){var l=Mr(c[f])[0];if(tw(l)){u=l;break}}var h=i.showHour,m=i.showMinute,y=i.showSecond,w=i.showMillisecond,v=i.use12Hours,p=xo(u,["a","A","LT","LLL","LTS"],v),g=Mf(h,m,y,w);g||(h=xo(u,["H","h","k","LT","LLL"]),m=xo(u,["m","LT","LLL"]),y=xo(u,["s","LTS"]),w=xo(u,["SSS"]));var b=Pf(g,h,m,y,w),C=X(b,3);h=C[0],m=C[1],y=C[2];var x=t||Sf(h,m,y,w,p);return re(re({},i),{},{format:x,showHour:h,showMinute:m,showSecond:y,showMillisecond:w,use12Hours:p})}return null}function nw(e,t,n){if(t===!1)return null;var r=t&&Ct(t)==="object"?t:{};return r.clearIcon||n||d.createElement("span",{className:"".concat(e,"-clear-btn")})}var tl=7;function ar(e,t,n){return!e&&!t||e===t?!0:!e||!t?!1:n()}function nl(e,t,n){return ar(t,n,function(){var r=Math.floor(e.getYear(t)/10),o=Math.floor(e.getYear(n)/10);return r===o})}function Pr(e,t,n){return ar(t,n,function(){return e.getYear(t)===e.getYear(n)})}function _f(e,t){var n=Math.floor(e.getMonth(t)/3);return n+1}function rw(e,t,n){return ar(t,n,function(){return Pr(e,t,n)&&_f(e,t)===_f(e,n)})}function rl(e,t,n){return ar(t,n,function(){return Pr(e,t,n)&&e.getMonth(t)===e.getMonth(n)})}function ol(e,t,n){return ar(t,n,function(){return Pr(e,t,n)&&rl(e,t,n)&&e.getDate(t)===e.getDate(n)})}function Nf(e,t,n){return ar(t,n,function(){return e.getHour(t)===e.getHour(n)&&e.getMinute(t)===e.getMinute(n)&&e.getSecond(t)===e.getSecond(n)})}function Of(e,t,n){return ar(t,n,function(){return ol(e,t,n)&&Nf(e,t,n)&&e.getMillisecond(t)===e.getMillisecond(n)})}function So(e,t,n,r){return ar(n,r,function(){var o=e.locale.getWeekFirstDate(t,n),a=e.locale.getWeekFirstDate(t,r);return Pr(e,o,a)&&e.locale.getWeek(t,n)===e.locale.getWeek(t,r)})}function Ut(e,t,n,r,o){switch(o){case"date":return ol(e,n,r);case"week":return So(e,t.locale,n,r);case"month":return rl(e,n,r);case"quarter":return rw(e,n,r);case"year":return Pr(e,n,r);case"decade":return nl(e,n,r);case"time":return Nf(e,n,r);default:return Of(e,n,r)}}function Ua(e,t,n,r){return!t||!n||!r?!1:e.isAfter(r,t)&&e.isAfter(n,r)}function qa(e,t,n,r,o){return Ut(e,t,n,r,o)?!0:e.isAfter(n,r)}function ow(e,t,n){var r=t.locale.getWeekFirstDay(e),o=t.setDate(n,1),a=t.getWeekDay(o),i=t.addDate(o,r-a);return t.getMonth(i)===t.getMonth(n)&&t.getDate(i)>1&&(i=t.addDate(i,-7)),i}function $t(e,t){var n=t.generateConfig,r=t.locale,o=t.format;return e?typeof o=="function"?o(e):n.locale.format(r.locale,e,o):""}function Ga(e,t,n){var r=t,o=["getHour","getMinute","getSecond","getMillisecond"],a=["setHour","setMinute","setSecond","setMillisecond"];return a.forEach(function(i,s){n?r=e[i](r,e[o[s]](n)):r=e[i](r,0)}),r}function aw(e,t,n,r,o){var a=ct(function(i,s){return!!(n&&n(i,s)||r&&e.isAfter(r,i)&&!Ut(e,t,r,i,s.type)||o&&e.isAfter(i,o)&&!Ut(e,t,o,i,s.type))});return a}function iw(e,t,n){return d.useMemo(function(){var r=bf(e,t,n),o=Mr(r),a=o[0],i=Ct(a)==="object"&&a.type==="mask"?a.format:null;return[o.map(function(s){return typeof s=="string"||typeof s=="function"?s:s.format}),i]},[e,t,n])}function sw(e,t,n){return typeof e[0]=="function"||n?!0:t}function lw(e,t,n,r){var o=ct(function(a,i){var s=re({type:t},i);if(delete s.activeIndex,!e.isValidate(a)||n&&n(a,s))return!0;if((t==="date"||t==="time")&&r){var u,c=i&&i.activeIndex===1?"end":"start",f=((u=r.disabledTime)===null||u===void 0?void 0:u.call(r,a,c,{from:s.from}))||{},l=f.disabledHours,h=f.disabledMinutes,m=f.disabledSeconds,y=f.disabledMilliseconds,w=r.disabledHours,v=r.disabledMinutes,p=r.disabledSeconds,g=l||w,b=h||v,C=m||p,x=e.getHour(a),S=e.getMinute(a),E=e.getSecond(a),M=e.getMillisecond(a);if(g&&g().includes(x)||b&&b(x).includes(S)||C&&C(x,S).includes(E)||y&&y(x,S,E).includes(M))return!0}return!1});return o}function Ka(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=d.useMemo(function(){var r=e&&Mr(e);return t&&r&&(r[1]=r[1]||r[0]),r},[e,t]);return n}function Tf(e,t){var n=e.generateConfig,r=e.locale,o=e.picker,a=o===void 0?"date":o,i=e.prefixCls,s=i===void 0?"rc-picker":i,u=e.styles,c=u===void 0?{}:u,f=e.classNames,l=f===void 0?{}:f,h=e.order,m=h===void 0?!0:h,y=e.components,w=y===void 0?{}:y,v=e.inputRender,p=e.allowClear,g=e.clearIcon,b=e.needConfirm,C=e.multiple,x=e.format,S=e.inputReadOnly,E=e.disabledDate,M=e.minDate,k=e.maxDate,T=e.showTime,R=e.value,F=e.defaultValue,V=e.pickerValue,$=e.defaultPickerValue,L=Ka(R),N=Ka(F),H=Ka(V),_=Ka($),z=a==="date"&&T?"datetime":a,B=z==="time"||z==="datetime",A=B||C,j=b!=null?b:B,Y=Df(e),U=X(Y,4),ne=U[0],te=U[1],J=U[2],G=U[3],q=Ef(r,te),Z=d.useMemo(function(){return kf(z,J,G,ne,q)},[z,J,G,ne,q]),O=d.useMemo(function(){return re(re({},e),{},{prefixCls:s,locale:q,picker:a,styles:c,classNames:l,order:m,components:re({input:v},w),clearIcon:nw(s,p,g),showTime:Z,value:L,defaultValue:N,pickerValue:H,defaultPickerValue:_},t==null?void 0:t())},[e]),I=iw(z,q,x),W=X(I,2),K=W[0],oe=W[1],Q=sw(K,S,C),ae=aw(n,r,E,M,k),ee=lw(n,a,ae,Z),ie=d.useMemo(function(){return re(re({},O),{},{needConfirm:j,inputReadOnly:Q,disabledDate:ae})},[O,j,Q,ae]);return[ie,z,A,K,oe,ee]}function uw(e,t,n){var r=ln(t,{value:e}),o=X(r,2),a=o[0],i=o[1],s=D.useRef(e),u=D.useRef(),c=function(){mt.cancel(u.current)},f=ct(function(){i(s.current),n&&a!==s.current&&n(s.current)}),l=ct(function(h,m){c(),s.current=h,h||m?f():u.current=mt(f)});return D.useEffect(function(){return c},[]),[a,l]}function If(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],r=arguments.length>3?arguments[3]:void 0,o=n.every(function(f){return f})?!1:e,a=uw(o,t||!1,r),i=X(a,2),s=i[0],u=i[1];function c(f){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};(!l.inherit||s)&&u(f,l.force)}return[s,c]}function Rf(e){var t=d.useRef();return d.useImperativeHandle(e,function(){var n;return{nativeElement:(n=t.current)===null||n===void 0?void 0:n.nativeElement,focus:function(o){var a;(a=t.current)===null||a===void 0||a.focus(o)},blur:function(){var o;(o=t.current)===null||o===void 0||o.blur()}}}),t}function Af(e,t){return d.useMemo(function(){return e||(t?(Er(!1,"`ranges` is deprecated. Please use `presets` instead."),Object.entries(t).map(function(n){var r=X(n,2),o=r[0],a=r[1];return{label:o,value:a}})):[])},[e,t])}function al(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,r=d.useRef(t);r.current=t,Ps(function(){if(e)r.current(e);else{var o=mt(function(){r.current(e)},n);return function(){mt.cancel(o)}}},[e])}function Lf(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,r=d.useState(0),o=X(r,2),a=o[0],i=o[1],s=d.useState(!1),u=X(s,2),c=u[0],f=u[1],l=d.useRef([]),h=d.useRef(null),m=d.useRef(null),y=function(C){h.current=C},w=function(C){return h.current===C},v=function(C){f(C)},p=function(C){return C&&(m.current=C),m.current},g=function(C){var x=l.current,S=new Set(x.filter(function(M){return C[M]||t[M]})),E=x[x.length-1]===0?1:0;return S.size>=2||e[E]?null:E};return al(c||n,function(){c||(l.current=[],y(null))}),d.useEffect(function(){c&&l.current.push(a)},[c,a]),[c,v,p,a,i,g,l.current,y,w]}function cw(e,t,n,r,o,a){var i=n[n.length-1],s=function(c,f){var l=X(e,2),h=l[0],m=l[1],y=re(re({},f),{},{from:wf(e,n)});return i===1&&t[0]&&h&&!Ut(r,o,h,c,y.type)&&r.isAfter(h,c)||i===0&&t[1]&&m&&!Ut(r,o,m,c,y.type)&&r.isAfter(c,m)?!0:a==null?void 0:a(c,y)};return s}function Eo(e,t,n,r){switch(t){case"date":case"week":return e.addMonth(n,r);case"month":case"quarter":return e.addYear(n,r);case"year":return e.addYear(n,r*10);case"decade":return e.addYear(n,r*100);default:return n}}var il=[];function $f(e,t,n,r,o,a,i,s){var u=arguments.length>8&&arguments[8]!==void 0?arguments[8]:il,c=arguments.length>9&&arguments[9]!==void 0?arguments[9]:il,f=arguments.length>10&&arguments[10]!==void 0?arguments[10]:il,l=arguments.length>11?arguments[11]:void 0,h=arguments.length>12?arguments[12]:void 0,m=arguments.length>13?arguments[13]:void 0,y=i==="time",w=a||0,v=function(H){var _=e.getNow();return y&&(_=Ga(e,_)),u[H]||n[H]||_},p=X(c,2),g=p[0],b=p[1],C=ln(function(){return v(0)},{value:g}),x=X(C,2),S=x[0],E=x[1],M=ln(function(){return v(1)},{value:b}),k=X(M,2),T=k[0],R=k[1],F=d.useMemo(function(){var N=[S,T][w];return y?N:Ga(e,N,f[w])},[y,S,T,w,e,f]),V=function(H){var _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"panel",z=[E,R][w];z(H);var B=[S,T];B[w]=H,l&&(!Ut(e,t,S,B[0],i)||!Ut(e,t,T,B[1],i))&&l(B,{source:_,range:w===1?"end":"start",mode:r})},$=function(H,_){if(s){var z={date:"month",week:"month",month:"year",quarter:"year"},B=z[i];if(B&&!Ut(e,t,H,_,B))return Eo(e,i,_,-1);if(i==="year"&&H){var A=Math.floor(e.getYear(H)/10),j=Math.floor(e.getYear(_)/10);if(A!==j)return Eo(e,i,_,-1)}}return _},L=d.useRef(null);return ht(function(){if(o&&!u[w]){var N=y?null:e.getNow();if(L.current!==null&&L.current!==w?N=[S,T][w^1]:n[w]?N=w===0?n[0]:$(n[0],n[1]):n[w^1]&&(N=n[w^1]),N){h&&e.isAfter(h,N)&&(N=h);var H=s?Eo(e,i,N,1):N;m&&e.isAfter(H,m)&&(N=s?Eo(e,i,m,-1):m),V(N,"reset")}}},[o,w,n[w]]),d.useEffect(function(){o?L.current=w:L.current=null},[o,w]),ht(function(){o&&u&&u[w]&&V(u[w],"reset")},[o,w]),[F,V]}function Ff(e,t){var n=d.useRef(e),r=d.useState({}),o=X(r,2),a=o[1],i=function(c){return c&&t!==void 0?t:n.current},s=function(c){n.current=c,a({})};return[i,s,i(!0)]}var dw=[];function zf(e,t,n){var r=function(i){return i.map(function(s){return $t(s,{generateConfig:e,locale:t,format:n[0]})})},o=function(i,s){for(var u=Math.max(i.length,s.length),c=-1,f=0;f<u;f+=1){var l=i[f]||null,h=s[f]||null;if(l!==h&&!Of(e,l,h)){c=f;break}}return[c<0,c!==0]};return[r,o]}function Hf(e,t){return wt(e).sort(function(n,r){return t.isAfter(n,r)?1:-1})}function fw(e){var t=Ff(e),n=X(t,2),r=n[0],o=n[1],a=ct(function(){o(e)});return d.useEffect(function(){a()},[e]),[r,o]}function Vf(e,t,n,r,o,a,i,s,u){var c=ln(a,{value:i}),f=X(c,2),l=f[0],h=f[1],m=l||dw,y=fw(m),w=X(y,2),v=w[0],p=w[1],g=zf(e,t,n),b=X(g,2),C=b[0],x=b[1],S=ct(function(M){var k=wt(M);if(r)for(var T=0;T<2;T+=1)k[T]=k[T]||null;else o&&(k=Hf(k.filter(function(N){return N}),e));var R=x(v(),k),F=X(R,2),V=F[0],$=F[1];if(!V&&(p(k),s)){var L=C(k);s(k,L,{range:$?"end":"start"})}}),E=function(){u&&u(v())};return[m,h,v,S,E]}function Wf(e,t,n,r,o,a,i,s,u,c){var f=e.generateConfig,l=e.locale,h=e.picker,m=e.onChange,y=e.allowEmpty,w=e.order,v=a.some(function(V){return V})?!1:w,p=zf(f,l,i),g=X(p,2),b=g[0],C=g[1],x=Ff(t),S=X(x,2),E=S[0],M=S[1],k=ct(function(){M(t)});d.useEffect(function(){k()},[t]);var T=ct(function(V){var $=V===null,L=wt(V||E());if($)for(var N=Math.max(a.length,L.length),H=0;H<N;H+=1)a[H]||(L[H]=null);v&&L[0]&&L[1]&&(L=Hf(L,f)),o(L);var _=L,z=X(_,2),B=z[0],A=z[1],j=!B,Y=!A,U=y?(!j||y[0])&&(!Y||y[1]):!0,ne=!w||j||Y||Ut(f,l,B,A,h)||f.isAfter(A,B),te=(a[0]||!B||!c(B,{activeIndex:0}))&&(a[1]||!A||!c(A,{from:B,activeIndex:1})),J=$||U&&ne&&te;if(J){n(L);var G=C(L,t),q=X(G,1),Z=q[0];m&&!Z&&m($&&L.every(function(O){return!O})?null:L,b(L))}return J}),R=ct(function(V,$){var L=Co(E(),V,r()[V]);M(L),$&&T()}),F=!s&&!u;return al(!F,function(){F&&(T(),o(t),k())},2),[R,T]}function Bf(e,t,n,r,o){return t!=="date"&&t!=="time"?!1:n!==void 0?n:r!==void 0?r:!o&&(e==="date"||e==="time")}function vw(e,t,n,r,o,a){var i=e;function s(l,h,m){var y=a[l](i),w=m.find(function(b){return b.value===y});if(!w||w.disabled){var v=m.filter(function(b){return!b.disabled}),p=wt(v).reverse(),g=p.find(function(b){return b.value<=y})||v[0];g&&(y=g.value,i=a[h](i,y))}return y}var u=s("getHour","setHour",t()),c=s("getMinute","setMinute",n(u)),f=s("getSecond","setSecond",r(u,c));return s("getMillisecond","setMillisecond",o(u,c,f)),i}function Xa(){return[]}function Za(e,t){for(var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:[],a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:2,i=[],s=n>=1?n|0:1,u=e;u<=t;u+=s){var c=o.includes(u);(!c||!r)&&i.push({label:Js(u,a),value:u,disabled:c})}return i}function sl(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=t||{},o=r.use12Hours,a=r.hourStep,i=a===void 0?1:a,s=r.minuteStep,u=s===void 0?1:s,c=r.secondStep,f=c===void 0?1:c,l=r.millisecondStep,h=l===void 0?100:l,m=r.hideDisabledOptions,y=r.disabledTime,w=r.disabledHours,v=r.disabledMinutes,p=r.disabledSeconds,g=d.useMemo(function(){return n||e.getNow()},[n,e]),b=d.useCallback(function(_){var z=(y==null?void 0:y(_))||{};return[z.disabledHours||w||Xa,z.disabledMinutes||v||Xa,z.disabledSeconds||p||Xa,z.disabledMilliseconds||Xa]},[y,w,v,p]),C=d.useMemo(function(){return b(g)},[g,b]),x=X(C,4),S=x[0],E=x[1],M=x[2],k=x[3],T=d.useCallback(function(_,z,B,A){var j=Za(0,23,i,m,_()),Y=o?j.map(function(J){return re(re({},J),{},{label:Js(J.value%12||12,2)})}):j,U=function(G){return Za(0,59,u,m,z(G))},ne=function(G,q){return Za(0,59,f,m,B(G,q))},te=function(G,q,Z){return Za(0,999,h,m,A(G,q,Z),3)};return[Y,U,ne,te]},[m,i,o,h,u,f]),R=d.useMemo(function(){return T(S,E,M,k)},[T,S,E,M,k]),F=X(R,4),V=F[0],$=F[1],L=F[2],N=F[3],H=function(z,B){var A=function(){return V},j=$,Y=L,U=N;if(B){var ne=b(B),te=X(ne,4),J=te[0],G=te[1],q=te[2],Z=te[3],O=T(J,G,q,Z),I=X(O,4),W=I[0],K=I[1],oe=I[2],Q=I[3];A=function(){return W},j=K,Y=oe,U=Q}var ae=vw(z,A,j,Y,U,e);return ae};return[H,V,$,L,N]}function mw(e){var t=e.mode,n=e.internalMode,r=e.renderExtraFooter,o=e.showNow,a=e.showTime,i=e.onSubmit,s=e.onNow,u=e.invalid,c=e.needConfirm,f=e.generateConfig,l=e.disabledDate,h=d.useContext(Cn),m=h.prefixCls,y=h.locale,w=h.button,v=w===void 0?"button":w,p=f.getNow(),g=sl(f,a,p),b=X(g,1),C=b[0],x=r==null?void 0:r(t),S=l(p,{type:t}),E=function(){if(!S){var $=C(p);s($)}},M="".concat(m,"-now"),k="".concat(M,"-btn"),T=o&&d.createElement("li",{className:M},d.createElement("a",{className:Xe(k,S&&"".concat(k,"-disabled")),"aria-disabled":S,onClick:E},n==="date"?y.today:y.now)),R=c&&d.createElement("li",{className:"".concat(m,"-ok")},d.createElement(v,{disabled:u,onClick:i},y.ok)),F=(T||R)&&d.createElement("ul",{className:"".concat(m,"-ranges")},T,R);return!x&&!F?null:d.createElement("div",{className:"".concat(m,"-footer")},x&&d.createElement("div",{className:"".concat(m,"-footer-extra")},x),F)}function jf(e,t,n){function r(o,a){var i=o.findIndex(function(u){return Ut(e,t,u,a,n)});if(i===-1)return[].concat(wt(o),[a]);var s=wt(o);return s.splice(i,1),s}return r}var Dr=d.createContext(null);function Qa(){return d.useContext(Dr)}function Qr(e,t){var n=e.prefixCls,r=e.generateConfig,o=e.locale,a=e.disabledDate,i=e.minDate,s=e.maxDate,u=e.cellRender,c=e.hoverValue,f=e.hoverRangeValue,l=e.onHover,h=e.values,m=e.pickerValue,y=e.onSelect,w=e.prevIcon,v=e.nextIcon,p=e.superPrevIcon,g=e.superNextIcon,b=r.getNow(),C={now:b,values:h,pickerValue:m,prefixCls:n,disabledDate:a,minDate:i,maxDate:s,cellRender:u,hoverValue:c,hoverRangeValue:f,onHover:l,locale:o,generateConfig:r,onSelect:y,panelType:t,prevIcon:w,nextIcon:v,superPrevIcon:p,superNextIcon:g};return[C,b]}var ir=d.createContext({});function Mo(e){for(var t=e.rowNum,n=e.colNum,r=e.baseDate,o=e.getCellDate,a=e.prefixColumn,i=e.rowClassName,s=e.titleFormat,u=e.getCellText,c=e.getCellClassName,f=e.headerCells,l=e.cellSelection,h=l===void 0?!0:l,m=e.disabledDate,y=Qa(),w=y.prefixCls,v=y.panelType,p=y.now,g=y.disabledDate,b=y.cellRender,C=y.onHover,x=y.hoverValue,S=y.hoverRangeValue,E=y.generateConfig,M=y.values,k=y.locale,T=y.onSelect,R=m||g,F="".concat(w,"-cell"),V=d.useContext(ir),$=V.onCellDblClick,L=function(Y){return M.some(function(U){return U&&Ut(E,k,Y,U,v)})},N=[],H=0;H<t;H+=1){for(var _=[],z=void 0,B=function(){var Y=H*n+A,U=o(r,Y),ne=R==null?void 0:R(U,{type:v});A===0&&(z=U,a&&_.push(a(z)));var te=!1,J=!1,G=!1;if(h&&S){var q=X(S,2),Z=q[0],O=q[1];te=Ua(E,Z,O,U),J=Ut(E,k,U,Z,v),G=Ut(E,k,U,O,v)}var I=s?$t(U,{locale:k,format:s,generateConfig:E}):void 0,W=d.createElement("div",{className:"".concat(F,"-inner")},u(U));_.push(d.createElement("td",{key:A,title:I,className:Xe(F,re(ce(ce(ce(ce(ce(ce({},"".concat(F,"-disabled"),ne),"".concat(F,"-hover"),(x||[]).some(function(K){return Ut(E,k,U,K,v)})),"".concat(F,"-in-range"),te&&!J&&!G),"".concat(F,"-range-start"),J),"".concat(F,"-range-end"),G),"".concat(w,"-cell-selected"),!S&&v!=="week"&&L(U)),c(U))),onClick:function(){ne||T(U)},onDoubleClick:function(){!ne&&$&&$()},onMouseEnter:function(){ne||C==null||C(U)},onMouseLeave:function(){ne||C==null||C(null)}},b?b(U,{prefixCls:w,originNode:W,today:p,type:v,locale:k}):W))},A=0;A<n;A+=1)B();N.push(d.createElement("tr",{key:H,className:i==null?void 0:i(z)},_))}return d.createElement("div",{className:"".concat(w,"-body")},d.createElement("table",{className:"".concat(w,"-content")},f&&d.createElement("thead",null,d.createElement("tr",null,f)),d.createElement("tbody",null,N)))}var Ja={visibility:"hidden"};function Jr(e){var t=e.offset,n=e.superOffset,r=e.onChange,o=e.getStart,a=e.getEnd,i=e.children,s=Qa(),u=s.prefixCls,c=s.prevIcon,f=c===void 0?"‹":c,l=s.nextIcon,h=l===void 0?"›":l,m=s.superPrevIcon,y=m===void 0?"«":m,w=s.superNextIcon,v=w===void 0?"»":w,p=s.minDate,g=s.maxDate,b=s.generateConfig,C=s.locale,x=s.pickerValue,S=s.panelType,E="".concat(u,"-header"),M=d.useContext(ir),k=M.hidePrev,T=M.hideNext,R=M.hideHeader,F=d.useMemo(function(){if(!p||!t||!a)return!1;var j=a(t(-1,x));return!qa(b,C,j,p,S)},[p,t,x,a,b,C,S]),V=d.useMemo(function(){if(!p||!n||!a)return!1;var j=a(n(-1,x));return!qa(b,C,j,p,S)},[p,n,x,a,b,C,S]),$=d.useMemo(function(){if(!g||!t||!o)return!1;var j=o(t(1,x));return!qa(b,C,g,j,S)},[g,t,x,o,b,C,S]),L=d.useMemo(function(){if(!g||!n||!o)return!1;var j=o(n(1,x));return!qa(b,C,g,j,S)},[g,n,x,o,b,C,S]),N=function(Y){t&&r(t(Y,x))},H=function(Y){n&&r(n(Y,x))};if(R)return null;var _="".concat(E,"-prev-btn"),z="".concat(E,"-next-btn"),B="".concat(E,"-super-prev-btn"),A="".concat(E,"-super-next-btn");return d.createElement("div",{className:E},n&&d.createElement("button",{type:"button","aria-label":C.previousYear,onClick:function(){return H(-1)},tabIndex:-1,className:Xe(B,V&&"".concat(B,"-disabled")),disabled:V,style:k?Ja:{}},y),t&&d.createElement("button",{type:"button","aria-label":C.previousMonth,onClick:function(){return N(-1)},tabIndex:-1,className:Xe(_,F&&"".concat(_,"-disabled")),disabled:F,style:k?Ja:{}},f),d.createElement("div",{className:"".concat(E,"-view")},i),t&&d.createElement("button",{type:"button","aria-label":C.nextMonth,onClick:function(){return N(1)},tabIndex:-1,className:Xe(z,$&&"".concat(z,"-disabled")),disabled:$,style:T?Ja:{}},h),n&&d.createElement("button",{type:"button","aria-label":C.nextYear,onClick:function(){return H(1)},tabIndex:-1,className:Xe(A,L&&"".concat(A,"-disabled")),disabled:L,style:T?Ja:{}},v))}function ei(e){var t=e.prefixCls,n=e.panelName,r=n===void 0?"date":n,o=e.locale,a=e.generateConfig,i=e.pickerValue,s=e.onPickerValueChange,u=e.onModeChange,c=e.mode,f=c===void 0?"date":c,l=e.disabledDate,h=e.onSelect,m=e.onHover,y=e.showWeek,w="".concat(t,"-").concat(r,"-panel"),v="".concat(t,"-cell"),p=f==="week",g=Qr(e,f),b=X(g,2),C=b[0],x=b[1],S=a.locale.getWeekFirstDay(o.locale),E=a.setDate(i,1),M=ow(o.locale,a,E),k=a.getMonth(i),T=y===void 0?p:y,R=T?function(j){var Y=l==null?void 0:l(j,{type:"week"});return d.createElement("td",{key:"week",className:Xe(v,"".concat(v,"-week"),ce({},"".concat(v,"-disabled"),Y)),onClick:function(){Y||h(j)},onMouseEnter:function(){Y||m==null||m(j)},onMouseLeave:function(){Y||m==null||m(null)}},d.createElement("div",{className:"".concat(v,"-inner")},a.locale.getWeek(o.locale,j)))}:null,F=[],V=o.shortWeekDays||(a.locale.getShortWeekDays?a.locale.getShortWeekDays(o.locale):[]);R&&F.push(d.createElement("th",{key:"empty"},d.createElement("span",{style:{width:0,height:0,position:"absolute",overflow:"hidden",opacity:0}},o.week)));for(var $=0;$<tl;$+=1)F.push(d.createElement("th",{key:$},V[($+S)%tl]));var L=function(Y,U){return a.addDate(Y,U)},N=function(Y){return $t(Y,{locale:o,format:o.cellDateFormat,generateConfig:a})},H=function(Y){var U=ce(ce({},"".concat(t,"-cell-in-view"),rl(a,Y,i)),"".concat(t,"-cell-today"),ol(a,Y,x));return U},_=o.shortMonths||(a.locale.getShortMonths?a.locale.getShortMonths(o.locale):[]),z=d.createElement("button",{type:"button","aria-label":o.yearSelect,key:"year",onClick:function(){u("year",i)},tabIndex:-1,className:"".concat(t,"-year-btn")},$t(i,{locale:o,format:o.yearFormat,generateConfig:a})),B=d.createElement("button",{type:"button","aria-label":o.monthSelect,key:"month",onClick:function(){u("month",i)},tabIndex:-1,className:"".concat(t,"-month-btn")},o.monthFormat?$t(i,{locale:o,format:o.monthFormat,generateConfig:a}):_[k]),A=o.monthBeforeYear?[B,z]:[z,B];return d.createElement(Dr.Provider,{value:C},d.createElement("div",{className:Xe(w,y&&"".concat(w,"-show-week"))},d.createElement(Jr,{offset:function(Y){return a.addMonth(i,Y)},superOffset:function(Y){return a.addYear(i,Y)},onChange:s,getStart:function(Y){return a.setDate(Y,1)},getEnd:function(Y){var U=a.setDate(Y,1);return U=a.addMonth(U,1),a.addDate(U,-1)}},A),d.createElement(Mo,Ne({titleFormat:o.fieldDateFormat},e,{colNum:tl,rowNum:6,baseDate:M,headerCells:F,getCellDate:L,getCellText:N,getCellClassName:H,prefixColumn:R,cellSelection:!p}))))}var hw=1/3;function pw(e,t){var n=d.useRef(!1),r=d.useRef(null),o=d.useRef(null),a=function(){return n.current},i=function(){mt.cancel(r.current),n.current=!1},s=d.useRef(),u=function(){var l=e.current;if(o.current=null,s.current=0,l){var h=l.querySelector('[data-value="'.concat(t,'"]')),m=l.querySelector("li"),y=function w(){i(),n.current=!0,s.current+=1;var v=l.scrollTop,p=m.offsetTop,g=h.offsetTop,b=g-p;if(g===0&&h!==m||!Xs(l)){s.current<=5&&(r.current=mt(w));return}var C=v+(b-v)*hw,x=Math.abs(b-C);if(o.current!==null&&o.current<x){i();return}if(o.current=x,x<=1){l.scrollTop=b,i();return}l.scrollTop=C,r.current=mt(w)};h&&m&&y()}},c=ct(u);return[c,i,a]}var gw=300;function yw(e){return e.map(function(t){var n=t.value,r=t.label,o=t.disabled;return[n,r,o].join(",")}).join(";")}function Po(e){var t=e.units,n=e.value,r=e.optionalValue,o=e.type,a=e.onChange,i=e.onHover,s=e.onDblClick,u=e.changeOnScroll,c=Qa(),f=c.prefixCls,l=c.cellRender,h=c.now,m=c.locale,y="".concat(f,"-time-panel"),w="".concat(f,"-time-panel-cell"),v=d.useRef(null),p=d.useRef(),g=function(){clearTimeout(p.current)},b=pw(v,n!=null?n:r),C=X(b,3),x=C[0],S=C[1],E=C[2];ht(function(){return x(),g(),function(){S(),g()}},[n,r,yw(t)]);var M=function(R){g();var F=R.target;!E()&&u&&(p.current=setTimeout(function(){var V=v.current,$=V.querySelector("li").offsetTop,L=Array.from(V.querySelectorAll("li")),N=L.map(function(A){return A.offsetTop-$}),H=N.map(function(A,j){return t[j].disabled?Number.MAX_SAFE_INTEGER:Math.abs(A-F.scrollTop)}),_=Math.min.apply(Math,wt(H)),z=H.findIndex(function(A){return A===_}),B=t[z];B&&!B.disabled&&a(B.value)},gw))},k="".concat(y,"-column");return d.createElement("ul",{className:k,ref:v,"data-type":o,onScroll:M},t.map(function(T){var R=T.label,F=T.value,V=T.disabled,$=d.createElement("div",{className:"".concat(w,"-inner")},R);return d.createElement("li",{key:F,className:Xe(w,ce(ce({},"".concat(w,"-selected"),n===F),"".concat(w,"-disabled"),V)),onClick:function(){V||a(F)},onDoubleClick:function(){!V&&s&&s()},onMouseEnter:function(){i(F)},onMouseLeave:function(){i(null)},"data-value":F},l?l(F,{prefixCls:f,originNode:$,today:h,type:"time",subType:o,locale:m}):$)}))}function sr(e){return e<12}function bw(e){var t=e.showHour,n=e.showMinute,r=e.showSecond,o=e.showMillisecond,a=e.use12Hours,i=e.changeOnScroll,s=Qa(),u=s.prefixCls,c=s.values,f=s.generateConfig,l=s.locale,h=s.onSelect,m=s.onHover,y=m===void 0?function(){}:m,w=s.pickerValue,v=(c==null?void 0:c[0])||null,p=d.useContext(ir),g=p.onCellDblClick,b=sl(f,e,v),C=X(b,5),x=C[0],S=C[1],E=C[2],M=C[3],k=C[4],T=function(he){var Ue=v&&f[he](v),Je=w&&f[he](w);return[Ue,Je]},R=T("getHour"),F=X(R,2),V=F[0],$=F[1],L=T("getMinute"),N=X(L,2),H=N[0],_=N[1],z=T("getSecond"),B=X(z,2),A=B[0],j=B[1],Y=T("getMillisecond"),U=X(Y,2),ne=U[0],te=U[1],J=V===null?null:sr(V)?"am":"pm",G=d.useMemo(function(){return a?sr(V)?S.filter(function(ue){return sr(ue.value)}):S.filter(function(ue){return!sr(ue.value)}):S},[V,S,a]),q=function(he,Ue){var Je,nt=he.filter(function(yt){return!yt.disabled});return Ue!=null?Ue:nt==null||(Je=nt[0])===null||Je===void 0?void 0:Je.value},Z=q(S,V),O=d.useMemo(function(){return E(Z)},[E,Z]),I=q(O,H),W=d.useMemo(function(){return M(Z,I)},[M,Z,I]),K=q(W,A),oe=d.useMemo(function(){return k(Z,I,K)},[k,Z,I,K]),Q=q(oe,ne),ae=d.useMemo(function(){if(!a)return[];var ue=f.getNow(),he=f.setHour(ue,6),Ue=f.setHour(ue,18),Je=function(yt,tt){var be=l.cellMeridiemFormat;return be?$t(yt,{generateConfig:f,locale:l,format:be}):tt};return[{label:Je(he,"AM"),value:"am",disabled:S.every(function(nt){return nt.disabled||!sr(nt.value)})},{label:Je(Ue,"PM"),value:"pm",disabled:S.every(function(nt){return nt.disabled||sr(nt.value)})}]},[S,a,f,l]),ee=function(he){var Ue=x(he);h(Ue)},ie=d.useMemo(function(){var ue=v||w||f.getNow(),he=function(Je){return Je!=null};return he(V)?(ue=f.setHour(ue,V),ue=f.setMinute(ue,H),ue=f.setSecond(ue,A),ue=f.setMillisecond(ue,ne)):he($)?(ue=f.setHour(ue,$),ue=f.setMinute(ue,_),ue=f.setSecond(ue,j),ue=f.setMillisecond(ue,te)):he(Z)&&(ue=f.setHour(ue,Z),ue=f.setMinute(ue,I),ue=f.setSecond(ue,K),ue=f.setMillisecond(ue,Q)),ue},[v,w,V,H,A,ne,Z,I,K,Q,$,_,j,te,f]),ve=function(he,Ue){return he===null?null:f[Ue](ie,he)},ye=function(he){return ve(he,"setHour")},de=function(he){return ve(he,"setMinute")},se=function(he){return ve(he,"setSecond")},He=function(he){return ve(he,"setMillisecond")},Le=function(he){return he===null?null:he==="am"&&!sr(V)?f.setHour(ie,V-12):he==="pm"&&sr(V)?f.setHour(ie,V+12):ie},ge=function(he){ee(ye(he))},Ye=function(he){ee(de(he))},Fe=function(he){ee(se(he))},ze=function(he){ee(He(he))},Ge=function(he){ee(Le(he))},Ke=function(he){y(ye(he))},Ee=function(he){y(de(he))},$e=function(he){y(se(he))},le=function(he){y(He(he))},fe=function(he){y(Le(he))},Pe={onDblClick:g,changeOnScroll:i};return d.createElement("div",{className:"".concat(u,"-content")},t&&d.createElement(Po,Ne({units:G,value:V,optionalValue:$,type:"hour",onChange:ge,onHover:Ke},Pe)),n&&d.createElement(Po,Ne({units:O,value:H,optionalValue:_,type:"minute",onChange:Ye,onHover:Ee},Pe)),r&&d.createElement(Po,Ne({units:W,value:A,optionalValue:j,type:"second",onChange:Fe,onHover:$e},Pe)),o&&d.createElement(Po,Ne({units:oe,value:ne,optionalValue:te,type:"millisecond",onChange:ze,onHover:le},Pe)),a&&d.createElement(Po,Ne({units:ae,value:J,type:"meridiem",onChange:Ge,onHover:fe},Pe)))}function Yf(e){var t=e.prefixCls,n=e.value,r=e.locale,o=e.generateConfig,a=e.showTime,i=a||{},s=i.format,u="".concat(t,"-time-panel"),c=Qr(e,"time"),f=X(c,1),l=f[0];return d.createElement(Dr.Provider,{value:l},d.createElement("div",{className:Xe(u)},d.createElement(Jr,null,n?$t(n,{locale:r,format:s,generateConfig:o}):" "),d.createElement(bw,a)))}function ww(e){var t=e.prefixCls,n=e.generateConfig,r=e.showTime,o=e.onSelect,a=e.value,i=e.pickerValue,s=e.onHover,u="".concat(t,"-datetime-panel"),c=sl(n,r),f=X(c,1),l=f[0],h=function(v){return a?Ga(n,v,a):Ga(n,v,i)},m=function(v){s==null||s(v&&h(v))},y=function(v){var p=h(v);o(l(p,p))};return d.createElement("div",{className:u},d.createElement(ei,Ne({},e,{onSelect:y,onHover:m})),d.createElement(Yf,e))}function Cw(e){var t=e.prefixCls,n=e.locale,r=e.generateConfig,o=e.pickerValue,a=e.disabledDate,i=e.onPickerValueChange,s="".concat(t,"-decade-panel"),u=Qr(e,"decade"),c=X(u,1),f=c[0],l=function(S){var E=Math.floor(r.getYear(S)/100)*100;return r.setYear(S,E)},h=function(S){var E=l(S);return r.addYear(E,99)},m=l(o),y=h(o),w=r.addYear(m,-10),v=function(S,E){return r.addYear(S,E*10)},p=function(S){var E=n.cellYearFormat,M=$t(S,{locale:n,format:E,generateConfig:r}),k=$t(r.addYear(S,9),{locale:n,format:E,generateConfig:r});return"".concat(M,"-").concat(k)},g=function(S){return ce({},"".concat(t,"-cell-in-view"),nl(r,S,m)||nl(r,S,y)||Ua(r,m,y,S))},b=a?function(x,S){var E=r.setDate(x,1),M=r.setMonth(E,0),k=r.setYear(M,Math.floor(r.getYear(M)/10)*10),T=r.addYear(k,10),R=r.addDate(T,-1);return a(k,S)&&a(R,S)}:null,C="".concat($t(m,{locale:n,format:n.yearFormat,generateConfig:r}),"-").concat($t(y,{locale:n,format:n.yearFormat,generateConfig:r}));return d.createElement(Dr.Provider,{value:f},d.createElement("div",{className:s},d.createElement(Jr,{superOffset:function(S){return r.addYear(o,S*100)},onChange:i,getStart:l,getEnd:h},C),d.createElement(Mo,Ne({},e,{disabledDate:b,colNum:3,rowNum:4,baseDate:w,getCellDate:v,getCellText:p,getCellClassName:g}))))}function xw(e){var t=e.prefixCls,n=e.locale,r=e.generateConfig,o=e.pickerValue,a=e.disabledDate,i=e.onPickerValueChange,s=e.onModeChange,u="".concat(t,"-month-panel"),c=Qr(e,"month"),f=X(c,1),l=f[0],h=r.setMonth(o,0),m=n.shortMonths||(r.locale.getShortMonths?r.locale.getShortMonths(n.locale):[]),y=function(C,x){return r.addMonth(C,x)},w=function(C){var x=r.getMonth(C);return n.monthFormat?$t(C,{locale:n,format:n.monthFormat,generateConfig:r}):m[x]},v=function(){return ce({},"".concat(t,"-cell-in-view"),!0)},p=a?function(b,C){var x=r.setDate(b,1),S=r.setMonth(x,r.getMonth(x)+1),E=r.addDate(S,-1);return a(x,C)&&a(E,C)}:null,g=d.createElement("button",{type:"button",key:"year","aria-label":n.yearSelect,onClick:function(){s("year")},tabIndex:-1,className:"".concat(t,"-year-btn")},$t(o,{locale:n,format:n.yearFormat,generateConfig:r}));return d.createElement(Dr.Provider,{value:l},d.createElement("div",{className:u},d.createElement(Jr,{superOffset:function(C){return r.addYear(o,C)},onChange:i,getStart:function(C){return r.setMonth(C,0)},getEnd:function(C){return r.setMonth(C,11)}},g),d.createElement(Mo,Ne({},e,{disabledDate:p,titleFormat:n.fieldMonthFormat,colNum:3,rowNum:4,baseDate:h,getCellDate:y,getCellText:w,getCellClassName:v}))))}function Sw(e){var t=e.prefixCls,n=e.locale,r=e.generateConfig,o=e.pickerValue,a=e.onPickerValueChange,i=e.onModeChange,s="".concat(t,"-quarter-panel"),u=Qr(e,"quarter"),c=X(u,1),f=c[0],l=r.setMonth(o,0),h=function(p,g){return r.addMonth(p,g*3)},m=function(p){return $t(p,{locale:n,format:n.cellQuarterFormat,generateConfig:r})},y=function(){return ce({},"".concat(t,"-cell-in-view"),!0)},w=d.createElement("button",{type:"button",key:"year","aria-label":n.yearSelect,onClick:function(){i("year")},tabIndex:-1,className:"".concat(t,"-year-btn")},$t(o,{locale:n,format:n.yearFormat,generateConfig:r}));return d.createElement(Dr.Provider,{value:f},d.createElement("div",{className:s},d.createElement(Jr,{superOffset:function(p){return r.addYear(o,p)},onChange:a,getStart:function(p){return r.setMonth(p,0)},getEnd:function(p){return r.setMonth(p,11)}},w),d.createElement(Mo,Ne({},e,{titleFormat:n.fieldQuarterFormat,colNum:4,rowNum:1,baseDate:l,getCellDate:h,getCellText:m,getCellClassName:y}))))}function Ew(e){var t=e.prefixCls,n=e.generateConfig,r=e.locale,o=e.value,a=e.hoverValue,i=e.hoverRangeValue,s=r.locale,u="".concat(t,"-week-panel-row"),c=function(l){var h={};if(i){var m=X(i,2),y=m[0],w=m[1],v=So(n,s,y,l),p=So(n,s,w,l);h["".concat(u,"-range-start")]=v,h["".concat(u,"-range-end")]=p,h["".concat(u,"-range-hover")]=!v&&!p&&Ua(n,y,w,l)}return a&&(h["".concat(u,"-hover")]=a.some(function(g){return So(n,s,l,g)})),Xe(u,ce({},"".concat(u,"-selected"),!i&&So(n,s,o,l)),h)};return d.createElement(ei,Ne({},e,{mode:"week",panelName:"week",rowClassName:c}))}function Mw(e){var t=e.prefixCls,n=e.locale,r=e.generateConfig,o=e.pickerValue,a=e.disabledDate,i=e.onPickerValueChange,s=e.onModeChange,u="".concat(t,"-year-panel"),c=Qr(e,"year"),f=X(c,1),l=f[0],h=function(E){var M=Math.floor(r.getYear(E)/10)*10;return r.setYear(E,M)},m=function(E){var M=h(E);return r.addYear(M,9)},y=h(o),w=m(o),v=r.addYear(y,-1),p=function(E,M){return r.addYear(E,M)},g=function(E){return $t(E,{locale:n,format:n.cellYearFormat,generateConfig:r})},b=function(E){return ce({},"".concat(t,"-cell-in-view"),Pr(r,E,y)||Pr(r,E,w)||Ua(r,y,w,E))},C=a?function(S,E){var M=r.setMonth(S,0),k=r.setDate(M,1),T=r.addYear(k,1),R=r.addDate(T,-1);return a(k,E)&&a(R,E)}:null,x=d.createElement("button",{type:"button",key:"decade","aria-label":n.decadeSelect,onClick:function(){s("decade")},tabIndex:-1,className:"".concat(t,"-decade-btn")},$t(y,{locale:n,format:n.yearFormat,generateConfig:r}),"-",$t(w,{locale:n,format:n.yearFormat,generateConfig:r}));return d.createElement(Dr.Provider,{value:l},d.createElement("div",{className:u},d.createElement(Jr,{superOffset:function(E){return r.addYear(o,E*10)},onChange:i,getStart:h,getEnd:m},x),d.createElement(Mo,Ne({},e,{disabledDate:C,titleFormat:n.fieldYearFormat,colNum:3,rowNum:4,baseDate:v,getCellDate:p,getCellText:g,getCellClassName:b}))))}var Pw={date:ei,datetime:ww,week:Ew,month:xw,quarter:Sw,year:Mw,decade:Cw,time:Yf};function Dw(e,t){var n,r=e.locale,o=e.generateConfig,a=e.direction,i=e.prefixCls,s=e.tabIndex,u=s===void 0?0:s,c=e.multiple,f=e.defaultValue,l=e.value,h=e.onChange,m=e.onSelect,y=e.defaultPickerValue,w=e.pickerValue,v=e.onPickerValueChange,p=e.mode,g=e.onPanelChange,b=e.picker,C=b===void 0?"date":b,x=e.showTime,S=e.hoverValue,E=e.hoverRangeValue,M=e.cellRender,k=e.dateRender,T=e.monthCellRender,R=e.components,F=R===void 0?{}:R,V=e.hideHeader,$=((n=d.useContext(Cn))===null||n===void 0?void 0:n.prefixCls)||i||"rc-picker",L=d.useRef();d.useImperativeHandle(t,function(){return{nativeElement:L.current}});var N=Df(e),H=X(N,4),_=H[0],z=H[1],B=H[2],A=H[3],j=Ef(r,z),Y=C==="date"&&x?"datetime":C,U=d.useMemo(function(){return kf(Y,B,A,_,j)},[Y,B,A,_,j]),ne=o.getNow(),te=ln(C,{value:p,postState:function(fe){return fe||"date"}}),J=X(te,2),G=J[0],q=J[1],Z=G==="date"&&U?"datetime":G,O=jf(o,r,Y),I=ln(f,{value:l}),W=X(I,2),K=W[0],oe=W[1],Q=d.useMemo(function(){var le=Mr(K).filter(function(fe){return fe});return c?le:le.slice(0,1)},[K,c]),ae=ct(function(le){oe(le),h&&(le===null||Q.length!==le.length||Q.some(function(fe,Pe){return!Ut(o,r,fe,le[Pe],Y)}))&&(h==null||h(c?le:le[0]))}),ee=ct(function(le){if(m==null||m(le),G===C){var fe=c?O(Q,le):[le];ae(fe)}}),ie=ln(y||Q[0]||ne,{value:w}),ve=X(ie,2),ye=ve[0],de=ve[1];d.useEffect(function(){Q[0]&&!w&&de(Q[0])},[Q[0]]);var se=function(fe,Pe){g==null||g(fe||w,Pe||G)},He=function(fe){var Pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;de(fe),v==null||v(fe),Pe&&se(fe)},Le=function(fe,Pe){q(fe),Pe&&He(Pe),se(Pe,fe)},ge=function(fe){if(ee(fe),He(fe),G!==C){var Pe=["decade","year"],ue=[].concat(Pe,["month"]),he={quarter:[].concat(Pe,["quarter"]),week:[].concat(wt(ue),["week"]),date:[].concat(wt(ue),["date"])},Ue=he[C]||ue,Je=Ue.indexOf(G),nt=Ue[Je+1];nt&&Le(nt,fe)}},Ye=d.useMemo(function(){var le,fe;if(Array.isArray(E)){var Pe=X(E,2);le=Pe[0],fe=Pe[1]}else le=E;return!le&&!fe?null:(le=le||fe,fe=fe||le,o.isAfter(le,fe)?[fe,le]:[le,fe])},[E,o]),Fe=el(M,k,T),ze=F[Z]||Pw[Z]||ei,Ge=d.useContext(ir),Ke=d.useMemo(function(){return re(re({},Ge),{},{hideHeader:V})},[Ge,V]),Ee="".concat($,"-panel"),$e=Ya(e,["showWeek","prevIcon","nextIcon","superPrevIcon","superNextIcon","disabledDate","minDate","maxDate","onHover"]);return d.createElement(ir.Provider,{value:Ke},d.createElement("div",{ref:L,tabIndex:u,className:Xe(Ee,ce({},"".concat(Ee,"-rtl"),a==="rtl"))},d.createElement(ze,Ne({},$e,{showTime:U,prefixCls:$,locale:j,generateConfig:o,onModeChange:Le,pickerValue:ye,onPickerValueChange:function(fe){He(fe,!0)},value:Q[0],onSelect:ge,values:Q,cellRender:Fe,hoverRangeValue:Ye,hoverValue:S}))))}var ti=d.memo(d.forwardRef(Dw));function kw(e){var t=e.picker,n=e.multiplePanel,r=e.pickerValue,o=e.onPickerValueChange,a=e.needConfirm,i=e.onSubmit,s=e.range,u=e.hoverValue,c=d.useContext(Cn),f=c.prefixCls,l=c.generateConfig,h=d.useCallback(function(g,b){return Eo(l,t,g,b)},[l,t]),m=d.useMemo(function(){return h(r,1)},[r,h]),y=function(b){o(h(b,-1))},w={onCellDblClick:function(){a&&i()}},v=t==="time",p=re(re({},e),{},{hoverValue:null,hoverRangeValue:null,hideHeader:v});return s?p.hoverRangeValue=u:p.hoverValue=u,n?d.createElement("div",{className:"".concat(f,"-panels")},d.createElement(ir.Provider,{value:re(re({},w),{},{hideNext:!0})},d.createElement(ti,p)),d.createElement(ir.Provider,{value:re(re({},w),{},{hidePrev:!0})},d.createElement(ti,Ne({},p,{pickerValue:m,onPickerValueChange:y})))):d.createElement(ir.Provider,{value:re({},w)},d.createElement(ti,p))}function Uf(e){return typeof e=="function"?e():e}function _w(e){var t=e.prefixCls,n=e.presets,r=e.onClick,o=e.onHover;return n.length?d.createElement("div",{className:"".concat(t,"-presets")},d.createElement("ul",null,n.map(function(a,i){var s=a.label,u=a.value;return d.createElement("li",{key:i,onClick:function(){r(Uf(u))},onMouseEnter:function(){o(Uf(u))},onMouseLeave:function(){o(null)}},s)}))):null}function qf(e){var t=e.panelRender,n=e.internalMode,r=e.picker,o=e.showNow,a=e.range,i=e.multiple,s=e.activeInfo,u=s===void 0?[0,0,0]:s,c=e.presets,f=e.onPresetHover,l=e.onPresetSubmit,h=e.onFocus,m=e.onBlur,y=e.onPanelMouseDown,w=e.direction,v=e.value,p=e.onSelect,g=e.isInvalid,b=e.defaultOpenValue,C=e.onOk,x=e.onSubmit,S=d.useContext(Cn),E=S.prefixCls,M="".concat(E,"-panel"),k=w==="rtl",T=d.useRef(null),R=d.useRef(null),F=d.useState(0),V=X(F,2),$=V[0],L=V[1],N=d.useState(0),H=X(N,2),_=H[0],z=H[1],B=d.useState(0),A=X(B,2),j=A[0],Y=A[1],U=function(ge){ge.width&&L(ge.width)},ne=X(u,3),te=ne[0],J=ne[1],G=ne[2],q=d.useState(0),Z=X(q,2),O=Z[0],I=Z[1];d.useEffect(function(){I(10)},[te]),d.useEffect(function(){if(a&&R.current){var Le,ge=((Le=T.current)===null||Le===void 0?void 0:Le.offsetWidth)||0,Ye=R.current.getBoundingClientRect();if(!Ye.height||Ye.right<0){I(function(Ke){return Math.max(0,Ke-1)});return}var Fe=(k?J-ge:te)-Ye.left;if(Y(Fe),$&&$<G){var ze=k?Ye.right-(J-ge+$):te+ge-Ye.left-$,Ge=Math.max(0,ze);z(Ge)}else z(0)}},[O,k,$,te,J,G,a]);function W(Le){return Le.filter(function(ge){return ge})}var K=d.useMemo(function(){return W(Mr(v))},[v]),oe=r==="time"&&!K.length,Q=d.useMemo(function(){return oe?W([b]):K},[oe,K,b]),ae=oe?b:K,ee=d.useMemo(function(){return Q.length?Q.some(function(Le){return g(Le)}):!0},[Q,g]),ie=function(){oe&&p(b),C(),x()},ve=d.createElement("div",{className:"".concat(E,"-panel-layout")},d.createElement(_w,{prefixCls:E,presets:c,onClick:l,onHover:f}),d.createElement("div",null,d.createElement(kw,Ne({},e,{value:ae})),d.createElement(mw,Ne({},e,{showNow:i?!1:o,invalid:ee,onSubmit:ie}))));t&&(ve=t(ve));var ye="".concat(M,"-container"),de="marginLeft",se="marginRight",He=d.createElement("div",{onMouseDown:y,tabIndex:-1,className:Xe(ye,"".concat(E,"-").concat(n,"-panel-container")),style:ce(ce({},k?se:de,_),k?de:se,"auto"),onFocus:h,onBlur:m},ve);return a&&(He=d.createElement("div",{onMouseDown:y,ref:R,className:Xe("".concat(E,"-range-wrapper"),"".concat(E,"-").concat(r,"-range-wrapper"))},d.createElement("div",{ref:T,className:"".concat(E,"-range-arrow"),style:{left:j}}),d.createElement(jn,{onResize:U},He))),He}function Gf(e,t){var n=e.format,r=e.maskFormat,o=e.generateConfig,a=e.locale,i=e.preserveInvalidOnBlur,s=e.inputReadOnly,u=e.required,c=e["aria-required"],f=e.onSubmit,l=e.onFocus,h=e.onBlur,m=e.onInputChange,y=e.onInvalid,w=e.open,v=e.onOpenChange,p=e.onKeyDown,g=e.onChange,b=e.activeHelp,C=e.name,x=e.autoComplete,S=e.id,E=e.value,M=e.invalid,k=e.placeholder,T=e.disabled,R=e.activeIndex,F=e.allHelp,V=e.picker,$=function(j,Y){var U=o.locale.parse(a.locale,j,[Y]);return U&&o.isValidate(U)?U:null},L=n[0],N=d.useCallback(function(A){return $t(A,{locale:a,format:L,generateConfig:o})},[a,o,L]),H=d.useMemo(function(){return E.map(N)},[E,N]),_=d.useMemo(function(){var A=V==="time"?8:10,j=typeof L=="function"?L(o.getNow()).length:L.length;return Math.max(A,j)+2},[L,V,o]),z=function(j){for(var Y=0;Y<n.length;Y+=1){var U=n[Y];if(typeof U=="string"){var ne=$(j,U);if(ne)return ne}}return!1},B=function(j){function Y(te){return j!==void 0?te[j]:te}var U=Is(e,{aria:!0,data:!0}),ne=re(re({},U),{},{format:r,validateFormat:function(J){return!!z(J)},preserveInvalidOnBlur:i,readOnly:s,required:u,"aria-required":c,name:C,autoComplete:x,size:_,id:Y(S),value:Y(H)||"",invalid:Y(M),placeholder:Y(k),active:R===j,helped:F||b&&R===j,disabled:Y(T),onFocus:function(J){l(J,j)},onBlur:function(J){h(J,j)},onSubmit:f,onChange:function(J){m();var G=z(J);if(G){y(!1,j),g(G,j);return}y(!!J,j)},onHelp:function(){v(!0,{index:j})},onKeyDown:function(J){var G=!1;if(p==null||p(J,function(){G=!0}),!J.defaultPrevented&&!G)switch(J.key){case"Escape":v(!1,{index:j});break;case"Enter":w||v(!0);break}}},t==null?void 0:t({valueTexts:H}));return Object.keys(ne).forEach(function(te){ne[te]===void 0&&delete ne[te]}),ne};return[B,N]}var Nw=["onMouseEnter","onMouseLeave"];function Kf(e){return d.useMemo(function(){return Ya(e,Nw)},[e])}var Ow=["icon","type"],Tw=["onClear"];function ni(e){var t=e.icon,n=e.type,r=pt(e,Ow),o=d.useContext(Cn),a=o.prefixCls;return t?d.createElement("span",Ne({className:"".concat(a,"-").concat(n)},r),t):null}function ll(e){var t=e.onClear,n=pt(e,Tw);return d.createElement(ni,Ne({},n,{type:"clear",role:"button",onMouseDown:function(o){o.preventDefault()},onClick:function(o){o.stopPropagation(),t()}}))}var ul=["YYYY","MM","DD","HH","mm","ss","SSS"],Xf="顧",Iw=function(){function e(t){qr(this,e),ce(this,"format",void 0),ce(this,"maskFormat",void 0),ce(this,"cells",void 0),ce(this,"maskCells",void 0),this.format=t;var n=ul.map(function(s){return"(".concat(s,")")}).join("|"),r=new RegExp(n,"g");this.maskFormat=t.replace(r,function(s){return Xf.repeat(s.length)});var o=new RegExp("(".concat(ul.join("|"),")")),a=(t.split(o)||[]).filter(function(s){return s}),i=0;this.cells=a.map(function(s){var u=ul.includes(s),c=i,f=i+s.length;return i=f,{text:s,mask:u,start:c,end:f}}),this.maskCells=this.cells.filter(function(s){return s.mask})}return Gr(e,[{key:"getSelection",value:function(n){var r=this.maskCells[n]||{},o=r.start,a=r.end;return[o||0,a||0]}},{key:"match",value:function(n){for(var r=0;r<this.maskFormat.length;r+=1){var o=this.maskFormat[r],a=n[r];if(!a||o!==Xf&&o!==a)return!1}return!0}},{key:"size",value:function(){return this.maskCells.length}},{key:"getMaskCellIndex",value:function(n){for(var r=Number.MAX_SAFE_INTEGER,o=0,a=0;a<this.maskCells.length;a+=1){var i=this.maskCells[a],s=i.start,u=i.end;if(n>=s&&n<=u)return a;var c=Math.min(Math.abs(n-s),Math.abs(n-u));c<r&&(r=c,o=a)}return o}}]),e}();function Rw(e){var t={YYYY:[0,9999,new Date().getFullYear()],MM:[1,12],DD:[1,31],HH:[0,23],mm:[0,59],ss:[0,59],SSS:[0,999]};return t[e]}var Aw=["active","showActiveCls","suffixIcon","format","validateFormat","onChange","onInput","helped","onHelp","onSubmit","onKeyDown","preserveInvalidOnBlur","invalid","clearIcon"],cl=d.forwardRef(function(e,t){var n=e.active,r=e.showActiveCls,o=r===void 0?!0:r,a=e.suffixIcon,i=e.format,s=e.validateFormat,u=e.onChange;e.onInput;var c=e.helped,f=e.onHelp,l=e.onSubmit,h=e.onKeyDown,m=e.preserveInvalidOnBlur,y=m===void 0?!1:m,w=e.invalid,v=e.clearIcon,p=pt(e,Aw),g=e.value,b=e.onFocus,C=e.onBlur,x=e.onMouseUp,S=d.useContext(Cn),E=S.prefixCls,M=S.input,k=M===void 0?"input":M,T="".concat(E,"-input"),R=d.useState(!1),F=X(R,2),V=F[0],$=F[1],L=d.useState(g),N=X(L,2),H=N[0],_=N[1],z=d.useState(""),B=X(z,2),A=B[0],j=B[1],Y=d.useState(null),U=X(Y,2),ne=U[0],te=U[1],J=d.useState(null),G=X(J,2),q=G[0],Z=G[1],O=H||"";d.useEffect(function(){_(g)},[g]);var I=d.useRef(),W=d.useRef();d.useImperativeHandle(t,function(){return{nativeElement:I.current,inputElement:W.current,focus:function(le){W.current.focus(le)},blur:function(){W.current.blur()}}});var K=d.useMemo(function(){return new Iw(i||"")},[i]),oe=d.useMemo(function(){return c?[0,0]:K.getSelection(ne)},[K,ne,c]),Q=X(oe,2),ae=Q[0],ee=Q[1],ie=function(le){le&&le!==i&&le!==g&&f()},ve=ct(function($e){s($e)&&u($e),_($e),ie($e)}),ye=function(le){if(!i){var fe=le.target.value;ie(fe),_(fe),u(fe)}},de=function(le){var fe=le.clipboardData.getData("text");s(fe)&&ve(fe)},se=d.useRef(!1),He=function(){se.current=!0},Le=function(le){var fe=le.target,Pe=fe.selectionStart,ue=K.getMaskCellIndex(Pe);te(ue),Z({}),x==null||x(le),se.current=!1},ge=function(le){$(!0),te(0),j(""),b(le)},Ye=function(le){C(le)},Fe=function(le){$(!1),Ye(le)};al(n,function(){!n&&!y&&_(g)});var ze=function(le){le.key==="Enter"&&s(O)&&l(),h==null||h(le)},Ge=function(le){ze(le);var fe=le.key,Pe=null,ue=null,he=ee-ae,Ue=i.slice(ae,ee),Je=function(be){te(function(We){var Oe=We+be;return Oe=Math.max(Oe,0),Oe=Math.min(Oe,K.size()-1),Oe})},nt=function(be){var We=Rw(Ue),Oe=X(We,3),Ce=Oe[0],xe=Oe[1],pe=Oe[2],Ve=O.slice(ae,ee),dt=Number(Ve);if(isNaN(dt))return String(pe||(be>0?Ce:xe));var ut=dt+be,rt=xe-Ce+1;return String(Ce+(rt+ut-Ce)%rt)};switch(fe){case"Backspace":case"Delete":Pe="",ue=Ue;break;case"ArrowLeft":Pe="",Je(-1);break;case"ArrowRight":Pe="",Je(1);break;case"ArrowUp":Pe="",ue=nt(1);break;case"ArrowDown":Pe="",ue=nt(-1);break;default:isNaN(Number(fe))||(Pe=A+fe,ue=Pe);break}if(Pe!==null&&(j(Pe),Pe.length>=he&&(Je(1),j(""))),ue!==null){var yt=O.slice(0,ae)+Js(ue,he)+O.slice(ee);ve(yt.slice(0,i.length))}Z({})},Ke=d.useRef();ht(function(){if(!(!V||!i||se.current)){if(!K.match(O)){ve(i);return}return W.current.setSelectionRange(ae,ee),Ke.current=mt(function(){W.current.setSelectionRange(ae,ee)}),function(){mt.cancel(Ke.current)}}},[K,i,V,O,ne,ae,ee,q,ve]);var Ee=i?{onFocus:ge,onBlur:Fe,onKeyDown:Ge,onMouseDown:He,onMouseUp:Le,onPaste:de}:{};return d.createElement("div",{ref:I,className:Xe(T,ce(ce({},"".concat(T,"-active"),n&&o),"".concat(T,"-placeholder"),c))},d.createElement(k,Ne({ref:W,"aria-invalid":w,autoComplete:"off"},p,{onKeyDown:ze,onBlur:Ye},Ee,{value:O,onChange:ye})),d.createElement(ni,{type:"suffix",icon:a}),v)}),Lw=["id","prefix","clearIcon","suffixIcon","separator","activeIndex","activeHelp","allHelp","focused","onFocus","onBlur","onKeyDown","locale","generateConfig","placeholder","className","style","onClick","onClear","value","onChange","onSubmit","onInputChange","format","maskFormat","preserveInvalidOnBlur","onInvalid","disabled","invalid","inputReadOnly","direction","onOpenChange","onActiveInfo","placement","onMouseDown","required","aria-required","autoFocus","tabIndex"],$w=["index"];function Fw(e,t){var n=e.id,r=e.prefix,o=e.clearIcon,a=e.suffixIcon,i=e.separator,s=i===void 0?"~":i,u=e.activeIndex;e.activeHelp,e.allHelp;var c=e.focused;e.onFocus,e.onBlur,e.onKeyDown,e.locale,e.generateConfig;var f=e.placeholder,l=e.className,h=e.style,m=e.onClick,y=e.onClear,w=e.value;e.onChange,e.onSubmit,e.onInputChange,e.format,e.maskFormat,e.preserveInvalidOnBlur,e.onInvalid;var v=e.disabled,p=e.invalid;e.inputReadOnly;var g=e.direction;e.onOpenChange;var b=e.onActiveInfo;e.placement;var C=e.onMouseDown;e.required,e["aria-required"];var x=e.autoFocus,S=e.tabIndex,E=pt(e,Lw),M=g==="rtl",k=d.useContext(Cn),T=k.prefixCls,R=d.useMemo(function(){if(typeof n=="string")return[n];var q=n||{};return[q.start,q.end]},[n]),F=d.useRef(),V=d.useRef(),$=d.useRef(),L=function(Z){var O;return(O=[V,$][Z])===null||O===void 0?void 0:O.current};d.useImperativeHandle(t,function(){return{nativeElement:F.current,focus:function(Z){if(Ct(Z)==="object"){var O,I=Z||{},W=I.index,K=W===void 0?0:W,oe=pt(I,$w);(O=L(K))===null||O===void 0||O.focus(oe)}else{var Q;(Q=L(Z!=null?Z:0))===null||Q===void 0||Q.focus()}},blur:function(){var Z,O;(Z=L(0))===null||Z===void 0||Z.blur(),(O=L(1))===null||O===void 0||O.blur()}}});var N=Kf(E),H=d.useMemo(function(){return Array.isArray(f)?f:[f,f]},[f]),_=Gf(re(re({},e),{},{id:R,placeholder:H})),z=X(_,1),B=z[0],A=d.useState({position:"absolute",width:0}),j=X(A,2),Y=j[0],U=j[1],ne=ct(function(){var q=L(u);if(q){var Z=q.nativeElement.getBoundingClientRect(),O=F.current.getBoundingClientRect(),I=Z.left-O.left;U(function(W){return re(re({},W),{},{width:Z.width,left:I})}),b([Z.left,Z.right,O.width])}});d.useEffect(function(){ne()},[u]);var te=o&&(w[0]&&!v[0]||w[1]&&!v[1]),J=x&&!v[0],G=x&&!J&&!v[1];return d.createElement(jn,{onResize:ne},d.createElement("div",Ne({},N,{className:Xe(T,"".concat(T,"-range"),ce(ce(ce(ce({},"".concat(T,"-focused"),c),"".concat(T,"-disabled"),v.every(function(q){return q})),"".concat(T,"-invalid"),p.some(function(q){return q})),"".concat(T,"-rtl"),M),l),style:h,ref:F,onClick:m,onMouseDown:function(Z){var O=Z.target;O!==V.current.inputElement&&O!==$.current.inputElement&&Z.preventDefault(),C==null||C(Z)}}),r&&d.createElement("div",{className:"".concat(T,"-prefix")},r),d.createElement(cl,Ne({ref:V},B(0),{autoFocus:J,tabIndex:S,"date-range":"start"})),d.createElement("div",{className:"".concat(T,"-range-separator")},s),d.createElement(cl,Ne({ref:$},B(1),{autoFocus:G,tabIndex:S,"date-range":"end"})),d.createElement("div",{className:"".concat(T,"-active-bar"),style:Y}),d.createElement(ni,{type:"suffix",icon:a}),te&&d.createElement(ll,{icon:o,onClear:y})))}var zw=d.forwardRef(Fw);function Zf(e,t){var n=e!=null?e:t;return Array.isArray(n)?n:[n,n]}function ri(e){return e===1?"end":"start"}function Hw(e,t){var n=Tf(e,function(){var Ze=e.disabled,Ae=e.allowEmpty,Qe=Zf(Ze,!1),at=Zf(Ae,!1);return{disabled:Qe,allowEmpty:at}}),r=X(n,6),o=r[0],a=r[1],i=r[2],s=r[3],u=r[4],c=r[5],f=o.prefixCls,l=o.styles,h=o.classNames,m=o.defaultValue,y=o.value,w=o.needConfirm,v=o.onKeyDown,p=o.disabled,g=o.allowEmpty,b=o.disabledDate,C=o.minDate,x=o.maxDate,S=o.defaultOpen,E=o.open,M=o.onOpenChange,k=o.locale,T=o.generateConfig,R=o.picker,F=o.showNow,V=o.showToday,$=o.showTime,L=o.mode,N=o.onPanelChange,H=o.onCalendarChange,_=o.onOk,z=o.defaultPickerValue,B=o.pickerValue,A=o.onPickerValueChange,j=o.inputReadOnly,Y=o.suffixIcon,U=o.onFocus,ne=o.onBlur,te=o.presets,J=o.ranges,G=o.components,q=o.cellRender,Z=o.dateRender,O=o.monthCellRender,I=o.onClick,W=Rf(t),K=If(E,S,p,M),oe=X(K,2),Q=oe[0],ae=oe[1],ee=function(Ae,Qe){(p.some(function(at){return!at})||!Ae)&&ae(Ae,Qe)},ie=Vf(T,k,s,!0,!1,m,y,H,_),ve=X(ie,5),ye=ve[0],de=ve[1],se=ve[2],He=ve[3],Le=ve[4],ge=se(),Ye=Lf(p,g,Q),Fe=X(Ye,9),ze=Fe[0],Ge=Fe[1],Ke=Fe[2],Ee=Fe[3],$e=Fe[4],le=Fe[5],fe=Fe[6],Pe=Fe[7],ue=Fe[8],he=function(Ae,Qe){Ge(!0),U==null||U(Ae,{range:ri(Qe!=null?Qe:Ee)})},Ue=function(Ae,Qe){Ge(!1),ne==null||ne(Ae,{range:ri(Qe!=null?Qe:Ee)})},Je=d.useMemo(function(){if(!$)return null;var Ze=$.disabledTime,Ae=Ze?function(Qe){var at=ri(Ee),Dt=wf(ge,fe,Ee);return Ze(Qe,at,{from:Dt})}:void 0;return re(re({},$),{},{disabledTime:Ae})},[$,Ee,ge,fe]),nt=ln([R,R],{value:L}),yt=X(nt,2),tt=yt[0],be=yt[1],We=tt[Ee]||R,Oe=We==="date"&&Je?"datetime":We,Ce=Oe===R&&Oe!=="time",xe=Bf(R,We,F,V,!0),pe=Wf(o,ye,de,se,He,p,s,ze,Q,c),Ve=X(pe,2),dt=Ve[0],ut=Ve[1],rt=cw(ge,p,fe,T,k,b),Jt=xf(ge,c,g),xt=X(Jt,2),Vt=xt[0],en=xt[1],dn=$f(T,k,ge,tt,Q,Ee,a,Ce,z,B,Je==null?void 0:Je.defaultOpenValue,A,C,x),Wt=X(dn,2),Nt=Wt[0],Kt=Wt[1],Et=ct(function(Ze,Ae,Qe){var at=Co(tt,Ee,Ae);if((at[0]!==tt[0]||at[1]!==tt[1])&&be(at),N&&Qe!==!1){var Dt=wt(ge);Ze&&(Dt[Ee]=Ze),N(Dt,at)}}),Bt=function(Ae,Qe){return Co(ge,Qe,Ae)},bt=function(Ae,Qe){var at=ge;Ae&&(at=Bt(Ae,Ee)),Pe(Ee);var Dt=le(at);He(at),dt(Ee,Dt===null),Dt===null?ee(!1,{force:!0}):Qe||W.current.focus({index:Dt})},sn=function(Ae){var Qe,at=Ae.target.getRootNode();if(!W.current.nativeElement.contains((Qe=at.activeElement)!==null&&Qe!==void 0?Qe:document.activeElement)){var Dt=p.findIndex(function(pr){return!pr});Dt>=0&&W.current.focus({index:Dt})}ee(!0),I==null||I(Ae)},Ot=function(){ut(null),ee(!1,{force:!0})},fn=d.useState(null),we=X(fn,2),Me=we[0],Be=we[1],qe=d.useState(null),it=X(qe,2),Ft=it[0],Rt=it[1],tn=d.useMemo(function(){return Ft||ge},[ge,Ft]);d.useEffect(function(){Q||Rt(null)},[Q]);var nn=d.useState([0,0,0]),Xt=X(nn,2),zt=Xt[0],rn=Xt[1],zn=Af(te,J),Hn=function(Ae){Rt(Ae),Be("preset")},jt=function(Ae){var Qe=ut(Ae);Qe&&ee(!1,{force:!0})},Yt=function(Ae){bt(Ae)},pn=function(Ae){Rt(Ae?Bt(Ae,Ee):null),Be("cell")},gn=function(Ae){ee(!0),he(Ae)},Zt=function(){Ke("panel")},Xn=function(Ae){var Qe=Co(ge,Ee,Ae);He(Qe),!w&&!i&&a===Oe&&bt(Ae)},ft=function(){ee(!1)},ot=el(q,Z,O,ri(Ee)),lt=ge[Ee]||null,Tt=ct(function(Ze){return c(Ze,{activeIndex:Ee})}),Te=d.useMemo(function(){var Ze=Is(o,!1),Ae=po(o,[].concat(wt(Object.keys(Ze)),["onChange","onCalendarChange","style","className","onPanelChange","disabledTime"]));return Ae},[o]),Re=d.createElement(qf,Ne({},Te,{showNow:xe,showTime:Je,range:!0,multiplePanel:Ce,activeInfo:zt,disabledDate:rt,onFocus:gn,onBlur:Ue,onPanelMouseDown:Zt,picker:R,mode:We,internalMode:Oe,onPanelChange:Et,format:u,value:lt,isInvalid:Tt,onChange:null,onSelect:Xn,pickerValue:Nt,defaultOpenValue:Mr($==null?void 0:$.defaultOpenValue)[Ee],onPickerValueChange:Kt,hoverValue:tn,onHover:pn,needConfirm:w,onSubmit:bt,onOk:Le,presets:zn,onPresetHover:Hn,onPresetSubmit:jt,onNow:Yt,cellRender:ot})),Mt=function(Ae,Qe){var at=Bt(Ae,Qe);He(at)},Qt=function(){Ke("input")},Pn=function(Ae,Qe){var at=fe.length,Dt=fe[at-1];if(at&&Dt!==Qe&&w&&!g[Dt]&&!ue(Dt)&&ge[Dt]){W.current.focus({index:Dt});return}Ke("input"),ee(!0,{inherit:!0}),Ee!==Qe&&Q&&!w&&i&&bt(null,!0),$e(Qe),he(Ae,Qe)},Zn=function(Ae,Qe){if(ee(!1),!w&&Ke()==="input"){var at=le(ge);dt(Ee,at===null)}Ue(Ae,Qe)},Dn=function(Ae,Qe){Ae.key==="Tab"&&bt(null,!0),v==null||v(Ae,Qe)},Qn=d.useMemo(function(){return{prefixCls:f,locale:k,generateConfig:T,button:G.button,input:G.input}},[f,k,T,G.button,G.input]);return ht(function(){Q&&Ee!==void 0&&Et(null,R,!1)},[Q,Ee,R]),ht(function(){var Ze=Ke();!Q&&Ze==="input"&&(ee(!1),bt(null,!0)),!Q&&i&&!w&&Ze==="panel"&&(ee(!0),bt())},[Q]),d.createElement(Cn.Provider,{value:Qn},d.createElement(yf,Ne({},Cf(o),{popupElement:Re,popupStyle:l.popup,popupClassName:h.popup,visible:Q,onClose:ft,range:!0}),d.createElement(zw,Ne({},o,{ref:W,suffixIcon:Y,activeIndex:ze||Q?Ee:null,activeHelp:!!Ft,allHelp:!!Ft&&Me==="preset",focused:ze,onFocus:Pn,onBlur:Zn,onKeyDown:Dn,onSubmit:bt,value:tn,maskFormat:u,onChange:Mt,onInputChange:Qt,format:s,inputReadOnly:j,disabled:p,open:Q,onOpenChange:ee,onClick:sn,onClear:Ot,invalid:Vt,onInvalid:en,onActiveInfo:rn}))))}var Vw=d.forwardRef(Hw),Ww=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],eo=void 0;function Bw(e,t){var n=e.prefixCls,r=e.invalidate,o=e.item,a=e.renderItem,i=e.responsive,s=e.responsiveDisabled,u=e.registerSize,c=e.itemKey,f=e.className,l=e.style,h=e.children,m=e.display,y=e.order,w=e.component,v=w===void 0?"div":w,p=pt(e,Ww),g=i&&!m;function b(M){u(c,M)}d.useEffect(function(){return function(){b(null)}},[]);var C=a&&o!==eo?a(o,{index:y}):h,x;r||(x={opacity:g?0:1,height:g?0:eo,overflowY:g?"hidden":eo,order:i?y:eo,pointerEvents:g?"none":eo,position:g?"absolute":eo});var S={};g&&(S["aria-hidden"]=!0);var E=d.createElement(v,Ne({className:Xe(!r&&n,f),style:re(re({},x),l)},S,p,{ref:t}),C);return i&&(E=d.createElement(jn,{onResize:function(k){var T=k.offsetWidth;b(T)},disabled:s},E)),E}var Do=d.forwardRef(Bw);Do.displayName="Item";function jw(e){if(typeof MessageChannel>"u")mt(e);else{var t=new MessageChannel;t.port1.onmessage=function(){return e()},t.port2.postMessage(void 0)}}function Yw(){var e=d.useRef(null),t=function(r){e.current||(e.current=[],jw(function(){It.unstable_batchedUpdates(function(){e.current.forEach(function(o){o()}),e.current=null})})),e.current.push(r)};return t}function ko(e,t){var n=d.useState(t),r=X(n,2),o=r[0],a=r[1],i=ct(function(s){e(function(){a(s)})});return[o,i]}var oi=D.createContext(null),Uw=["component"],qw=["className"],Gw=["className"],Kw=function(t,n){var r=d.useContext(oi);if(!r){var o=t.component,a=o===void 0?"div":o,i=pt(t,Uw);return d.createElement(a,Ne({},i,{ref:n}))}var s=r.className,u=pt(r,qw),c=t.className,f=pt(t,Gw);return d.createElement(oi.Provider,{value:null},d.createElement(Do,Ne({ref:n,className:Xe(s,c)},u,f)))},Qf=d.forwardRef(Kw);Qf.displayName="RawItem";var Xw=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","suffix","component","itemComponent","onVisibleChange"],Jf="responsive",ev="invalidate";function Zw(e){return"+ ".concat(e.length," ...")}function Qw(e,t){var n=e.prefixCls,r=n===void 0?"rc-overflow":n,o=e.data,a=o===void 0?[]:o,i=e.renderItem,s=e.renderRawItem,u=e.itemKey,c=e.itemWidth,f=c===void 0?10:c,l=e.ssr,h=e.style,m=e.className,y=e.maxCount,w=e.renderRest,v=e.renderRawRest,p=e.suffix,g=e.component,b=g===void 0?"div":g,C=e.itemComponent,x=e.onVisibleChange,S=pt(e,Xw),E=l==="full",M=Yw(),k=ko(M,null),T=X(k,2),R=T[0],F=T[1],V=R||0,$=ko(M,new Map),L=X($,2),N=L[0],H=L[1],_=ko(M,0),z=X(_,2),B=z[0],A=z[1],j=ko(M,0),Y=X(j,2),U=Y[0],ne=Y[1],te=ko(M,0),J=X(te,2),G=J[0],q=J[1],Z=D.useState(null),O=X(Z,2),I=O[0],W=O[1],K=D.useState(null),oe=X(K,2),Q=oe[0],ae=oe[1],ee=d.useMemo(function(){return Q===null&&E?Number.MAX_SAFE_INTEGER:Q||0},[Q,R]),ie=D.useState(!1),ve=X(ie,2),ye=ve[0],de=ve[1],se="".concat(r,"-item"),He=Math.max(B,U),Le=y===Jf,ge=a.length&&Le,Ye=y===ev,Fe=ge||typeof y=="number"&&a.length>y,ze=D.useMemo(function(){var Ce=a;return ge?R===null&&E?Ce=a:Ce=a.slice(0,Math.min(a.length,V/f)):typeof y=="number"&&(Ce=a.slice(0,y)),Ce},[a,f,R,y,ge]),Ge=D.useMemo(function(){return ge?a.slice(ee+1):a.slice(ze.length)},[a,ze,ge,ee]),Ke=D.useCallback(function(Ce,xe){var pe;return typeof u=="function"?u(Ce):(pe=u&&(Ce==null?void 0:Ce[u]))!==null&&pe!==void 0?pe:xe},[u]),Ee=D.useCallback(i||function(Ce){return Ce},[i]);function $e(Ce,xe,pe){Q===Ce&&(xe===void 0||xe===I)||(ae(Ce),pe||(de(Ce<a.length-1),x==null||x(Ce)),xe!==void 0&&W(xe))}function le(Ce,xe){F(xe.clientWidth)}function fe(Ce,xe){H(function(pe){var Ve=new Map(pe);return xe===null?Ve.delete(Ce):Ve.set(Ce,xe),Ve})}function Pe(Ce,xe){ne(xe),A(U)}function ue(Ce,xe){q(xe)}function he(Ce){return N.get(Ke(ze[Ce],Ce))}ht(function(){if(V&&typeof He=="number"&&ze){var Ce=G,xe=ze.length,pe=xe-1;if(!xe){$e(0,null);return}for(var Ve=0;Ve<xe;Ve+=1){var dt=he(Ve);if(E&&(dt=dt||0),dt===void 0){$e(Ve-1,void 0,!0);break}if(Ce+=dt,pe===0&&Ce<=V||Ve===pe-1&&Ce+he(pe)<=V){$e(pe,null);break}else if(Ce+He>V){$e(Ve-1,Ce-dt-G+U);break}}p&&he(0)+G>V&&W(null)}},[V,N,U,G,Ke,ze]);var Ue=ye&&!!Ge.length,Je={};I!==null&&ge&&(Je={position:"absolute",left:I,top:0});var nt={prefixCls:se,responsive:ge,component:C,invalidate:Ye},yt=s?function(Ce,xe){var pe=Ke(Ce,xe);return d.createElement(oi.Provider,{key:pe,value:re(re({},nt),{},{order:xe,item:Ce,itemKey:pe,registerSize:fe,display:xe<=ee})},s(Ce,xe))}:function(Ce,xe){var pe=Ke(Ce,xe);return d.createElement(Do,Ne({},nt,{order:xe,key:pe,item:Ce,renderItem:Ee,itemKey:pe,registerSize:fe,display:xe<=ee}))},tt={order:Ue?ee:Number.MAX_SAFE_INTEGER,className:"".concat(se,"-rest"),registerSize:Pe,display:Ue},be=w||Zw,We=v?d.createElement(oi.Provider,{value:re(re({},nt),tt)},v(Ge)):d.createElement(Do,Ne({},nt,tt),typeof be=="function"?be(Ge):be),Oe=d.createElement(b,Ne({className:Xe(!Ye&&r,m),style:h,ref:t},S),ze.map(yt),Fe?We:null,p&&d.createElement(Do,Ne({},nt,{responsive:Le,responsiveDisabled:!ge,order:ee,className:"".concat(se,"-suffix"),registerSize:ue,display:!0,style:Je}),p));return Le?d.createElement(jn,{onResize:le,disabled:!ge},Oe):Oe}var Tn=d.forwardRef(Qw);Tn.displayName="Overflow",Tn.Item=Qf,Tn.RESPONSIVE=Jf,Tn.INVALIDATE=ev;function Jw(e){var t=e.prefixCls,n=e.value,r=e.onRemove,o=e.removeIcon,a=o===void 0?"×":o,i=e.formatDate,s=e.disabled,u=e.maxTagCount,c=e.placeholder,f="".concat(t,"-selector"),l="".concat(t,"-selection"),h="".concat(l,"-overflow");function m(v,p){return d.createElement("span",{className:Xe("".concat(l,"-item")),title:typeof v=="string"?v:null},d.createElement("span",{className:"".concat(l,"-item-content")},v),!s&&p&&d.createElement("span",{onMouseDown:function(b){b.preventDefault()},onClick:p,className:"".concat(l,"-item-remove")},a))}function y(v){var p=i(v),g=function(C){C&&C.stopPropagation(),r(v)};return m(p,g)}function w(v){var p="+ ".concat(v.length," ...");return m(p)}return d.createElement("div",{className:f},d.createElement(Tn,{prefixCls:h,data:n,renderItem:y,renderRest:w,itemKey:function(p){return i(p)},maxCount:u}),!n.length&&d.createElement("span",{className:"".concat(t,"-selection-placeholder")},c))}var eC=["id","open","prefix","clearIcon","suffixIcon","activeHelp","allHelp","focused","onFocus","onBlur","onKeyDown","locale","generateConfig","placeholder","className","style","onClick","onClear","internalPicker","value","onChange","onSubmit","onInputChange","multiple","maxTagCount","format","maskFormat","preserveInvalidOnBlur","onInvalid","disabled","invalid","inputReadOnly","direction","onOpenChange","onMouseDown","required","aria-required","autoFocus","tabIndex","removeIcon"];function tC(e,t){e.id;var n=e.open,r=e.prefix,o=e.clearIcon,a=e.suffixIcon;e.activeHelp,e.allHelp;var i=e.focused;e.onFocus,e.onBlur,e.onKeyDown;var s=e.locale,u=e.generateConfig,c=e.placeholder,f=e.className,l=e.style,h=e.onClick,m=e.onClear,y=e.internalPicker,w=e.value,v=e.onChange,p=e.onSubmit;e.onInputChange;var g=e.multiple,b=e.maxTagCount;e.format,e.maskFormat,e.preserveInvalidOnBlur,e.onInvalid;var C=e.disabled,x=e.invalid;e.inputReadOnly;var S=e.direction;e.onOpenChange;var E=e.onMouseDown;e.required,e["aria-required"];var M=e.autoFocus,k=e.tabIndex,T=e.removeIcon,R=pt(e,eC),F=S==="rtl",V=d.useContext(Cn),$=V.prefixCls,L=d.useRef(),N=d.useRef();d.useImperativeHandle(t,function(){return{nativeElement:L.current,focus:function(J){var G;(G=N.current)===null||G===void 0||G.focus(J)},blur:function(){var J;(J=N.current)===null||J===void 0||J.blur()}}});var H=Kf(R),_=function(J){v([J])},z=function(J){var G=w.filter(function(q){return q&&!Ut(u,s,q,J,y)});v(G),n||p()},B=Gf(re(re({},e),{},{onChange:_}),function(te){var J=te.valueTexts;return{value:J[0]||"",active:i}}),A=X(B,2),j=A[0],Y=A[1],U=!!(o&&w.length&&!C),ne=g?d.createElement(d.Fragment,null,d.createElement(Jw,{prefixCls:$,value:w,onRemove:z,formatDate:Y,maxTagCount:b,disabled:C,removeIcon:T,placeholder:c}),d.createElement("input",{className:"".concat($,"-multiple-input"),value:w.map(Y).join(","),ref:N,readOnly:!0,autoFocus:M,tabIndex:k}),d.createElement(ni,{type:"suffix",icon:a}),U&&d.createElement(ll,{icon:o,onClear:m})):d.createElement(cl,Ne({ref:N},j(),{autoFocus:M,tabIndex:k,suffixIcon:a,clearIcon:U&&d.createElement(ll,{icon:o,onClear:m}),showActiveCls:!1}));return d.createElement("div",Ne({},H,{className:Xe($,ce(ce(ce(ce(ce({},"".concat($,"-multiple"),g),"".concat($,"-focused"),i),"".concat($,"-disabled"),C),"".concat($,"-invalid"),x),"".concat($,"-rtl"),F),f),style:l,ref:L,onClick:h,onMouseDown:function(J){var G,q=J.target;q!==((G=N.current)===null||G===void 0?void 0:G.inputElement)&&J.preventDefault(),E==null||E(J)}}),r&&d.createElement("div",{className:"".concat($,"-prefix")},r),ne)}var nC=d.forwardRef(tC);function rC(e,t){var n=Tf(e),r=X(n,6),o=r[0],a=r[1],i=r[2],s=r[3],u=r[4],c=r[5],f=o,l=f.prefixCls,h=f.styles,m=f.classNames,y=f.order,w=f.defaultValue,v=f.value,p=f.needConfirm,g=f.onChange,b=f.onKeyDown,C=f.disabled,x=f.disabledDate,S=f.minDate,E=f.maxDate,M=f.defaultOpen,k=f.open,T=f.onOpenChange,R=f.locale,F=f.generateConfig,V=f.picker,$=f.showNow,L=f.showToday,N=f.showTime,H=f.mode,_=f.onPanelChange,z=f.onCalendarChange,B=f.onOk,A=f.multiple,j=f.defaultPickerValue,Y=f.pickerValue,U=f.onPickerValueChange,ne=f.inputReadOnly,te=f.suffixIcon,J=f.removeIcon,G=f.onFocus,q=f.onBlur,Z=f.presets,O=f.components,I=f.cellRender,W=f.dateRender,K=f.monthCellRender,oe=f.onClick,Q=Rf(t);function ae(Te){return Te===null?null:A?Te:Te[0]}var ee=jf(F,R,a),ie=If(k,M,[C],T),ve=X(ie,2),ye=ve[0],de=ve[1],se=function(Re,Mt,Qt){if(z){var Pn=re({},Qt);delete Pn.range,z(ae(Re),ae(Mt),Pn)}},He=function(Re){B==null||B(ae(Re))},Le=Vf(F,R,s,!1,y,w,v,se,He),ge=X(Le,5),Ye=ge[0],Fe=ge[1],ze=ge[2],Ge=ge[3],Ke=ge[4],Ee=ze(),$e=Lf([C]),le=X($e,4),fe=le[0],Pe=le[1],ue=le[2],he=le[3],Ue=function(Re){Pe(!0),G==null||G(Re,{})},Je=function(Re){Pe(!1),q==null||q(Re,{})},nt=ln(V,{value:H}),yt=X(nt,2),tt=yt[0],be=yt[1],We=tt==="date"&&N?"datetime":tt,Oe=Bf(V,tt,$,L),Ce=g&&function(Te,Re){g(ae(Te),ae(Re))},xe=Wf(re(re({},o),{},{onChange:Ce}),Ye,Fe,ze,Ge,[],s,fe,ye,c),pe=X(xe,2),Ve=pe[1],dt=xf(Ee,c),ut=X(dt,2),rt=ut[0],Jt=ut[1],xt=d.useMemo(function(){return rt.some(function(Te){return Te})},[rt]),Vt=function(Re,Mt){if(U){var Qt=re(re({},Mt),{},{mode:Mt.mode[0]});delete Qt.range,U(Re[0],Qt)}},en=$f(F,R,Ee,[tt],ye,he,a,!1,j,Y,Mr(N==null?void 0:N.defaultOpenValue),Vt,S,E),dn=X(en,2),Wt=dn[0],Nt=dn[1],Kt=ct(function(Te,Re,Mt){if(be(Re),_&&Mt!==!1){var Qt=Te||Ee[Ee.length-1];_(Qt,Re)}}),Et=function(){Ve(ze()),de(!1,{force:!0})},Bt=function(Re){!C&&!Q.current.nativeElement.contains(document.activeElement)&&Q.current.focus(),de(!0),oe==null||oe(Re)},bt=function(){Ve(null),de(!1,{force:!0})},sn=d.useState(null),Ot=X(sn,2),fn=Ot[0],we=Ot[1],Me=d.useState(null),Be=X(Me,2),qe=Be[0],it=Be[1],Ft=d.useMemo(function(){var Te=[qe].concat(wt(Ee)).filter(function(Re){return Re});return A?Te:Te.slice(0,1)},[Ee,qe,A]),Rt=d.useMemo(function(){return!A&&qe?[qe]:Ee.filter(function(Te){return Te})},[Ee,qe,A]);d.useEffect(function(){ye||it(null)},[ye]);var tn=Af(Z),nn=function(Re){it(Re),we("preset")},Xt=function(Re){var Mt=A?ee(ze(),Re):[Re],Qt=Ve(Mt);Qt&&!A&&de(!1,{force:!0})},zt=function(Re){Xt(Re)},rn=function(Re){it(Re),we("cell")},zn=function(Re){de(!0),Ue(Re)},Hn=function(Re){if(ue("panel"),!(A&&We!==V)){var Mt=A?ee(ze(),Re):[Re];Ge(Mt),!p&&!i&&a===We&&Et()}},jt=function(){de(!1)},Yt=el(I,W,K),pn=d.useMemo(function(){var Te=Is(o,!1),Re=po(o,[].concat(wt(Object.keys(Te)),["onChange","onCalendarChange","style","className","onPanelChange"]));return re(re({},Re),{},{multiple:o.multiple})},[o]),gn=d.createElement(qf,Ne({},pn,{showNow:Oe,showTime:N,disabledDate:x,onFocus:zn,onBlur:Je,picker:V,mode:tt,internalMode:We,onPanelChange:Kt,format:u,value:Ee,isInvalid:c,onChange:null,onSelect:Hn,pickerValue:Wt,defaultOpenValue:N==null?void 0:N.defaultOpenValue,onPickerValueChange:Nt,hoverValue:Ft,onHover:rn,needConfirm:p,onSubmit:Et,onOk:Ke,presets:tn,onPresetHover:nn,onPresetSubmit:Xt,onNow:zt,cellRender:Yt})),Zt=function(Re){Ge(Re)},Xn=function(){ue("input")},ft=function(Re){ue("input"),de(!0,{inherit:!0}),Ue(Re)},ot=function(Re){de(!1),Je(Re)},lt=function(Re,Mt){Re.key==="Tab"&&Et(),b==null||b(Re,Mt)},Tt=d.useMemo(function(){return{prefixCls:l,locale:R,generateConfig:F,button:O.button,input:O.input}},[l,R,F,O.button,O.input]);return ht(function(){ye&&he!==void 0&&Kt(null,V,!1)},[ye,he,V]),ht(function(){var Te=ue();!ye&&Te==="input"&&(de(!1),Et()),!ye&&i&&!p&&Te==="panel"&&Et()},[ye]),d.createElement(Cn.Provider,{value:Tt},d.createElement(yf,Ne({},Cf(o),{popupElement:gn,popupStyle:h.popup,popupClassName:m.popup,visible:ye,onClose:jt}),d.createElement(nC,Ne({},o,{ref:Q,suffixIcon:te,removeIcon:J,activeHelp:!!qe,allHelp:!!qe&&fn==="preset",focused:fe,onFocus:ft,onBlur:ot,onKeyDown:lt,onSubmit:Et,value:Rt,maskFormat:u,onChange:Zt,onInputChange:Xn,internalPicker:a,format:s,inputReadOnly:ne,disabled:C,open:ye,onOpenChange:de,onClick:Bt,onClear:bt,invalid:xt,onInvalid:function(Re){Jt(Re,0)}}))))}var oC=d.forwardRef(rC),_o={},dl={exports:{}},tv;function aC(){return tv||(tv=1,function(e){function t(n){return n&&n.__esModule?n:{default:n}}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(dl)),dl.exports}var ai={exports:{}},iC=ai.exports,nv;function sC(){return nv||(nv=1,function(e,t){(function(n,r){e.exports=r()})(iC,function(){var n=1e3,r=6e4,o=36e5,a="millisecond",i="second",s="minute",u="hour",c="day",f="week",l="month",h="quarter",m="year",y="date",w="Invalid Date",v=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,p=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function($){var L=["th","st","nd","rd"],N=$%100;return"["+$+(L[(N-20)%10]||L[N]||L[0])+"]"}},b=function($,L,N){var H=String($);return!H||H.length>=L?$:""+Array(L+1-H.length).join(N)+$},C={s:b,z:function($){var L=-$.utcOffset(),N=Math.abs(L),H=Math.floor(N/60),_=N%60;return(L<=0?"+":"-")+b(H,2,"0")+":"+b(_,2,"0")},m:function $(L,N){if(L.date()<N.date())return-$(N,L);var H=12*(N.year()-L.year())+(N.month()-L.month()),_=L.clone().add(H,l),z=N-_<0,B=L.clone().add(H+(z?-1:1),l);return+(-(H+(N-_)/(z?_-B:B-_))||0)},a:function($){return $<0?Math.ceil($)||0:Math.floor($)},p:function($){return{M:l,y:m,w:f,d:c,D:y,h:u,m:s,s:i,ms:a,Q:h}[$]||String($||"").toLowerCase().replace(/s$/,"")},u:function($){return $===void 0}},x="en",S={};S[x]=g;var E="$isDayjsObject",M=function($){return $ instanceof F||!(!$||!$[E])},k=function $(L,N,H){var _;if(!L)return x;if(typeof L=="string"){var z=L.toLowerCase();S[z]&&(_=z),N&&(S[z]=N,_=z);var B=L.split("-");if(!_&&B.length>1)return $(B[0])}else{var A=L.name;S[A]=L,_=A}return!H&&_&&(x=_),_||!H&&x},T=function($,L){if(M($))return $.clone();var N=typeof L=="object"?L:{};return N.date=$,N.args=arguments,new F(N)},R=C;R.l=k,R.i=M,R.w=function($,L){return T($,{locale:L.$L,utc:L.$u,x:L.$x,$offset:L.$offset})};var F=function(){function $(N){this.$L=k(N.locale,null,!0),this.parse(N),this.$x=this.$x||N.x||{},this[E]=!0}var L=$.prototype;return L.parse=function(N){this.$d=function(H){var _=H.date,z=H.utc;if(_===null)return new Date(NaN);if(R.u(_))return new Date;if(_ instanceof Date)return new Date(_);if(typeof _=="string"&&!/Z$/i.test(_)){var B=_.match(v);if(B){var A=B[2]-1||0,j=(B[7]||"0").substring(0,3);return z?new Date(Date.UTC(B[1],A,B[3]||1,B[4]||0,B[5]||0,B[6]||0,j)):new Date(B[1],A,B[3]||1,B[4]||0,B[5]||0,B[6]||0,j)}}return new Date(_)}(N),this.init()},L.init=function(){var N=this.$d;this.$y=N.getFullYear(),this.$M=N.getMonth(),this.$D=N.getDate(),this.$W=N.getDay(),this.$H=N.getHours(),this.$m=N.getMinutes(),this.$s=N.getSeconds(),this.$ms=N.getMilliseconds()},L.$utils=function(){return R},L.isValid=function(){return this.$d.toString()!==w},L.isSame=function(N,H){var _=T(N);return this.startOf(H)<=_&&_<=this.endOf(H)},L.isAfter=function(N,H){return T(N)<this.startOf(H)},L.isBefore=function(N,H){return this.endOf(H)<T(N)},L.$g=function(N,H,_){return R.u(N)?this[H]:this.set(_,N)},L.unix=function(){return Math.floor(this.valueOf()/1e3)},L.valueOf=function(){return this.$d.getTime()},L.startOf=function(N,H){var _=this,z=!!R.u(H)||H,B=R.p(N),A=function(q,Z){var O=R.w(_.$u?Date.UTC(_.$y,Z,q):new Date(_.$y,Z,q),_);return z?O:O.endOf(c)},j=function(q,Z){return R.w(_.toDate()[q].apply(_.toDate("s"),(z?[0,0,0,0]:[23,59,59,999]).slice(Z)),_)},Y=this.$W,U=this.$M,ne=this.$D,te="set"+(this.$u?"UTC":"");switch(B){case m:return z?A(1,0):A(31,11);case l:return z?A(1,U):A(0,U+1);case f:var J=this.$locale().weekStart||0,G=(Y<J?Y+7:Y)-J;return A(z?ne-G:ne+(6-G),U);case c:case y:return j(te+"Hours",0);case u:return j(te+"Minutes",1);case s:return j(te+"Seconds",2);case i:return j(te+"Milliseconds",3);default:return this.clone()}},L.endOf=function(N){return this.startOf(N,!1)},L.$set=function(N,H){var _,z=R.p(N),B="set"+(this.$u?"UTC":""),A=(_={},_[c]=B+"Date",_[y]=B+"Date",_[l]=B+"Month",_[m]=B+"FullYear",_[u]=B+"Hours",_[s]=B+"Minutes",_[i]=B+"Seconds",_[a]=B+"Milliseconds",_)[z],j=z===c?this.$D+(H-this.$W):H;if(z===l||z===m){var Y=this.clone().set(y,1);Y.$d[A](j),Y.init(),this.$d=Y.set(y,Math.min(this.$D,Y.daysInMonth())).$d}else A&&this.$d[A](j);return this.init(),this},L.set=function(N,H){return this.clone().$set(N,H)},L.get=function(N){return this[R.p(N)]()},L.add=function(N,H){var _,z=this;N=Number(N);var B=R.p(H),A=function(U){var ne=T(z);return R.w(ne.date(ne.date()+Math.round(U*N)),z)};if(B===l)return this.set(l,this.$M+N);if(B===m)return this.set(m,this.$y+N);if(B===c)return A(1);if(B===f)return A(7);var j=(_={},_[s]=r,_[u]=o,_[i]=n,_)[B]||1,Y=this.$d.getTime()+N*j;return R.w(Y,this)},L.subtract=function(N,H){return this.add(-1*N,H)},L.format=function(N){var H=this,_=this.$locale();if(!this.isValid())return _.invalidDate||w;var z=N||"YYYY-MM-DDTHH:mm:ssZ",B=R.z(this),A=this.$H,j=this.$m,Y=this.$M,U=_.weekdays,ne=_.months,te=_.meridiem,J=function(Z,O,I,W){return Z&&(Z[O]||Z(H,z))||I[O].slice(0,W)},G=function(Z){return R.s(A%12||12,Z,"0")},q=te||function(Z,O,I){var W=Z<12?"AM":"PM";return I?W.toLowerCase():W};return z.replace(p,function(Z,O){return O||function(I){switch(I){case"YY":return String(H.$y).slice(-2);case"YYYY":return R.s(H.$y,4,"0");case"M":return Y+1;case"MM":return R.s(Y+1,2,"0");case"MMM":return J(_.monthsShort,Y,ne,3);case"MMMM":return J(ne,Y);case"D":return H.$D;case"DD":return R.s(H.$D,2,"0");case"d":return String(H.$W);case"dd":return J(_.weekdaysMin,H.$W,U,2);case"ddd":return J(_.weekdaysShort,H.$W,U,3);case"dddd":return U[H.$W];case"H":return String(A);case"HH":return R.s(A,2,"0");case"h":return G(1);case"hh":return G(2);case"a":return q(A,j,!0);case"A":return q(A,j,!1);case"m":return String(j);case"mm":return R.s(j,2,"0");case"s":return String(H.$s);case"ss":return R.s(H.$s,2,"0");case"SSS":return R.s(H.$ms,3,"0");case"Z":return B}return null}(Z)||B.replace(":","")})},L.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},L.diff=function(N,H,_){var z,B=this,A=R.p(H),j=T(N),Y=(j.utcOffset()-this.utcOffset())*r,U=this-j,ne=function(){return R.m(B,j)};switch(A){case m:z=ne()/12;break;case l:z=ne();break;case h:z=ne()/3;break;case f:z=(U-Y)/6048e5;break;case c:z=(U-Y)/864e5;break;case u:z=U/o;break;case s:z=U/r;break;case i:z=U/n;break;default:z=U}return _?z:R.a(z)},L.daysInMonth=function(){return this.endOf(l).$D},L.$locale=function(){return S[this.$L]},L.locale=function(N,H){if(!N)return this.$L;var _=this.clone(),z=k(N,H,!0);return z&&(_.$L=z),_},L.clone=function(){return R.w(this.$d,this)},L.toDate=function(){return new Date(this.valueOf())},L.toJSON=function(){return this.isValid()?this.toISOString():null},L.toISOString=function(){return this.$d.toISOString()},L.toString=function(){return this.$d.toUTCString()},$}(),V=F.prototype;return T.prototype=V,[["$ms",a],["$s",i],["$m",s],["$H",u],["$W",c],["$M",l],["$y",m],["$D",y]].forEach(function($){V[$[1]]=function(L){return this.$g(L,$[0],$[1])}}),T.extend=function($,L){return $.$i||($(L,F,T),$.$i=!0),T},T.locale=k,T.isDayjs=M,T.unix=function($){return T(1e3*$)},T.en=S[x],T.Ls=S,T.p={},T})}(ai)),ai.exports}var ii={exports:{}},lC=ii.exports,rv;function uC(){return rv||(rv=1,function(e,t){(function(n,r){e.exports=r()})(lC,function(){return function(n,r){r.prototype.weekday=function(o){var a=this.$locale().weekStart||0,i=this.$W,s=(i<a?i+7:i)-a;return this.$utils().u(o)?s:this.subtract(s,"day").add(o,"day")}}})}(ii)),ii.exports}var si={exports:{}},cC=si.exports,ov;function dC(){return ov||(ov=1,function(e,t){(function(n,r){e.exports=r()})(cC,function(){return function(n,r,o){var a=r.prototype,i=function(l){return l&&(l.indexOf?l:l.s)},s=function(l,h,m,y,w){var v=l.name?l:l.$locale(),p=i(v[h]),g=i(v[m]),b=p||g.map(function(x){return x.slice(0,y)});if(!w)return b;var C=v.weekStart;return b.map(function(x,S){return b[(S+(C||0))%7]})},u=function(){return o.Ls[o.locale()]},c=function(l,h){return l.formats[h]||function(m){return m.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(y,w,v){return w||v.slice(1)})}(l.formats[h.toUpperCase()])},f=function(){var l=this;return{months:function(h){return h?h.format("MMMM"):s(l,"months")},monthsShort:function(h){return h?h.format("MMM"):s(l,"monthsShort","months",3)},firstDayOfWeek:function(){return l.$locale().weekStart||0},weekdays:function(h){return h?h.format("dddd"):s(l,"weekdays")},weekdaysMin:function(h){return h?h.format("dd"):s(l,"weekdaysMin","weekdays",2)},weekdaysShort:function(h){return h?h.format("ddd"):s(l,"weekdaysShort","weekdays",3)},longDateFormat:function(h){return c(l.$locale(),h)},meridiem:this.$locale().meridiem,ordinal:this.$locale().ordinal}};a.localeData=function(){return f.bind(this)()},o.localeData=function(){var l=u();return{firstDayOfWeek:function(){return l.weekStart||0},weekdays:function(){return o.weekdays()},weekdaysShort:function(){return o.weekdaysShort()},weekdaysMin:function(){return o.weekdaysMin()},months:function(){return o.months()},monthsShort:function(){return o.monthsShort()},longDateFormat:function(h){return c(l,h)},meridiem:l.meridiem,ordinal:l.ordinal}},o.months=function(){return s(u(),"months")},o.monthsShort=function(){return s(u(),"monthsShort","months",3)},o.weekdays=function(l){return s(u(),"weekdays",null,null,l)},o.weekdaysShort=function(l){return s(u(),"weekdaysShort","weekdays",3,l)},o.weekdaysMin=function(l){return s(u(),"weekdaysMin","weekdays",2,l)}}})}(si)),si.exports}var li={exports:{}},fC=li.exports,av;function vC(){return av||(av=1,function(e,t){(function(n,r){e.exports=r()})(fC,function(){var n="week",r="year";return function(o,a,i){var s=a.prototype;s.week=function(u){if(u===void 0&&(u=null),u!==null)return this.add(7*(u-this.week()),"day");var c=this.$locale().yearStart||1;if(this.month()===11&&this.date()>25){var f=i(this).startOf(r).add(1,r).date(c),l=i(this).endOf(n);if(f.isBefore(l))return 1}var h=i(this).startOf(r).date(c).startOf(n).subtract(1,"millisecond"),m=this.diff(h,n,!0);return m<0?i(this).startOf("week").week():Math.ceil(m)},s.weeks=function(u){return u===void 0&&(u=null),this.week(u)}}})}(li)),li.exports}var ui={exports:{}},mC=ui.exports,iv;function hC(){return iv||(iv=1,function(e,t){(function(n,r){e.exports=r()})(mC,function(){return function(n,r){r.prototype.weekYear=function(){var o=this.month(),a=this.week(),i=this.year();return a===1&&o===11?i+1:o===0&&a>=52?i-1:i}}})}(ui)),ui.exports}var ci={exports:{}},pC=ci.exports,sv;function gC(){return sv||(sv=1,function(e,t){(function(n,r){e.exports=r()})(pC,function(){return function(n,r){var o=r.prototype,a=o.format;o.format=function(i){var s=this,u=this.$locale();if(!this.isValid())return a.bind(this)(i);var c=this.$utils(),f=(i||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,function(l){switch(l){case"Q":return Math.ceil((s.$M+1)/3);case"Do":return u.ordinal(s.$D);case"gggg":return s.weekYear();case"GGGG":return s.isoWeekYear();case"wo":return u.ordinal(s.week(),"W");case"w":case"ww":return c.s(s.week(),l==="w"?1:2,"0");case"W":case"WW":return c.s(s.isoWeek(),l==="W"?1:2,"0");case"k":case"kk":return c.s(String(s.$H===0?24:s.$H),l==="k"?1:2,"0");case"X":return Math.floor(s.$d.getTime()/1e3);case"x":return s.$d.getTime();case"z":return"["+s.offsetName()+"]";case"zzz":return"["+s.offsetName("long")+"]";default:return l}});return a.bind(this)(f)}}})}(ci)),ci.exports}var di={exports:{}},yC=di.exports,lv;function bC(){return lv||(lv=1,function(e,t){(function(n,r){e.exports=r()})(yC,function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},r=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,o=/\d/,a=/\d\d/,i=/\d\d?/,s=/\d*[^-_:/,()\s\d]+/,u={},c=function(v){return(v=+v)+(v>68?1900:2e3)},f=function(v){return function(p){this[v]=+p}},l=[/[+-]\d\d:?(\d\d)?|Z/,function(v){(this.zone||(this.zone={})).offset=function(p){if(!p||p==="Z")return 0;var g=p.match(/([+-]|\d\d)/g),b=60*g[1]+(+g[2]||0);return b===0?0:g[0]==="+"?-b:b}(v)}],h=function(v){var p=u[v];return p&&(p.indexOf?p:p.s.concat(p.f))},m=function(v,p){var g,b=u.meridiem;if(b){for(var C=1;C<=24;C+=1)if(v.indexOf(b(C,0,p))>-1){g=C>12;break}}else g=v===(p?"pm":"PM");return g},y={A:[s,function(v){this.afternoon=m(v,!1)}],a:[s,function(v){this.afternoon=m(v,!0)}],Q:[o,function(v){this.month=3*(v-1)+1}],S:[o,function(v){this.milliseconds=100*+v}],SS:[a,function(v){this.milliseconds=10*+v}],SSS:[/\d{3}/,function(v){this.milliseconds=+v}],s:[i,f("seconds")],ss:[i,f("seconds")],m:[i,f("minutes")],mm:[i,f("minutes")],H:[i,f("hours")],h:[i,f("hours")],HH:[i,f("hours")],hh:[i,f("hours")],D:[i,f("day")],DD:[a,f("day")],Do:[s,function(v){var p=u.ordinal,g=v.match(/\d+/);if(this.day=g[0],p)for(var b=1;b<=31;b+=1)p(b).replace(/\[|\]/g,"")===v&&(this.day=b)}],w:[i,f("week")],ww:[a,f("week")],M:[i,f("month")],MM:[a,f("month")],MMM:[s,function(v){var p=h("months"),g=(h("monthsShort")||p.map(function(b){return b.slice(0,3)})).indexOf(v)+1;if(g<1)throw new Error;this.month=g%12||g}],MMMM:[s,function(v){var p=h("months").indexOf(v)+1;if(p<1)throw new Error;this.month=p%12||p}],Y:[/[+-]?\d+/,f("year")],YY:[a,function(v){this.year=c(v)}],YYYY:[/\d{4}/,f("year")],Z:l,ZZ:l};function w(v){var p,g;p=v,g=u&&u.formats;for(var b=(v=p.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(T,R,F){var V=F&&F.toUpperCase();return R||g[F]||n[F]||g[V].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function($,L,N){return L||N.slice(1)})})).match(r),C=b.length,x=0;x<C;x+=1){var S=b[x],E=y[S],M=E&&E[0],k=E&&E[1];b[x]=k?{regex:M,parser:k}:S.replace(/^\[|\]$/g,"")}return function(T){for(var R={},F=0,V=0;F<C;F+=1){var $=b[F];if(typeof $=="string")V+=$.length;else{var L=$.regex,N=$.parser,H=T.slice(V),_=L.exec(H)[0];N.call(R,_),T=T.replace(_,"")}}return function(z){var B=z.afternoon;if(B!==void 0){var A=z.hours;B?A<12&&(z.hours+=12):A===12&&(z.hours=0),delete z.afternoon}}(R),R}}return function(v,p,g){g.p.customParseFormat=!0,v&&v.parseTwoDigitYear&&(c=v.parseTwoDigitYear);var b=p.prototype,C=b.parse;b.parse=function(x){var S=x.date,E=x.utc,M=x.args;this.$u=E;var k=M[1];if(typeof k=="string"){var T=M[2]===!0,R=M[3]===!0,F=T||R,V=M[2];R&&(V=M[2]),u=this.$locale(),!T&&V&&(u=g.Ls[V]),this.$d=function(H,_,z,B){try{if(["x","X"].indexOf(_)>-1)return new Date((_==="X"?1e3:1)*H);var A=w(_)(H),j=A.year,Y=A.month,U=A.day,ne=A.hours,te=A.minutes,J=A.seconds,G=A.milliseconds,q=A.zone,Z=A.week,O=new Date,I=U||(j||Y?1:O.getDate()),W=j||O.getFullYear(),K=0;j&&!Y||(K=Y>0?Y-1:O.getMonth());var oe,Q=ne||0,ae=te||0,ee=J||0,ie=G||0;return q?new Date(Date.UTC(W,K,I,Q,ae,ee,ie+60*q.offset*1e3)):z?new Date(Date.UTC(W,K,I,Q,ae,ee,ie)):(oe=new Date(W,K,I,Q,ae,ee,ie),Z&&(oe=B(oe).week(Z).toDate()),oe)}catch{return new Date("")}}(S,k,E,g),this.init(),V&&V!==!0&&(this.$L=this.locale(V).$L),F&&S!=this.format(k)&&(this.$d=new Date("")),u={}}else if(k instanceof Array)for(var $=k.length,L=1;L<=$;L+=1){M[1]=k[L-1];var N=g.apply(this,M);if(N.isValid()){this.$d=N.$d,this.$L=N.$L,this.init();break}L===$&&(this.$d=new Date(""))}else C.call(this,x)}}})}(di)),di.exports}var uv;function wC(){if(uv)return _o;uv=1;var e=aC().default;Object.defineProperty(_o,"__esModule",{value:!0}),_o.default=void 0;var t=e(sC()),n=e(uC()),r=e(dC()),o=e(vC()),a=e(hC()),i=e(gC()),s=e(bC());t.default.extend(s.default),t.default.extend(i.default),t.default.extend(n.default),t.default.extend(r.default),t.default.extend(o.default),t.default.extend(a.default),t.default.extend(function(l,h){var m=h.prototype,y=m.format;m.format=function(v){var p=(v||"").replace("Wo","wo");return y.bind(this)(p)}});var u={bn_BD:"bn-bd",by_BY:"be",en_GB:"en-gb",en_US:"en",fr_BE:"fr",fr_CA:"fr-ca",hy_AM:"hy-am",kmr_IQ:"ku",nl_BE:"nl-be",pt_BR:"pt-br",zh_CN:"zh-cn",zh_HK:"zh-hk",zh_TW:"zh-tw"},c=function(h){var m=u[h];return m||h.split("_")[0]},f={getNow:function(){var h=(0,t.default)();return typeof h.tz=="function"?h.tz():h},getFixedDate:function(h){return(0,t.default)(h,["YYYY-M-DD","YYYY-MM-DD"])},getEndDate:function(h){return h.endOf("month")},getWeekDay:function(h){var m=h.locale("en");return m.weekday()+m.localeData().firstDayOfWeek()},getYear:function(h){return h.year()},getMonth:function(h){return h.month()},getDate:function(h){return h.date()},getHour:function(h){return h.hour()},getMinute:function(h){return h.minute()},getSecond:function(h){return h.second()},getMillisecond:function(h){return h.millisecond()},addYear:function(h,m){return h.add(m,"year")},addMonth:function(h,m){return h.add(m,"month")},addDate:function(h,m){return h.add(m,"day")},setYear:function(h,m){return h.year(m)},setMonth:function(h,m){return h.month(m)},setDate:function(h,m){return h.date(m)},setHour:function(h,m){return h.hour(m)},setMinute:function(h,m){return h.minute(m)},setSecond:function(h,m){return h.second(m)},setMillisecond:function(h,m){return h.millisecond(m)},isAfter:function(h,m){return h.isAfter(m)},isValidate:function(h){return h.isValid()},locale:{getWeekFirstDay:function(h){return(0,t.default)().locale(c(h)).localeData().firstDayOfWeek()},getWeekFirstDate:function(h,m){return m.locale(c(h)).weekday(0)},getWeek:function(h,m){return m.locale(c(h)).week()},getShortWeekDays:function(h){return(0,t.default)().locale(c(h)).localeData().weekdaysMin()},getShortMonths:function(h){return(0,t.default)().locale(c(h)).localeData().monthsShort()},format:function(h,m,y){return m.locale(c(h)).format(y)},parse:function(h,m,y){for(var w=c(h),v=0;v<y.length;v+=1){var p=y[v],g=m;if(p.includes("wo")||p.includes("Wo")){for(var b=g.split("-")[0],C=g.split("-")[1],x=(0,t.default)(b,"YYYY").startOf("year").locale(w),S=0;S<=52;S+=1){var E=x.add(S,"week");if(E.format("Wo")===C)return E}return null}var M=(0,t.default)(g,p,!0).locale(w);if(M.isValid())return M}return null}}};return _o.default=f,_o}var CC=wC();const fl=ks(CC),xC=e=>{const{locale:t}=D.useContext(mn);return P.jsx(ti,{...e,prefixCls:"univer-date-picker",generateConfig:fl,locale:t==null?void 0:t.Picker})};function SC(e){const{value:t,onChange:n,...r}=e,{locale:o}=D.useContext(mn);function a(i,s){!Array.isArray(i)&&!Array.isArray(s)&&n(i,s)}return P.jsx(oC,{...r,value:t,prefixCls:"univer-date-picker",generateConfig:fl,locale:o==null?void 0:o.Picker,suffixIcon:P.jsx(Ji,{className:"univer-date-picker-suffix-icon"}),onChange:a})}function EC(e){const{value:t,onChange:n,...r}=e,{locale:o}=D.useContext(mn);function a(i,s){Array.isArray(i)&&Array.isArray(s)&&n(i,s)}return P.jsx(Vw,{...r,value:t,prefixCls:"univer-date-range-picker",generateConfig:fl,locale:o==null?void 0:o.Picker,separator:P.jsx(Iu,{}),suffixIcon:P.jsx(Ji,{className:"univer-date-range-picker-suffix-icon"}),onChange:a})}var vl={exports:{}},No={},Oo={exports:{}},MC=Oo.exports,cv;function ml(){return cv||(cv=1,function(e,t){(function(n,r){r(t)})(MC,function(n){function r(G){return function(Z,O,I,W,K,oe,Q){return G(Z,O,Q)}}function o(G){return function(Z,O,I,W){if(!Z||!O||typeof Z!="object"||typeof O!="object")return G(Z,O,I,W);var K=W.get(Z),oe=W.get(O);if(K&&oe)return K===O&&oe===Z;W.set(Z,O),W.set(O,Z);var Q=G(Z,O,I,W);return W.delete(Z),W.delete(O),Q}}function a(G,q){var Z={};for(var O in G)Z[O]=G[O];for(var O in q)Z[O]=q[O];return Z}function i(G){return G.constructor===Object||G.constructor==null}function s(G){return typeof G.then=="function"}function u(G,q){return G===q||G!==G&&q!==q}var c="[object Arguments]",f="[object Boolean]",l="[object Date]",h="[object RegExp]",m="[object Map]",y="[object Number]",w="[object Object]",v="[object Set]",p="[object String]",g=Object.prototype.toString;function b(G){var q=G.areArraysEqual,Z=G.areDatesEqual,O=G.areMapsEqual,I=G.areObjectsEqual,W=G.areRegExpsEqual,K=G.areSetsEqual,oe=G.createIsNestedEqual,Q=oe(ae);function ae(ee,ie,ve){if(ee===ie)return!0;if(!ee||!ie||typeof ee!="object"||typeof ie!="object")return ee!==ee&&ie!==ie;if(i(ee)&&i(ie))return I(ee,ie,Q,ve);var ye=Array.isArray(ee),de=Array.isArray(ie);if(ye||de)return ye===de&&q(ee,ie,Q,ve);var se=g.call(ee);return se!==g.call(ie)?!1:se===l?Z(ee,ie,Q,ve):se===h?W(ee,ie,Q,ve):se===m?O(ee,ie,Q,ve):se===v?K(ee,ie,Q,ve):se===w||se===c?s(ee)||s(ie)?!1:I(ee,ie,Q,ve):se===f||se===y||se===p?u(ee.valueOf(),ie.valueOf()):!1}return ae}function C(G,q,Z,O){var I=G.length;if(q.length!==I)return!1;for(;I-- >0;)if(!Z(G[I],q[I],I,I,G,q,O))return!1;return!0}var x=o(C);function S(G,q){return u(G.valueOf(),q.valueOf())}function E(G,q,Z,O){var I=G.size===q.size;if(!I)return!1;if(!G.size)return!0;var W={},K=0;return G.forEach(function(oe,Q){if(I){var ae=!1,ee=0;q.forEach(function(ie,ve){!ae&&!W[ee]&&(ae=Z(Q,ve,K,ee,G,q,O)&&Z(oe,ie,Q,ve,G,q,O))&&(W[ee]=!0),ee++}),K++,I=ae}}),I}var M=o(E),k="_owner",T=Object.prototype.hasOwnProperty;function R(G,q,Z,O){var I=Object.keys(G),W=I.length;if(Object.keys(q).length!==W)return!1;for(var K;W-- >0;){if(K=I[W],K===k){var oe=!!G.$$typeof,Q=!!q.$$typeof;if((oe||Q)&&oe!==Q)return!1}if(!T.call(q,K)||!Z(G[K],q[K],K,K,G,q,O))return!1}return!0}var F=o(R);function V(G,q){return G.source===q.source&&G.flags===q.flags}function $(G,q,Z,O){var I=G.size===q.size;if(!I)return!1;if(!G.size)return!0;var W={};return G.forEach(function(K,oe){if(I){var Q=!1,ae=0;q.forEach(function(ee,ie){!Q&&!W[ae]&&(Q=Z(K,ee,oe,ie,G,q,O))&&(W[ae]=!0),ae++}),I=Q}}),I}var L=o($),N=Object.freeze({areArraysEqual:C,areDatesEqual:S,areMapsEqual:E,areObjectsEqual:R,areRegExpsEqual:V,areSetsEqual:$,createIsNestedEqual:r}),H=Object.freeze({areArraysEqual:x,areDatesEqual:S,areMapsEqual:M,areObjectsEqual:F,areRegExpsEqual:V,areSetsEqual:L,createIsNestedEqual:r}),_=b(N);function z(G,q){return _(G,q,void 0)}var B=b(a(N,{createIsNestedEqual:function(){return u}}));function A(G,q){return B(G,q,void 0)}var j=b(H);function Y(G,q){return j(G,q,new WeakMap)}var U=b(a(H,{createIsNestedEqual:function(){return u}}));function ne(G,q){return U(G,q,new WeakMap)}function te(G){return b(a(N,G(N)))}function J(G){var q=b(a(H,G(H)));return function(Z,O,I){return I===void 0&&(I=new WeakMap),q(Z,O,I)}}n.circularDeepEqual=Y,n.circularShallowEqual=ne,n.createCustomCircularEqual=J,n.createCustomEqual=te,n.deepEqual=z,n.sameValueZeroEqual=u,n.shallowEqual=A,Object.defineProperty(n,"__esModule",{value:!0})})}(Oo,Oo.exports)),Oo.exports}var fi={exports:{}},dv;function hl(){if(dv)return fi.exports;dv=1;function e(n){var r,o,a="";if(typeof n=="string"||typeof n=="number")a+=n;else if(typeof n=="object")if(Array.isArray(n)){var i=n.length;for(r=0;r<i;r++)n[r]&&(o=e(n[r]))&&(a&&(a+=" "),a+=o)}else for(o in n)n[o]&&(a&&(a+=" "),a+=o);return a}function t(){for(var n,r,o=0,a="",i=arguments.length;o<i;o++)(n=arguments[o])&&(r=e(n))&&(a&&(a+=" "),a+=r);return a}return fi.exports=t,fi.exports.clsx=t,fi.exports}var st={},pl,fv;function PC(){return fv||(fv=1,pl=function(t,n,r){return t===n?!0:t.className===n.className&&r(t.style,n.style)&&t.width===n.width&&t.autoSize===n.autoSize&&t.cols===n.cols&&t.draggableCancel===n.draggableCancel&&t.draggableHandle===n.draggableHandle&&r(t.verticalCompact,n.verticalCompact)&&r(t.compactType,n.compactType)&&r(t.layout,n.layout)&&r(t.margin,n.margin)&&r(t.containerPadding,n.containerPadding)&&t.rowHeight===n.rowHeight&&t.maxRows===n.maxRows&&t.isBounded===n.isBounded&&t.isDraggable===n.isDraggable&&t.isResizable===n.isResizable&&t.allowOverlap===n.allowOverlap&&t.preventCollision===n.preventCollision&&t.useCSSTransforms===n.useCSSTransforms&&t.transformScale===n.transformScale&&t.isDroppable===n.isDroppable&&r(t.resizeHandles,n.resizeHandles)&&r(t.resizeHandle,n.resizeHandle)&&t.onLayoutChange===n.onLayoutChange&&t.onDragStart===n.onDragStart&&t.onDrag===n.onDrag&&t.onDragStop===n.onDragStop&&t.onResizeStart===n.onResizeStart&&t.onResize===n.onResize&&t.onResizeStop===n.onResizeStop&&t.onDrop===n.onDrop&&r(t.droppingItem,n.droppingItem)&&r(t.innerRef,n.innerRef)}),pl}var vv;function to(){if(vv)return st;vv=1,Object.defineProperty(st,"__esModule",{value:!0}),st.bottom=r,st.childrenEqual=u,st.cloneLayout=o,st.cloneLayoutItem=s,st.collides=f,st.compact=l,st.compactItem=y,st.compactType=G,st.correctBounds=w,st.fastPositionEqual=c,st.fastRGLPropsEqual=void 0,st.getAllCollisions=g,st.getFirstCollision=p,st.getLayoutItem=v,st.getStatics=b,st.modifyLayout=a,st.moveElement=C,st.moveElementAwayFromCollision=x,st.noop=void 0,st.perc=S,st.resizeItemInDirection=B,st.setTopLeft=j,st.setTransform=A,st.sortLayoutItems=Y,st.sortLayoutItemsByColRow=ne,st.sortLayoutItemsByRowCol=U,st.synchronizeLayoutWithChildren=te,st.validateLayout=J,st.withLayoutItem=i;var e=ml(),t=n(D);function n(O){return O&&O.__esModule?O:{default:O}}function r(O){let I=0,W;for(let K=0,oe=O.length;K<oe;K++)W=O[K].y+O[K].h,W>I&&(I=W);return I}function o(O){const I=Array(O.length);for(let W=0,K=O.length;W<K;W++)I[W]=s(O[W]);return I}function a(O,I){const W=Array(O.length);for(let K=0,oe=O.length;K<oe;K++)I.i===O[K].i?W[K]=I:W[K]=O[K];return W}function i(O,I,W){let K=v(O,I);return K?(K=W(s(K)),O=a(O,K),[O,K]):[O,null]}function s(O){return{w:O.w,h:O.h,x:O.x,y:O.y,i:O.i,minW:O.minW,maxW:O.maxW,minH:O.minH,maxH:O.maxH,moved:!!O.moved,static:!!O.static,isDraggable:O.isDraggable,isResizable:O.isResizable,resizeHandles:O.resizeHandles,isBounded:O.isBounded}}function u(O,I){return(0,e.deepEqual)(t.default.Children.map(O,W=>W==null?void 0:W.key),t.default.Children.map(I,W=>W==null?void 0:W.key))&&(0,e.deepEqual)(t.default.Children.map(O,W=>W==null?void 0:W.props["data-grid"]),t.default.Children.map(I,W=>W==null?void 0:W.props["data-grid"]))}st.fastRGLPropsEqual=PC();function c(O,I){return O.left===I.left&&O.top===I.top&&O.width===I.width&&O.height===I.height}function f(O,I){return!(O.i===I.i||O.x+O.w<=I.x||O.x>=I.x+I.w||O.y+O.h<=I.y||O.y>=I.y+I.h)}function l(O,I,W,K){const oe=b(O),Q=Y(O,I),ae=Array(O.length);for(let ee=0,ie=Q.length;ee<ie;ee++){let ve=s(Q[ee]);ve.static||(ve=y(oe,ve,I,W,Q,K),oe.push(ve)),ae[O.indexOf(Q[ee])]=ve,ve.moved=!1}return ae}const h={x:"w",y:"h"};function m(O,I,W,K){const oe=h[K];I[K]+=1;const Q=O.map(ae=>ae.i).indexOf(I.i);for(let ae=Q+1;ae<O.length;ae++){const ee=O[ae];if(!ee.static){if(ee.y>I.y+I.h)break;f(I,ee)&&m(O,ee,W+I[oe],K)}}I[K]=W}function y(O,I,W,K,oe,Q){const ae=W==="vertical",ee=W==="horizontal";if(ae)for(I.y=Math.min(r(O),I.y);I.y>0&&!p(O,I);)I.y--;else if(ee)for(;I.x>0&&!p(O,I);)I.x--;let ie;for(;(ie=p(O,I))&&!(W===null&&Q);)if(ee?m(oe,I,ie.x+ie.w,"x"):m(oe,I,ie.y+ie.h,"y"),ee&&I.x+I.w>K)for(I.x=K-I.w,I.y++;I.x>0&&!p(O,I);)I.x--;return I.y=Math.max(I.y,0),I.x=Math.max(I.x,0),I}function w(O,I){const W=b(O);for(let K=0,oe=O.length;K<oe;K++){const Q=O[K];if(Q.x+Q.w>I.cols&&(Q.x=I.cols-Q.w),Q.x<0&&(Q.x=0,Q.w=I.cols),!Q.static)W.push(Q);else for(;p(W,Q);)Q.y++}return O}function v(O,I){for(let W=0,K=O.length;W<K;W++)if(O[W].i===I)return O[W]}function p(O,I){for(let W=0,K=O.length;W<K;W++)if(f(O[W],I))return O[W]}function g(O,I){return O.filter(W=>f(W,I))}function b(O){return O.filter(I=>I.static)}function C(O,I,W,K,oe,Q,ae,ee,ie){if(I.static&&I.isDraggable!==!0||I.y===K&&I.x===W)return O;`${I.i}${String(W)}${String(K)}${I.x}${I.y}`;const ve=I.x,ye=I.y;typeof W=="number"&&(I.x=W),typeof K=="number"&&(I.y=K),I.moved=!0;let de=Y(O,ae);(ae==="vertical"&&typeof K=="number"?ye>=K:ae==="horizontal"&&typeof W=="number"?ve>=W:!1)&&(de=de.reverse());const He=g(de,I),Le=He.length>0;if(Le&&ie)return o(O);if(Le&&Q)return`${I.i}`,I.x=ve,I.y=ye,I.moved=!1,O;for(let ge=0,Ye=He.length;ge<Ye;ge++){const Fe=He[ge];`${I.i}${I.x}${I.y}${Fe.i}${Fe.x}${Fe.y}`,!Fe.moved&&(Fe.static?O=x(O,Fe,I,oe,ae):O=x(O,I,Fe,oe,ae))}return O}function x(O,I,W,K,oe,Q){const ae=oe==="horizontal",ee=oe==="vertical",ie=I.static;if(K){K=!1;const de={x:ae?Math.max(I.x-W.w,0):W.x,y:ee?Math.max(I.y-W.h,0):W.y,w:W.w,h:W.h,i:"-1"},se=p(O,de),He=se&&se.y+se.h>I.y,Le=se&&I.x+I.w>se.x;if(se){if(He&&ee)return C(O,W,void 0,I.y+1,K,ie,oe);if(He&&oe==null)return I.y=W.y,W.y=W.y+W.h,O;if(Le&&ae)return C(O,I,W.x,void 0,K,ie,oe)}else return`${W.i}${de.x}${de.y}`,C(O,W,ae?de.x:void 0,ee?de.y:void 0,K,ie,oe)}const ve=ae?W.x+1:void 0,ye=ee?W.y+1:void 0;return ve==null&&ye==null?O:C(O,W,ae?W.x+1:void 0,ee?W.y+1:void 0,K,ie,oe)}function S(O){return O*100+"%"}const E=(O,I,W,K)=>O+W>K?I:W,M=(O,I,W)=>O<0?I:W,k=O=>Math.max(0,O),T=O=>Math.max(0,O),R=(O,I,W)=>{let{left:K,height:oe,width:Q}=I;const ae=O.top-(oe-O.height);return{left:K,width:Q,height:M(ae,O.height,oe),top:T(ae)}},F=(O,I,W)=>{let{top:K,left:oe,height:Q,width:ae}=I;return{top:K,height:Q,width:E(O.left,O.width,ae,W),left:k(oe)}},V=(O,I,W)=>{let{top:K,height:oe,width:Q}=I;const ae=O.left-(Q-O.width);return{height:oe,width:ae<0?O.width:E(O.left,O.width,Q,W),top:T(K),left:k(ae)}},$=(O,I,W)=>{let{top:K,left:oe,height:Q,width:ae}=I;return{width:ae,left:oe,height:M(K,O.height,Q),top:T(K)}},z={n:R,ne:function(){return R(arguments.length<=0?void 0:arguments[0],F(...arguments))},e:F,se:function(){return $(arguments.length<=0?void 0:arguments[0],F(...arguments))},s:$,sw:function(){return $(arguments.length<=0?void 0:arguments[0],V(...arguments))},w:V,nw:function(){return R(arguments.length<=0?void 0:arguments[0],V(...arguments))}};function B(O,I,W,K){const oe=z[O];return oe?oe(I,{...I,...W},K):W}function A(O){let{top:I,left:W,width:K,height:oe}=O;const Q=`translate(${W}px,${I}px)`;return{transform:Q,WebkitTransform:Q,MozTransform:Q,msTransform:Q,OTransform:Q,width:`${K}px`,height:`${oe}px`,position:"absolute"}}function j(O){let{top:I,left:W,width:K,height:oe}=O;return{top:`${I}px`,left:`${W}px`,width:`${K}px`,height:`${oe}px`,position:"absolute"}}function Y(O,I){return I==="horizontal"?ne(O):I==="vertical"?U(O):O}function U(O){return O.slice(0).sort(function(I,W){return I.y>W.y||I.y===W.y&&I.x>W.x?1:I.y===W.y&&I.x===W.x?0:-1})}function ne(O){return O.slice(0).sort(function(I,W){return I.x>W.x||I.x===W.x&&I.y>W.y?1:-1})}function te(O,I,W,K,oe){O=O||[];const Q=[];t.default.Children.forEach(I,ee=>{if((ee==null?void 0:ee.key)==null)return;const ie=v(O,String(ee.key)),ve=ee.props["data-grid"];ie&&ve==null?Q.push(s(ie)):ve?Q.push(s({...ve,i:ee.key})):Q.push(s({w:1,h:1,x:0,y:r(Q),i:String(ee.key)}))});const ae=w(Q,{cols:W});return oe?ae:l(ae,K,W)}function J(O){let I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Layout";const W=["x","y","w","h"];if(!Array.isArray(O))throw new Error(I+" must be an array!");for(let K=0,oe=O.length;K<oe;K++){const Q=O[K];for(let ae=0;ae<W.length;ae++){const ee=W[ae],ie=Q[ee];if(typeof ie!="number"||Number.isNaN(ie))throw new Error(`ReactGridLayout: ${I}[${K}].${ee} must be a number! Received: ${ie} (${typeof ie})`)}if(typeof Q.i<"u"&&typeof Q.i!="string")throw new Error(`ReactGridLayout: ${I}[${K}].i must be a string! Received: ${Q.i} (${typeof Q.i})`)}}function G(O){const{verticalCompact:I,compactType:W}=O||{};return I===!1?null:W}function q(){}const Z=()=>{};return st.noop=Z,st}var Yn={},mv;function gl(){if(mv)return Yn;mv=1,Object.defineProperty(Yn,"__esModule",{value:!0}),Yn.calcGridColWidth=e,Yn.calcGridItemPosition=n,Yn.calcGridItemWHPx=t,Yn.calcWH=o,Yn.calcXY=r,Yn.clamp=a;function e(i){const{margin:s,containerPadding:u,containerWidth:c,cols:f}=i;return(c-s[0]*(f-1)-u[0]*2)/f}function t(i,s,u){return Number.isFinite(i)?Math.round(s*i+Math.max(0,i-1)*u):i}function n(i,s,u,c,f,l){const{margin:h,containerPadding:m,rowHeight:y}=i,w=e(i),v={};return l&&l.resizing?(v.width=Math.round(l.resizing.width),v.height=Math.round(l.resizing.height)):(v.width=t(c,w,h[0]),v.height=t(f,y,h[1])),l&&l.dragging?(v.top=Math.round(l.dragging.top),v.left=Math.round(l.dragging.left)):l&&l.resizing&&typeof l.resizing.top=="number"&&typeof l.resizing.left=="number"?(v.top=Math.round(l.resizing.top),v.left=Math.round(l.resizing.left)):(v.top=Math.round((y+h[1])*u+m[1]),v.left=Math.round((w+h[0])*s+m[0])),v}function r(i,s,u,c,f){const{margin:l,containerPadding:h,cols:m,rowHeight:y,maxRows:w}=i,v=e(i);let p=Math.round((u-h[0])/(v+l[0])),g=Math.round((s-h[1])/(y+l[1]));return p=a(p,0,m-c),g=a(g,0,w-f),{x:p,y:g}}function o(i,s,u,c,f,l){const{margin:h,maxRows:m,cols:y,rowHeight:w}=i,v=e(i);let p=Math.round((s+h[0])/(v+h[0])),g=Math.round((u+h[1])/(w+h[1])),b=a(p,0,y-c),C=a(g,0,m-f);return["sw","w","nw"].indexOf(l)!==-1&&(b=a(p,0,y)),["nw","n","ne"].indexOf(l)!==-1&&(C=a(g,0,m)),{w:b,h:C}}function a(i,s,u){return Math.max(Math.min(i,u),s)}return Yn}var To={},yl={exports:{}},bl,hv;function DC(){if(hv)return bl;hv=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return bl=e,bl}var wl,pv;function kC(){if(pv)return wl;pv=1;var e=DC();function t(){}function n(){}return n.resetWarningCache=t,wl=function(){function r(i,s,u,c,f,l){if(l!==e){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}}r.isRequired=r;function o(){return r}var a={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return a.PropTypes=a,a},wl}var gv;function lr(){return gv||(gv=1,yl.exports=kC()()),yl.exports}var Io={exports:{}},Cl={};function yv(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=yv(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function bv(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=yv(e))&&(r&&(r+=" "),r+=t);return r}const _C=vd(Object.freeze(Object.defineProperty({__proto__:null,clsx:bv,default:bv},Symbol.toStringTag,{value:"Module"})));var _t={},ur={},wv;function vi(){if(wv)return ur;wv=1,Object.defineProperty(ur,"__esModule",{value:!0}),ur.dontSetMe=o,ur.findInArray=e,ur.int=r,ur.isFunction=t,ur.isNum=n;function e(a,i){for(let s=0,u=a.length;s<u;s++)if(i.apply(i,[a[s],s,a]))return a[s]}function t(a){return typeof a=="function"||Object.prototype.toString.call(a)==="[object Function]"}function n(a){return typeof a=="number"&&!isNaN(a)}function r(a){return parseInt(a,10)}function o(a,i,s){if(a[i])return new Error("Invalid prop ".concat(i," passed to ").concat(s," - do not set this, set it on the child."))}return ur}var cr={},Cv;function NC(){if(Cv)return cr;Cv=1,Object.defineProperty(cr,"__esModule",{value:!0}),cr.browserPrefixToKey=n,cr.browserPrefixToStyle=r,cr.default=void 0,cr.getPrefix=t;const e=["Moz","Webkit","O","ms"];function t(){var a;let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const s=(a=window.document)===null||a===void 0||(a=a.documentElement)===null||a===void 0?void 0:a.style;if(!s||i in s)return"";for(let u=0;u<e.length;u++)if(n(i,e[u])in s)return e[u];return""}function n(a,i){return i?"".concat(i).concat(o(a)):a}function r(a,i){return i?"-".concat(i.toLowerCase(),"-").concat(a):a}function o(a){let i="",s=!0;for(let u=0;u<a.length;u++)s?(i+=a[u].toUpperCase(),s=!1):a[u]==="-"?s=!0:i+=a[u];return i}return cr.default=t(),cr}var xv;function xl(){if(xv)return _t;xv=1,Object.defineProperty(_t,"__esModule",{value:!0}),_t.addClassName=x,_t.addEvent=s,_t.addUserSelectStyles=b,_t.createCSSTransform=y,_t.createSVGTransform=w,_t.getTouch=p,_t.getTouchIdentifier=g,_t.getTranslation=v,_t.innerHeight=l,_t.innerWidth=h,_t.matchesSelector=a,_t.matchesSelectorAndParentsTo=i,_t.offsetXYFromParent=m,_t.outerHeight=c,_t.outerWidth=f,_t.removeClassName=S,_t.removeEvent=u,_t.removeUserSelectStyles=C;var e=vi(),t=r(NC());function n(E){if(typeof WeakMap!="function")return null;var M=new WeakMap,k=new WeakMap;return(n=function(T){return T?k:M})(E)}function r(E,M){if(E&&E.__esModule)return E;if(E===null||typeof E!="object"&&typeof E!="function")return{default:E};var k=n(M);if(k&&k.has(E))return k.get(E);var T={},R=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var F in E)if(F!=="default"&&Object.prototype.hasOwnProperty.call(E,F)){var V=R?Object.getOwnPropertyDescriptor(E,F):null;V&&(V.get||V.set)?Object.defineProperty(T,F,V):T[F]=E[F]}return T.default=E,k&&k.set(E,T),T}let o="";function a(E,M){return o||(o=(0,e.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(k){return(0,e.isFunction)(E[k])})),(0,e.isFunction)(E[o])?E[o](M):!1}function i(E,M,k){let T=E;do{if(a(T,M))return!0;if(T===k)return!1;T=T.parentNode}while(T);return!1}function s(E,M,k,T){if(!E)return;const R={capture:!0,...T};E.addEventListener?E.addEventListener(M,k,R):E.attachEvent?E.attachEvent("on"+M,k):E["on"+M]=k}function u(E,M,k,T){if(!E)return;const R={capture:!0,...T};E.removeEventListener?E.removeEventListener(M,k,R):E.detachEvent?E.detachEvent("on"+M,k):E["on"+M]=null}function c(E){let M=E.clientHeight;const k=E.ownerDocument.defaultView.getComputedStyle(E);return M+=(0,e.int)(k.borderTopWidth),M+=(0,e.int)(k.borderBottomWidth),M}function f(E){let M=E.clientWidth;const k=E.ownerDocument.defaultView.getComputedStyle(E);return M+=(0,e.int)(k.borderLeftWidth),M+=(0,e.int)(k.borderRightWidth),M}function l(E){let M=E.clientHeight;const k=E.ownerDocument.defaultView.getComputedStyle(E);return M-=(0,e.int)(k.paddingTop),M-=(0,e.int)(k.paddingBottom),M}function h(E){let M=E.clientWidth;const k=E.ownerDocument.defaultView.getComputedStyle(E);return M-=(0,e.int)(k.paddingLeft),M-=(0,e.int)(k.paddingRight),M}function m(E,M,k){const R=M===M.ownerDocument.body?{left:0,top:0}:M.getBoundingClientRect(),F=(E.clientX+M.scrollLeft-R.left)/k,V=(E.clientY+M.scrollTop-R.top)/k;return{x:F,y:V}}function y(E,M){const k=v(E,M,"px");return{[(0,t.browserPrefixToKey)("transform",t.default)]:k}}function w(E,M){return v(E,M,"")}function v(E,M,k){let{x:T,y:R}=E,F="translate(".concat(T).concat(k,",").concat(R).concat(k,")");if(M){const V="".concat(typeof M.x=="string"?M.x:M.x+k),$="".concat(typeof M.y=="string"?M.y:M.y+k);F="translate(".concat(V,", ").concat($,")")+F}return F}function p(E,M){return E.targetTouches&&(0,e.findInArray)(E.targetTouches,k=>M===k.identifier)||E.changedTouches&&(0,e.findInArray)(E.changedTouches,k=>M===k.identifier)}function g(E){if(E.targetTouches&&E.targetTouches[0])return E.targetTouches[0].identifier;if(E.changedTouches&&E.changedTouches[0])return E.changedTouches[0].identifier}function b(E){if(!E)return;let M=E.getElementById("react-draggable-style-el");M||(M=E.createElement("style"),M.type="text/css",M.id="react-draggable-style-el",M.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
1396
+ */var Td;function Lb(){return Td||(Td=1,function(e){(function(){var t={}.hasOwnProperty;function n(){for(var a="",i=0;i<arguments.length;i++){var s=arguments[i];s&&(a=o(a,r(s)))}return a}function r(a){if(typeof a=="string"||typeof a=="number")return a;if(typeof a!="object")return"";if(Array.isArray(a))return n.apply(null,a);if(a.toString!==Object.prototype.toString&&!a.toString.toString().includes("[native code]"))return a.toString();var i="";for(var s in a)t.call(a,s)&&a[s]&&(i=o(i,s));return i}function o(a,i){return i?a?a+" "+i:a+i:a}e.exports?(n.default=n,e.exports=n):window.classNames=n})()}(Fs)),Fs.exports}var $b=Lb();const Xe=ks($b);function Oa(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=[];return D.Children.forEach(e,function(r){r==null&&!t.keepEmpty||(Array.isArray(r)?n=n.concat(Oa(r)):gd(r)&&r.props?n=n.concat(Oa(r.props.children,t)):n.push(r))}),n}function go(e){return e instanceof HTMLElement||e instanceof SVGElement}function Fb(e){return e&&Ct(e)==="object"&&go(e.nativeElement)?e.nativeElement:go(e)?e:null}function Ta(e){var t=Fb(e);if(t)return t;if(e instanceof D.Component){var n;return(n=It.findDOMNode)===null||n===void 0?void 0:n.call(It,e)}return null}var zs=f.createContext(null);function zb(e){var t=e.children,n=e.onBatchResize,r=f.useRef(0),o=f.useRef([]),a=f.useContext(zs),i=f.useCallback(function(s,u,c){r.current+=1;var d=r.current;o.current.push({size:s,element:u,data:c}),Promise.resolve().then(function(){d===r.current&&(n==null||n(o.current),o.current=[])}),a==null||a(s,u,c)},[n,a]);return f.createElement(zs.Provider,{value:i},t)}var Id=function(){if(typeof Map<"u")return Map;function e(t,n){var r=-1;return t.some(function(o,a){return o[0]===n?(r=a,!0):!1}),r}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(n){var r=e(this.__entries__,n),o=this.__entries__[r];return o&&o[1]},t.prototype.set=function(n,r){var o=e(this.__entries__,n);~o?this.__entries__[o][1]=r:this.__entries__.push([n,r])},t.prototype.delete=function(n){var r=this.__entries__,o=e(r,n);~o&&r.splice(o,1)},t.prototype.has=function(n){return!!~e(this.__entries__,n)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(n,r){r===void 0&&(r=null);for(var o=0,a=this.__entries__;o<a.length;o++){var i=a[o];n.call(r,i[1],i[0])}},t}()}(),Hs=typeof window<"u"&&typeof document<"u"&&window.document===document,Ia=function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()}(),Hb=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Ia):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),Vb=2;function Wb(e,t){var n=!1,r=!1,o=0;function a(){n&&(n=!1,e()),r&&s()}function i(){Hb(a)}function s(){var u=Date.now();if(n){if(u-o<Vb)return;r=!0}else n=!0,r=!1,setTimeout(i,t);o=u}return s}var Bb=20,jb=["top","right","bottom","left","width","height","size","weight"],Yb=typeof MutationObserver<"u",Ub=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=Wb(this.refresh.bind(this),Bb)}return e.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},e.prototype.removeObserver=function(t){var n=this.observers_,r=n.indexOf(t);~r&&n.splice(r,1),!n.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){var t=this.updateObservers_();t&&this.refresh()},e.prototype.updateObservers_=function(){var t=this.observers_.filter(function(n){return n.gatherActive(),n.hasActive()});return t.forEach(function(n){return n.broadcastActive()}),t.length>0},e.prototype.connect_=function(){!Hs||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Yb?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!Hs||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var n=t.propertyName,r=n===void 0?"":n,o=jb.some(function(a){return!!~r.indexOf(a)});o&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),Rd=function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n++){var o=r[n];Object.defineProperty(e,o,{value:t[o],enumerable:!1,writable:!1,configurable:!0})}return e},Ur=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||Ia},Ad=Aa(0,0,0,0);function Ra(e){return parseFloat(e)||0}function Ld(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce(function(r,o){var a=e["border-"+o+"-width"];return r+Ra(a)},0)}function qb(e){for(var t=["top","right","bottom","left"],n={},r=0,o=t;r<o.length;r++){var a=o[r],i=e["padding-"+a];n[a]=Ra(i)}return n}function Gb(e){var t=e.getBBox();return Aa(0,0,t.width,t.height)}function Kb(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return Ad;var r=Ur(e).getComputedStyle(e),o=qb(r),a=o.left+o.right,i=o.top+o.bottom,s=Ra(r.width),u=Ra(r.height);if(r.boxSizing==="border-box"&&(Math.round(s+a)!==t&&(s-=Ld(r,"left","right")+a),Math.round(u+i)!==n&&(u-=Ld(r,"top","bottom")+i)),!Zb(e)){var c=Math.round(s+a)-t,d=Math.round(u+i)-n;Math.abs(c)!==1&&(s-=c),Math.abs(d)!==1&&(u-=d)}return Aa(o.left,o.top,s,u)}var Xb=function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof Ur(e).SVGGraphicsElement}:function(e){return e instanceof Ur(e).SVGElement&&typeof e.getBBox=="function"}}();function Zb(e){return e===Ur(e).document.documentElement}function Qb(e){return Hs?Xb(e)?Gb(e):Kb(e):Ad}function Jb(e){var t=e.x,n=e.y,r=e.width,o=e.height,a=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,i=Object.create(a.prototype);return Rd(i,{x:t,y:n,width:r,height:o,top:n,right:t+r,bottom:o+n,left:t}),i}function Aa(e,t,n,r){return{x:e,y:t,width:n,height:r}}var e1=function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Aa(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=Qb(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},e}(),t1=function(){function e(t,n){var r=Jb(n);Rd(this,{target:t,contentRect:r})}return e}(),n1=function(){function e(t,n,r){if(this.activeObservations_=[],this.observations_=new Id,typeof t!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=n,this.callbackCtx_=r}return e.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof Ur(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new e1(t)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof Ur(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)&&(n.delete(t),n.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&t.activeObservations_.push(n)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,n=this.activeObservations_.map(function(r){return new t1(r.target,r.broadcastRect())});this.callback_.call(t,n,t),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),$d=typeof WeakMap<"u"?new WeakMap:new Id,Fd=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=Ub.getInstance(),r=new n1(t,n,this);$d.set(this,r)}return e}();["observe","unobserve","disconnect"].forEach(function(e){Fd.prototype[e]=function(){var t;return(t=$d.get(this))[e].apply(t,arguments)}});var zd=function(){return typeof Ia.ResizeObserver<"u"?Ia.ResizeObserver:Fd}();const r1=Object.freeze(Object.defineProperty({__proto__:null,default:zd},Symbol.toStringTag,{value:"Module"}));var rr=new Map;function o1(e){e.forEach(function(t){var n,r=t.target;(n=rr.get(r))===null||n===void 0||n.forEach(function(o){return o(r)})})}var Hd=new zd(o1);function a1(e,t){rr.has(e)||(rr.set(e,new Set),Hd.observe(e)),rr.get(e).add(t)}function i1(e,t){rr.has(e)&&(rr.get(e).delete(t),rr.get(e).size||(Hd.unobserve(e),rr.delete(e)))}function qr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Vd(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,cd(r.key),r)}}function Gr(e,t,n){return t&&Vd(e.prototype,t),n&&Vd(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function La(e,t){return La=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},La(e,t)}function $a(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&La(e,t)}function Fa(e){return Fa=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Fa(e)}function Wd(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Wd=function(){return!!e})()}function Vs(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function s1(e,t){if(t&&(Ct(t)=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Vs(e)}function za(e){var t=Wd();return function(){var n,r=Fa(e);if(t){var o=Fa(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return s1(this,n)}}var l1=function(e){$a(n,e);var t=za(n);function n(){return qr(this,n),t.apply(this,arguments)}return Gr(n,[{key:"render",value:function(){return this.props.children}}]),n}(f.Component);function u1(e,t){var n=e.children,r=e.disabled,o=f.useRef(null),a=f.useRef(null),i=f.useContext(zs),s=typeof n=="function",u=s?n(o):n,c=f.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),d=!s&&f.isValidElement(u)&&Yr(u),l=d?ho(u):null,h=Na(l,o),m=function(){var p;return Ta(o.current)||(o.current&&Ct(o.current)==="object"?Ta((p=o.current)===null||p===void 0?void 0:p.nativeElement):null)||Ta(a.current)};f.useImperativeHandle(t,function(){return m()});var y=f.useRef(e);y.current=e;var w=f.useCallback(function(v){var p=y.current,g=p.onResize,b=p.data,C=v.getBoundingClientRect(),x=C.width,S=C.height,E=v.offsetWidth,M=v.offsetHeight,k=Math.floor(x),T=Math.floor(S);if(c.current.width!==k||c.current.height!==T||c.current.offsetWidth!==E||c.current.offsetHeight!==M){var R={width:k,height:T,offsetWidth:E,offsetHeight:M};c.current=R;var F=E===Math.round(x)?x:E,V=M===Math.round(S)?S:M,$=re(re({},R),{},{offsetWidth:F,offsetHeight:V});i==null||i($,v,b),g&&Promise.resolve().then(function(){g($,v)})}},[]);return f.useEffect(function(){var v=m();return v&&!r&&a1(v,w),function(){return i1(v,w)}},[o.current,r]),f.createElement(l1,{ref:a},d?f.cloneElement(u,{ref:h}):u)}var c1=f.forwardRef(u1),d1="rc-observer-key";function f1(e,t){var n=e.children,r=typeof n=="function"?[n]:Oa(n);return r.map(function(o,a){var i=(o==null?void 0:o.key)||"".concat(d1,"-").concat(a);return f.createElement(c1,_e({},e,{key:i,ref:a===0?t:void 0}),o)})}var jn=f.forwardRef(f1);jn.Collection=zb;function Bd(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}function v1(e){return Bd(e)instanceof ShadowRoot}function Ws(e){return v1(e)?Bd(e):null}function m1(){var e=re({},f);return e.useId}var jd=0,Yd=m1();const h1=Yd?function(t){var n=Yd();return t||n}:function(t){var n=f.useState("ssr-id"),r=X(n,2),o=r[0],a=r[1];return f.useEffect(function(){var i=jd;jd+=1,a("rc_unique_".concat(i))},[]),t||o},p1=function(){if(typeof navigator>"u"||typeof window>"u")return!1;var e=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(e==null?void 0:e.substr(0,4))};var g1=f.createContext({}),y1=function(e){$a(n,e);var t=za(n);function n(){return qr(this,n),t.apply(this,arguments)}return Gr(n,[{key:"render",value:function(){return this.props.children}}]),n}(f.Component);function b1(e){var t=f.useReducer(function(s){return s+1},0),n=X(t,2),r=n[1],o=f.useRef(e),a=ct(function(){return o.current}),i=ct(function(s){o.current=typeof s=="function"?s(o.current):s,r()});return[a,i]}var or="none",Ha="appear",Va="enter",Wa="leave",Ud="none",wn="prepare",Kr="start",Xr="active",Bs="end",qd="prepared";function Gd(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit".concat(e)]="webkit".concat(t),n["Moz".concat(e)]="moz".concat(t),n["ms".concat(e)]="MS".concat(t),n["O".concat(e)]="o".concat(t.toLowerCase()),n}function w1(e,t){var n={animationend:Gd("Animation","AnimationEnd"),transitionend:Gd("Transition","TransitionEnd")};return e&&("AnimationEvent"in t||delete n.animationend.animation,"TransitionEvent"in t||delete n.transitionend.transition),n}var C1=w1(Bn(),typeof window<"u"?window:{}),Kd={};if(Bn()){var x1=document.createElement("div");Kd=x1.style}var Ba={};function Xd(e){if(Ba[e])return Ba[e];var t=C1[e];if(t)for(var n=Object.keys(t),r=n.length,o=0;o<r;o+=1){var a=n[o];if(Object.prototype.hasOwnProperty.call(t,a)&&a in Kd)return Ba[e]=t[a],Ba[e]}return""}var Zd=Xd("animationend"),Qd=Xd("transitionend"),Jd=!!(Zd&&Qd),ef=Zd||"animationend",tf=Qd||"transitionend";function nf(e,t){if(!e)return null;if(Ct(e)==="object"){var n=t.replace(/-\w/g,function(r){return r[1].toUpperCase()});return e[n]}return"".concat(e,"-").concat(t)}const S1=function(e){var t=D.useRef();function n(o){o&&(o.removeEventListener(tf,e),o.removeEventListener(ef,e))}function r(o){t.current&&t.current!==o&&n(t.current),o&&o!==t.current&&(o.addEventListener(tf,e),o.addEventListener(ef,e),t.current=o)}return f.useEffect(function(){return function(){n(t.current)}},[]),[r,n]};var rf=Bn()?D.useLayoutEffect:D.useEffect,of=function(t){return+setTimeout(t,16)},af=function(t){return clearTimeout(t)};typeof window<"u"&&"requestAnimationFrame"in window&&(of=function(t){return window.requestAnimationFrame(t)},af=function(t){return window.cancelAnimationFrame(t)});var sf=0,js=new Map;function lf(e){js.delete(e)}var mt=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;sf+=1;var r=sf;function o(a){if(a===0)lf(r),t();else{var i=of(function(){o(a-1)});js.set(r,i)}}return o(n),r};mt.cancel=function(e){var t=js.get(e);return lf(e),af(t)};const E1=function(){var e=f.useRef(null);function t(){mt.cancel(e.current)}function n(r){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;t();var a=mt(function(){o<=1?r({isCanceled:function(){return a!==e.current}}):n(r,o-1)});e.current=a}return f.useEffect(function(){return function(){t()}},[]),[n,t]};var M1=[wn,Kr,Xr,Bs],P1=[wn,qd],uf=!1,D1=!0;function cf(e){return e===Xr||e===Bs}const k1=function(e,t,n){var r=mo(Ud),o=X(r,2),a=o[0],i=o[1],s=E1(),u=X(s,2),c=u[0],d=u[1];function l(){i(wn,!0)}var h=t?P1:M1;return rf(function(){if(a!==Ud&&a!==Bs){var m=h.indexOf(a),y=h[m+1],w=n(a);w===uf?i(y,!0):y&&c(function(v){function p(){v.isCanceled()||i(y,!0)}w===!0?p():Promise.resolve(w).then(p)})}},[e,a]),f.useEffect(function(){return function(){d()}},[]),[l,a]};function N1(e,t,n,r){var o=r.motionEnter,a=o===void 0?!0:o,i=r.motionAppear,s=i===void 0?!0:i,u=r.motionLeave,c=u===void 0?!0:u,d=r.motionDeadline,l=r.motionLeaveImmediately,h=r.onAppearPrepare,m=r.onEnterPrepare,y=r.onLeavePrepare,w=r.onAppearStart,v=r.onEnterStart,p=r.onLeaveStart,g=r.onAppearActive,b=r.onEnterActive,C=r.onLeaveActive,x=r.onAppearEnd,S=r.onEnterEnd,E=r.onLeaveEnd,M=r.onVisibleChanged,k=mo(),T=X(k,2),R=T[0],F=T[1],V=b1(or),$=X(V,2),L=$[0],_=$[1],H=mo(null),N=X(H,2),z=N[0],B=N[1],A=L(),j=D.useRef(!1),Y=D.useRef(null);function U(){return n()}var ne=D.useRef(!1);function te(){_(or),B(null,!0)}var J=ct(function(ye){var de=L();if(de!==or){var se=U();if(!(ye&&!ye.deadline&&ye.target!==se)){var He=ne.current,Le;de===Ha&&He?Le=x==null?void 0:x(se,ye):de===Va&&He?Le=S==null?void 0:S(se,ye):de===Wa&&He&&(Le=E==null?void 0:E(se,ye)),He&&Le!==!1&&te()}}}),G=S1(J),q=X(G,1),Z=q[0],O=function(de){switch(de){case Ha:return ce(ce(ce({},wn,h),Kr,w),Xr,g);case Va:return ce(ce(ce({},wn,m),Kr,v),Xr,b);case Wa:return ce(ce(ce({},wn,y),Kr,p),Xr,C);default:return{}}},I=f.useMemo(function(){return O(A)},[A]),W=k1(A,!e,function(ye){if(ye===wn){var de=I[wn];return de?de(U()):uf}if(Q in I){var se;B(((se=I[Q])===null||se===void 0?void 0:se.call(I,U(),null))||null)}return Q===Xr&&A!==or&&(Z(U()),d>0&&(clearTimeout(Y.current),Y.current=setTimeout(function(){J({deadline:!0})},d))),Q===qd&&te(),D1}),K=X(W,2),oe=K[0],Q=K[1],ae=cf(Q);ne.current=ae;var ee=D.useRef(null);rf(function(){if(!(j.current&&ee.current===t)){F(t);var ye=j.current;j.current=!0;var de;!ye&&t&&s&&(de=Ha),ye&&t&&a&&(de=Va),(ye&&!t&&c||!ye&&l&&!t&&c)&&(de=Wa);var se=O(de);de&&(e||se[wn])?(_(de),oe()):_(or),ee.current=t}},[t]),D.useEffect(function(){(A===Ha&&!s||A===Va&&!a||A===Wa&&!c)&&_(or)},[s,a,c]),D.useEffect(function(){return function(){j.current=!1,clearTimeout(Y.current)}},[]);var ie=f.useRef(!1);D.useEffect(function(){R&&(ie.current=!0),R!==void 0&&A===or&&((ie.current||R)&&(M==null||M(R)),ie.current=!0)},[R,A]);var me=z;return I[wn]&&Q===Kr&&(me=re({transition:"none"},me)),[A,Q,me,R!=null?R:t]}function _1(e){var t=e;Ct(e)==="object"&&(t=e.transitionSupport);function n(o,a){return!!(o.motionName&&t&&a!==!1)}var r=f.forwardRef(function(o,a){var i=o.visible,s=i===void 0?!0:i,u=o.removeOnLeave,c=u===void 0?!0:u,d=o.forceRender,l=o.children,h=o.motionName,m=o.leavedClassName,y=o.eventProps,w=f.useContext(g1),v=w.motion,p=n(o,v),g=D.useRef(),b=D.useRef();function C(){try{return g.current instanceof HTMLElement?g.current:Ta(b.current)}catch{return null}}var x=N1(p,s,C,o),S=X(x,4),E=S[0],M=S[1],k=S[2],T=S[3],R=f.useRef(T);T&&(R.current=!0);var F=f.useCallback(function(N){g.current=N,Os(a,N)},[a]),V,$=re(re({},y),{},{visible:s});if(!l)V=null;else if(E===or)T?V=l(re({},$),F):!c&&R.current&&m?V=l(re(re({},$),{},{className:m}),F):d||!c&&!m?V=l(re(re({},$),{},{style:{display:"none"}}),F):V=null;else{var L;M===wn?L="prepare":cf(M)?L="active":M===Kr&&(L="start");var _=nf(h,"".concat(E,"-").concat(L));V=l(re(re({},$),{},{className:Xe(nf(h,E),ce(ce({},_,_&&L),h,typeof h=="string")),style:k}),F)}if(f.isValidElement(V)&&Yr(V)){var H=ho(V);H||(V=f.cloneElement(V,{ref:F}))}return f.createElement(y1,{ref:b},V)});return r.displayName="CSSMotion",r}const ja=_1(Jd);var Ys="add",Us="keep",qs="remove",Gs="removed";function O1(e){var t;return e&&Ct(e)==="object"&&"key"in e?t=e:t={key:e},re(re({},t),{},{key:String(t.key)})}function Ks(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return e.map(O1)}function T1(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=[],r=0,o=t.length,a=Ks(e),i=Ks(t);a.forEach(function(c){for(var d=!1,l=r;l<o;l+=1){var h=i[l];if(h.key===c.key){r<l&&(n=n.concat(i.slice(r,l).map(function(m){return re(re({},m),{},{status:Ys})})),r=l),n.push(re(re({},h),{},{status:Us})),r+=1,d=!0;break}}d||n.push(re(re({},c),{},{status:qs}))}),r<o&&(n=n.concat(i.slice(r).map(function(c){return re(re({},c),{},{status:Ys})})));var s={};n.forEach(function(c){var d=c.key;s[d]=(s[d]||0)+1});var u=Object.keys(s).filter(function(c){return s[c]>1});return u.forEach(function(c){n=n.filter(function(d){var l=d.key,h=d.status;return l!==c||h!==qs}),n.forEach(function(d){d.key===c&&(d.status=Us)})}),n}var I1=["component","children","onVisibleChanged","onAllRemoved"],R1=["status"],A1=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearPrepare","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function L1(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ja,n=function(r){$a(a,r);var o=za(a);function a(){var i;qr(this,a);for(var s=arguments.length,u=new Array(s),c=0;c<s;c++)u[c]=arguments[c];return i=o.call.apply(o,[this].concat(u)),ce(Vs(i),"state",{keyEntities:[]}),ce(Vs(i),"removeKey",function(d){i.setState(function(l){var h=l.keyEntities.map(function(m){return m.key!==d?m:re(re({},m),{},{status:Gs})});return{keyEntities:h}},function(){var l=i.state.keyEntities,h=l.filter(function(m){var y=m.status;return y!==Gs}).length;h===0&&i.props.onAllRemoved&&i.props.onAllRemoved()})}),i}return Gr(a,[{key:"render",value:function(){var s=this,u=this.state.keyEntities,c=this.props,d=c.component,l=c.children,h=c.onVisibleChanged;c.onAllRemoved;var m=pt(c,I1),y=d||f.Fragment,w={};return A1.forEach(function(v){w[v]=m[v],delete m[v]}),delete m.keys,f.createElement(y,m,u.map(function(v,p){var g=v.status,b=pt(v,R1),C=g===Ys||g===Us;return f.createElement(t,_e({},w,{key:b.key,visible:C,eventProps:b,onVisibleChanged:function(S){h==null||h(S,{key:b.key}),S||s.removeKey(b.key)}}),function(x,S){return l(re(re({},x),{},{index:p}),S)})}))}}],[{key:"getDerivedStateFromProps",value:function(s,u){var c=s.keys,d=u.keyEntities,l=Ks(c),h=T1(d,l);return{keyEntities:h.filter(function(m){var y=d.find(function(w){var v=w.key;return m.key===v});return!(y&&y.status===Gs&&m.status===qs)})}}}]),a}(f.Component);return ce(n,"defaultProps",{component:"div"}),n}L1(Jd);function $1(e){var t=e.prefixCls,n=e.align,r=e.arrow,o=e.arrowPos,a=r||{},i=a.className,s=a.content,u=o.x,c=u===void 0?0:u,d=o.y,l=d===void 0?0:d,h=f.useRef();if(!n||!n.points)return null;var m={position:"absolute"};if(n.autoArrow!==!1){var y=n.points[0],w=n.points[1],v=y[0],p=y[1],g=w[0],b=w[1];v===g||!["t","b"].includes(v)?m.top=l:v==="t"?m.top=0:m.bottom=0,p===b||!["l","r"].includes(p)?m.left=c:p==="l"?m.left=0:m.right=0}return f.createElement("div",{ref:h,className:Xe("".concat(t,"-arrow"),i),style:m},s)}function F1(e){var t=e.prefixCls,n=e.open,r=e.zIndex,o=e.mask,a=e.motion;return o?f.createElement(ja,_e({},a,{motionAppear:!0,visible:n,removeOnLeave:!0}),function(i){var s=i.className;return f.createElement("div",{style:{zIndex:r},className:Xe("".concat(t,"-mask"),s)})}):null}var z1=f.memo(function(e){var t=e.children;return t},function(e,t){return t.cache}),H1=f.forwardRef(function(e,t){var n=e.popup,r=e.className,o=e.prefixCls,a=e.style,i=e.target,s=e.onVisibleChanged,u=e.open,c=e.keepDom,d=e.fresh,l=e.onClick,h=e.mask,m=e.arrow,y=e.arrowPos,w=e.align,v=e.motion,p=e.maskMotion,g=e.forceRender,b=e.getPopupContainer,C=e.autoDestroy,x=e.portal,S=e.zIndex,E=e.onMouseEnter,M=e.onMouseLeave,k=e.onPointerEnter,T=e.onPointerDownCapture,R=e.ready,F=e.offsetX,V=e.offsetY,$=e.offsetR,L=e.offsetB,_=e.onAlign,H=e.onPrepare,N=e.stretch,z=e.targetWidth,B=e.targetHeight,A=typeof n=="function"?n():n,j=u||c,Y=(b==null?void 0:b.length)>0,U=f.useState(!b||!Y),ne=X(U,2),te=ne[0],J=ne[1];if(ht(function(){!te&&Y&&i&&J(!0)},[te,Y,i]),!te)return null;var G="auto",q={left:"-1000vw",top:"-1000vh",right:G,bottom:G};if(R||!u){var Z,O=w.points,I=w.dynamicInset||((Z=w._experimental)===null||Z===void 0?void 0:Z.dynamicInset),W=I&&O[0][1]==="r",K=I&&O[0][0]==="b";W?(q.right=$,q.left=G):(q.left=F,q.right=G),K?(q.bottom=L,q.top=G):(q.top=V,q.bottom=G)}var oe={};return N&&(N.includes("height")&&B?oe.height=B:N.includes("minHeight")&&B&&(oe.minHeight=B),N.includes("width")&&z?oe.width=z:N.includes("minWidth")&&z&&(oe.minWidth=z)),u||(oe.pointerEvents="none"),f.createElement(x,{open:g||j,getContainer:b&&function(){return b(i)},autoDestroy:C},f.createElement(F1,{prefixCls:o,open:u,zIndex:S,mask:h,motion:p}),f.createElement(jn,{onResize:_,disabled:!u},function(Q){return f.createElement(ja,_e({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:g,leavedClassName:"".concat(o,"-hidden")},v,{onAppearPrepare:H,onEnterPrepare:H,visible:u,onVisibleChanged:function(ee){var ie;v==null||(ie=v.onVisibleChanged)===null||ie===void 0||ie.call(v,ee),s(ee)}}),function(ae,ee){var ie=ae.className,me=ae.style,ye=Xe(o,ie,r);return f.createElement("div",{ref:ka(Q,t,ee),className:ye,style:re(re(re(re({"--arrow-x":"".concat(y.x||0,"px"),"--arrow-y":"".concat(y.y||0,"px")},q),oe),me),{},{boxSizing:"border-box",zIndex:S},a),onMouseEnter:E,onMouseLeave:M,onPointerEnter:k,onClick:l,onPointerDownCapture:T},m&&f.createElement($1,{prefixCls:o,arrow:m,arrowPos:y,align:w}),f.createElement(z1,{cache:!u&&!d},A))})}))}),V1=f.forwardRef(function(e,t){var n=e.children,r=e.getTriggerDOMNode,o=Yr(n),a=f.useCallback(function(s){Os(t,r?r(s):s)},[r]),i=Na(a,ho(n));return o?f.cloneElement(n,{ref:i}):n}),df=f.createContext(null);function ff(e){return e?Array.isArray(e)?e:[e]:[]}function W1(e,t,n,r){return f.useMemo(function(){var o=ff(n!=null?n:t),a=ff(r!=null?r:t),i=new Set(o),s=new Set(a);return e&&(i.has("hover")&&(i.delete("hover"),i.add("click")),s.has("hover")&&(s.delete("hover"),s.add("click"))),[i,s]},[e,t,n,r])}const Xs=function(e){if(!e)return!1;if(e instanceof Element){if(e.offsetParent)return!0;if(e.getBBox){var t=e.getBBox(),n=t.width,r=t.height;if(n||r)return!0}if(e.getBoundingClientRect){var o=e.getBoundingClientRect(),a=o.width,i=o.height;if(a||i)return!0}}return!1};function B1(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0;return n?e[0]===t[0]:e[0]===t[0]&&e[1]===t[1]}function j1(e,t,n,r){for(var o=n.points,a=Object.keys(e),i=0;i<a.length;i+=1){var s,u=a[i];if(B1((s=e[u])===null||s===void 0?void 0:s.points,o,r))return"".concat(t,"-placement-").concat(u)}return""}function vf(e,t,n,r){return t||(n?{motionName:"".concat(e,"-").concat(n)}:r?{motionName:r}:null)}function yo(e){return e.ownerDocument.defaultView}function Zs(e){for(var t=[],n=e==null?void 0:e.parentElement,r=["hidden","scroll","clip","auto"];n;){var o=yo(n).getComputedStyle(n),a=o.overflowX,i=o.overflowY,s=o.overflow;[a,i,s].some(function(u){return r.includes(u)})&&t.push(n),n=n.parentElement}return t}function bo(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;return Number.isNaN(e)?t:e}function wo(e){return bo(parseFloat(e),0)}function mf(e,t){var n=re({},e);return(t||[]).forEach(function(r){if(!(r instanceof HTMLBodyElement||r instanceof HTMLHtmlElement)){var o=yo(r).getComputedStyle(r),a=o.overflow,i=o.overflowClipMargin,s=o.borderTopWidth,u=o.borderBottomWidth,c=o.borderLeftWidth,d=o.borderRightWidth,l=r.getBoundingClientRect(),h=r.offsetHeight,m=r.clientHeight,y=r.offsetWidth,w=r.clientWidth,v=wo(s),p=wo(u),g=wo(c),b=wo(d),C=bo(Math.round(l.width/y*1e3)/1e3),x=bo(Math.round(l.height/h*1e3)/1e3),S=(y-w-g-b)*C,E=(h-m-v-p)*x,M=v*x,k=p*x,T=g*C,R=b*C,F=0,V=0;if(a==="clip"){var $=wo(i);F=$*C,V=$*x}var L=l.x+T-F,_=l.y+M-V,H=L+l.width+2*F-T-R-S,N=_+l.height+2*V-M-k-E;n.left=Math.max(n.left,L),n.top=Math.max(n.top,_),n.right=Math.min(n.right,H),n.bottom=Math.min(n.bottom,N)}}),n}function hf(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n="".concat(t),r=n.match(/^(.*)\%$/);return r?e*(parseFloat(r[1])/100):parseFloat(n)}function pf(e,t){var n=t||[],r=X(n,2),o=r[0],a=r[1];return[hf(e.width,o),hf(e.height,a)]}function gf(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return[e[0],e[1]]}function Zr(e,t){var n=t[0],r=t[1],o,a;return n==="t"?a=e.y:n==="b"?a=e.y+e.height:a=e.y+e.height/2,r==="l"?o=e.x:r==="r"?o=e.x+e.width:o=e.x+e.width/2,{x:o,y:a}}function ar(e,t){var n={t:"b",b:"t",l:"r",r:"l"};return e.map(function(r,o){return o===t?n[r]||"c":r}).join("")}function Y1(e,t,n,r,o,a,i){var s=f.useState({ready:!1,offsetX:0,offsetY:0,offsetR:0,offsetB:0,arrowX:0,arrowY:0,scaleX:1,scaleY:1,align:o[r]||{}}),u=X(s,2),c=u[0],d=u[1],l=f.useRef(0),h=f.useMemo(function(){return t?Zs(t):[]},[t]),m=f.useRef({}),y=function(){m.current={}};e||y();var w=ct(function(){if(t&&n&&e){let at=function(gr,yr){var br=arguments.length>2&&arguments[2]!==void 0?arguments[2]:He,la=U.x+gr,Xi=U.y+yr,xu=la+W,Su=Xi+I,Eu=Math.max(la,br.left),Ne=Math.max(Xi,br.top),je=Math.min(xu,br.right),St=Math.min(Su,br.bottom);return Math.max(0,(je-Eu)*(St-Ne))},Dt=function(){Et=U.y+pe,Bt=Et+I,bt=U.x+Se,sn=bt+W};var g,b,C,x,S=t,E=S.ownerDocument,M=yo(S),k=M.getComputedStyle(S),T=k.width,R=k.height,F=k.position,V=S.style.left,$=S.style.top,L=S.style.right,_=S.style.bottom,H=S.style.overflow,N=re(re({},o[r]),a),z=E.createElement("div");(g=S.parentElement)===null||g===void 0||g.appendChild(z),z.style.left="".concat(S.offsetLeft,"px"),z.style.top="".concat(S.offsetTop,"px"),z.style.position=F,z.style.height="".concat(S.offsetHeight,"px"),z.style.width="".concat(S.offsetWidth,"px"),S.style.left="0",S.style.top="0",S.style.right="auto",S.style.bottom="auto",S.style.overflow="hidden";var B;if(Array.isArray(n))B={x:n[0],y:n[1],width:0,height:0};else{var A,j,Y=n.getBoundingClientRect();Y.x=(A=Y.x)!==null&&A!==void 0?A:Y.left,Y.y=(j=Y.y)!==null&&j!==void 0?j:Y.top,B={x:Y.x,y:Y.y,width:Y.width,height:Y.height}}var U=S.getBoundingClientRect();U.x=(b=U.x)!==null&&b!==void 0?b:U.left,U.y=(C=U.y)!==null&&C!==void 0?C:U.top;var ne=E.documentElement,te=ne.clientWidth,J=ne.clientHeight,G=ne.scrollWidth,q=ne.scrollHeight,Z=ne.scrollTop,O=ne.scrollLeft,I=U.height,W=U.width,K=B.height,oe=B.width,Q={left:0,top:0,right:te,bottom:J},ae={left:-O,top:-Z,right:G-O,bottom:q-Z},ee=N.htmlRegion,ie="visible",me="visibleFirst";ee!=="scroll"&&ee!==me&&(ee=ie);var ye=ee===me,de=mf(ae,h),se=mf(Q,h),He=ee===ie?se:de,Le=ye?se:He;S.style.left="auto",S.style.top="auto",S.style.right="0",S.style.bottom="0";var ge=S.getBoundingClientRect();S.style.left=V,S.style.top=$,S.style.right=L,S.style.bottom=_,S.style.overflow=H,(x=S.parentElement)===null||x===void 0||x.removeChild(z);var Ye=bo(Math.round(W/parseFloat(T)*1e3)/1e3),Fe=bo(Math.round(I/parseFloat(R)*1e3)/1e3);if(Ye===0||Fe===0||go(n)&&!Xs(n))return;var ze=N.offset,Ge=N.targetOffset,Ke=pf(U,ze),Ee=X(Ke,2),$e=Ee[0],le=Ee[1],fe=pf(B,Ge),Pe=X(fe,2),ue=Pe[0],he=Pe[1];B.x-=ue,B.y-=he;var Ue=N.points||[],Je=X(Ue,2),nt=Je[0],yt=Je[1],tt=gf(yt),be=gf(nt),We=Zr(B,tt),Oe=Zr(U,be),Ce=re({},N),Se=We.x-Oe.x+$e,pe=We.y-Oe.y+le,Ve=at(Se,pe),dt=at(Se,pe,se),ut=Zr(B,["t","l"]),rt=Zr(U,["t","l"]),Jt=Zr(B,["b","r"]),xt=Zr(U,["b","r"]),Vt=N.overflow||{},en=Vt.adjustX,dn=Vt.adjustY,Wt=Vt.shiftX,_t=Vt.shiftY,Kt=function(yr){return typeof yr=="boolean"?yr:yr>=0},Et,Bt,bt,sn;Dt();var Ot=Kt(dn),fn=be[0]===tt[0];if(Ot&&be[0]==="t"&&(Bt>Le.bottom||m.current.bt)){var we=pe;fn?we-=I-K:we=ut.y-xt.y-le;var Me=at(Se,we),Be=at(Se,we,se);Me>Ve||Me===Ve&&(!ye||Be>=dt)?(m.current.bt=!0,pe=we,le=-le,Ce.points=[ar(be,0),ar(tt,0)]):m.current.bt=!1}if(Ot&&be[0]==="b"&&(Et<Le.top||m.current.tb)){var qe=pe;fn?qe+=I-K:qe=Jt.y-rt.y-le;var it=at(Se,qe),Ft=at(Se,qe,se);it>Ve||it===Ve&&(!ye||Ft>=dt)?(m.current.tb=!0,pe=qe,le=-le,Ce.points=[ar(be,0),ar(tt,0)]):m.current.tb=!1}var Rt=Kt(en),tn=be[1]===tt[1];if(Rt&&be[1]==="l"&&(sn>Le.right||m.current.rl)){var nn=Se;tn?nn-=W-oe:nn=ut.x-xt.x-$e;var Xt=at(nn,pe),zt=at(nn,pe,se);Xt>Ve||Xt===Ve&&(!ye||zt>=dt)?(m.current.rl=!0,Se=nn,$e=-$e,Ce.points=[ar(be,1),ar(tt,1)]):m.current.rl=!1}if(Rt&&be[1]==="r"&&(bt<Le.left||m.current.lr)){var rn=Se;tn?rn+=W-oe:rn=Jt.x-rt.x-$e;var zn=at(rn,pe),Hn=at(rn,pe,se);zn>Ve||zn===Ve&&(!ye||Hn>=dt)?(m.current.lr=!0,Se=rn,$e=-$e,Ce.points=[ar(be,1),ar(tt,1)]):m.current.lr=!1}Dt();var jt=Wt===!0?0:Wt;typeof jt=="number"&&(bt<se.left&&(Se-=bt-se.left-$e,B.x+oe<se.left+jt&&(Se+=B.x-se.left+oe-jt)),sn>se.right&&(Se-=sn-se.right-$e,B.x>se.right-jt&&(Se+=B.x-se.right+jt)));var Yt=_t===!0?0:_t;typeof Yt=="number"&&(Et<se.top&&(pe-=Et-se.top-le,B.y+K<se.top+Yt&&(pe+=B.y-se.top+K-Yt)),Bt>se.bottom&&(pe-=Bt-se.bottom-le,B.y>se.bottom-Yt&&(pe+=B.y-se.bottom+Yt)));var gn=U.x+Se,yn=gn+W,Zt=U.y+pe,Xn=Zt+I,ft=B.x,ot=ft+oe,lt=B.y,Tt=lt+K,Te=Math.max(gn,ft),Re=Math.min(yn,ot),Mt=(Te+Re)/2,Qt=Mt-gn,Pn=Math.max(Zt,lt),Zn=Math.min(Xn,Tt),Dn=(Pn+Zn)/2,Qn=Dn-Zt;i==null||i(t,Ce);var Ze=ge.right-U.x-(Se+U.width),Ae=ge.bottom-U.y-(pe+U.height);Ye===1&&(Se=Math.round(Se),Ze=Math.round(Ze)),Fe===1&&(pe=Math.round(pe),Ae=Math.round(Ae));var Qe={ready:!0,offsetX:Se/Ye,offsetY:pe/Fe,offsetR:Ze/Ye,offsetB:Ae/Fe,arrowX:Qt/Ye,arrowY:Qn/Fe,scaleX:Ye,scaleY:Fe,align:Ce};d(Qe)}}),v=function(){l.current+=1;var b=l.current;Promise.resolve().then(function(){l.current===b&&w()})},p=function(){d(function(b){return re(re({},b),{},{ready:!1})})};return ht(p,[r]),ht(function(){e||p()},[e]),[c.ready,c.offsetX,c.offsetY,c.offsetR,c.offsetB,c.arrowX,c.arrowY,c.scaleX,c.scaleY,c.align,v]}function U1(e,t,n,r,o){ht(function(){if(e&&t&&n){let l=function(){r(),o()};var a=t,i=n,s=Zs(a),u=Zs(i),c=yo(i),d=new Set([c].concat(wt(s),wt(u)));return d.forEach(function(h){h.addEventListener("scroll",l,{passive:!0})}),c.addEventListener("resize",l,{passive:!0}),r(),function(){d.forEach(function(h){h.removeEventListener("scroll",l),c.removeEventListener("resize",l)})}}},[e,t,n])}function q1(e,t,n,r,o,a,i,s){var u=f.useRef(e);u.current=e;var c=f.useRef(!1);f.useEffect(function(){if(t&&r&&(!o||a)){var l=function(){c.current=!1},h=function(v){var p;u.current&&!i(((p=v.composedPath)===null||p===void 0||(p=p.call(v))===null||p===void 0?void 0:p[0])||v.target)&&!c.current&&s(!1)},m=yo(r);m.addEventListener("pointerdown",l,!0),m.addEventListener("mousedown",h,!0),m.addEventListener("contextmenu",h,!0);var y=Ws(n);return y&&(y.addEventListener("mousedown",h,!0),y.addEventListener("contextmenu",h,!0)),function(){m.removeEventListener("pointerdown",l,!0),m.removeEventListener("mousedown",h,!0),m.removeEventListener("contextmenu",h,!0),y&&(y.removeEventListener("mousedown",h,!0),y.removeEventListener("contextmenu",h,!0))}}},[t,n,r,o,a]);function d(){c.current=!0}return d}var G1=["prefixCls","children","action","showAction","hideAction","popupVisible","defaultPopupVisible","onPopupVisibleChange","afterPopupVisibleChange","mouseEnterDelay","mouseLeaveDelay","focusDelay","blurDelay","mask","maskClosable","getPopupContainer","forceRender","autoDestroy","destroyPopupOnHide","popup","popupClassName","popupStyle","popupPlacement","builtinPlacements","popupAlign","zIndex","stretch","getPopupClassNameFromAlign","fresh","alignPoint","onPopupClick","onPopupAlign","arrow","popupMotion","maskMotion","popupTransitionName","popupAnimation","maskTransitionName","maskAnimation","className","getTriggerDOMNode"];function K1(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Od,t=f.forwardRef(function(n,r){var o=n.prefixCls,a=o===void 0?"rc-trigger-popup":o,i=n.children,s=n.action,u=s===void 0?"hover":s,c=n.showAction,d=n.hideAction,l=n.popupVisible,h=n.defaultPopupVisible,m=n.onPopupVisibleChange,y=n.afterPopupVisibleChange,w=n.mouseEnterDelay,v=n.mouseLeaveDelay,p=v===void 0?.1:v,g=n.focusDelay,b=n.blurDelay,C=n.mask,x=n.maskClosable,S=x===void 0?!0:x,E=n.getPopupContainer,M=n.forceRender,k=n.autoDestroy,T=n.destroyPopupOnHide,R=n.popup,F=n.popupClassName,V=n.popupStyle,$=n.popupPlacement,L=n.builtinPlacements,_=L===void 0?{}:L,H=n.popupAlign,N=n.zIndex,z=n.stretch,B=n.getPopupClassNameFromAlign,A=n.fresh,j=n.alignPoint,Y=n.onPopupClick,U=n.onPopupAlign,ne=n.arrow,te=n.popupMotion,J=n.maskMotion,G=n.popupTransitionName,q=n.popupAnimation,Z=n.maskTransitionName,O=n.maskAnimation,I=n.className,W=n.getTriggerDOMNode,K=pt(n,G1),oe=k||T||!1,Q=f.useState(!1),ae=X(Q,2),ee=ae[0],ie=ae[1];ht(function(){ie(p1())},[]);var me=f.useRef({}),ye=f.useContext(df),de=f.useMemo(function(){return{registerSubPopup:function(je,St){me.current[je]=St,ye==null||ye.registerSubPopup(je,St)}}},[ye]),se=h1(),He=f.useState(null),Le=X(He,2),ge=Le[0],Ye=Le[1],Fe=f.useRef(null),ze=ct(function(Ne){Fe.current=Ne,go(Ne)&&ge!==Ne&&Ye(Ne),ye==null||ye.registerSubPopup(se,Ne)}),Ge=f.useState(null),Ke=X(Ge,2),Ee=Ke[0],$e=Ke[1],le=f.useRef(null),fe=ct(function(Ne){go(Ne)&&Ee!==Ne&&($e(Ne),le.current=Ne)}),Pe=f.Children.only(i),ue=(Pe==null?void 0:Pe.props)||{},he={},Ue=ct(function(Ne){var je,St,Ht=Ee;return(Ht==null?void 0:Ht.contains(Ne))||((je=Ws(Ht))===null||je===void 0?void 0:je.host)===Ne||Ne===Ht||(ge==null?void 0:ge.contains(Ne))||((St=Ws(ge))===null||St===void 0?void 0:St.host)===Ne||Ne===ge||Object.values(me.current).some(function(kt){return(kt==null?void 0:kt.contains(Ne))||Ne===kt})}),Je=vf(a,te,q,G),nt=vf(a,J,O,Z),yt=f.useState(h||!1),tt=X(yt,2),be=tt[0],We=tt[1],Oe=l!=null?l:be,Ce=ct(function(Ne){l===void 0&&We(Ne)});ht(function(){We(l||!1)},[l]);var Se=f.useRef(Oe);Se.current=Oe;var pe=f.useRef([]);pe.current=[];var Ve=ct(function(Ne){var je;Ce(Ne),((je=pe.current[pe.current.length-1])!==null&&je!==void 0?je:Oe)!==Ne&&(pe.current.push(Ne),m==null||m(Ne))}),dt=f.useRef(),ut=function(){clearTimeout(dt.current)},rt=function(je){var St=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;ut(),St===0?Ve(je):dt.current=setTimeout(function(){Ve(je)},St*1e3)};f.useEffect(function(){return ut},[]);var Jt=f.useState(!1),xt=X(Jt,2),Vt=xt[0],en=xt[1];ht(function(Ne){(!Ne||Oe)&&en(!0)},[Oe]);var dn=f.useState(null),Wt=X(dn,2),_t=Wt[0],Kt=Wt[1],Et=f.useState(null),Bt=X(Et,2),bt=Bt[0],sn=Bt[1],Ot=function(je){sn([je.clientX,je.clientY])},fn=Y1(Oe,ge,j&&bt!==null?bt:Ee,$,_,H,U),we=X(fn,11),Me=we[0],Be=we[1],qe=we[2],it=we[3],Ft=we[4],Rt=we[5],tn=we[6],nn=we[7],Xt=we[8],zt=we[9],rn=we[10],zn=W1(ee,u,c,d),Hn=X(zn,2),jt=Hn[0],Yt=Hn[1],gn=jt.has("click"),yn=Yt.has("click")||Yt.has("contextMenu"),Zt=ct(function(){Vt||rn()}),Xn=function(){Se.current&&j&&yn&&rt(!1)};U1(Oe,Ee,ge,Zt,Xn),ht(function(){Zt()},[bt,$]),ht(function(){Oe&&!(_!=null&&_[$])&&Zt()},[JSON.stringify(H)]);var ft=f.useMemo(function(){var Ne=j1(_,a,zt,j);return Xe(Ne,B==null?void 0:B(zt))},[zt,B,_,a,j]);f.useImperativeHandle(r,function(){return{nativeElement:le.current,popupElement:Fe.current,forceAlign:Zt}});var ot=f.useState(0),lt=X(ot,2),Tt=lt[0],Te=lt[1],Re=f.useState(0),Mt=X(Re,2),Qt=Mt[0],Pn=Mt[1],Zn=function(){if(z&&Ee){var je=Ee.getBoundingClientRect();Te(je.width),Pn(je.height)}},Dn=function(){Zn(),Zt()},Qn=function(je){en(!1),rn(),y==null||y(je)},Ze=function(){return new Promise(function(je){Zn(),Kt(function(){return je})})};ht(function(){_t&&(rn(),_t(),Kt(null))},[_t]);function Ae(Ne,je,St,Ht){he[Ne]=function(kt){var Zi;Ht==null||Ht(kt),rt(je,St);for(var Mu=arguments.length,Bp=new Array(Mu>1?Mu-1:0),Qi=1;Qi<Mu;Qi++)Bp[Qi-1]=arguments[Qi];(Zi=ue[Ne])===null||Zi===void 0||Zi.call.apply(Zi,[ue,kt].concat(Bp))}}(gn||yn)&&(he.onClick=function(Ne){var je;Se.current&&yn?rt(!1):!Se.current&&gn&&(Ot(Ne),rt(!0));for(var St=arguments.length,Ht=new Array(St>1?St-1:0),kt=1;kt<St;kt++)Ht[kt-1]=arguments[kt];(je=ue.onClick)===null||je===void 0||je.call.apply(je,[ue,Ne].concat(Ht))});var Qe=q1(Oe,yn,Ee,ge,C,S,Ue,rt),at=jt.has("hover"),Dt=Yt.has("hover"),gr,yr;at&&(Ae("onMouseEnter",!0,w,function(Ne){Ot(Ne)}),Ae("onPointerEnter",!0,w,function(Ne){Ot(Ne)}),gr=function(je){(Oe||Vt)&&ge!==null&&ge!==void 0&&ge.contains(je.target)&&rt(!0,w)},j&&(he.onMouseMove=function(Ne){var je;(je=ue.onMouseMove)===null||je===void 0||je.call(ue,Ne)})),Dt&&(Ae("onMouseLeave",!1,p),Ae("onPointerLeave",!1,p),yr=function(){rt(!1,p)}),jt.has("focus")&&Ae("onFocus",!0,g),Yt.has("focus")&&Ae("onBlur",!1,b),jt.has("contextMenu")&&(he.onContextMenu=function(Ne){var je;Se.current&&Yt.has("contextMenu")?rt(!1):(Ot(Ne),rt(!0)),Ne.preventDefault();for(var St=arguments.length,Ht=new Array(St>1?St-1:0),kt=1;kt<St;kt++)Ht[kt-1]=arguments[kt];(je=ue.onContextMenu)===null||je===void 0||je.call.apply(je,[ue,Ne].concat(Ht))}),I&&(he.className=Xe(ue.className,I));var br=re(re({},ue),he),la={},Xi=["onContextMenu","onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur"];Xi.forEach(function(Ne){K[Ne]&&(la[Ne]=function(){for(var je,St=arguments.length,Ht=new Array(St),kt=0;kt<St;kt++)Ht[kt]=arguments[kt];(je=br[Ne])===null||je===void 0||je.call.apply(je,[br].concat(Ht)),K[Ne].apply(K,Ht)})});var xu=f.cloneElement(Pe,re(re({},br),la)),Su={x:Rt,y:tn},Eu=ne?re({},ne!==!0?ne:{}):null;return f.createElement(f.Fragment,null,f.createElement(jn,{disabled:!Oe,ref:fe,onResize:Dn},f.createElement(V1,{getTriggerDOMNode:W},xu)),f.createElement(df.Provider,{value:de},f.createElement(H1,{portal:e,ref:ze,prefixCls:a,popup:R,className:Xe(F,ft),style:V,target:Ee,onMouseEnter:gr,onMouseLeave:yr,onPointerEnter:gr,zIndex:N,open:Oe,keepDom:Vt,fresh:A,onClick:Y,onPointerDownCapture:Qe,mask:C,motion:Je,maskMotion:nt,onVisibleChanged:Qn,onPrepare:Ze,forceRender:M,autoDestroy:oe,getPopupContainer:E,align:zt,arrow:Eu,arrowPos:Su,ready:Me,offsetX:Be,offsetY:qe,offsetR:it,offsetB:Ft,onAlign:Zt,stretch:z,targetWidth:Tt/nn,targetHeight:Qt/Xt})))});return t}const Qs=K1(Od);function X1(e,t){return e!==void 0?e:t?"bottomRight":"bottomLeft"}var Cn=f.createContext(null),Z1={bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:1,adjustY:1}},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:1,adjustY:1}},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:0,adjustY:1}},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:0,adjustY:1}}};function yf(e){var t=e.popupElement,n=e.popupStyle,r=e.popupClassName,o=e.popupAlign,a=e.transitionName,i=e.getPopupContainer,s=e.children,u=e.range,c=e.placement,d=e.builtinPlacements,l=d===void 0?Z1:d,h=e.direction,m=e.visible,y=e.onClose,w=f.useContext(Cn),v=w.prefixCls,p="".concat(v,"-dropdown"),g=X1(c,h==="rtl");return f.createElement(Qs,{showAction:[],hideAction:["click"],popupPlacement:g,builtinPlacements:l,prefixCls:p,popupTransitionName:a,popup:t,popupAlign:o,popupVisible:m,popupClassName:Xe(r,ce(ce({},"".concat(p,"-range"),u),"".concat(p,"-rtl"),h==="rtl")),popupStyle:n,stretch:"minWidth",getPopupContainer:i,onPopupVisibleChange:function(C){C||y()}},s)}function Js(e,t){for(var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"0",r=String(e);r.length<t;)r="".concat(n).concat(r);return r}function Mr(e){return e==null?[]:Array.isArray(e)?e:[e]}function Co(e,t,n){var r=wt(e);return r[t]=n,r}function Ya(e,t){var n={},r=t||Object.keys(e);return r.forEach(function(o){e[o]!==void 0&&(n[o]=e[o])}),n}function bf(e,t,n){if(n)return n;switch(e){case"time":return t.fieldTimeFormat;case"datetime":return t.fieldDateTimeFormat;case"month":return t.fieldMonthFormat;case"year":return t.fieldYearFormat;case"quarter":return t.fieldQuarterFormat;case"week":return t.fieldWeekFormat;default:return t.fieldDateFormat}}function wf(e,t,n){var r=n!==void 0?n:t[t.length-1],o=t.find(function(a){return e[a]});return r!==o?e[o]:void 0}function Cf(e){return Ya(e,["placement","builtinPlacements","popupAlign","getPopupContainer","transitionName","direction"])}function el(e,t,n,r){var o=f.useMemo(function(){return e||function(i,s){var u=i;return t&&s.type==="date"?t(u,s.today):n&&s.type==="month"?n(u,s.locale):s.originNode}},[e,n,t]),a=f.useCallback(function(i,s){return o(i,re(re({},s),{},{range:r}))},[o,r]);return a}function xf(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],r=f.useState([!1,!1]),o=X(r,2),a=o[0],i=o[1],s=function(d,l){i(function(h){return Co(h,l,d)})},u=f.useMemo(function(){return a.map(function(c,d){if(c)return!0;var l=e[d];return l?!!(!n[d]&&!l||l&&t(l,{activeIndex:d})):!1})},[e,a,t,n]);return[u,s]}function Sf(e,t,n,r,o){var a="",i=[];return e&&i.push(o?"hh":"HH"),t&&i.push("mm"),n&&i.push("ss"),a=i.join(":"),r&&(a+=".SSS"),o&&(a+=" A"),a}function Q1(e,t,n,r,o,a){var i=e.fieldDateTimeFormat,s=e.fieldDateFormat,u=e.fieldTimeFormat,c=e.fieldMonthFormat,d=e.fieldYearFormat,l=e.fieldWeekFormat,h=e.fieldQuarterFormat,m=e.yearFormat,y=e.cellYearFormat,w=e.cellQuarterFormat,v=e.dayFormat,p=e.cellDateFormat,g=Sf(t,n,r,o,a);return re(re({},e),{},{fieldDateTimeFormat:i||"YYYY-MM-DD ".concat(g),fieldDateFormat:s||"YYYY-MM-DD",fieldTimeFormat:u||g,fieldMonthFormat:c||"YYYY-MM",fieldYearFormat:d||"YYYY",fieldWeekFormat:l||"gggg-wo",fieldQuarterFormat:h||"YYYY-[Q]Q",yearFormat:m||"YYYY",cellYearFormat:y||"YYYY",cellQuarterFormat:w||"[Q]Q",cellDateFormat:p||v||"D"})}function Ef(e,t){var n=t.showHour,r=t.showMinute,o=t.showSecond,a=t.showMillisecond,i=t.use12Hours;return D.useMemo(function(){return Q1(e,n,r,o,a,i)},[e,n,r,o,a,i])}function xo(e,t,n){return n!=null?n:t.some(function(r){return e.includes(r)})}var J1=["showNow","showHour","showMinute","showSecond","showMillisecond","use12Hours","hourStep","minuteStep","secondStep","millisecondStep","hideDisabledOptions","defaultValue","disabledHours","disabledMinutes","disabledSeconds","disabledMilliseconds","disabledTime","changeOnScroll","defaultOpenValue"];function ew(e){var t=Ya(e,J1),n=e.format,r=e.picker,o=null;return n&&(o=n,Array.isArray(o)&&(o=o[0]),o=Ct(o)==="object"?o.format:o),r==="time"&&(t.format=o),[t,o]}function tw(e){return e&&typeof e=="string"}function Mf(e,t,n,r){return[e,t,n,r].some(function(o){return o!==void 0})}function Pf(e,t,n,r,o){var a=t,i=n,s=r;if(!e&&!a&&!i&&!s&&!o)a=!0,i=!0,s=!0;else if(e){var u,c,d,l=[a,i,s].some(function(y){return y===!1}),h=[a,i,s].some(function(y){return y===!0}),m=l?!0:!h;a=(u=a)!==null&&u!==void 0?u:m,i=(c=i)!==null&&c!==void 0?c:m,s=(d=s)!==null&&d!==void 0?d:m}return[a,i,s,o]}function Df(e){var t=e.showTime,n=ew(e),r=X(n,2),o=r[0],a=r[1],i=t&&Ct(t)==="object"?t:{},s=re(re({defaultOpenValue:i.defaultOpenValue||i.defaultValue},o),i),u=s.showMillisecond,c=s.showHour,d=s.showMinute,l=s.showSecond,h=Mf(c,d,l,u),m=Pf(h,c,d,l,u),y=X(m,3);return c=y[0],d=y[1],l=y[2],[s,re(re({},s),{},{showHour:c,showMinute:d,showSecond:l,showMillisecond:u}),s.format,a]}function kf(e,t,n,r,o){var a=e==="time";if(e==="datetime"||a){for(var i=r,s=bf(e,o,null),u=s,c=[t,n],d=0;d<c.length;d+=1){var l=Mr(c[d])[0];if(tw(l)){u=l;break}}var h=i.showHour,m=i.showMinute,y=i.showSecond,w=i.showMillisecond,v=i.use12Hours,p=xo(u,["a","A","LT","LLL","LTS"],v),g=Mf(h,m,y,w);g||(h=xo(u,["H","h","k","LT","LLL"]),m=xo(u,["m","LT","LLL"]),y=xo(u,["s","LTS"]),w=xo(u,["SSS"]));var b=Pf(g,h,m,y,w),C=X(b,3);h=C[0],m=C[1],y=C[2];var x=t||Sf(h,m,y,w,p);return re(re({},i),{},{format:x,showHour:h,showMinute:m,showSecond:y,showMillisecond:w,use12Hours:p})}return null}function nw(e,t,n){if(t===!1)return null;var r=t&&Ct(t)==="object"?t:{};return r.clearIcon||n||f.createElement("span",{className:"".concat(e,"-clear-btn")})}var tl=7;function ir(e,t,n){return!e&&!t||e===t?!0:!e||!t?!1:n()}function nl(e,t,n){return ir(t,n,function(){var r=Math.floor(e.getYear(t)/10),o=Math.floor(e.getYear(n)/10);return r===o})}function Pr(e,t,n){return ir(t,n,function(){return e.getYear(t)===e.getYear(n)})}function Nf(e,t){var n=Math.floor(e.getMonth(t)/3);return n+1}function rw(e,t,n){return ir(t,n,function(){return Pr(e,t,n)&&Nf(e,t)===Nf(e,n)})}function rl(e,t,n){return ir(t,n,function(){return Pr(e,t,n)&&e.getMonth(t)===e.getMonth(n)})}function ol(e,t,n){return ir(t,n,function(){return Pr(e,t,n)&&rl(e,t,n)&&e.getDate(t)===e.getDate(n)})}function _f(e,t,n){return ir(t,n,function(){return e.getHour(t)===e.getHour(n)&&e.getMinute(t)===e.getMinute(n)&&e.getSecond(t)===e.getSecond(n)})}function Of(e,t,n){return ir(t,n,function(){return ol(e,t,n)&&_f(e,t,n)&&e.getMillisecond(t)===e.getMillisecond(n)})}function So(e,t,n,r){return ir(n,r,function(){var o=e.locale.getWeekFirstDate(t,n),a=e.locale.getWeekFirstDate(t,r);return Pr(e,o,a)&&e.locale.getWeek(t,n)===e.locale.getWeek(t,r)})}function Ut(e,t,n,r,o){switch(o){case"date":return ol(e,n,r);case"week":return So(e,t.locale,n,r);case"month":return rl(e,n,r);case"quarter":return rw(e,n,r);case"year":return Pr(e,n,r);case"decade":return nl(e,n,r);case"time":return _f(e,n,r);default:return Of(e,n,r)}}function Ua(e,t,n,r){return!t||!n||!r?!1:e.isAfter(r,t)&&e.isAfter(n,r)}function qa(e,t,n,r,o){return Ut(e,t,n,r,o)?!0:e.isAfter(n,r)}function ow(e,t,n){var r=t.locale.getWeekFirstDay(e),o=t.setDate(n,1),a=t.getWeekDay(o),i=t.addDate(o,r-a);return t.getMonth(i)===t.getMonth(n)&&t.getDate(i)>1&&(i=t.addDate(i,-7)),i}function $t(e,t){var n=t.generateConfig,r=t.locale,o=t.format;return e?typeof o=="function"?o(e):n.locale.format(r.locale,e,o):""}function Ga(e,t,n){var r=t,o=["getHour","getMinute","getSecond","getMillisecond"],a=["setHour","setMinute","setSecond","setMillisecond"];return a.forEach(function(i,s){n?r=e[i](r,e[o[s]](n)):r=e[i](r,0)}),r}function aw(e,t,n,r,o){var a=ct(function(i,s){return!!(n&&n(i,s)||r&&e.isAfter(r,i)&&!Ut(e,t,r,i,s.type)||o&&e.isAfter(i,o)&&!Ut(e,t,o,i,s.type))});return a}function iw(e,t,n){return f.useMemo(function(){var r=bf(e,t,n),o=Mr(r),a=o[0],i=Ct(a)==="object"&&a.type==="mask"?a.format:null;return[o.map(function(s){return typeof s=="string"||typeof s=="function"?s:s.format}),i]},[e,t,n])}function sw(e,t,n){return typeof e[0]=="function"||n?!0:t}function lw(e,t,n,r){var o=ct(function(a,i){var s=re({type:t},i);if(delete s.activeIndex,!e.isValidate(a)||n&&n(a,s))return!0;if((t==="date"||t==="time")&&r){var u,c=i&&i.activeIndex===1?"end":"start",d=((u=r.disabledTime)===null||u===void 0?void 0:u.call(r,a,c,{from:s.from}))||{},l=d.disabledHours,h=d.disabledMinutes,m=d.disabledSeconds,y=d.disabledMilliseconds,w=r.disabledHours,v=r.disabledMinutes,p=r.disabledSeconds,g=l||w,b=h||v,C=m||p,x=e.getHour(a),S=e.getMinute(a),E=e.getSecond(a),M=e.getMillisecond(a);if(g&&g().includes(x)||b&&b(x).includes(S)||C&&C(x,S).includes(E)||y&&y(x,S,E).includes(M))return!0}return!1});return o}function Ka(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=f.useMemo(function(){var r=e&&Mr(e);return t&&r&&(r[1]=r[1]||r[0]),r},[e,t]);return n}function Tf(e,t){var n=e.generateConfig,r=e.locale,o=e.picker,a=o===void 0?"date":o,i=e.prefixCls,s=i===void 0?"rc-picker":i,u=e.styles,c=u===void 0?{}:u,d=e.classNames,l=d===void 0?{}:d,h=e.order,m=h===void 0?!0:h,y=e.components,w=y===void 0?{}:y,v=e.inputRender,p=e.allowClear,g=e.clearIcon,b=e.needConfirm,C=e.multiple,x=e.format,S=e.inputReadOnly,E=e.disabledDate,M=e.minDate,k=e.maxDate,T=e.showTime,R=e.value,F=e.defaultValue,V=e.pickerValue,$=e.defaultPickerValue,L=Ka(R),_=Ka(F),H=Ka(V),N=Ka($),z=a==="date"&&T?"datetime":a,B=z==="time"||z==="datetime",A=B||C,j=b!=null?b:B,Y=Df(e),U=X(Y,4),ne=U[0],te=U[1],J=U[2],G=U[3],q=Ef(r,te),Z=f.useMemo(function(){return kf(z,J,G,ne,q)},[z,J,G,ne,q]),O=f.useMemo(function(){return re(re({},e),{},{prefixCls:s,locale:q,picker:a,styles:c,classNames:l,order:m,components:re({input:v},w),clearIcon:nw(s,p,g),showTime:Z,value:L,defaultValue:_,pickerValue:H,defaultPickerValue:N},t==null?void 0:t())},[e]),I=iw(z,q,x),W=X(I,2),K=W[0],oe=W[1],Q=sw(K,S,C),ae=aw(n,r,E,M,k),ee=lw(n,a,ae,Z),ie=f.useMemo(function(){return re(re({},O),{},{needConfirm:j,inputReadOnly:Q,disabledDate:ae})},[O,j,Q,ae]);return[ie,z,A,K,oe,ee]}function uw(e,t,n){var r=ln(t,{value:e}),o=X(r,2),a=o[0],i=o[1],s=D.useRef(e),u=D.useRef(),c=function(){mt.cancel(u.current)},d=ct(function(){i(s.current),n&&a!==s.current&&n(s.current)}),l=ct(function(h,m){c(),s.current=h,h||m?d():u.current=mt(d)});return D.useEffect(function(){return c},[]),[a,l]}function If(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],r=arguments.length>3?arguments[3]:void 0,o=n.every(function(d){return d})?!1:e,a=uw(o,t||!1,r),i=X(a,2),s=i[0],u=i[1];function c(d){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};(!l.inherit||s)&&u(d,l.force)}return[s,c]}function Rf(e){var t=f.useRef();return f.useImperativeHandle(e,function(){var n;return{nativeElement:(n=t.current)===null||n===void 0?void 0:n.nativeElement,focus:function(o){var a;(a=t.current)===null||a===void 0||a.focus(o)},blur:function(){var o;(o=t.current)===null||o===void 0||o.blur()}}}),t}function Af(e,t){return f.useMemo(function(){return e||(t?(Er(!1,"`ranges` is deprecated. Please use `presets` instead."),Object.entries(t).map(function(n){var r=X(n,2),o=r[0],a=r[1];return{label:o,value:a}})):[])},[e,t])}function al(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,r=f.useRef(t);r.current=t,Ps(function(){if(e)r.current(e);else{var o=mt(function(){r.current(e)},n);return function(){mt.cancel(o)}}},[e])}function Lf(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,r=f.useState(0),o=X(r,2),a=o[0],i=o[1],s=f.useState(!1),u=X(s,2),c=u[0],d=u[1],l=f.useRef([]),h=f.useRef(null),m=f.useRef(null),y=function(C){h.current=C},w=function(C){return h.current===C},v=function(C){d(C)},p=function(C){return C&&(m.current=C),m.current},g=function(C){var x=l.current,S=new Set(x.filter(function(M){return C[M]||t[M]})),E=x[x.length-1]===0?1:0;return S.size>=2||e[E]?null:E};return al(c||n,function(){c||(l.current=[],y(null))}),f.useEffect(function(){c&&l.current.push(a)},[c,a]),[c,v,p,a,i,g,l.current,y,w]}function cw(e,t,n,r,o,a){var i=n[n.length-1],s=function(c,d){var l=X(e,2),h=l[0],m=l[1],y=re(re({},d),{},{from:wf(e,n)});return i===1&&t[0]&&h&&!Ut(r,o,h,c,y.type)&&r.isAfter(h,c)||i===0&&t[1]&&m&&!Ut(r,o,m,c,y.type)&&r.isAfter(c,m)?!0:a==null?void 0:a(c,y)};return s}function Eo(e,t,n,r){switch(t){case"date":case"week":return e.addMonth(n,r);case"month":case"quarter":return e.addYear(n,r);case"year":return e.addYear(n,r*10);case"decade":return e.addYear(n,r*100);default:return n}}var il=[];function $f(e,t,n,r,o,a,i,s){var u=arguments.length>8&&arguments[8]!==void 0?arguments[8]:il,c=arguments.length>9&&arguments[9]!==void 0?arguments[9]:il,d=arguments.length>10&&arguments[10]!==void 0?arguments[10]:il,l=arguments.length>11?arguments[11]:void 0,h=arguments.length>12?arguments[12]:void 0,m=arguments.length>13?arguments[13]:void 0,y=i==="time",w=a||0,v=function(H){var N=e.getNow();return y&&(N=Ga(e,N)),u[H]||n[H]||N},p=X(c,2),g=p[0],b=p[1],C=ln(function(){return v(0)},{value:g}),x=X(C,2),S=x[0],E=x[1],M=ln(function(){return v(1)},{value:b}),k=X(M,2),T=k[0],R=k[1],F=f.useMemo(function(){var _=[S,T][w];return y?_:Ga(e,_,d[w])},[y,S,T,w,e,d]),V=function(H){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"panel",z=[E,R][w];z(H);var B=[S,T];B[w]=H,l&&(!Ut(e,t,S,B[0],i)||!Ut(e,t,T,B[1],i))&&l(B,{source:N,range:w===1?"end":"start",mode:r})},$=function(H,N){if(s){var z={date:"month",week:"month",month:"year",quarter:"year"},B=z[i];if(B&&!Ut(e,t,H,N,B))return Eo(e,i,N,-1);if(i==="year"&&H){var A=Math.floor(e.getYear(H)/10),j=Math.floor(e.getYear(N)/10);if(A!==j)return Eo(e,i,N,-1)}}return N},L=f.useRef(null);return ht(function(){if(o&&!u[w]){var _=y?null:e.getNow();if(L.current!==null&&L.current!==w?_=[S,T][w^1]:n[w]?_=w===0?n[0]:$(n[0],n[1]):n[w^1]&&(_=n[w^1]),_){h&&e.isAfter(h,_)&&(_=h);var H=s?Eo(e,i,_,1):_;m&&e.isAfter(H,m)&&(_=s?Eo(e,i,m,-1):m),V(_,"reset")}}},[o,w,n[w]]),f.useEffect(function(){o?L.current=w:L.current=null},[o,w]),ht(function(){o&&u&&u[w]&&V(u[w],"reset")},[o,w]),[F,V]}function Ff(e,t){var n=f.useRef(e),r=f.useState({}),o=X(r,2),a=o[1],i=function(c){return c&&t!==void 0?t:n.current},s=function(c){n.current=c,a({})};return[i,s,i(!0)]}var dw=[];function zf(e,t,n){var r=function(i){return i.map(function(s){return $t(s,{generateConfig:e,locale:t,format:n[0]})})},o=function(i,s){for(var u=Math.max(i.length,s.length),c=-1,d=0;d<u;d+=1){var l=i[d]||null,h=s[d]||null;if(l!==h&&!Of(e,l,h)){c=d;break}}return[c<0,c!==0]};return[r,o]}function Hf(e,t){return wt(e).sort(function(n,r){return t.isAfter(n,r)?1:-1})}function fw(e){var t=Ff(e),n=X(t,2),r=n[0],o=n[1],a=ct(function(){o(e)});return f.useEffect(function(){a()},[e]),[r,o]}function Vf(e,t,n,r,o,a,i,s,u){var c=ln(a,{value:i}),d=X(c,2),l=d[0],h=d[1],m=l||dw,y=fw(m),w=X(y,2),v=w[0],p=w[1],g=zf(e,t,n),b=X(g,2),C=b[0],x=b[1],S=ct(function(M){var k=wt(M);if(r)for(var T=0;T<2;T+=1)k[T]=k[T]||null;else o&&(k=Hf(k.filter(function(_){return _}),e));var R=x(v(),k),F=X(R,2),V=F[0],$=F[1];if(!V&&(p(k),s)){var L=C(k);s(k,L,{range:$?"end":"start"})}}),E=function(){u&&u(v())};return[m,h,v,S,E]}function Wf(e,t,n,r,o,a,i,s,u,c){var d=e.generateConfig,l=e.locale,h=e.picker,m=e.onChange,y=e.allowEmpty,w=e.order,v=a.some(function(V){return V})?!1:w,p=zf(d,l,i),g=X(p,2),b=g[0],C=g[1],x=Ff(t),S=X(x,2),E=S[0],M=S[1],k=ct(function(){M(t)});f.useEffect(function(){k()},[t]);var T=ct(function(V){var $=V===null,L=wt(V||E());if($)for(var _=Math.max(a.length,L.length),H=0;H<_;H+=1)a[H]||(L[H]=null);v&&L[0]&&L[1]&&(L=Hf(L,d)),o(L);var N=L,z=X(N,2),B=z[0],A=z[1],j=!B,Y=!A,U=y?(!j||y[0])&&(!Y||y[1]):!0,ne=!w||j||Y||Ut(d,l,B,A,h)||d.isAfter(A,B),te=(a[0]||!B||!c(B,{activeIndex:0}))&&(a[1]||!A||!c(A,{from:B,activeIndex:1})),J=$||U&&ne&&te;if(J){n(L);var G=C(L,t),q=X(G,1),Z=q[0];m&&!Z&&m($&&L.every(function(O){return!O})?null:L,b(L))}return J}),R=ct(function(V,$){var L=Co(E(),V,r()[V]);M(L),$&&T()}),F=!s&&!u;return al(!F,function(){F&&(T(),o(t),k())},2),[R,T]}function Bf(e,t,n,r,o){return t!=="date"&&t!=="time"?!1:n!==void 0?n:r!==void 0?r:!o&&(e==="date"||e==="time")}function vw(e,t,n,r,o,a){var i=e;function s(l,h,m){var y=a[l](i),w=m.find(function(b){return b.value===y});if(!w||w.disabled){var v=m.filter(function(b){return!b.disabled}),p=wt(v).reverse(),g=p.find(function(b){return b.value<=y})||v[0];g&&(y=g.value,i=a[h](i,y))}return y}var u=s("getHour","setHour",t()),c=s("getMinute","setMinute",n(u)),d=s("getSecond","setSecond",r(u,c));return s("getMillisecond","setMillisecond",o(u,c,d)),i}function Xa(){return[]}function Za(e,t){for(var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:[],a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:2,i=[],s=n>=1?n|0:1,u=e;u<=t;u+=s){var c=o.includes(u);(!c||!r)&&i.push({label:Js(u,a),value:u,disabled:c})}return i}function sl(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=t||{},o=r.use12Hours,a=r.hourStep,i=a===void 0?1:a,s=r.minuteStep,u=s===void 0?1:s,c=r.secondStep,d=c===void 0?1:c,l=r.millisecondStep,h=l===void 0?100:l,m=r.hideDisabledOptions,y=r.disabledTime,w=r.disabledHours,v=r.disabledMinutes,p=r.disabledSeconds,g=f.useMemo(function(){return n||e.getNow()},[n,e]),b=f.useCallback(function(N){var z=(y==null?void 0:y(N))||{};return[z.disabledHours||w||Xa,z.disabledMinutes||v||Xa,z.disabledSeconds||p||Xa,z.disabledMilliseconds||Xa]},[y,w,v,p]),C=f.useMemo(function(){return b(g)},[g,b]),x=X(C,4),S=x[0],E=x[1],M=x[2],k=x[3],T=f.useCallback(function(N,z,B,A){var j=Za(0,23,i,m,N()),Y=o?j.map(function(J){return re(re({},J),{},{label:Js(J.value%12||12,2)})}):j,U=function(G){return Za(0,59,u,m,z(G))},ne=function(G,q){return Za(0,59,d,m,B(G,q))},te=function(G,q,Z){return Za(0,999,h,m,A(G,q,Z),3)};return[Y,U,ne,te]},[m,i,o,h,u,d]),R=f.useMemo(function(){return T(S,E,M,k)},[T,S,E,M,k]),F=X(R,4),V=F[0],$=F[1],L=F[2],_=F[3],H=function(z,B){var A=function(){return V},j=$,Y=L,U=_;if(B){var ne=b(B),te=X(ne,4),J=te[0],G=te[1],q=te[2],Z=te[3],O=T(J,G,q,Z),I=X(O,4),W=I[0],K=I[1],oe=I[2],Q=I[3];A=function(){return W},j=K,Y=oe,U=Q}var ae=vw(z,A,j,Y,U,e);return ae};return[H,V,$,L,_]}function mw(e){var t=e.mode,n=e.internalMode,r=e.renderExtraFooter,o=e.showNow,a=e.showTime,i=e.onSubmit,s=e.onNow,u=e.invalid,c=e.needConfirm,d=e.generateConfig,l=e.disabledDate,h=f.useContext(Cn),m=h.prefixCls,y=h.locale,w=h.button,v=w===void 0?"button":w,p=d.getNow(),g=sl(d,a,p),b=X(g,1),C=b[0],x=r==null?void 0:r(t),S=l(p,{type:t}),E=function(){if(!S){var $=C(p);s($)}},M="".concat(m,"-now"),k="".concat(M,"-btn"),T=o&&f.createElement("li",{className:M},f.createElement("a",{className:Xe(k,S&&"".concat(k,"-disabled")),"aria-disabled":S,onClick:E},n==="date"?y.today:y.now)),R=c&&f.createElement("li",{className:"".concat(m,"-ok")},f.createElement(v,{disabled:u,onClick:i},y.ok)),F=(T||R)&&f.createElement("ul",{className:"".concat(m,"-ranges")},T,R);return!x&&!F?null:f.createElement("div",{className:"".concat(m,"-footer")},x&&f.createElement("div",{className:"".concat(m,"-footer-extra")},x),F)}function jf(e,t,n){function r(o,a){var i=o.findIndex(function(u){return Ut(e,t,u,a,n)});if(i===-1)return[].concat(wt(o),[a]);var s=wt(o);return s.splice(i,1),s}return r}var Dr=f.createContext(null);function Qa(){return f.useContext(Dr)}function Qr(e,t){var n=e.prefixCls,r=e.generateConfig,o=e.locale,a=e.disabledDate,i=e.minDate,s=e.maxDate,u=e.cellRender,c=e.hoverValue,d=e.hoverRangeValue,l=e.onHover,h=e.values,m=e.pickerValue,y=e.onSelect,w=e.prevIcon,v=e.nextIcon,p=e.superPrevIcon,g=e.superNextIcon,b=r.getNow(),C={now:b,values:h,pickerValue:m,prefixCls:n,disabledDate:a,minDate:i,maxDate:s,cellRender:u,hoverValue:c,hoverRangeValue:d,onHover:l,locale:o,generateConfig:r,onSelect:y,panelType:t,prevIcon:w,nextIcon:v,superPrevIcon:p,superNextIcon:g};return[C,b]}var sr=f.createContext({});function Mo(e){for(var t=e.rowNum,n=e.colNum,r=e.baseDate,o=e.getCellDate,a=e.prefixColumn,i=e.rowClassName,s=e.titleFormat,u=e.getCellText,c=e.getCellClassName,d=e.headerCells,l=e.cellSelection,h=l===void 0?!0:l,m=e.disabledDate,y=Qa(),w=y.prefixCls,v=y.panelType,p=y.now,g=y.disabledDate,b=y.cellRender,C=y.onHover,x=y.hoverValue,S=y.hoverRangeValue,E=y.generateConfig,M=y.values,k=y.locale,T=y.onSelect,R=m||g,F="".concat(w,"-cell"),V=f.useContext(sr),$=V.onCellDblClick,L=function(Y){return M.some(function(U){return U&&Ut(E,k,Y,U,v)})},_=[],H=0;H<t;H+=1){for(var N=[],z=void 0,B=function(){var Y=H*n+A,U=o(r,Y),ne=R==null?void 0:R(U,{type:v});A===0&&(z=U,a&&N.push(a(z)));var te=!1,J=!1,G=!1;if(h&&S){var q=X(S,2),Z=q[0],O=q[1];te=Ua(E,Z,O,U),J=Ut(E,k,U,Z,v),G=Ut(E,k,U,O,v)}var I=s?$t(U,{locale:k,format:s,generateConfig:E}):void 0,W=f.createElement("div",{className:"".concat(F,"-inner")},u(U));N.push(f.createElement("td",{key:A,title:I,className:Xe(F,re(ce(ce(ce(ce(ce(ce({},"".concat(F,"-disabled"),ne),"".concat(F,"-hover"),(x||[]).some(function(K){return Ut(E,k,U,K,v)})),"".concat(F,"-in-range"),te&&!J&&!G),"".concat(F,"-range-start"),J),"".concat(F,"-range-end"),G),"".concat(w,"-cell-selected"),!S&&v!=="week"&&L(U)),c(U))),onClick:function(){ne||T(U)},onDoubleClick:function(){!ne&&$&&$()},onMouseEnter:function(){ne||C==null||C(U)},onMouseLeave:function(){ne||C==null||C(null)}},b?b(U,{prefixCls:w,originNode:W,today:p,type:v,locale:k}):W))},A=0;A<n;A+=1)B();_.push(f.createElement("tr",{key:H,className:i==null?void 0:i(z)},N))}return f.createElement("div",{className:"".concat(w,"-body")},f.createElement("table",{className:"".concat(w,"-content")},d&&f.createElement("thead",null,f.createElement("tr",null,d)),f.createElement("tbody",null,_)))}var Ja={visibility:"hidden"};function Jr(e){var t=e.offset,n=e.superOffset,r=e.onChange,o=e.getStart,a=e.getEnd,i=e.children,s=Qa(),u=s.prefixCls,c=s.prevIcon,d=c===void 0?"‹":c,l=s.nextIcon,h=l===void 0?"›":l,m=s.superPrevIcon,y=m===void 0?"«":m,w=s.superNextIcon,v=w===void 0?"»":w,p=s.minDate,g=s.maxDate,b=s.generateConfig,C=s.locale,x=s.pickerValue,S=s.panelType,E="".concat(u,"-header"),M=f.useContext(sr),k=M.hidePrev,T=M.hideNext,R=M.hideHeader,F=f.useMemo(function(){if(!p||!t||!a)return!1;var j=a(t(-1,x));return!qa(b,C,j,p,S)},[p,t,x,a,b,C,S]),V=f.useMemo(function(){if(!p||!n||!a)return!1;var j=a(n(-1,x));return!qa(b,C,j,p,S)},[p,n,x,a,b,C,S]),$=f.useMemo(function(){if(!g||!t||!o)return!1;var j=o(t(1,x));return!qa(b,C,g,j,S)},[g,t,x,o,b,C,S]),L=f.useMemo(function(){if(!g||!n||!o)return!1;var j=o(n(1,x));return!qa(b,C,g,j,S)},[g,n,x,o,b,C,S]),_=function(Y){t&&r(t(Y,x))},H=function(Y){n&&r(n(Y,x))};if(R)return null;var N="".concat(E,"-prev-btn"),z="".concat(E,"-next-btn"),B="".concat(E,"-super-prev-btn"),A="".concat(E,"-super-next-btn");return f.createElement("div",{className:E},n&&f.createElement("button",{type:"button","aria-label":C.previousYear,onClick:function(){return H(-1)},tabIndex:-1,className:Xe(B,V&&"".concat(B,"-disabled")),disabled:V,style:k?Ja:{}},y),t&&f.createElement("button",{type:"button","aria-label":C.previousMonth,onClick:function(){return _(-1)},tabIndex:-1,className:Xe(N,F&&"".concat(N,"-disabled")),disabled:F,style:k?Ja:{}},d),f.createElement("div",{className:"".concat(E,"-view")},i),t&&f.createElement("button",{type:"button","aria-label":C.nextMonth,onClick:function(){return _(1)},tabIndex:-1,className:Xe(z,$&&"".concat(z,"-disabled")),disabled:$,style:T?Ja:{}},h),n&&f.createElement("button",{type:"button","aria-label":C.nextYear,onClick:function(){return H(1)},tabIndex:-1,className:Xe(A,L&&"".concat(A,"-disabled")),disabled:L,style:T?Ja:{}},v))}function ei(e){var t=e.prefixCls,n=e.panelName,r=n===void 0?"date":n,o=e.locale,a=e.generateConfig,i=e.pickerValue,s=e.onPickerValueChange,u=e.onModeChange,c=e.mode,d=c===void 0?"date":c,l=e.disabledDate,h=e.onSelect,m=e.onHover,y=e.showWeek,w="".concat(t,"-").concat(r,"-panel"),v="".concat(t,"-cell"),p=d==="week",g=Qr(e,d),b=X(g,2),C=b[0],x=b[1],S=a.locale.getWeekFirstDay(o.locale),E=a.setDate(i,1),M=ow(o.locale,a,E),k=a.getMonth(i),T=y===void 0?p:y,R=T?function(j){var Y=l==null?void 0:l(j,{type:"week"});return f.createElement("td",{key:"week",className:Xe(v,"".concat(v,"-week"),ce({},"".concat(v,"-disabled"),Y)),onClick:function(){Y||h(j)},onMouseEnter:function(){Y||m==null||m(j)},onMouseLeave:function(){Y||m==null||m(null)}},f.createElement("div",{className:"".concat(v,"-inner")},a.locale.getWeek(o.locale,j)))}:null,F=[],V=o.shortWeekDays||(a.locale.getShortWeekDays?a.locale.getShortWeekDays(o.locale):[]);R&&F.push(f.createElement("th",{key:"empty"},f.createElement("span",{style:{width:0,height:0,position:"absolute",overflow:"hidden",opacity:0}},o.week)));for(var $=0;$<tl;$+=1)F.push(f.createElement("th",{key:$},V[($+S)%tl]));var L=function(Y,U){return a.addDate(Y,U)},_=function(Y){return $t(Y,{locale:o,format:o.cellDateFormat,generateConfig:a})},H=function(Y){var U=ce(ce({},"".concat(t,"-cell-in-view"),rl(a,Y,i)),"".concat(t,"-cell-today"),ol(a,Y,x));return U},N=o.shortMonths||(a.locale.getShortMonths?a.locale.getShortMonths(o.locale):[]),z=f.createElement("button",{type:"button","aria-label":o.yearSelect,key:"year",onClick:function(){u("year",i)},tabIndex:-1,className:"".concat(t,"-year-btn")},$t(i,{locale:o,format:o.yearFormat,generateConfig:a})),B=f.createElement("button",{type:"button","aria-label":o.monthSelect,key:"month",onClick:function(){u("month",i)},tabIndex:-1,className:"".concat(t,"-month-btn")},o.monthFormat?$t(i,{locale:o,format:o.monthFormat,generateConfig:a}):N[k]),A=o.monthBeforeYear?[B,z]:[z,B];return f.createElement(Dr.Provider,{value:C},f.createElement("div",{className:Xe(w,y&&"".concat(w,"-show-week"))},f.createElement(Jr,{offset:function(Y){return a.addMonth(i,Y)},superOffset:function(Y){return a.addYear(i,Y)},onChange:s,getStart:function(Y){return a.setDate(Y,1)},getEnd:function(Y){var U=a.setDate(Y,1);return U=a.addMonth(U,1),a.addDate(U,-1)}},A),f.createElement(Mo,_e({titleFormat:o.fieldDateFormat},e,{colNum:tl,rowNum:6,baseDate:M,headerCells:F,getCellDate:L,getCellText:_,getCellClassName:H,prefixColumn:R,cellSelection:!p}))))}var hw=1/3;function pw(e,t){var n=f.useRef(!1),r=f.useRef(null),o=f.useRef(null),a=function(){return n.current},i=function(){mt.cancel(r.current),n.current=!1},s=f.useRef(),u=function(){var l=e.current;if(o.current=null,s.current=0,l){var h=l.querySelector('[data-value="'.concat(t,'"]')),m=l.querySelector("li"),y=function w(){i(),n.current=!0,s.current+=1;var v=l.scrollTop,p=m.offsetTop,g=h.offsetTop,b=g-p;if(g===0&&h!==m||!Xs(l)){s.current<=5&&(r.current=mt(w));return}var C=v+(b-v)*hw,x=Math.abs(b-C);if(o.current!==null&&o.current<x){i();return}if(o.current=x,x<=1){l.scrollTop=b,i();return}l.scrollTop=C,r.current=mt(w)};h&&m&&y()}},c=ct(u);return[c,i,a]}var gw=300;function yw(e){return e.map(function(t){var n=t.value,r=t.label,o=t.disabled;return[n,r,o].join(",")}).join(";")}function Po(e){var t=e.units,n=e.value,r=e.optionalValue,o=e.type,a=e.onChange,i=e.onHover,s=e.onDblClick,u=e.changeOnScroll,c=Qa(),d=c.prefixCls,l=c.cellRender,h=c.now,m=c.locale,y="".concat(d,"-time-panel"),w="".concat(d,"-time-panel-cell"),v=f.useRef(null),p=f.useRef(),g=function(){clearTimeout(p.current)},b=pw(v,n!=null?n:r),C=X(b,3),x=C[0],S=C[1],E=C[2];ht(function(){return x(),g(),function(){S(),g()}},[n,r,yw(t)]);var M=function(R){g();var F=R.target;!E()&&u&&(p.current=setTimeout(function(){var V=v.current,$=V.querySelector("li").offsetTop,L=Array.from(V.querySelectorAll("li")),_=L.map(function(A){return A.offsetTop-$}),H=_.map(function(A,j){return t[j].disabled?Number.MAX_SAFE_INTEGER:Math.abs(A-F.scrollTop)}),N=Math.min.apply(Math,wt(H)),z=H.findIndex(function(A){return A===N}),B=t[z];B&&!B.disabled&&a(B.value)},gw))},k="".concat(y,"-column");return f.createElement("ul",{className:k,ref:v,"data-type":o,onScroll:M},t.map(function(T){var R=T.label,F=T.value,V=T.disabled,$=f.createElement("div",{className:"".concat(w,"-inner")},R);return f.createElement("li",{key:F,className:Xe(w,ce(ce({},"".concat(w,"-selected"),n===F),"".concat(w,"-disabled"),V)),onClick:function(){V||a(F)},onDoubleClick:function(){!V&&s&&s()},onMouseEnter:function(){i(F)},onMouseLeave:function(){i(null)},"data-value":F},l?l(F,{prefixCls:d,originNode:$,today:h,type:"time",subType:o,locale:m}):$)}))}function lr(e){return e<12}function bw(e){var t=e.showHour,n=e.showMinute,r=e.showSecond,o=e.showMillisecond,a=e.use12Hours,i=e.changeOnScroll,s=Qa(),u=s.prefixCls,c=s.values,d=s.generateConfig,l=s.locale,h=s.onSelect,m=s.onHover,y=m===void 0?function(){}:m,w=s.pickerValue,v=(c==null?void 0:c[0])||null,p=f.useContext(sr),g=p.onCellDblClick,b=sl(d,e,v),C=X(b,5),x=C[0],S=C[1],E=C[2],M=C[3],k=C[4],T=function(he){var Ue=v&&d[he](v),Je=w&&d[he](w);return[Ue,Je]},R=T("getHour"),F=X(R,2),V=F[0],$=F[1],L=T("getMinute"),_=X(L,2),H=_[0],N=_[1],z=T("getSecond"),B=X(z,2),A=B[0],j=B[1],Y=T("getMillisecond"),U=X(Y,2),ne=U[0],te=U[1],J=V===null?null:lr(V)?"am":"pm",G=f.useMemo(function(){return a?lr(V)?S.filter(function(ue){return lr(ue.value)}):S.filter(function(ue){return!lr(ue.value)}):S},[V,S,a]),q=function(he,Ue){var Je,nt=he.filter(function(yt){return!yt.disabled});return Ue!=null?Ue:nt==null||(Je=nt[0])===null||Je===void 0?void 0:Je.value},Z=q(S,V),O=f.useMemo(function(){return E(Z)},[E,Z]),I=q(O,H),W=f.useMemo(function(){return M(Z,I)},[M,Z,I]),K=q(W,A),oe=f.useMemo(function(){return k(Z,I,K)},[k,Z,I,K]),Q=q(oe,ne),ae=f.useMemo(function(){if(!a)return[];var ue=d.getNow(),he=d.setHour(ue,6),Ue=d.setHour(ue,18),Je=function(yt,tt){var be=l.cellMeridiemFormat;return be?$t(yt,{generateConfig:d,locale:l,format:be}):tt};return[{label:Je(he,"AM"),value:"am",disabled:S.every(function(nt){return nt.disabled||!lr(nt.value)})},{label:Je(Ue,"PM"),value:"pm",disabled:S.every(function(nt){return nt.disabled||lr(nt.value)})}]},[S,a,d,l]),ee=function(he){var Ue=x(he);h(Ue)},ie=f.useMemo(function(){var ue=v||w||d.getNow(),he=function(Je){return Je!=null};return he(V)?(ue=d.setHour(ue,V),ue=d.setMinute(ue,H),ue=d.setSecond(ue,A),ue=d.setMillisecond(ue,ne)):he($)?(ue=d.setHour(ue,$),ue=d.setMinute(ue,N),ue=d.setSecond(ue,j),ue=d.setMillisecond(ue,te)):he(Z)&&(ue=d.setHour(ue,Z),ue=d.setMinute(ue,I),ue=d.setSecond(ue,K),ue=d.setMillisecond(ue,Q)),ue},[v,w,V,H,A,ne,Z,I,K,Q,$,N,j,te,d]),me=function(he,Ue){return he===null?null:d[Ue](ie,he)},ye=function(he){return me(he,"setHour")},de=function(he){return me(he,"setMinute")},se=function(he){return me(he,"setSecond")},He=function(he){return me(he,"setMillisecond")},Le=function(he){return he===null?null:he==="am"&&!lr(V)?d.setHour(ie,V-12):he==="pm"&&lr(V)?d.setHour(ie,V+12):ie},ge=function(he){ee(ye(he))},Ye=function(he){ee(de(he))},Fe=function(he){ee(se(he))},ze=function(he){ee(He(he))},Ge=function(he){ee(Le(he))},Ke=function(he){y(ye(he))},Ee=function(he){y(de(he))},$e=function(he){y(se(he))},le=function(he){y(He(he))},fe=function(he){y(Le(he))},Pe={onDblClick:g,changeOnScroll:i};return f.createElement("div",{className:"".concat(u,"-content")},t&&f.createElement(Po,_e({units:G,value:V,optionalValue:$,type:"hour",onChange:ge,onHover:Ke},Pe)),n&&f.createElement(Po,_e({units:O,value:H,optionalValue:N,type:"minute",onChange:Ye,onHover:Ee},Pe)),r&&f.createElement(Po,_e({units:W,value:A,optionalValue:j,type:"second",onChange:Fe,onHover:$e},Pe)),o&&f.createElement(Po,_e({units:oe,value:ne,optionalValue:te,type:"millisecond",onChange:ze,onHover:le},Pe)),a&&f.createElement(Po,_e({units:ae,value:J,type:"meridiem",onChange:Ge,onHover:fe},Pe)))}function Yf(e){var t=e.prefixCls,n=e.value,r=e.locale,o=e.generateConfig,a=e.showTime,i=a||{},s=i.format,u="".concat(t,"-time-panel"),c=Qr(e,"time"),d=X(c,1),l=d[0];return f.createElement(Dr.Provider,{value:l},f.createElement("div",{className:Xe(u)},f.createElement(Jr,null,n?$t(n,{locale:r,format:s,generateConfig:o}):" "),f.createElement(bw,a)))}function ww(e){var t=e.prefixCls,n=e.generateConfig,r=e.showTime,o=e.onSelect,a=e.value,i=e.pickerValue,s=e.onHover,u="".concat(t,"-datetime-panel"),c=sl(n,r),d=X(c,1),l=d[0],h=function(v){return a?Ga(n,v,a):Ga(n,v,i)},m=function(v){s==null||s(v&&h(v))},y=function(v){var p=h(v);o(l(p,p))};return f.createElement("div",{className:u},f.createElement(ei,_e({},e,{onSelect:y,onHover:m})),f.createElement(Yf,e))}function Cw(e){var t=e.prefixCls,n=e.locale,r=e.generateConfig,o=e.pickerValue,a=e.disabledDate,i=e.onPickerValueChange,s="".concat(t,"-decade-panel"),u=Qr(e,"decade"),c=X(u,1),d=c[0],l=function(S){var E=Math.floor(r.getYear(S)/100)*100;return r.setYear(S,E)},h=function(S){var E=l(S);return r.addYear(E,99)},m=l(o),y=h(o),w=r.addYear(m,-10),v=function(S,E){return r.addYear(S,E*10)},p=function(S){var E=n.cellYearFormat,M=$t(S,{locale:n,format:E,generateConfig:r}),k=$t(r.addYear(S,9),{locale:n,format:E,generateConfig:r});return"".concat(M,"-").concat(k)},g=function(S){return ce({},"".concat(t,"-cell-in-view"),nl(r,S,m)||nl(r,S,y)||Ua(r,m,y,S))},b=a?function(x,S){var E=r.setDate(x,1),M=r.setMonth(E,0),k=r.setYear(M,Math.floor(r.getYear(M)/10)*10),T=r.addYear(k,10),R=r.addDate(T,-1);return a(k,S)&&a(R,S)}:null,C="".concat($t(m,{locale:n,format:n.yearFormat,generateConfig:r}),"-").concat($t(y,{locale:n,format:n.yearFormat,generateConfig:r}));return f.createElement(Dr.Provider,{value:d},f.createElement("div",{className:s},f.createElement(Jr,{superOffset:function(S){return r.addYear(o,S*100)},onChange:i,getStart:l,getEnd:h},C),f.createElement(Mo,_e({},e,{disabledDate:b,colNum:3,rowNum:4,baseDate:w,getCellDate:v,getCellText:p,getCellClassName:g}))))}function xw(e){var t=e.prefixCls,n=e.locale,r=e.generateConfig,o=e.pickerValue,a=e.disabledDate,i=e.onPickerValueChange,s=e.onModeChange,u="".concat(t,"-month-panel"),c=Qr(e,"month"),d=X(c,1),l=d[0],h=r.setMonth(o,0),m=n.shortMonths||(r.locale.getShortMonths?r.locale.getShortMonths(n.locale):[]),y=function(C,x){return r.addMonth(C,x)},w=function(C){var x=r.getMonth(C);return n.monthFormat?$t(C,{locale:n,format:n.monthFormat,generateConfig:r}):m[x]},v=function(){return ce({},"".concat(t,"-cell-in-view"),!0)},p=a?function(b,C){var x=r.setDate(b,1),S=r.setMonth(x,r.getMonth(x)+1),E=r.addDate(S,-1);return a(x,C)&&a(E,C)}:null,g=f.createElement("button",{type:"button",key:"year","aria-label":n.yearSelect,onClick:function(){s("year")},tabIndex:-1,className:"".concat(t,"-year-btn")},$t(o,{locale:n,format:n.yearFormat,generateConfig:r}));return f.createElement(Dr.Provider,{value:l},f.createElement("div",{className:u},f.createElement(Jr,{superOffset:function(C){return r.addYear(o,C)},onChange:i,getStart:function(C){return r.setMonth(C,0)},getEnd:function(C){return r.setMonth(C,11)}},g),f.createElement(Mo,_e({},e,{disabledDate:p,titleFormat:n.fieldMonthFormat,colNum:3,rowNum:4,baseDate:h,getCellDate:y,getCellText:w,getCellClassName:v}))))}function Sw(e){var t=e.prefixCls,n=e.locale,r=e.generateConfig,o=e.pickerValue,a=e.onPickerValueChange,i=e.onModeChange,s="".concat(t,"-quarter-panel"),u=Qr(e,"quarter"),c=X(u,1),d=c[0],l=r.setMonth(o,0),h=function(p,g){return r.addMonth(p,g*3)},m=function(p){return $t(p,{locale:n,format:n.cellQuarterFormat,generateConfig:r})},y=function(){return ce({},"".concat(t,"-cell-in-view"),!0)},w=f.createElement("button",{type:"button",key:"year","aria-label":n.yearSelect,onClick:function(){i("year")},tabIndex:-1,className:"".concat(t,"-year-btn")},$t(o,{locale:n,format:n.yearFormat,generateConfig:r}));return f.createElement(Dr.Provider,{value:d},f.createElement("div",{className:s},f.createElement(Jr,{superOffset:function(p){return r.addYear(o,p)},onChange:a,getStart:function(p){return r.setMonth(p,0)},getEnd:function(p){return r.setMonth(p,11)}},w),f.createElement(Mo,_e({},e,{titleFormat:n.fieldQuarterFormat,colNum:4,rowNum:1,baseDate:l,getCellDate:h,getCellText:m,getCellClassName:y}))))}function Ew(e){var t=e.prefixCls,n=e.generateConfig,r=e.locale,o=e.value,a=e.hoverValue,i=e.hoverRangeValue,s=r.locale,u="".concat(t,"-week-panel-row"),c=function(l){var h={};if(i){var m=X(i,2),y=m[0],w=m[1],v=So(n,s,y,l),p=So(n,s,w,l);h["".concat(u,"-range-start")]=v,h["".concat(u,"-range-end")]=p,h["".concat(u,"-range-hover")]=!v&&!p&&Ua(n,y,w,l)}return a&&(h["".concat(u,"-hover")]=a.some(function(g){return So(n,s,l,g)})),Xe(u,ce({},"".concat(u,"-selected"),!i&&So(n,s,o,l)),h)};return f.createElement(ei,_e({},e,{mode:"week",panelName:"week",rowClassName:c}))}function Mw(e){var t=e.prefixCls,n=e.locale,r=e.generateConfig,o=e.pickerValue,a=e.disabledDate,i=e.onPickerValueChange,s=e.onModeChange,u="".concat(t,"-year-panel"),c=Qr(e,"year"),d=X(c,1),l=d[0],h=function(E){var M=Math.floor(r.getYear(E)/10)*10;return r.setYear(E,M)},m=function(E){var M=h(E);return r.addYear(M,9)},y=h(o),w=m(o),v=r.addYear(y,-1),p=function(E,M){return r.addYear(E,M)},g=function(E){return $t(E,{locale:n,format:n.cellYearFormat,generateConfig:r})},b=function(E){return ce({},"".concat(t,"-cell-in-view"),Pr(r,E,y)||Pr(r,E,w)||Ua(r,y,w,E))},C=a?function(S,E){var M=r.setMonth(S,0),k=r.setDate(M,1),T=r.addYear(k,1),R=r.addDate(T,-1);return a(k,E)&&a(R,E)}:null,x=f.createElement("button",{type:"button",key:"decade","aria-label":n.decadeSelect,onClick:function(){s("decade")},tabIndex:-1,className:"".concat(t,"-decade-btn")},$t(y,{locale:n,format:n.yearFormat,generateConfig:r}),"-",$t(w,{locale:n,format:n.yearFormat,generateConfig:r}));return f.createElement(Dr.Provider,{value:l},f.createElement("div",{className:u},f.createElement(Jr,{superOffset:function(E){return r.addYear(o,E*10)},onChange:i,getStart:h,getEnd:m},x),f.createElement(Mo,_e({},e,{disabledDate:C,titleFormat:n.fieldYearFormat,colNum:3,rowNum:4,baseDate:v,getCellDate:p,getCellText:g,getCellClassName:b}))))}var Pw={date:ei,datetime:ww,week:Ew,month:xw,quarter:Sw,year:Mw,decade:Cw,time:Yf};function Dw(e,t){var n,r=e.locale,o=e.generateConfig,a=e.direction,i=e.prefixCls,s=e.tabIndex,u=s===void 0?0:s,c=e.multiple,d=e.defaultValue,l=e.value,h=e.onChange,m=e.onSelect,y=e.defaultPickerValue,w=e.pickerValue,v=e.onPickerValueChange,p=e.mode,g=e.onPanelChange,b=e.picker,C=b===void 0?"date":b,x=e.showTime,S=e.hoverValue,E=e.hoverRangeValue,M=e.cellRender,k=e.dateRender,T=e.monthCellRender,R=e.components,F=R===void 0?{}:R,V=e.hideHeader,$=((n=f.useContext(Cn))===null||n===void 0?void 0:n.prefixCls)||i||"rc-picker",L=f.useRef();f.useImperativeHandle(t,function(){return{nativeElement:L.current}});var _=Df(e),H=X(_,4),N=H[0],z=H[1],B=H[2],A=H[3],j=Ef(r,z),Y=C==="date"&&x?"datetime":C,U=f.useMemo(function(){return kf(Y,B,A,N,j)},[Y,B,A,N,j]),ne=o.getNow(),te=ln(C,{value:p,postState:function(fe){return fe||"date"}}),J=X(te,2),G=J[0],q=J[1],Z=G==="date"&&U?"datetime":G,O=jf(o,r,Y),I=ln(d,{value:l}),W=X(I,2),K=W[0],oe=W[1],Q=f.useMemo(function(){var le=Mr(K).filter(function(fe){return fe});return c?le:le.slice(0,1)},[K,c]),ae=ct(function(le){oe(le),h&&(le===null||Q.length!==le.length||Q.some(function(fe,Pe){return!Ut(o,r,fe,le[Pe],Y)}))&&(h==null||h(c?le:le[0]))}),ee=ct(function(le){if(m==null||m(le),G===C){var fe=c?O(Q,le):[le];ae(fe)}}),ie=ln(y||Q[0]||ne,{value:w}),me=X(ie,2),ye=me[0],de=me[1];f.useEffect(function(){Q[0]&&!w&&de(Q[0])},[Q[0]]);var se=function(fe,Pe){g==null||g(fe||w,Pe||G)},He=function(fe){var Pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;de(fe),v==null||v(fe),Pe&&se(fe)},Le=function(fe,Pe){q(fe),Pe&&He(Pe),se(Pe,fe)},ge=function(fe){if(ee(fe),He(fe),G!==C){var Pe=["decade","year"],ue=[].concat(Pe,["month"]),he={quarter:[].concat(Pe,["quarter"]),week:[].concat(wt(ue),["week"]),date:[].concat(wt(ue),["date"])},Ue=he[C]||ue,Je=Ue.indexOf(G),nt=Ue[Je+1];nt&&Le(nt,fe)}},Ye=f.useMemo(function(){var le,fe;if(Array.isArray(E)){var Pe=X(E,2);le=Pe[0],fe=Pe[1]}else le=E;return!le&&!fe?null:(le=le||fe,fe=fe||le,o.isAfter(le,fe)?[fe,le]:[le,fe])},[E,o]),Fe=el(M,k,T),ze=F[Z]||Pw[Z]||ei,Ge=f.useContext(sr),Ke=f.useMemo(function(){return re(re({},Ge),{},{hideHeader:V})},[Ge,V]),Ee="".concat($,"-panel"),$e=Ya(e,["showWeek","prevIcon","nextIcon","superPrevIcon","superNextIcon","disabledDate","minDate","maxDate","onHover"]);return f.createElement(sr.Provider,{value:Ke},f.createElement("div",{ref:L,tabIndex:u,className:Xe(Ee,ce({},"".concat(Ee,"-rtl"),a==="rtl"))},f.createElement(ze,_e({},$e,{showTime:U,prefixCls:$,locale:j,generateConfig:o,onModeChange:Le,pickerValue:ye,onPickerValueChange:function(fe){He(fe,!0)},value:Q[0],onSelect:ge,values:Q,cellRender:Fe,hoverRangeValue:Ye,hoverValue:S}))))}var ti=f.memo(f.forwardRef(Dw));function kw(e){var t=e.picker,n=e.multiplePanel,r=e.pickerValue,o=e.onPickerValueChange,a=e.needConfirm,i=e.onSubmit,s=e.range,u=e.hoverValue,c=f.useContext(Cn),d=c.prefixCls,l=c.generateConfig,h=f.useCallback(function(g,b){return Eo(l,t,g,b)},[l,t]),m=f.useMemo(function(){return h(r,1)},[r,h]),y=function(b){o(h(b,-1))},w={onCellDblClick:function(){a&&i()}},v=t==="time",p=re(re({},e),{},{hoverValue:null,hoverRangeValue:null,hideHeader:v});return s?p.hoverRangeValue=u:p.hoverValue=u,n?f.createElement("div",{className:"".concat(d,"-panels")},f.createElement(sr.Provider,{value:re(re({},w),{},{hideNext:!0})},f.createElement(ti,p)),f.createElement(sr.Provider,{value:re(re({},w),{},{hidePrev:!0})},f.createElement(ti,_e({},p,{pickerValue:m,onPickerValueChange:y})))):f.createElement(sr.Provider,{value:re({},w)},f.createElement(ti,p))}function Uf(e){return typeof e=="function"?e():e}function Nw(e){var t=e.prefixCls,n=e.presets,r=e.onClick,o=e.onHover;return n.length?f.createElement("div",{className:"".concat(t,"-presets")},f.createElement("ul",null,n.map(function(a,i){var s=a.label,u=a.value;return f.createElement("li",{key:i,onClick:function(){r(Uf(u))},onMouseEnter:function(){o(Uf(u))},onMouseLeave:function(){o(null)}},s)}))):null}function qf(e){var t=e.panelRender,n=e.internalMode,r=e.picker,o=e.showNow,a=e.range,i=e.multiple,s=e.activeInfo,u=s===void 0?[0,0,0]:s,c=e.presets,d=e.onPresetHover,l=e.onPresetSubmit,h=e.onFocus,m=e.onBlur,y=e.onPanelMouseDown,w=e.direction,v=e.value,p=e.onSelect,g=e.isInvalid,b=e.defaultOpenValue,C=e.onOk,x=e.onSubmit,S=f.useContext(Cn),E=S.prefixCls,M="".concat(E,"-panel"),k=w==="rtl",T=f.useRef(null),R=f.useRef(null),F=f.useState(0),V=X(F,2),$=V[0],L=V[1],_=f.useState(0),H=X(_,2),N=H[0],z=H[1],B=f.useState(0),A=X(B,2),j=A[0],Y=A[1],U=function(ge){ge.width&&L(ge.width)},ne=X(u,3),te=ne[0],J=ne[1],G=ne[2],q=f.useState(0),Z=X(q,2),O=Z[0],I=Z[1];f.useEffect(function(){I(10)},[te]),f.useEffect(function(){if(a&&R.current){var Le,ge=((Le=T.current)===null||Le===void 0?void 0:Le.offsetWidth)||0,Ye=R.current.getBoundingClientRect();if(!Ye.height||Ye.right<0){I(function(Ke){return Math.max(0,Ke-1)});return}var Fe=(k?J-ge:te)-Ye.left;if(Y(Fe),$&&$<G){var ze=k?Ye.right-(J-ge+$):te+ge-Ye.left-$,Ge=Math.max(0,ze);z(Ge)}else z(0)}},[O,k,$,te,J,G,a]);function W(Le){return Le.filter(function(ge){return ge})}var K=f.useMemo(function(){return W(Mr(v))},[v]),oe=r==="time"&&!K.length,Q=f.useMemo(function(){return oe?W([b]):K},[oe,K,b]),ae=oe?b:K,ee=f.useMemo(function(){return Q.length?Q.some(function(Le){return g(Le)}):!0},[Q,g]),ie=function(){oe&&p(b),C(),x()},me=f.createElement("div",{className:"".concat(E,"-panel-layout")},f.createElement(Nw,{prefixCls:E,presets:c,onClick:l,onHover:d}),f.createElement("div",null,f.createElement(kw,_e({},e,{value:ae})),f.createElement(mw,_e({},e,{showNow:i?!1:o,invalid:ee,onSubmit:ie}))));t&&(me=t(me));var ye="".concat(M,"-container"),de="marginLeft",se="marginRight",He=f.createElement("div",{onMouseDown:y,tabIndex:-1,className:Xe(ye,"".concat(E,"-").concat(n,"-panel-container")),style:ce(ce({},k?se:de,N),k?de:se,"auto"),onFocus:h,onBlur:m},me);return a&&(He=f.createElement("div",{onMouseDown:y,ref:R,className:Xe("".concat(E,"-range-wrapper"),"".concat(E,"-").concat(r,"-range-wrapper"))},f.createElement("div",{ref:T,className:"".concat(E,"-range-arrow"),style:{left:j}}),f.createElement(jn,{onResize:U},He))),He}function Gf(e,t){var n=e.format,r=e.maskFormat,o=e.generateConfig,a=e.locale,i=e.preserveInvalidOnBlur,s=e.inputReadOnly,u=e.required,c=e["aria-required"],d=e.onSubmit,l=e.onFocus,h=e.onBlur,m=e.onInputChange,y=e.onInvalid,w=e.open,v=e.onOpenChange,p=e.onKeyDown,g=e.onChange,b=e.activeHelp,C=e.name,x=e.autoComplete,S=e.id,E=e.value,M=e.invalid,k=e.placeholder,T=e.disabled,R=e.activeIndex,F=e.allHelp,V=e.picker,$=function(j,Y){var U=o.locale.parse(a.locale,j,[Y]);return U&&o.isValidate(U)?U:null},L=n[0],_=f.useCallback(function(A){return $t(A,{locale:a,format:L,generateConfig:o})},[a,o,L]),H=f.useMemo(function(){return E.map(_)},[E,_]),N=f.useMemo(function(){var A=V==="time"?8:10,j=typeof L=="function"?L(o.getNow()).length:L.length;return Math.max(A,j)+2},[L,V,o]),z=function(j){for(var Y=0;Y<n.length;Y+=1){var U=n[Y];if(typeof U=="string"){var ne=$(j,U);if(ne)return ne}}return!1},B=function(j){function Y(te){return j!==void 0?te[j]:te}var U=Is(e,{aria:!0,data:!0}),ne=re(re({},U),{},{format:r,validateFormat:function(J){return!!z(J)},preserveInvalidOnBlur:i,readOnly:s,required:u,"aria-required":c,name:C,autoComplete:x,size:N,id:Y(S),value:Y(H)||"",invalid:Y(M),placeholder:Y(k),active:R===j,helped:F||b&&R===j,disabled:Y(T),onFocus:function(J){l(J,j)},onBlur:function(J){h(J,j)},onSubmit:d,onChange:function(J){m();var G=z(J);if(G){y(!1,j),g(G,j);return}y(!!J,j)},onHelp:function(){v(!0,{index:j})},onKeyDown:function(J){var G=!1;if(p==null||p(J,function(){G=!0}),!J.defaultPrevented&&!G)switch(J.key){case"Escape":v(!1,{index:j});break;case"Enter":w||v(!0);break}}},t==null?void 0:t({valueTexts:H}));return Object.keys(ne).forEach(function(te){ne[te]===void 0&&delete ne[te]}),ne};return[B,_]}var _w=["onMouseEnter","onMouseLeave"];function Kf(e){return f.useMemo(function(){return Ya(e,_w)},[e])}var Ow=["icon","type"],Tw=["onClear"];function ni(e){var t=e.icon,n=e.type,r=pt(e,Ow),o=f.useContext(Cn),a=o.prefixCls;return t?f.createElement("span",_e({className:"".concat(a,"-").concat(n)},r),t):null}function ll(e){var t=e.onClear,n=pt(e,Tw);return f.createElement(ni,_e({},n,{type:"clear",role:"button",onMouseDown:function(o){o.preventDefault()},onClick:function(o){o.stopPropagation(),t()}}))}var ul=["YYYY","MM","DD","HH","mm","ss","SSS"],Xf="顧",Iw=function(){function e(t){qr(this,e),ce(this,"format",void 0),ce(this,"maskFormat",void 0),ce(this,"cells",void 0),ce(this,"maskCells",void 0),this.format=t;var n=ul.map(function(s){return"(".concat(s,")")}).join("|"),r=new RegExp(n,"g");this.maskFormat=t.replace(r,function(s){return Xf.repeat(s.length)});var o=new RegExp("(".concat(ul.join("|"),")")),a=(t.split(o)||[]).filter(function(s){return s}),i=0;this.cells=a.map(function(s){var u=ul.includes(s),c=i,d=i+s.length;return i=d,{text:s,mask:u,start:c,end:d}}),this.maskCells=this.cells.filter(function(s){return s.mask})}return Gr(e,[{key:"getSelection",value:function(n){var r=this.maskCells[n]||{},o=r.start,a=r.end;return[o||0,a||0]}},{key:"match",value:function(n){for(var r=0;r<this.maskFormat.length;r+=1){var o=this.maskFormat[r],a=n[r];if(!a||o!==Xf&&o!==a)return!1}return!0}},{key:"size",value:function(){return this.maskCells.length}},{key:"getMaskCellIndex",value:function(n){for(var r=Number.MAX_SAFE_INTEGER,o=0,a=0;a<this.maskCells.length;a+=1){var i=this.maskCells[a],s=i.start,u=i.end;if(n>=s&&n<=u)return a;var c=Math.min(Math.abs(n-s),Math.abs(n-u));c<r&&(r=c,o=a)}return o}}]),e}();function Rw(e){var t={YYYY:[0,9999,new Date().getFullYear()],MM:[1,12],DD:[1,31],HH:[0,23],mm:[0,59],ss:[0,59],SSS:[0,999]};return t[e]}var Aw=["active","showActiveCls","suffixIcon","format","validateFormat","onChange","onInput","helped","onHelp","onSubmit","onKeyDown","preserveInvalidOnBlur","invalid","clearIcon"],cl=f.forwardRef(function(e,t){var n=e.active,r=e.showActiveCls,o=r===void 0?!0:r,a=e.suffixIcon,i=e.format,s=e.validateFormat,u=e.onChange;e.onInput;var c=e.helped,d=e.onHelp,l=e.onSubmit,h=e.onKeyDown,m=e.preserveInvalidOnBlur,y=m===void 0?!1:m,w=e.invalid,v=e.clearIcon,p=pt(e,Aw),g=e.value,b=e.onFocus,C=e.onBlur,x=e.onMouseUp,S=f.useContext(Cn),E=S.prefixCls,M=S.input,k=M===void 0?"input":M,T="".concat(E,"-input"),R=f.useState(!1),F=X(R,2),V=F[0],$=F[1],L=f.useState(g),_=X(L,2),H=_[0],N=_[1],z=f.useState(""),B=X(z,2),A=B[0],j=B[1],Y=f.useState(null),U=X(Y,2),ne=U[0],te=U[1],J=f.useState(null),G=X(J,2),q=G[0],Z=G[1],O=H||"";f.useEffect(function(){N(g)},[g]);var I=f.useRef(),W=f.useRef();f.useImperativeHandle(t,function(){return{nativeElement:I.current,inputElement:W.current,focus:function(le){W.current.focus(le)},blur:function(){W.current.blur()}}});var K=f.useMemo(function(){return new Iw(i||"")},[i]),oe=f.useMemo(function(){return c?[0,0]:K.getSelection(ne)},[K,ne,c]),Q=X(oe,2),ae=Q[0],ee=Q[1],ie=function(le){le&&le!==i&&le!==g&&d()},me=ct(function($e){s($e)&&u($e),N($e),ie($e)}),ye=function(le){if(!i){var fe=le.target.value;ie(fe),N(fe),u(fe)}},de=function(le){var fe=le.clipboardData.getData("text");s(fe)&&me(fe)},se=f.useRef(!1),He=function(){se.current=!0},Le=function(le){var fe=le.target,Pe=fe.selectionStart,ue=K.getMaskCellIndex(Pe);te(ue),Z({}),x==null||x(le),se.current=!1},ge=function(le){$(!0),te(0),j(""),b(le)},Ye=function(le){C(le)},Fe=function(le){$(!1),Ye(le)};al(n,function(){!n&&!y&&N(g)});var ze=function(le){le.key==="Enter"&&s(O)&&l(),h==null||h(le)},Ge=function(le){ze(le);var fe=le.key,Pe=null,ue=null,he=ee-ae,Ue=i.slice(ae,ee),Je=function(be){te(function(We){var Oe=We+be;return Oe=Math.max(Oe,0),Oe=Math.min(Oe,K.size()-1),Oe})},nt=function(be){var We=Rw(Ue),Oe=X(We,3),Ce=Oe[0],Se=Oe[1],pe=Oe[2],Ve=O.slice(ae,ee),dt=Number(Ve);if(isNaN(dt))return String(pe||(be>0?Ce:Se));var ut=dt+be,rt=Se-Ce+1;return String(Ce+(rt+ut-Ce)%rt)};switch(fe){case"Backspace":case"Delete":Pe="",ue=Ue;break;case"ArrowLeft":Pe="",Je(-1);break;case"ArrowRight":Pe="",Je(1);break;case"ArrowUp":Pe="",ue=nt(1);break;case"ArrowDown":Pe="",ue=nt(-1);break;default:isNaN(Number(fe))||(Pe=A+fe,ue=Pe);break}if(Pe!==null&&(j(Pe),Pe.length>=he&&(Je(1),j(""))),ue!==null){var yt=O.slice(0,ae)+Js(ue,he)+O.slice(ee);me(yt.slice(0,i.length))}Z({})},Ke=f.useRef();ht(function(){if(!(!V||!i||se.current)){if(!K.match(O)){me(i);return}return W.current.setSelectionRange(ae,ee),Ke.current=mt(function(){W.current.setSelectionRange(ae,ee)}),function(){mt.cancel(Ke.current)}}},[K,i,V,O,ne,ae,ee,q,me]);var Ee=i?{onFocus:ge,onBlur:Fe,onKeyDown:Ge,onMouseDown:He,onMouseUp:Le,onPaste:de}:{};return f.createElement("div",{ref:I,className:Xe(T,ce(ce({},"".concat(T,"-active"),n&&o),"".concat(T,"-placeholder"),c))},f.createElement(k,_e({ref:W,"aria-invalid":w,autoComplete:"off"},p,{onKeyDown:ze,onBlur:Ye},Ee,{value:O,onChange:ye})),f.createElement(ni,{type:"suffix",icon:a}),v)}),Lw=["id","prefix","clearIcon","suffixIcon","separator","activeIndex","activeHelp","allHelp","focused","onFocus","onBlur","onKeyDown","locale","generateConfig","placeholder","className","style","onClick","onClear","value","onChange","onSubmit","onInputChange","format","maskFormat","preserveInvalidOnBlur","onInvalid","disabled","invalid","inputReadOnly","direction","onOpenChange","onActiveInfo","placement","onMouseDown","required","aria-required","autoFocus","tabIndex"],$w=["index"];function Fw(e,t){var n=e.id,r=e.prefix,o=e.clearIcon,a=e.suffixIcon,i=e.separator,s=i===void 0?"~":i,u=e.activeIndex;e.activeHelp,e.allHelp;var c=e.focused;e.onFocus,e.onBlur,e.onKeyDown,e.locale,e.generateConfig;var d=e.placeholder,l=e.className,h=e.style,m=e.onClick,y=e.onClear,w=e.value;e.onChange,e.onSubmit,e.onInputChange,e.format,e.maskFormat,e.preserveInvalidOnBlur,e.onInvalid;var v=e.disabled,p=e.invalid;e.inputReadOnly;var g=e.direction;e.onOpenChange;var b=e.onActiveInfo;e.placement;var C=e.onMouseDown;e.required,e["aria-required"];var x=e.autoFocus,S=e.tabIndex,E=pt(e,Lw),M=g==="rtl",k=f.useContext(Cn),T=k.prefixCls,R=f.useMemo(function(){if(typeof n=="string")return[n];var q=n||{};return[q.start,q.end]},[n]),F=f.useRef(),V=f.useRef(),$=f.useRef(),L=function(Z){var O;return(O=[V,$][Z])===null||O===void 0?void 0:O.current};f.useImperativeHandle(t,function(){return{nativeElement:F.current,focus:function(Z){if(Ct(Z)==="object"){var O,I=Z||{},W=I.index,K=W===void 0?0:W,oe=pt(I,$w);(O=L(K))===null||O===void 0||O.focus(oe)}else{var Q;(Q=L(Z!=null?Z:0))===null||Q===void 0||Q.focus()}},blur:function(){var Z,O;(Z=L(0))===null||Z===void 0||Z.blur(),(O=L(1))===null||O===void 0||O.blur()}}});var _=Kf(E),H=f.useMemo(function(){return Array.isArray(d)?d:[d,d]},[d]),N=Gf(re(re({},e),{},{id:R,placeholder:H})),z=X(N,1),B=z[0],A=f.useState({position:"absolute",width:0}),j=X(A,2),Y=j[0],U=j[1],ne=ct(function(){var q=L(u);if(q){var Z=q.nativeElement.getBoundingClientRect(),O=F.current.getBoundingClientRect(),I=Z.left-O.left;U(function(W){return re(re({},W),{},{width:Z.width,left:I})}),b([Z.left,Z.right,O.width])}});f.useEffect(function(){ne()},[u]);var te=o&&(w[0]&&!v[0]||w[1]&&!v[1]),J=x&&!v[0],G=x&&!J&&!v[1];return f.createElement(jn,{onResize:ne},f.createElement("div",_e({},_,{className:Xe(T,"".concat(T,"-range"),ce(ce(ce(ce({},"".concat(T,"-focused"),c),"".concat(T,"-disabled"),v.every(function(q){return q})),"".concat(T,"-invalid"),p.some(function(q){return q})),"".concat(T,"-rtl"),M),l),style:h,ref:F,onClick:m,onMouseDown:function(Z){var O=Z.target;O!==V.current.inputElement&&O!==$.current.inputElement&&Z.preventDefault(),C==null||C(Z)}}),r&&f.createElement("div",{className:"".concat(T,"-prefix")},r),f.createElement(cl,_e({ref:V},B(0),{autoFocus:J,tabIndex:S,"date-range":"start"})),f.createElement("div",{className:"".concat(T,"-range-separator")},s),f.createElement(cl,_e({ref:$},B(1),{autoFocus:G,tabIndex:S,"date-range":"end"})),f.createElement("div",{className:"".concat(T,"-active-bar"),style:Y}),f.createElement(ni,{type:"suffix",icon:a}),te&&f.createElement(ll,{icon:o,onClear:y})))}var zw=f.forwardRef(Fw);function Zf(e,t){var n=e!=null?e:t;return Array.isArray(n)?n:[n,n]}function ri(e){return e===1?"end":"start"}function Hw(e,t){var n=Tf(e,function(){var Ze=e.disabled,Ae=e.allowEmpty,Qe=Zf(Ze,!1),at=Zf(Ae,!1);return{disabled:Qe,allowEmpty:at}}),r=X(n,6),o=r[0],a=r[1],i=r[2],s=r[3],u=r[4],c=r[5],d=o.prefixCls,l=o.styles,h=o.classNames,m=o.defaultValue,y=o.value,w=o.needConfirm,v=o.onKeyDown,p=o.disabled,g=o.allowEmpty,b=o.disabledDate,C=o.minDate,x=o.maxDate,S=o.defaultOpen,E=o.open,M=o.onOpenChange,k=o.locale,T=o.generateConfig,R=o.picker,F=o.showNow,V=o.showToday,$=o.showTime,L=o.mode,_=o.onPanelChange,H=o.onCalendarChange,N=o.onOk,z=o.defaultPickerValue,B=o.pickerValue,A=o.onPickerValueChange,j=o.inputReadOnly,Y=o.suffixIcon,U=o.onFocus,ne=o.onBlur,te=o.presets,J=o.ranges,G=o.components,q=o.cellRender,Z=o.dateRender,O=o.monthCellRender,I=o.onClick,W=Rf(t),K=If(E,S,p,M),oe=X(K,2),Q=oe[0],ae=oe[1],ee=function(Ae,Qe){(p.some(function(at){return!at})||!Ae)&&ae(Ae,Qe)},ie=Vf(T,k,s,!0,!1,m,y,H,N),me=X(ie,5),ye=me[0],de=me[1],se=me[2],He=me[3],Le=me[4],ge=se(),Ye=Lf(p,g,Q),Fe=X(Ye,9),ze=Fe[0],Ge=Fe[1],Ke=Fe[2],Ee=Fe[3],$e=Fe[4],le=Fe[5],fe=Fe[6],Pe=Fe[7],ue=Fe[8],he=function(Ae,Qe){Ge(!0),U==null||U(Ae,{range:ri(Qe!=null?Qe:Ee)})},Ue=function(Ae,Qe){Ge(!1),ne==null||ne(Ae,{range:ri(Qe!=null?Qe:Ee)})},Je=f.useMemo(function(){if(!$)return null;var Ze=$.disabledTime,Ae=Ze?function(Qe){var at=ri(Ee),Dt=wf(ge,fe,Ee);return Ze(Qe,at,{from:Dt})}:void 0;return re(re({},$),{},{disabledTime:Ae})},[$,Ee,ge,fe]),nt=ln([R,R],{value:L}),yt=X(nt,2),tt=yt[0],be=yt[1],We=tt[Ee]||R,Oe=We==="date"&&Je?"datetime":We,Ce=Oe===R&&Oe!=="time",Se=Bf(R,We,F,V,!0),pe=Wf(o,ye,de,se,He,p,s,ze,Q,c),Ve=X(pe,2),dt=Ve[0],ut=Ve[1],rt=cw(ge,p,fe,T,k,b),Jt=xf(ge,c,g),xt=X(Jt,2),Vt=xt[0],en=xt[1],dn=$f(T,k,ge,tt,Q,Ee,a,Ce,z,B,Je==null?void 0:Je.defaultOpenValue,A,C,x),Wt=X(dn,2),_t=Wt[0],Kt=Wt[1],Et=ct(function(Ze,Ae,Qe){var at=Co(tt,Ee,Ae);if((at[0]!==tt[0]||at[1]!==tt[1])&&be(at),_&&Qe!==!1){var Dt=wt(ge);Ze&&(Dt[Ee]=Ze),_(Dt,at)}}),Bt=function(Ae,Qe){return Co(ge,Qe,Ae)},bt=function(Ae,Qe){var at=ge;Ae&&(at=Bt(Ae,Ee)),Pe(Ee);var Dt=le(at);He(at),dt(Ee,Dt===null),Dt===null?ee(!1,{force:!0}):Qe||W.current.focus({index:Dt})},sn=function(Ae){var Qe,at=Ae.target.getRootNode();if(!W.current.nativeElement.contains((Qe=at.activeElement)!==null&&Qe!==void 0?Qe:document.activeElement)){var Dt=p.findIndex(function(gr){return!gr});Dt>=0&&W.current.focus({index:Dt})}ee(!0),I==null||I(Ae)},Ot=function(){ut(null),ee(!1,{force:!0})},fn=f.useState(null),we=X(fn,2),Me=we[0],Be=we[1],qe=f.useState(null),it=X(qe,2),Ft=it[0],Rt=it[1],tn=f.useMemo(function(){return Ft||ge},[ge,Ft]);f.useEffect(function(){Q||Rt(null)},[Q]);var nn=f.useState([0,0,0]),Xt=X(nn,2),zt=Xt[0],rn=Xt[1],zn=Af(te,J),Hn=function(Ae){Rt(Ae),Be("preset")},jt=function(Ae){var Qe=ut(Ae);Qe&&ee(!1,{force:!0})},Yt=function(Ae){bt(Ae)},gn=function(Ae){Rt(Ae?Bt(Ae,Ee):null),Be("cell")},yn=function(Ae){ee(!0),he(Ae)},Zt=function(){Ke("panel")},Xn=function(Ae){var Qe=Co(ge,Ee,Ae);He(Qe),!w&&!i&&a===Oe&&bt(Ae)},ft=function(){ee(!1)},ot=el(q,Z,O,ri(Ee)),lt=ge[Ee]||null,Tt=ct(function(Ze){return c(Ze,{activeIndex:Ee})}),Te=f.useMemo(function(){var Ze=Is(o,!1),Ae=po(o,[].concat(wt(Object.keys(Ze)),["onChange","onCalendarChange","style","className","onPanelChange","disabledTime"]));return Ae},[o]),Re=f.createElement(qf,_e({},Te,{showNow:Se,showTime:Je,range:!0,multiplePanel:Ce,activeInfo:zt,disabledDate:rt,onFocus:yn,onBlur:Ue,onPanelMouseDown:Zt,picker:R,mode:We,internalMode:Oe,onPanelChange:Et,format:u,value:lt,isInvalid:Tt,onChange:null,onSelect:Xn,pickerValue:_t,defaultOpenValue:Mr($==null?void 0:$.defaultOpenValue)[Ee],onPickerValueChange:Kt,hoverValue:tn,onHover:gn,needConfirm:w,onSubmit:bt,onOk:Le,presets:zn,onPresetHover:Hn,onPresetSubmit:jt,onNow:Yt,cellRender:ot})),Mt=function(Ae,Qe){var at=Bt(Ae,Qe);He(at)},Qt=function(){Ke("input")},Pn=function(Ae,Qe){var at=fe.length,Dt=fe[at-1];if(at&&Dt!==Qe&&w&&!g[Dt]&&!ue(Dt)&&ge[Dt]){W.current.focus({index:Dt});return}Ke("input"),ee(!0,{inherit:!0}),Ee!==Qe&&Q&&!w&&i&&bt(null,!0),$e(Qe),he(Ae,Qe)},Zn=function(Ae,Qe){if(ee(!1),!w&&Ke()==="input"){var at=le(ge);dt(Ee,at===null)}Ue(Ae,Qe)},Dn=function(Ae,Qe){Ae.key==="Tab"&&bt(null,!0),v==null||v(Ae,Qe)},Qn=f.useMemo(function(){return{prefixCls:d,locale:k,generateConfig:T,button:G.button,input:G.input}},[d,k,T,G.button,G.input]);return ht(function(){Q&&Ee!==void 0&&Et(null,R,!1)},[Q,Ee,R]),ht(function(){var Ze=Ke();!Q&&Ze==="input"&&(ee(!1),bt(null,!0)),!Q&&i&&!w&&Ze==="panel"&&(ee(!0),bt())},[Q]),f.createElement(Cn.Provider,{value:Qn},f.createElement(yf,_e({},Cf(o),{popupElement:Re,popupStyle:l.popup,popupClassName:h.popup,visible:Q,onClose:ft,range:!0}),f.createElement(zw,_e({},o,{ref:W,suffixIcon:Y,activeIndex:ze||Q?Ee:null,activeHelp:!!Ft,allHelp:!!Ft&&Me==="preset",focused:ze,onFocus:Pn,onBlur:Zn,onKeyDown:Dn,onSubmit:bt,value:tn,maskFormat:u,onChange:Mt,onInputChange:Qt,format:s,inputReadOnly:j,disabled:p,open:Q,onOpenChange:ee,onClick:sn,onClear:Ot,invalid:Vt,onInvalid:en,onActiveInfo:rn}))))}var Vw=f.forwardRef(Hw),Ww=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],eo=void 0;function Bw(e,t){var n=e.prefixCls,r=e.invalidate,o=e.item,a=e.renderItem,i=e.responsive,s=e.responsiveDisabled,u=e.registerSize,c=e.itemKey,d=e.className,l=e.style,h=e.children,m=e.display,y=e.order,w=e.component,v=w===void 0?"div":w,p=pt(e,Ww),g=i&&!m;function b(M){u(c,M)}f.useEffect(function(){return function(){b(null)}},[]);var C=a&&o!==eo?a(o,{index:y}):h,x;r||(x={opacity:g?0:1,height:g?0:eo,overflowY:g?"hidden":eo,order:i?y:eo,pointerEvents:g?"none":eo,position:g?"absolute":eo});var S={};g&&(S["aria-hidden"]=!0);var E=f.createElement(v,_e({className:Xe(!r&&n,d),style:re(re({},x),l)},S,p,{ref:t}),C);return i&&(E=f.createElement(jn,{onResize:function(k){var T=k.offsetWidth;b(T)},disabled:s},E)),E}var Do=f.forwardRef(Bw);Do.displayName="Item";function jw(e){if(typeof MessageChannel>"u")mt(e);else{var t=new MessageChannel;t.port1.onmessage=function(){return e()},t.port2.postMessage(void 0)}}function Yw(){var e=f.useRef(null),t=function(r){e.current||(e.current=[],jw(function(){It.unstable_batchedUpdates(function(){e.current.forEach(function(o){o()}),e.current=null})})),e.current.push(r)};return t}function ko(e,t){var n=f.useState(t),r=X(n,2),o=r[0],a=r[1],i=ct(function(s){e(function(){a(s)})});return[o,i]}var oi=D.createContext(null),Uw=["component"],qw=["className"],Gw=["className"],Kw=function(t,n){var r=f.useContext(oi);if(!r){var o=t.component,a=o===void 0?"div":o,i=pt(t,Uw);return f.createElement(a,_e({},i,{ref:n}))}var s=r.className,u=pt(r,qw),c=t.className,d=pt(t,Gw);return f.createElement(oi.Provider,{value:null},f.createElement(Do,_e({ref:n,className:Xe(s,c)},u,d)))},Qf=f.forwardRef(Kw);Qf.displayName="RawItem";var Xw=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","suffix","component","itemComponent","onVisibleChange"],Jf="responsive",ev="invalidate";function Zw(e){return"+ ".concat(e.length," ...")}function Qw(e,t){var n=e.prefixCls,r=n===void 0?"rc-overflow":n,o=e.data,a=o===void 0?[]:o,i=e.renderItem,s=e.renderRawItem,u=e.itemKey,c=e.itemWidth,d=c===void 0?10:c,l=e.ssr,h=e.style,m=e.className,y=e.maxCount,w=e.renderRest,v=e.renderRawRest,p=e.suffix,g=e.component,b=g===void 0?"div":g,C=e.itemComponent,x=e.onVisibleChange,S=pt(e,Xw),E=l==="full",M=Yw(),k=ko(M,null),T=X(k,2),R=T[0],F=T[1],V=R||0,$=ko(M,new Map),L=X($,2),_=L[0],H=L[1],N=ko(M,0),z=X(N,2),B=z[0],A=z[1],j=ko(M,0),Y=X(j,2),U=Y[0],ne=Y[1],te=ko(M,0),J=X(te,2),G=J[0],q=J[1],Z=D.useState(null),O=X(Z,2),I=O[0],W=O[1],K=D.useState(null),oe=X(K,2),Q=oe[0],ae=oe[1],ee=f.useMemo(function(){return Q===null&&E?Number.MAX_SAFE_INTEGER:Q||0},[Q,R]),ie=D.useState(!1),me=X(ie,2),ye=me[0],de=me[1],se="".concat(r,"-item"),He=Math.max(B,U),Le=y===Jf,ge=a.length&&Le,Ye=y===ev,Fe=ge||typeof y=="number"&&a.length>y,ze=D.useMemo(function(){var Ce=a;return ge?R===null&&E?Ce=a:Ce=a.slice(0,Math.min(a.length,V/d)):typeof y=="number"&&(Ce=a.slice(0,y)),Ce},[a,d,R,y,ge]),Ge=D.useMemo(function(){return ge?a.slice(ee+1):a.slice(ze.length)},[a,ze,ge,ee]),Ke=D.useCallback(function(Ce,Se){var pe;return typeof u=="function"?u(Ce):(pe=u&&(Ce==null?void 0:Ce[u]))!==null&&pe!==void 0?pe:Se},[u]),Ee=D.useCallback(i||function(Ce){return Ce},[i]);function $e(Ce,Se,pe){Q===Ce&&(Se===void 0||Se===I)||(ae(Ce),pe||(de(Ce<a.length-1),x==null||x(Ce)),Se!==void 0&&W(Se))}function le(Ce,Se){F(Se.clientWidth)}function fe(Ce,Se){H(function(pe){var Ve=new Map(pe);return Se===null?Ve.delete(Ce):Ve.set(Ce,Se),Ve})}function Pe(Ce,Se){ne(Se),A(U)}function ue(Ce,Se){q(Se)}function he(Ce){return _.get(Ke(ze[Ce],Ce))}ht(function(){if(V&&typeof He=="number"&&ze){var Ce=G,Se=ze.length,pe=Se-1;if(!Se){$e(0,null);return}for(var Ve=0;Ve<Se;Ve+=1){var dt=he(Ve);if(E&&(dt=dt||0),dt===void 0){$e(Ve-1,void 0,!0);break}if(Ce+=dt,pe===0&&Ce<=V||Ve===pe-1&&Ce+he(pe)<=V){$e(pe,null);break}else if(Ce+He>V){$e(Ve-1,Ce-dt-G+U);break}}p&&he(0)+G>V&&W(null)}},[V,_,U,G,Ke,ze]);var Ue=ye&&!!Ge.length,Je={};I!==null&&ge&&(Je={position:"absolute",left:I,top:0});var nt={prefixCls:se,responsive:ge,component:C,invalidate:Ye},yt=s?function(Ce,Se){var pe=Ke(Ce,Se);return f.createElement(oi.Provider,{key:pe,value:re(re({},nt),{},{order:Se,item:Ce,itemKey:pe,registerSize:fe,display:Se<=ee})},s(Ce,Se))}:function(Ce,Se){var pe=Ke(Ce,Se);return f.createElement(Do,_e({},nt,{order:Se,key:pe,item:Ce,renderItem:Ee,itemKey:pe,registerSize:fe,display:Se<=ee}))},tt={order:Ue?ee:Number.MAX_SAFE_INTEGER,className:"".concat(se,"-rest"),registerSize:Pe,display:Ue},be=w||Zw,We=v?f.createElement(oi.Provider,{value:re(re({},nt),tt)},v(Ge)):f.createElement(Do,_e({},nt,tt),typeof be=="function"?be(Ge):be),Oe=f.createElement(b,_e({className:Xe(!Ye&&r,m),style:h,ref:t},S),ze.map(yt),Fe?We:null,p&&f.createElement(Do,_e({},nt,{responsive:Le,responsiveDisabled:!ge,order:ee,className:"".concat(se,"-suffix"),registerSize:ue,display:!0,style:Je}),p));return Le?f.createElement(jn,{onResize:le,disabled:!ge},Oe):Oe}var Tn=f.forwardRef(Qw);Tn.displayName="Overflow",Tn.Item=Qf,Tn.RESPONSIVE=Jf,Tn.INVALIDATE=ev;function Jw(e){var t=e.prefixCls,n=e.value,r=e.onRemove,o=e.removeIcon,a=o===void 0?"×":o,i=e.formatDate,s=e.disabled,u=e.maxTagCount,c=e.placeholder,d="".concat(t,"-selector"),l="".concat(t,"-selection"),h="".concat(l,"-overflow");function m(v,p){return f.createElement("span",{className:Xe("".concat(l,"-item")),title:typeof v=="string"?v:null},f.createElement("span",{className:"".concat(l,"-item-content")},v),!s&&p&&f.createElement("span",{onMouseDown:function(b){b.preventDefault()},onClick:p,className:"".concat(l,"-item-remove")},a))}function y(v){var p=i(v),g=function(C){C&&C.stopPropagation(),r(v)};return m(p,g)}function w(v){var p="+ ".concat(v.length," ...");return m(p)}return f.createElement("div",{className:d},f.createElement(Tn,{prefixCls:h,data:n,renderItem:y,renderRest:w,itemKey:function(p){return i(p)},maxCount:u}),!n.length&&f.createElement("span",{className:"".concat(t,"-selection-placeholder")},c))}var eC=["id","open","prefix","clearIcon","suffixIcon","activeHelp","allHelp","focused","onFocus","onBlur","onKeyDown","locale","generateConfig","placeholder","className","style","onClick","onClear","internalPicker","value","onChange","onSubmit","onInputChange","multiple","maxTagCount","format","maskFormat","preserveInvalidOnBlur","onInvalid","disabled","invalid","inputReadOnly","direction","onOpenChange","onMouseDown","required","aria-required","autoFocus","tabIndex","removeIcon"];function tC(e,t){e.id;var n=e.open,r=e.prefix,o=e.clearIcon,a=e.suffixIcon;e.activeHelp,e.allHelp;var i=e.focused;e.onFocus,e.onBlur,e.onKeyDown;var s=e.locale,u=e.generateConfig,c=e.placeholder,d=e.className,l=e.style,h=e.onClick,m=e.onClear,y=e.internalPicker,w=e.value,v=e.onChange,p=e.onSubmit;e.onInputChange;var g=e.multiple,b=e.maxTagCount;e.format,e.maskFormat,e.preserveInvalidOnBlur,e.onInvalid;var C=e.disabled,x=e.invalid;e.inputReadOnly;var S=e.direction;e.onOpenChange;var E=e.onMouseDown;e.required,e["aria-required"];var M=e.autoFocus,k=e.tabIndex,T=e.removeIcon,R=pt(e,eC),F=S==="rtl",V=f.useContext(Cn),$=V.prefixCls,L=f.useRef(),_=f.useRef();f.useImperativeHandle(t,function(){return{nativeElement:L.current,focus:function(J){var G;(G=_.current)===null||G===void 0||G.focus(J)},blur:function(){var J;(J=_.current)===null||J===void 0||J.blur()}}});var H=Kf(R),N=function(J){v([J])},z=function(J){var G=w.filter(function(q){return q&&!Ut(u,s,q,J,y)});v(G),n||p()},B=Gf(re(re({},e),{},{onChange:N}),function(te){var J=te.valueTexts;return{value:J[0]||"",active:i}}),A=X(B,2),j=A[0],Y=A[1],U=!!(o&&w.length&&!C),ne=g?f.createElement(f.Fragment,null,f.createElement(Jw,{prefixCls:$,value:w,onRemove:z,formatDate:Y,maxTagCount:b,disabled:C,removeIcon:T,placeholder:c}),f.createElement("input",{className:"".concat($,"-multiple-input"),value:w.map(Y).join(","),ref:_,readOnly:!0,autoFocus:M,tabIndex:k}),f.createElement(ni,{type:"suffix",icon:a}),U&&f.createElement(ll,{icon:o,onClear:m})):f.createElement(cl,_e({ref:_},j(),{autoFocus:M,tabIndex:k,suffixIcon:a,clearIcon:U&&f.createElement(ll,{icon:o,onClear:m}),showActiveCls:!1}));return f.createElement("div",_e({},H,{className:Xe($,ce(ce(ce(ce(ce({},"".concat($,"-multiple"),g),"".concat($,"-focused"),i),"".concat($,"-disabled"),C),"".concat($,"-invalid"),x),"".concat($,"-rtl"),F),d),style:l,ref:L,onClick:h,onMouseDown:function(J){var G,q=J.target;q!==((G=_.current)===null||G===void 0?void 0:G.inputElement)&&J.preventDefault(),E==null||E(J)}}),r&&f.createElement("div",{className:"".concat($,"-prefix")},r),ne)}var nC=f.forwardRef(tC);function rC(e,t){var n=Tf(e),r=X(n,6),o=r[0],a=r[1],i=r[2],s=r[3],u=r[4],c=r[5],d=o,l=d.prefixCls,h=d.styles,m=d.classNames,y=d.order,w=d.defaultValue,v=d.value,p=d.needConfirm,g=d.onChange,b=d.onKeyDown,C=d.disabled,x=d.disabledDate,S=d.minDate,E=d.maxDate,M=d.defaultOpen,k=d.open,T=d.onOpenChange,R=d.locale,F=d.generateConfig,V=d.picker,$=d.showNow,L=d.showToday,_=d.showTime,H=d.mode,N=d.onPanelChange,z=d.onCalendarChange,B=d.onOk,A=d.multiple,j=d.defaultPickerValue,Y=d.pickerValue,U=d.onPickerValueChange,ne=d.inputReadOnly,te=d.suffixIcon,J=d.removeIcon,G=d.onFocus,q=d.onBlur,Z=d.presets,O=d.components,I=d.cellRender,W=d.dateRender,K=d.monthCellRender,oe=d.onClick,Q=Rf(t);function ae(Te){return Te===null?null:A?Te:Te[0]}var ee=jf(F,R,a),ie=If(k,M,[C],T),me=X(ie,2),ye=me[0],de=me[1],se=function(Re,Mt,Qt){if(z){var Pn=re({},Qt);delete Pn.range,z(ae(Re),ae(Mt),Pn)}},He=function(Re){B==null||B(ae(Re))},Le=Vf(F,R,s,!1,y,w,v,se,He),ge=X(Le,5),Ye=ge[0],Fe=ge[1],ze=ge[2],Ge=ge[3],Ke=ge[4],Ee=ze(),$e=Lf([C]),le=X($e,4),fe=le[0],Pe=le[1],ue=le[2],he=le[3],Ue=function(Re){Pe(!0),G==null||G(Re,{})},Je=function(Re){Pe(!1),q==null||q(Re,{})},nt=ln(V,{value:H}),yt=X(nt,2),tt=yt[0],be=yt[1],We=tt==="date"&&_?"datetime":tt,Oe=Bf(V,tt,$,L),Ce=g&&function(Te,Re){g(ae(Te),ae(Re))},Se=Wf(re(re({},o),{},{onChange:Ce}),Ye,Fe,ze,Ge,[],s,fe,ye,c),pe=X(Se,2),Ve=pe[1],dt=xf(Ee,c),ut=X(dt,2),rt=ut[0],Jt=ut[1],xt=f.useMemo(function(){return rt.some(function(Te){return Te})},[rt]),Vt=function(Re,Mt){if(U){var Qt=re(re({},Mt),{},{mode:Mt.mode[0]});delete Qt.range,U(Re[0],Qt)}},en=$f(F,R,Ee,[tt],ye,he,a,!1,j,Y,Mr(_==null?void 0:_.defaultOpenValue),Vt,S,E),dn=X(en,2),Wt=dn[0],_t=dn[1],Kt=ct(function(Te,Re,Mt){if(be(Re),N&&Mt!==!1){var Qt=Te||Ee[Ee.length-1];N(Qt,Re)}}),Et=function(){Ve(ze()),de(!1,{force:!0})},Bt=function(Re){!C&&!Q.current.nativeElement.contains(document.activeElement)&&Q.current.focus(),de(!0),oe==null||oe(Re)},bt=function(){Ve(null),de(!1,{force:!0})},sn=f.useState(null),Ot=X(sn,2),fn=Ot[0],we=Ot[1],Me=f.useState(null),Be=X(Me,2),qe=Be[0],it=Be[1],Ft=f.useMemo(function(){var Te=[qe].concat(wt(Ee)).filter(function(Re){return Re});return A?Te:Te.slice(0,1)},[Ee,qe,A]),Rt=f.useMemo(function(){return!A&&qe?[qe]:Ee.filter(function(Te){return Te})},[Ee,qe,A]);f.useEffect(function(){ye||it(null)},[ye]);var tn=Af(Z),nn=function(Re){it(Re),we("preset")},Xt=function(Re){var Mt=A?ee(ze(),Re):[Re],Qt=Ve(Mt);Qt&&!A&&de(!1,{force:!0})},zt=function(Re){Xt(Re)},rn=function(Re){it(Re),we("cell")},zn=function(Re){de(!0),Ue(Re)},Hn=function(Re){if(ue("panel"),!(A&&We!==V)){var Mt=A?ee(ze(),Re):[Re];Ge(Mt),!p&&!i&&a===We&&Et()}},jt=function(){de(!1)},Yt=el(I,W,K),gn=f.useMemo(function(){var Te=Is(o,!1),Re=po(o,[].concat(wt(Object.keys(Te)),["onChange","onCalendarChange","style","className","onPanelChange"]));return re(re({},Re),{},{multiple:o.multiple})},[o]),yn=f.createElement(qf,_e({},gn,{showNow:Oe,showTime:_,disabledDate:x,onFocus:zn,onBlur:Je,picker:V,mode:tt,internalMode:We,onPanelChange:Kt,format:u,value:Ee,isInvalid:c,onChange:null,onSelect:Hn,pickerValue:Wt,defaultOpenValue:_==null?void 0:_.defaultOpenValue,onPickerValueChange:_t,hoverValue:Ft,onHover:rn,needConfirm:p,onSubmit:Et,onOk:Ke,presets:tn,onPresetHover:nn,onPresetSubmit:Xt,onNow:zt,cellRender:Yt})),Zt=function(Re){Ge(Re)},Xn=function(){ue("input")},ft=function(Re){ue("input"),de(!0,{inherit:!0}),Ue(Re)},ot=function(Re){de(!1),Je(Re)},lt=function(Re,Mt){Re.key==="Tab"&&Et(),b==null||b(Re,Mt)},Tt=f.useMemo(function(){return{prefixCls:l,locale:R,generateConfig:F,button:O.button,input:O.input}},[l,R,F,O.button,O.input]);return ht(function(){ye&&he!==void 0&&Kt(null,V,!1)},[ye,he,V]),ht(function(){var Te=ue();!ye&&Te==="input"&&(de(!1),Et()),!ye&&i&&!p&&Te==="panel"&&Et()},[ye]),f.createElement(Cn.Provider,{value:Tt},f.createElement(yf,_e({},Cf(o),{popupElement:yn,popupStyle:h.popup,popupClassName:m.popup,visible:ye,onClose:jt}),f.createElement(nC,_e({},o,{ref:Q,suffixIcon:te,removeIcon:J,activeHelp:!!qe,allHelp:!!qe&&fn==="preset",focused:fe,onFocus:ft,onBlur:ot,onKeyDown:lt,onSubmit:Et,value:Rt,maskFormat:u,onChange:Zt,onInputChange:Xn,internalPicker:a,format:s,inputReadOnly:ne,disabled:C,open:ye,onOpenChange:de,onClick:Bt,onClear:bt,invalid:xt,onInvalid:function(Re){Jt(Re,0)}}))))}var oC=f.forwardRef(rC),No={},dl={exports:{}},tv;function aC(){return tv||(tv=1,function(e){function t(n){return n&&n.__esModule?n:{default:n}}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(dl)),dl.exports}var ai={exports:{}},iC=ai.exports,nv;function sC(){return nv||(nv=1,function(e,t){(function(n,r){e.exports=r()})(iC,function(){var n=1e3,r=6e4,o=36e5,a="millisecond",i="second",s="minute",u="hour",c="day",d="week",l="month",h="quarter",m="year",y="date",w="Invalid Date",v=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,p=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function($){var L=["th","st","nd","rd"],_=$%100;return"["+$+(L[(_-20)%10]||L[_]||L[0])+"]"}},b=function($,L,_){var H=String($);return!H||H.length>=L?$:""+Array(L+1-H.length).join(_)+$},C={s:b,z:function($){var L=-$.utcOffset(),_=Math.abs(L),H=Math.floor(_/60),N=_%60;return(L<=0?"+":"-")+b(H,2,"0")+":"+b(N,2,"0")},m:function $(L,_){if(L.date()<_.date())return-$(_,L);var H=12*(_.year()-L.year())+(_.month()-L.month()),N=L.clone().add(H,l),z=_-N<0,B=L.clone().add(H+(z?-1:1),l);return+(-(H+(_-N)/(z?N-B:B-N))||0)},a:function($){return $<0?Math.ceil($)||0:Math.floor($)},p:function($){return{M:l,y:m,w:d,d:c,D:y,h:u,m:s,s:i,ms:a,Q:h}[$]||String($||"").toLowerCase().replace(/s$/,"")},u:function($){return $===void 0}},x="en",S={};S[x]=g;var E="$isDayjsObject",M=function($){return $ instanceof F||!(!$||!$[E])},k=function $(L,_,H){var N;if(!L)return x;if(typeof L=="string"){var z=L.toLowerCase();S[z]&&(N=z),_&&(S[z]=_,N=z);var B=L.split("-");if(!N&&B.length>1)return $(B[0])}else{var A=L.name;S[A]=L,N=A}return!H&&N&&(x=N),N||!H&&x},T=function($,L){if(M($))return $.clone();var _=typeof L=="object"?L:{};return _.date=$,_.args=arguments,new F(_)},R=C;R.l=k,R.i=M,R.w=function($,L){return T($,{locale:L.$L,utc:L.$u,x:L.$x,$offset:L.$offset})};var F=function(){function $(_){this.$L=k(_.locale,null,!0),this.parse(_),this.$x=this.$x||_.x||{},this[E]=!0}var L=$.prototype;return L.parse=function(_){this.$d=function(H){var N=H.date,z=H.utc;if(N===null)return new Date(NaN);if(R.u(N))return new Date;if(N instanceof Date)return new Date(N);if(typeof N=="string"&&!/Z$/i.test(N)){var B=N.match(v);if(B){var A=B[2]-1||0,j=(B[7]||"0").substring(0,3);return z?new Date(Date.UTC(B[1],A,B[3]||1,B[4]||0,B[5]||0,B[6]||0,j)):new Date(B[1],A,B[3]||1,B[4]||0,B[5]||0,B[6]||0,j)}}return new Date(N)}(_),this.init()},L.init=function(){var _=this.$d;this.$y=_.getFullYear(),this.$M=_.getMonth(),this.$D=_.getDate(),this.$W=_.getDay(),this.$H=_.getHours(),this.$m=_.getMinutes(),this.$s=_.getSeconds(),this.$ms=_.getMilliseconds()},L.$utils=function(){return R},L.isValid=function(){return this.$d.toString()!==w},L.isSame=function(_,H){var N=T(_);return this.startOf(H)<=N&&N<=this.endOf(H)},L.isAfter=function(_,H){return T(_)<this.startOf(H)},L.isBefore=function(_,H){return this.endOf(H)<T(_)},L.$g=function(_,H,N){return R.u(_)?this[H]:this.set(N,_)},L.unix=function(){return Math.floor(this.valueOf()/1e3)},L.valueOf=function(){return this.$d.getTime()},L.startOf=function(_,H){var N=this,z=!!R.u(H)||H,B=R.p(_),A=function(q,Z){var O=R.w(N.$u?Date.UTC(N.$y,Z,q):new Date(N.$y,Z,q),N);return z?O:O.endOf(c)},j=function(q,Z){return R.w(N.toDate()[q].apply(N.toDate("s"),(z?[0,0,0,0]:[23,59,59,999]).slice(Z)),N)},Y=this.$W,U=this.$M,ne=this.$D,te="set"+(this.$u?"UTC":"");switch(B){case m:return z?A(1,0):A(31,11);case l:return z?A(1,U):A(0,U+1);case d:var J=this.$locale().weekStart||0,G=(Y<J?Y+7:Y)-J;return A(z?ne-G:ne+(6-G),U);case c:case y:return j(te+"Hours",0);case u:return j(te+"Minutes",1);case s:return j(te+"Seconds",2);case i:return j(te+"Milliseconds",3);default:return this.clone()}},L.endOf=function(_){return this.startOf(_,!1)},L.$set=function(_,H){var N,z=R.p(_),B="set"+(this.$u?"UTC":""),A=(N={},N[c]=B+"Date",N[y]=B+"Date",N[l]=B+"Month",N[m]=B+"FullYear",N[u]=B+"Hours",N[s]=B+"Minutes",N[i]=B+"Seconds",N[a]=B+"Milliseconds",N)[z],j=z===c?this.$D+(H-this.$W):H;if(z===l||z===m){var Y=this.clone().set(y,1);Y.$d[A](j),Y.init(),this.$d=Y.set(y,Math.min(this.$D,Y.daysInMonth())).$d}else A&&this.$d[A](j);return this.init(),this},L.set=function(_,H){return this.clone().$set(_,H)},L.get=function(_){return this[R.p(_)]()},L.add=function(_,H){var N,z=this;_=Number(_);var B=R.p(H),A=function(U){var ne=T(z);return R.w(ne.date(ne.date()+Math.round(U*_)),z)};if(B===l)return this.set(l,this.$M+_);if(B===m)return this.set(m,this.$y+_);if(B===c)return A(1);if(B===d)return A(7);var j=(N={},N[s]=r,N[u]=o,N[i]=n,N)[B]||1,Y=this.$d.getTime()+_*j;return R.w(Y,this)},L.subtract=function(_,H){return this.add(-1*_,H)},L.format=function(_){var H=this,N=this.$locale();if(!this.isValid())return N.invalidDate||w;var z=_||"YYYY-MM-DDTHH:mm:ssZ",B=R.z(this),A=this.$H,j=this.$m,Y=this.$M,U=N.weekdays,ne=N.months,te=N.meridiem,J=function(Z,O,I,W){return Z&&(Z[O]||Z(H,z))||I[O].slice(0,W)},G=function(Z){return R.s(A%12||12,Z,"0")},q=te||function(Z,O,I){var W=Z<12?"AM":"PM";return I?W.toLowerCase():W};return z.replace(p,function(Z,O){return O||function(I){switch(I){case"YY":return String(H.$y).slice(-2);case"YYYY":return R.s(H.$y,4,"0");case"M":return Y+1;case"MM":return R.s(Y+1,2,"0");case"MMM":return J(N.monthsShort,Y,ne,3);case"MMMM":return J(ne,Y);case"D":return H.$D;case"DD":return R.s(H.$D,2,"0");case"d":return String(H.$W);case"dd":return J(N.weekdaysMin,H.$W,U,2);case"ddd":return J(N.weekdaysShort,H.$W,U,3);case"dddd":return U[H.$W];case"H":return String(A);case"HH":return R.s(A,2,"0");case"h":return G(1);case"hh":return G(2);case"a":return q(A,j,!0);case"A":return q(A,j,!1);case"m":return String(j);case"mm":return R.s(j,2,"0");case"s":return String(H.$s);case"ss":return R.s(H.$s,2,"0");case"SSS":return R.s(H.$ms,3,"0");case"Z":return B}return null}(Z)||B.replace(":","")})},L.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},L.diff=function(_,H,N){var z,B=this,A=R.p(H),j=T(_),Y=(j.utcOffset()-this.utcOffset())*r,U=this-j,ne=function(){return R.m(B,j)};switch(A){case m:z=ne()/12;break;case l:z=ne();break;case h:z=ne()/3;break;case d:z=(U-Y)/6048e5;break;case c:z=(U-Y)/864e5;break;case u:z=U/o;break;case s:z=U/r;break;case i:z=U/n;break;default:z=U}return N?z:R.a(z)},L.daysInMonth=function(){return this.endOf(l).$D},L.$locale=function(){return S[this.$L]},L.locale=function(_,H){if(!_)return this.$L;var N=this.clone(),z=k(_,H,!0);return z&&(N.$L=z),N},L.clone=function(){return R.w(this.$d,this)},L.toDate=function(){return new Date(this.valueOf())},L.toJSON=function(){return this.isValid()?this.toISOString():null},L.toISOString=function(){return this.$d.toISOString()},L.toString=function(){return this.$d.toUTCString()},$}(),V=F.prototype;return T.prototype=V,[["$ms",a],["$s",i],["$m",s],["$H",u],["$W",c],["$M",l],["$y",m],["$D",y]].forEach(function($){V[$[1]]=function(L){return this.$g(L,$[0],$[1])}}),T.extend=function($,L){return $.$i||($(L,F,T),$.$i=!0),T},T.locale=k,T.isDayjs=M,T.unix=function($){return T(1e3*$)},T.en=S[x],T.Ls=S,T.p={},T})}(ai)),ai.exports}var ii={exports:{}},lC=ii.exports,rv;function uC(){return rv||(rv=1,function(e,t){(function(n,r){e.exports=r()})(lC,function(){return function(n,r){r.prototype.weekday=function(o){var a=this.$locale().weekStart||0,i=this.$W,s=(i<a?i+7:i)-a;return this.$utils().u(o)?s:this.subtract(s,"day").add(o,"day")}}})}(ii)),ii.exports}var si={exports:{}},cC=si.exports,ov;function dC(){return ov||(ov=1,function(e,t){(function(n,r){e.exports=r()})(cC,function(){return function(n,r,o){var a=r.prototype,i=function(l){return l&&(l.indexOf?l:l.s)},s=function(l,h,m,y,w){var v=l.name?l:l.$locale(),p=i(v[h]),g=i(v[m]),b=p||g.map(function(x){return x.slice(0,y)});if(!w)return b;var C=v.weekStart;return b.map(function(x,S){return b[(S+(C||0))%7]})},u=function(){return o.Ls[o.locale()]},c=function(l,h){return l.formats[h]||function(m){return m.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(y,w,v){return w||v.slice(1)})}(l.formats[h.toUpperCase()])},d=function(){var l=this;return{months:function(h){return h?h.format("MMMM"):s(l,"months")},monthsShort:function(h){return h?h.format("MMM"):s(l,"monthsShort","months",3)},firstDayOfWeek:function(){return l.$locale().weekStart||0},weekdays:function(h){return h?h.format("dddd"):s(l,"weekdays")},weekdaysMin:function(h){return h?h.format("dd"):s(l,"weekdaysMin","weekdays",2)},weekdaysShort:function(h){return h?h.format("ddd"):s(l,"weekdaysShort","weekdays",3)},longDateFormat:function(h){return c(l.$locale(),h)},meridiem:this.$locale().meridiem,ordinal:this.$locale().ordinal}};a.localeData=function(){return d.bind(this)()},o.localeData=function(){var l=u();return{firstDayOfWeek:function(){return l.weekStart||0},weekdays:function(){return o.weekdays()},weekdaysShort:function(){return o.weekdaysShort()},weekdaysMin:function(){return o.weekdaysMin()},months:function(){return o.months()},monthsShort:function(){return o.monthsShort()},longDateFormat:function(h){return c(l,h)},meridiem:l.meridiem,ordinal:l.ordinal}},o.months=function(){return s(u(),"months")},o.monthsShort=function(){return s(u(),"monthsShort","months",3)},o.weekdays=function(l){return s(u(),"weekdays",null,null,l)},o.weekdaysShort=function(l){return s(u(),"weekdaysShort","weekdays",3,l)},o.weekdaysMin=function(l){return s(u(),"weekdaysMin","weekdays",2,l)}}})}(si)),si.exports}var li={exports:{}},fC=li.exports,av;function vC(){return av||(av=1,function(e,t){(function(n,r){e.exports=r()})(fC,function(){var n="week",r="year";return function(o,a,i){var s=a.prototype;s.week=function(u){if(u===void 0&&(u=null),u!==null)return this.add(7*(u-this.week()),"day");var c=this.$locale().yearStart||1;if(this.month()===11&&this.date()>25){var d=i(this).startOf(r).add(1,r).date(c),l=i(this).endOf(n);if(d.isBefore(l))return 1}var h=i(this).startOf(r).date(c).startOf(n).subtract(1,"millisecond"),m=this.diff(h,n,!0);return m<0?i(this).startOf("week").week():Math.ceil(m)},s.weeks=function(u){return u===void 0&&(u=null),this.week(u)}}})}(li)),li.exports}var ui={exports:{}},mC=ui.exports,iv;function hC(){return iv||(iv=1,function(e,t){(function(n,r){e.exports=r()})(mC,function(){return function(n,r){r.prototype.weekYear=function(){var o=this.month(),a=this.week(),i=this.year();return a===1&&o===11?i+1:o===0&&a>=52?i-1:i}}})}(ui)),ui.exports}var ci={exports:{}},pC=ci.exports,sv;function gC(){return sv||(sv=1,function(e,t){(function(n,r){e.exports=r()})(pC,function(){return function(n,r){var o=r.prototype,a=o.format;o.format=function(i){var s=this,u=this.$locale();if(!this.isValid())return a.bind(this)(i);var c=this.$utils(),d=(i||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,function(l){switch(l){case"Q":return Math.ceil((s.$M+1)/3);case"Do":return u.ordinal(s.$D);case"gggg":return s.weekYear();case"GGGG":return s.isoWeekYear();case"wo":return u.ordinal(s.week(),"W");case"w":case"ww":return c.s(s.week(),l==="w"?1:2,"0");case"W":case"WW":return c.s(s.isoWeek(),l==="W"?1:2,"0");case"k":case"kk":return c.s(String(s.$H===0?24:s.$H),l==="k"?1:2,"0");case"X":return Math.floor(s.$d.getTime()/1e3);case"x":return s.$d.getTime();case"z":return"["+s.offsetName()+"]";case"zzz":return"["+s.offsetName("long")+"]";default:return l}});return a.bind(this)(d)}}})}(ci)),ci.exports}var di={exports:{}},yC=di.exports,lv;function bC(){return lv||(lv=1,function(e,t){(function(n,r){e.exports=r()})(yC,function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},r=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,o=/\d/,a=/\d\d/,i=/\d\d?/,s=/\d*[^-_:/,()\s\d]+/,u={},c=function(v){return(v=+v)+(v>68?1900:2e3)},d=function(v){return function(p){this[v]=+p}},l=[/[+-]\d\d:?(\d\d)?|Z/,function(v){(this.zone||(this.zone={})).offset=function(p){if(!p||p==="Z")return 0;var g=p.match(/([+-]|\d\d)/g),b=60*g[1]+(+g[2]||0);return b===0?0:g[0]==="+"?-b:b}(v)}],h=function(v){var p=u[v];return p&&(p.indexOf?p:p.s.concat(p.f))},m=function(v,p){var g,b=u.meridiem;if(b){for(var C=1;C<=24;C+=1)if(v.indexOf(b(C,0,p))>-1){g=C>12;break}}else g=v===(p?"pm":"PM");return g},y={A:[s,function(v){this.afternoon=m(v,!1)}],a:[s,function(v){this.afternoon=m(v,!0)}],Q:[o,function(v){this.month=3*(v-1)+1}],S:[o,function(v){this.milliseconds=100*+v}],SS:[a,function(v){this.milliseconds=10*+v}],SSS:[/\d{3}/,function(v){this.milliseconds=+v}],s:[i,d("seconds")],ss:[i,d("seconds")],m:[i,d("minutes")],mm:[i,d("minutes")],H:[i,d("hours")],h:[i,d("hours")],HH:[i,d("hours")],hh:[i,d("hours")],D:[i,d("day")],DD:[a,d("day")],Do:[s,function(v){var p=u.ordinal,g=v.match(/\d+/);if(this.day=g[0],p)for(var b=1;b<=31;b+=1)p(b).replace(/\[|\]/g,"")===v&&(this.day=b)}],w:[i,d("week")],ww:[a,d("week")],M:[i,d("month")],MM:[a,d("month")],MMM:[s,function(v){var p=h("months"),g=(h("monthsShort")||p.map(function(b){return b.slice(0,3)})).indexOf(v)+1;if(g<1)throw new Error;this.month=g%12||g}],MMMM:[s,function(v){var p=h("months").indexOf(v)+1;if(p<1)throw new Error;this.month=p%12||p}],Y:[/[+-]?\d+/,d("year")],YY:[a,function(v){this.year=c(v)}],YYYY:[/\d{4}/,d("year")],Z:l,ZZ:l};function w(v){var p,g;p=v,g=u&&u.formats;for(var b=(v=p.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(T,R,F){var V=F&&F.toUpperCase();return R||g[F]||n[F]||g[V].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function($,L,_){return L||_.slice(1)})})).match(r),C=b.length,x=0;x<C;x+=1){var S=b[x],E=y[S],M=E&&E[0],k=E&&E[1];b[x]=k?{regex:M,parser:k}:S.replace(/^\[|\]$/g,"")}return function(T){for(var R={},F=0,V=0;F<C;F+=1){var $=b[F];if(typeof $=="string")V+=$.length;else{var L=$.regex,_=$.parser,H=T.slice(V),N=L.exec(H)[0];_.call(R,N),T=T.replace(N,"")}}return function(z){var B=z.afternoon;if(B!==void 0){var A=z.hours;B?A<12&&(z.hours+=12):A===12&&(z.hours=0),delete z.afternoon}}(R),R}}return function(v,p,g){g.p.customParseFormat=!0,v&&v.parseTwoDigitYear&&(c=v.parseTwoDigitYear);var b=p.prototype,C=b.parse;b.parse=function(x){var S=x.date,E=x.utc,M=x.args;this.$u=E;var k=M[1];if(typeof k=="string"){var T=M[2]===!0,R=M[3]===!0,F=T||R,V=M[2];R&&(V=M[2]),u=this.$locale(),!T&&V&&(u=g.Ls[V]),this.$d=function(H,N,z,B){try{if(["x","X"].indexOf(N)>-1)return new Date((N==="X"?1e3:1)*H);var A=w(N)(H),j=A.year,Y=A.month,U=A.day,ne=A.hours,te=A.minutes,J=A.seconds,G=A.milliseconds,q=A.zone,Z=A.week,O=new Date,I=U||(j||Y?1:O.getDate()),W=j||O.getFullYear(),K=0;j&&!Y||(K=Y>0?Y-1:O.getMonth());var oe,Q=ne||0,ae=te||0,ee=J||0,ie=G||0;return q?new Date(Date.UTC(W,K,I,Q,ae,ee,ie+60*q.offset*1e3)):z?new Date(Date.UTC(W,K,I,Q,ae,ee,ie)):(oe=new Date(W,K,I,Q,ae,ee,ie),Z&&(oe=B(oe).week(Z).toDate()),oe)}catch{return new Date("")}}(S,k,E,g),this.init(),V&&V!==!0&&(this.$L=this.locale(V).$L),F&&S!=this.format(k)&&(this.$d=new Date("")),u={}}else if(k instanceof Array)for(var $=k.length,L=1;L<=$;L+=1){M[1]=k[L-1];var _=g.apply(this,M);if(_.isValid()){this.$d=_.$d,this.$L=_.$L,this.init();break}L===$&&(this.$d=new Date(""))}else C.call(this,x)}}})}(di)),di.exports}var uv;function wC(){if(uv)return No;uv=1;var e=aC().default;Object.defineProperty(No,"__esModule",{value:!0}),No.default=void 0;var t=e(sC()),n=e(uC()),r=e(dC()),o=e(vC()),a=e(hC()),i=e(gC()),s=e(bC());t.default.extend(s.default),t.default.extend(i.default),t.default.extend(n.default),t.default.extend(r.default),t.default.extend(o.default),t.default.extend(a.default),t.default.extend(function(l,h){var m=h.prototype,y=m.format;m.format=function(v){var p=(v||"").replace("Wo","wo");return y.bind(this)(p)}});var u={bn_BD:"bn-bd",by_BY:"be",en_GB:"en-gb",en_US:"en",fr_BE:"fr",fr_CA:"fr-ca",hy_AM:"hy-am",kmr_IQ:"ku",nl_BE:"nl-be",pt_BR:"pt-br",zh_CN:"zh-cn",zh_HK:"zh-hk",zh_TW:"zh-tw"},c=function(h){var m=u[h];return m||h.split("_")[0]},d={getNow:function(){var h=(0,t.default)();return typeof h.tz=="function"?h.tz():h},getFixedDate:function(h){return(0,t.default)(h,["YYYY-M-DD","YYYY-MM-DD"])},getEndDate:function(h){return h.endOf("month")},getWeekDay:function(h){var m=h.locale("en");return m.weekday()+m.localeData().firstDayOfWeek()},getYear:function(h){return h.year()},getMonth:function(h){return h.month()},getDate:function(h){return h.date()},getHour:function(h){return h.hour()},getMinute:function(h){return h.minute()},getSecond:function(h){return h.second()},getMillisecond:function(h){return h.millisecond()},addYear:function(h,m){return h.add(m,"year")},addMonth:function(h,m){return h.add(m,"month")},addDate:function(h,m){return h.add(m,"day")},setYear:function(h,m){return h.year(m)},setMonth:function(h,m){return h.month(m)},setDate:function(h,m){return h.date(m)},setHour:function(h,m){return h.hour(m)},setMinute:function(h,m){return h.minute(m)},setSecond:function(h,m){return h.second(m)},setMillisecond:function(h,m){return h.millisecond(m)},isAfter:function(h,m){return h.isAfter(m)},isValidate:function(h){return h.isValid()},locale:{getWeekFirstDay:function(h){return(0,t.default)().locale(c(h)).localeData().firstDayOfWeek()},getWeekFirstDate:function(h,m){return m.locale(c(h)).weekday(0)},getWeek:function(h,m){return m.locale(c(h)).week()},getShortWeekDays:function(h){return(0,t.default)().locale(c(h)).localeData().weekdaysMin()},getShortMonths:function(h){return(0,t.default)().locale(c(h)).localeData().monthsShort()},format:function(h,m,y){return m.locale(c(h)).format(y)},parse:function(h,m,y){for(var w=c(h),v=0;v<y.length;v+=1){var p=y[v],g=m;if(p.includes("wo")||p.includes("Wo")){for(var b=g.split("-")[0],C=g.split("-")[1],x=(0,t.default)(b,"YYYY").startOf("year").locale(w),S=0;S<=52;S+=1){var E=x.add(S,"week");if(E.format("Wo")===C)return E}return null}var M=(0,t.default)(g,p,!0).locale(w);if(M.isValid())return M}return null}}};return No.default=d,No}var CC=wC();const fl=ks(CC),xC=e=>{const{locale:t}=D.useContext(hn);return P.jsx(ti,{...e,prefixCls:"univer-date-picker",generateConfig:fl,locale:t==null?void 0:t.Picker})};function SC(e){const{value:t,onChange:n,...r}=e,{locale:o}=D.useContext(hn);function a(i,s){!Array.isArray(i)&&!Array.isArray(s)&&n(i,s)}return P.jsx(oC,{...r,value:t,prefixCls:"univer-date-picker",generateConfig:fl,locale:o==null?void 0:o.Picker,suffixIcon:P.jsx(Ji,{className:"univer-date-picker-suffix-icon"}),onChange:a})}function EC(e){const{value:t,onChange:n,...r}=e,{locale:o}=D.useContext(hn);function a(i,s){Array.isArray(i)&&Array.isArray(s)&&n(i,s)}return P.jsx(Vw,{...r,value:t,prefixCls:"univer-date-range-picker",generateConfig:fl,locale:o==null?void 0:o.Picker,separator:P.jsx(Iu,{}),suffixIcon:P.jsx(Ji,{className:"univer-date-range-picker-suffix-icon"}),onChange:a})}var vl={exports:{}},_o={},Oo={exports:{}},MC=Oo.exports,cv;function ml(){return cv||(cv=1,function(e,t){(function(n,r){r(t)})(MC,function(n){function r(G){return function(Z,O,I,W,K,oe,Q){return G(Z,O,Q)}}function o(G){return function(Z,O,I,W){if(!Z||!O||typeof Z!="object"||typeof O!="object")return G(Z,O,I,W);var K=W.get(Z),oe=W.get(O);if(K&&oe)return K===O&&oe===Z;W.set(Z,O),W.set(O,Z);var Q=G(Z,O,I,W);return W.delete(Z),W.delete(O),Q}}function a(G,q){var Z={};for(var O in G)Z[O]=G[O];for(var O in q)Z[O]=q[O];return Z}function i(G){return G.constructor===Object||G.constructor==null}function s(G){return typeof G.then=="function"}function u(G,q){return G===q||G!==G&&q!==q}var c="[object Arguments]",d="[object Boolean]",l="[object Date]",h="[object RegExp]",m="[object Map]",y="[object Number]",w="[object Object]",v="[object Set]",p="[object String]",g=Object.prototype.toString;function b(G){var q=G.areArraysEqual,Z=G.areDatesEqual,O=G.areMapsEqual,I=G.areObjectsEqual,W=G.areRegExpsEqual,K=G.areSetsEqual,oe=G.createIsNestedEqual,Q=oe(ae);function ae(ee,ie,me){if(ee===ie)return!0;if(!ee||!ie||typeof ee!="object"||typeof ie!="object")return ee!==ee&&ie!==ie;if(i(ee)&&i(ie))return I(ee,ie,Q,me);var ye=Array.isArray(ee),de=Array.isArray(ie);if(ye||de)return ye===de&&q(ee,ie,Q,me);var se=g.call(ee);return se!==g.call(ie)?!1:se===l?Z(ee,ie,Q,me):se===h?W(ee,ie,Q,me):se===m?O(ee,ie,Q,me):se===v?K(ee,ie,Q,me):se===w||se===c?s(ee)||s(ie)?!1:I(ee,ie,Q,me):se===d||se===y||se===p?u(ee.valueOf(),ie.valueOf()):!1}return ae}function C(G,q,Z,O){var I=G.length;if(q.length!==I)return!1;for(;I-- >0;)if(!Z(G[I],q[I],I,I,G,q,O))return!1;return!0}var x=o(C);function S(G,q){return u(G.valueOf(),q.valueOf())}function E(G,q,Z,O){var I=G.size===q.size;if(!I)return!1;if(!G.size)return!0;var W={},K=0;return G.forEach(function(oe,Q){if(I){var ae=!1,ee=0;q.forEach(function(ie,me){!ae&&!W[ee]&&(ae=Z(Q,me,K,ee,G,q,O)&&Z(oe,ie,Q,me,G,q,O))&&(W[ee]=!0),ee++}),K++,I=ae}}),I}var M=o(E),k="_owner",T=Object.prototype.hasOwnProperty;function R(G,q,Z,O){var I=Object.keys(G),W=I.length;if(Object.keys(q).length!==W)return!1;for(var K;W-- >0;){if(K=I[W],K===k){var oe=!!G.$$typeof,Q=!!q.$$typeof;if((oe||Q)&&oe!==Q)return!1}if(!T.call(q,K)||!Z(G[K],q[K],K,K,G,q,O))return!1}return!0}var F=o(R);function V(G,q){return G.source===q.source&&G.flags===q.flags}function $(G,q,Z,O){var I=G.size===q.size;if(!I)return!1;if(!G.size)return!0;var W={};return G.forEach(function(K,oe){if(I){var Q=!1,ae=0;q.forEach(function(ee,ie){!Q&&!W[ae]&&(Q=Z(K,ee,oe,ie,G,q,O))&&(W[ae]=!0),ae++}),I=Q}}),I}var L=o($),_=Object.freeze({areArraysEqual:C,areDatesEqual:S,areMapsEqual:E,areObjectsEqual:R,areRegExpsEqual:V,areSetsEqual:$,createIsNestedEqual:r}),H=Object.freeze({areArraysEqual:x,areDatesEqual:S,areMapsEqual:M,areObjectsEqual:F,areRegExpsEqual:V,areSetsEqual:L,createIsNestedEqual:r}),N=b(_);function z(G,q){return N(G,q,void 0)}var B=b(a(_,{createIsNestedEqual:function(){return u}}));function A(G,q){return B(G,q,void 0)}var j=b(H);function Y(G,q){return j(G,q,new WeakMap)}var U=b(a(H,{createIsNestedEqual:function(){return u}}));function ne(G,q){return U(G,q,new WeakMap)}function te(G){return b(a(_,G(_)))}function J(G){var q=b(a(H,G(H)));return function(Z,O,I){return I===void 0&&(I=new WeakMap),q(Z,O,I)}}n.circularDeepEqual=Y,n.circularShallowEqual=ne,n.createCustomCircularEqual=J,n.createCustomEqual=te,n.deepEqual=z,n.sameValueZeroEqual=u,n.shallowEqual=A,Object.defineProperty(n,"__esModule",{value:!0})})}(Oo,Oo.exports)),Oo.exports}var fi={exports:{}},dv;function hl(){if(dv)return fi.exports;dv=1;function e(n){var r,o,a="";if(typeof n=="string"||typeof n=="number")a+=n;else if(typeof n=="object")if(Array.isArray(n)){var i=n.length;for(r=0;r<i;r++)n[r]&&(o=e(n[r]))&&(a&&(a+=" "),a+=o)}else for(o in n)n[o]&&(a&&(a+=" "),a+=o);return a}function t(){for(var n,r,o=0,a="",i=arguments.length;o<i;o++)(n=arguments[o])&&(r=e(n))&&(a&&(a+=" "),a+=r);return a}return fi.exports=t,fi.exports.clsx=t,fi.exports}var st={},pl,fv;function PC(){return fv||(fv=1,pl=function(t,n,r){return t===n?!0:t.className===n.className&&r(t.style,n.style)&&t.width===n.width&&t.autoSize===n.autoSize&&t.cols===n.cols&&t.draggableCancel===n.draggableCancel&&t.draggableHandle===n.draggableHandle&&r(t.verticalCompact,n.verticalCompact)&&r(t.compactType,n.compactType)&&r(t.layout,n.layout)&&r(t.margin,n.margin)&&r(t.containerPadding,n.containerPadding)&&t.rowHeight===n.rowHeight&&t.maxRows===n.maxRows&&t.isBounded===n.isBounded&&t.isDraggable===n.isDraggable&&t.isResizable===n.isResizable&&t.allowOverlap===n.allowOverlap&&t.preventCollision===n.preventCollision&&t.useCSSTransforms===n.useCSSTransforms&&t.transformScale===n.transformScale&&t.isDroppable===n.isDroppable&&r(t.resizeHandles,n.resizeHandles)&&r(t.resizeHandle,n.resizeHandle)&&t.onLayoutChange===n.onLayoutChange&&t.onDragStart===n.onDragStart&&t.onDrag===n.onDrag&&t.onDragStop===n.onDragStop&&t.onResizeStart===n.onResizeStart&&t.onResize===n.onResize&&t.onResizeStop===n.onResizeStop&&t.onDrop===n.onDrop&&r(t.droppingItem,n.droppingItem)&&r(t.innerRef,n.innerRef)}),pl}var vv;function to(){if(vv)return st;vv=1,Object.defineProperty(st,"__esModule",{value:!0}),st.bottom=r,st.childrenEqual=u,st.cloneLayout=o,st.cloneLayoutItem=s,st.collides=d,st.compact=l,st.compactItem=y,st.compactType=G,st.correctBounds=w,st.fastPositionEqual=c,st.fastRGLPropsEqual=void 0,st.getAllCollisions=g,st.getFirstCollision=p,st.getLayoutItem=v,st.getStatics=b,st.modifyLayout=a,st.moveElement=C,st.moveElementAwayFromCollision=x,st.noop=void 0,st.perc=S,st.resizeItemInDirection=B,st.setTopLeft=j,st.setTransform=A,st.sortLayoutItems=Y,st.sortLayoutItemsByColRow=ne,st.sortLayoutItemsByRowCol=U,st.synchronizeLayoutWithChildren=te,st.validateLayout=J,st.withLayoutItem=i;var e=ml(),t=n(D);function n(O){return O&&O.__esModule?O:{default:O}}function r(O){let I=0,W;for(let K=0,oe=O.length;K<oe;K++)W=O[K].y+O[K].h,W>I&&(I=W);return I}function o(O){const I=Array(O.length);for(let W=0,K=O.length;W<K;W++)I[W]=s(O[W]);return I}function a(O,I){const W=Array(O.length);for(let K=0,oe=O.length;K<oe;K++)I.i===O[K].i?W[K]=I:W[K]=O[K];return W}function i(O,I,W){let K=v(O,I);return K?(K=W(s(K)),O=a(O,K),[O,K]):[O,null]}function s(O){return{w:O.w,h:O.h,x:O.x,y:O.y,i:O.i,minW:O.minW,maxW:O.maxW,minH:O.minH,maxH:O.maxH,moved:!!O.moved,static:!!O.static,isDraggable:O.isDraggable,isResizable:O.isResizable,resizeHandles:O.resizeHandles,isBounded:O.isBounded}}function u(O,I){return(0,e.deepEqual)(t.default.Children.map(O,W=>W==null?void 0:W.key),t.default.Children.map(I,W=>W==null?void 0:W.key))&&(0,e.deepEqual)(t.default.Children.map(O,W=>W==null?void 0:W.props["data-grid"]),t.default.Children.map(I,W=>W==null?void 0:W.props["data-grid"]))}st.fastRGLPropsEqual=PC();function c(O,I){return O.left===I.left&&O.top===I.top&&O.width===I.width&&O.height===I.height}function d(O,I){return!(O.i===I.i||O.x+O.w<=I.x||O.x>=I.x+I.w||O.y+O.h<=I.y||O.y>=I.y+I.h)}function l(O,I,W,K){const oe=b(O),Q=Y(O,I),ae=Array(O.length);for(let ee=0,ie=Q.length;ee<ie;ee++){let me=s(Q[ee]);me.static||(me=y(oe,me,I,W,Q,K),oe.push(me)),ae[O.indexOf(Q[ee])]=me,me.moved=!1}return ae}const h={x:"w",y:"h"};function m(O,I,W,K){const oe=h[K];I[K]+=1;const Q=O.map(ae=>ae.i).indexOf(I.i);for(let ae=Q+1;ae<O.length;ae++){const ee=O[ae];if(!ee.static){if(ee.y>I.y+I.h)break;d(I,ee)&&m(O,ee,W+I[oe],K)}}I[K]=W}function y(O,I,W,K,oe,Q){const ae=W==="vertical",ee=W==="horizontal";if(ae)for(I.y=Math.min(r(O),I.y);I.y>0&&!p(O,I);)I.y--;else if(ee)for(;I.x>0&&!p(O,I);)I.x--;let ie;for(;(ie=p(O,I))&&!(W===null&&Q);)if(ee?m(oe,I,ie.x+ie.w,"x"):m(oe,I,ie.y+ie.h,"y"),ee&&I.x+I.w>K)for(I.x=K-I.w,I.y++;I.x>0&&!p(O,I);)I.x--;return I.y=Math.max(I.y,0),I.x=Math.max(I.x,0),I}function w(O,I){const W=b(O);for(let K=0,oe=O.length;K<oe;K++){const Q=O[K];if(Q.x+Q.w>I.cols&&(Q.x=I.cols-Q.w),Q.x<0&&(Q.x=0,Q.w=I.cols),!Q.static)W.push(Q);else for(;p(W,Q);)Q.y++}return O}function v(O,I){for(let W=0,K=O.length;W<K;W++)if(O[W].i===I)return O[W]}function p(O,I){for(let W=0,K=O.length;W<K;W++)if(d(O[W],I))return O[W]}function g(O,I){return O.filter(W=>d(W,I))}function b(O){return O.filter(I=>I.static)}function C(O,I,W,K,oe,Q,ae,ee,ie){if(I.static&&I.isDraggable!==!0||I.y===K&&I.x===W)return O;`${I.i}${String(W)}${String(K)}${I.x}${I.y}`;const me=I.x,ye=I.y;typeof W=="number"&&(I.x=W),typeof K=="number"&&(I.y=K),I.moved=!0;let de=Y(O,ae);(ae==="vertical"&&typeof K=="number"?ye>=K:ae==="horizontal"&&typeof W=="number"?me>=W:!1)&&(de=de.reverse());const He=g(de,I),Le=He.length>0;if(Le&&ie)return o(O);if(Le&&Q)return`${I.i}`,I.x=me,I.y=ye,I.moved=!1,O;for(let ge=0,Ye=He.length;ge<Ye;ge++){const Fe=He[ge];`${I.i}${I.x}${I.y}${Fe.i}${Fe.x}${Fe.y}`,!Fe.moved&&(Fe.static?O=x(O,Fe,I,oe,ae):O=x(O,I,Fe,oe,ae))}return O}function x(O,I,W,K,oe,Q){const ae=oe==="horizontal",ee=oe==="vertical",ie=I.static;if(K){K=!1;const de={x:ae?Math.max(I.x-W.w,0):W.x,y:ee?Math.max(I.y-W.h,0):W.y,w:W.w,h:W.h,i:"-1"},se=p(O,de),He=se&&se.y+se.h>I.y,Le=se&&I.x+I.w>se.x;if(se){if(He&&ee)return C(O,W,void 0,I.y+1,K,ie,oe);if(He&&oe==null)return I.y=W.y,W.y=W.y+W.h,O;if(Le&&ae)return C(O,I,W.x,void 0,K,ie,oe)}else return`${W.i}${de.x}${de.y}`,C(O,W,ae?de.x:void 0,ee?de.y:void 0,K,ie,oe)}const me=ae?W.x+1:void 0,ye=ee?W.y+1:void 0;return me==null&&ye==null?O:C(O,W,ae?W.x+1:void 0,ee?W.y+1:void 0,K,ie,oe)}function S(O){return O*100+"%"}const E=(O,I,W,K)=>O+W>K?I:W,M=(O,I,W)=>O<0?I:W,k=O=>Math.max(0,O),T=O=>Math.max(0,O),R=(O,I,W)=>{let{left:K,height:oe,width:Q}=I;const ae=O.top-(oe-O.height);return{left:K,width:Q,height:M(ae,O.height,oe),top:T(ae)}},F=(O,I,W)=>{let{top:K,left:oe,height:Q,width:ae}=I;return{top:K,height:Q,width:E(O.left,O.width,ae,W),left:k(oe)}},V=(O,I,W)=>{let{top:K,height:oe,width:Q}=I;const ae=O.left-(Q-O.width);return{height:oe,width:ae<0?O.width:E(O.left,O.width,Q,W),top:T(K),left:k(ae)}},$=(O,I,W)=>{let{top:K,left:oe,height:Q,width:ae}=I;return{width:ae,left:oe,height:M(K,O.height,Q),top:T(K)}},z={n:R,ne:function(){return R(arguments.length<=0?void 0:arguments[0],F(...arguments))},e:F,se:function(){return $(arguments.length<=0?void 0:arguments[0],F(...arguments))},s:$,sw:function(){return $(arguments.length<=0?void 0:arguments[0],V(...arguments))},w:V,nw:function(){return R(arguments.length<=0?void 0:arguments[0],V(...arguments))}};function B(O,I,W,K){const oe=z[O];return oe?oe(I,{...I,...W},K):W}function A(O){let{top:I,left:W,width:K,height:oe}=O;const Q=`translate(${W}px,${I}px)`;return{transform:Q,WebkitTransform:Q,MozTransform:Q,msTransform:Q,OTransform:Q,width:`${K}px`,height:`${oe}px`,position:"absolute"}}function j(O){let{top:I,left:W,width:K,height:oe}=O;return{top:`${I}px`,left:`${W}px`,width:`${K}px`,height:`${oe}px`,position:"absolute"}}function Y(O,I){return I==="horizontal"?ne(O):I==="vertical"?U(O):O}function U(O){return O.slice(0).sort(function(I,W){return I.y>W.y||I.y===W.y&&I.x>W.x?1:I.y===W.y&&I.x===W.x?0:-1})}function ne(O){return O.slice(0).sort(function(I,W){return I.x>W.x||I.x===W.x&&I.y>W.y?1:-1})}function te(O,I,W,K,oe){O=O||[];const Q=[];t.default.Children.forEach(I,ee=>{if((ee==null?void 0:ee.key)==null)return;const ie=v(O,String(ee.key)),me=ee.props["data-grid"];ie&&me==null?Q.push(s(ie)):me?Q.push(s({...me,i:ee.key})):Q.push(s({w:1,h:1,x:0,y:r(Q),i:String(ee.key)}))});const ae=w(Q,{cols:W});return oe?ae:l(ae,K,W)}function J(O){let I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Layout";const W=["x","y","w","h"];if(!Array.isArray(O))throw new Error(I+" must be an array!");for(let K=0,oe=O.length;K<oe;K++){const Q=O[K];for(let ae=0;ae<W.length;ae++){const ee=W[ae],ie=Q[ee];if(typeof ie!="number"||Number.isNaN(ie))throw new Error(`ReactGridLayout: ${I}[${K}].${ee} must be a number! Received: ${ie} (${typeof ie})`)}if(typeof Q.i<"u"&&typeof Q.i!="string")throw new Error(`ReactGridLayout: ${I}[${K}].i must be a string! Received: ${Q.i} (${typeof Q.i})`)}}function G(O){const{verticalCompact:I,compactType:W}=O||{};return I===!1?null:W}function q(){}const Z=()=>{};return st.noop=Z,st}var Yn={},mv;function gl(){if(mv)return Yn;mv=1,Object.defineProperty(Yn,"__esModule",{value:!0}),Yn.calcGridColWidth=e,Yn.calcGridItemPosition=n,Yn.calcGridItemWHPx=t,Yn.calcWH=o,Yn.calcXY=r,Yn.clamp=a;function e(i){const{margin:s,containerPadding:u,containerWidth:c,cols:d}=i;return(c-s[0]*(d-1)-u[0]*2)/d}function t(i,s,u){return Number.isFinite(i)?Math.round(s*i+Math.max(0,i-1)*u):i}function n(i,s,u,c,d,l){const{margin:h,containerPadding:m,rowHeight:y}=i,w=e(i),v={};return l&&l.resizing?(v.width=Math.round(l.resizing.width),v.height=Math.round(l.resizing.height)):(v.width=t(c,w,h[0]),v.height=t(d,y,h[1])),l&&l.dragging?(v.top=Math.round(l.dragging.top),v.left=Math.round(l.dragging.left)):l&&l.resizing&&typeof l.resizing.top=="number"&&typeof l.resizing.left=="number"?(v.top=Math.round(l.resizing.top),v.left=Math.round(l.resizing.left)):(v.top=Math.round((y+h[1])*u+m[1]),v.left=Math.round((w+h[0])*s+m[0])),v}function r(i,s,u,c,d){const{margin:l,containerPadding:h,cols:m,rowHeight:y,maxRows:w}=i,v=e(i);let p=Math.round((u-h[0])/(v+l[0])),g=Math.round((s-h[1])/(y+l[1]));return p=a(p,0,m-c),g=a(g,0,w-d),{x:p,y:g}}function o(i,s,u,c,d,l){const{margin:h,maxRows:m,cols:y,rowHeight:w}=i,v=e(i);let p=Math.round((s+h[0])/(v+h[0])),g=Math.round((u+h[1])/(w+h[1])),b=a(p,0,y-c),C=a(g,0,m-d);return["sw","w","nw"].indexOf(l)!==-1&&(b=a(p,0,y)),["nw","n","ne"].indexOf(l)!==-1&&(C=a(g,0,m)),{w:b,h:C}}function a(i,s,u){return Math.max(Math.min(i,u),s)}return Yn}var To={},yl={exports:{}},bl,hv;function DC(){if(hv)return bl;hv=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return bl=e,bl}var wl,pv;function kC(){if(pv)return wl;pv=1;var e=DC();function t(){}function n(){}return n.resetWarningCache=t,wl=function(){function r(i,s,u,c,d,l){if(l!==e){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}}r.isRequired=r;function o(){return r}var a={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return a.PropTypes=a,a},wl}var gv;function ur(){return gv||(gv=1,yl.exports=kC()()),yl.exports}var Io={exports:{}},Cl={};function yv(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=yv(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function bv(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=yv(e))&&(r&&(r+=" "),r+=t);return r}const NC=vd(Object.freeze(Object.defineProperty({__proto__:null,clsx:bv,default:bv},Symbol.toStringTag,{value:"Module"})));var Nt={},cr={},wv;function vi(){if(wv)return cr;wv=1,Object.defineProperty(cr,"__esModule",{value:!0}),cr.dontSetMe=o,cr.findInArray=e,cr.int=r,cr.isFunction=t,cr.isNum=n;function e(a,i){for(let s=0,u=a.length;s<u;s++)if(i.apply(i,[a[s],s,a]))return a[s]}function t(a){return typeof a=="function"||Object.prototype.toString.call(a)==="[object Function]"}function n(a){return typeof a=="number"&&!isNaN(a)}function r(a){return parseInt(a,10)}function o(a,i,s){if(a[i])return new Error("Invalid prop ".concat(i," passed to ").concat(s," - do not set this, set it on the child."))}return cr}var dr={},Cv;function _C(){if(Cv)return dr;Cv=1,Object.defineProperty(dr,"__esModule",{value:!0}),dr.browserPrefixToKey=n,dr.browserPrefixToStyle=r,dr.default=void 0,dr.getPrefix=t;const e=["Moz","Webkit","O","ms"];function t(){var a;let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const s=(a=window.document)===null||a===void 0||(a=a.documentElement)===null||a===void 0?void 0:a.style;if(!s||i in s)return"";for(let u=0;u<e.length;u++)if(n(i,e[u])in s)return e[u];return""}function n(a,i){return i?"".concat(i).concat(o(a)):a}function r(a,i){return i?"-".concat(i.toLowerCase(),"-").concat(a):a}function o(a){let i="",s=!0;for(let u=0;u<a.length;u++)s?(i+=a[u].toUpperCase(),s=!1):a[u]==="-"?s=!0:i+=a[u];return i}return dr.default=t(),dr}var xv;function xl(){if(xv)return Nt;xv=1,Object.defineProperty(Nt,"__esModule",{value:!0}),Nt.addClassName=x,Nt.addEvent=s,Nt.addUserSelectStyles=b,Nt.createCSSTransform=y,Nt.createSVGTransform=w,Nt.getTouch=p,Nt.getTouchIdentifier=g,Nt.getTranslation=v,Nt.innerHeight=l,Nt.innerWidth=h,Nt.matchesSelector=a,Nt.matchesSelectorAndParentsTo=i,Nt.offsetXYFromParent=m,Nt.outerHeight=c,Nt.outerWidth=d,Nt.removeClassName=S,Nt.removeEvent=u,Nt.removeUserSelectStyles=C;var e=vi(),t=r(_C());function n(E){if(typeof WeakMap!="function")return null;var M=new WeakMap,k=new WeakMap;return(n=function(T){return T?k:M})(E)}function r(E,M){if(E&&E.__esModule)return E;if(E===null||typeof E!="object"&&typeof E!="function")return{default:E};var k=n(M);if(k&&k.has(E))return k.get(E);var T={},R=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var F in E)if(F!=="default"&&Object.prototype.hasOwnProperty.call(E,F)){var V=R?Object.getOwnPropertyDescriptor(E,F):null;V&&(V.get||V.set)?Object.defineProperty(T,F,V):T[F]=E[F]}return T.default=E,k&&k.set(E,T),T}let o="";function a(E,M){return o||(o=(0,e.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(k){return(0,e.isFunction)(E[k])})),(0,e.isFunction)(E[o])?E[o](M):!1}function i(E,M,k){let T=E;do{if(a(T,M))return!0;if(T===k)return!1;T=T.parentNode}while(T);return!1}function s(E,M,k,T){if(!E)return;const R={capture:!0,...T};E.addEventListener?E.addEventListener(M,k,R):E.attachEvent?E.attachEvent("on"+M,k):E["on"+M]=k}function u(E,M,k,T){if(!E)return;const R={capture:!0,...T};E.removeEventListener?E.removeEventListener(M,k,R):E.detachEvent?E.detachEvent("on"+M,k):E["on"+M]=null}function c(E){let M=E.clientHeight;const k=E.ownerDocument.defaultView.getComputedStyle(E);return M+=(0,e.int)(k.borderTopWidth),M+=(0,e.int)(k.borderBottomWidth),M}function d(E){let M=E.clientWidth;const k=E.ownerDocument.defaultView.getComputedStyle(E);return M+=(0,e.int)(k.borderLeftWidth),M+=(0,e.int)(k.borderRightWidth),M}function l(E){let M=E.clientHeight;const k=E.ownerDocument.defaultView.getComputedStyle(E);return M-=(0,e.int)(k.paddingTop),M-=(0,e.int)(k.paddingBottom),M}function h(E){let M=E.clientWidth;const k=E.ownerDocument.defaultView.getComputedStyle(E);return M-=(0,e.int)(k.paddingLeft),M-=(0,e.int)(k.paddingRight),M}function m(E,M,k){const R=M===M.ownerDocument.body?{left:0,top:0}:M.getBoundingClientRect(),F=(E.clientX+M.scrollLeft-R.left)/k,V=(E.clientY+M.scrollTop-R.top)/k;return{x:F,y:V}}function y(E,M){const k=v(E,M,"px");return{[(0,t.browserPrefixToKey)("transform",t.default)]:k}}function w(E,M){return v(E,M,"")}function v(E,M,k){let{x:T,y:R}=E,F="translate(".concat(T).concat(k,",").concat(R).concat(k,")");if(M){const V="".concat(typeof M.x=="string"?M.x:M.x+k),$="".concat(typeof M.y=="string"?M.y:M.y+k);F="translate(".concat(V,", ").concat($,")")+F}return F}function p(E,M){return E.targetTouches&&(0,e.findInArray)(E.targetTouches,k=>M===k.identifier)||E.changedTouches&&(0,e.findInArray)(E.changedTouches,k=>M===k.identifier)}function g(E){if(E.targetTouches&&E.targetTouches[0])return E.targetTouches[0].identifier;if(E.changedTouches&&E.changedTouches[0])return E.changedTouches[0].identifier}function b(E){if(!E)return;let M=E.getElementById("react-draggable-style-el");M||(M=E.createElement("style"),M.type="text/css",M.id="react-draggable-style-el",M.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
1397
1397
  `,M.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
1398
- `,E.getElementsByTagName("head")[0].appendChild(M)),E.body&&x(E.body,"react-draggable-transparent-selection")}function C(E){if(E)try{if(E.body&&S(E.body,"react-draggable-transparent-selection"),E.selection)E.selection.empty();else{const M=(E.defaultView||window).getSelection();M&&M.type!=="Caret"&&M.removeAllRanges()}}catch{}}function x(E,M){E.classList?E.classList.add(M):E.className.match(new RegExp("(?:^|\\s)".concat(M,"(?!\\S)")))||(E.className+=" ".concat(M))}function S(E,M){E.classList?E.classList.remove(M):E.className=E.className.replace(new RegExp("(?:^|\\s)".concat(M,"(?!\\S)"),"g"),"")}return _t}var In={},Sv;function Ev(){if(Sv)return In;Sv=1,Object.defineProperty(In,"__esModule",{value:!0}),In.canDragX=o,In.canDragY=a,In.createCoreData=s,In.createDraggableData=u,In.getBoundPosition=n,In.getControlPosition=i,In.snapToGrid=r;var e=vi(),t=xl();function n(l,h,m){if(!l.props.bounds)return[h,m];let{bounds:y}=l.props;y=typeof y=="string"?y:c(y);const w=f(l);if(typeof y=="string"){const{ownerDocument:v}=w,p=v.defaultView;let g;if(y==="parent"?g=w.parentNode:g=v.querySelector(y),!(g instanceof p.HTMLElement))throw new Error('Bounds selector "'+y+'" could not find an element.');const b=g,C=p.getComputedStyle(w),x=p.getComputedStyle(b);y={left:-w.offsetLeft+(0,e.int)(x.paddingLeft)+(0,e.int)(C.marginLeft),top:-w.offsetTop+(0,e.int)(x.paddingTop)+(0,e.int)(C.marginTop),right:(0,t.innerWidth)(b)-(0,t.outerWidth)(w)-w.offsetLeft+(0,e.int)(x.paddingRight)-(0,e.int)(C.marginRight),bottom:(0,t.innerHeight)(b)-(0,t.outerHeight)(w)-w.offsetTop+(0,e.int)(x.paddingBottom)-(0,e.int)(C.marginBottom)}}return(0,e.isNum)(y.right)&&(h=Math.min(h,y.right)),(0,e.isNum)(y.bottom)&&(m=Math.min(m,y.bottom)),(0,e.isNum)(y.left)&&(h=Math.max(h,y.left)),(0,e.isNum)(y.top)&&(m=Math.max(m,y.top)),[h,m]}function r(l,h,m){const y=Math.round(h/l[0])*l[0],w=Math.round(m/l[1])*l[1];return[y,w]}function o(l){return l.props.axis==="both"||l.props.axis==="x"}function a(l){return l.props.axis==="both"||l.props.axis==="y"}function i(l,h,m){const y=typeof h=="number"?(0,t.getTouch)(l,h):null;if(typeof h=="number"&&!y)return null;const w=f(m),v=m.props.offsetParent||w.offsetParent||w.ownerDocument.body;return(0,t.offsetXYFromParent)(y||l,v,m.props.scale)}function s(l,h,m){const y=!(0,e.isNum)(l.lastX),w=f(l);return y?{node:w,deltaX:0,deltaY:0,lastX:h,lastY:m,x:h,y:m}:{node:w,deltaX:h-l.lastX,deltaY:m-l.lastY,lastX:l.lastX,lastY:l.lastY,x:h,y:m}}function u(l,h){const m=l.props.scale;return{node:h.node,x:l.state.x+h.deltaX/m,y:l.state.y+h.deltaY/m,deltaX:h.deltaX/m,deltaY:h.deltaY/m,lastX:l.state.x,lastY:l.state.y}}function c(l){return{left:l.left,top:l.top,right:l.right,bottom:l.bottom}}function f(l){const h=l.findDOMNode();if(!h)throw new Error("<DraggableCore>: Unmounted during event!");return h}return In}var Ro={},mi={},Mv;function Pv(){if(Mv)return mi;Mv=1,Object.defineProperty(mi,"__esModule",{value:!0}),mi.default=e;function e(){}return mi}var Dv;function OC(){if(Dv)return Ro;Dv=1,Object.defineProperty(Ro,"__esModule",{value:!0}),Ro.default=void 0;var e=c(D),t=s(lr()),n=s(It),r=xl(),o=Ev(),a=vi(),i=s(Pv());function s(v){return v&&v.__esModule?v:{default:v}}function u(v){if(typeof WeakMap!="function")return null;var p=new WeakMap,g=new WeakMap;return(u=function(b){return b?g:p})(v)}function c(v,p){if(v&&v.__esModule)return v;if(v===null||typeof v!="object"&&typeof v!="function")return{default:v};var g=u(p);if(g&&g.has(v))return g.get(v);var b={},C=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var x in v)if(x!=="default"&&Object.prototype.hasOwnProperty.call(v,x)){var S=C?Object.getOwnPropertyDescriptor(v,x):null;S&&(S.get||S.set)?Object.defineProperty(b,x,S):b[x]=v[x]}return b.default=v,g&&g.set(v,b),b}function f(v,p,g){return p=l(p),p in v?Object.defineProperty(v,p,{value:g,enumerable:!0,configurable:!0,writable:!0}):v[p]=g,v}function l(v){var p=h(v,"string");return typeof p=="symbol"?p:String(p)}function h(v,p){if(typeof v!="object"||v===null)return v;var g=v[Symbol.toPrimitive];if(g!==void 0){var b=g.call(v,p);if(typeof b!="object")return b;throw new TypeError("@@toPrimitive must return a primitive value.")}return(p==="string"?String:Number)(v)}const m={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let y=m.mouse,w=class extends e.Component{constructor(){super(...arguments),f(this,"dragging",!1),f(this,"lastX",NaN),f(this,"lastY",NaN),f(this,"touchIdentifier",null),f(this,"mounted",!1),f(this,"handleDragStart",p=>{if(this.props.onMouseDown(p),!this.props.allowAnyClick&&typeof p.button=="number"&&p.button!==0)return!1;const g=this.findDOMNode();if(!g||!g.ownerDocument||!g.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:b}=g;if(this.props.disabled||!(p.target instanceof b.defaultView.Node)||this.props.handle&&!(0,r.matchesSelectorAndParentsTo)(p.target,this.props.handle,g)||this.props.cancel&&(0,r.matchesSelectorAndParentsTo)(p.target,this.props.cancel,g))return;p.type==="touchstart"&&p.preventDefault();const C=(0,r.getTouchIdentifier)(p);this.touchIdentifier=C;const x=(0,o.getControlPosition)(p,C,this);if(x==null)return;const{x:S,y:E}=x,M=(0,o.createCoreData)(this,S,E);(0,i.default)("DraggableCore: handleDragStart: %j",M),(0,i.default)("calling",this.props.onStart),!(this.props.onStart(p,M)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,r.addUserSelectStyles)(b),this.dragging=!0,this.lastX=S,this.lastY=E,(0,r.addEvent)(b,y.move,this.handleDrag),(0,r.addEvent)(b,y.stop,this.handleDragStop))}),f(this,"handleDrag",p=>{const g=(0,o.getControlPosition)(p,this.touchIdentifier,this);if(g==null)return;let{x:b,y:C}=g;if(Array.isArray(this.props.grid)){let E=b-this.lastX,M=C-this.lastY;if([E,M]=(0,o.snapToGrid)(this.props.grid,E,M),!E&&!M)return;b=this.lastX+E,C=this.lastY+M}const x=(0,o.createCoreData)(this,b,C);if((0,i.default)("DraggableCore: handleDrag: %j",x),this.props.onDrag(p,x)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const M=document.createEvent("MouseEvents");M.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(M)}return}this.lastX=b,this.lastY=C}),f(this,"handleDragStop",p=>{if(!this.dragging)return;const g=(0,o.getControlPosition)(p,this.touchIdentifier,this);if(g==null)return;let{x:b,y:C}=g;if(Array.isArray(this.props.grid)){let M=b-this.lastX||0,k=C-this.lastY||0;[M,k]=(0,o.snapToGrid)(this.props.grid,M,k),b=this.lastX+M,C=this.lastY+k}const x=(0,o.createCoreData)(this,b,C);if(this.props.onStop(p,x)===!1||this.mounted===!1)return!1;const E=this.findDOMNode();E&&this.props.enableUserSelectHack&&(0,r.removeUserSelectStyles)(E.ownerDocument),(0,i.default)("DraggableCore: handleDragStop: %j",x),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,E&&((0,i.default)("DraggableCore: Removing handlers"),(0,r.removeEvent)(E.ownerDocument,y.move,this.handleDrag),(0,r.removeEvent)(E.ownerDocument,y.stop,this.handleDragStop))}),f(this,"onMouseDown",p=>(y=m.mouse,this.handleDragStart(p))),f(this,"onMouseUp",p=>(y=m.mouse,this.handleDragStop(p))),f(this,"onTouchStart",p=>(y=m.touch,this.handleDragStart(p))),f(this,"onTouchEnd",p=>(y=m.touch,this.handleDragStop(p)))}componentDidMount(){this.mounted=!0;const p=this.findDOMNode();p&&(0,r.addEvent)(p,m.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const p=this.findDOMNode();if(p){const{ownerDocument:g}=p;(0,r.removeEvent)(g,m.mouse.move,this.handleDrag),(0,r.removeEvent)(g,m.touch.move,this.handleDrag),(0,r.removeEvent)(g,m.mouse.stop,this.handleDragStop),(0,r.removeEvent)(g,m.touch.stop,this.handleDragStop),(0,r.removeEvent)(p,m.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,r.removeUserSelectStyles)(g)}}findDOMNode(){var p,g;return(p=this.props)!==null&&p!==void 0&&p.nodeRef?(g=this.props)===null||g===void 0||(g=g.nodeRef)===null||g===void 0?void 0:g.current:n.default.findDOMNode(this)}render(){return e.cloneElement(e.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};return Ro.default=w,f(w,"displayName","DraggableCore"),f(w,"propTypes",{allowAnyClick:t.default.bool,children:t.default.node.isRequired,disabled:t.default.bool,enableUserSelectHack:t.default.bool,offsetParent:function(v,p){if(v[p]&&v[p].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:t.default.arrayOf(t.default.number),handle:t.default.string,cancel:t.default.string,nodeRef:t.default.object,onStart:t.default.func,onDrag:t.default.func,onStop:t.default.func,onMouseDown:t.default.func,scale:t.default.number,className:a.dontSetMe,style:a.dontSetMe,transform:a.dontSetMe}),f(w,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),Ro}var kv;function TC(){return kv||(kv=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return u.default}}),e.default=void 0;var t=h(D),n=f(lr()),r=f(It),o=f(_C),a=xl(),i=Ev(),s=vi(),u=f(OC()),c=f(Pv());function f(g){return g&&g.__esModule?g:{default:g}}function l(g){if(typeof WeakMap!="function")return null;var b=new WeakMap,C=new WeakMap;return(l=function(x){return x?C:b})(g)}function h(g,b){if(g&&g.__esModule)return g;if(g===null||typeof g!="object"&&typeof g!="function")return{default:g};var C=l(b);if(C&&C.has(g))return C.get(g);var x={},S=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var E in g)if(E!=="default"&&Object.prototype.hasOwnProperty.call(g,E)){var M=S?Object.getOwnPropertyDescriptor(g,E):null;M&&(M.get||M.set)?Object.defineProperty(x,E,M):x[E]=g[E]}return x.default=g,C&&C.set(g,x),x}function m(){return m=Object.assign?Object.assign.bind():function(g){for(var b=1;b<arguments.length;b++){var C=arguments[b];for(var x in C)Object.prototype.hasOwnProperty.call(C,x)&&(g[x]=C[x])}return g},m.apply(this,arguments)}function y(g,b,C){return b=w(b),b in g?Object.defineProperty(g,b,{value:C,enumerable:!0,configurable:!0,writable:!0}):g[b]=C,g}function w(g){var b=v(g,"string");return typeof b=="symbol"?b:String(b)}function v(g,b){if(typeof g!="object"||g===null)return g;var C=g[Symbol.toPrimitive];if(C!==void 0){var x=C.call(g,b);if(typeof x!="object")return x;throw new TypeError("@@toPrimitive must return a primitive value.")}return(b==="string"?String:Number)(g)}class p extends t.Component{static getDerivedStateFromProps(b,C){let{position:x}=b,{prevPropsPosition:S}=C;return x&&(!S||x.x!==S.x||x.y!==S.y)?((0,c.default)("Draggable: getDerivedStateFromProps %j",{position:x,prevPropsPosition:S}),{x:x.x,y:x.y,prevPropsPosition:{...x}}):null}constructor(b){super(b),y(this,"onDragStart",(C,x)=>{if((0,c.default)("Draggable: onDragStart: %j",x),this.props.onStart(C,(0,i.createDraggableData)(this,x))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),y(this,"onDrag",(C,x)=>{if(!this.state.dragging)return!1;(0,c.default)("Draggable: onDrag: %j",x);const S=(0,i.createDraggableData)(this,x),E={x:S.x,y:S.y,slackX:0,slackY:0};if(this.props.bounds){const{x:k,y:T}=E;E.x+=this.state.slackX,E.y+=this.state.slackY;const[R,F]=(0,i.getBoundPosition)(this,E.x,E.y);E.x=R,E.y=F,E.slackX=this.state.slackX+(k-E.x),E.slackY=this.state.slackY+(T-E.y),S.x=E.x,S.y=E.y,S.deltaX=E.x-this.state.x,S.deltaY=E.y-this.state.y}if(this.props.onDrag(C,S)===!1)return!1;this.setState(E)}),y(this,"onDragStop",(C,x)=>{if(!this.state.dragging||this.props.onStop(C,(0,i.createDraggableData)(this,x))===!1)return!1;(0,c.default)("Draggable: onDragStop: %j",x);const E={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:k,y:T}=this.props.position;E.x=k,E.y=T}this.setState(E)}),this.state={dragging:!1,dragged:!1,x:b.position?b.position.x:b.defaultPosition.x,y:b.position?b.position.y:b.defaultPosition.y,prevPropsPosition:{...b.position},slackX:0,slackY:0,isElementSVG:!1},b.position&&!(b.onDrag||b.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var b,C;return(b=(C=this.props)===null||C===void 0||(C=C.nodeRef)===null||C===void 0?void 0:C.current)!==null&&b!==void 0?b:r.default.findDOMNode(this)}render(){const{axis:b,bounds:C,children:x,defaultPosition:S,defaultClassName:E,defaultClassNameDragging:M,defaultClassNameDragged:k,position:T,positionOffset:R,scale:F,...V}=this.props;let $={},L=null;const H=!!!T||this.state.dragging,_=T||S,z={x:(0,i.canDragX)(this)&&H?this.state.x:_.x,y:(0,i.canDragY)(this)&&H?this.state.y:_.y};this.state.isElementSVG?L=(0,a.createSVGTransform)(z,R):$=(0,a.createCSSTransform)(z,R);const B=(0,o.default)(x.props.className||"",E,{[M]:this.state.dragging,[k]:this.state.dragged});return t.createElement(u.default,m({},V,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(x),{className:B,style:{...x.props.style,...$},transform:L}))}}e.default=p,y(p,"displayName","Draggable"),y(p,"propTypes",{...u.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:s.dontSetMe,style:s.dontSetMe,transform:s.dontSetMe}),y(p,"defaultProps",{...u.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})}(Cl)),Cl}var _v;function Sl(){if(_v)return Io.exports;_v=1;const{default:e,DraggableCore:t}=TC();return Io.exports=e,Io.exports.default=e,Io.exports.DraggableCore=t,Io.exports}var Ao={exports:{}},Lo={},hi={},Nv;function IC(){if(Nv)return hi;Nv=1,hi.__esModule=!0,hi.cloneElement=s;var e=t(D);function t(u){return u&&u.__esModule?u:{default:u}}function n(u,c){var f=Object.keys(u);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(u);c&&(l=l.filter(function(h){return Object.getOwnPropertyDescriptor(u,h).enumerable})),f.push.apply(f,l)}return f}function r(u){for(var c=1;c<arguments.length;c++){var f=arguments[c]!=null?arguments[c]:{};c%2?n(Object(f),!0).forEach(function(l){o(u,l,f[l])}):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(f)):n(Object(f)).forEach(function(l){Object.defineProperty(u,l,Object.getOwnPropertyDescriptor(f,l))})}return u}function o(u,c,f){return c=a(c),c in u?Object.defineProperty(u,c,{value:f,enumerable:!0,configurable:!0,writable:!0}):u[c]=f,u}function a(u){var c=i(u,"string");return typeof c=="symbol"?c:String(c)}function i(u,c){if(typeof u!="object"||u===null)return u;var f=u[Symbol.toPrimitive];if(f!==void 0){var l=f.call(u,c);if(typeof l!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(c==="string"?String:Number)(u)}function s(u,c){return c.style&&u.props.style&&(c.style=r(r({},u.props.style),c.style)),c.className&&u.props.className&&(c.className=u.props.className+" "+c.className),e.default.cloneElement(u,c)}return hi}var $o={},Ov;function Tv(){if(Ov)return $o;Ov=1,$o.__esModule=!0,$o.resizableProps=void 0;var e=t(lr());Sl();function t(r){return r&&r.__esModule?r:{default:r}}var n={axis:e.default.oneOf(["both","x","y","none"]),className:e.default.string,children:e.default.element.isRequired,draggableOpts:e.default.shape({allowAnyClick:e.default.bool,cancel:e.default.string,children:e.default.node,disabled:e.default.bool,enableUserSelectHack:e.default.bool,offsetParent:e.default.node,grid:e.default.arrayOf(e.default.number),handle:e.default.string,nodeRef:e.default.object,onStart:e.default.func,onDrag:e.default.func,onStop:e.default.func,onMouseDown:e.default.func,scale:e.default.number}),height:function(){for(var o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];var s=a[0];if(s.axis==="both"||s.axis==="y"){var u;return(u=e.default.number).isRequired.apply(u,a)}return e.default.number.apply(e.default,a)},handle:e.default.oneOfType([e.default.node,e.default.func]),handleSize:e.default.arrayOf(e.default.number),lockAspectRatio:e.default.bool,maxConstraints:e.default.arrayOf(e.default.number),minConstraints:e.default.arrayOf(e.default.number),onResizeStop:e.default.func,onResizeStart:e.default.func,onResize:e.default.func,resizeHandles:e.default.arrayOf(e.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:e.default.number,width:function(){for(var o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];var s=a[0];if(s.axis==="both"||s.axis==="x"){var u;return(u=e.default.number).isRequired.apply(u,a)}return e.default.number.apply(e.default,a)}};return $o.resizableProps=n,$o}var Iv;function Rv(){if(Iv)return Lo;Iv=1,Lo.__esModule=!0,Lo.default=void 0;var e=i(D),t=Sl(),n=IC(),r=Tv(),o=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function a(p){if(typeof WeakMap!="function")return null;var g=new WeakMap,b=new WeakMap;return(a=function(x){return x?b:g})(p)}function i(p,g){if(p&&p.__esModule)return p;if(p===null||typeof p!="object"&&typeof p!="function")return{default:p};var b=a(g);if(b&&b.has(p))return b.get(p);var C={},x=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var S in p)if(S!=="default"&&Object.prototype.hasOwnProperty.call(p,S)){var E=x?Object.getOwnPropertyDescriptor(p,S):null;E&&(E.get||E.set)?Object.defineProperty(C,S,E):C[S]=p[S]}return C.default=p,b&&b.set(p,C),C}function s(){return s=Object.assign?Object.assign.bind():function(p){for(var g=1;g<arguments.length;g++){var b=arguments[g];for(var C in b)Object.prototype.hasOwnProperty.call(b,C)&&(p[C]=b[C])}return p},s.apply(this,arguments)}function u(p,g){if(p==null)return{};var b={},C=Object.keys(p),x,S;for(S=0;S<C.length;S++)x=C[S],!(g.indexOf(x)>=0)&&(b[x]=p[x]);return b}function c(p,g){var b=Object.keys(p);if(Object.getOwnPropertySymbols){var C=Object.getOwnPropertySymbols(p);g&&(C=C.filter(function(x){return Object.getOwnPropertyDescriptor(p,x).enumerable})),b.push.apply(b,C)}return b}function f(p){for(var g=1;g<arguments.length;g++){var b=arguments[g]!=null?arguments[g]:{};g%2?c(Object(b),!0).forEach(function(C){l(p,C,b[C])}):Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(b)):c(Object(b)).forEach(function(C){Object.defineProperty(p,C,Object.getOwnPropertyDescriptor(b,C))})}return p}function l(p,g,b){return g=h(g),g in p?Object.defineProperty(p,g,{value:b,enumerable:!0,configurable:!0,writable:!0}):p[g]=b,p}function h(p){var g=m(p,"string");return typeof g=="symbol"?g:String(g)}function m(p,g){if(typeof p!="object"||p===null)return p;var b=p[Symbol.toPrimitive];if(b!==void 0){var C=b.call(p,g);if(typeof C!="object")return C;throw new TypeError("@@toPrimitive must return a primitive value.")}return(g==="string"?String:Number)(p)}function y(p,g){p.prototype=Object.create(g.prototype),p.prototype.constructor=p,w(p,g)}function w(p,g){return w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(C,x){return C.__proto__=x,C},w(p,g)}var v=function(p){y(g,p);function g(){for(var C,x=arguments.length,S=new Array(x),E=0;E<x;E++)S[E]=arguments[E];return C=p.call.apply(p,[this].concat(S))||this,C.handleRefs={},C.lastHandleRect=null,C.slack=null,C}var b=g.prototype;return b.componentWillUnmount=function(){this.resetData()},b.resetData=function(){this.lastHandleRect=this.slack=null},b.runConstraints=function(x,S){var E=this.props,M=E.minConstraints,k=E.maxConstraints,T=E.lockAspectRatio;if(!M&&!k&&!T)return[x,S];if(T){var R=this.props.width/this.props.height,F=x-this.props.width,V=S-this.props.height;Math.abs(F)>Math.abs(V*R)?S=x/R:x=S*R}var $=x,L=S,N=this.slack||[0,0],H=N[0],_=N[1];return x+=H,S+=_,M&&(x=Math.max(M[0],x),S=Math.max(M[1],S)),k&&(x=Math.min(k[0],x),S=Math.min(k[1],S)),this.slack=[H+($-x),_+(L-S)],[x,S]},b.resizeHandler=function(x,S){var E=this;return function(M,k){var T=k.node,R=k.deltaX,F=k.deltaY;x==="onResizeStart"&&E.resetData();var V=(E.props.axis==="both"||E.props.axis==="x")&&S!=="n"&&S!=="s",$=(E.props.axis==="both"||E.props.axis==="y")&&S!=="e"&&S!=="w";if(!(!V&&!$)){var L=S[0],N=S[S.length-1],H=T.getBoundingClientRect();if(E.lastHandleRect!=null){if(N==="w"){var _=H.left-E.lastHandleRect.left;R+=_}if(L==="n"){var z=H.top-E.lastHandleRect.top;F+=z}}E.lastHandleRect=H,N==="w"&&(R=-R),L==="n"&&(F=-F);var B=E.props.width+(V?R/E.props.transformScale:0),A=E.props.height+($?F/E.props.transformScale:0),j=E.runConstraints(B,A);B=j[0],A=j[1];var Y=B!==E.props.width||A!==E.props.height,U=typeof E.props[x]=="function"?E.props[x]:null,ne=x==="onResize"&&!Y;U&&!ne&&(M.persist==null||M.persist(),U(M,{node:T,size:{width:B,height:A},handle:S})),x==="onResizeStop"&&E.resetData()}}},b.renderResizeHandle=function(x,S){var E=this.props.handle;if(!E)return e.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+x,ref:S});if(typeof E=="function")return E(x,S);var M=typeof E.type=="string",k=f({ref:S},M?{}:{handleAxis:x});return e.cloneElement(E,k)},b.render=function(){var x=this,S=this.props,E=S.children,M=S.className,k=S.draggableOpts;S.width,S.height,S.handle,S.handleSize,S.lockAspectRatio,S.axis,S.minConstraints,S.maxConstraints,S.onResize,S.onResizeStop,S.onResizeStart;var T=S.resizeHandles;S.transformScale;var R=u(S,o);return(0,n.cloneElement)(E,f(f({},R),{},{className:(M?M+" ":"")+"react-resizable",children:[].concat(E.props.children,T.map(function(F){var V,$=(V=x.handleRefs[F])!=null?V:x.handleRefs[F]=e.createRef();return e.createElement(t.DraggableCore,s({},k,{nodeRef:$,key:"resizableHandle-"+F,onStop:x.resizeHandler("onResizeStop",F),onStart:x.resizeHandler("onResizeStart",F),onDrag:x.resizeHandler("onResize",F)}),x.renderResizeHandle(F,$))}))}))},g}(e.Component);return Lo.default=v,v.propTypes=r.resizableProps,v.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1},Lo}var Fo={},Av;function RC(){if(Av)return Fo;Av=1,Fo.__esModule=!0,Fo.default=void 0;var e=s(D),t=a(lr()),n=a(Rv()),r=Tv(),o=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function a(g){return g&&g.__esModule?g:{default:g}}function i(g){if(typeof WeakMap!="function")return null;var b=new WeakMap,C=new WeakMap;return(i=function(S){return S?C:b})(g)}function s(g,b){if(g&&g.__esModule)return g;if(g===null||typeof g!="object"&&typeof g!="function")return{default:g};var C=i(b);if(C&&C.has(g))return C.get(g);var x={},S=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var E in g)if(E!=="default"&&Object.prototype.hasOwnProperty.call(g,E)){var M=S?Object.getOwnPropertyDescriptor(g,E):null;M&&(M.get||M.set)?Object.defineProperty(x,E,M):x[E]=g[E]}return x.default=g,C&&C.set(g,x),x}function u(){return u=Object.assign?Object.assign.bind():function(g){for(var b=1;b<arguments.length;b++){var C=arguments[b];for(var x in C)Object.prototype.hasOwnProperty.call(C,x)&&(g[x]=C[x])}return g},u.apply(this,arguments)}function c(g,b){var C=Object.keys(g);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(g);b&&(x=x.filter(function(S){return Object.getOwnPropertyDescriptor(g,S).enumerable})),C.push.apply(C,x)}return C}function f(g){for(var b=1;b<arguments.length;b++){var C=arguments[b]!=null?arguments[b]:{};b%2?c(Object(C),!0).forEach(function(x){l(g,x,C[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(g,Object.getOwnPropertyDescriptors(C)):c(Object(C)).forEach(function(x){Object.defineProperty(g,x,Object.getOwnPropertyDescriptor(C,x))})}return g}function l(g,b,C){return b=h(b),b in g?Object.defineProperty(g,b,{value:C,enumerable:!0,configurable:!0,writable:!0}):g[b]=C,g}function h(g){var b=m(g,"string");return typeof b=="symbol"?b:String(b)}function m(g,b){if(typeof g!="object"||g===null)return g;var C=g[Symbol.toPrimitive];if(C!==void 0){var x=C.call(g,b);if(typeof x!="object")return x;throw new TypeError("@@toPrimitive must return a primitive value.")}return(b==="string"?String:Number)(g)}function y(g,b){if(g==null)return{};var C={},x=Object.keys(g),S,E;for(E=0;E<x.length;E++)S=x[E],!(b.indexOf(S)>=0)&&(C[S]=g[S]);return C}function w(g,b){g.prototype=Object.create(b.prototype),g.prototype.constructor=g,v(g,b)}function v(g,b){return v=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(x,S){return x.__proto__=S,x},v(g,b)}var p=function(g){w(b,g);function b(){for(var x,S=arguments.length,E=new Array(S),M=0;M<S;M++)E[M]=arguments[M];return x=g.call.apply(g,[this].concat(E))||this,x.state={width:x.props.width,height:x.props.height,propsWidth:x.props.width,propsHeight:x.props.height},x.onResize=function(k,T){var R=T.size;x.props.onResize?(k.persist==null||k.persist(),x.setState(R,function(){return x.props.onResize&&x.props.onResize(k,T)})):x.setState(R)},x}b.getDerivedStateFromProps=function(S,E){return E.propsWidth!==S.width||E.propsHeight!==S.height?{width:S.width,height:S.height,propsWidth:S.width,propsHeight:S.height}:null};var C=b.prototype;return C.render=function(){var S=this.props,E=S.handle,M=S.handleSize;S.onResize;var k=S.onResizeStart,T=S.onResizeStop,R=S.draggableOpts,F=S.minConstraints,V=S.maxConstraints,$=S.lockAspectRatio,L=S.axis;S.width,S.height;var N=S.resizeHandles,H=S.style,_=S.transformScale,z=y(S,o);return e.createElement(n.default,{axis:L,draggableOpts:R,handle:E,handleSize:M,height:this.state.height,lockAspectRatio:$,maxConstraints:V,minConstraints:F,onResizeStart:k,onResize:this.onResize,onResizeStop:T,resizeHandles:N,transformScale:_,width:this.state.width},e.createElement("div",u({},z,{style:f(f({},H),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},b}(e.Component);return Fo.default=p,p.propTypes=f(f({},r.resizableProps),{},{children:t.default.element}),Fo}var Lv;function AC(){return Lv||(Lv=1,Ao.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},Ao.exports.Resizable=Rv().default,Ao.exports.ResizableBox=RC().default),Ao.exports}var Un={},$v;function Fv(){if($v)return Un;$v=1,Object.defineProperty(Un,"__esModule",{value:!0}),Un.resizeHandleType=Un.resizeHandleAxesType=Un.default=void 0;var e=n(lr()),t=n(D);function n(a){return a&&a.__esModule?a:{default:a}}const r=Un.resizeHandleAxesType=e.default.arrayOf(e.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),o=Un.resizeHandleType=e.default.oneOfType([e.default.node,e.default.func]);return Un.default={className:e.default.string,style:e.default.object,width:e.default.number,autoSize:e.default.bool,cols:e.default.number,draggableCancel:e.default.string,draggableHandle:e.default.string,verticalCompact:function(a){a.verticalCompact},compactType:e.default.oneOf(["vertical","horizontal"]),layout:function(a){var i=a.layout;i!==void 0&&to().validateLayout(i,"layout")},margin:e.default.arrayOf(e.default.number),containerPadding:e.default.arrayOf(e.default.number),rowHeight:e.default.number,maxRows:e.default.number,isBounded:e.default.bool,isDraggable:e.default.bool,isResizable:e.default.bool,allowOverlap:e.default.bool,preventCollision:e.default.bool,useCSSTransforms:e.default.bool,transformScale:e.default.number,isDroppable:e.default.bool,resizeHandles:r,resizeHandle:o,onLayoutChange:e.default.func,onDragStart:e.default.func,onDrag:e.default.func,onDragStop:e.default.func,onResizeStart:e.default.func,onResize:e.default.func,onResizeStop:e.default.func,onDrop:e.default.func,droppingItem:e.default.shape({i:e.default.string.isRequired,w:e.default.number.isRequired,h:e.default.number.isRequired}),children:function(a,i){const s=a[i],u={};t.default.Children.forEach(s,function(c){if((c==null?void 0:c.key)!=null){if(u[c.key])throw new Error('Duplicate child key "'+c.key+'" found! This will cause problems in ReactGridLayout.');u[c.key]=!0}})},innerRef:e.default.any},Un}var zv;function LC(){if(zv)return To;zv=1,Object.defineProperty(To,"__esModule",{value:!0}),To.default=void 0;var e=c(D),t=It,n=c(lr()),r=Sl(),o=AC(),a=to(),i=gl(),s=Fv(),u=c(hl());function c(y){return y&&y.__esModule?y:{default:y}}function f(y,w,v){return w=l(w),w in y?Object.defineProperty(y,w,{value:v,enumerable:!0,configurable:!0,writable:!0}):y[w]=v,y}function l(y){var w=h(y,"string");return typeof w=="symbol"?w:String(w)}function h(y,w){if(typeof y!="object"||y===null)return y;var v=y[Symbol.toPrimitive];if(v!==void 0){var p=v.call(y,w);if(typeof p!="object")return p;throw new TypeError("@@toPrimitive must return a primitive value.")}return(w==="string"?String:Number)(y)}let m=class extends e.default.Component{constructor(){super(...arguments),f(this,"state",{resizing:null,dragging:null,className:""}),f(this,"elementRef",e.default.createRef()),f(this,"onDragStart",(w,v)=>{let{node:p}=v;const{onDragStart:g,transformScale:b}=this.props;if(!g)return;const C={top:0,left:0},{offsetParent:x}=p;if(!x)return;const S=x.getBoundingClientRect(),E=p.getBoundingClientRect(),M=E.left/b,k=S.left/b,T=E.top/b,R=S.top/b;C.left=M-k+x.scrollLeft,C.top=T-R+x.scrollTop,this.setState({dragging:C});const{x:F,y:V}=(0,i.calcXY)(this.getPositionParams(),C.top,C.left,this.props.w,this.props.h);return g.call(this,this.props.i,F,V,{e:w,node:p,newPosition:C})}),f(this,"onDrag",(w,v,p)=>{let{node:g,deltaX:b,deltaY:C}=v;const{onDrag:x}=this.props;if(!x)return;if(!this.state.dragging)throw new Error("onDrag called before onDragStart.");let S=this.state.dragging.top+C,E=this.state.dragging.left+b;const{isBounded:M,i:k,w:T,h:R,containerWidth:F}=this.props,V=this.getPositionParams();if(M){const{offsetParent:H}=g;if(H){const{margin:_,rowHeight:z,containerPadding:B}=this.props,A=H.clientHeight-(0,i.calcGridItemWHPx)(R,z,_[1]);S=(0,i.clamp)(S-B[1],0,A);const j=(0,i.calcGridColWidth)(V),Y=F-(0,i.calcGridItemWHPx)(T,j,_[0]);E=(0,i.clamp)(E-B[0],0,Y)}}const $={top:S,left:E};p?this.setState({dragging:$}):(0,t.flushSync)(()=>{this.setState({dragging:$})});const{x:L,y:N}=(0,i.calcXY)(V,S,E,T,R);return x.call(this,k,L,N,{e:w,node:g,newPosition:$})}),f(this,"onDragStop",(w,v)=>{let{node:p}=v;const{onDragStop:g}=this.props;if(!g)return;if(!this.state.dragging)throw new Error("onDragEnd called before onDragStart.");const{w:b,h:C,i:x}=this.props,{left:S,top:E}=this.state.dragging,M={top:E,left:S};this.setState({dragging:null});const{x:k,y:T}=(0,i.calcXY)(this.getPositionParams(),E,S,b,C);return g.call(this,x,k,T,{e:w,node:p,newPosition:M})}),f(this,"onResizeStop",(w,v,p)=>this.onResizeHandler(w,v,p,"onResizeStop")),f(this,"onResizeStart",(w,v,p)=>this.onResizeHandler(w,v,p,"onResizeStart")),f(this,"onResize",(w,v,p)=>this.onResizeHandler(w,v,p,"onResize"))}shouldComponentUpdate(w,v){if(this.props.children!==w.children||this.props.droppingPosition!==w.droppingPosition)return!0;const p=(0,i.calcGridItemPosition)(this.getPositionParams(this.props),this.props.x,this.props.y,this.props.w,this.props.h,this.state),g=(0,i.calcGridItemPosition)(this.getPositionParams(w),w.x,w.y,w.w,w.h,v);return!(0,a.fastPositionEqual)(p,g)||this.props.useCSSTransforms!==w.useCSSTransforms}componentDidMount(){this.moveDroppingItem({})}componentDidUpdate(w){this.moveDroppingItem(w)}moveDroppingItem(w){const{droppingPosition:v}=this.props;if(!v)return;const p=this.elementRef.current;if(!p)return;const g=w.droppingPosition||{left:0,top:0},{dragging:b}=this.state,C=b&&v.left!==g.left||v.top!==g.top;if(!b)this.onDragStart(v.e,{node:p,deltaX:v.left,deltaY:v.top});else if(C){const x=v.left-b.left,S=v.top-b.top;this.onDrag(v.e,{node:p,deltaX:x,deltaY:S},!0)}}getPositionParams(){let w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props;return{cols:w.cols,containerPadding:w.containerPadding,containerWidth:w.containerWidth,margin:w.margin,maxRows:w.maxRows,rowHeight:w.rowHeight}}createStyle(w){const{usePercentages:v,containerWidth:p,useCSSTransforms:g}=this.props;let b;return g?b=(0,a.setTransform)(w):(b=(0,a.setTopLeft)(w),v&&(b.left=(0,a.perc)(w.left/p),b.width=(0,a.perc)(w.width/p))),b}mixinDraggable(w,v){return e.default.createElement(r.DraggableCore,{disabled:!v,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop,handle:this.props.handle,cancel:".react-resizable-handle"+(this.props.cancel?","+this.props.cancel:""),scale:this.props.transformScale,nodeRef:this.elementRef},w)}curryResizeHandler(w,v){return(p,g)=>v(p,g,w)}mixinResizable(w,v,p){const{cols:g,minW:b,minH:C,maxW:x,maxH:S,transformScale:E,resizeHandles:M,resizeHandle:k}=this.props,T=this.getPositionParams(),R=(0,i.calcGridItemPosition)(T,0,0,g,0).width,F=(0,i.calcGridItemPosition)(T,0,0,b,C),V=(0,i.calcGridItemPosition)(T,0,0,x,S),$=[F.width,F.height],L=[Math.min(V.width,R),Math.min(V.height,1/0)];return e.default.createElement(o.Resizable,{draggableOpts:{disabled:!p},className:p?void 0:"react-resizable-hide",width:v.width,height:v.height,minConstraints:$,maxConstraints:L,onResizeStop:this.curryResizeHandler(v,this.onResizeStop),onResizeStart:this.curryResizeHandler(v,this.onResizeStart),onResize:this.curryResizeHandler(v,this.onResize),transformScale:E,resizeHandles:M,handle:k},w)}onResizeHandler(w,v,p,g){let{node:b,size:C,handle:x}=v;const S=this.props[g];if(!S)return;const{x:E,y:M,i:k,maxH:T,minH:R,containerWidth:F}=this.props,{minW:V,maxW:$}=this.props;let L=C;b&&(L=(0,a.resizeItemInDirection)(x,p,C,F),(0,t.flushSync)(()=>{this.setState({resizing:g==="onResizeStop"?null:L})}));let{w:N,h:H}=(0,i.calcWH)(this.getPositionParams(),L.width,L.height,E,M,x);N=(0,i.clamp)(N,Math.max(V,1),$),H=(0,i.clamp)(H,R,T),S.call(this,k,N,H,{e:w,node:b,size:L,handle:x})}render(){const{x:w,y:v,w:p,h:g,isDraggable:b,isResizable:C,droppingPosition:x,useCSSTransforms:S}=this.props,E=(0,i.calcGridItemPosition)(this.getPositionParams(),w,v,p,g,this.state),M=e.default.Children.only(this.props.children);let k=e.default.cloneElement(M,{ref:this.elementRef,className:(0,u.default)("react-grid-item",M.props.className,this.props.className,{static:this.props.static,resizing:!!this.state.resizing,"react-draggable":b,"react-draggable-dragging":!!this.state.dragging,dropping:!!x,cssTransforms:S}),style:{...this.props.style,...M.props.style,...this.createStyle(E)}});return k=this.mixinResizable(k,E,C),k=this.mixinDraggable(k,b),k}};return To.default=m,f(m,"propTypes",{children:n.default.element,cols:n.default.number.isRequired,containerWidth:n.default.number.isRequired,rowHeight:n.default.number.isRequired,margin:n.default.array.isRequired,maxRows:n.default.number.isRequired,containerPadding:n.default.array.isRequired,x:n.default.number.isRequired,y:n.default.number.isRequired,w:n.default.number.isRequired,h:n.default.number.isRequired,minW:function(y,w){const v=y[w];if(typeof v!="number")return new Error("minWidth not Number");if(v>y.w||v>y.maxW)return new Error("minWidth larger than item width/maxWidth")},maxW:function(y,w){const v=y[w];if(typeof v!="number")return new Error("maxWidth not Number");if(v<y.w||v<y.minW)return new Error("maxWidth smaller than item width/minWidth")},minH:function(y,w){const v=y[w];if(typeof v!="number")return new Error("minHeight not Number");if(v>y.h||v>y.maxH)return new Error("minHeight larger than item height/maxHeight")},maxH:function(y,w){const v=y[w];if(typeof v!="number")return new Error("maxHeight not Number");if(v<y.h||v<y.minH)return new Error("maxHeight smaller than item height/minHeight")},i:n.default.string.isRequired,resizeHandles:s.resizeHandleAxesType,resizeHandle:s.resizeHandleType,onDragStop:n.default.func,onDragStart:n.default.func,onDrag:n.default.func,onResizeStop:n.default.func,onResizeStart:n.default.func,onResize:n.default.func,isDraggable:n.default.bool.isRequired,isResizable:n.default.bool.isRequired,isBounded:n.default.bool.isRequired,static:n.default.bool,useCSSTransforms:n.default.bool.isRequired,transformScale:n.default.number,className:n.default.string,handle:n.default.string,cancel:n.default.string,droppingPosition:n.default.shape({e:n.default.object.isRequired,left:n.default.number.isRequired,top:n.default.number.isRequired})}),f(m,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1}),To}var Hv;function Vv(){if(Hv)return No;Hv=1,Object.defineProperty(No,"__esModule",{value:!0}),No.default=void 0;var e=c(D),t=ml(),n=s(hl()),r=to(),o=gl(),a=s(LC()),i=s(Fv());function s(v){return v&&v.__esModule?v:{default:v}}function u(v){if(typeof WeakMap!="function")return null;var p=new WeakMap,g=new WeakMap;return(u=function(b){return b?g:p})(v)}function c(v,p){if(v&&v.__esModule)return v;if(v===null||typeof v!="object"&&typeof v!="function")return{default:v};var g=u(p);if(g&&g.has(v))return g.get(v);var b={__proto__:null},C=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var x in v)if(x!=="default"&&Object.prototype.hasOwnProperty.call(v,x)){var S=C?Object.getOwnPropertyDescriptor(v,x):null;S&&(S.get||S.set)?Object.defineProperty(b,x,S):b[x]=v[x]}return b.default=v,g&&g.set(v,b),b}function f(v,p,g){return p=l(p),p in v?Object.defineProperty(v,p,{value:g,enumerable:!0,configurable:!0,writable:!0}):v[p]=g,v}function l(v){var p=h(v,"string");return typeof p=="symbol"?p:String(p)}function h(v,p){if(typeof v!="object"||v===null)return v;var g=v[Symbol.toPrimitive];if(g!==void 0){var b=g.call(v,p);if(typeof b!="object")return b;throw new TypeError("@@toPrimitive must return a primitive value.")}return(p==="string"?String:Number)(v)}const m="react-grid-layout";let y=!1;try{y=/firefox/i.test(navigator.userAgent)}catch{}class w extends e.Component{constructor(){super(...arguments),f(this,"state",{activeDrag:null,layout:(0,r.synchronizeLayoutWithChildren)(this.props.layout,this.props.children,this.props.cols,(0,r.compactType)(this.props),this.props.allowOverlap),mounted:!1,oldDragItem:null,oldLayout:null,oldResizeItem:null,resizing:!1,droppingDOMNode:null,children:[]}),f(this,"dragEnterCounter",0),f(this,"onDragStart",(p,g,b,C)=>{let{e:x,node:S}=C;const{layout:E}=this.state,M=(0,r.getLayoutItem)(E,p);if(!M)return;const k={w:M.w,h:M.h,x:M.x,y:M.y,placeholder:!0,i:p};return this.setState({oldDragItem:(0,r.cloneLayoutItem)(M),oldLayout:E,activeDrag:k}),this.props.onDragStart(E,M,M,null,x,S)}),f(this,"onDrag",(p,g,b,C)=>{let{e:x,node:S}=C;const{oldDragItem:E}=this.state;let{layout:M}=this.state;const{cols:k,allowOverlap:T,preventCollision:R}=this.props,F=(0,r.getLayoutItem)(M,p);if(!F)return;const V={w:F.w,h:F.h,x:F.x,y:F.y,placeholder:!0,i:p};M=(0,r.moveElement)(M,F,g,b,!0,R,(0,r.compactType)(this.props),k,T),this.props.onDrag(M,E,F,V,x,S),this.setState({layout:T?M:(0,r.compact)(M,(0,r.compactType)(this.props),k),activeDrag:V})}),f(this,"onDragStop",(p,g,b,C)=>{let{e:x,node:S}=C;if(!this.state.activeDrag)return;const{oldDragItem:E}=this.state;let{layout:M}=this.state;const{cols:k,preventCollision:T,allowOverlap:R}=this.props,F=(0,r.getLayoutItem)(M,p);if(!F)return;M=(0,r.moveElement)(M,F,g,b,!0,T,(0,r.compactType)(this.props),k,R);const $=R?M:(0,r.compact)(M,(0,r.compactType)(this.props),k);this.props.onDragStop($,E,F,null,x,S);const{oldLayout:L}=this.state;this.setState({activeDrag:null,layout:$,oldDragItem:null,oldLayout:null}),this.onLayoutMaybeChanged($,L)}),f(this,"onResizeStart",(p,g,b,C)=>{let{e:x,node:S}=C;const{layout:E}=this.state,M=(0,r.getLayoutItem)(E,p);M&&(this.setState({oldResizeItem:(0,r.cloneLayoutItem)(M),oldLayout:this.state.layout,resizing:!0}),this.props.onResizeStart(E,M,M,null,x,S))}),f(this,"onResize",(p,g,b,C)=>{let{e:x,node:S,size:E,handle:M}=C;const{oldResizeItem:k}=this.state,{layout:T}=this.state,{cols:R,preventCollision:F,allowOverlap:V}=this.props;let $=!1,L,N,H;const[_,z]=(0,r.withLayoutItem)(T,p,A=>{let j;return N=A.x,H=A.y,["sw","w","nw","n","ne"].indexOf(M)!==-1&&(["sw","nw","w"].indexOf(M)!==-1&&(N=A.x+(A.w-g),g=A.x!==N&&N<0?A.w:g,N=N<0?0:N),["ne","n","nw"].indexOf(M)!==-1&&(H=A.y+(A.h-b),b=A.y!==H&&H<0?A.h:b,H=H<0?0:H),$=!0),F&&!V&&(j=(0,r.getAllCollisions)(T,{...A,w:g,h:b,x:N,y:H}).filter(U=>U.i!==A.i).length>0,j&&(H=A.y,b=A.h,N=A.x,g=A.w,$=!1)),A.w=g,A.h=b,A});if(!z)return;L=_,$&&(L=(0,r.moveElement)(_,z,N,H,!0,this.props.preventCollision,(0,r.compactType)(this.props),R,V));const B={w:z.w,h:z.h,x:z.x,y:z.y,static:!0,i:p};this.props.onResize(L,k,z,B,x,S),this.setState({layout:V?L:(0,r.compact)(L,(0,r.compactType)(this.props),R),activeDrag:B})}),f(this,"onResizeStop",(p,g,b,C)=>{let{e:x,node:S}=C;const{layout:E,oldResizeItem:M}=this.state,{cols:k,allowOverlap:T}=this.props,R=(0,r.getLayoutItem)(E,p),F=T?E:(0,r.compact)(E,(0,r.compactType)(this.props),k);this.props.onResizeStop(F,M,R,null,x,S);const{oldLayout:V}=this.state;this.setState({activeDrag:null,layout:F,oldResizeItem:null,oldLayout:null,resizing:!1}),this.onLayoutMaybeChanged(F,V)}),f(this,"onDragOver",p=>{var _;if(p.preventDefault(),p.stopPropagation(),y&&!((_=p.nativeEvent.target)!=null&&_.classList.contains(m)))return!1;const{droppingItem:g,onDropDragOver:b,margin:C,cols:x,rowHeight:S,maxRows:E,width:M,containerPadding:k,transformScale:T}=this.props,R=b==null?void 0:b(p);if(R===!1)return this.state.droppingDOMNode&&this.removeDroppingPlaceholder(),!1;const F={...g,...R},{layout:V}=this.state,$=p.currentTarget.getBoundingClientRect(),L=p.clientX-$.left,N=p.clientY-$.top,H={left:L/T,top:N/T,e:p};if(this.state.droppingDOMNode){if(this.state.droppingPosition){const{left:z,top:B}=this.state.droppingPosition;(z!=L||B!=N)&&this.setState({droppingPosition:H})}}else{const z={cols:x,margin:C,maxRows:E,rowHeight:S,containerWidth:M,containerPadding:k||C},B=(0,o.calcXY)(z,N,L,F.w,F.h);this.setState({droppingDOMNode:e.createElement("div",{key:F.i}),droppingPosition:H,layout:[...V,{...F,x:B.x,y:B.y,static:!1,isDraggable:!0}]})}}),f(this,"removeDroppingPlaceholder",()=>{const{droppingItem:p,cols:g}=this.props,{layout:b}=this.state,C=(0,r.compact)(b.filter(x=>x.i!==p.i),(0,r.compactType)(this.props),g,this.props.allowOverlap);this.setState({layout:C,droppingDOMNode:null,activeDrag:null,droppingPosition:void 0})}),f(this,"onDragLeave",p=>{p.preventDefault(),p.stopPropagation(),this.dragEnterCounter--,this.dragEnterCounter===0&&this.removeDroppingPlaceholder()}),f(this,"onDragEnter",p=>{p.preventDefault(),p.stopPropagation(),this.dragEnterCounter++}),f(this,"onDrop",p=>{p.preventDefault(),p.stopPropagation();const{droppingItem:g}=this.props,{layout:b}=this.state,C=b.find(x=>x.i===g.i);this.dragEnterCounter=0,this.removeDroppingPlaceholder(),this.props.onDrop(b,C,p)})}componentDidMount(){this.setState({mounted:!0}),this.onLayoutMaybeChanged(this.state.layout,this.props.layout)}static getDerivedStateFromProps(p,g){let b;return g.activeDrag?null:(!(0,t.deepEqual)(p.layout,g.propsLayout)||p.compactType!==g.compactType?b=p.layout:(0,r.childrenEqual)(p.children,g.children)||(b=g.layout),b?{layout:(0,r.synchronizeLayoutWithChildren)(b,p.children,p.cols,(0,r.compactType)(p),p.allowOverlap),compactType:p.compactType,children:p.children,propsLayout:p.layout}:null)}shouldComponentUpdate(p,g){return this.props.children!==p.children||!(0,r.fastRGLPropsEqual)(this.props,p,t.deepEqual)||this.state.activeDrag!==g.activeDrag||this.state.mounted!==g.mounted||this.state.droppingPosition!==g.droppingPosition}componentDidUpdate(p,g){if(!this.state.activeDrag){const b=this.state.layout,C=g.layout;this.onLayoutMaybeChanged(b,C)}}containerHeight(){if(!this.props.autoSize)return;const p=(0,r.bottom)(this.state.layout),g=this.props.containerPadding?this.props.containerPadding[1]:this.props.margin[1];return p*this.props.rowHeight+(p-1)*this.props.margin[1]+g*2+"px"}onLayoutMaybeChanged(p,g){g||(g=this.state.layout),(0,t.deepEqual)(g,p)||this.props.onLayoutChange(p)}placeholder(){const{activeDrag:p}=this.state;if(!p)return null;const{width:g,cols:b,margin:C,containerPadding:x,rowHeight:S,maxRows:E,useCSSTransforms:M,transformScale:k}=this.props;return e.createElement(a.default,{w:p.w,h:p.h,x:p.x,y:p.y,i:p.i,className:`react-grid-placeholder ${this.state.resizing?"placeholder-resizing":""}`,containerWidth:g,cols:b,margin:C,containerPadding:x||C,maxRows:E,rowHeight:S,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:M,transformScale:k},e.createElement("div",null))}processGridItem(p,g){if(!p||!p.key)return;const b=(0,r.getLayoutItem)(this.state.layout,String(p.key));if(!b)return null;const{width:C,cols:x,margin:S,containerPadding:E,rowHeight:M,maxRows:k,isDraggable:T,isResizable:R,isBounded:F,useCSSTransforms:V,transformScale:$,draggableCancel:L,draggableHandle:N,resizeHandles:H,resizeHandle:_}=this.props,{mounted:z,droppingPosition:B}=this.state,A=typeof b.isDraggable=="boolean"?b.isDraggable:!b.static&&T,j=typeof b.isResizable=="boolean"?b.isResizable:!b.static&&R,Y=b.resizeHandles||H,U=A&&F&&b.isBounded!==!1;return e.createElement(a.default,{containerWidth:C,cols:x,margin:S,containerPadding:E||S,maxRows:k,rowHeight:M,cancel:L,handle:N,onDragStop:this.onDragStop,onDragStart:this.onDragStart,onDrag:this.onDrag,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,isDraggable:A,isResizable:j,isBounded:U,useCSSTransforms:V&&z,usePercentages:!z,transformScale:$,w:b.w,h:b.h,x:b.x,y:b.y,i:b.i,minH:b.minH,minW:b.minW,maxH:b.maxH,maxW:b.maxW,static:b.static,droppingPosition:g?B:void 0,resizeHandles:Y,resizeHandle:_},p)}render(){const{className:p,style:g,isDroppable:b,innerRef:C}=this.props,x=(0,n.default)(m,p),S={height:this.containerHeight(),...g};return e.createElement("div",{ref:C,className:x,style:S,onDrop:b?this.onDrop:r.noop,onDragLeave:b?this.onDragLeave:r.noop,onDragEnter:b?this.onDragEnter:r.noop,onDragOver:b?this.onDragOver:r.noop},e.Children.map(this.props.children,E=>this.processGridItem(E)),b&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}}return No.default=w,f(w,"displayName","ReactGridLayout"),f(w,"propTypes",i.default),f(w,"defaultProps",{autoSize:!0,cols:12,className:"",style:{},draggableHandle:"",draggableCancel:"",containerPadding:null,rowHeight:150,maxRows:1/0,layout:[],margin:[10,10],isBounded:!1,isDraggable:!0,isResizable:!0,allowOverlap:!1,isDroppable:!1,useCSSTransforms:!0,transformScale:1,verticalCompact:!0,compactType:"vertical",preventCollision:!1,droppingItem:{i:"__dropping-elem__",h:1,w:1},resizeHandles:["se"],onLayoutChange:r.noop,onDragStart:r.noop,onDrag:r.noop,onDragStop:r.noop,onResizeStart:r.noop,onResize:r.noop,onResizeStop:r.noop,onDrop:r.noop,onDropDragOver:r.noop}),No}var zo={},kr={},Wv;function Bv(){if(Wv)return kr;Wv=1,Object.defineProperty(kr,"__esModule",{value:!0}),kr.findOrGenerateResponsiveLayout=r,kr.getBreakpointFromWidth=t,kr.getColsFromBreakpoint=n,kr.sortBreakpoints=o;var e=to();function t(a,i){const s=o(a);let u=s[0];for(let c=1,f=s.length;c<f;c++){const l=s[c];i>a[l]&&(u=l)}return u}function n(a,i){if(!i[a])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+a+" is missing!");return i[a]}function r(a,i,s,u,c,f){if(a[s])return(0,e.cloneLayout)(a[s]);let l=a[u];const h=o(i),m=h.slice(h.indexOf(s));for(let y=0,w=m.length;y<w;y++){const v=m[y];if(a[v]){l=a[v];break}}return l=(0,e.cloneLayout)(l||[]),(0,e.compact)((0,e.correctBounds)(l,{cols:c}),f,c)}function o(a){return Object.keys(a).sort(function(s,u){return a[s]-a[u]})}return kr}var jv;function $C(){if(jv)return zo;jv=1,Object.defineProperty(zo,"__esModule",{value:!0}),zo.default=void 0;var e=u(D),t=i(lr()),n=ml(),r=to(),o=Bv(),a=i(Vv());function i(v){return v&&v.__esModule?v:{default:v}}function s(v){if(typeof WeakMap!="function")return null;var p=new WeakMap,g=new WeakMap;return(s=function(b){return b?g:p})(v)}function u(v,p){if(v&&v.__esModule)return v;if(v===null||typeof v!="object"&&typeof v!="function")return{default:v};var g=s(p);if(g&&g.has(v))return g.get(v);var b={__proto__:null},C=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var x in v)if(x!=="default"&&Object.prototype.hasOwnProperty.call(v,x)){var S=C?Object.getOwnPropertyDescriptor(v,x):null;S&&(S.get||S.set)?Object.defineProperty(b,x,S):b[x]=v[x]}return b.default=v,g&&g.set(v,b),b}function c(){return c=Object.assign?Object.assign.bind():function(v){for(var p=1;p<arguments.length;p++){var g=arguments[p];for(var b in g)Object.prototype.hasOwnProperty.call(g,b)&&(v[b]=g[b])}return v},c.apply(this,arguments)}function f(v,p,g){return p=l(p),p in v?Object.defineProperty(v,p,{value:g,enumerable:!0,configurable:!0,writable:!0}):v[p]=g,v}function l(v){var p=h(v,"string");return typeof p=="symbol"?p:String(p)}function h(v,p){if(typeof v!="object"||v===null)return v;var g=v[Symbol.toPrimitive];if(g!==void 0){var b=g.call(v,p);if(typeof b!="object")return b;throw new TypeError("@@toPrimitive must return a primitive value.")}return(p==="string"?String:Number)(v)}const m=v=>Object.prototype.toString.call(v);function y(v,p){return v==null?null:Array.isArray(v)?v:v[p]}let w=class extends e.Component{constructor(){super(...arguments),f(this,"state",this.generateInitialState()),f(this,"onLayoutChange",p=>{this.props.onLayoutChange(p,{...this.props.layouts,[this.state.breakpoint]:p})})}generateInitialState(){const{width:p,breakpoints:g,layouts:b,cols:C}=this.props,x=(0,o.getBreakpointFromWidth)(g,p),S=(0,o.getColsFromBreakpoint)(x,C),E=this.props.verticalCompact===!1?null:this.props.compactType;return{layout:(0,o.findOrGenerateResponsiveLayout)(b,g,x,x,S,E),breakpoint:x,cols:S}}static getDerivedStateFromProps(p,g){if(!(0,n.deepEqual)(p.layouts,g.layouts)){const{breakpoint:b,cols:C}=g;return{layout:(0,o.findOrGenerateResponsiveLayout)(p.layouts,p.breakpoints,b,b,C,p.compactType),layouts:p.layouts}}return null}componentDidUpdate(p){(this.props.width!=p.width||this.props.breakpoint!==p.breakpoint||!(0,n.deepEqual)(this.props.breakpoints,p.breakpoints)||!(0,n.deepEqual)(this.props.cols,p.cols))&&this.onWidthChange(p)}onWidthChange(p){const{breakpoints:g,cols:b,layouts:C,compactType:x}=this.props,S=this.props.breakpoint||(0,o.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),E=this.state.breakpoint,M=(0,o.getColsFromBreakpoint)(S,b),k={...C};if(E!==S||p.breakpoints!==g||p.cols!==b){E in k||(k[E]=(0,r.cloneLayout)(this.state.layout));let F=(0,o.findOrGenerateResponsiveLayout)(k,g,S,E,M,x);F=(0,r.synchronizeLayoutWithChildren)(F,this.props.children,M,x,this.props.allowOverlap),k[S]=F,this.props.onBreakpointChange(S,M),this.props.onLayoutChange(F,k),this.setState({breakpoint:S,layout:F,cols:M})}const T=y(this.props.margin,S),R=y(this.props.containerPadding,S);this.props.onWidthChange(this.props.width,T,M,R)}render(){const{breakpoint:p,breakpoints:g,cols:b,layouts:C,margin:x,containerPadding:S,onBreakpointChange:E,onLayoutChange:M,onWidthChange:k,...T}=this.props;return e.createElement(a.default,c({},T,{margin:y(x,this.state.breakpoint),containerPadding:y(S,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}};return zo.default=w,f(w,"propTypes",{breakpoint:t.default.string,breakpoints:t.default.object,allowOverlap:t.default.bool,cols:t.default.object,margin:t.default.oneOfType([t.default.array,t.default.object]),containerPadding:t.default.oneOfType([t.default.array,t.default.object]),layouts(v,p){if(m(v[p])!=="[object Object]")throw new Error("Layout property must be an object. Received: "+m(v[p]));Object.keys(v[p]).forEach(g=>{if(!(g in v.breakpoints))throw new Error("Each key in layouts must align with a key in breakpoints.");(0,r.validateLayout)(v.layouts[g],"layouts."+g)})},width:t.default.number.isRequired,onBreakpointChange:t.default.func,onLayoutChange:t.default.func,onWidthChange:t.default.func}),f(w,"defaultProps",{breakpoints:{lg:1200,md:996,sm:768,xs:480,xxs:0},cols:{lg:12,md:10,sm:6,xs:4,xxs:2},containerPadding:{lg:null,md:null,sm:null,xs:null,xxs:null},layouts:{},margin:[10,10],allowOverlap:!1,onBreakpointChange:r.noop,onLayoutChange:r.noop,onWidthChange:r.noop}),zo}var pi={};const FC=vd(r1);var Yv;function zC(){if(Yv)return pi;Yv=1,Object.defineProperty(pi,"__esModule",{value:!0}),pi.default=h;var e=i(D),t=o(lr()),n=o(FC),r=o(hl());function o(m){return m&&m.__esModule?m:{default:m}}function a(m){if(typeof WeakMap!="function")return null;var y=new WeakMap,w=new WeakMap;return(a=function(v){return v?w:y})(m)}function i(m,y){if(m&&m.__esModule)return m;if(m===null||typeof m!="object"&&typeof m!="function")return{default:m};var w=a(y);if(w&&w.has(m))return w.get(m);var v={__proto__:null},p=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var g in m)if(g!=="default"&&Object.prototype.hasOwnProperty.call(m,g)){var b=p?Object.getOwnPropertyDescriptor(m,g):null;b&&(b.get||b.set)?Object.defineProperty(v,g,b):v[g]=m[g]}return v.default=m,w&&w.set(m,v),v}function s(){return s=Object.assign?Object.assign.bind():function(m){for(var y=1;y<arguments.length;y++){var w=arguments[y];for(var v in w)Object.prototype.hasOwnProperty.call(w,v)&&(m[v]=w[v])}return m},s.apply(this,arguments)}function u(m,y,w){return y=c(y),y in m?Object.defineProperty(m,y,{value:w,enumerable:!0,configurable:!0,writable:!0}):m[y]=w,m}function c(m){var y=f(m,"string");return typeof y=="symbol"?y:String(y)}function f(m,y){if(typeof m!="object"||m===null)return m;var w=m[Symbol.toPrimitive];if(w!==void 0){var v=w.call(m,y);if(typeof v!="object")return v;throw new TypeError("@@toPrimitive must return a primitive value.")}return(y==="string"?String:Number)(m)}const l="react-grid-layout";function h(m){var y;return y=class extends e.Component{constructor(){super(...arguments),u(this,"state",{width:1280}),u(this,"elementRef",e.createRef()),u(this,"mounted",!1),u(this,"resizeObserver",void 0)}componentDidMount(){this.mounted=!0,this.resizeObserver=new n.default(p=>{if(this.elementRef.current instanceof HTMLElement){const b=p[0].contentRect.width;this.setState({width:b})}});const v=this.elementRef.current;v instanceof HTMLElement&&this.resizeObserver.observe(v)}componentWillUnmount(){this.mounted=!1;const v=this.elementRef.current;v instanceof HTMLElement&&this.resizeObserver.unobserve(v),this.resizeObserver.disconnect()}render(){const{measureBeforeMount:v,...p}=this.props;return v&&!this.mounted?e.createElement("div",{className:(0,r.default)(this.props.className,l),style:this.props.style,ref:this.elementRef}):e.createElement(m,s({innerRef:this.elementRef},p,this.state))}},u(y,"defaultProps",{measureBeforeMount:!1}),u(y,"propTypes",{measureBeforeMount:t.default.bool}),y}return pi}var Uv;function HC(){return Uv||(Uv=1,function(e){e.exports=Vv().default,e.exports.utils=to(),e.exports.calculateUtils=gl(),e.exports.Responsive=$C().default,e.exports.Responsive.utils=Bv(),e.exports.WidthProvider=zC().default}(vl)),vl.exports}var qv=HC();const VC=ks(qv),Gv=qv.WidthProvider(VC);function WC(e){const{list:t,onListChange:n,idKey:r,itemRender:o,...a}=e,i=D.useMemo(()=>{const u=new Map;return t.forEach(c=>{const f=c[r];u.set(f,c)}),u},[r,t]),s=D.useMemo(()=>t.map((u,c)=>({i:u[r],w:12,h:1,x:0,y:c,col:12})),[r,t]);return P.jsx(Gv,{...a,cols:12,preventCollision:!1,isResizable:!1,isDraggable:!0,onLayoutChange:u=>{const c=u.sort((f,l)=>f.y-l.y).map(f=>i.get(f.i));n(c)},children:s.map((u,c)=>P.jsx("div",{"data-grid":u,children:o(i.get(u.i),c)},u.i))})}var xn={TAB:9,ENTER:13,ESC:27,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40},BC=xn.ESC,jC=xn.TAB;function YC(e){var t=e.visible,n=e.triggerRef,r=e.onVisibleChange,o=e.autoFocus,a=e.overlayRef,i=d.useRef(!1),s=function(){if(t){var l,h;(l=n.current)===null||l===void 0||(h=l.focus)===null||h===void 0||h.call(l),r==null||r(!1)}},u=function(){var l;return(l=a.current)!==null&&l!==void 0&&l.focus?(a.current.focus(),i.current=!0,!0):!1},c=function(l){switch(l.keyCode){case BC:s();break;case jC:{var h=!1;i.current||(h=u()),h?l.preventDefault():s();break}}};d.useEffect(function(){return t?(window.addEventListener("keydown",c),o&&mt(u,3),function(){window.removeEventListener("keydown",c),i.current=!1}):function(){i.current=!1}},[t])}var UC=D.forwardRef(function(e,t){var n=e.overlay,r=e.arrow,o=e.prefixCls,a=D.useMemo(function(){var s;return typeof n=="function"?s=n():s=n,s},[n]),i=ka(t,ho(a));return D.createElement(D.Fragment,null,r&&D.createElement("div",{className:"".concat(o,"-arrow")}),D.cloneElement(a,{ref:Yr(a)?i:void 0}))}),no={adjustX:1,adjustY:1},ro=[0,0],qC={topLeft:{points:["bl","tl"],overflow:no,offset:[0,-4],targetOffset:ro},top:{points:["bc","tc"],overflow:no,offset:[0,-4],targetOffset:ro},topRight:{points:["br","tr"],overflow:no,offset:[0,-4],targetOffset:ro},bottomLeft:{points:["tl","bl"],overflow:no,offset:[0,4],targetOffset:ro},bottom:{points:["tc","bc"],overflow:no,offset:[0,4],targetOffset:ro},bottomRight:{points:["tr","br"],overflow:no,offset:[0,4],targetOffset:ro}},GC=["arrow","prefixCls","transitionName","animation","align","placement","placements","getPopupContainer","showAction","hideAction","overlayClassName","overlayStyle","visible","trigger","autoFocus","overlay","children","onVisibleChange"];function KC(e,t){var n,r=e.arrow,o=r===void 0?!1:r,a=e.prefixCls,i=a===void 0?"rc-dropdown":a,s=e.transitionName,u=e.animation,c=e.align,f=e.placement,l=f===void 0?"bottomLeft":f,h=e.placements,m=h===void 0?qC:h,y=e.getPopupContainer,w=e.showAction,v=e.hideAction,p=e.overlayClassName,g=e.overlayStyle,b=e.visible,C=e.trigger,x=C===void 0?["hover"]:C,S=e.autoFocus,E=e.overlay,M=e.children,k=e.onVisibleChange,T=pt(e,GC),R=D.useState(),F=X(R,2),V=F[0],$=F[1],L="visible"in e?b:V,N=D.useRef(null),H=D.useRef(null),_=D.useRef(null);D.useImperativeHandle(t,function(){return N.current});var z=function(G){$(G),k==null||k(G)};YC({visible:L,triggerRef:_,onVisibleChange:z,autoFocus:S,overlayRef:H});var B=function(G){var q=e.onOverlayClick;$(!1),q&&q(G)},A=function(){return D.createElement(UC,{ref:H,overlay:E,prefixCls:i,arrow:o})},j=function(){return typeof E=="function"?A:A()},Y=function(){var G=e.minOverlayWidthMatchTrigger,q=e.alignPoint;return"minOverlayWidthMatchTrigger"in e?G:!q},U=function(){var G=e.openClassName;return G!==void 0?G:"".concat(i,"-open")},ne=D.cloneElement(M,{className:Xe((n=M.props)===null||n===void 0?void 0:n.className,L&&U()),ref:Yr(M)?ka(_,ho(M)):void 0}),te=v;return!te&&x.indexOf("contextMenu")!==-1&&(te=["click"]),D.createElement(Qs,Ne({builtinPlacements:m},T,{prefixCls:i,ref:N,popupClassName:Xe(p,ce({},"".concat(i,"-show-arrow"),o)),popupStyle:g,action:x,showAction:w,hideAction:te,popupPlacement:l,popupAlign:c,popupTransitionName:s,popupAnimation:u,popupVisible:L,stretch:Y()?"minWidth":"",popup:j(),onPopupVisibleChange:z,onPopupClick:B,getPopupContainer:y}),ne)}const XC=D.forwardRef(KC);function ZC(e){const{className:t,placement:n,children:r,overlay:o,alignPoint:a=!1,align:i,disabled:s,onVisibleChange:u}=e,c=s?[]:e.trigger||["click"],{mountContainer:f}=D.useContext(mn);return f&&P.jsx(XC,{...e,overlayClassName:t,prefixCls:"univer-dropdown",getPopupContainer:()=>f,trigger:c,animation:"slide-up",placement:n,overlay:o,alignPoint:a,align:i,onVisibleChange:u,children:r})}function Kv(e){const t=e+"CollectionProvider",[n,r]=Wn(t),[o,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=w=>{const{scope:v,children:p}=w,g=D.useRef(null),b=D.useRef(new Map).current;return P.jsx(o,{scope:v,itemMap:b,collectionRef:g,children:p})};i.displayName=t;const s=e+"CollectionSlot",u=wr(s),c=D.forwardRef((w,v)=>{const{scope:p,children:g}=w,b=a(s,p),C=Pt(v,b.collectionRef);return P.jsx(u,{ref:C,children:g})});c.displayName=s;const f=e+"CollectionItemSlot",l="data-radix-collection-item",h=wr(f),m=D.forwardRef((w,v)=>{const{scope:p,children:g,...b}=w,C=D.useRef(null),x=Pt(v,C),S=a(f,p);return D.useEffect(()=>(S.itemMap.set(C,{ref:C,...b}),()=>void S.itemMap.delete(C))),P.jsx(h,{[l]:"",ref:x,children:g})});m.displayName=f;function y(w){const v=a(e+"CollectionConsumer",w);return D.useCallback(()=>{const g=v.collectionRef.current;if(!g)return[];const b=Array.from(g.querySelectorAll(`[${l}]`));return Array.from(v.itemMap.values()).sort((S,E)=>b.indexOf(S.ref.current)-b.indexOf(E.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:i,Slot:c,ItemSlot:m},y,r]}var QC=d.createContext(void 0);function Xv(e){const t=d.useContext(QC);return e||t||"ltr"}const JC=["top","right","bottom","left"],dr=Math.min,un=Math.max,gi=Math.round,yi=Math.floor,Rn=e=>({x:e,y:e}),ex={left:"right",right:"left",bottom:"top",top:"bottom"},tx={start:"end",end:"start"};function El(e,t,n){return un(e,dr(t,n))}function qn(e,t){return typeof e=="function"?e(t):e}function Gn(e){return e.split("-")[0]}function oo(e){return e.split("-")[1]}function Ml(e){return e==="x"?"y":"x"}function Pl(e){return e==="y"?"height":"width"}const nx=new Set(["top","bottom"]);function An(e){return nx.has(Gn(e))?"y":"x"}function Dl(e){return Ml(An(e))}function rx(e,t,n){n===void 0&&(n=!1);const r=oo(e),o=Dl(e),a=Pl(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(i=bi(i)),[i,bi(i)]}function ox(e){const t=bi(e);return[kl(e),t,kl(t)]}function kl(e){return e.replace(/start|end/g,t=>tx[t])}const Zv=["left","right"],Qv=["right","left"],ax=["top","bottom"],ix=["bottom","top"];function sx(e,t,n){switch(e){case"top":case"bottom":return n?t?Qv:Zv:t?Zv:Qv;case"left":case"right":return t?ax:ix;default:return[]}}function lx(e,t,n,r){const o=oo(e);let a=sx(Gn(e),n==="start",r);return o&&(a=a.map(i=>i+"-"+o),t&&(a=a.concat(a.map(kl)))),a}function bi(e){return e.replace(/left|right|bottom|top/g,t=>ex[t])}function ux(e){return{top:0,right:0,bottom:0,left:0,...e}}function Jv(e){return typeof e!="number"?ux(e):{top:e,right:e,bottom:e,left:e}}function wi(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function em(e,t,n){let{reference:r,floating:o}=e;const a=An(t),i=Dl(t),s=Pl(i),u=Gn(t),c=a==="y",f=r.x+r.width/2-o.width/2,l=r.y+r.height/2-o.height/2,h=r[s]/2-o[s]/2;let m;switch(u){case"top":m={x:f,y:r.y-o.height};break;case"bottom":m={x:f,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:l};break;case"left":m={x:r.x-o.width,y:l};break;default:m={x:r.x,y:r.y}}switch(oo(t)){case"start":m[i]-=h*(n&&c?-1:1);break;case"end":m[i]+=h*(n&&c?-1:1);break}return m}const cx=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:a=[],platform:i}=n,s=a.filter(Boolean),u=await(i.isRTL==null?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:f,y:l}=em(c,r,u),h=r,m={},y=0;for(let w=0;w<s.length;w++){const{name:v,fn:p}=s[w],{x:g,y:b,data:C,reset:x}=await p({x:f,y:l,initialPlacement:r,placement:h,strategy:o,middlewareData:m,rects:c,platform:i,elements:{reference:e,floating:t}});f=g!=null?g:f,l=b!=null?b:l,m={...m,[v]:{...m[v],...C}},x&&y<=50&&(y++,typeof x=="object"&&(x.placement&&(h=x.placement),x.rects&&(c=x.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):x.rects),{x:f,y:l}=em(c,h,u)),w=-1)}return{x:f,y:l,placement:h,strategy:o,middlewareData:m}};async function Ho(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:a,rects:i,elements:s,strategy:u}=e,{boundary:c="clippingAncestors",rootBoundary:f="viewport",elementContext:l="floating",altBoundary:h=!1,padding:m=0}=qn(t,e),y=Jv(m),v=s[h?l==="floating"?"reference":"floating":l],p=wi(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(v)))==null||n?v:v.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(s.floating)),boundary:c,rootBoundary:f,strategy:u})),g=l==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,b=await(a.getOffsetParent==null?void 0:a.getOffsetParent(s.floating)),C=await(a.isElement==null?void 0:a.isElement(b))?await(a.getScale==null?void 0:a.getScale(b))||{x:1,y:1}:{x:1,y:1},x=wi(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:g,offsetParent:b,strategy:u}):g);return{top:(p.top-x.top+y.top)/C.y,bottom:(x.bottom-p.bottom+y.bottom)/C.y,left:(p.left-x.left+y.left)/C.x,right:(x.right-p.right+y.right)/C.x}}const dx=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:a,platform:i,elements:s,middlewareData:u}=t,{element:c,padding:f=0}=qn(e,t)||{};if(c==null)return{};const l=Jv(f),h={x:n,y:r},m=Dl(o),y=Pl(m),w=await i.getDimensions(c),v=m==="y",p=v?"top":"left",g=v?"bottom":"right",b=v?"clientHeight":"clientWidth",C=a.reference[y]+a.reference[m]-h[m]-a.floating[y],x=h[m]-a.reference[m],S=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c));let E=S?S[b]:0;(!E||!await(i.isElement==null?void 0:i.isElement(S)))&&(E=s.floating[b]||a.floating[y]);const M=C/2-x/2,k=E/2-w[y]/2-1,T=dr(l[p],k),R=dr(l[g],k),F=T,V=E-w[y]-R,$=E/2-w[y]/2+M,L=El(F,$,V),N=!u.arrow&&oo(o)!=null&&$!==L&&a.reference[y]/2-($<F?T:R)-w[y]/2<0,H=N?$<F?$-F:$-V:0;return{[m]:h[m]+H,data:{[m]:L,centerOffset:$-L-H,...N&&{alignmentOffset:H}},reset:N}}}),fx=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:a,rects:i,initialPlacement:s,platform:u,elements:c}=t,{mainAxis:f=!0,crossAxis:l=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:w=!0,...v}=qn(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const p=Gn(o),g=An(s),b=Gn(s)===s,C=await(u.isRTL==null?void 0:u.isRTL(c.floating)),x=h||(b||!w?[bi(s)]:ox(s)),S=y!=="none";!h&&S&&x.push(...lx(s,w,y,C));const E=[s,...x],M=await Ho(t,v),k=[];let T=((r=a.flip)==null?void 0:r.overflows)||[];if(f&&k.push(M[p]),l){const $=rx(o,i,C);k.push(M[$[0]],M[$[1]])}if(T=[...T,{placement:o,overflows:k}],!k.every($=>$<=0)){var R,F;const $=(((R=a.flip)==null?void 0:R.index)||0)+1,L=E[$];if(L&&(!(l==="alignment"?g!==An(L):!1)||T.every(_=>_.overflows[0]>0&&An(_.placement)===g)))return{data:{index:$,overflows:T},reset:{placement:L}};let N=(F=T.filter(H=>H.overflows[0]<=0).sort((H,_)=>H.overflows[1]-_.overflows[1])[0])==null?void 0:F.placement;if(!N)switch(m){case"bestFit":{var V;const H=(V=T.filter(_=>{if(S){const z=An(_.placement);return z===g||z==="y"}return!0}).map(_=>[_.placement,_.overflows.filter(z=>z>0).reduce((z,B)=>z+B,0)]).sort((_,z)=>_[1]-z[1])[0])==null?void 0:V[0];H&&(N=H);break}case"initialPlacement":N=s;break}if(o!==N)return{reset:{placement:N}}}return{}}}};function tm(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function nm(e){return JC.some(t=>e[t]>=0)}const vx=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=qn(e,t);switch(r){case"referenceHidden":{const a=await Ho(t,{...o,elementContext:"reference"}),i=tm(a,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:nm(i)}}}case"escaped":{const a=await Ho(t,{...o,altBoundary:!0}),i=tm(a,n.floating);return{data:{escapedOffsets:i,escaped:nm(i)}}}default:return{}}}}},rm=new Set(["left","top"]);async function mx(e,t){const{placement:n,platform:r,elements:o}=e,a=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=Gn(n),s=oo(n),u=An(n)==="y",c=rm.has(i)?-1:1,f=a&&u?-1:1,l=qn(t,e);let{mainAxis:h,crossAxis:m,alignmentAxis:y}=typeof l=="number"?{mainAxis:l,crossAxis:0,alignmentAxis:null}:{mainAxis:l.mainAxis||0,crossAxis:l.crossAxis||0,alignmentAxis:l.alignmentAxis};return s&&typeof y=="number"&&(m=s==="end"?y*-1:y),u?{x:m*f,y:h*c}:{x:h*c,y:m*f}}const hx=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:a,placement:i,middlewareData:s}=t,u=await mx(t,e);return i===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:o+u.x,y:a+u.y,data:{...u,placement:i}}}}},px=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:a=!0,crossAxis:i=!1,limiter:s={fn:v=>{let{x:p,y:g}=v;return{x:p,y:g}}},...u}=qn(e,t),c={x:n,y:r},f=await Ho(t,u),l=An(Gn(o)),h=Ml(l);let m=c[h],y=c[l];if(a){const v=h==="y"?"top":"left",p=h==="y"?"bottom":"right",g=m+f[v],b=m-f[p];m=El(g,m,b)}if(i){const v=l==="y"?"top":"left",p=l==="y"?"bottom":"right",g=y+f[v],b=y-f[p];y=El(g,y,b)}const w=s.fn({...t,[h]:m,[l]:y});return{...w,data:{x:w.x-n,y:w.y-r,enabled:{[h]:a,[l]:i}}}}}},gx=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:a,middlewareData:i}=t,{offset:s=0,mainAxis:u=!0,crossAxis:c=!0}=qn(e,t),f={x:n,y:r},l=An(o),h=Ml(l);let m=f[h],y=f[l];const w=qn(s,t),v=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(u){const b=h==="y"?"height":"width",C=a.reference[h]-a.floating[b]+v.mainAxis,x=a.reference[h]+a.reference[b]-v.mainAxis;m<C?m=C:m>x&&(m=x)}if(c){var p,g;const b=h==="y"?"width":"height",C=rm.has(Gn(o)),x=a.reference[l]-a.floating[b]+(C&&((p=i.offset)==null?void 0:p[l])||0)+(C?0:v.crossAxis),S=a.reference[l]+a.reference[b]+(C?0:((g=i.offset)==null?void 0:g[l])||0)-(C?v.crossAxis:0);y<x?y=x:y>S&&(y=S)}return{[h]:m,[l]:y}}}},yx=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:a,platform:i,elements:s}=t,{apply:u=()=>{},...c}=qn(e,t),f=await Ho(t,c),l=Gn(o),h=oo(o),m=An(o)==="y",{width:y,height:w}=a.floating;let v,p;l==="top"||l==="bottom"?(v=l,p=h===(await(i.isRTL==null?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(p=l,v=h==="end"?"top":"bottom");const g=w-f.top-f.bottom,b=y-f.left-f.right,C=dr(w-f[v],g),x=dr(y-f[p],b),S=!t.middlewareData.shift;let E=C,M=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(M=b),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(E=g),S&&!h){const T=un(f.left,0),R=un(f.right,0),F=un(f.top,0),V=un(f.bottom,0);m?M=y-2*(T!==0||R!==0?T+R:un(f.left,f.right)):E=w-2*(F!==0||V!==0?F+V:un(f.top,f.bottom))}await u({...t,availableWidth:M,availableHeight:E});const k=await i.getDimensions(s.floating);return y!==k.width||w!==k.height?{reset:{rects:!0}}:{}}}};function Ci(){return typeof window<"u"}function ao(e){return om(e)?(e.nodeName||"").toLowerCase():"#document"}function cn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ln(e){var t;return(t=(om(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function om(e){return Ci()?e instanceof Node||e instanceof cn(e).Node:!1}function Sn(e){return Ci()?e instanceof Element||e instanceof cn(e).Element:!1}function $n(e){return Ci()?e instanceof HTMLElement||e instanceof cn(e).HTMLElement:!1}function am(e){return!Ci()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof cn(e).ShadowRoot}const bx=new Set(["inline","contents"]);function Vo(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=En(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!bx.has(o)}const wx=new Set(["table","td","th"]);function Cx(e){return wx.has(ao(e))}const xx=[":popover-open",":modal"];function xi(e){return xx.some(t=>{try{return e.matches(t)}catch{return!1}})}const Sx=["transform","translate","scale","rotate","perspective"],Ex=["transform","translate","scale","rotate","perspective","filter"],Mx=["paint","layout","strict","content"];function _l(e){const t=Nl(),n=Sn(e)?En(e):e;return Sx.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||Ex.some(r=>(n.willChange||"").includes(r))||Mx.some(r=>(n.contain||"").includes(r))}function Px(e){let t=fr(e);for(;$n(t)&&!io(t);){if(_l(t))return t;if(xi(t))return null;t=fr(t)}return null}function Nl(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Dx=new Set(["html","body","#document"]);function io(e){return Dx.has(ao(e))}function En(e){return cn(e).getComputedStyle(e)}function Si(e){return Sn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function fr(e){if(ao(e)==="html")return e;const t=e.assignedSlot||e.parentNode||am(e)&&e.host||Ln(e);return am(t)?t.host:t}function im(e){const t=fr(e);return io(t)?e.ownerDocument?e.ownerDocument.body:e.body:$n(t)&&Vo(t)?t:im(t)}function Wo(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=im(e),a=o===((r=e.ownerDocument)==null?void 0:r.body),i=cn(o);if(a){const s=Ol(i);return t.concat(i,i.visualViewport||[],Vo(o)?o:[],s&&n?Wo(s):[])}return t.concat(o,Wo(o,[],n))}function Ol(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function sm(e){const t=En(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=$n(e),a=o?e.offsetWidth:n,i=o?e.offsetHeight:r,s=gi(n)!==a||gi(r)!==i;return s&&(n=a,r=i),{width:n,height:r,$:s}}function Tl(e){return Sn(e)?e:e.contextElement}function so(e){const t=Tl(e);if(!$n(t))return Rn(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:a}=sm(t);let i=(a?gi(n.width):n.width)/r,s=(a?gi(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!s||!Number.isFinite(s))&&(s=1),{x:i,y:s}}const kx=Rn(0);function lm(e){const t=cn(e);return!Nl()||!t.visualViewport?kx:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function _x(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==cn(e)?!1:t}function _r(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),a=Tl(e);let i=Rn(1);t&&(r?Sn(r)&&(i=so(r)):i=so(e));const s=_x(a,n,r)?lm(a):Rn(0);let u=(o.left+s.x)/i.x,c=(o.top+s.y)/i.y,f=o.width/i.x,l=o.height/i.y;if(a){const h=cn(a),m=r&&Sn(r)?cn(r):r;let y=h,w=Ol(y);for(;w&&r&&m!==y;){const v=so(w),p=w.getBoundingClientRect(),g=En(w),b=p.left+(w.clientLeft+parseFloat(g.paddingLeft))*v.x,C=p.top+(w.clientTop+parseFloat(g.paddingTop))*v.y;u*=v.x,c*=v.y,f*=v.x,l*=v.y,u+=b,c+=C,y=cn(w),w=Ol(y)}}return wi({width:f,height:l,x:u,y:c})}function Il(e,t){const n=Si(e).scrollLeft;return t?t.left+n:_r(Ln(e)).left+n}function um(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:Il(e,r)),a=r.top+t.scrollTop;return{x:o,y:a}}function Nx(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const a=o==="fixed",i=Ln(r),s=t?xi(t.floating):!1;if(r===i||s&&a)return n;let u={scrollLeft:0,scrollTop:0},c=Rn(1);const f=Rn(0),l=$n(r);if((l||!l&&!a)&&((ao(r)!=="body"||Vo(i))&&(u=Si(r)),$n(r))){const m=_r(r);c=so(r),f.x=m.x+r.clientLeft,f.y=m.y+r.clientTop}const h=i&&!l&&!a?um(i,u,!0):Rn(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-u.scrollLeft*c.x+f.x+h.x,y:n.y*c.y-u.scrollTop*c.y+f.y+h.y}}function Ox(e){return Array.from(e.getClientRects())}function Tx(e){const t=Ln(e),n=Si(e),r=e.ownerDocument.body,o=un(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=un(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+Il(e);const s=-n.scrollTop;return En(r).direction==="rtl"&&(i+=un(t.clientWidth,r.clientWidth)-o),{width:o,height:a,x:i,y:s}}function Ix(e,t){const n=cn(e),r=Ln(e),o=n.visualViewport;let a=r.clientWidth,i=r.clientHeight,s=0,u=0;if(o){a=o.width,i=o.height;const c=Nl();(!c||c&&t==="fixed")&&(s=o.offsetLeft,u=o.offsetTop)}return{width:a,height:i,x:s,y:u}}const Rx=new Set(["absolute","fixed"]);function Ax(e,t){const n=_r(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,a=$n(e)?so(e):Rn(1),i=e.clientWidth*a.x,s=e.clientHeight*a.y,u=o*a.x,c=r*a.y;return{width:i,height:s,x:u,y:c}}function cm(e,t,n){let r;if(t==="viewport")r=Ix(e,n);else if(t==="document")r=Tx(Ln(e));else if(Sn(t))r=Ax(t,n);else{const o=lm(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return wi(r)}function dm(e,t){const n=fr(e);return n===t||!Sn(n)||io(n)?!1:En(n).position==="fixed"||dm(n,t)}function Lx(e,t){const n=t.get(e);if(n)return n;let r=Wo(e,[],!1).filter(s=>Sn(s)&&ao(s)!=="body"),o=null;const a=En(e).position==="fixed";let i=a?fr(e):e;for(;Sn(i)&&!io(i);){const s=En(i),u=_l(i);!u&&s.position==="fixed"&&(o=null),(a?!u&&!o:!u&&s.position==="static"&&!!o&&Rx.has(o.position)||Vo(i)&&!u&&dm(e,i))?r=r.filter(f=>f!==i):o=s,i=fr(i)}return t.set(e,r),r}function $x(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?xi(t)?[]:Lx(t,this._c):[].concat(n),r],s=i[0],u=i.reduce((c,f)=>{const l=cm(t,f,o);return c.top=un(l.top,c.top),c.right=dr(l.right,c.right),c.bottom=dr(l.bottom,c.bottom),c.left=un(l.left,c.left),c},cm(t,s,o));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function Fx(e){const{width:t,height:n}=sm(e);return{width:t,height:n}}function zx(e,t,n){const r=$n(t),o=Ln(t),a=n==="fixed",i=_r(e,!0,a,t);let s={scrollLeft:0,scrollTop:0};const u=Rn(0);function c(){u.x=Il(o)}if(r||!r&&!a)if((ao(t)!=="body"||Vo(o))&&(s=Si(t)),r){const m=_r(t,!0,a,t);u.x=m.x+t.clientLeft,u.y=m.y+t.clientTop}else o&&c();a&&!r&&o&&c();const f=o&&!r&&!a?um(o,s):Rn(0),l=i.left+s.scrollLeft-u.x-f.x,h=i.top+s.scrollTop-u.y-f.y;return{x:l,y:h,width:i.width,height:i.height}}function Rl(e){return En(e).position==="static"}function fm(e,t){if(!$n(e)||En(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ln(e)===n&&(n=n.ownerDocument.body),n}function vm(e,t){const n=cn(e);if(xi(e))return n;if(!$n(e)){let o=fr(e);for(;o&&!io(o);){if(Sn(o)&&!Rl(o))return o;o=fr(o)}return n}let r=fm(e,t);for(;r&&Cx(r)&&Rl(r);)r=fm(r,t);return r&&io(r)&&Rl(r)&&!_l(r)?n:r||Px(e)||n}const Hx=async function(e){const t=this.getOffsetParent||vm,n=this.getDimensions,r=await n(e.floating);return{reference:zx(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Vx(e){return En(e).direction==="rtl"}const Wx={convertOffsetParentRelativeRectToViewportRelativeRect:Nx,getDocumentElement:Ln,getClippingRect:$x,getOffsetParent:vm,getElementRects:Hx,getClientRects:Ox,getDimensions:Fx,getScale:so,isElement:Sn,isRTL:Vx};function mm(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Bx(e,t){let n=null,r;const o=Ln(e);function a(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function i(s,u){s===void 0&&(s=!1),u===void 0&&(u=1),a();const c=e.getBoundingClientRect(),{left:f,top:l,width:h,height:m}=c;if(s||t(),!h||!m)return;const y=yi(l),w=yi(o.clientWidth-(f+h)),v=yi(o.clientHeight-(l+m)),p=yi(f),b={rootMargin:-y+"px "+-w+"px "+-v+"px "+-p+"px",threshold:un(0,dr(1,u))||1};let C=!0;function x(S){const E=S[0].intersectionRatio;if(E!==u){if(!C)return i();E?i(!1,E):r=setTimeout(()=>{i(!1,1e-7)},1e3)}E===1&&!mm(c,e.getBoundingClientRect())&&i(),C=!1}try{n=new IntersectionObserver(x,{...b,root:o.ownerDocument})}catch{n=new IntersectionObserver(x,b)}n.observe(e)}return i(!0),a}function jx(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,c=Tl(e),f=o||a?[...c?Wo(c):[],...Wo(t)]:[];f.forEach(p=>{o&&p.addEventListener("scroll",n,{passive:!0}),a&&p.addEventListener("resize",n)});const l=c&&s?Bx(c,n):null;let h=-1,m=null;i&&(m=new ResizeObserver(p=>{let[g]=p;g&&g.target===c&&m&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var b;(b=m)==null||b.observe(t)})),n()}),c&&!u&&m.observe(c),m.observe(t));let y,w=u?_r(e):null;u&&v();function v(){const p=_r(e);w&&!mm(w,p)&&n(),w=p,y=requestAnimationFrame(v)}return n(),()=>{var p;f.forEach(g=>{o&&g.removeEventListener("scroll",n),a&&g.removeEventListener("resize",n)}),l==null||l(),(p=m)==null||p.disconnect(),m=null,u&&cancelAnimationFrame(y)}}const Yx=hx,Ux=px,qx=fx,Gx=yx,Kx=vx,hm=dx,Xx=gx,Zx=(e,t,n)=>{const r=new Map,o={platform:Wx,...n},a={...o.platform,_c:r};return cx(e,t,{...o,platform:a})};var Qx=typeof document<"u",Jx=function(){},Ei=Qx?D.useLayoutEffect:Jx;function Mi(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Mi(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const a=o[r];if(!(a==="_owner"&&e.$$typeof)&&!Mi(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function pm(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function gm(e,t){const n=pm(e);return Math.round(t*n)/n}function Al(e){const t=d.useRef(e);return Ei(()=>{t.current=e}),t}function eS(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:a,floating:i}={},transform:s=!0,whileElementsMounted:u,open:c}=e,[f,l]=d.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,m]=d.useState(r);Mi(h,r)||m(r);const[y,w]=d.useState(null),[v,p]=d.useState(null),g=d.useCallback(_=>{_!==S.current&&(S.current=_,w(_))},[]),b=d.useCallback(_=>{_!==E.current&&(E.current=_,p(_))},[]),C=a||y,x=i||v,S=d.useRef(null),E=d.useRef(null),M=d.useRef(f),k=u!=null,T=Al(u),R=Al(o),F=Al(c),V=d.useCallback(()=>{if(!S.current||!E.current)return;const _={placement:t,strategy:n,middleware:h};R.current&&(_.platform=R.current),Zx(S.current,E.current,_).then(z=>{const B={...z,isPositioned:F.current!==!1};$.current&&!Mi(M.current,B)&&(M.current=B,ku.flushSync(()=>{l(B)}))})},[h,t,n,R,F]);Ei(()=>{c===!1&&M.current.isPositioned&&(M.current.isPositioned=!1,l(_=>({..._,isPositioned:!1})))},[c]);const $=d.useRef(!1);Ei(()=>($.current=!0,()=>{$.current=!1}),[]),Ei(()=>{if(C&&(S.current=C),x&&(E.current=x),C&&x){if(T.current)return T.current(C,x,V);V()}},[C,x,V,T,k]);const L=d.useMemo(()=>({reference:S,floating:E,setReference:g,setFloating:b}),[g,b]),N=d.useMemo(()=>({reference:C,floating:x}),[C,x]),H=d.useMemo(()=>{const _={position:n,left:0,top:0};if(!N.floating)return _;const z=gm(N.floating,f.x),B=gm(N.floating,f.y);return s?{..._,transform:"translate("+z+"px, "+B+"px)",...pm(N.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:z,top:B}},[n,s,N.floating,f.x,f.y]);return d.useMemo(()=>({...f,update:V,refs:L,elements:N,floatingStyles:H}),[f,V,L,N,H])}const tS=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?hm({element:r.current,padding:o}).fn(n):{}:r?hm({element:r,padding:o}).fn(n):{}}}},nS=(e,t)=>({...Yx(e),options:[e,t]}),rS=(e,t)=>({...Ux(e),options:[e,t]}),oS=(e,t)=>({...Xx(e),options:[e,t]}),aS=(e,t)=>({...qx(e),options:[e,t]}),iS=(e,t)=>({...Gx(e),options:[e,t]}),sS=(e,t)=>({...Kx(e),options:[e,t]}),lS=(e,t)=>({...tS(e),options:[e,t]});var uS="Arrow",ym=d.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...a}=e;return P.jsx(gt.svg,{...a,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:P.jsx("polygon",{points:"0,0 30,0 15,10"})})});ym.displayName=uS;var cS=ym;function dS(e){const[t,n]=d.useState(void 0);return er(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const a=o[0];let i,s;if("borderBoxSize"in a){const u=a.borderBoxSize,c=Array.isArray(u)?u[0]:u;i=c.inlineSize,s=c.blockSize}else i=e.offsetWidth,s=e.offsetHeight;n({width:i,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Ll="Popper",[bm,vr]=Wn(Ll),[fS,wm]=bm(Ll),Cm=e=>{const{__scopePopper:t,children:n}=e,[r,o]=d.useState(null);return P.jsx(fS,{scope:t,anchor:r,onAnchorChange:o,children:n})};Cm.displayName=Ll;var xm="PopperAnchor",Sm=d.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,a=wm(xm,n),i=d.useRef(null),s=Pt(t,i);return d.useEffect(()=>{a.onAnchorChange((r==null?void 0:r.current)||i.current)}),r?null:P.jsx(gt.div,{...o,ref:s})});Sm.displayName=xm;var $l="PopperContent",[vS,mS]=bm($l),Em=d.forwardRef((e,t)=>{var J,G,q,Z,O,I,W,K;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:a="center",alignOffset:i=0,arrowPadding:s=0,avoidCollisions:u=!0,collisionBoundary:c=[],collisionPadding:f=0,sticky:l="partial",hideWhenDetached:h=!1,updatePositionStrategy:m="optimized",onPlaced:y,...w}=e,v=wm($l,n),[p,g]=d.useState(null),b=Pt(t,oe=>g(oe)),[C,x]=d.useState(null),S=dS(C),E=(J=S==null?void 0:S.width)!=null?J:0,M=(G=S==null?void 0:S.height)!=null?G:0,k=r+(a!=="center"?"-"+a:""),T=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},R=Array.isArray(c)?c:[c],F=R.length>0,V={padding:T,boundary:R.filter(pS),altBoundary:F},{refs:$,floatingStyles:L,placement:N,isPositioned:H,middlewareData:_}=eS({strategy:"fixed",placement:k,whileElementsMounted:(...oe)=>jx(...oe,{animationFrame:m==="always"}),elements:{reference:v.anchor},middleware:[nS({mainAxis:o+M,alignmentAxis:i}),u&&rS({mainAxis:!0,crossAxis:!1,limiter:l==="partial"?oS():void 0,...V}),u&&aS({...V}),iS({...V,apply:({elements:oe,rects:Q,availableWidth:ae,availableHeight:ee})=>{const{width:ie,height:ve}=Q.reference,ye=oe.floating.style;ye.setProperty("--radix-popper-available-width",`${ae}px`),ye.setProperty("--radix-popper-available-height",`${ee}px`),ye.setProperty("--radix-popper-anchor-width",`${ie}px`),ye.setProperty("--radix-popper-anchor-height",`${ve}px`)}}),C&&lS({element:C,padding:s}),gS({arrowWidth:E,arrowHeight:M}),h&&sS({strategy:"referenceHidden",...V})]}),[z,B]=Dm(N),A=Nn(y);er(()=>{H&&(A==null||A())},[H,A]);const j=(q=_.arrow)==null?void 0:q.x,Y=(Z=_.arrow)==null?void 0:Z.y,U=((O=_.arrow)==null?void 0:O.centerOffset)!==0,[ne,te]=d.useState();return er(()=>{p&&te(window.getComputedStyle(p).zIndex)},[p]),P.jsx("div",{ref:$.setFloating,"data-radix-popper-content-wrapper":"",style:{...L,transform:H?L.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ne,"--radix-popper-transform-origin":[(I=_.transformOrigin)==null?void 0:I.x,(W=_.transformOrigin)==null?void 0:W.y].join(" "),...((K=_.hide)==null?void 0:K.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:P.jsx(vS,{scope:n,placedSide:z,onArrowChange:x,arrowX:j,arrowY:Y,shouldHideArrow:U,children:P.jsx(gt.div,{"data-side":z,"data-align":B,...w,ref:b,style:{...w.style,animation:H?void 0:"none"}})})})});Em.displayName=$l;var Mm="PopperArrow",hS={top:"bottom",right:"left",bottom:"top",left:"right"},Pm=d.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,a=mS(Mm,r),i=hS[a.placedSide];return P.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:P.jsx(cS,{...o,ref:n,style:{...o.style,display:"block"}})})});Pm.displayName=Mm;function pS(e){return e!==null}var gS=e=>({name:"transformOrigin",options:e,fn(t){var v,p,g,b,C;const{placement:n,rects:r,middlewareData:o}=t,i=((v=o.arrow)==null?void 0:v.centerOffset)!==0,s=i?0:e.arrowWidth,u=i?0:e.arrowHeight,[c,f]=Dm(n),l={start:"0%",center:"50%",end:"100%"}[f],h=((g=(p=o.arrow)==null?void 0:p.x)!=null?g:0)+s/2,m=((C=(b=o.arrow)==null?void 0:b.y)!=null?C:0)+u/2;let y="",w="";return c==="bottom"?(y=i?l:`${h}px`,w=`${-u}px`):c==="top"?(y=i?l:`${h}px`,w=`${r.floating.height+u}px`):c==="right"?(y=`${-u}px`,w=i?l:`${m}px`):c==="left"&&(y=`${r.floating.width+u}px`,w=i?l:`${m}px`),{data:{x:y,y:w}}}});function Dm(e){const[t,n="center"]=e.split("-");return[t,n]}var Bo=Cm,jo=Sm,Pi=Em,Di=Pm,Fl="rovingFocusGroup.onEntryFocus",yS={bubbles:!1,cancelable:!0},Yo="RovingFocusGroup",[zl,km,bS]=Kv(Yo),[wS,_m]=Wn(Yo,[bS]),[CS,xS]=wS(Yo),Nm=d.forwardRef((e,t)=>P.jsx(zl.Provider,{scope:e.__scopeRovingFocusGroup,children:P.jsx(zl.Slot,{scope:e.__scopeRovingFocusGroup,children:P.jsx(SS,{...e,ref:t})})}));Nm.displayName=Yo;var SS=d.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:a,currentTabStopId:i,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:u,onEntryFocus:c,preventScrollOnEntryFocus:f=!1,...l}=e,h=d.useRef(null),m=Pt(t,h),y=Xv(a),[w,v]=xr({prop:i,defaultProp:s!=null?s:null,onChange:u,caller:Yo}),[p,g]=d.useState(!1),b=Nn(c),C=km(n),x=d.useRef(!1),[S,E]=d.useState(0);return d.useEffect(()=>{const M=h.current;if(M)return M.addEventListener(Fl,b),()=>M.removeEventListener(Fl,b)},[b]),P.jsx(CS,{scope:n,orientation:r,dir:y,loop:o,currentTabStopId:w,onItemFocus:d.useCallback(M=>v(M),[v]),onItemShiftTab:d.useCallback(()=>g(!0),[]),onFocusableItemAdd:d.useCallback(()=>E(M=>M+1),[]),onFocusableItemRemove:d.useCallback(()=>E(M=>M-1),[]),children:P.jsx(gt.div,{tabIndex:p||S===0?-1:0,"data-orientation":r,...l,ref:m,style:{outline:"none",...e.style},onMouseDown:Ie(e.onMouseDown,()=>{x.current=!0}),onFocus:Ie(e.onFocus,M=>{const k=!x.current;if(M.target===M.currentTarget&&k&&!p){const T=new CustomEvent(Fl,yS);if(M.currentTarget.dispatchEvent(T),!T.defaultPrevented){const R=C().filter(N=>N.focusable),F=R.find(N=>N.active),V=R.find(N=>N.id===w),L=[F,V,...R].filter(Boolean).map(N=>N.ref.current);Im(L,f)}}x.current=!1}),onBlur:Ie(e.onBlur,()=>g(!1))})})}),Om="RovingFocusGroupItem",Tm=d.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:a,children:i,...s}=e,u=_n(),c=a||u,f=xS(Om,n),l=f.currentTabStopId===c,h=km(n),{onFocusableItemAdd:m,onFocusableItemRemove:y,currentTabStopId:w}=f;return d.useEffect(()=>{if(r)return m(),()=>y()},[r,m,y]),P.jsx(zl.ItemSlot,{scope:n,id:c,focusable:r,active:o,children:P.jsx(gt.span,{tabIndex:l?0:-1,"data-orientation":f.orientation,...s,ref:t,onMouseDown:Ie(e.onMouseDown,v=>{r?f.onItemFocus(c):v.preventDefault()}),onFocus:Ie(e.onFocus,()=>f.onItemFocus(c)),onKeyDown:Ie(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){f.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const p=PS(v,f.orientation,f.dir);if(p!==void 0){if(v.metaKey||v.ctrlKey||v.altKey||v.shiftKey)return;v.preventDefault();let b=h().filter(C=>C.focusable).map(C=>C.ref.current);if(p==="last")b.reverse();else if(p==="prev"||p==="next"){p==="prev"&&b.reverse();const C=b.indexOf(v.currentTarget);b=f.loop?DS(b,C+1):b.slice(C+1)}setTimeout(()=>Im(b))}}),children:typeof i=="function"?i({isCurrentTabStop:l,hasTabStop:w!=null}):i})})});Tm.displayName=Om;var ES={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function MS(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function PS(e,t,n){const r=MS(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return ES[r]}function Im(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function DS(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var kS=Nm,_S=Tm,Hl=["Enter"," "],NS=["ArrowDown","PageUp","Home"],Rm=["ArrowUp","PageDown","End"],OS=[...NS,...Rm],TS={ltr:[...Hl,"ArrowRight"],rtl:[...Hl,"ArrowLeft"]},IS={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Uo="Menu",[qo,RS,AS]=Kv(Uo),[Nr,Am]=Wn(Uo,[AS,vr,_m]),Go=vr(),Lm=_m(),[$m,mr]=Nr(Uo),[LS,Ko]=Nr(Uo),Fm=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:a,modal:i=!0}=e,s=Go(t),[u,c]=d.useState(null),f=d.useRef(!1),l=Nn(a),h=Xv(o);return d.useEffect(()=>{const m=()=>{f.current=!0,document.addEventListener("pointerdown",y,{capture:!0,once:!0}),document.addEventListener("pointermove",y,{capture:!0,once:!0})},y=()=>f.current=!1;return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",y,{capture:!0}),document.removeEventListener("pointermove",y,{capture:!0})}},[]),P.jsx(Bo,{...s,children:P.jsx($m,{scope:t,open:n,onOpenChange:l,content:u,onContentChange:c,children:P.jsx(LS,{scope:t,onClose:d.useCallback(()=>l(!1),[l]),isUsingKeyboardRef:f,dir:h,modal:i,children:r})})})};Fm.displayName=Uo;var $S="MenuAnchor",Vl=d.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=Go(n);return P.jsx(jo,{...o,...r,ref:t})});Vl.displayName=$S;var Wl="MenuPortal",[FS,zm]=Nr(Wl,{forceMount:void 0}),Hm=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,a=mr(Wl,t);return P.jsx(FS,{scope:t,forceMount:n,children:P.jsx(on,{present:n||a.open,children:P.jsx(Hr,{asChild:!0,container:o,children:r})})})};Hm.displayName=Wl;var hn="MenuContent",[zS,Bl]=Nr(hn),Vm=d.forwardRef((e,t)=>{const n=zm(hn,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,a=mr(hn,e.__scopeMenu),i=Ko(hn,e.__scopeMenu);return P.jsx(qo.Provider,{scope:e.__scopeMenu,children:P.jsx(on,{present:r||a.open,children:P.jsx(qo.Slot,{scope:e.__scopeMenu,children:i.modal?P.jsx(HS,{...o,ref:t}):P.jsx(VS,{...o,ref:t})})})})}),HS=d.forwardRef((e,t)=>{const n=mr(hn,e.__scopeMenu),r=d.useRef(null),o=Pt(t,r);return d.useEffect(()=>{const a=r.current;if(a)return bs(a)},[]),P.jsx(jl,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Ie(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),VS=d.forwardRef((e,t)=>{const n=mr(hn,e.__scopeMenu);return P.jsx(jl,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),WS=wr("MenuContent.ScrollLock"),jl=d.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:a,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEntryFocus:u,onEscapeKeyDown:c,onPointerDownOutside:f,onFocusOutside:l,onInteractOutside:h,onDismiss:m,disableOutsideScroll:y,...w}=e,v=mr(hn,n),p=Ko(hn,n),g=Go(n),b=Lm(n),C=RS(n),[x,S]=d.useState(null),E=d.useRef(null),M=Pt(t,E,v.onContentChange),k=d.useRef(0),T=d.useRef(""),R=d.useRef(0),F=d.useRef(null),V=d.useRef("right"),$=d.useRef(0),L=y?Ca:d.Fragment,N=y?{as:WS,allowPinchZoom:!0}:void 0,H=z=>{var J,G;const B=T.current+z,A=C().filter(q=>!q.disabled),j=document.activeElement,Y=(J=A.find(q=>q.ref.current===j))==null?void 0:J.textValue,U=A.map(q=>q.textValue),ne=eE(U,B,Y),te=(G=A.find(q=>q.textValue===ne))==null?void 0:G.ref.current;(function q(Z){T.current=Z,window.clearTimeout(k.current),Z!==""&&(k.current=window.setTimeout(()=>q(""),1e3))})(B),te&&setTimeout(()=>te.focus())};d.useEffect(()=>()=>window.clearTimeout(k.current),[]),vs();const _=d.useCallback(z=>{var A,j;return V.current===((A=F.current)==null?void 0:A.side)&&nE(z,(j=F.current)==null?void 0:j.area)},[]);return P.jsx(zS,{scope:n,searchRef:T,onItemEnter:d.useCallback(z=>{_(z)&&z.preventDefault()},[_]),onItemLeave:d.useCallback(z=>{var B;_(z)||((B=E.current)==null||B.focus(),S(null))},[_]),onTriggerLeave:d.useCallback(z=>{_(z)&&z.preventDefault()},[_]),pointerGraceTimerRef:R,onPointerGraceIntentChange:d.useCallback(z=>{F.current=z},[]),children:P.jsx(L,{...N,children:P.jsx(ma,{asChild:!0,trapped:o,onMountAutoFocus:Ie(a,z=>{var B;z.preventDefault(),(B=E.current)==null||B.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:P.jsx(zr,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:c,onPointerDownOutside:f,onFocusOutside:l,onInteractOutside:h,onDismiss:m,children:P.jsx(kS,{asChild:!0,...b,dir:p.dir,orientation:"vertical",loop:r,currentTabStopId:x,onCurrentTabStopIdChange:S,onEntryFocus:Ie(u,z=>{p.isUsingKeyboardRef.current||z.preventDefault()}),preventScrollOnEntryFocus:!0,children:P.jsx(Pi,{role:"menu","aria-orientation":"vertical","data-state":ah(v.open),"data-radix-menu-content":"",dir:p.dir,...g,...w,ref:M,style:{outline:"none",...w.style},onKeyDown:Ie(w.onKeyDown,z=>{const A=z.target.closest("[data-radix-menu-content]")===z.currentTarget,j=z.ctrlKey||z.altKey||z.metaKey,Y=z.key.length===1;A&&(z.key==="Tab"&&z.preventDefault(),!j&&Y&&H(z.key));const U=E.current;if(z.target!==U||!OS.includes(z.key))return;z.preventDefault();const te=C().filter(J=>!J.disabled).map(J=>J.ref.current);Rm.includes(z.key)&&te.reverse(),QS(te)}),onBlur:Ie(e.onBlur,z=>{z.currentTarget.contains(z.target)||(window.clearTimeout(k.current),T.current="")}),onPointerMove:Ie(e.onPointerMove,Zo(z=>{const B=z.target,A=$.current!==z.clientX;if(z.currentTarget.contains(B)&&A){const j=z.clientX>$.current?"right":"left";V.current=j,$.current=z.clientX}}))})})})})})})});Vm.displayName=hn;var BS="MenuGroup",Yl=d.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return P.jsx(gt.div,{role:"group",...r,ref:t})});Yl.displayName=BS;var jS="MenuLabel",Wm=d.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return P.jsx(gt.div,{...r,ref:t})});Wm.displayName=jS;var ki="MenuItem",Bm="menu.itemSelect",_i=d.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,a=d.useRef(null),i=Ko(ki,e.__scopeMenu),s=Bl(ki,e.__scopeMenu),u=Pt(t,a),c=d.useRef(!1),f=()=>{const l=a.current;if(!n&&l){const h=new CustomEvent(Bm,{bubbles:!0,cancelable:!0});l.addEventListener(Bm,m=>r==null?void 0:r(m),{once:!0}),fc(l,h),h.defaultPrevented?c.current=!1:i.onClose()}};return P.jsx(jm,{...o,ref:u,disabled:n,onClick:Ie(e.onClick,f),onPointerDown:l=>{var h;(h=e.onPointerDown)==null||h.call(e,l),c.current=!0},onPointerUp:Ie(e.onPointerUp,l=>{var h;c.current||(h=l.currentTarget)==null||h.click()}),onKeyDown:Ie(e.onKeyDown,l=>{const h=s.searchRef.current!=="";n||h&&l.key===" "||Hl.includes(l.key)&&(l.currentTarget.click(),l.preventDefault())})})});_i.displayName=ki;var jm=d.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...a}=e,i=Bl(ki,n),s=Lm(n),u=d.useRef(null),c=Pt(t,u),[f,l]=d.useState(!1),[h,m]=d.useState("");return d.useEffect(()=>{var w;const y=u.current;y&&m(((w=y.textContent)!=null?w:"").trim())},[a.children]),P.jsx(qo.ItemSlot,{scope:n,disabled:r,textValue:o!=null?o:h,children:P.jsx(_S,{asChild:!0,...s,focusable:!r,children:P.jsx(gt.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...a,ref:c,onPointerMove:Ie(e.onPointerMove,Zo(y=>{r?i.onItemLeave(y):(i.onItemEnter(y),y.defaultPrevented||y.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Ie(e.onPointerLeave,Zo(y=>i.onItemLeave(y))),onFocus:Ie(e.onFocus,()=>l(!0)),onBlur:Ie(e.onBlur,()=>l(!1))})})})}),YS="MenuCheckboxItem",Ym=d.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return P.jsx(Xm,{scope:e.__scopeMenu,checked:n,children:P.jsx(_i,{role:"menuitemcheckbox","aria-checked":Ni(n)?"mixed":n,...o,ref:t,"data-state":Gl(n),onSelect:Ie(o.onSelect,()=>r==null?void 0:r(Ni(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Ym.displayName=YS;var Um="MenuRadioGroup",[US,qS]=Nr(Um,{value:void 0,onValueChange:()=>{}}),qm=d.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,a=Nn(r);return P.jsx(US,{scope:e.__scopeMenu,value:n,onValueChange:a,children:P.jsx(Yl,{...o,ref:t})})});qm.displayName=Um;var Gm="MenuRadioItem",Km=d.forwardRef((e,t)=>{const{value:n,...r}=e,o=qS(Gm,e.__scopeMenu),a=n===o.value;return P.jsx(Xm,{scope:e.__scopeMenu,checked:a,children:P.jsx(_i,{role:"menuitemradio","aria-checked":a,...r,ref:t,"data-state":Gl(a),onSelect:Ie(r.onSelect,()=>{var i;return(i=o.onValueChange)==null?void 0:i.call(o,n)},{checkForDefaultPrevented:!1})})})});Km.displayName=Gm;var Ul="MenuItemIndicator",[Xm,GS]=Nr(Ul,{checked:!1}),Zm=d.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,a=GS(Ul,n);return P.jsx(on,{present:r||Ni(a.checked)||a.checked===!0,children:P.jsx(gt.span,{...o,ref:t,"data-state":Gl(a.checked)})})});Zm.displayName=Ul;var KS="MenuSeparator",Qm=d.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return P.jsx(gt.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});Qm.displayName=KS;var XS="MenuArrow",Jm=d.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=Go(n);return P.jsx(Di,{...o,...r,ref:t})});Jm.displayName=XS;var ql="MenuSub",[ZS,eh]=Nr(ql),th=e=>{const{__scopeMenu:t,children:n,open:r=!1,onOpenChange:o}=e,a=mr(ql,t),i=Go(t),[s,u]=d.useState(null),[c,f]=d.useState(null),l=Nn(o);return d.useEffect(()=>(a.open===!1&&l(!1),()=>l(!1)),[a.open,l]),P.jsx(Bo,{...i,children:P.jsx($m,{scope:t,open:r,onOpenChange:l,content:c,onContentChange:f,children:P.jsx(ZS,{scope:t,contentId:_n(),triggerId:_n(),trigger:s,onTriggerChange:u,children:n})})})};th.displayName=ql;var Xo="MenuSubTrigger",nh=d.forwardRef((e,t)=>{const n=mr(Xo,e.__scopeMenu),r=Ko(Xo,e.__scopeMenu),o=eh(Xo,e.__scopeMenu),a=Bl(Xo,e.__scopeMenu),i=d.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:u}=a,c={__scopeMenu:e.__scopeMenu},f=d.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return d.useEffect(()=>f,[f]),d.useEffect(()=>{const l=s.current;return()=>{window.clearTimeout(l),u(null)}},[s,u]),P.jsx(Vl,{asChild:!0,...c,children:P.jsx(jm,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":ah(n.open),...e,ref:fa(t,o.onTriggerChange),onClick:l=>{var h;(h=e.onClick)==null||h.call(e,l),!(e.disabled||l.defaultPrevented)&&(l.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Ie(e.onPointerMove,Zo(l=>{a.onItemEnter(l),!l.defaultPrevented&&!e.disabled&&!n.open&&!i.current&&(a.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{n.onOpenChange(!0),f()},100))})),onPointerLeave:Ie(e.onPointerLeave,Zo(l=>{var m,y;f();const h=(m=n.content)==null?void 0:m.getBoundingClientRect();if(h){const w=(y=n.content)==null?void 0:y.dataset.side,v=w==="right",p=v?-5:5,g=h[v?"left":"right"],b=h[v?"right":"left"];a.onPointerGraceIntentChange({area:[{x:l.clientX+p,y:l.clientY},{x:g,y:h.top},{x:b,y:h.top},{x:b,y:h.bottom},{x:g,y:h.bottom}],side:w}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(l),l.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:Ie(e.onKeyDown,l=>{var m;const h=a.searchRef.current!=="";e.disabled||h&&l.key===" "||TS[r.dir].includes(l.key)&&(n.onOpenChange(!0),(m=n.content)==null||m.focus(),l.preventDefault())})})})});nh.displayName=Xo;var rh="MenuSubContent",oh=d.forwardRef((e,t)=>{const n=zm(hn,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,a=mr(hn,e.__scopeMenu),i=Ko(hn,e.__scopeMenu),s=eh(rh,e.__scopeMenu),u=d.useRef(null),c=Pt(t,u);return P.jsx(qo.Provider,{scope:e.__scopeMenu,children:P.jsx(on,{present:r||a.open,children:P.jsx(qo.Slot,{scope:e.__scopeMenu,children:P.jsx(jl,{id:s.contentId,"aria-labelledby":s.triggerId,...o,ref:c,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{var l;i.isUsingKeyboardRef.current&&((l=u.current)==null||l.focus()),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:Ie(e.onFocusOutside,f=>{f.target!==s.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:Ie(e.onEscapeKeyDown,f=>{i.onClose(),f.preventDefault()}),onKeyDown:Ie(e.onKeyDown,f=>{var m;const l=f.currentTarget.contains(f.target),h=IS[i.dir].includes(f.key);l&&h&&(a.onOpenChange(!1),(m=s.trigger)==null||m.focus(),f.preventDefault())})})})})})});oh.displayName=rh;function ah(e){return e?"open":"closed"}function Ni(e){return e==="indeterminate"}function Gl(e){return Ni(e)?"indeterminate":e?"checked":"unchecked"}function QS(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function JS(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function eE(e,t,n){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,a=n?e.indexOf(n):-1;let i=JS(e,Math.max(a,0));o.length===1&&(i=i.filter(c=>c!==n));const u=i.find(c=>c.toLowerCase().startsWith(o.toLowerCase()));return u!==n?u:void 0}function tE(e,t){const{x:n,y:r}=e;let o=!1;for(let a=0,i=t.length-1;a<t.length;i=a++){const s=t[a],u=t[i],c=s.x,f=s.y,l=u.x,h=u.y;f>r!=h>r&&n<(l-c)*(r-f)/(h-f)+c&&(o=!o)}return o}function nE(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return tE(n,t)}function Zo(e){return t=>t.pointerType==="mouse"?e(t):void 0}var rE=Fm,oE=Vl,aE=Hm,iE=Vm,sE=Yl,lE=Wm,uE=_i,cE=Ym,dE=qm,fE=Km,vE=Zm,mE=Qm,hE=Jm,pE=th,gE=nh,yE=oh,Oi="DropdownMenu",[bE,TD]=Wn(Oi,[Am]),qt=Am(),[wE,ih]=bE(Oi),sh=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:a,onOpenChange:i,modal:s=!0}=e,u=qt(t),c=d.useRef(null),[f,l]=xr({prop:o,defaultProp:a!=null?a:!1,onChange:i,caller:Oi});return P.jsx(wE,{scope:t,triggerId:_n(),triggerRef:c,contentId:_n(),open:f,onOpenChange:l,onOpenToggle:d.useCallback(()=>l(h=>!h),[l]),modal:s,children:P.jsx(rE,{...u,open:f,onOpenChange:l,dir:r,modal:s,children:n})})};sh.displayName=Oi;var lh="DropdownMenuTrigger",uh=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,a=ih(lh,n),i=qt(n);return P.jsx(oE,{asChild:!0,...i,children:P.jsx(gt.button,{type:"button",id:a.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:fa(t,a.triggerRef),onPointerDown:Ie(e.onPointerDown,s=>{!r&&s.button===0&&s.ctrlKey===!1&&(a.onOpenToggle(),a.open||s.preventDefault())}),onKeyDown:Ie(e.onKeyDown,s=>{r||(["Enter"," "].includes(s.key)&&a.onOpenToggle(),s.key==="ArrowDown"&&a.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(s.key)&&s.preventDefault())})})})});uh.displayName=lh;var CE="DropdownMenuPortal",ch=e=>{const{__scopeDropdownMenu:t,...n}=e,r=qt(t);return P.jsx(aE,{...r,...n})};ch.displayName=CE;var dh="DropdownMenuContent",fh=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ih(dh,n),a=qt(n),i=d.useRef(!1);return P.jsx(iE,{id:o.contentId,"aria-labelledby":o.triggerId,...a,...r,ref:t,onCloseAutoFocus:Ie(e.onCloseAutoFocus,s=>{var u;i.current||(u=o.triggerRef.current)==null||u.focus(),i.current=!1,s.preventDefault()}),onInteractOutside:Ie(e.onInteractOutside,s=>{const u=s.detail.originalEvent,c=u.button===0&&u.ctrlKey===!0,f=u.button===2||c;(!o.modal||f)&&(i.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});fh.displayName=dh;var xE="DropdownMenuGroup",SE=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=qt(n);return P.jsx(sE,{...o,...r,ref:t})});SE.displayName=xE;var EE="DropdownMenuLabel",ME=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=qt(n);return P.jsx(lE,{...o,...r,ref:t})});ME.displayName=EE;var PE="DropdownMenuItem",vh=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=qt(n);return P.jsx(uE,{...o,...r,ref:t})});vh.displayName=PE;var DE="DropdownMenuCheckboxItem",mh=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=qt(n);return P.jsx(cE,{...o,...r,ref:t})});mh.displayName=DE;var kE="DropdownMenuRadioGroup",hh=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=qt(n);return P.jsx(dE,{...o,...r,ref:t})});hh.displayName=kE;var _E="DropdownMenuRadioItem",ph=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=qt(n);return P.jsx(fE,{...o,...r,ref:t})});ph.displayName=_E;var NE="DropdownMenuItemIndicator",gh=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=qt(n);return P.jsx(vE,{...o,...r,ref:t})});gh.displayName=NE;var OE="DropdownMenuSeparator",yh=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=qt(n);return P.jsx(mE,{...o,...r,ref:t})});yh.displayName=OE;var TE="DropdownMenuArrow",IE=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=qt(n);return P.jsx(hE,{...o,...r,ref:t})});IE.displayName=TE;var RE=e=>{const{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:o,defaultOpen:a}=e,i=qt(t),[s,u]=xr({prop:r,defaultProp:a!=null?a:!1,onChange:o,caller:"DropdownMenuSub"});return P.jsx(pE,{...i,open:s,onOpenChange:u,children:n})},AE="DropdownMenuSubTrigger",bh=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=qt(n);return P.jsx(gE,{...o,...r,ref:t})});bh.displayName=AE;var LE="DropdownMenuSubContent",wh=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=qt(n);return P.jsx(yE,{...o,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});wh.displayName=LE;var $E=sh,FE=uh,Ch=ch,zE=fh,HE=vh,VE=mh,WE=hh,BE=ph,xh=gh,jE=yh,YE=RE,UE=bh,qE=wh;function GE({...e}){return P.jsx($E,{"data-slot":"dropdown-menu",...e})}function KE({...e}){return P.jsx(Ch,{"data-slot":"dropdown-menu-portal",...e})}function XE({...e}){return P.jsx(FE,{"data-slot":"dropdown-menu-trigger",...e})}function ZE({...e}){return P.jsx(YE,{"data-slot":"dropdown-menu-sub",...e})}function QE({...e}){return P.jsx(WE,{"data-slot":"dropdown-menu-radio-group",...e})}function JE({className:e,inset:t,children:n,...r}){return P.jsxs(UE,{"data-slot":"dropdown-menu-sub-trigger","data-inset":t,className:Se(`
1398
+ `,E.getElementsByTagName("head")[0].appendChild(M)),E.body&&x(E.body,"react-draggable-transparent-selection")}function C(E){if(E)try{if(E.body&&S(E.body,"react-draggable-transparent-selection"),E.selection)E.selection.empty();else{const M=(E.defaultView||window).getSelection();M&&M.type!=="Caret"&&M.removeAllRanges()}}catch{}}function x(E,M){E.classList?E.classList.add(M):E.className.match(new RegExp("(?:^|\\s)".concat(M,"(?!\\S)")))||(E.className+=" ".concat(M))}function S(E,M){E.classList?E.classList.remove(M):E.className=E.className.replace(new RegExp("(?:^|\\s)".concat(M,"(?!\\S)"),"g"),"")}return Nt}var In={},Sv;function Ev(){if(Sv)return In;Sv=1,Object.defineProperty(In,"__esModule",{value:!0}),In.canDragX=o,In.canDragY=a,In.createCoreData=s,In.createDraggableData=u,In.getBoundPosition=n,In.getControlPosition=i,In.snapToGrid=r;var e=vi(),t=xl();function n(l,h,m){if(!l.props.bounds)return[h,m];let{bounds:y}=l.props;y=typeof y=="string"?y:c(y);const w=d(l);if(typeof y=="string"){const{ownerDocument:v}=w,p=v.defaultView;let g;if(y==="parent"?g=w.parentNode:g=v.querySelector(y),!(g instanceof p.HTMLElement))throw new Error('Bounds selector "'+y+'" could not find an element.');const b=g,C=p.getComputedStyle(w),x=p.getComputedStyle(b);y={left:-w.offsetLeft+(0,e.int)(x.paddingLeft)+(0,e.int)(C.marginLeft),top:-w.offsetTop+(0,e.int)(x.paddingTop)+(0,e.int)(C.marginTop),right:(0,t.innerWidth)(b)-(0,t.outerWidth)(w)-w.offsetLeft+(0,e.int)(x.paddingRight)-(0,e.int)(C.marginRight),bottom:(0,t.innerHeight)(b)-(0,t.outerHeight)(w)-w.offsetTop+(0,e.int)(x.paddingBottom)-(0,e.int)(C.marginBottom)}}return(0,e.isNum)(y.right)&&(h=Math.min(h,y.right)),(0,e.isNum)(y.bottom)&&(m=Math.min(m,y.bottom)),(0,e.isNum)(y.left)&&(h=Math.max(h,y.left)),(0,e.isNum)(y.top)&&(m=Math.max(m,y.top)),[h,m]}function r(l,h,m){const y=Math.round(h/l[0])*l[0],w=Math.round(m/l[1])*l[1];return[y,w]}function o(l){return l.props.axis==="both"||l.props.axis==="x"}function a(l){return l.props.axis==="both"||l.props.axis==="y"}function i(l,h,m){const y=typeof h=="number"?(0,t.getTouch)(l,h):null;if(typeof h=="number"&&!y)return null;const w=d(m),v=m.props.offsetParent||w.offsetParent||w.ownerDocument.body;return(0,t.offsetXYFromParent)(y||l,v,m.props.scale)}function s(l,h,m){const y=!(0,e.isNum)(l.lastX),w=d(l);return y?{node:w,deltaX:0,deltaY:0,lastX:h,lastY:m,x:h,y:m}:{node:w,deltaX:h-l.lastX,deltaY:m-l.lastY,lastX:l.lastX,lastY:l.lastY,x:h,y:m}}function u(l,h){const m=l.props.scale;return{node:h.node,x:l.state.x+h.deltaX/m,y:l.state.y+h.deltaY/m,deltaX:h.deltaX/m,deltaY:h.deltaY/m,lastX:l.state.x,lastY:l.state.y}}function c(l){return{left:l.left,top:l.top,right:l.right,bottom:l.bottom}}function d(l){const h=l.findDOMNode();if(!h)throw new Error("<DraggableCore>: Unmounted during event!");return h}return In}var Ro={},mi={},Mv;function Pv(){if(Mv)return mi;Mv=1,Object.defineProperty(mi,"__esModule",{value:!0}),mi.default=e;function e(){}return mi}var Dv;function OC(){if(Dv)return Ro;Dv=1,Object.defineProperty(Ro,"__esModule",{value:!0}),Ro.default=void 0;var e=c(D),t=s(ur()),n=s(It),r=xl(),o=Ev(),a=vi(),i=s(Pv());function s(v){return v&&v.__esModule?v:{default:v}}function u(v){if(typeof WeakMap!="function")return null;var p=new WeakMap,g=new WeakMap;return(u=function(b){return b?g:p})(v)}function c(v,p){if(v&&v.__esModule)return v;if(v===null||typeof v!="object"&&typeof v!="function")return{default:v};var g=u(p);if(g&&g.has(v))return g.get(v);var b={},C=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var x in v)if(x!=="default"&&Object.prototype.hasOwnProperty.call(v,x)){var S=C?Object.getOwnPropertyDescriptor(v,x):null;S&&(S.get||S.set)?Object.defineProperty(b,x,S):b[x]=v[x]}return b.default=v,g&&g.set(v,b),b}function d(v,p,g){return p=l(p),p in v?Object.defineProperty(v,p,{value:g,enumerable:!0,configurable:!0,writable:!0}):v[p]=g,v}function l(v){var p=h(v,"string");return typeof p=="symbol"?p:String(p)}function h(v,p){if(typeof v!="object"||v===null)return v;var g=v[Symbol.toPrimitive];if(g!==void 0){var b=g.call(v,p);if(typeof b!="object")return b;throw new TypeError("@@toPrimitive must return a primitive value.")}return(p==="string"?String:Number)(v)}const m={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let y=m.mouse,w=class extends e.Component{constructor(){super(...arguments),d(this,"dragging",!1),d(this,"lastX",NaN),d(this,"lastY",NaN),d(this,"touchIdentifier",null),d(this,"mounted",!1),d(this,"handleDragStart",p=>{if(this.props.onMouseDown(p),!this.props.allowAnyClick&&typeof p.button=="number"&&p.button!==0)return!1;const g=this.findDOMNode();if(!g||!g.ownerDocument||!g.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:b}=g;if(this.props.disabled||!(p.target instanceof b.defaultView.Node)||this.props.handle&&!(0,r.matchesSelectorAndParentsTo)(p.target,this.props.handle,g)||this.props.cancel&&(0,r.matchesSelectorAndParentsTo)(p.target,this.props.cancel,g))return;p.type==="touchstart"&&p.preventDefault();const C=(0,r.getTouchIdentifier)(p);this.touchIdentifier=C;const x=(0,o.getControlPosition)(p,C,this);if(x==null)return;const{x:S,y:E}=x,M=(0,o.createCoreData)(this,S,E);(0,i.default)("DraggableCore: handleDragStart: %j",M),(0,i.default)("calling",this.props.onStart),!(this.props.onStart(p,M)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,r.addUserSelectStyles)(b),this.dragging=!0,this.lastX=S,this.lastY=E,(0,r.addEvent)(b,y.move,this.handleDrag),(0,r.addEvent)(b,y.stop,this.handleDragStop))}),d(this,"handleDrag",p=>{const g=(0,o.getControlPosition)(p,this.touchIdentifier,this);if(g==null)return;let{x:b,y:C}=g;if(Array.isArray(this.props.grid)){let E=b-this.lastX,M=C-this.lastY;if([E,M]=(0,o.snapToGrid)(this.props.grid,E,M),!E&&!M)return;b=this.lastX+E,C=this.lastY+M}const x=(0,o.createCoreData)(this,b,C);if((0,i.default)("DraggableCore: handleDrag: %j",x),this.props.onDrag(p,x)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const M=document.createEvent("MouseEvents");M.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(M)}return}this.lastX=b,this.lastY=C}),d(this,"handleDragStop",p=>{if(!this.dragging)return;const g=(0,o.getControlPosition)(p,this.touchIdentifier,this);if(g==null)return;let{x:b,y:C}=g;if(Array.isArray(this.props.grid)){let M=b-this.lastX||0,k=C-this.lastY||0;[M,k]=(0,o.snapToGrid)(this.props.grid,M,k),b=this.lastX+M,C=this.lastY+k}const x=(0,o.createCoreData)(this,b,C);if(this.props.onStop(p,x)===!1||this.mounted===!1)return!1;const E=this.findDOMNode();E&&this.props.enableUserSelectHack&&(0,r.removeUserSelectStyles)(E.ownerDocument),(0,i.default)("DraggableCore: handleDragStop: %j",x),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,E&&((0,i.default)("DraggableCore: Removing handlers"),(0,r.removeEvent)(E.ownerDocument,y.move,this.handleDrag),(0,r.removeEvent)(E.ownerDocument,y.stop,this.handleDragStop))}),d(this,"onMouseDown",p=>(y=m.mouse,this.handleDragStart(p))),d(this,"onMouseUp",p=>(y=m.mouse,this.handleDragStop(p))),d(this,"onTouchStart",p=>(y=m.touch,this.handleDragStart(p))),d(this,"onTouchEnd",p=>(y=m.touch,this.handleDragStop(p)))}componentDidMount(){this.mounted=!0;const p=this.findDOMNode();p&&(0,r.addEvent)(p,m.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const p=this.findDOMNode();if(p){const{ownerDocument:g}=p;(0,r.removeEvent)(g,m.mouse.move,this.handleDrag),(0,r.removeEvent)(g,m.touch.move,this.handleDrag),(0,r.removeEvent)(g,m.mouse.stop,this.handleDragStop),(0,r.removeEvent)(g,m.touch.stop,this.handleDragStop),(0,r.removeEvent)(p,m.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,r.removeUserSelectStyles)(g)}}findDOMNode(){var p,g;return(p=this.props)!==null&&p!==void 0&&p.nodeRef?(g=this.props)===null||g===void 0||(g=g.nodeRef)===null||g===void 0?void 0:g.current:n.default.findDOMNode(this)}render(){return e.cloneElement(e.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};return Ro.default=w,d(w,"displayName","DraggableCore"),d(w,"propTypes",{allowAnyClick:t.default.bool,children:t.default.node.isRequired,disabled:t.default.bool,enableUserSelectHack:t.default.bool,offsetParent:function(v,p){if(v[p]&&v[p].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:t.default.arrayOf(t.default.number),handle:t.default.string,cancel:t.default.string,nodeRef:t.default.object,onStart:t.default.func,onDrag:t.default.func,onStop:t.default.func,onMouseDown:t.default.func,scale:t.default.number,className:a.dontSetMe,style:a.dontSetMe,transform:a.dontSetMe}),d(w,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),Ro}var kv;function TC(){return kv||(kv=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return u.default}}),e.default=void 0;var t=h(D),n=d(ur()),r=d(It),o=d(NC),a=xl(),i=Ev(),s=vi(),u=d(OC()),c=d(Pv());function d(g){return g&&g.__esModule?g:{default:g}}function l(g){if(typeof WeakMap!="function")return null;var b=new WeakMap,C=new WeakMap;return(l=function(x){return x?C:b})(g)}function h(g,b){if(g&&g.__esModule)return g;if(g===null||typeof g!="object"&&typeof g!="function")return{default:g};var C=l(b);if(C&&C.has(g))return C.get(g);var x={},S=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var E in g)if(E!=="default"&&Object.prototype.hasOwnProperty.call(g,E)){var M=S?Object.getOwnPropertyDescriptor(g,E):null;M&&(M.get||M.set)?Object.defineProperty(x,E,M):x[E]=g[E]}return x.default=g,C&&C.set(g,x),x}function m(){return m=Object.assign?Object.assign.bind():function(g){for(var b=1;b<arguments.length;b++){var C=arguments[b];for(var x in C)Object.prototype.hasOwnProperty.call(C,x)&&(g[x]=C[x])}return g},m.apply(this,arguments)}function y(g,b,C){return b=w(b),b in g?Object.defineProperty(g,b,{value:C,enumerable:!0,configurable:!0,writable:!0}):g[b]=C,g}function w(g){var b=v(g,"string");return typeof b=="symbol"?b:String(b)}function v(g,b){if(typeof g!="object"||g===null)return g;var C=g[Symbol.toPrimitive];if(C!==void 0){var x=C.call(g,b);if(typeof x!="object")return x;throw new TypeError("@@toPrimitive must return a primitive value.")}return(b==="string"?String:Number)(g)}class p extends t.Component{static getDerivedStateFromProps(b,C){let{position:x}=b,{prevPropsPosition:S}=C;return x&&(!S||x.x!==S.x||x.y!==S.y)?((0,c.default)("Draggable: getDerivedStateFromProps %j",{position:x,prevPropsPosition:S}),{x:x.x,y:x.y,prevPropsPosition:{...x}}):null}constructor(b){super(b),y(this,"onDragStart",(C,x)=>{if((0,c.default)("Draggable: onDragStart: %j",x),this.props.onStart(C,(0,i.createDraggableData)(this,x))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),y(this,"onDrag",(C,x)=>{if(!this.state.dragging)return!1;(0,c.default)("Draggable: onDrag: %j",x);const S=(0,i.createDraggableData)(this,x),E={x:S.x,y:S.y,slackX:0,slackY:0};if(this.props.bounds){const{x:k,y:T}=E;E.x+=this.state.slackX,E.y+=this.state.slackY;const[R,F]=(0,i.getBoundPosition)(this,E.x,E.y);E.x=R,E.y=F,E.slackX=this.state.slackX+(k-E.x),E.slackY=this.state.slackY+(T-E.y),S.x=E.x,S.y=E.y,S.deltaX=E.x-this.state.x,S.deltaY=E.y-this.state.y}if(this.props.onDrag(C,S)===!1)return!1;this.setState(E)}),y(this,"onDragStop",(C,x)=>{if(!this.state.dragging||this.props.onStop(C,(0,i.createDraggableData)(this,x))===!1)return!1;(0,c.default)("Draggable: onDragStop: %j",x);const E={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:k,y:T}=this.props.position;E.x=k,E.y=T}this.setState(E)}),this.state={dragging:!1,dragged:!1,x:b.position?b.position.x:b.defaultPosition.x,y:b.position?b.position.y:b.defaultPosition.y,prevPropsPosition:{...b.position},slackX:0,slackY:0,isElementSVG:!1},b.position&&!(b.onDrag||b.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var b,C;return(b=(C=this.props)===null||C===void 0||(C=C.nodeRef)===null||C===void 0?void 0:C.current)!==null&&b!==void 0?b:r.default.findDOMNode(this)}render(){const{axis:b,bounds:C,children:x,defaultPosition:S,defaultClassName:E,defaultClassNameDragging:M,defaultClassNameDragged:k,position:T,positionOffset:R,scale:F,...V}=this.props;let $={},L=null;const H=!!!T||this.state.dragging,N=T||S,z={x:(0,i.canDragX)(this)&&H?this.state.x:N.x,y:(0,i.canDragY)(this)&&H?this.state.y:N.y};this.state.isElementSVG?L=(0,a.createSVGTransform)(z,R):$=(0,a.createCSSTransform)(z,R);const B=(0,o.default)(x.props.className||"",E,{[M]:this.state.dragging,[k]:this.state.dragged});return t.createElement(u.default,m({},V,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(x),{className:B,style:{...x.props.style,...$},transform:L}))}}e.default=p,y(p,"displayName","Draggable"),y(p,"propTypes",{...u.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:s.dontSetMe,style:s.dontSetMe,transform:s.dontSetMe}),y(p,"defaultProps",{...u.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})}(Cl)),Cl}var Nv;function Sl(){if(Nv)return Io.exports;Nv=1;const{default:e,DraggableCore:t}=TC();return Io.exports=e,Io.exports.default=e,Io.exports.DraggableCore=t,Io.exports}var Ao={exports:{}},Lo={},hi={},_v;function IC(){if(_v)return hi;_v=1,hi.__esModule=!0,hi.cloneElement=s;var e=t(D);function t(u){return u&&u.__esModule?u:{default:u}}function n(u,c){var d=Object.keys(u);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(u);c&&(l=l.filter(function(h){return Object.getOwnPropertyDescriptor(u,h).enumerable})),d.push.apply(d,l)}return d}function r(u){for(var c=1;c<arguments.length;c++){var d=arguments[c]!=null?arguments[c]:{};c%2?n(Object(d),!0).forEach(function(l){o(u,l,d[l])}):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(d)):n(Object(d)).forEach(function(l){Object.defineProperty(u,l,Object.getOwnPropertyDescriptor(d,l))})}return u}function o(u,c,d){return c=a(c),c in u?Object.defineProperty(u,c,{value:d,enumerable:!0,configurable:!0,writable:!0}):u[c]=d,u}function a(u){var c=i(u,"string");return typeof c=="symbol"?c:String(c)}function i(u,c){if(typeof u!="object"||u===null)return u;var d=u[Symbol.toPrimitive];if(d!==void 0){var l=d.call(u,c);if(typeof l!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(c==="string"?String:Number)(u)}function s(u,c){return c.style&&u.props.style&&(c.style=r(r({},u.props.style),c.style)),c.className&&u.props.className&&(c.className=u.props.className+" "+c.className),e.default.cloneElement(u,c)}return hi}var $o={},Ov;function Tv(){if(Ov)return $o;Ov=1,$o.__esModule=!0,$o.resizableProps=void 0;var e=t(ur());Sl();function t(r){return r&&r.__esModule?r:{default:r}}var n={axis:e.default.oneOf(["both","x","y","none"]),className:e.default.string,children:e.default.element.isRequired,draggableOpts:e.default.shape({allowAnyClick:e.default.bool,cancel:e.default.string,children:e.default.node,disabled:e.default.bool,enableUserSelectHack:e.default.bool,offsetParent:e.default.node,grid:e.default.arrayOf(e.default.number),handle:e.default.string,nodeRef:e.default.object,onStart:e.default.func,onDrag:e.default.func,onStop:e.default.func,onMouseDown:e.default.func,scale:e.default.number}),height:function(){for(var o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];var s=a[0];if(s.axis==="both"||s.axis==="y"){var u;return(u=e.default.number).isRequired.apply(u,a)}return e.default.number.apply(e.default,a)},handle:e.default.oneOfType([e.default.node,e.default.func]),handleSize:e.default.arrayOf(e.default.number),lockAspectRatio:e.default.bool,maxConstraints:e.default.arrayOf(e.default.number),minConstraints:e.default.arrayOf(e.default.number),onResizeStop:e.default.func,onResizeStart:e.default.func,onResize:e.default.func,resizeHandles:e.default.arrayOf(e.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:e.default.number,width:function(){for(var o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];var s=a[0];if(s.axis==="both"||s.axis==="x"){var u;return(u=e.default.number).isRequired.apply(u,a)}return e.default.number.apply(e.default,a)}};return $o.resizableProps=n,$o}var Iv;function Rv(){if(Iv)return Lo;Iv=1,Lo.__esModule=!0,Lo.default=void 0;var e=i(D),t=Sl(),n=IC(),r=Tv(),o=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function a(p){if(typeof WeakMap!="function")return null;var g=new WeakMap,b=new WeakMap;return(a=function(x){return x?b:g})(p)}function i(p,g){if(p&&p.__esModule)return p;if(p===null||typeof p!="object"&&typeof p!="function")return{default:p};var b=a(g);if(b&&b.has(p))return b.get(p);var C={},x=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var S in p)if(S!=="default"&&Object.prototype.hasOwnProperty.call(p,S)){var E=x?Object.getOwnPropertyDescriptor(p,S):null;E&&(E.get||E.set)?Object.defineProperty(C,S,E):C[S]=p[S]}return C.default=p,b&&b.set(p,C),C}function s(){return s=Object.assign?Object.assign.bind():function(p){for(var g=1;g<arguments.length;g++){var b=arguments[g];for(var C in b)Object.prototype.hasOwnProperty.call(b,C)&&(p[C]=b[C])}return p},s.apply(this,arguments)}function u(p,g){if(p==null)return{};var b={},C=Object.keys(p),x,S;for(S=0;S<C.length;S++)x=C[S],!(g.indexOf(x)>=0)&&(b[x]=p[x]);return b}function c(p,g){var b=Object.keys(p);if(Object.getOwnPropertySymbols){var C=Object.getOwnPropertySymbols(p);g&&(C=C.filter(function(x){return Object.getOwnPropertyDescriptor(p,x).enumerable})),b.push.apply(b,C)}return b}function d(p){for(var g=1;g<arguments.length;g++){var b=arguments[g]!=null?arguments[g]:{};g%2?c(Object(b),!0).forEach(function(C){l(p,C,b[C])}):Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(b)):c(Object(b)).forEach(function(C){Object.defineProperty(p,C,Object.getOwnPropertyDescriptor(b,C))})}return p}function l(p,g,b){return g=h(g),g in p?Object.defineProperty(p,g,{value:b,enumerable:!0,configurable:!0,writable:!0}):p[g]=b,p}function h(p){var g=m(p,"string");return typeof g=="symbol"?g:String(g)}function m(p,g){if(typeof p!="object"||p===null)return p;var b=p[Symbol.toPrimitive];if(b!==void 0){var C=b.call(p,g);if(typeof C!="object")return C;throw new TypeError("@@toPrimitive must return a primitive value.")}return(g==="string"?String:Number)(p)}function y(p,g){p.prototype=Object.create(g.prototype),p.prototype.constructor=p,w(p,g)}function w(p,g){return w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(C,x){return C.__proto__=x,C},w(p,g)}var v=function(p){y(g,p);function g(){for(var C,x=arguments.length,S=new Array(x),E=0;E<x;E++)S[E]=arguments[E];return C=p.call.apply(p,[this].concat(S))||this,C.handleRefs={},C.lastHandleRect=null,C.slack=null,C}var b=g.prototype;return b.componentWillUnmount=function(){this.resetData()},b.resetData=function(){this.lastHandleRect=this.slack=null},b.runConstraints=function(x,S){var E=this.props,M=E.minConstraints,k=E.maxConstraints,T=E.lockAspectRatio;if(!M&&!k&&!T)return[x,S];if(T){var R=this.props.width/this.props.height,F=x-this.props.width,V=S-this.props.height;Math.abs(F)>Math.abs(V*R)?S=x/R:x=S*R}var $=x,L=S,_=this.slack||[0,0],H=_[0],N=_[1];return x+=H,S+=N,M&&(x=Math.max(M[0],x),S=Math.max(M[1],S)),k&&(x=Math.min(k[0],x),S=Math.min(k[1],S)),this.slack=[H+($-x),N+(L-S)],[x,S]},b.resizeHandler=function(x,S){var E=this;return function(M,k){var T=k.node,R=k.deltaX,F=k.deltaY;x==="onResizeStart"&&E.resetData();var V=(E.props.axis==="both"||E.props.axis==="x")&&S!=="n"&&S!=="s",$=(E.props.axis==="both"||E.props.axis==="y")&&S!=="e"&&S!=="w";if(!(!V&&!$)){var L=S[0],_=S[S.length-1],H=T.getBoundingClientRect();if(E.lastHandleRect!=null){if(_==="w"){var N=H.left-E.lastHandleRect.left;R+=N}if(L==="n"){var z=H.top-E.lastHandleRect.top;F+=z}}E.lastHandleRect=H,_==="w"&&(R=-R),L==="n"&&(F=-F);var B=E.props.width+(V?R/E.props.transformScale:0),A=E.props.height+($?F/E.props.transformScale:0),j=E.runConstraints(B,A);B=j[0],A=j[1];var Y=B!==E.props.width||A!==E.props.height,U=typeof E.props[x]=="function"?E.props[x]:null,ne=x==="onResize"&&!Y;U&&!ne&&(M.persist==null||M.persist(),U(M,{node:T,size:{width:B,height:A},handle:S})),x==="onResizeStop"&&E.resetData()}}},b.renderResizeHandle=function(x,S){var E=this.props.handle;if(!E)return e.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+x,ref:S});if(typeof E=="function")return E(x,S);var M=typeof E.type=="string",k=d({ref:S},M?{}:{handleAxis:x});return e.cloneElement(E,k)},b.render=function(){var x=this,S=this.props,E=S.children,M=S.className,k=S.draggableOpts;S.width,S.height,S.handle,S.handleSize,S.lockAspectRatio,S.axis,S.minConstraints,S.maxConstraints,S.onResize,S.onResizeStop,S.onResizeStart;var T=S.resizeHandles;S.transformScale;var R=u(S,o);return(0,n.cloneElement)(E,d(d({},R),{},{className:(M?M+" ":"")+"react-resizable",children:[].concat(E.props.children,T.map(function(F){var V,$=(V=x.handleRefs[F])!=null?V:x.handleRefs[F]=e.createRef();return e.createElement(t.DraggableCore,s({},k,{nodeRef:$,key:"resizableHandle-"+F,onStop:x.resizeHandler("onResizeStop",F),onStart:x.resizeHandler("onResizeStart",F),onDrag:x.resizeHandler("onResize",F)}),x.renderResizeHandle(F,$))}))}))},g}(e.Component);return Lo.default=v,v.propTypes=r.resizableProps,v.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1},Lo}var Fo={},Av;function RC(){if(Av)return Fo;Av=1,Fo.__esModule=!0,Fo.default=void 0;var e=s(D),t=a(ur()),n=a(Rv()),r=Tv(),o=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function a(g){return g&&g.__esModule?g:{default:g}}function i(g){if(typeof WeakMap!="function")return null;var b=new WeakMap,C=new WeakMap;return(i=function(S){return S?C:b})(g)}function s(g,b){if(g&&g.__esModule)return g;if(g===null||typeof g!="object"&&typeof g!="function")return{default:g};var C=i(b);if(C&&C.has(g))return C.get(g);var x={},S=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var E in g)if(E!=="default"&&Object.prototype.hasOwnProperty.call(g,E)){var M=S?Object.getOwnPropertyDescriptor(g,E):null;M&&(M.get||M.set)?Object.defineProperty(x,E,M):x[E]=g[E]}return x.default=g,C&&C.set(g,x),x}function u(){return u=Object.assign?Object.assign.bind():function(g){for(var b=1;b<arguments.length;b++){var C=arguments[b];for(var x in C)Object.prototype.hasOwnProperty.call(C,x)&&(g[x]=C[x])}return g},u.apply(this,arguments)}function c(g,b){var C=Object.keys(g);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(g);b&&(x=x.filter(function(S){return Object.getOwnPropertyDescriptor(g,S).enumerable})),C.push.apply(C,x)}return C}function d(g){for(var b=1;b<arguments.length;b++){var C=arguments[b]!=null?arguments[b]:{};b%2?c(Object(C),!0).forEach(function(x){l(g,x,C[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(g,Object.getOwnPropertyDescriptors(C)):c(Object(C)).forEach(function(x){Object.defineProperty(g,x,Object.getOwnPropertyDescriptor(C,x))})}return g}function l(g,b,C){return b=h(b),b in g?Object.defineProperty(g,b,{value:C,enumerable:!0,configurable:!0,writable:!0}):g[b]=C,g}function h(g){var b=m(g,"string");return typeof b=="symbol"?b:String(b)}function m(g,b){if(typeof g!="object"||g===null)return g;var C=g[Symbol.toPrimitive];if(C!==void 0){var x=C.call(g,b);if(typeof x!="object")return x;throw new TypeError("@@toPrimitive must return a primitive value.")}return(b==="string"?String:Number)(g)}function y(g,b){if(g==null)return{};var C={},x=Object.keys(g),S,E;for(E=0;E<x.length;E++)S=x[E],!(b.indexOf(S)>=0)&&(C[S]=g[S]);return C}function w(g,b){g.prototype=Object.create(b.prototype),g.prototype.constructor=g,v(g,b)}function v(g,b){return v=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(x,S){return x.__proto__=S,x},v(g,b)}var p=function(g){w(b,g);function b(){for(var x,S=arguments.length,E=new Array(S),M=0;M<S;M++)E[M]=arguments[M];return x=g.call.apply(g,[this].concat(E))||this,x.state={width:x.props.width,height:x.props.height,propsWidth:x.props.width,propsHeight:x.props.height},x.onResize=function(k,T){var R=T.size;x.props.onResize?(k.persist==null||k.persist(),x.setState(R,function(){return x.props.onResize&&x.props.onResize(k,T)})):x.setState(R)},x}b.getDerivedStateFromProps=function(S,E){return E.propsWidth!==S.width||E.propsHeight!==S.height?{width:S.width,height:S.height,propsWidth:S.width,propsHeight:S.height}:null};var C=b.prototype;return C.render=function(){var S=this.props,E=S.handle,M=S.handleSize;S.onResize;var k=S.onResizeStart,T=S.onResizeStop,R=S.draggableOpts,F=S.minConstraints,V=S.maxConstraints,$=S.lockAspectRatio,L=S.axis;S.width,S.height;var _=S.resizeHandles,H=S.style,N=S.transformScale,z=y(S,o);return e.createElement(n.default,{axis:L,draggableOpts:R,handle:E,handleSize:M,height:this.state.height,lockAspectRatio:$,maxConstraints:V,minConstraints:F,onResizeStart:k,onResize:this.onResize,onResizeStop:T,resizeHandles:_,transformScale:N,width:this.state.width},e.createElement("div",u({},z,{style:d(d({},H),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},b}(e.Component);return Fo.default=p,p.propTypes=d(d({},r.resizableProps),{},{children:t.default.element}),Fo}var Lv;function AC(){return Lv||(Lv=1,Ao.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},Ao.exports.Resizable=Rv().default,Ao.exports.ResizableBox=RC().default),Ao.exports}var Un={},$v;function Fv(){if($v)return Un;$v=1,Object.defineProperty(Un,"__esModule",{value:!0}),Un.resizeHandleType=Un.resizeHandleAxesType=Un.default=void 0;var e=n(ur()),t=n(D);function n(a){return a&&a.__esModule?a:{default:a}}const r=Un.resizeHandleAxesType=e.default.arrayOf(e.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),o=Un.resizeHandleType=e.default.oneOfType([e.default.node,e.default.func]);return Un.default={className:e.default.string,style:e.default.object,width:e.default.number,autoSize:e.default.bool,cols:e.default.number,draggableCancel:e.default.string,draggableHandle:e.default.string,verticalCompact:function(a){a.verticalCompact},compactType:e.default.oneOf(["vertical","horizontal"]),layout:function(a){var i=a.layout;i!==void 0&&to().validateLayout(i,"layout")},margin:e.default.arrayOf(e.default.number),containerPadding:e.default.arrayOf(e.default.number),rowHeight:e.default.number,maxRows:e.default.number,isBounded:e.default.bool,isDraggable:e.default.bool,isResizable:e.default.bool,allowOverlap:e.default.bool,preventCollision:e.default.bool,useCSSTransforms:e.default.bool,transformScale:e.default.number,isDroppable:e.default.bool,resizeHandles:r,resizeHandle:o,onLayoutChange:e.default.func,onDragStart:e.default.func,onDrag:e.default.func,onDragStop:e.default.func,onResizeStart:e.default.func,onResize:e.default.func,onResizeStop:e.default.func,onDrop:e.default.func,droppingItem:e.default.shape({i:e.default.string.isRequired,w:e.default.number.isRequired,h:e.default.number.isRequired}),children:function(a,i){const s=a[i],u={};t.default.Children.forEach(s,function(c){if((c==null?void 0:c.key)!=null){if(u[c.key])throw new Error('Duplicate child key "'+c.key+'" found! This will cause problems in ReactGridLayout.');u[c.key]=!0}})},innerRef:e.default.any},Un}var zv;function LC(){if(zv)return To;zv=1,Object.defineProperty(To,"__esModule",{value:!0}),To.default=void 0;var e=c(D),t=It,n=c(ur()),r=Sl(),o=AC(),a=to(),i=gl(),s=Fv(),u=c(hl());function c(y){return y&&y.__esModule?y:{default:y}}function d(y,w,v){return w=l(w),w in y?Object.defineProperty(y,w,{value:v,enumerable:!0,configurable:!0,writable:!0}):y[w]=v,y}function l(y){var w=h(y,"string");return typeof w=="symbol"?w:String(w)}function h(y,w){if(typeof y!="object"||y===null)return y;var v=y[Symbol.toPrimitive];if(v!==void 0){var p=v.call(y,w);if(typeof p!="object")return p;throw new TypeError("@@toPrimitive must return a primitive value.")}return(w==="string"?String:Number)(y)}let m=class extends e.default.Component{constructor(){super(...arguments),d(this,"state",{resizing:null,dragging:null,className:""}),d(this,"elementRef",e.default.createRef()),d(this,"onDragStart",(w,v)=>{let{node:p}=v;const{onDragStart:g,transformScale:b}=this.props;if(!g)return;const C={top:0,left:0},{offsetParent:x}=p;if(!x)return;const S=x.getBoundingClientRect(),E=p.getBoundingClientRect(),M=E.left/b,k=S.left/b,T=E.top/b,R=S.top/b;C.left=M-k+x.scrollLeft,C.top=T-R+x.scrollTop,this.setState({dragging:C});const{x:F,y:V}=(0,i.calcXY)(this.getPositionParams(),C.top,C.left,this.props.w,this.props.h);return g.call(this,this.props.i,F,V,{e:w,node:p,newPosition:C})}),d(this,"onDrag",(w,v,p)=>{let{node:g,deltaX:b,deltaY:C}=v;const{onDrag:x}=this.props;if(!x)return;if(!this.state.dragging)throw new Error("onDrag called before onDragStart.");let S=this.state.dragging.top+C,E=this.state.dragging.left+b;const{isBounded:M,i:k,w:T,h:R,containerWidth:F}=this.props,V=this.getPositionParams();if(M){const{offsetParent:H}=g;if(H){const{margin:N,rowHeight:z,containerPadding:B}=this.props,A=H.clientHeight-(0,i.calcGridItemWHPx)(R,z,N[1]);S=(0,i.clamp)(S-B[1],0,A);const j=(0,i.calcGridColWidth)(V),Y=F-(0,i.calcGridItemWHPx)(T,j,N[0]);E=(0,i.clamp)(E-B[0],0,Y)}}const $={top:S,left:E};p?this.setState({dragging:$}):(0,t.flushSync)(()=>{this.setState({dragging:$})});const{x:L,y:_}=(0,i.calcXY)(V,S,E,T,R);return x.call(this,k,L,_,{e:w,node:g,newPosition:$})}),d(this,"onDragStop",(w,v)=>{let{node:p}=v;const{onDragStop:g}=this.props;if(!g)return;if(!this.state.dragging)throw new Error("onDragEnd called before onDragStart.");const{w:b,h:C,i:x}=this.props,{left:S,top:E}=this.state.dragging,M={top:E,left:S};this.setState({dragging:null});const{x:k,y:T}=(0,i.calcXY)(this.getPositionParams(),E,S,b,C);return g.call(this,x,k,T,{e:w,node:p,newPosition:M})}),d(this,"onResizeStop",(w,v,p)=>this.onResizeHandler(w,v,p,"onResizeStop")),d(this,"onResizeStart",(w,v,p)=>this.onResizeHandler(w,v,p,"onResizeStart")),d(this,"onResize",(w,v,p)=>this.onResizeHandler(w,v,p,"onResize"))}shouldComponentUpdate(w,v){if(this.props.children!==w.children||this.props.droppingPosition!==w.droppingPosition)return!0;const p=(0,i.calcGridItemPosition)(this.getPositionParams(this.props),this.props.x,this.props.y,this.props.w,this.props.h,this.state),g=(0,i.calcGridItemPosition)(this.getPositionParams(w),w.x,w.y,w.w,w.h,v);return!(0,a.fastPositionEqual)(p,g)||this.props.useCSSTransforms!==w.useCSSTransforms}componentDidMount(){this.moveDroppingItem({})}componentDidUpdate(w){this.moveDroppingItem(w)}moveDroppingItem(w){const{droppingPosition:v}=this.props;if(!v)return;const p=this.elementRef.current;if(!p)return;const g=w.droppingPosition||{left:0,top:0},{dragging:b}=this.state,C=b&&v.left!==g.left||v.top!==g.top;if(!b)this.onDragStart(v.e,{node:p,deltaX:v.left,deltaY:v.top});else if(C){const x=v.left-b.left,S=v.top-b.top;this.onDrag(v.e,{node:p,deltaX:x,deltaY:S},!0)}}getPositionParams(){let w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props;return{cols:w.cols,containerPadding:w.containerPadding,containerWidth:w.containerWidth,margin:w.margin,maxRows:w.maxRows,rowHeight:w.rowHeight}}createStyle(w){const{usePercentages:v,containerWidth:p,useCSSTransforms:g}=this.props;let b;return g?b=(0,a.setTransform)(w):(b=(0,a.setTopLeft)(w),v&&(b.left=(0,a.perc)(w.left/p),b.width=(0,a.perc)(w.width/p))),b}mixinDraggable(w,v){return e.default.createElement(r.DraggableCore,{disabled:!v,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop,handle:this.props.handle,cancel:".react-resizable-handle"+(this.props.cancel?","+this.props.cancel:""),scale:this.props.transformScale,nodeRef:this.elementRef},w)}curryResizeHandler(w,v){return(p,g)=>v(p,g,w)}mixinResizable(w,v,p){const{cols:g,minW:b,minH:C,maxW:x,maxH:S,transformScale:E,resizeHandles:M,resizeHandle:k}=this.props,T=this.getPositionParams(),R=(0,i.calcGridItemPosition)(T,0,0,g,0).width,F=(0,i.calcGridItemPosition)(T,0,0,b,C),V=(0,i.calcGridItemPosition)(T,0,0,x,S),$=[F.width,F.height],L=[Math.min(V.width,R),Math.min(V.height,1/0)];return e.default.createElement(o.Resizable,{draggableOpts:{disabled:!p},className:p?void 0:"react-resizable-hide",width:v.width,height:v.height,minConstraints:$,maxConstraints:L,onResizeStop:this.curryResizeHandler(v,this.onResizeStop),onResizeStart:this.curryResizeHandler(v,this.onResizeStart),onResize:this.curryResizeHandler(v,this.onResize),transformScale:E,resizeHandles:M,handle:k},w)}onResizeHandler(w,v,p,g){let{node:b,size:C,handle:x}=v;const S=this.props[g];if(!S)return;const{x:E,y:M,i:k,maxH:T,minH:R,containerWidth:F}=this.props,{minW:V,maxW:$}=this.props;let L=C;b&&(L=(0,a.resizeItemInDirection)(x,p,C,F),(0,t.flushSync)(()=>{this.setState({resizing:g==="onResizeStop"?null:L})}));let{w:_,h:H}=(0,i.calcWH)(this.getPositionParams(),L.width,L.height,E,M,x);_=(0,i.clamp)(_,Math.max(V,1),$),H=(0,i.clamp)(H,R,T),S.call(this,k,_,H,{e:w,node:b,size:L,handle:x})}render(){const{x:w,y:v,w:p,h:g,isDraggable:b,isResizable:C,droppingPosition:x,useCSSTransforms:S}=this.props,E=(0,i.calcGridItemPosition)(this.getPositionParams(),w,v,p,g,this.state),M=e.default.Children.only(this.props.children);let k=e.default.cloneElement(M,{ref:this.elementRef,className:(0,u.default)("react-grid-item",M.props.className,this.props.className,{static:this.props.static,resizing:!!this.state.resizing,"react-draggable":b,"react-draggable-dragging":!!this.state.dragging,dropping:!!x,cssTransforms:S}),style:{...this.props.style,...M.props.style,...this.createStyle(E)}});return k=this.mixinResizable(k,E,C),k=this.mixinDraggable(k,b),k}};return To.default=m,d(m,"propTypes",{children:n.default.element,cols:n.default.number.isRequired,containerWidth:n.default.number.isRequired,rowHeight:n.default.number.isRequired,margin:n.default.array.isRequired,maxRows:n.default.number.isRequired,containerPadding:n.default.array.isRequired,x:n.default.number.isRequired,y:n.default.number.isRequired,w:n.default.number.isRequired,h:n.default.number.isRequired,minW:function(y,w){const v=y[w];if(typeof v!="number")return new Error("minWidth not Number");if(v>y.w||v>y.maxW)return new Error("minWidth larger than item width/maxWidth")},maxW:function(y,w){const v=y[w];if(typeof v!="number")return new Error("maxWidth not Number");if(v<y.w||v<y.minW)return new Error("maxWidth smaller than item width/minWidth")},minH:function(y,w){const v=y[w];if(typeof v!="number")return new Error("minHeight not Number");if(v>y.h||v>y.maxH)return new Error("minHeight larger than item height/maxHeight")},maxH:function(y,w){const v=y[w];if(typeof v!="number")return new Error("maxHeight not Number");if(v<y.h||v<y.minH)return new Error("maxHeight smaller than item height/minHeight")},i:n.default.string.isRequired,resizeHandles:s.resizeHandleAxesType,resizeHandle:s.resizeHandleType,onDragStop:n.default.func,onDragStart:n.default.func,onDrag:n.default.func,onResizeStop:n.default.func,onResizeStart:n.default.func,onResize:n.default.func,isDraggable:n.default.bool.isRequired,isResizable:n.default.bool.isRequired,isBounded:n.default.bool.isRequired,static:n.default.bool,useCSSTransforms:n.default.bool.isRequired,transformScale:n.default.number,className:n.default.string,handle:n.default.string,cancel:n.default.string,droppingPosition:n.default.shape({e:n.default.object.isRequired,left:n.default.number.isRequired,top:n.default.number.isRequired})}),d(m,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1}),To}var Hv;function Vv(){if(Hv)return _o;Hv=1,Object.defineProperty(_o,"__esModule",{value:!0}),_o.default=void 0;var e=c(D),t=ml(),n=s(hl()),r=to(),o=gl(),a=s(LC()),i=s(Fv());function s(v){return v&&v.__esModule?v:{default:v}}function u(v){if(typeof WeakMap!="function")return null;var p=new WeakMap,g=new WeakMap;return(u=function(b){return b?g:p})(v)}function c(v,p){if(v&&v.__esModule)return v;if(v===null||typeof v!="object"&&typeof v!="function")return{default:v};var g=u(p);if(g&&g.has(v))return g.get(v);var b={__proto__:null},C=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var x in v)if(x!=="default"&&Object.prototype.hasOwnProperty.call(v,x)){var S=C?Object.getOwnPropertyDescriptor(v,x):null;S&&(S.get||S.set)?Object.defineProperty(b,x,S):b[x]=v[x]}return b.default=v,g&&g.set(v,b),b}function d(v,p,g){return p=l(p),p in v?Object.defineProperty(v,p,{value:g,enumerable:!0,configurable:!0,writable:!0}):v[p]=g,v}function l(v){var p=h(v,"string");return typeof p=="symbol"?p:String(p)}function h(v,p){if(typeof v!="object"||v===null)return v;var g=v[Symbol.toPrimitive];if(g!==void 0){var b=g.call(v,p);if(typeof b!="object")return b;throw new TypeError("@@toPrimitive must return a primitive value.")}return(p==="string"?String:Number)(v)}const m="react-grid-layout";let y=!1;try{y=/firefox/i.test(navigator.userAgent)}catch{}class w extends e.Component{constructor(){super(...arguments),d(this,"state",{activeDrag:null,layout:(0,r.synchronizeLayoutWithChildren)(this.props.layout,this.props.children,this.props.cols,(0,r.compactType)(this.props),this.props.allowOverlap),mounted:!1,oldDragItem:null,oldLayout:null,oldResizeItem:null,resizing:!1,droppingDOMNode:null,children:[]}),d(this,"dragEnterCounter",0),d(this,"onDragStart",(p,g,b,C)=>{let{e:x,node:S}=C;const{layout:E}=this.state,M=(0,r.getLayoutItem)(E,p);if(!M)return;const k={w:M.w,h:M.h,x:M.x,y:M.y,placeholder:!0,i:p};return this.setState({oldDragItem:(0,r.cloneLayoutItem)(M),oldLayout:E,activeDrag:k}),this.props.onDragStart(E,M,M,null,x,S)}),d(this,"onDrag",(p,g,b,C)=>{let{e:x,node:S}=C;const{oldDragItem:E}=this.state;let{layout:M}=this.state;const{cols:k,allowOverlap:T,preventCollision:R}=this.props,F=(0,r.getLayoutItem)(M,p);if(!F)return;const V={w:F.w,h:F.h,x:F.x,y:F.y,placeholder:!0,i:p};M=(0,r.moveElement)(M,F,g,b,!0,R,(0,r.compactType)(this.props),k,T),this.props.onDrag(M,E,F,V,x,S),this.setState({layout:T?M:(0,r.compact)(M,(0,r.compactType)(this.props),k),activeDrag:V})}),d(this,"onDragStop",(p,g,b,C)=>{let{e:x,node:S}=C;if(!this.state.activeDrag)return;const{oldDragItem:E}=this.state;let{layout:M}=this.state;const{cols:k,preventCollision:T,allowOverlap:R}=this.props,F=(0,r.getLayoutItem)(M,p);if(!F)return;M=(0,r.moveElement)(M,F,g,b,!0,T,(0,r.compactType)(this.props),k,R);const $=R?M:(0,r.compact)(M,(0,r.compactType)(this.props),k);this.props.onDragStop($,E,F,null,x,S);const{oldLayout:L}=this.state;this.setState({activeDrag:null,layout:$,oldDragItem:null,oldLayout:null}),this.onLayoutMaybeChanged($,L)}),d(this,"onResizeStart",(p,g,b,C)=>{let{e:x,node:S}=C;const{layout:E}=this.state,M=(0,r.getLayoutItem)(E,p);M&&(this.setState({oldResizeItem:(0,r.cloneLayoutItem)(M),oldLayout:this.state.layout,resizing:!0}),this.props.onResizeStart(E,M,M,null,x,S))}),d(this,"onResize",(p,g,b,C)=>{let{e:x,node:S,size:E,handle:M}=C;const{oldResizeItem:k}=this.state,{layout:T}=this.state,{cols:R,preventCollision:F,allowOverlap:V}=this.props;let $=!1,L,_,H;const[N,z]=(0,r.withLayoutItem)(T,p,A=>{let j;return _=A.x,H=A.y,["sw","w","nw","n","ne"].indexOf(M)!==-1&&(["sw","nw","w"].indexOf(M)!==-1&&(_=A.x+(A.w-g),g=A.x!==_&&_<0?A.w:g,_=_<0?0:_),["ne","n","nw"].indexOf(M)!==-1&&(H=A.y+(A.h-b),b=A.y!==H&&H<0?A.h:b,H=H<0?0:H),$=!0),F&&!V&&(j=(0,r.getAllCollisions)(T,{...A,w:g,h:b,x:_,y:H}).filter(U=>U.i!==A.i).length>0,j&&(H=A.y,b=A.h,_=A.x,g=A.w,$=!1)),A.w=g,A.h=b,A});if(!z)return;L=N,$&&(L=(0,r.moveElement)(N,z,_,H,!0,this.props.preventCollision,(0,r.compactType)(this.props),R,V));const B={w:z.w,h:z.h,x:z.x,y:z.y,static:!0,i:p};this.props.onResize(L,k,z,B,x,S),this.setState({layout:V?L:(0,r.compact)(L,(0,r.compactType)(this.props),R),activeDrag:B})}),d(this,"onResizeStop",(p,g,b,C)=>{let{e:x,node:S}=C;const{layout:E,oldResizeItem:M}=this.state,{cols:k,allowOverlap:T}=this.props,R=(0,r.getLayoutItem)(E,p),F=T?E:(0,r.compact)(E,(0,r.compactType)(this.props),k);this.props.onResizeStop(F,M,R,null,x,S);const{oldLayout:V}=this.state;this.setState({activeDrag:null,layout:F,oldResizeItem:null,oldLayout:null,resizing:!1}),this.onLayoutMaybeChanged(F,V)}),d(this,"onDragOver",p=>{var N;if(p.preventDefault(),p.stopPropagation(),y&&!((N=p.nativeEvent.target)!=null&&N.classList.contains(m)))return!1;const{droppingItem:g,onDropDragOver:b,margin:C,cols:x,rowHeight:S,maxRows:E,width:M,containerPadding:k,transformScale:T}=this.props,R=b==null?void 0:b(p);if(R===!1)return this.state.droppingDOMNode&&this.removeDroppingPlaceholder(),!1;const F={...g,...R},{layout:V}=this.state,$=p.currentTarget.getBoundingClientRect(),L=p.clientX-$.left,_=p.clientY-$.top,H={left:L/T,top:_/T,e:p};if(this.state.droppingDOMNode){if(this.state.droppingPosition){const{left:z,top:B}=this.state.droppingPosition;(z!=L||B!=_)&&this.setState({droppingPosition:H})}}else{const z={cols:x,margin:C,maxRows:E,rowHeight:S,containerWidth:M,containerPadding:k||C},B=(0,o.calcXY)(z,_,L,F.w,F.h);this.setState({droppingDOMNode:e.createElement("div",{key:F.i}),droppingPosition:H,layout:[...V,{...F,x:B.x,y:B.y,static:!1,isDraggable:!0}]})}}),d(this,"removeDroppingPlaceholder",()=>{const{droppingItem:p,cols:g}=this.props,{layout:b}=this.state,C=(0,r.compact)(b.filter(x=>x.i!==p.i),(0,r.compactType)(this.props),g,this.props.allowOverlap);this.setState({layout:C,droppingDOMNode:null,activeDrag:null,droppingPosition:void 0})}),d(this,"onDragLeave",p=>{p.preventDefault(),p.stopPropagation(),this.dragEnterCounter--,this.dragEnterCounter===0&&this.removeDroppingPlaceholder()}),d(this,"onDragEnter",p=>{p.preventDefault(),p.stopPropagation(),this.dragEnterCounter++}),d(this,"onDrop",p=>{p.preventDefault(),p.stopPropagation();const{droppingItem:g}=this.props,{layout:b}=this.state,C=b.find(x=>x.i===g.i);this.dragEnterCounter=0,this.removeDroppingPlaceholder(),this.props.onDrop(b,C,p)})}componentDidMount(){this.setState({mounted:!0}),this.onLayoutMaybeChanged(this.state.layout,this.props.layout)}static getDerivedStateFromProps(p,g){let b;return g.activeDrag?null:(!(0,t.deepEqual)(p.layout,g.propsLayout)||p.compactType!==g.compactType?b=p.layout:(0,r.childrenEqual)(p.children,g.children)||(b=g.layout),b?{layout:(0,r.synchronizeLayoutWithChildren)(b,p.children,p.cols,(0,r.compactType)(p),p.allowOverlap),compactType:p.compactType,children:p.children,propsLayout:p.layout}:null)}shouldComponentUpdate(p,g){return this.props.children!==p.children||!(0,r.fastRGLPropsEqual)(this.props,p,t.deepEqual)||this.state.activeDrag!==g.activeDrag||this.state.mounted!==g.mounted||this.state.droppingPosition!==g.droppingPosition}componentDidUpdate(p,g){if(!this.state.activeDrag){const b=this.state.layout,C=g.layout;this.onLayoutMaybeChanged(b,C)}}containerHeight(){if(!this.props.autoSize)return;const p=(0,r.bottom)(this.state.layout),g=this.props.containerPadding?this.props.containerPadding[1]:this.props.margin[1];return p*this.props.rowHeight+(p-1)*this.props.margin[1]+g*2+"px"}onLayoutMaybeChanged(p,g){g||(g=this.state.layout),(0,t.deepEqual)(g,p)||this.props.onLayoutChange(p)}placeholder(){const{activeDrag:p}=this.state;if(!p)return null;const{width:g,cols:b,margin:C,containerPadding:x,rowHeight:S,maxRows:E,useCSSTransforms:M,transformScale:k}=this.props;return e.createElement(a.default,{w:p.w,h:p.h,x:p.x,y:p.y,i:p.i,className:`react-grid-placeholder ${this.state.resizing?"placeholder-resizing":""}`,containerWidth:g,cols:b,margin:C,containerPadding:x||C,maxRows:E,rowHeight:S,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:M,transformScale:k},e.createElement("div",null))}processGridItem(p,g){if(!p||!p.key)return;const b=(0,r.getLayoutItem)(this.state.layout,String(p.key));if(!b)return null;const{width:C,cols:x,margin:S,containerPadding:E,rowHeight:M,maxRows:k,isDraggable:T,isResizable:R,isBounded:F,useCSSTransforms:V,transformScale:$,draggableCancel:L,draggableHandle:_,resizeHandles:H,resizeHandle:N}=this.props,{mounted:z,droppingPosition:B}=this.state,A=typeof b.isDraggable=="boolean"?b.isDraggable:!b.static&&T,j=typeof b.isResizable=="boolean"?b.isResizable:!b.static&&R,Y=b.resizeHandles||H,U=A&&F&&b.isBounded!==!1;return e.createElement(a.default,{containerWidth:C,cols:x,margin:S,containerPadding:E||S,maxRows:k,rowHeight:M,cancel:L,handle:_,onDragStop:this.onDragStop,onDragStart:this.onDragStart,onDrag:this.onDrag,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,isDraggable:A,isResizable:j,isBounded:U,useCSSTransforms:V&&z,usePercentages:!z,transformScale:$,w:b.w,h:b.h,x:b.x,y:b.y,i:b.i,minH:b.minH,minW:b.minW,maxH:b.maxH,maxW:b.maxW,static:b.static,droppingPosition:g?B:void 0,resizeHandles:Y,resizeHandle:N},p)}render(){const{className:p,style:g,isDroppable:b,innerRef:C}=this.props,x=(0,n.default)(m,p),S={height:this.containerHeight(),...g};return e.createElement("div",{ref:C,className:x,style:S,onDrop:b?this.onDrop:r.noop,onDragLeave:b?this.onDragLeave:r.noop,onDragEnter:b?this.onDragEnter:r.noop,onDragOver:b?this.onDragOver:r.noop},e.Children.map(this.props.children,E=>this.processGridItem(E)),b&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}}return _o.default=w,d(w,"displayName","ReactGridLayout"),d(w,"propTypes",i.default),d(w,"defaultProps",{autoSize:!0,cols:12,className:"",style:{},draggableHandle:"",draggableCancel:"",containerPadding:null,rowHeight:150,maxRows:1/0,layout:[],margin:[10,10],isBounded:!1,isDraggable:!0,isResizable:!0,allowOverlap:!1,isDroppable:!1,useCSSTransforms:!0,transformScale:1,verticalCompact:!0,compactType:"vertical",preventCollision:!1,droppingItem:{i:"__dropping-elem__",h:1,w:1},resizeHandles:["se"],onLayoutChange:r.noop,onDragStart:r.noop,onDrag:r.noop,onDragStop:r.noop,onResizeStart:r.noop,onResize:r.noop,onResizeStop:r.noop,onDrop:r.noop,onDropDragOver:r.noop}),_o}var zo={},kr={},Wv;function Bv(){if(Wv)return kr;Wv=1,Object.defineProperty(kr,"__esModule",{value:!0}),kr.findOrGenerateResponsiveLayout=r,kr.getBreakpointFromWidth=t,kr.getColsFromBreakpoint=n,kr.sortBreakpoints=o;var e=to();function t(a,i){const s=o(a);let u=s[0];for(let c=1,d=s.length;c<d;c++){const l=s[c];i>a[l]&&(u=l)}return u}function n(a,i){if(!i[a])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+a+" is missing!");return i[a]}function r(a,i,s,u,c,d){if(a[s])return(0,e.cloneLayout)(a[s]);let l=a[u];const h=o(i),m=h.slice(h.indexOf(s));for(let y=0,w=m.length;y<w;y++){const v=m[y];if(a[v]){l=a[v];break}}return l=(0,e.cloneLayout)(l||[]),(0,e.compact)((0,e.correctBounds)(l,{cols:c}),d,c)}function o(a){return Object.keys(a).sort(function(s,u){return a[s]-a[u]})}return kr}var jv;function $C(){if(jv)return zo;jv=1,Object.defineProperty(zo,"__esModule",{value:!0}),zo.default=void 0;var e=u(D),t=i(ur()),n=ml(),r=to(),o=Bv(),a=i(Vv());function i(v){return v&&v.__esModule?v:{default:v}}function s(v){if(typeof WeakMap!="function")return null;var p=new WeakMap,g=new WeakMap;return(s=function(b){return b?g:p})(v)}function u(v,p){if(v&&v.__esModule)return v;if(v===null||typeof v!="object"&&typeof v!="function")return{default:v};var g=s(p);if(g&&g.has(v))return g.get(v);var b={__proto__:null},C=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var x in v)if(x!=="default"&&Object.prototype.hasOwnProperty.call(v,x)){var S=C?Object.getOwnPropertyDescriptor(v,x):null;S&&(S.get||S.set)?Object.defineProperty(b,x,S):b[x]=v[x]}return b.default=v,g&&g.set(v,b),b}function c(){return c=Object.assign?Object.assign.bind():function(v){for(var p=1;p<arguments.length;p++){var g=arguments[p];for(var b in g)Object.prototype.hasOwnProperty.call(g,b)&&(v[b]=g[b])}return v},c.apply(this,arguments)}function d(v,p,g){return p=l(p),p in v?Object.defineProperty(v,p,{value:g,enumerable:!0,configurable:!0,writable:!0}):v[p]=g,v}function l(v){var p=h(v,"string");return typeof p=="symbol"?p:String(p)}function h(v,p){if(typeof v!="object"||v===null)return v;var g=v[Symbol.toPrimitive];if(g!==void 0){var b=g.call(v,p);if(typeof b!="object")return b;throw new TypeError("@@toPrimitive must return a primitive value.")}return(p==="string"?String:Number)(v)}const m=v=>Object.prototype.toString.call(v);function y(v,p){return v==null?null:Array.isArray(v)?v:v[p]}let w=class extends e.Component{constructor(){super(...arguments),d(this,"state",this.generateInitialState()),d(this,"onLayoutChange",p=>{this.props.onLayoutChange(p,{...this.props.layouts,[this.state.breakpoint]:p})})}generateInitialState(){const{width:p,breakpoints:g,layouts:b,cols:C}=this.props,x=(0,o.getBreakpointFromWidth)(g,p),S=(0,o.getColsFromBreakpoint)(x,C),E=this.props.verticalCompact===!1?null:this.props.compactType;return{layout:(0,o.findOrGenerateResponsiveLayout)(b,g,x,x,S,E),breakpoint:x,cols:S}}static getDerivedStateFromProps(p,g){if(!(0,n.deepEqual)(p.layouts,g.layouts)){const{breakpoint:b,cols:C}=g;return{layout:(0,o.findOrGenerateResponsiveLayout)(p.layouts,p.breakpoints,b,b,C,p.compactType),layouts:p.layouts}}return null}componentDidUpdate(p){(this.props.width!=p.width||this.props.breakpoint!==p.breakpoint||!(0,n.deepEqual)(this.props.breakpoints,p.breakpoints)||!(0,n.deepEqual)(this.props.cols,p.cols))&&this.onWidthChange(p)}onWidthChange(p){const{breakpoints:g,cols:b,layouts:C,compactType:x}=this.props,S=this.props.breakpoint||(0,o.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),E=this.state.breakpoint,M=(0,o.getColsFromBreakpoint)(S,b),k={...C};if(E!==S||p.breakpoints!==g||p.cols!==b){E in k||(k[E]=(0,r.cloneLayout)(this.state.layout));let F=(0,o.findOrGenerateResponsiveLayout)(k,g,S,E,M,x);F=(0,r.synchronizeLayoutWithChildren)(F,this.props.children,M,x,this.props.allowOverlap),k[S]=F,this.props.onBreakpointChange(S,M),this.props.onLayoutChange(F,k),this.setState({breakpoint:S,layout:F,cols:M})}const T=y(this.props.margin,S),R=y(this.props.containerPadding,S);this.props.onWidthChange(this.props.width,T,M,R)}render(){const{breakpoint:p,breakpoints:g,cols:b,layouts:C,margin:x,containerPadding:S,onBreakpointChange:E,onLayoutChange:M,onWidthChange:k,...T}=this.props;return e.createElement(a.default,c({},T,{margin:y(x,this.state.breakpoint),containerPadding:y(S,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}};return zo.default=w,d(w,"propTypes",{breakpoint:t.default.string,breakpoints:t.default.object,allowOverlap:t.default.bool,cols:t.default.object,margin:t.default.oneOfType([t.default.array,t.default.object]),containerPadding:t.default.oneOfType([t.default.array,t.default.object]),layouts(v,p){if(m(v[p])!=="[object Object]")throw new Error("Layout property must be an object. Received: "+m(v[p]));Object.keys(v[p]).forEach(g=>{if(!(g in v.breakpoints))throw new Error("Each key in layouts must align with a key in breakpoints.");(0,r.validateLayout)(v.layouts[g],"layouts."+g)})},width:t.default.number.isRequired,onBreakpointChange:t.default.func,onLayoutChange:t.default.func,onWidthChange:t.default.func}),d(w,"defaultProps",{breakpoints:{lg:1200,md:996,sm:768,xs:480,xxs:0},cols:{lg:12,md:10,sm:6,xs:4,xxs:2},containerPadding:{lg:null,md:null,sm:null,xs:null,xxs:null},layouts:{},margin:[10,10],allowOverlap:!1,onBreakpointChange:r.noop,onLayoutChange:r.noop,onWidthChange:r.noop}),zo}var pi={};const FC=vd(r1);var Yv;function zC(){if(Yv)return pi;Yv=1,Object.defineProperty(pi,"__esModule",{value:!0}),pi.default=h;var e=i(D),t=o(ur()),n=o(FC),r=o(hl());function o(m){return m&&m.__esModule?m:{default:m}}function a(m){if(typeof WeakMap!="function")return null;var y=new WeakMap,w=new WeakMap;return(a=function(v){return v?w:y})(m)}function i(m,y){if(m&&m.__esModule)return m;if(m===null||typeof m!="object"&&typeof m!="function")return{default:m};var w=a(y);if(w&&w.has(m))return w.get(m);var v={__proto__:null},p=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var g in m)if(g!=="default"&&Object.prototype.hasOwnProperty.call(m,g)){var b=p?Object.getOwnPropertyDescriptor(m,g):null;b&&(b.get||b.set)?Object.defineProperty(v,g,b):v[g]=m[g]}return v.default=m,w&&w.set(m,v),v}function s(){return s=Object.assign?Object.assign.bind():function(m){for(var y=1;y<arguments.length;y++){var w=arguments[y];for(var v in w)Object.prototype.hasOwnProperty.call(w,v)&&(m[v]=w[v])}return m},s.apply(this,arguments)}function u(m,y,w){return y=c(y),y in m?Object.defineProperty(m,y,{value:w,enumerable:!0,configurable:!0,writable:!0}):m[y]=w,m}function c(m){var y=d(m,"string");return typeof y=="symbol"?y:String(y)}function d(m,y){if(typeof m!="object"||m===null)return m;var w=m[Symbol.toPrimitive];if(w!==void 0){var v=w.call(m,y);if(typeof v!="object")return v;throw new TypeError("@@toPrimitive must return a primitive value.")}return(y==="string"?String:Number)(m)}const l="react-grid-layout";function h(m){var y;return y=class extends e.Component{constructor(){super(...arguments),u(this,"state",{width:1280}),u(this,"elementRef",e.createRef()),u(this,"mounted",!1),u(this,"resizeObserver",void 0)}componentDidMount(){this.mounted=!0,this.resizeObserver=new n.default(p=>{if(this.elementRef.current instanceof HTMLElement){const b=p[0].contentRect.width;this.setState({width:b})}});const v=this.elementRef.current;v instanceof HTMLElement&&this.resizeObserver.observe(v)}componentWillUnmount(){this.mounted=!1;const v=this.elementRef.current;v instanceof HTMLElement&&this.resizeObserver.unobserve(v),this.resizeObserver.disconnect()}render(){const{measureBeforeMount:v,...p}=this.props;return v&&!this.mounted?e.createElement("div",{className:(0,r.default)(this.props.className,l),style:this.props.style,ref:this.elementRef}):e.createElement(m,s({innerRef:this.elementRef},p,this.state))}},u(y,"defaultProps",{measureBeforeMount:!1}),u(y,"propTypes",{measureBeforeMount:t.default.bool}),y}return pi}var Uv;function HC(){return Uv||(Uv=1,function(e){e.exports=Vv().default,e.exports.utils=to(),e.exports.calculateUtils=gl(),e.exports.Responsive=$C().default,e.exports.Responsive.utils=Bv(),e.exports.WidthProvider=zC().default}(vl)),vl.exports}var qv=HC();const VC=ks(qv),Gv=qv.WidthProvider(VC);function WC(e){const{list:t,onListChange:n,idKey:r,itemRender:o,...a}=e,i=D.useMemo(()=>{const u=new Map;return t.forEach(c=>{const d=c[r];u.set(d,c)}),u},[r,t]),s=D.useMemo(()=>t.map((u,c)=>({i:u[r],w:12,h:1,x:0,y:c,col:12})),[r,t]);return P.jsx(Gv,{...a,cols:12,preventCollision:!1,isResizable:!1,isDraggable:!0,onLayoutChange:u=>{const c=u.sort((d,l)=>d.y-l.y).map(d=>i.get(d.i));n(c)},children:s.map((u,c)=>P.jsx("div",{"data-grid":u,children:o(i.get(u.i),c)},u.i))})}var xn={TAB:9,ENTER:13,ESC:27,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40},BC=xn.ESC,jC=xn.TAB;function YC(e){var t=e.visible,n=e.triggerRef,r=e.onVisibleChange,o=e.autoFocus,a=e.overlayRef,i=f.useRef(!1),s=function(){if(t){var l,h;(l=n.current)===null||l===void 0||(h=l.focus)===null||h===void 0||h.call(l),r==null||r(!1)}},u=function(){var l;return(l=a.current)!==null&&l!==void 0&&l.focus?(a.current.focus(),i.current=!0,!0):!1},c=function(l){switch(l.keyCode){case BC:s();break;case jC:{var h=!1;i.current||(h=u()),h?l.preventDefault():s();break}}};f.useEffect(function(){return t?(window.addEventListener("keydown",c),o&&mt(u,3),function(){window.removeEventListener("keydown",c),i.current=!1}):function(){i.current=!1}},[t])}var UC=D.forwardRef(function(e,t){var n=e.overlay,r=e.arrow,o=e.prefixCls,a=D.useMemo(function(){var s;return typeof n=="function"?s=n():s=n,s},[n]),i=ka(t,ho(a));return D.createElement(D.Fragment,null,r&&D.createElement("div",{className:"".concat(o,"-arrow")}),D.cloneElement(a,{ref:Yr(a)?i:void 0}))}),no={adjustX:1,adjustY:1},ro=[0,0],qC={topLeft:{points:["bl","tl"],overflow:no,offset:[0,-4],targetOffset:ro},top:{points:["bc","tc"],overflow:no,offset:[0,-4],targetOffset:ro},topRight:{points:["br","tr"],overflow:no,offset:[0,-4],targetOffset:ro},bottomLeft:{points:["tl","bl"],overflow:no,offset:[0,4],targetOffset:ro},bottom:{points:["tc","bc"],overflow:no,offset:[0,4],targetOffset:ro},bottomRight:{points:["tr","br"],overflow:no,offset:[0,4],targetOffset:ro}},GC=["arrow","prefixCls","transitionName","animation","align","placement","placements","getPopupContainer","showAction","hideAction","overlayClassName","overlayStyle","visible","trigger","autoFocus","overlay","children","onVisibleChange"];function KC(e,t){var n,r=e.arrow,o=r===void 0?!1:r,a=e.prefixCls,i=a===void 0?"rc-dropdown":a,s=e.transitionName,u=e.animation,c=e.align,d=e.placement,l=d===void 0?"bottomLeft":d,h=e.placements,m=h===void 0?qC:h,y=e.getPopupContainer,w=e.showAction,v=e.hideAction,p=e.overlayClassName,g=e.overlayStyle,b=e.visible,C=e.trigger,x=C===void 0?["hover"]:C,S=e.autoFocus,E=e.overlay,M=e.children,k=e.onVisibleChange,T=pt(e,GC),R=D.useState(),F=X(R,2),V=F[0],$=F[1],L="visible"in e?b:V,_=D.useRef(null),H=D.useRef(null),N=D.useRef(null);D.useImperativeHandle(t,function(){return _.current});var z=function(G){$(G),k==null||k(G)};YC({visible:L,triggerRef:N,onVisibleChange:z,autoFocus:S,overlayRef:H});var B=function(G){var q=e.onOverlayClick;$(!1),q&&q(G)},A=function(){return D.createElement(UC,{ref:H,overlay:E,prefixCls:i,arrow:o})},j=function(){return typeof E=="function"?A:A()},Y=function(){var G=e.minOverlayWidthMatchTrigger,q=e.alignPoint;return"minOverlayWidthMatchTrigger"in e?G:!q},U=function(){var G=e.openClassName;return G!==void 0?G:"".concat(i,"-open")},ne=D.cloneElement(M,{className:Xe((n=M.props)===null||n===void 0?void 0:n.className,L&&U()),ref:Yr(M)?ka(N,ho(M)):void 0}),te=v;return!te&&x.indexOf("contextMenu")!==-1&&(te=["click"]),D.createElement(Qs,_e({builtinPlacements:m},T,{prefixCls:i,ref:_,popupClassName:Xe(p,ce({},"".concat(i,"-show-arrow"),o)),popupStyle:g,action:x,showAction:w,hideAction:te,popupPlacement:l,popupAlign:c,popupTransitionName:s,popupAnimation:u,popupVisible:L,stretch:Y()?"minWidth":"",popup:j(),onPopupVisibleChange:z,onPopupClick:B,getPopupContainer:y}),ne)}const XC=D.forwardRef(KC);function ZC(e){const{className:t,placement:n,children:r,overlay:o,alignPoint:a=!1,align:i,disabled:s,onVisibleChange:u}=e,c=s?[]:e.trigger||["click"],{mountContainer:d}=D.useContext(hn);return d&&P.jsx(XC,{...e,overlayClassName:t,prefixCls:"univer-dropdown",getPopupContainer:()=>d,trigger:c,animation:"slide-up",placement:n,overlay:o,alignPoint:a,align:i,onVisibleChange:u,children:r})}function Kv(e){const t=e+"CollectionProvider",[n,r]=Wn(t),[o,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=w=>{const{scope:v,children:p}=w,g=D.useRef(null),b=D.useRef(new Map).current;return P.jsx(o,{scope:v,itemMap:b,collectionRef:g,children:p})};i.displayName=t;const s=e+"CollectionSlot",u=Cr(s),c=D.forwardRef((w,v)=>{const{scope:p,children:g}=w,b=a(s,p),C=Pt(v,b.collectionRef);return P.jsx(u,{ref:C,children:g})});c.displayName=s;const d=e+"CollectionItemSlot",l="data-radix-collection-item",h=Cr(d),m=D.forwardRef((w,v)=>{const{scope:p,children:g,...b}=w,C=D.useRef(null),x=Pt(v,C),S=a(d,p);return D.useEffect(()=>(S.itemMap.set(C,{ref:C,...b}),()=>void S.itemMap.delete(C))),P.jsx(h,{[l]:"",ref:x,children:g})});m.displayName=d;function y(w){const v=a(e+"CollectionConsumer",w);return D.useCallback(()=>{const g=v.collectionRef.current;if(!g)return[];const b=Array.from(g.querySelectorAll(`[${l}]`));return Array.from(v.itemMap.values()).sort((S,E)=>b.indexOf(S.ref.current)-b.indexOf(E.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:i,Slot:c,ItemSlot:m},y,r]}var QC=f.createContext(void 0);function Xv(e){const t=f.useContext(QC);return e||t||"ltr"}const JC=["top","right","bottom","left"],fr=Math.min,un=Math.max,gi=Math.round,yi=Math.floor,Rn=e=>({x:e,y:e}),ex={left:"right",right:"left",bottom:"top",top:"bottom"},tx={start:"end",end:"start"};function El(e,t,n){return un(e,fr(t,n))}function qn(e,t){return typeof e=="function"?e(t):e}function Gn(e){return e.split("-")[0]}function oo(e){return e.split("-")[1]}function Ml(e){return e==="x"?"y":"x"}function Pl(e){return e==="y"?"height":"width"}const nx=new Set(["top","bottom"]);function An(e){return nx.has(Gn(e))?"y":"x"}function Dl(e){return Ml(An(e))}function rx(e,t,n){n===void 0&&(n=!1);const r=oo(e),o=Dl(e),a=Pl(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(i=bi(i)),[i,bi(i)]}function ox(e){const t=bi(e);return[kl(e),t,kl(t)]}function kl(e){return e.replace(/start|end/g,t=>tx[t])}const Zv=["left","right"],Qv=["right","left"],ax=["top","bottom"],ix=["bottom","top"];function sx(e,t,n){switch(e){case"top":case"bottom":return n?t?Qv:Zv:t?Zv:Qv;case"left":case"right":return t?ax:ix;default:return[]}}function lx(e,t,n,r){const o=oo(e);let a=sx(Gn(e),n==="start",r);return o&&(a=a.map(i=>i+"-"+o),t&&(a=a.concat(a.map(kl)))),a}function bi(e){return e.replace(/left|right|bottom|top/g,t=>ex[t])}function ux(e){return{top:0,right:0,bottom:0,left:0,...e}}function Jv(e){return typeof e!="number"?ux(e):{top:e,right:e,bottom:e,left:e}}function wi(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function em(e,t,n){let{reference:r,floating:o}=e;const a=An(t),i=Dl(t),s=Pl(i),u=Gn(t),c=a==="y",d=r.x+r.width/2-o.width/2,l=r.y+r.height/2-o.height/2,h=r[s]/2-o[s]/2;let m;switch(u){case"top":m={x:d,y:r.y-o.height};break;case"bottom":m={x:d,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:l};break;case"left":m={x:r.x-o.width,y:l};break;default:m={x:r.x,y:r.y}}switch(oo(t)){case"start":m[i]-=h*(n&&c?-1:1);break;case"end":m[i]+=h*(n&&c?-1:1);break}return m}const cx=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:a=[],platform:i}=n,s=a.filter(Boolean),u=await(i.isRTL==null?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:l}=em(c,r,u),h=r,m={},y=0;for(let w=0;w<s.length;w++){const{name:v,fn:p}=s[w],{x:g,y:b,data:C,reset:x}=await p({x:d,y:l,initialPlacement:r,placement:h,strategy:o,middlewareData:m,rects:c,platform:i,elements:{reference:e,floating:t}});d=g!=null?g:d,l=b!=null?b:l,m={...m,[v]:{...m[v],...C}},x&&y<=50&&(y++,typeof x=="object"&&(x.placement&&(h=x.placement),x.rects&&(c=x.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):x.rects),{x:d,y:l}=em(c,h,u)),w=-1)}return{x:d,y:l,placement:h,strategy:o,middlewareData:m}};async function Ho(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:a,rects:i,elements:s,strategy:u}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:l="floating",altBoundary:h=!1,padding:m=0}=qn(t,e),y=Jv(m),v=s[h?l==="floating"?"reference":"floating":l],p=wi(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(v)))==null||n?v:v.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(s.floating)),boundary:c,rootBoundary:d,strategy:u})),g=l==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,b=await(a.getOffsetParent==null?void 0:a.getOffsetParent(s.floating)),C=await(a.isElement==null?void 0:a.isElement(b))?await(a.getScale==null?void 0:a.getScale(b))||{x:1,y:1}:{x:1,y:1},x=wi(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:g,offsetParent:b,strategy:u}):g);return{top:(p.top-x.top+y.top)/C.y,bottom:(x.bottom-p.bottom+y.bottom)/C.y,left:(p.left-x.left+y.left)/C.x,right:(x.right-p.right+y.right)/C.x}}const dx=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:a,platform:i,elements:s,middlewareData:u}=t,{element:c,padding:d=0}=qn(e,t)||{};if(c==null)return{};const l=Jv(d),h={x:n,y:r},m=Dl(o),y=Pl(m),w=await i.getDimensions(c),v=m==="y",p=v?"top":"left",g=v?"bottom":"right",b=v?"clientHeight":"clientWidth",C=a.reference[y]+a.reference[m]-h[m]-a.floating[y],x=h[m]-a.reference[m],S=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c));let E=S?S[b]:0;(!E||!await(i.isElement==null?void 0:i.isElement(S)))&&(E=s.floating[b]||a.floating[y]);const M=C/2-x/2,k=E/2-w[y]/2-1,T=fr(l[p],k),R=fr(l[g],k),F=T,V=E-w[y]-R,$=E/2-w[y]/2+M,L=El(F,$,V),_=!u.arrow&&oo(o)!=null&&$!==L&&a.reference[y]/2-($<F?T:R)-w[y]/2<0,H=_?$<F?$-F:$-V:0;return{[m]:h[m]+H,data:{[m]:L,centerOffset:$-L-H,..._&&{alignmentOffset:H}},reset:_}}}),fx=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:a,rects:i,initialPlacement:s,platform:u,elements:c}=t,{mainAxis:d=!0,crossAxis:l=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:w=!0,...v}=qn(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const p=Gn(o),g=An(s),b=Gn(s)===s,C=await(u.isRTL==null?void 0:u.isRTL(c.floating)),x=h||(b||!w?[bi(s)]:ox(s)),S=y!=="none";!h&&S&&x.push(...lx(s,w,y,C));const E=[s,...x],M=await Ho(t,v),k=[];let T=((r=a.flip)==null?void 0:r.overflows)||[];if(d&&k.push(M[p]),l){const $=rx(o,i,C);k.push(M[$[0]],M[$[1]])}if(T=[...T,{placement:o,overflows:k}],!k.every($=>$<=0)){var R,F;const $=(((R=a.flip)==null?void 0:R.index)||0)+1,L=E[$];if(L&&(!(l==="alignment"?g!==An(L):!1)||T.every(N=>N.overflows[0]>0&&An(N.placement)===g)))return{data:{index:$,overflows:T},reset:{placement:L}};let _=(F=T.filter(H=>H.overflows[0]<=0).sort((H,N)=>H.overflows[1]-N.overflows[1])[0])==null?void 0:F.placement;if(!_)switch(m){case"bestFit":{var V;const H=(V=T.filter(N=>{if(S){const z=An(N.placement);return z===g||z==="y"}return!0}).map(N=>[N.placement,N.overflows.filter(z=>z>0).reduce((z,B)=>z+B,0)]).sort((N,z)=>N[1]-z[1])[0])==null?void 0:V[0];H&&(_=H);break}case"initialPlacement":_=s;break}if(o!==_)return{reset:{placement:_}}}return{}}}};function tm(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function nm(e){return JC.some(t=>e[t]>=0)}const vx=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=qn(e,t);switch(r){case"referenceHidden":{const a=await Ho(t,{...o,elementContext:"reference"}),i=tm(a,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:nm(i)}}}case"escaped":{const a=await Ho(t,{...o,altBoundary:!0}),i=tm(a,n.floating);return{data:{escapedOffsets:i,escaped:nm(i)}}}default:return{}}}}},rm=new Set(["left","top"]);async function mx(e,t){const{placement:n,platform:r,elements:o}=e,a=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=Gn(n),s=oo(n),u=An(n)==="y",c=rm.has(i)?-1:1,d=a&&u?-1:1,l=qn(t,e);let{mainAxis:h,crossAxis:m,alignmentAxis:y}=typeof l=="number"?{mainAxis:l,crossAxis:0,alignmentAxis:null}:{mainAxis:l.mainAxis||0,crossAxis:l.crossAxis||0,alignmentAxis:l.alignmentAxis};return s&&typeof y=="number"&&(m=s==="end"?y*-1:y),u?{x:m*d,y:h*c}:{x:h*c,y:m*d}}const hx=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:a,placement:i,middlewareData:s}=t,u=await mx(t,e);return i===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:o+u.x,y:a+u.y,data:{...u,placement:i}}}}},px=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:a=!0,crossAxis:i=!1,limiter:s={fn:v=>{let{x:p,y:g}=v;return{x:p,y:g}}},...u}=qn(e,t),c={x:n,y:r},d=await Ho(t,u),l=An(Gn(o)),h=Ml(l);let m=c[h],y=c[l];if(a){const v=h==="y"?"top":"left",p=h==="y"?"bottom":"right",g=m+d[v],b=m-d[p];m=El(g,m,b)}if(i){const v=l==="y"?"top":"left",p=l==="y"?"bottom":"right",g=y+d[v],b=y-d[p];y=El(g,y,b)}const w=s.fn({...t,[h]:m,[l]:y});return{...w,data:{x:w.x-n,y:w.y-r,enabled:{[h]:a,[l]:i}}}}}},gx=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:a,middlewareData:i}=t,{offset:s=0,mainAxis:u=!0,crossAxis:c=!0}=qn(e,t),d={x:n,y:r},l=An(o),h=Ml(l);let m=d[h],y=d[l];const w=qn(s,t),v=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(u){const b=h==="y"?"height":"width",C=a.reference[h]-a.floating[b]+v.mainAxis,x=a.reference[h]+a.reference[b]-v.mainAxis;m<C?m=C:m>x&&(m=x)}if(c){var p,g;const b=h==="y"?"width":"height",C=rm.has(Gn(o)),x=a.reference[l]-a.floating[b]+(C&&((p=i.offset)==null?void 0:p[l])||0)+(C?0:v.crossAxis),S=a.reference[l]+a.reference[b]+(C?0:((g=i.offset)==null?void 0:g[l])||0)-(C?v.crossAxis:0);y<x?y=x:y>S&&(y=S)}return{[h]:m,[l]:y}}}},yx=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:a,platform:i,elements:s}=t,{apply:u=()=>{},...c}=qn(e,t),d=await Ho(t,c),l=Gn(o),h=oo(o),m=An(o)==="y",{width:y,height:w}=a.floating;let v,p;l==="top"||l==="bottom"?(v=l,p=h===(await(i.isRTL==null?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(p=l,v=h==="end"?"top":"bottom");const g=w-d.top-d.bottom,b=y-d.left-d.right,C=fr(w-d[v],g),x=fr(y-d[p],b),S=!t.middlewareData.shift;let E=C,M=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(M=b),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(E=g),S&&!h){const T=un(d.left,0),R=un(d.right,0),F=un(d.top,0),V=un(d.bottom,0);m?M=y-2*(T!==0||R!==0?T+R:un(d.left,d.right)):E=w-2*(F!==0||V!==0?F+V:un(d.top,d.bottom))}await u({...t,availableWidth:M,availableHeight:E});const k=await i.getDimensions(s.floating);return y!==k.width||w!==k.height?{reset:{rects:!0}}:{}}}};function Ci(){return typeof window<"u"}function ao(e){return om(e)?(e.nodeName||"").toLowerCase():"#document"}function cn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ln(e){var t;return(t=(om(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function om(e){return Ci()?e instanceof Node||e instanceof cn(e).Node:!1}function Sn(e){return Ci()?e instanceof Element||e instanceof cn(e).Element:!1}function $n(e){return Ci()?e instanceof HTMLElement||e instanceof cn(e).HTMLElement:!1}function am(e){return!Ci()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof cn(e).ShadowRoot}const bx=new Set(["inline","contents"]);function Vo(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=En(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!bx.has(o)}const wx=new Set(["table","td","th"]);function Cx(e){return wx.has(ao(e))}const xx=[":popover-open",":modal"];function xi(e){return xx.some(t=>{try{return e.matches(t)}catch{return!1}})}const Sx=["transform","translate","scale","rotate","perspective"],Ex=["transform","translate","scale","rotate","perspective","filter"],Mx=["paint","layout","strict","content"];function Nl(e){const t=_l(),n=Sn(e)?En(e):e;return Sx.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||Ex.some(r=>(n.willChange||"").includes(r))||Mx.some(r=>(n.contain||"").includes(r))}function Px(e){let t=vr(e);for(;$n(t)&&!io(t);){if(Nl(t))return t;if(xi(t))return null;t=vr(t)}return null}function _l(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Dx=new Set(["html","body","#document"]);function io(e){return Dx.has(ao(e))}function En(e){return cn(e).getComputedStyle(e)}function Si(e){return Sn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function vr(e){if(ao(e)==="html")return e;const t=e.assignedSlot||e.parentNode||am(e)&&e.host||Ln(e);return am(t)?t.host:t}function im(e){const t=vr(e);return io(t)?e.ownerDocument?e.ownerDocument.body:e.body:$n(t)&&Vo(t)?t:im(t)}function Wo(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=im(e),a=o===((r=e.ownerDocument)==null?void 0:r.body),i=cn(o);if(a){const s=Ol(i);return t.concat(i,i.visualViewport||[],Vo(o)?o:[],s&&n?Wo(s):[])}return t.concat(o,Wo(o,[],n))}function Ol(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function sm(e){const t=En(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=$n(e),a=o?e.offsetWidth:n,i=o?e.offsetHeight:r,s=gi(n)!==a||gi(r)!==i;return s&&(n=a,r=i),{width:n,height:r,$:s}}function Tl(e){return Sn(e)?e:e.contextElement}function so(e){const t=Tl(e);if(!$n(t))return Rn(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:a}=sm(t);let i=(a?gi(n.width):n.width)/r,s=(a?gi(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!s||!Number.isFinite(s))&&(s=1),{x:i,y:s}}const kx=Rn(0);function lm(e){const t=cn(e);return!_l()||!t.visualViewport?kx:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Nx(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==cn(e)?!1:t}function Nr(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),a=Tl(e);let i=Rn(1);t&&(r?Sn(r)&&(i=so(r)):i=so(e));const s=Nx(a,n,r)?lm(a):Rn(0);let u=(o.left+s.x)/i.x,c=(o.top+s.y)/i.y,d=o.width/i.x,l=o.height/i.y;if(a){const h=cn(a),m=r&&Sn(r)?cn(r):r;let y=h,w=Ol(y);for(;w&&r&&m!==y;){const v=so(w),p=w.getBoundingClientRect(),g=En(w),b=p.left+(w.clientLeft+parseFloat(g.paddingLeft))*v.x,C=p.top+(w.clientTop+parseFloat(g.paddingTop))*v.y;u*=v.x,c*=v.y,d*=v.x,l*=v.y,u+=b,c+=C,y=cn(w),w=Ol(y)}}return wi({width:d,height:l,x:u,y:c})}function Il(e,t){const n=Si(e).scrollLeft;return t?t.left+n:Nr(Ln(e)).left+n}function um(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:Il(e,r)),a=r.top+t.scrollTop;return{x:o,y:a}}function _x(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const a=o==="fixed",i=Ln(r),s=t?xi(t.floating):!1;if(r===i||s&&a)return n;let u={scrollLeft:0,scrollTop:0},c=Rn(1);const d=Rn(0),l=$n(r);if((l||!l&&!a)&&((ao(r)!=="body"||Vo(i))&&(u=Si(r)),$n(r))){const m=Nr(r);c=so(r),d.x=m.x+r.clientLeft,d.y=m.y+r.clientTop}const h=i&&!l&&!a?um(i,u,!0):Rn(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-u.scrollLeft*c.x+d.x+h.x,y:n.y*c.y-u.scrollTop*c.y+d.y+h.y}}function Ox(e){return Array.from(e.getClientRects())}function Tx(e){const t=Ln(e),n=Si(e),r=e.ownerDocument.body,o=un(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=un(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+Il(e);const s=-n.scrollTop;return En(r).direction==="rtl"&&(i+=un(t.clientWidth,r.clientWidth)-o),{width:o,height:a,x:i,y:s}}function Ix(e,t){const n=cn(e),r=Ln(e),o=n.visualViewport;let a=r.clientWidth,i=r.clientHeight,s=0,u=0;if(o){a=o.width,i=o.height;const c=_l();(!c||c&&t==="fixed")&&(s=o.offsetLeft,u=o.offsetTop)}return{width:a,height:i,x:s,y:u}}const Rx=new Set(["absolute","fixed"]);function Ax(e,t){const n=Nr(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,a=$n(e)?so(e):Rn(1),i=e.clientWidth*a.x,s=e.clientHeight*a.y,u=o*a.x,c=r*a.y;return{width:i,height:s,x:u,y:c}}function cm(e,t,n){let r;if(t==="viewport")r=Ix(e,n);else if(t==="document")r=Tx(Ln(e));else if(Sn(t))r=Ax(t,n);else{const o=lm(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return wi(r)}function dm(e,t){const n=vr(e);return n===t||!Sn(n)||io(n)?!1:En(n).position==="fixed"||dm(n,t)}function Lx(e,t){const n=t.get(e);if(n)return n;let r=Wo(e,[],!1).filter(s=>Sn(s)&&ao(s)!=="body"),o=null;const a=En(e).position==="fixed";let i=a?vr(e):e;for(;Sn(i)&&!io(i);){const s=En(i),u=Nl(i);!u&&s.position==="fixed"&&(o=null),(a?!u&&!o:!u&&s.position==="static"&&!!o&&Rx.has(o.position)||Vo(i)&&!u&&dm(e,i))?r=r.filter(d=>d!==i):o=s,i=vr(i)}return t.set(e,r),r}function $x(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?xi(t)?[]:Lx(t,this._c):[].concat(n),r],s=i[0],u=i.reduce((c,d)=>{const l=cm(t,d,o);return c.top=un(l.top,c.top),c.right=fr(l.right,c.right),c.bottom=fr(l.bottom,c.bottom),c.left=un(l.left,c.left),c},cm(t,s,o));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function Fx(e){const{width:t,height:n}=sm(e);return{width:t,height:n}}function zx(e,t,n){const r=$n(t),o=Ln(t),a=n==="fixed",i=Nr(e,!0,a,t);let s={scrollLeft:0,scrollTop:0};const u=Rn(0);function c(){u.x=Il(o)}if(r||!r&&!a)if((ao(t)!=="body"||Vo(o))&&(s=Si(t)),r){const m=Nr(t,!0,a,t);u.x=m.x+t.clientLeft,u.y=m.y+t.clientTop}else o&&c();a&&!r&&o&&c();const d=o&&!r&&!a?um(o,s):Rn(0),l=i.left+s.scrollLeft-u.x-d.x,h=i.top+s.scrollTop-u.y-d.y;return{x:l,y:h,width:i.width,height:i.height}}function Rl(e){return En(e).position==="static"}function fm(e,t){if(!$n(e)||En(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ln(e)===n&&(n=n.ownerDocument.body),n}function vm(e,t){const n=cn(e);if(xi(e))return n;if(!$n(e)){let o=vr(e);for(;o&&!io(o);){if(Sn(o)&&!Rl(o))return o;o=vr(o)}return n}let r=fm(e,t);for(;r&&Cx(r)&&Rl(r);)r=fm(r,t);return r&&io(r)&&Rl(r)&&!Nl(r)?n:r||Px(e)||n}const Hx=async function(e){const t=this.getOffsetParent||vm,n=this.getDimensions,r=await n(e.floating);return{reference:zx(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Vx(e){return En(e).direction==="rtl"}const Wx={convertOffsetParentRelativeRectToViewportRelativeRect:_x,getDocumentElement:Ln,getClippingRect:$x,getOffsetParent:vm,getElementRects:Hx,getClientRects:Ox,getDimensions:Fx,getScale:so,isElement:Sn,isRTL:Vx};function mm(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Bx(e,t){let n=null,r;const o=Ln(e);function a(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function i(s,u){s===void 0&&(s=!1),u===void 0&&(u=1),a();const c=e.getBoundingClientRect(),{left:d,top:l,width:h,height:m}=c;if(s||t(),!h||!m)return;const y=yi(l),w=yi(o.clientWidth-(d+h)),v=yi(o.clientHeight-(l+m)),p=yi(d),b={rootMargin:-y+"px "+-w+"px "+-v+"px "+-p+"px",threshold:un(0,fr(1,u))||1};let C=!0;function x(S){const E=S[0].intersectionRatio;if(E!==u){if(!C)return i();E?i(!1,E):r=setTimeout(()=>{i(!1,1e-7)},1e3)}E===1&&!mm(c,e.getBoundingClientRect())&&i(),C=!1}try{n=new IntersectionObserver(x,{...b,root:o.ownerDocument})}catch{n=new IntersectionObserver(x,b)}n.observe(e)}return i(!0),a}function jx(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,c=Tl(e),d=o||a?[...c?Wo(c):[],...Wo(t)]:[];d.forEach(p=>{o&&p.addEventListener("scroll",n,{passive:!0}),a&&p.addEventListener("resize",n)});const l=c&&s?Bx(c,n):null;let h=-1,m=null;i&&(m=new ResizeObserver(p=>{let[g]=p;g&&g.target===c&&m&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var b;(b=m)==null||b.observe(t)})),n()}),c&&!u&&m.observe(c),m.observe(t));let y,w=u?Nr(e):null;u&&v();function v(){const p=Nr(e);w&&!mm(w,p)&&n(),w=p,y=requestAnimationFrame(v)}return n(),()=>{var p;d.forEach(g=>{o&&g.removeEventListener("scroll",n),a&&g.removeEventListener("resize",n)}),l==null||l(),(p=m)==null||p.disconnect(),m=null,u&&cancelAnimationFrame(y)}}const Yx=hx,Ux=px,qx=fx,Gx=yx,Kx=vx,hm=dx,Xx=gx,Zx=(e,t,n)=>{const r=new Map,o={platform:Wx,...n},a={...o.platform,_c:r};return cx(e,t,{...o,platform:a})};var Qx=typeof document<"u",Jx=function(){},Ei=Qx?D.useLayoutEffect:Jx;function Mi(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Mi(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const a=o[r];if(!(a==="_owner"&&e.$$typeof)&&!Mi(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function pm(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function gm(e,t){const n=pm(e);return Math.round(t*n)/n}function Al(e){const t=f.useRef(e);return Ei(()=>{t.current=e}),t}function eS(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:a,floating:i}={},transform:s=!0,whileElementsMounted:u,open:c}=e,[d,l]=f.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,m]=f.useState(r);Mi(h,r)||m(r);const[y,w]=f.useState(null),[v,p]=f.useState(null),g=f.useCallback(N=>{N!==S.current&&(S.current=N,w(N))},[]),b=f.useCallback(N=>{N!==E.current&&(E.current=N,p(N))},[]),C=a||y,x=i||v,S=f.useRef(null),E=f.useRef(null),M=f.useRef(d),k=u!=null,T=Al(u),R=Al(o),F=Al(c),V=f.useCallback(()=>{if(!S.current||!E.current)return;const N={placement:t,strategy:n,middleware:h};R.current&&(N.platform=R.current),Zx(S.current,E.current,N).then(z=>{const B={...z,isPositioned:F.current!==!1};$.current&&!Mi(M.current,B)&&(M.current=B,ku.flushSync(()=>{l(B)}))})},[h,t,n,R,F]);Ei(()=>{c===!1&&M.current.isPositioned&&(M.current.isPositioned=!1,l(N=>({...N,isPositioned:!1})))},[c]);const $=f.useRef(!1);Ei(()=>($.current=!0,()=>{$.current=!1}),[]),Ei(()=>{if(C&&(S.current=C),x&&(E.current=x),C&&x){if(T.current)return T.current(C,x,V);V()}},[C,x,V,T,k]);const L=f.useMemo(()=>({reference:S,floating:E,setReference:g,setFloating:b}),[g,b]),_=f.useMemo(()=>({reference:C,floating:x}),[C,x]),H=f.useMemo(()=>{const N={position:n,left:0,top:0};if(!_.floating)return N;const z=gm(_.floating,d.x),B=gm(_.floating,d.y);return s?{...N,transform:"translate("+z+"px, "+B+"px)",...pm(_.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:z,top:B}},[n,s,_.floating,d.x,d.y]);return f.useMemo(()=>({...d,update:V,refs:L,elements:_,floatingStyles:H}),[d,V,L,_,H])}const tS=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?hm({element:r.current,padding:o}).fn(n):{}:r?hm({element:r,padding:o}).fn(n):{}}}},nS=(e,t)=>({...Yx(e),options:[e,t]}),rS=(e,t)=>({...Ux(e),options:[e,t]}),oS=(e,t)=>({...Xx(e),options:[e,t]}),aS=(e,t)=>({...qx(e),options:[e,t]}),iS=(e,t)=>({...Gx(e),options:[e,t]}),sS=(e,t)=>({...Kx(e),options:[e,t]}),lS=(e,t)=>({...tS(e),options:[e,t]});var uS="Arrow",ym=f.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...a}=e;return P.jsx(gt.svg,{...a,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:P.jsx("polygon",{points:"0,0 30,0 15,10"})})});ym.displayName=uS;var cS=ym;function dS(e){const[t,n]=f.useState(void 0);return tr(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const a=o[0];let i,s;if("borderBoxSize"in a){const u=a.borderBoxSize,c=Array.isArray(u)?u[0]:u;i=c.inlineSize,s=c.blockSize}else i=e.offsetWidth,s=e.offsetHeight;n({width:i,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Ll="Popper",[bm,mr]=Wn(Ll),[fS,wm]=bm(Ll),Cm=e=>{const{__scopePopper:t,children:n}=e,[r,o]=f.useState(null);return P.jsx(fS,{scope:t,anchor:r,onAnchorChange:o,children:n})};Cm.displayName=Ll;var xm="PopperAnchor",Sm=f.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,a=wm(xm,n),i=f.useRef(null),s=Pt(t,i);return f.useEffect(()=>{a.onAnchorChange((r==null?void 0:r.current)||i.current)}),r?null:P.jsx(gt.div,{...o,ref:s})});Sm.displayName=xm;var $l="PopperContent",[vS,mS]=bm($l),Em=f.forwardRef((e,t)=>{var J,G,q,Z,O,I,W,K;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:a="center",alignOffset:i=0,arrowPadding:s=0,avoidCollisions:u=!0,collisionBoundary:c=[],collisionPadding:d=0,sticky:l="partial",hideWhenDetached:h=!1,updatePositionStrategy:m="optimized",onPlaced:y,...w}=e,v=wm($l,n),[p,g]=f.useState(null),b=Pt(t,oe=>g(oe)),[C,x]=f.useState(null),S=dS(C),E=(J=S==null?void 0:S.width)!=null?J:0,M=(G=S==null?void 0:S.height)!=null?G:0,k=r+(a!=="center"?"-"+a:""),T=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},R=Array.isArray(c)?c:[c],F=R.length>0,V={padding:T,boundary:R.filter(pS),altBoundary:F},{refs:$,floatingStyles:L,placement:_,isPositioned:H,middlewareData:N}=eS({strategy:"fixed",placement:k,whileElementsMounted:(...oe)=>jx(...oe,{animationFrame:m==="always"}),elements:{reference:v.anchor},middleware:[nS({mainAxis:o+M,alignmentAxis:i}),u&&rS({mainAxis:!0,crossAxis:!1,limiter:l==="partial"?oS():void 0,...V}),u&&aS({...V}),iS({...V,apply:({elements:oe,rects:Q,availableWidth:ae,availableHeight:ee})=>{const{width:ie,height:me}=Q.reference,ye=oe.floating.style;ye.setProperty("--radix-popper-available-width",`${ae}px`),ye.setProperty("--radix-popper-available-height",`${ee}px`),ye.setProperty("--radix-popper-anchor-width",`${ie}px`),ye.setProperty("--radix-popper-anchor-height",`${me}px`)}}),C&&lS({element:C,padding:s}),gS({arrowWidth:E,arrowHeight:M}),h&&sS({strategy:"referenceHidden",...V})]}),[z,B]=Dm(_),A=_n(y);tr(()=>{H&&(A==null||A())},[H,A]);const j=(q=N.arrow)==null?void 0:q.x,Y=(Z=N.arrow)==null?void 0:Z.y,U=((O=N.arrow)==null?void 0:O.centerOffset)!==0,[ne,te]=f.useState();return tr(()=>{p&&te(window.getComputedStyle(p).zIndex)},[p]),P.jsx("div",{ref:$.setFloating,"data-radix-popper-content-wrapper":"",style:{...L,transform:H?L.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ne,"--radix-popper-transform-origin":[(I=N.transformOrigin)==null?void 0:I.x,(W=N.transformOrigin)==null?void 0:W.y].join(" "),...((K=N.hide)==null?void 0:K.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:P.jsx(vS,{scope:n,placedSide:z,onArrowChange:x,arrowX:j,arrowY:Y,shouldHideArrow:U,children:P.jsx(gt.div,{"data-side":z,"data-align":B,...w,ref:b,style:{...w.style,animation:H?void 0:"none"}})})})});Em.displayName=$l;var Mm="PopperArrow",hS={top:"bottom",right:"left",bottom:"top",left:"right"},Pm=f.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,a=mS(Mm,r),i=hS[a.placedSide];return P.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:P.jsx(cS,{...o,ref:n,style:{...o.style,display:"block"}})})});Pm.displayName=Mm;function pS(e){return e!==null}var gS=e=>({name:"transformOrigin",options:e,fn(t){var v,p,g,b,C;const{placement:n,rects:r,middlewareData:o}=t,i=((v=o.arrow)==null?void 0:v.centerOffset)!==0,s=i?0:e.arrowWidth,u=i?0:e.arrowHeight,[c,d]=Dm(n),l={start:"0%",center:"50%",end:"100%"}[d],h=((g=(p=o.arrow)==null?void 0:p.x)!=null?g:0)+s/2,m=((C=(b=o.arrow)==null?void 0:b.y)!=null?C:0)+u/2;let y="",w="";return c==="bottom"?(y=i?l:`${h}px`,w=`${-u}px`):c==="top"?(y=i?l:`${h}px`,w=`${r.floating.height+u}px`):c==="right"?(y=`${-u}px`,w=i?l:`${m}px`):c==="left"&&(y=`${r.floating.width+u}px`,w=i?l:`${m}px`),{data:{x:y,y:w}}}});function Dm(e){const[t,n="center"]=e.split("-");return[t,n]}var Bo=Cm,jo=Sm,Pi=Em,Di=Pm,Fl="rovingFocusGroup.onEntryFocus",yS={bubbles:!1,cancelable:!0},Yo="RovingFocusGroup",[zl,km,bS]=Kv(Yo),[wS,Nm]=Wn(Yo,[bS]),[CS,xS]=wS(Yo),_m=f.forwardRef((e,t)=>P.jsx(zl.Provider,{scope:e.__scopeRovingFocusGroup,children:P.jsx(zl.Slot,{scope:e.__scopeRovingFocusGroup,children:P.jsx(SS,{...e,ref:t})})}));_m.displayName=Yo;var SS=f.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:a,currentTabStopId:i,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:u,onEntryFocus:c,preventScrollOnEntryFocus:d=!1,...l}=e,h=f.useRef(null),m=Pt(t,h),y=Xv(a),[w,v]=xr({prop:i,defaultProp:s!=null?s:null,onChange:u,caller:Yo}),[p,g]=f.useState(!1),b=_n(c),C=km(n),x=f.useRef(!1),[S,E]=f.useState(0);return f.useEffect(()=>{const M=h.current;if(M)return M.addEventListener(Fl,b),()=>M.removeEventListener(Fl,b)},[b]),P.jsx(CS,{scope:n,orientation:r,dir:y,loop:o,currentTabStopId:w,onItemFocus:f.useCallback(M=>v(M),[v]),onItemShiftTab:f.useCallback(()=>g(!0),[]),onFocusableItemAdd:f.useCallback(()=>E(M=>M+1),[]),onFocusableItemRemove:f.useCallback(()=>E(M=>M-1),[]),children:P.jsx(gt.div,{tabIndex:p||S===0?-1:0,"data-orientation":r,...l,ref:m,style:{outline:"none",...e.style},onMouseDown:Ie(e.onMouseDown,()=>{x.current=!0}),onFocus:Ie(e.onFocus,M=>{const k=!x.current;if(M.target===M.currentTarget&&k&&!p){const T=new CustomEvent(Fl,yS);if(M.currentTarget.dispatchEvent(T),!T.defaultPrevented){const R=C().filter(_=>_.focusable),F=R.find(_=>_.active),V=R.find(_=>_.id===w),L=[F,V,...R].filter(Boolean).map(_=>_.ref.current);Im(L,d)}}x.current=!1}),onBlur:Ie(e.onBlur,()=>g(!1))})})}),Om="RovingFocusGroupItem",Tm=f.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:a,children:i,...s}=e,u=Nn(),c=a||u,d=xS(Om,n),l=d.currentTabStopId===c,h=km(n),{onFocusableItemAdd:m,onFocusableItemRemove:y,currentTabStopId:w}=d;return f.useEffect(()=>{if(r)return m(),()=>y()},[r,m,y]),P.jsx(zl.ItemSlot,{scope:n,id:c,focusable:r,active:o,children:P.jsx(gt.span,{tabIndex:l?0:-1,"data-orientation":d.orientation,...s,ref:t,onMouseDown:Ie(e.onMouseDown,v=>{r?d.onItemFocus(c):v.preventDefault()}),onFocus:Ie(e.onFocus,()=>d.onItemFocus(c)),onKeyDown:Ie(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){d.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const p=PS(v,d.orientation,d.dir);if(p!==void 0){if(v.metaKey||v.ctrlKey||v.altKey||v.shiftKey)return;v.preventDefault();let b=h().filter(C=>C.focusable).map(C=>C.ref.current);if(p==="last")b.reverse();else if(p==="prev"||p==="next"){p==="prev"&&b.reverse();const C=b.indexOf(v.currentTarget);b=d.loop?DS(b,C+1):b.slice(C+1)}setTimeout(()=>Im(b))}}),children:typeof i=="function"?i({isCurrentTabStop:l,hasTabStop:w!=null}):i})})});Tm.displayName=Om;var ES={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function MS(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function PS(e,t,n){const r=MS(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return ES[r]}function Im(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function DS(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var kS=_m,NS=Tm,Hl=["Enter"," "],_S=["ArrowDown","PageUp","Home"],Rm=["ArrowUp","PageDown","End"],OS=[..._S,...Rm],TS={ltr:[...Hl,"ArrowRight"],rtl:[...Hl,"ArrowLeft"]},IS={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Uo="Menu",[qo,RS,AS]=Kv(Uo),[_r,Am]=Wn(Uo,[AS,mr,Nm]),Go=mr(),Lm=Nm(),[$m,hr]=_r(Uo),[LS,Ko]=_r(Uo),Fm=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:a,modal:i=!0}=e,s=Go(t),[u,c]=f.useState(null),d=f.useRef(!1),l=_n(a),h=Xv(o);return f.useEffect(()=>{const m=()=>{d.current=!0,document.addEventListener("pointerdown",y,{capture:!0,once:!0}),document.addEventListener("pointermove",y,{capture:!0,once:!0})},y=()=>d.current=!1;return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",y,{capture:!0}),document.removeEventListener("pointermove",y,{capture:!0})}},[]),P.jsx(Bo,{...s,children:P.jsx($m,{scope:t,open:n,onOpenChange:l,content:u,onContentChange:c,children:P.jsx(LS,{scope:t,onClose:f.useCallback(()=>l(!1),[l]),isUsingKeyboardRef:d,dir:h,modal:i,children:r})})})};Fm.displayName=Uo;var $S="MenuAnchor",Vl=f.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=Go(n);return P.jsx(jo,{...o,...r,ref:t})});Vl.displayName=$S;var Wl="MenuPortal",[FS,zm]=_r(Wl,{forceMount:void 0}),Hm=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,a=hr(Wl,t);return P.jsx(FS,{scope:t,forceMount:n,children:P.jsx(on,{present:n||a.open,children:P.jsx(Hr,{asChild:!0,container:o,children:r})})})};Hm.displayName=Wl;var pn="MenuContent",[zS,Bl]=_r(pn),Vm=f.forwardRef((e,t)=>{const n=zm(pn,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,a=hr(pn,e.__scopeMenu),i=Ko(pn,e.__scopeMenu);return P.jsx(qo.Provider,{scope:e.__scopeMenu,children:P.jsx(on,{present:r||a.open,children:P.jsx(qo.Slot,{scope:e.__scopeMenu,children:i.modal?P.jsx(HS,{...o,ref:t}):P.jsx(VS,{...o,ref:t})})})})}),HS=f.forwardRef((e,t)=>{const n=hr(pn,e.__scopeMenu),r=f.useRef(null),o=Pt(t,r);return f.useEffect(()=>{const a=r.current;if(a)return bs(a)},[]),P.jsx(jl,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Ie(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),VS=f.forwardRef((e,t)=>{const n=hr(pn,e.__scopeMenu);return P.jsx(jl,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),WS=Cr("MenuContent.ScrollLock"),jl=f.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:a,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEntryFocus:u,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:l,onInteractOutside:h,onDismiss:m,disableOutsideScroll:y,...w}=e,v=hr(pn,n),p=Ko(pn,n),g=Go(n),b=Lm(n),C=RS(n),[x,S]=f.useState(null),E=f.useRef(null),M=Pt(t,E,v.onContentChange),k=f.useRef(0),T=f.useRef(""),R=f.useRef(0),F=f.useRef(null),V=f.useRef("right"),$=f.useRef(0),L=y?Ca:f.Fragment,_=y?{as:WS,allowPinchZoom:!0}:void 0,H=z=>{var J,G;const B=T.current+z,A=C().filter(q=>!q.disabled),j=document.activeElement,Y=(J=A.find(q=>q.ref.current===j))==null?void 0:J.textValue,U=A.map(q=>q.textValue),ne=eE(U,B,Y),te=(G=A.find(q=>q.textValue===ne))==null?void 0:G.ref.current;(function q(Z){T.current=Z,window.clearTimeout(k.current),Z!==""&&(k.current=window.setTimeout(()=>q(""),1e3))})(B),te&&setTimeout(()=>te.focus())};f.useEffect(()=>()=>window.clearTimeout(k.current),[]),vs();const N=f.useCallback(z=>{var A,j;return V.current===((A=F.current)==null?void 0:A.side)&&nE(z,(j=F.current)==null?void 0:j.area)},[]);return P.jsx(zS,{scope:n,searchRef:T,onItemEnter:f.useCallback(z=>{N(z)&&z.preventDefault()},[N]),onItemLeave:f.useCallback(z=>{var B;N(z)||((B=E.current)==null||B.focus(),S(null))},[N]),onTriggerLeave:f.useCallback(z=>{N(z)&&z.preventDefault()},[N]),pointerGraceTimerRef:R,onPointerGraceIntentChange:f.useCallback(z=>{F.current=z},[]),children:P.jsx(L,{..._,children:P.jsx(ma,{asChild:!0,trapped:o,onMountAutoFocus:Ie(a,z=>{var B;z.preventDefault(),(B=E.current)==null||B.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:P.jsx(zr,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:l,onInteractOutside:h,onDismiss:m,children:P.jsx(kS,{asChild:!0,...b,dir:p.dir,orientation:"vertical",loop:r,currentTabStopId:x,onCurrentTabStopIdChange:S,onEntryFocus:Ie(u,z=>{p.isUsingKeyboardRef.current||z.preventDefault()}),preventScrollOnEntryFocus:!0,children:P.jsx(Pi,{role:"menu","aria-orientation":"vertical","data-state":ah(v.open),"data-radix-menu-content":"",dir:p.dir,...g,...w,ref:M,style:{outline:"none",...w.style},onKeyDown:Ie(w.onKeyDown,z=>{const A=z.target.closest("[data-radix-menu-content]")===z.currentTarget,j=z.ctrlKey||z.altKey||z.metaKey,Y=z.key.length===1;A&&(z.key==="Tab"&&z.preventDefault(),!j&&Y&&H(z.key));const U=E.current;if(z.target!==U||!OS.includes(z.key))return;z.preventDefault();const te=C().filter(J=>!J.disabled).map(J=>J.ref.current);Rm.includes(z.key)&&te.reverse(),QS(te)}),onBlur:Ie(e.onBlur,z=>{z.currentTarget.contains(z.target)||(window.clearTimeout(k.current),T.current="")}),onPointerMove:Ie(e.onPointerMove,Zo(z=>{const B=z.target,A=$.current!==z.clientX;if(z.currentTarget.contains(B)&&A){const j=z.clientX>$.current?"right":"left";V.current=j,$.current=z.clientX}}))})})})})})})});Vm.displayName=pn;var BS="MenuGroup",Yl=f.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return P.jsx(gt.div,{role:"group",...r,ref:t})});Yl.displayName=BS;var jS="MenuLabel",Wm=f.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return P.jsx(gt.div,{...r,ref:t})});Wm.displayName=jS;var ki="MenuItem",Bm="menu.itemSelect",Ni=f.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,a=f.useRef(null),i=Ko(ki,e.__scopeMenu),s=Bl(ki,e.__scopeMenu),u=Pt(t,a),c=f.useRef(!1),d=()=>{const l=a.current;if(!n&&l){const h=new CustomEvent(Bm,{bubbles:!0,cancelable:!0});l.addEventListener(Bm,m=>r==null?void 0:r(m),{once:!0}),fc(l,h),h.defaultPrevented?c.current=!1:i.onClose()}};return P.jsx(jm,{...o,ref:u,disabled:n,onClick:Ie(e.onClick,d),onPointerDown:l=>{var h;(h=e.onPointerDown)==null||h.call(e,l),c.current=!0},onPointerUp:Ie(e.onPointerUp,l=>{var h;c.current||(h=l.currentTarget)==null||h.click()}),onKeyDown:Ie(e.onKeyDown,l=>{const h=s.searchRef.current!=="";n||h&&l.key===" "||Hl.includes(l.key)&&(l.currentTarget.click(),l.preventDefault())})})});Ni.displayName=ki;var jm=f.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...a}=e,i=Bl(ki,n),s=Lm(n),u=f.useRef(null),c=Pt(t,u),[d,l]=f.useState(!1),[h,m]=f.useState("");return f.useEffect(()=>{var w;const y=u.current;y&&m(((w=y.textContent)!=null?w:"").trim())},[a.children]),P.jsx(qo.ItemSlot,{scope:n,disabled:r,textValue:o!=null?o:h,children:P.jsx(NS,{asChild:!0,...s,focusable:!r,children:P.jsx(gt.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...a,ref:c,onPointerMove:Ie(e.onPointerMove,Zo(y=>{r?i.onItemLeave(y):(i.onItemEnter(y),y.defaultPrevented||y.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Ie(e.onPointerLeave,Zo(y=>i.onItemLeave(y))),onFocus:Ie(e.onFocus,()=>l(!0)),onBlur:Ie(e.onBlur,()=>l(!1))})})})}),YS="MenuCheckboxItem",Ym=f.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return P.jsx(Xm,{scope:e.__scopeMenu,checked:n,children:P.jsx(Ni,{role:"menuitemcheckbox","aria-checked":_i(n)?"mixed":n,...o,ref:t,"data-state":Gl(n),onSelect:Ie(o.onSelect,()=>r==null?void 0:r(_i(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Ym.displayName=YS;var Um="MenuRadioGroup",[US,qS]=_r(Um,{value:void 0,onValueChange:()=>{}}),qm=f.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,a=_n(r);return P.jsx(US,{scope:e.__scopeMenu,value:n,onValueChange:a,children:P.jsx(Yl,{...o,ref:t})})});qm.displayName=Um;var Gm="MenuRadioItem",Km=f.forwardRef((e,t)=>{const{value:n,...r}=e,o=qS(Gm,e.__scopeMenu),a=n===o.value;return P.jsx(Xm,{scope:e.__scopeMenu,checked:a,children:P.jsx(Ni,{role:"menuitemradio","aria-checked":a,...r,ref:t,"data-state":Gl(a),onSelect:Ie(r.onSelect,()=>{var i;return(i=o.onValueChange)==null?void 0:i.call(o,n)},{checkForDefaultPrevented:!1})})})});Km.displayName=Gm;var Ul="MenuItemIndicator",[Xm,GS]=_r(Ul,{checked:!1}),Zm=f.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,a=GS(Ul,n);return P.jsx(on,{present:r||_i(a.checked)||a.checked===!0,children:P.jsx(gt.span,{...o,ref:t,"data-state":Gl(a.checked)})})});Zm.displayName=Ul;var KS="MenuSeparator",Qm=f.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return P.jsx(gt.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});Qm.displayName=KS;var XS="MenuArrow",Jm=f.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=Go(n);return P.jsx(Di,{...o,...r,ref:t})});Jm.displayName=XS;var ql="MenuSub",[ZS,eh]=_r(ql),th=e=>{const{__scopeMenu:t,children:n,open:r=!1,onOpenChange:o}=e,a=hr(ql,t),i=Go(t),[s,u]=f.useState(null),[c,d]=f.useState(null),l=_n(o);return f.useEffect(()=>(a.open===!1&&l(!1),()=>l(!1)),[a.open,l]),P.jsx(Bo,{...i,children:P.jsx($m,{scope:t,open:r,onOpenChange:l,content:c,onContentChange:d,children:P.jsx(ZS,{scope:t,contentId:Nn(),triggerId:Nn(),trigger:s,onTriggerChange:u,children:n})})})};th.displayName=ql;var Xo="MenuSubTrigger",nh=f.forwardRef((e,t)=>{const n=hr(Xo,e.__scopeMenu),r=Ko(Xo,e.__scopeMenu),o=eh(Xo,e.__scopeMenu),a=Bl(Xo,e.__scopeMenu),i=f.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:u}=a,c={__scopeMenu:e.__scopeMenu},d=f.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return f.useEffect(()=>d,[d]),f.useEffect(()=>{const l=s.current;return()=>{window.clearTimeout(l),u(null)}},[s,u]),P.jsx(Vl,{asChild:!0,...c,children:P.jsx(jm,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":ah(n.open),...e,ref:fa(t,o.onTriggerChange),onClick:l=>{var h;(h=e.onClick)==null||h.call(e,l),!(e.disabled||l.defaultPrevented)&&(l.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Ie(e.onPointerMove,Zo(l=>{a.onItemEnter(l),!l.defaultPrevented&&!e.disabled&&!n.open&&!i.current&&(a.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:Ie(e.onPointerLeave,Zo(l=>{var m,y;d();const h=(m=n.content)==null?void 0:m.getBoundingClientRect();if(h){const w=(y=n.content)==null?void 0:y.dataset.side,v=w==="right",p=v?-5:5,g=h[v?"left":"right"],b=h[v?"right":"left"];a.onPointerGraceIntentChange({area:[{x:l.clientX+p,y:l.clientY},{x:g,y:h.top},{x:b,y:h.top},{x:b,y:h.bottom},{x:g,y:h.bottom}],side:w}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(l),l.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:Ie(e.onKeyDown,l=>{var m;const h=a.searchRef.current!=="";e.disabled||h&&l.key===" "||TS[r.dir].includes(l.key)&&(n.onOpenChange(!0),(m=n.content)==null||m.focus(),l.preventDefault())})})})});nh.displayName=Xo;var rh="MenuSubContent",oh=f.forwardRef((e,t)=>{const n=zm(pn,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,a=hr(pn,e.__scopeMenu),i=Ko(pn,e.__scopeMenu),s=eh(rh,e.__scopeMenu),u=f.useRef(null),c=Pt(t,u);return P.jsx(qo.Provider,{scope:e.__scopeMenu,children:P.jsx(on,{present:r||a.open,children:P.jsx(qo.Slot,{scope:e.__scopeMenu,children:P.jsx(jl,{id:s.contentId,"aria-labelledby":s.triggerId,...o,ref:c,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{var l;i.isUsingKeyboardRef.current&&((l=u.current)==null||l.focus()),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:Ie(e.onFocusOutside,d=>{d.target!==s.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:Ie(e.onEscapeKeyDown,d=>{i.onClose(),d.preventDefault()}),onKeyDown:Ie(e.onKeyDown,d=>{var m;const l=d.currentTarget.contains(d.target),h=IS[i.dir].includes(d.key);l&&h&&(a.onOpenChange(!1),(m=s.trigger)==null||m.focus(),d.preventDefault())})})})})})});oh.displayName=rh;function ah(e){return e?"open":"closed"}function _i(e){return e==="indeterminate"}function Gl(e){return _i(e)?"indeterminate":e?"checked":"unchecked"}function QS(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function JS(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function eE(e,t,n){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,a=n?e.indexOf(n):-1;let i=JS(e,Math.max(a,0));o.length===1&&(i=i.filter(c=>c!==n));const u=i.find(c=>c.toLowerCase().startsWith(o.toLowerCase()));return u!==n?u:void 0}function tE(e,t){const{x:n,y:r}=e;let o=!1;for(let a=0,i=t.length-1;a<t.length;i=a++){const s=t[a],u=t[i],c=s.x,d=s.y,l=u.x,h=u.y;d>r!=h>r&&n<(l-c)*(r-d)/(h-d)+c&&(o=!o)}return o}function nE(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return tE(n,t)}function Zo(e){return t=>t.pointerType==="mouse"?e(t):void 0}var rE=Fm,oE=Vl,aE=Hm,iE=Vm,sE=Yl,lE=Wm,uE=Ni,cE=Ym,dE=qm,fE=Km,vE=Zm,mE=Qm,hE=Jm,pE=th,gE=nh,yE=oh,Oi="DropdownMenu",[bE,ID]=Wn(Oi,[Am]),qt=Am(),[wE,ih]=bE(Oi),sh=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:a,onOpenChange:i,modal:s=!0}=e,u=qt(t),c=f.useRef(null),[d,l]=xr({prop:o,defaultProp:a!=null?a:!1,onChange:i,caller:Oi});return P.jsx(wE,{scope:t,triggerId:Nn(),triggerRef:c,contentId:Nn(),open:d,onOpenChange:l,onOpenToggle:f.useCallback(()=>l(h=>!h),[l]),modal:s,children:P.jsx(rE,{...u,open:d,onOpenChange:l,dir:r,modal:s,children:n})})};sh.displayName=Oi;var lh="DropdownMenuTrigger",uh=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,a=ih(lh,n),i=qt(n);return P.jsx(oE,{asChild:!0,...i,children:P.jsx(gt.button,{type:"button",id:a.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:fa(t,a.triggerRef),onPointerDown:Ie(e.onPointerDown,s=>{!r&&s.button===0&&s.ctrlKey===!1&&(a.onOpenToggle(),a.open||s.preventDefault())}),onKeyDown:Ie(e.onKeyDown,s=>{r||(["Enter"," "].includes(s.key)&&a.onOpenToggle(),s.key==="ArrowDown"&&a.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(s.key)&&s.preventDefault())})})})});uh.displayName=lh;var CE="DropdownMenuPortal",ch=e=>{const{__scopeDropdownMenu:t,...n}=e,r=qt(t);return P.jsx(aE,{...r,...n})};ch.displayName=CE;var dh="DropdownMenuContent",fh=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ih(dh,n),a=qt(n),i=f.useRef(!1);return P.jsx(iE,{id:o.contentId,"aria-labelledby":o.triggerId,...a,...r,ref:t,onCloseAutoFocus:Ie(e.onCloseAutoFocus,s=>{var u;i.current||(u=o.triggerRef.current)==null||u.focus(),i.current=!1,s.preventDefault()}),onInteractOutside:Ie(e.onInteractOutside,s=>{const u=s.detail.originalEvent,c=u.button===0&&u.ctrlKey===!0,d=u.button===2||c;(!o.modal||d)&&(i.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});fh.displayName=dh;var xE="DropdownMenuGroup",SE=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=qt(n);return P.jsx(sE,{...o,...r,ref:t})});SE.displayName=xE;var EE="DropdownMenuLabel",ME=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=qt(n);return P.jsx(lE,{...o,...r,ref:t})});ME.displayName=EE;var PE="DropdownMenuItem",vh=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=qt(n);return P.jsx(uE,{...o,...r,ref:t})});vh.displayName=PE;var DE="DropdownMenuCheckboxItem",mh=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=qt(n);return P.jsx(cE,{...o,...r,ref:t})});mh.displayName=DE;var kE="DropdownMenuRadioGroup",hh=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=qt(n);return P.jsx(dE,{...o,...r,ref:t})});hh.displayName=kE;var NE="DropdownMenuRadioItem",ph=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=qt(n);return P.jsx(fE,{...o,...r,ref:t})});ph.displayName=NE;var _E="DropdownMenuItemIndicator",gh=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=qt(n);return P.jsx(vE,{...o,...r,ref:t})});gh.displayName=_E;var OE="DropdownMenuSeparator",yh=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=qt(n);return P.jsx(mE,{...o,...r,ref:t})});yh.displayName=OE;var TE="DropdownMenuArrow",IE=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=qt(n);return P.jsx(hE,{...o,...r,ref:t})});IE.displayName=TE;var RE=e=>{const{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:o,defaultOpen:a}=e,i=qt(t),[s,u]=xr({prop:r,defaultProp:a!=null?a:!1,onChange:o,caller:"DropdownMenuSub"});return P.jsx(pE,{...i,open:s,onOpenChange:u,children:n})},AE="DropdownMenuSubTrigger",bh=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=qt(n);return P.jsx(gE,{...o,...r,ref:t})});bh.displayName=AE;var LE="DropdownMenuSubContent",wh=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=qt(n);return P.jsx(yE,{...o,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});wh.displayName=LE;var $E=sh,FE=uh,Ch=ch,zE=fh,HE=vh,VE=mh,WE=hh,BE=ph,xh=gh,jE=yh,YE=RE,UE=bh,qE=wh;function GE({...e}){return P.jsx($E,{"data-slot":"dropdown-menu",...e})}function KE({...e}){return P.jsx(Ch,{"data-slot":"dropdown-menu-portal",...e})}function XE({...e}){return P.jsx(FE,{"data-slot":"dropdown-menu-trigger",...e})}function ZE({...e}){return P.jsx(YE,{"data-slot":"dropdown-menu-sub",...e})}function QE({...e}){return P.jsx(WE,{"data-slot":"dropdown-menu-radio-group",...e})}function JE({className:e,inset:t,children:n,...r}){return P.jsxs(UE,{"data-slot":"dropdown-menu-sub-trigger","data-inset":t,className:xe(`
1399
1399
  univer-flex univer-cursor-default univer-select-none univer-items-center univer-justify-between
1400
1400
  univer-gap-2 univer-rounded univer-px-2 univer-py-1.5 univer-text-sm univer-outline-none
1401
1401
  focus:univer-bg-gray-100
1402
1402
  data-[state=open]:univer-bg-gray-100
1403
1403
  dark:focus:!univer-bg-gray-600 dark:data-[state=open]:!univer-bg-gray-600
1404
1404
  [&_svg]:univer-pointer-events-none [&_svg]:univer-size-4 [&_svg]:univer-shrink-0
1405
- `,e),...r,children:[n,P.jsx(ts,{className:"ml-auto"})]})}function eM({className:e,...t}){return P.jsx(qE,{"data-slot":"dropdown-menu-sub-content",className:Se(`
1405
+ `,e),...r,children:[n,P.jsx(ts,{className:"ml-auto"})]})}function eM({className:e,...t}){return P.jsx(qE,{"data-slot":"dropdown-menu-sub-content",className:xe(`
1406
1406
  data-[state=open]:univer-animate-in data-[state=open]:univer-fade-in-0
1407
1407
  data-[state=open]:univer-zoom-in-95
1408
1408
  data-[state=closed]:univer-animate-out data-[state=closed]:univer-fade-out-0
@@ -1415,7 +1415,7 @@ html body {
1415
1415
  univer-overflow-y-auto univer-rounded-md univer-bg-white univer-p-1.5 univer-text-gray-900
1416
1416
  univer-shadow-md
1417
1417
  dark:!univer-bg-gray-700 dark:!univer-text-white
1418
- `,yn,Cr,e),...t})}function tM({className:e,sideOffset:t=4,...n}){return P.jsx(Ch,{children:P.jsx(zE,{"data-slot":"dropdown-menu-content",sideOffset:t,className:Se(`
1418
+ `,mn,er,e),...t})}function tM({className:e,sideOffset:t=4,...n}){return P.jsx(Ch,{children:P.jsx(zE,{"data-slot":"dropdown-menu-content",sideOffset:t,className:xe(`
1419
1419
  data-[state=open]:univer-animate-in data-[state=open]:univer-fade-in-0
1420
1420
  data-[state=open]:univer-zoom-in-95
1421
1421
  data-[state=closed]:univer-animate-out data-[state=closed]:univer-fade-out-0
@@ -1428,26 +1428,26 @@ html body {
1428
1428
  univer-overflow-y-auto univer-rounded-md univer-bg-white univer-p-1.5 univer-text-gray-900
1429
1429
  univer-shadow-md
1430
1430
  dark:!univer-bg-gray-700 dark:!univer-text-white
1431
- `,yn,Cr,e),...n})})}function nM({className:e,inset:t,variant:n="default",...r}){return P.jsx(HE,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:Se(`
1431
+ `,mn,er,e),...n})})}function nM({className:e,inset:t,variant:n="default",...r}){return P.jsx(HE,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:xe(`
1432
1432
  univer-relative univer-flex univer-cursor-default univer-select-none univer-items-center univer-gap-2
1433
1433
  univer-rounded univer-px-2 univer-py-1.5 univer-text-sm univer-outline-none univer-transition-colors
1434
1434
  focus:univer-bg-gray-100
1435
1435
  data-[disabled]:univer-pointer-events-none data-[disabled]:univer-opacity-50
1436
1436
  dark:focus:!univer-bg-gray-600
1437
1437
  [&>svg]:univer-size-4 [&>svg]:univer-shrink-0
1438
- `,e),...r})}function rM({className:e,children:t,hideIndicator:n,checked:r,...o}){return P.jsxs(VE,{"data-slot":"dropdown-menu-checkbox-item",className:Se(`
1438
+ `,e),...r})}function rM({className:e,children:t,hideIndicator:n,checked:r,...o}){return P.jsxs(VE,{"data-slot":"dropdown-menu-checkbox-item",className:xe(`
1439
1439
  univer-relative univer-flex univer-cursor-default univer-select-none univer-items-center
1440
1440
  univer-rounded univer-py-1.5 univer-pr-2 univer-text-sm univer-outline-none univer-transition-colors
1441
1441
  focus:univer-bg-gray-100
1442
1442
  data-[disabled]:univer-pointer-events-none data-[disabled]:univer-opacity-50
1443
1443
  dark:focus:!univer-bg-gray-600
1444
- `,{"univer-pl-8":!n,"univer-pl-2":n},e),checked:r,...o,children:[!n&&P.jsx("span",{className:"univer-absolute univer-left-2 univer-flex univer-h-3.5 univer-w-3.5 univer-items-center univer-justify-center",children:P.jsx(xh,{children:P.jsx(Rr,{className:"univer-block univer-size-4 univer-fill-current univer-text-primary-600"})})}),t]})}function oM({className:e,children:t,hideIndicator:n,...r}){return P.jsxs(BE,{"data-slot":"dropdown-menu-radio-item",className:Se(`
1444
+ `,{"univer-pl-8":!n,"univer-pl-2":n},e),checked:r,...o,children:[!n&&P.jsx("span",{className:"univer-absolute univer-left-2 univer-flex univer-h-3.5 univer-w-3.5 univer-items-center univer-justify-center",children:P.jsx(xh,{children:P.jsx(Rr,{className:"univer-block univer-size-4 univer-fill-current univer-text-primary-600"})})}),t]})}function oM({className:e,children:t,hideIndicator:n,...r}){return P.jsxs(BE,{"data-slot":"dropdown-menu-radio-item",className:xe(`
1445
1445
  univer-relative univer-flex univer-cursor-default univer-select-none univer-items-center
1446
1446
  univer-rounded univer-py-1.5 univer-pr-2 univer-text-sm univer-outline-none univer-transition-colors
1447
1447
  focus:univer-bg-gray-100
1448
1448
  data-[disabled]:univer-pointer-events-none data-[disabled]:univer-opacity-50
1449
1449
  dark:focus:!univer-bg-gray-600
1450
- `,{"univer-pl-8":!n,"univer-pl-2":n},e),...r,children:[!n&&P.jsx("span",{className:"univer-absolute univer-left-2 univer-flex univer-h-3.5 univer-w-3.5 univer-items-center univer-justify-center",children:P.jsx(xh,{children:P.jsx(Rr,{className:"univer-block univer-size-4 univer-fill-current univer-text-primary-600"})})}),t]})}function Sh({className:e,...t}){return P.jsx(jE,{className:Se("-univer-mx-1 univer-my-1 univer-h-px univer-bg-gray-200 dark:!univer-bg-gray-600",e),...t})}function Kl(e){const{children:t,items:n,disabled:r,open:o,onOpenChange:a,...i}=e,[s,u]=D.useState(!1),c=o!==void 0,f=c?o:s;function l(m){r||(c||u(m),a==null||a(m))}function h(m,y){var p;const{className:w,type:v}=m;if(v==="separator")return P.jsx(Sh,{className:w},y);if(v==="radio")return P.jsx(QE,{className:w,value:m.value,onValueChange:m.onSelect,children:m.options.map((g,b)=>{if("type"in g){if(g.type==="separator")return P.jsx(Sh,{className:g.className},b)}else{if(g.value===void 0)throw new Error("[DropdownMenu]: `value` is required");return P.jsx(oM,{value:g.value,disabled:g.disabled,hideIndicator:m.hideIndicator,children:g.label},g.value)}return null})},y);if(v==="checkbox")return P.jsx(rM,{className:w,disabled:m.disabled,checked:m.checked,onSelect:()=>{var g;(g=m.onSelect)==null||g.call(m,m.value)},children:m.label},y);if(v==="item")return P.jsx(nM,{className:w,disabled:m.disabled,onSelect:()=>{var g;(g=m.onSelect)==null||g.call(m,m)},children:m.children},y);if(v==="subItem")return P.jsxs(ZE,{children:[P.jsx(JE,{children:m.children}),P.jsx(KE,{children:P.jsx(eM,{sideOffset:12,children:(p=m.options)==null?void 0:p.map((g,b)=>h(g,b))})})]},y)}return P.jsxs(GE,{modal:!1,open:f,onOpenChange:l,children:[P.jsx(XE,{asChild:!0,children:t}),P.jsx(tM,{className:"univer-text-sm",collisionPadding:{top:12,bottom:12},onWheel:m=>m.stopPropagation(),...i,children:n.map((m,y)=>h(m,y))})]})}var Ti="Popover",[Eh,ID]=Wn(Ti,[vr]),Qo=vr(),[aM,hr]=Eh(Ti),Mh=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:a,modal:i=!1}=e,s=Qo(t),u=d.useRef(null),[c,f]=d.useState(!1),[l,h]=xr({prop:r,defaultProp:o!=null?o:!1,onChange:a,caller:Ti});return P.jsx(Bo,{...s,children:P.jsx(aM,{scope:t,contentId:_n(),triggerRef:u,open:l,onOpenChange:h,onOpenToggle:d.useCallback(()=>h(m=>!m),[h]),hasCustomAnchor:c,onCustomAnchorAdd:d.useCallback(()=>f(!0),[]),onCustomAnchorRemove:d.useCallback(()=>f(!1),[]),modal:i,children:n})})};Mh.displayName=Ti;var Ph="PopoverAnchor",iM=d.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=hr(Ph,n),a=Qo(n),{onCustomAnchorAdd:i,onCustomAnchorRemove:s}=o;return d.useEffect(()=>(i(),()=>s()),[i,s]),P.jsx(jo,{...a,...r,ref:t})});iM.displayName=Ph;var Dh="PopoverTrigger",kh=d.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=hr(Dh,n),a=Qo(n),i=Pt(t,o.triggerRef),s=P.jsx(gt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Ih(o.open),...r,ref:i,onClick:Ie(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?s:P.jsx(jo,{asChild:!0,...a,children:s})});kh.displayName=Dh;var Xl="PopoverPortal",[sM,lM]=Eh(Xl,{forceMount:void 0}),_h=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,a=hr(Xl,t);return P.jsx(sM,{scope:t,forceMount:n,children:P.jsx(on,{present:n||a.open,children:P.jsx(Hr,{asChild:!0,container:o,children:r})})})};_h.displayName=Xl;var lo="PopoverContent",Nh=d.forwardRef((e,t)=>{const n=lM(lo,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,a=hr(lo,e.__scopePopover);return P.jsx(on,{present:r||a.open,children:a.modal?P.jsx(cM,{...o,ref:t}):P.jsx(dM,{...o,ref:t})})});Nh.displayName=lo;var uM=wr("PopoverContent.RemoveScroll"),cM=d.forwardRef((e,t)=>{const n=hr(lo,e.__scopePopover),r=d.useRef(null),o=Pt(t,r),a=d.useRef(!1);return d.useEffect(()=>{const i=r.current;if(i)return bs(i)},[]),P.jsx(Ca,{as:uM,allowPinchZoom:!0,children:P.jsx(Oh,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ie(e.onCloseAutoFocus,i=>{var s;i.preventDefault(),a.current||(s=n.triggerRef.current)==null||s.focus()}),onPointerDownOutside:Ie(e.onPointerDownOutside,i=>{const s=i.detail.originalEvent,u=s.button===0&&s.ctrlKey===!0,c=s.button===2||u;a.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:Ie(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})}),dM=d.forwardRef((e,t)=>{const n=hr(lo,e.__scopePopover),r=d.useRef(!1),o=d.useRef(!1);return P.jsx(Oh,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var i,s;(i=e.onCloseAutoFocus)==null||i.call(e,a),a.defaultPrevented||(r.current||(s=n.triggerRef.current)==null||s.focus(),a.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:a=>{var u,c;(u=e.onInteractOutside)==null||u.call(e,a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=a.target;((c=n.triggerRef.current)==null?void 0:c.contains(i))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&o.current&&a.preventDefault()}})}),Oh=d.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:i,onEscapeKeyDown:s,onPointerDownOutside:u,onFocusOutside:c,onInteractOutside:f,...l}=e,h=hr(lo,n),m=Qo(n);return vs(),P.jsx(ma,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:a,children:P.jsx(zr,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:f,onEscapeKeyDown:s,onPointerDownOutside:u,onFocusOutside:c,onDismiss:()=>h.onOpenChange(!1),children:P.jsx(Pi,{"data-state":Ih(h.open),role:"dialog",id:h.contentId,...m,...l,ref:t,style:{...l.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),Th="PopoverClose",fM=d.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=hr(Th,n);return P.jsx(gt.button,{type:"button",...r,ref:t,onClick:Ie(e.onClick,()=>o.onOpenChange(!1))})});fM.displayName=Th;var vM="PopoverArrow",mM=d.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Qo(n);return P.jsx(Di,{...o,...r,ref:t})});mM.displayName=vM;function Ih(e){return e?"open":"closed"}var hM=Mh,pM=kh,gM=_h,yM=Nh;function bM({...e}){return P.jsx(hM,{"data-slot":"popover",...e})}function wM({...e}){return P.jsx(pM,{"data-slot":"popover-trigger",...e})}function CM({className:e,align:t="center",sideOffset:n=4,...r}){return P.jsx(gM,{children:P.jsx(yM,{"data-slot":"popover-content",align:t,sideOffset:n,className:Se(`
1450
+ `,{"univer-pl-8":!n,"univer-pl-2":n},e),...r,children:[!n&&P.jsx("span",{className:"univer-absolute univer-left-2 univer-flex univer-h-3.5 univer-w-3.5 univer-items-center univer-justify-center",children:P.jsx(xh,{children:P.jsx(Rr,{className:"univer-block univer-size-4 univer-fill-current univer-text-primary-600"})})}),t]})}function Sh({className:e,...t}){return P.jsx(jE,{className:xe("-univer-mx-1 univer-my-1 univer-h-px univer-bg-gray-200 dark:!univer-bg-gray-600",e),...t})}function Kl(e){const{children:t,items:n,disabled:r,open:o,onOpenChange:a,...i}=e,[s,u]=D.useState(!1),c=o!==void 0,d=c?o:s;function l(m){r||(c||u(m),a==null||a(m))}function h(m,y){var p;const{className:w,type:v}=m;if(v==="separator")return P.jsx(Sh,{className:w},y);if(v==="radio")return P.jsx(QE,{className:w,value:m.value,onValueChange:m.onSelect,children:m.options.map((g,b)=>{if("type"in g){if(g.type==="separator")return P.jsx(Sh,{className:g.className},b)}else{if(g.value===void 0)throw new Error("[DropdownMenu]: `value` is required");return P.jsx(oM,{value:g.value,disabled:g.disabled,hideIndicator:m.hideIndicator,children:g.label},g.value)}return null})},y);if(v==="checkbox")return P.jsx(rM,{className:w,disabled:m.disabled,checked:m.checked,onSelect:()=>{var g;(g=m.onSelect)==null||g.call(m,m.value)},children:m.label},y);if(v==="item")return P.jsx(nM,{className:w,disabled:m.disabled,onSelect:()=>{var g;(g=m.onSelect)==null||g.call(m,m)},children:m.children},y);if(v==="subItem")return P.jsxs(ZE,{children:[P.jsx(JE,{children:m.children}),P.jsx(KE,{children:P.jsx(eM,{sideOffset:12,children:(p=m.options)==null?void 0:p.map((g,b)=>h(g,b))})})]},y)}return P.jsxs(GE,{modal:!1,open:d,onOpenChange:l,children:[P.jsx(XE,{asChild:!0,children:t}),P.jsx(tM,{className:"univer-text-sm",collisionPadding:{top:12,bottom:12},onWheel:m=>m.stopPropagation(),...i,children:n.map((m,y)=>h(m,y))})]})}var Ti="Popover",[Eh,RD]=Wn(Ti,[mr]),Qo=mr(),[aM,pr]=Eh(Ti),Mh=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:a,modal:i=!1}=e,s=Qo(t),u=f.useRef(null),[c,d]=f.useState(!1),[l,h]=xr({prop:r,defaultProp:o!=null?o:!1,onChange:a,caller:Ti});return P.jsx(Bo,{...s,children:P.jsx(aM,{scope:t,contentId:Nn(),triggerRef:u,open:l,onOpenChange:h,onOpenToggle:f.useCallback(()=>h(m=>!m),[h]),hasCustomAnchor:c,onCustomAnchorAdd:f.useCallback(()=>d(!0),[]),onCustomAnchorRemove:f.useCallback(()=>d(!1),[]),modal:i,children:n})})};Mh.displayName=Ti;var Ph="PopoverAnchor",iM=f.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=pr(Ph,n),a=Qo(n),{onCustomAnchorAdd:i,onCustomAnchorRemove:s}=o;return f.useEffect(()=>(i(),()=>s()),[i,s]),P.jsx(jo,{...a,...r,ref:t})});iM.displayName=Ph;var Dh="PopoverTrigger",kh=f.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=pr(Dh,n),a=Qo(n),i=Pt(t,o.triggerRef),s=P.jsx(gt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Ih(o.open),...r,ref:i,onClick:Ie(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?s:P.jsx(jo,{asChild:!0,...a,children:s})});kh.displayName=Dh;var Xl="PopoverPortal",[sM,lM]=Eh(Xl,{forceMount:void 0}),Nh=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,a=pr(Xl,t);return P.jsx(sM,{scope:t,forceMount:n,children:P.jsx(on,{present:n||a.open,children:P.jsx(Hr,{asChild:!0,container:o,children:r})})})};Nh.displayName=Xl;var lo="PopoverContent",_h=f.forwardRef((e,t)=>{const n=lM(lo,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,a=pr(lo,e.__scopePopover);return P.jsx(on,{present:r||a.open,children:a.modal?P.jsx(cM,{...o,ref:t}):P.jsx(dM,{...o,ref:t})})});_h.displayName=lo;var uM=Cr("PopoverContent.RemoveScroll"),cM=f.forwardRef((e,t)=>{const n=pr(lo,e.__scopePopover),r=f.useRef(null),o=Pt(t,r),a=f.useRef(!1);return f.useEffect(()=>{const i=r.current;if(i)return bs(i)},[]),P.jsx(Ca,{as:uM,allowPinchZoom:!0,children:P.jsx(Oh,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ie(e.onCloseAutoFocus,i=>{var s;i.preventDefault(),a.current||(s=n.triggerRef.current)==null||s.focus()}),onPointerDownOutside:Ie(e.onPointerDownOutside,i=>{const s=i.detail.originalEvent,u=s.button===0&&s.ctrlKey===!0,c=s.button===2||u;a.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:Ie(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})}),dM=f.forwardRef((e,t)=>{const n=pr(lo,e.__scopePopover),r=f.useRef(!1),o=f.useRef(!1);return P.jsx(Oh,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var i,s;(i=e.onCloseAutoFocus)==null||i.call(e,a),a.defaultPrevented||(r.current||(s=n.triggerRef.current)==null||s.focus(),a.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:a=>{var u,c;(u=e.onInteractOutside)==null||u.call(e,a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=a.target;((c=n.triggerRef.current)==null?void 0:c.contains(i))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&o.current&&a.preventDefault()}})}),Oh=f.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:i,onEscapeKeyDown:s,onPointerDownOutside:u,onFocusOutside:c,onInteractOutside:d,...l}=e,h=pr(lo,n),m=Qo(n);return vs(),P.jsx(ma,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:a,children:P.jsx(zr,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:d,onEscapeKeyDown:s,onPointerDownOutside:u,onFocusOutside:c,onDismiss:()=>h.onOpenChange(!1),children:P.jsx(Pi,{"data-state":Ih(h.open),role:"dialog",id:h.contentId,...m,...l,ref:t,style:{...l.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),Th="PopoverClose",fM=f.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=pr(Th,n);return P.jsx(gt.button,{type:"button",...r,ref:t,onClick:Ie(e.onClick,()=>o.onOpenChange(!1))})});fM.displayName=Th;var vM="PopoverArrow",mM=f.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Qo(n);return P.jsx(Di,{...o,...r,ref:t})});mM.displayName=vM;function Ih(e){return e?"open":"closed"}var hM=Mh,pM=kh,gM=Nh,yM=_h;function bM({...e}){return P.jsx(hM,{"data-slot":"popover",...e})}function wM({...e}){return P.jsx(pM,{"data-slot":"popover-trigger",...e})}function CM({className:e,align:t="center",sideOffset:n=4,...r}){return P.jsx(gM,{children:P.jsx(yM,{"data-slot":"popover-content",align:t,sideOffset:n,className:xe(`
1451
1451
  univer-outline-hidden univer-z-[1080] univer-max-h-[var(--radix-popper-available-height)]
1452
1452
  univer-overflow-y-auto univer-rounded-md univer-bg-white univer-text-gray-900 univer-shadow-md
1453
1453
  data-[state=open]:univer-animate-in data-[state=open]:univer-fade-in-0
@@ -1459,10 +1459,10 @@ html body {
1459
1459
  data-[side=right]:univer-slide-in-from-left-2
1460
1460
  data-[side=top]:univer-slide-in-from-bottom-2
1461
1461
  dark:!univer-bg-gray-900 dark:!univer-text-white dark:focus-visible:!univer-border-gray-600
1462
- `,yn,Cr,e),...r})})}function xM(e){const{children:t,overlay:n,disabled:r,open:o,onOpenChange:a,...i}=e,[s,u]=D.useState(!1),c=o!==void 0,f=c?o:s;function l(h){r||(c||u(h),a==null||a(h))}return P.jsxs(bM,{open:f,onOpenChange:l,children:[P.jsx(wM,{asChild:!0,children:t}),P.jsx(CM,{...i,children:n})]})}const SM=D.createContext(!1),EM=e=>{const{label:t,desc:n,children:r,style:o,className:a,error:i,contentStyle:s,collapsable:u=!1,defaultCollapsed:c=!1}=e,[f,l]=D.useState(c);return P.jsx(SM.Provider,{value:!0,children:P.jsxs("div",{"data-u-comp":"form-layout",className:Se("univer-mb-3 univer-flex univer-flex-col",a),style:o,children:[t&&P.jsxs("div",{className:Se("univer-mb-2 univer-flex univer-min-h-3.5 univer-items-center univer-text-sm univer-text-gray-900 dark:!univer-text-white",{"univer-cursor-pointer":u}),onClick:()=>l(!f),children:[t,u&&P.jsx($u,{className:Se("univer-ml-1 univer-transition-transform",{"univer-rotate-180":f})})]}),f&&u?null:P.jsxs(P.Fragment,{children:[n&&P.jsx("div",{className:"univer-mt-1 univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",children:n}),r?P.jsxs("div",{className:Se("last:univer-mb-0 [&_[data-u-comp=input]]:univer-w-full [&_[data-u-comp=select]]:univer-w-full",{"[&_[data-u-comp=input]]:univer-border-red-500":i,"[&_[data-u-comp=select]]:univer-border-red-500":i}),style:s,children:[r,i?P.jsx("div",{className:"univer-mt-1 univer-text-xs univer-text-red-500",children:i}):null]}):null]})]})})},MM=e=>P.jsx("div",{className:"univer-flex univer-justify-between [&_[data-u-comp=form-layout]]:univer-max-w-[calc(50%-8px)] [&_[data-u-comp=form-layout]]:univer-shrink [&_[data-u-comp=form-layout]]:univer-grow",children:e.children});function Rh(e){const{className:t,value:n=0,total:r=0,loop:o,text:a}=e,i=D.useMemo(()=>a!=null?a:`${n}/${r}`,[n,r,a]),s=r>0,u=()=>{var f,l;n===1?o&&((f=e.onChange)==null||f.call(e,r)):(l=e.onChange)==null||l.call(e,n-1)},c=()=>{var f,l;n===r?o&&((f=e.onChange)==null||f.call(e,1)):(l=e.onChange)==null||l.call(e,n+1)};return P.jsx("div",{"data-u-comp":"pager",className:Se("univer-flex univer-flex-shrink-0 univer-items-center univer-text-sm univer-text-gray-700 dark:!univer-text-gray-400",t),children:s?P.jsxs(P.Fragment,{children:[P.jsx("div",{"data-u-comp":"pager-left-arrow",className:"univer-inline-flex univer-size-4 univer-cursor-pointer univer-items-center univer-rounded hover:univer-bg-gray-50 dark:hover:!univer-bg-gray-600",role:"button",onClick:u,children:P.jsx(Lu,{})}),P.jsx("div",{className:"univer-mx-1",children:i}),P.jsx("div",{"data-u-comp":"pager-right-arrow",className:"univer-inline-flex univer-size-4 univer-cursor-pointer univer-items-center univer-rounded hover:univer-bg-gray-50 dark:hover:!univer-bg-gray-600",role:"button",onClick:c,children:P.jsx(ts,{})})]}):P.jsx("div",{className:"univer-mx-1",children:i})})}function PM(e){const{className:t,images:n,open:r,onOpenChange:o}=e,[a,i]=D.useState(!1),[s,u]=D.useState(0),[c,f]=D.useState(1),l=D.useMemo(()=>n[s],[s,n]);if(D.useEffect(()=>{if(r)i(!0);else{const m=setTimeout(()=>{i(!1)},150);return()=>clearTimeout(m)}},[r]),!r&&!a)return null;function h(m){if(m==="reset"){f(1);return}const y=c+m;y<.5||y>2||f(y)}return It.createPortal(P.jsxs("div",{"data-u-comp":"gallery",className:Se(`
1462
+ `,mn,er,e),...r})})}function xM(e){const{children:t,overlay:n,disabled:r,open:o,onOpenChange:a,...i}=e,[s,u]=D.useState(!1),c=o!==void 0,d=c?o:s;function l(h){r||(c||u(h),a==null||a(h))}return P.jsxs(bM,{open:d,onOpenChange:l,children:[P.jsx(wM,{asChild:!0,children:t}),P.jsx(CM,{...i,children:n})]})}const SM=D.createContext(!1),EM=e=>{const{label:t,desc:n,children:r,style:o,className:a,error:i,contentStyle:s,collapsable:u=!1,defaultCollapsed:c=!1}=e,[d,l]=D.useState(c);return P.jsx(SM.Provider,{value:!0,children:P.jsxs("div",{"data-u-comp":"form-layout",className:xe("univer-mb-3 univer-flex univer-flex-col",a),style:o,children:[t&&P.jsxs("div",{className:xe("univer-mb-2 univer-flex univer-min-h-3.5 univer-items-center univer-text-sm univer-text-gray-900 dark:!univer-text-white",{"univer-cursor-pointer":u}),onClick:()=>l(!d),children:[t,u&&P.jsx($u,{className:xe("univer-ml-1 univer-transition-transform",{"univer-rotate-180":d})})]}),d&&u?null:P.jsxs(P.Fragment,{children:[n&&P.jsx("div",{className:"univer-mt-1 univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",children:n}),r?P.jsxs("div",{className:xe("last:univer-mb-0 [&_[data-u-comp=input]]:univer-w-full [&_[data-u-comp=select]]:univer-w-full",{"[&_[data-u-comp=input]]:univer-border-red-500":i,"[&_[data-u-comp=select]]:univer-border-red-500":i}),style:s,children:[r,i?P.jsx("div",{className:"univer-mt-1 univer-text-xs univer-text-red-500",children:i}):null]}):null]})]})})},MM=e=>P.jsx("div",{className:"univer-flex univer-justify-between [&_[data-u-comp=form-layout]]:univer-max-w-[calc(50%-8px)] [&_[data-u-comp=form-layout]]:univer-shrink [&_[data-u-comp=form-layout]]:univer-grow",children:e.children});function Rh(e){const{className:t,value:n=0,total:r=0,loop:o,text:a}=e,i=D.useMemo(()=>a!=null?a:`${n}/${r}`,[n,r,a]),s=r>0,u=()=>{var d,l;n===1?o&&((d=e.onChange)==null||d.call(e,r)):(l=e.onChange)==null||l.call(e,n-1)},c=()=>{var d,l;n===r?o&&((d=e.onChange)==null||d.call(e,1)):(l=e.onChange)==null||l.call(e,n+1)};return P.jsx("div",{"data-u-comp":"pager",className:xe("univer-flex univer-flex-shrink-0 univer-items-center univer-text-sm univer-text-gray-700 dark:!univer-text-gray-400",t),children:s?P.jsxs(P.Fragment,{children:[P.jsx("div",{"data-u-comp":"pager-left-arrow",className:"univer-inline-flex univer-size-4 univer-cursor-pointer univer-items-center univer-rounded hover:univer-bg-gray-50 dark:hover:!univer-bg-gray-600",role:"button",onClick:u,children:P.jsx(Lu,{})}),P.jsx("div",{className:"univer-mx-1",children:i}),P.jsx("div",{"data-u-comp":"pager-right-arrow",className:"univer-inline-flex univer-size-4 univer-cursor-pointer univer-items-center univer-rounded hover:univer-bg-gray-50 dark:hover:!univer-bg-gray-600",role:"button",onClick:c,children:P.jsx(ts,{})})]}):P.jsx("div",{className:"univer-mx-1",children:i})})}function PM(e){const{className:t,images:n,open:r,onOpenChange:o}=e,[a,i]=D.useState(!1),[s,u]=D.useState(0),[c,d]=D.useState(1),l=D.useMemo(()=>n[s],[s,n]);if(D.useEffect(()=>{if(r)i(!0);else{const m=setTimeout(()=>{i(!1)},150);return()=>clearTimeout(m)}},[r]),!r&&!a)return null;function h(m){if(m==="reset"){d(1);return}const y=c+m;y<.5||y>2||d(y)}return It.createPortal(P.jsxs("div",{"data-u-comp":"gallery",className:xe(`
1463
1463
  univer-absolute univer-inset-0 univer-z-[1080] univer-flex univer-size-full univer-select-none
1464
1464
  univer-items-center univer-justify-center
1465
- `,{"univer-animate-in univer-fade-in":r,"univer-animate-out univer-fade-out":!r},t),children:[P.jsx("div",{className:"univer-absolute univer-inset-0 univer-size-full univer-bg-gray-900 univer-opacity-80",onClick:()=>o==null?void 0:o(!1)}),P.jsx("div",{className:"univer-relative",children:l&&P.jsx("img",{className:"univer-max-h-[40vh] univer-max-w-[60vw] univer-transition-transform univer-duration-300 univer-ease-out",style:{transform:`scale(${c})`},src:l,alt:"gallery",draggable:!1})}),P.jsxs("footer",{className:"univer-absolute univer-bottom-6 univer-left-1/2 univer-flex -univer-translate-x-1/2 univer-items-center univer-gap-3 univer-rounded-full univer-bg-gray-800 univer-px-6 univer-py-3 univer-text-gray-400",children:[P.jsx(Rh,{className:"!univer-text-gray-400 [&_[data-u-comp=pager-left-arrow]:hover]:!univer-bg-gray-600 [&_[data-u-comp=pager-right-arrow]:hover]:!univer-bg-gray-600",value:s+1,total:n.length,onChange:m=>u(m-1)}),P.jsx("a",{className:"univer-flex univer-cursor-pointer univer-items-center univer-justify-center hover:univer-text-white",onClick:()=>h(.25),children:P.jsx(Vu,{})}),P.jsx("a",{className:"univer-flex univer-cursor-pointer univer-items-center univer-justify-center hover:univer-text-white",onClick:()=>h(-.25),children:P.jsx(Wu,{})}),P.jsx("a",{className:"univer-flex univer-cursor-pointer univer-items-center univer-justify-center hover:univer-text-white",onClick:()=>h("reset"),children:P.jsx(Fu,{})})]})]}),document.body)}var Zl,Ii="HoverCard",[Ah,RD]=Wn(Ii,[vr]),Ri=vr(),[DM,Ai]=Ah(Ii),Lh=e=>{const{__scopeHoverCard:t,children:n,open:r,defaultOpen:o,onOpenChange:a,openDelay:i=700,closeDelay:s=300}=e,u=Ri(t),c=d.useRef(0),f=d.useRef(0),l=d.useRef(!1),h=d.useRef(!1),[m,y]=xr({prop:r,defaultProp:o!=null?o:!1,onChange:a,caller:Ii}),w=d.useCallback(()=>{clearTimeout(f.current),c.current=window.setTimeout(()=>y(!0),i)},[i,y]),v=d.useCallback(()=>{clearTimeout(c.current),!l.current&&!h.current&&(f.current=window.setTimeout(()=>y(!1),s))},[s,y]),p=d.useCallback(()=>y(!1),[y]);return d.useEffect(()=>()=>{clearTimeout(c.current),clearTimeout(f.current)},[]),P.jsx(DM,{scope:t,open:m,onOpenChange:y,onOpen:w,onClose:v,onDismiss:p,hasSelectionRef:l,isPointerDownOnContentRef:h,children:P.jsx(Bo,{...u,children:n})})};Lh.displayName=Ii;var $h="HoverCardTrigger",Fh=d.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,o=Ai($h,n),a=Ri(n);return P.jsx(jo,{asChild:!0,...a,children:P.jsx(gt.a,{"data-state":o.open?"open":"closed",...r,ref:t,onPointerEnter:Ie(e.onPointerEnter,$i(o.onOpen)),onPointerLeave:Ie(e.onPointerLeave,$i(o.onClose)),onFocus:Ie(e.onFocus,o.onOpen),onBlur:Ie(e.onBlur,o.onClose),onTouchStart:Ie(e.onTouchStart,i=>i.preventDefault())})})});Fh.displayName=$h;var Ql="HoverCardPortal",[kM,_M]=Ah(Ql,{forceMount:void 0}),zh=e=>{const{__scopeHoverCard:t,forceMount:n,children:r,container:o}=e,a=Ai(Ql,t);return P.jsx(kM,{scope:t,forceMount:n,children:P.jsx(on,{present:n||a.open,children:P.jsx(Hr,{asChild:!0,container:o,children:r})})})};zh.displayName=Ql;var Li="HoverCardContent",Hh=d.forwardRef((e,t)=>{const n=_M(Li,e.__scopeHoverCard),{forceMount:r=n.forceMount,...o}=e,a=Ai(Li,e.__scopeHoverCard);return P.jsx(on,{present:r||a.open,children:P.jsx(NM,{"data-state":a.open?"open":"closed",...o,onPointerEnter:Ie(e.onPointerEnter,$i(a.onOpen)),onPointerLeave:Ie(e.onPointerLeave,$i(a.onClose)),ref:t})})});Hh.displayName=Li;var NM=d.forwardRef((e,t)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:a,onInteractOutside:i,...s}=e,u=Ai(Li,n),c=Ri(n),f=d.useRef(null),l=Pt(t,f),[h,m]=d.useState(!1);return d.useEffect(()=>{if(h){const y=document.body;return Zl=y.style.userSelect||y.style.webkitUserSelect,y.style.userSelect="none",y.style.webkitUserSelect="none",()=>{y.style.userSelect=Zl,y.style.webkitUserSelect=Zl}}},[h]),d.useEffect(()=>{if(f.current){const y=()=>{m(!1),u.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var v;((v=document.getSelection())==null?void 0:v.toString())!==""&&(u.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",y),()=>{document.removeEventListener("pointerup",y),u.hasSelectionRef.current=!1,u.isPointerDownOnContentRef.current=!1}}},[u.isPointerDownOnContentRef,u.hasSelectionRef]),d.useEffect(()=>{f.current&&IM(f.current).forEach(w=>w.setAttribute("tabindex","-1"))}),P.jsx(zr,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:i,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:Ie(a,y=>{y.preventDefault()}),onDismiss:u.onDismiss,children:P.jsx(Pi,{...c,...s,onPointerDown:Ie(s.onPointerDown,y=>{y.currentTarget.contains(y.target)&&m(!0),u.hasSelectionRef.current=!1,u.isPointerDownOnContentRef.current=!0}),ref:l,style:{...s.style,userSelect:h?"text":void 0,WebkitUserSelect:h?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),OM="HoverCardArrow",TM=d.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,o=Ri(n);return P.jsx(Di,{...o,...r,ref:t})});TM.displayName=OM;function $i(e){return t=>t.pointerType==="touch"?void 0:e()}function IM(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)t.push(n.currentNode);return t}var RM=Lh,AM=Fh,LM=zh,Vh=Hh;const $M=RM,FM=LM,zM=AM,Wh=D.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>P.jsx(Vh,{ref:o,align:t,sideOffset:n,className:Se(`
1465
+ `,{"univer-animate-in univer-fade-in":r,"univer-animate-out univer-fade-out":!r},t),children:[P.jsx("div",{className:"univer-absolute univer-inset-0 univer-size-full univer-bg-gray-900 univer-opacity-80",onClick:()=>o==null?void 0:o(!1)}),P.jsx("div",{className:"univer-relative",children:l&&P.jsx("img",{className:"univer-max-h-[40vh] univer-max-w-[60vw] univer-transition-transform univer-duration-300 univer-ease-out",style:{transform:`scale(${c})`},src:l,alt:"gallery",draggable:!1})}),P.jsxs("footer",{className:"univer-absolute univer-bottom-6 univer-left-1/2 univer-flex -univer-translate-x-1/2 univer-items-center univer-gap-3 univer-rounded-full univer-bg-gray-800 univer-px-6 univer-py-3 univer-text-gray-400",children:[P.jsx(Rh,{className:"!univer-text-gray-400 [&_[data-u-comp=pager-left-arrow]:hover]:!univer-bg-gray-600 [&_[data-u-comp=pager-right-arrow]:hover]:!univer-bg-gray-600",value:s+1,total:n.length,onChange:m=>u(m-1)}),P.jsx("a",{className:"univer-flex univer-cursor-pointer univer-items-center univer-justify-center hover:univer-text-white",onClick:()=>h(.25),children:P.jsx(Vu,{})}),P.jsx("a",{className:"univer-flex univer-cursor-pointer univer-items-center univer-justify-center hover:univer-text-white",onClick:()=>h(-.25),children:P.jsx(Wu,{})}),P.jsx("a",{className:"univer-flex univer-cursor-pointer univer-items-center univer-justify-center hover:univer-text-white",onClick:()=>h("reset"),children:P.jsx(Fu,{})})]})]}),document.body)}var Zl,Ii="HoverCard",[Ah,AD]=Wn(Ii,[mr]),Ri=mr(),[DM,Ai]=Ah(Ii),Lh=e=>{const{__scopeHoverCard:t,children:n,open:r,defaultOpen:o,onOpenChange:a,openDelay:i=700,closeDelay:s=300}=e,u=Ri(t),c=f.useRef(0),d=f.useRef(0),l=f.useRef(!1),h=f.useRef(!1),[m,y]=xr({prop:r,defaultProp:o!=null?o:!1,onChange:a,caller:Ii}),w=f.useCallback(()=>{clearTimeout(d.current),c.current=window.setTimeout(()=>y(!0),i)},[i,y]),v=f.useCallback(()=>{clearTimeout(c.current),!l.current&&!h.current&&(d.current=window.setTimeout(()=>y(!1),s))},[s,y]),p=f.useCallback(()=>y(!1),[y]);return f.useEffect(()=>()=>{clearTimeout(c.current),clearTimeout(d.current)},[]),P.jsx(DM,{scope:t,open:m,onOpenChange:y,onOpen:w,onClose:v,onDismiss:p,hasSelectionRef:l,isPointerDownOnContentRef:h,children:P.jsx(Bo,{...u,children:n})})};Lh.displayName=Ii;var $h="HoverCardTrigger",Fh=f.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,o=Ai($h,n),a=Ri(n);return P.jsx(jo,{asChild:!0,...a,children:P.jsx(gt.a,{"data-state":o.open?"open":"closed",...r,ref:t,onPointerEnter:Ie(e.onPointerEnter,$i(o.onOpen)),onPointerLeave:Ie(e.onPointerLeave,$i(o.onClose)),onFocus:Ie(e.onFocus,o.onOpen),onBlur:Ie(e.onBlur,o.onClose),onTouchStart:Ie(e.onTouchStart,i=>i.preventDefault())})})});Fh.displayName=$h;var Ql="HoverCardPortal",[kM,NM]=Ah(Ql,{forceMount:void 0}),zh=e=>{const{__scopeHoverCard:t,forceMount:n,children:r,container:o}=e,a=Ai(Ql,t);return P.jsx(kM,{scope:t,forceMount:n,children:P.jsx(on,{present:n||a.open,children:P.jsx(Hr,{asChild:!0,container:o,children:r})})})};zh.displayName=Ql;var Li="HoverCardContent",Hh=f.forwardRef((e,t)=>{const n=NM(Li,e.__scopeHoverCard),{forceMount:r=n.forceMount,...o}=e,a=Ai(Li,e.__scopeHoverCard);return P.jsx(on,{present:r||a.open,children:P.jsx(_M,{"data-state":a.open?"open":"closed",...o,onPointerEnter:Ie(e.onPointerEnter,$i(a.onOpen)),onPointerLeave:Ie(e.onPointerLeave,$i(a.onClose)),ref:t})})});Hh.displayName=Li;var _M=f.forwardRef((e,t)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:a,onInteractOutside:i,...s}=e,u=Ai(Li,n),c=Ri(n),d=f.useRef(null),l=Pt(t,d),[h,m]=f.useState(!1);return f.useEffect(()=>{if(h){const y=document.body;return Zl=y.style.userSelect||y.style.webkitUserSelect,y.style.userSelect="none",y.style.webkitUserSelect="none",()=>{y.style.userSelect=Zl,y.style.webkitUserSelect=Zl}}},[h]),f.useEffect(()=>{if(d.current){const y=()=>{m(!1),u.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var v;((v=document.getSelection())==null?void 0:v.toString())!==""&&(u.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",y),()=>{document.removeEventListener("pointerup",y),u.hasSelectionRef.current=!1,u.isPointerDownOnContentRef.current=!1}}},[u.isPointerDownOnContentRef,u.hasSelectionRef]),f.useEffect(()=>{d.current&&IM(d.current).forEach(w=>w.setAttribute("tabindex","-1"))}),P.jsx(zr,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:i,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:Ie(a,y=>{y.preventDefault()}),onDismiss:u.onDismiss,children:P.jsx(Pi,{...c,...s,onPointerDown:Ie(s.onPointerDown,y=>{y.currentTarget.contains(y.target)&&m(!0),u.hasSelectionRef.current=!1,u.isPointerDownOnContentRef.current=!0}),ref:l,style:{...s.style,userSelect:h?"text":void 0,WebkitUserSelect:h?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),OM="HoverCardArrow",TM=f.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,o=Ri(n);return P.jsx(Di,{...o,...r,ref:t})});TM.displayName=OM;function $i(e){return t=>t.pointerType==="touch"?void 0:e()}function IM(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)t.push(n.currentNode);return t}var RM=Lh,AM=Fh,LM=zh,Vh=Hh;const $M=RM,FM=LM,zM=AM,Wh=D.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>P.jsx(Vh,{ref:o,align:t,sideOffset:n,className:xe(`
1466
1466
  data-[state=open]:univer-animate-in data-[state=open]:univer-fade-in-0 data-[state=open]:univer-zoom-in-95
1467
1467
  data-[state=closed]:univer-animate-out data-[state=closed]:univer-fade-out-0
1468
1468
  data-[state=closed]:univer-zoom-out-95
@@ -1473,21 +1473,21 @@ html body {
1473
1473
  univer-z-[1080] univer-w-64 univer-origin-[--radix-hover-card-content-transform-origin] univer-rounded-md
1474
1474
  univer-bg-white univer-text-gray-900 univer-shadow-md univer-outline-none
1475
1475
  dark:!univer-bg-gray-900 dark:!univer-text-white
1476
- `,yn,e),...r}));Wh.displayName=Vh.displayName;function HM(e){const{children:t,overlay:n,disabled:r,openDelay:o=200,open:a,onOpenChange:i,...s}=e,[u,c]=D.useState(!1),f=a!==void 0,l=f?a:u;function h(m){r||(f||c(m),i==null||i(m))}return P.jsxs($M,{open:l,onOpenChange:h,openDelay:o,children:[P.jsx(zM,{asChild:!0,children:t}),P.jsx(FM,{children:P.jsx(Wh,{...s,children:n})})]})}const VM=ls(`
1476
+ `,mn,e),...r}));Wh.displayName=Vh.displayName;function HM(e){const{children:t,overlay:n,disabled:r,openDelay:o=200,open:a,onOpenChange:i,...s}=e,[u,c]=D.useState(!1),d=a!==void 0,l=d?a:u;function h(m){r||(d||c(m),i==null||i(m))}return P.jsxs($M,{open:l,onOpenChange:h,openDelay:o,children:[P.jsx(zM,{asChild:!0,children:t}),P.jsx(FM,{children:P.jsx(Wh,{...s,children:n})})]})}const VM=ls(`
1477
1477
  univer-box-border univer-w-full univer-rounded-md univer-bg-white univer-transition-colors univer-duration-200
1478
1478
  placeholder:univer-text-gray-400
1479
1479
  focus:univer-border-primary-600 focus:univer-outline-none focus:univer-ring-2 focus:univer-ring-primary-50
1480
1480
  dark:!univer-bg-gray-700 dark:!univer-text-white dark:focus:!univer-ring-primary-900
1481
- `,{variants:{size:{mini:"univer-h-7 univer-px-1.5 univer-text-sm",small:"univer-h-8 univer-px-2 univer-text-sm",middle:"univer-h-10 univer-px-3 univer-text-base",large:"univer-h-12 univer-px-4 univer-text-lg"}},defaultVariants:{size:"small"}}),Bh=D.forwardRef(({autoFocus:e=!1,className:t,style:n,type:r="text",placeholder:o,value:a,size:i="small",allowClear:s=!1,disabled:u=!1,onClick:c,onKeyDown:f,onChange:l,onFocus:h,onBlur:m,slot:y,inputClass:w,inputStyle:v,...p},g)=>{const b=k=>{k.stopPropagation(),l==null||l("")},C=k=>{l==null||l(k.target.value)},x=D.useMemo(()=>s&&a&&!u||y,[s,u,y,a]),[S,E]=D.useState(0),M=D.useRef(null);return D.useEffect(()=>{let k=null;return y&&M.current&&(k=new MutationObserver(()=>{M.current&&E(M.current.offsetWidth+4*2)}),k.observe(M.current,{childList:!0,subtree:!0}),E(M.current.offsetWidth+4*2)),()=>k==null?void 0:k.disconnect()},[M.current]),P.jsxs("div",{"data-u-comp":"input",className:Se("univer-relative univer-inline-flex univer-w-full univer-items-center univer-rounded-md",u&&"univer-cursor-not-allowed",t),style:n,children:[P.jsx("input",{ref:g,type:r,className:Se(VM({size:i}),yn,u&&`
1481
+ `,{variants:{size:{mini:"univer-h-7 univer-px-1.5 univer-text-sm",small:"univer-h-8 univer-px-2 univer-text-sm",middle:"univer-h-10 univer-px-3 univer-text-base",large:"univer-h-12 univer-px-4 univer-text-lg"}},defaultVariants:{size:"small"}}),Bh=D.forwardRef(({autoFocus:e=!1,className:t,style:n,type:r="text",placeholder:o,value:a,size:i="small",allowClear:s=!1,disabled:u=!1,onClick:c,onKeyDown:d,onChange:l,onFocus:h,onBlur:m,slot:y,inputClass:w,inputStyle:v,...p},g)=>{const b=k=>{k.stopPropagation(),l==null||l("")},C=k=>{l==null||l(k.target.value)},x=D.useMemo(()=>s&&a&&!u||y,[s,u,y,a]),[S,E]=D.useState(0),M=D.useRef(null);return D.useEffect(()=>{let k=null;return y&&M.current&&(k=new MutationObserver(()=>{M.current&&E(M.current.offsetWidth+4*2)}),k.observe(M.current,{childList:!0,subtree:!0}),E(M.current.offsetWidth+4*2)),()=>k==null?void 0:k.disconnect()},[M.current]),P.jsxs("div",{"data-u-comp":"input",className:xe("univer-relative univer-inline-flex univer-w-full univer-items-center univer-rounded-md",u&&"univer-cursor-not-allowed",t),style:n,children:[P.jsx("input",{ref:g,type:r,className:xe(VM({size:i}),mn,u&&`
1482
1482
  univer-cursor-not-allowed univer-bg-gray-50 univer-text-gray-400
1483
1483
  dark:!univer-text-gray-500
1484
- `,s&&!y&&"univer-pr-8",w),placeholder:o,value:a,disabled:u,autoFocus:e,onClick:c,onKeyDown:f,onChange:C,onFocus:h,onBlur:m,style:{...v,paddingRight:S},...p}),x&&P.jsxs("div",{className:"univer-absolute univer-right-2 univer-flex univer-items-center univer-gap-1 univer-rounded-full",ref:M,children:[y,s&&a&&!u&&P.jsx("button",{type:"button",onClick:b,className:"univer-flex univer-size-4 univer-cursor-pointer univer-items-center univer-rounded-full univer-border-none univer-bg-transparent univer-p-1 univer-text-gray-400 univer-transition-colors univer-duration-200 hover:univer-text-gray-500 focus:univer-outline-none",children:P.jsx(ua,{className:"univer-size-3"})})]})]})}),WM=D.forwardRef(({value:e,defaultValue:t,size:n="small",min:r=Number.MIN_SAFE_INTEGER,max:o=Number.MAX_SAFE_INTEGER,step:a=1,precision:i,formatter:s,parser:u,controls:c=!0,className:f,inputClassName:l,controlsClassName:h,disabled:m,onChange:y,onKeyDown:w,onPressEnter:v,onFocus:p,onBlur:g,allowEmpty:b=!1},C)=>{const[x,S]=D.useState(e!==void 0?e:t!==void 0?t:null),E=D.useRef(x),[M,k]=D.useState($(x)),T=D.useRef(null),R=D.useRef(null),F=D.useRef(null),V=A=>{C&&(typeof C=="function"?C(A):C.current=A),T.current=A};D.useEffect(()=>{e!==void 0&&(S(e),E.current=e,k($(e)))},[e]),D.useEffect(()=>{x!==null&&(E.current=x)},[x]),D.useEffect(()=>()=>{R.current&&clearTimeout(R.current),F.current&&clearInterval(F.current)},[]);function $(A){if(A==null)return"";let j=A;return i!==void 0&&(j=Number(A).toFixed(i)),s?s(j):String(j)}function L(A){if(!A)return null;let j=A;u&&(j=u(A));try{const U=j.replace(/[^\d.-]/g,"").split("."),ne=U[0],te=U.length>1?U.slice(1).join(""):"",J=ne+(te?`.${te}`:""),G=Number(J);if(Number.isNaN(G))return null;let q;if(i!==void 0){const Z=10**i,O=Math.round(G*Z)/Z;O.toString().includes("e")?q=Number.parseFloat(O.toFixed(i)):q=O}else G.toString().includes("e")?q=Number.parseFloat(G.toFixed(16).replace(/\.?0+$/,"")):q=G;return o!==void 0&&q>o&&(q=o),r!==void 0&&q<r&&(q=r),q}catch{return null}}function N(A){if(k(A),b&&A===""){S(null),y==null||y(null);return}const j=L(A);S(j),y==null||y(j)}function H(A){if(x===null){if(M===""&&b)y&&y(null);else{const Y=E.current;S(Y),k($(Y)),y&&y(Y)}g==null||g(A);return}let j=x;o!==void 0&&j>o&&(j=o),r!==void 0&&j<r&&(j=r),j!==x?(S(j),k($(j)),y==null||y(j)):k($(x)),g==null||g(A)}function _(A){if(m)return;const j=A?a:-a;let Y;x!==null?Y=x:E.current!==null?Y=E.current:Y=r>0?r:0;let U=Y+j;o!==void 0&&U>o&&(U=o),r!==void 0&&U<r&&(U=r),U!==Y&&(S(U),E.current=U,k($(U)),y==null||y(U))}function z(A){m||(w==null||w(A),A.key==="ArrowUp"?(A.preventDefault(),_(!0)):A.key==="ArrowDown"?(A.preventDefault(),_(!1)):A.key==="Enter"&&(v==null||v(A)))}function B(A){var j;m||(_(A),(j=T.current)==null||j.focus())}return P.jsx("div",{className:Se("univer-inline-block",f),children:P.jsxs("div",{className:"univer-relative univer-w-full",children:[P.jsx(Bh,{ref:V,className:Se("univer-box-border",l),size:n,value:M,disabled:m,onChange:N,onFocus:p,onBlur:H,onKeyDown:z}),c&&P.jsxs("div",{className:Se(`
1484
+ `,s&&!y&&"univer-pr-8",w),placeholder:o,value:a,disabled:u,autoFocus:e,onClick:c,onKeyDown:d,onChange:C,onFocus:h,onBlur:m,style:{...v,paddingRight:S},...p}),x&&P.jsxs("div",{className:"univer-absolute univer-right-2 univer-flex univer-items-center univer-gap-1 univer-rounded-full",ref:M,children:[y,s&&a&&!u&&P.jsx("button",{type:"button",onClick:b,className:"univer-flex univer-size-4 univer-cursor-pointer univer-items-center univer-rounded-full univer-border-none univer-bg-transparent univer-p-1 univer-text-gray-400 univer-transition-colors univer-duration-200 hover:univer-text-gray-500 focus:univer-outline-none",children:P.jsx(ua,{className:"univer-size-3"})})]})]})}),WM=D.forwardRef(({value:e,defaultValue:t,size:n="small",min:r=Number.MIN_SAFE_INTEGER,max:o=Number.MAX_SAFE_INTEGER,step:a=1,precision:i,formatter:s,parser:u,controls:c=!0,className:d,inputClassName:l,controlsClassName:h,disabled:m,onChange:y,onKeyDown:w,onPressEnter:v,onFocus:p,onBlur:g,allowEmpty:b=!1},C)=>{const[x,S]=D.useState(e!==void 0?e:t!==void 0?t:null),E=D.useRef(x),[M,k]=D.useState($(x)),T=D.useRef(null),R=D.useRef(null),F=D.useRef(null),V=A=>{C&&(typeof C=="function"?C(A):C.current=A),T.current=A};D.useEffect(()=>{e!==void 0&&(S(e),E.current=e,k($(e)))},[e]),D.useEffect(()=>{x!==null&&(E.current=x)},[x]),D.useEffect(()=>()=>{R.current&&clearTimeout(R.current),F.current&&clearInterval(F.current)},[]);function $(A){if(A==null)return"";let j=A;return i!==void 0&&(j=Number(A).toFixed(i)),s?s(j):String(j)}function L(A){if(!A)return null;let j=A;u&&(j=u(A));try{const U=j.replace(/[^\d.-]/g,"").split("."),ne=U[0],te=U.length>1?U.slice(1).join(""):"",J=ne+(te?`.${te}`:""),G=Number(J);if(Number.isNaN(G))return null;let q;if(i!==void 0){const Z=10**i,O=Math.round(G*Z)/Z;O.toString().includes("e")?q=Number.parseFloat(O.toFixed(i)):q=O}else G.toString().includes("e")?q=Number.parseFloat(G.toFixed(16).replace(/\.?0+$/,"")):q=G;return o!==void 0&&q>o&&(q=o),r!==void 0&&q<r&&(q=r),q}catch{return null}}function _(A){if(k(A),b&&A===""){S(null),y==null||y(null);return}const j=L(A);S(j),y==null||y(j)}function H(A){if(x===null){if(M===""&&b)y&&y(null);else{const Y=E.current;S(Y),k($(Y)),y&&y(Y)}g==null||g(A);return}let j=x;o!==void 0&&j>o&&(j=o),r!==void 0&&j<r&&(j=r),j!==x?(S(j),k($(j)),y==null||y(j)):k($(x)),g==null||g(A)}function N(A){if(m)return;const j=A?a:-a;let Y;x!==null?Y=x:E.current!==null?Y=E.current:Y=r>0?r:0;let U=Y+j;o!==void 0&&U>o&&(U=o),r!==void 0&&U<r&&(U=r),U!==Y&&(S(U),E.current=U,k($(U)),y==null||y(U))}function z(A){m||(w==null||w(A),A.key==="ArrowUp"?(A.preventDefault(),N(!0)):A.key==="ArrowDown"?(A.preventDefault(),N(!1)):A.key==="Enter"&&(v==null||v(A)))}function B(A){var j;m||(N(A),(j=T.current)==null||j.focus())}return P.jsx("div",{className:xe("univer-inline-block",d),children:P.jsxs("div",{className:"univer-relative univer-w-full",children:[P.jsx(Bh,{ref:V,className:xe("univer-box-border",l),size:n,value:M,disabled:m,onChange:_,onFocus:p,onBlur:H,onKeyDown:z}),c&&P.jsxs("div",{className:xe(`
1485
1485
  univer-absolute univer-right-px univer-top-px univer-box-border univer-flex
1486
1486
  univer-h-[calc(100%-2px)] univer-w-6 univer-flex-col univer-border univer-border-y-0
1487
1487
  univer-border-l univer-border-r-0 univer-border-solid univer-border-gray-200
1488
1488
  univer-border-l-gray-200
1489
1489
  dark:!univer-border-gray-600
1490
- `,h),children:[P.jsx(kn,{className:"univer-relative !univer-h-1/2 univer-w-full univer-rounded-none univer-rounded-tr-md univer-border-none !univer-bg-transparent univer-text-xs after:univer-absolute after:-univer-bottom-px after:univer-block after:univer-h-px after:univer-w-full after:univer-bg-gray-200 after:univer-content-[''] dark:after:!univer-bg-gray-600",tabIndex:-1,disabled:m||o!==void 0&&x!==null&&x>=o,onClick:()=>B(!0),children:"+"}),P.jsx(kn,{className:"!univer-h-1/2 univer-w-full univer-rounded-none univer-rounded-br-md univer-border-none !univer-bg-transparent univer-text-xs",tabIndex:-1,disabled:m||r!==void 0&&x!==null&&x<=r,onClick:()=>B(!1),children:"-"})]})]})})});function BM(e){const{keyboard:t,className:n}=e,r=t.split("+");return P.jsx("span",{className:Se("univer-inline-block univer-h-6 univer-select-none univer-rounded-md univer-bg-gray-50 univer-px-2 univer-font-mono univer-text-xs/6 univer-font-medium univer-text-gray-700 dark:!univer-bg-gray-700 dark:!univer-text-white",yn,n),children:r.map((o,a)=>P.jsxs(P.Fragment,{children:[P.jsx("kbd",{className:"univer-inline-block univer-h-full",children:o}),a<r.length-1&&P.jsx("span",{className:"univer-inline-block univer-h-full univer-px-1",children:"+"})]},a))})}function jh(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,r=new Set;function o(a,i){var s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,u=r.has(a);if(Er(!u,"Warning: There may be circular references"),u)return!1;if(a===i)return!0;if(n&&s>1)return!1;r.add(a);var c=s+1;if(Array.isArray(a)){if(!Array.isArray(i)||a.length!==i.length)return!1;for(var f=0;f<a.length;f++)if(!o(a[f],i[f],c))return!1;return!0}if(a&&i&&Ct(a)==="object"&&Ct(i)==="object"){var l=Object.keys(a);return l.length!==Object.keys(i).length?!1:l.every(function(h){return o(a[h],i[h],c)})}return!1}return o(e,t)}var Yh=d.createContext(null);function Uh(e,t){return e===void 0?null:"".concat(e,"-").concat(t)}function qh(e){var t=d.useContext(Yh);return Uh(t,e)}var jM=["children","locked"],Mn=d.createContext(null);function YM(e,t){var n=re({},e);return Object.keys(t).forEach(function(r){var o=t[r];o!==void 0&&(n[r]=o)}),n}function Jo(e){var t=e.children,n=e.locked,r=pt(e,jM),o=d.useContext(Mn),a=pd(function(){return YM(o,r)},[o,r],function(i,s){return!n&&(i[0]!==s[0]||!jh(i[1],s[1],!0))});return d.createElement(Mn.Provider,{value:a},t)}var UM=[],Gh=d.createContext(null);function Fi(){return d.useContext(Gh)}var Kh=d.createContext(UM);function ea(e){var t=d.useContext(Kh);return d.useMemo(function(){return e!==void 0?[].concat(wt(t),[e]):t},[t,e])}var Xh=d.createContext(null),Jl=d.createContext({});function Zh(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(Xs(e)){var n=e.nodeName.toLowerCase(),r=["input","select","textarea","button"].includes(n)||e.isContentEditable||n==="a"&&!!e.getAttribute("href"),o=e.getAttribute("tabindex"),a=Number(o),i=null;return o&&!Number.isNaN(a)?i=a:r&&i===null&&(i=0),r&&e.disabled&&(i=null),i!==null&&(i>=0||t&&i<0)}return!1}function qM(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=wt(e.querySelectorAll("*")).filter(function(r){return Zh(r,t)});return Zh(e,t)&&n.unshift(e),n}var eu=xn.LEFT,tu=xn.RIGHT,nu=xn.UP,zi=xn.DOWN,Hi=xn.ENTER,Qh=xn.ESC,ta=xn.HOME,na=xn.END,Jh=[nu,zi,eu,tu];function GM(e,t,n,r){var o,a="prev",i="next",s="children",u="parent";if(e==="inline"&&r===Hi)return{inlineTrigger:!0};var c=ce(ce({},nu,a),zi,i),f=ce(ce(ce(ce({},eu,n?i:a),tu,n?a:i),zi,s),Hi,s),l=ce(ce(ce(ce(ce(ce({},nu,a),zi,i),Hi,s),Qh,u),eu,n?s:u),tu,n?u:s),h={inline:c,horizontal:f,vertical:l,inlineSub:c,horizontalSub:l,verticalSub:l},m=(o=h["".concat(e).concat(t?"":"Sub")])===null||o===void 0?void 0:o[r];switch(m){case a:return{offset:-1,sibling:!0};case i:return{offset:1,sibling:!0};case u:return{offset:-1,sibling:!1};case s:return{offset:1,sibling:!1};default:return null}}function KM(e){for(var t=e;t;){if(t.getAttribute("data-menu-list"))return t;t=t.parentElement}return null}function XM(e,t){for(var n=e||document.activeElement;n;){if(t.has(n))return n;n=n.parentElement}return null}function ru(e,t){var n=qM(e,!0);return n.filter(function(r){return t.has(r)})}function ep(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;if(!e)return null;var o=ru(e,t),a=o.length,i=o.findIndex(function(s){return n===s});return r<0?i===-1?i=a-1:i-=1:r>0&&(i+=1),i=(i+a)%a,o[i]}var ou=function(t,n){var r=new Set,o=new Map,a=new Map;return t.forEach(function(i){var s=document.querySelector("[data-menu-id='".concat(Uh(n,i),"']"));s&&(r.add(s),a.set(s,i),o.set(i,s))}),{elements:r,key2element:o,element2key:a}};function ZM(e,t,n,r,o,a,i,s,u,c){var f=d.useRef(),l=d.useRef();l.current=t;var h=function(){mt.cancel(f.current)};return d.useEffect(function(){return function(){h()}},[]),function(m){var y=m.which;if([].concat(Jh,[Hi,Qh,ta,na]).includes(y)){var w=a(),v=ou(w,r),p=v,g=p.elements,b=p.key2element,C=p.element2key,x=b.get(t),S=XM(x,g),E=C.get(S),M=GM(e,i(E,!0).length===1,n,y);if(!M&&y!==ta&&y!==na)return;(Jh.includes(y)||[ta,na].includes(y))&&m.preventDefault();var k=function(H){if(H){var _=H,z=H.querySelector("a");z!=null&&z.getAttribute("href")&&(_=z);var B=C.get(H);s(B),h(),f.current=mt(function(){l.current===B&&_.focus()})}};if([ta,na].includes(y)||M.sibling||!S){var T;!S||e==="inline"?T=o.current:T=KM(S);var R,F=ru(T,g);y===ta?R=F[0]:y===na?R=F[F.length-1]:R=ep(T,g,S,M.offset),k(R)}else if(M.inlineTrigger)u(E);else if(M.offset>0)u(E,!0),h(),f.current=mt(function(){v=ou(w,r);var N=S.getAttribute("aria-controls"),H=document.getElementById(N),_=ep(H,v.elements);k(_)},5);else if(M.offset<0){var V=i(E,!0),$=V[V.length-2],L=b.get($);u($,!1),k(L)}}c==null||c(m)}}function QM(e){Promise.resolve().then(e)}var au="__RC_UTIL_PATH_SPLIT__",tp=function(t){return t.join(au)},JM=function(t){return t.split(au)},iu="rc-menu-more";function e2(){var e=d.useState({}),t=X(e,2),n=t[1],r=D.useRef(new Map),o=D.useRef(new Map),a=d.useState([]),i=X(a,2),s=i[0],u=i[1],c=D.useRef(0),f=D.useRef(!1),l=function(){f.current||n({})},h=D.useCallback(function(b,C){var x=tp(C);o.current.set(x,b),r.current.set(b,x),c.current+=1;var S=c.current;QM(function(){S===c.current&&l()})},[]),m=D.useCallback(function(b,C){var x=tp(C);o.current.delete(x),r.current.delete(b)},[]),y=D.useCallback(function(b){u(b)},[]),w=D.useCallback(function(b,C){var x=r.current.get(b)||"",S=JM(x);return C&&s.includes(S[0])&&S.unshift(iu),S},[s]),v=D.useCallback(function(b,C){return b.filter(function(x){return x!==void 0}).some(function(x){var S=w(x,!0);return S.includes(C)})},[w]),p=function(){var C=wt(r.current.keys());return s.length&&C.push(iu),C},g=D.useCallback(function(b){var C="".concat(r.current.get(b)).concat(au),x=new Set;return wt(o.current.keys()).forEach(function(S){S.startsWith(C)&&x.add(o.current.get(S))}),x},[]);return d.useEffect(function(){return function(){f.current=!0}},[]),{registerPath:h,unregisterPath:m,refreshOverflowKeys:y,isSubPathKey:v,getKeyPath:w,getKeys:p,getSubPathKeys:g}}function ra(e){var t=d.useRef(e);t.current=e;var n=d.useCallback(function(){for(var r,o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];return(r=t.current)===null||r===void 0?void 0:r.call.apply(r,[t].concat(a))},[]);return e?n:void 0}var t2=Math.random().toFixed(5).toString().slice(2),np=0;function n2(e){var t=ln(e,{value:e}),n=X(t,2),r=n[0],o=n[1];return d.useEffect(function(){np+=1;var a="".concat(t2,"-").concat(np);o("rc-menu-uuid-".concat(a))},[]),r}function rp(e,t,n,r){var o=d.useContext(Mn),a=o.activeKey,i=o.onActive,s=o.onInactive,u={active:a===e};return t||(u.onMouseEnter=function(c){n==null||n({key:e,domEvent:c}),i(e)},u.onMouseLeave=function(c){r==null||r({key:e,domEvent:c}),s(e)}),u}function op(e){var t=d.useContext(Mn),n=t.mode,r=t.rtl,o=t.inlineIndent;if(n!=="inline")return null;var a=e;return r?{paddingRight:a*o}:{paddingLeft:a*o}}function ap(e){var t=e.icon,n=e.props,r=e.children,o;return t===null||t===!1?null:(typeof t=="function"?o=d.createElement(t,re({},n)):typeof t!="boolean"&&(o=t),o||r||null)}var r2=["item"];function Vi(e){var t=e.item,n=pt(e,r2);return Object.defineProperty(n,"item",{get:function(){return Er(!1,"`info.item` is deprecated since we will move to function component that not provides React Node instance in future."),t}}),n}var o2=["title","attribute","elementRef"],a2=["style","className","eventKey","warnKey","disabled","itemIcon","children","role","onMouseEnter","onMouseLeave","onClick","onKeyDown","onFocus"],i2=["active"],s2=function(e){$a(n,e);var t=za(n);function n(){return qr(this,n),t.apply(this,arguments)}return Gr(n,[{key:"render",value:function(){var o=this.props,a=o.title,i=o.attribute,s=o.elementRef,u=pt(o,o2),c=po(u,["eventKey","popupClassName","popupOffset","onTitleClick"]);return Er(!i,"`attribute` of Menu.Item is deprecated. Please pass attribute directly."),d.createElement(Tn.Item,Ne({},i,{title:typeof a=="string"?a:void 0},c,{ref:s}))}}]),n}(d.Component),l2=d.forwardRef(function(e,t){var n=e.style,r=e.className,o=e.eventKey;e.warnKey;var a=e.disabled,i=e.itemIcon,s=e.children,u=e.role,c=e.onMouseEnter,f=e.onMouseLeave,l=e.onClick,h=e.onKeyDown,m=e.onFocus,y=pt(e,a2),w=qh(o),v=d.useContext(Mn),p=v.prefixCls,g=v.onItemClick,b=v.disabled,C=v.overflowDisabled,x=v.itemIcon,S=v.selectedKeys,E=v.onActive,M=d.useContext(Jl),k=M._internalRenderMenuItem,T="".concat(p,"-item"),R=d.useRef(),F=d.useRef(),V=b||a,$=_a(t,F),L=ea(o),N=function(q){return{key:o,keyPath:wt(L).reverse(),item:R.current,domEvent:q}},H=i||x,_=rp(o,V,c,f),z=_.active,B=pt(_,i2),A=S.includes(o),j=op(L.length),Y=function(q){if(!V){var Z=N(q);l==null||l(Vi(Z)),g(Z)}},U=function(q){if(h==null||h(q),q.which===xn.ENTER){var Z=N(q);l==null||l(Vi(Z)),g(Z)}},ne=function(q){E(o),m==null||m(q)},te={};e.role==="option"&&(te["aria-selected"]=A);var J=d.createElement(s2,Ne({ref:R,elementRef:$,role:u===null?"none":u||"menuitem",tabIndex:a?null:-1,"data-menu-id":C&&w?null:w},po(y,["extra"]),B,te,{component:"li","aria-disabled":a,style:re(re({},j),n),className:Xe(T,ce(ce(ce({},"".concat(T,"-active"),z),"".concat(T,"-selected"),A),"".concat(T,"-disabled"),V),r),onClick:Y,onKeyDown:U,onFocus:ne}),s,d.createElement(ap,{props:re(re({},e),{},{isSelected:A}),icon:H}));return k&&(J=k(J,e,{selected:A})),J});function u2(e,t){var n=e.eventKey,r=Fi(),o=ea(n);return d.useEffect(function(){if(r)return r.registerPath(n,o),function(){r.unregisterPath(n,o)}},[o]),r?null:d.createElement(l2,Ne({},e,{ref:t}))}const Wi=d.forwardRef(u2);var c2=["className","children"],d2=function(t,n){var r=t.className,o=t.children,a=pt(t,c2),i=d.useContext(Mn),s=i.prefixCls,u=i.mode,c=i.rtl;return d.createElement("ul",Ne({className:Xe(s,c&&"".concat(s,"-rtl"),"".concat(s,"-sub"),"".concat(s,"-").concat(u==="inline"?"inline":"vertical"),r),role:"menu"},a,{"data-menu-list":!0,ref:n}),o)},su=d.forwardRef(d2);su.displayName="SubMenuList";function lu(e,t){return Oa(e).map(function(n,r){if(d.isValidElement(n)){var o,a,i=n.key,s=(o=(a=n.props)===null||a===void 0?void 0:a.eventKey)!==null&&o!==void 0?o:i,u=s==null;u&&(s="tmp_key-".concat([].concat(wt(t),[r]).join("-")));var c={key:s,eventKey:s};return d.cloneElement(n,c)}return n})}var Gt={adjustX:1,adjustY:1},f2={topLeft:{points:["bl","tl"],overflow:Gt},topRight:{points:["br","tr"],overflow:Gt},bottomLeft:{points:["tl","bl"],overflow:Gt},bottomRight:{points:["tr","br"],overflow:Gt},leftTop:{points:["tr","tl"],overflow:Gt},leftBottom:{points:["br","bl"],overflow:Gt},rightTop:{points:["tl","tr"],overflow:Gt},rightBottom:{points:["bl","br"],overflow:Gt}},v2={topLeft:{points:["bl","tl"],overflow:Gt},topRight:{points:["br","tr"],overflow:Gt},bottomLeft:{points:["tl","bl"],overflow:Gt},bottomRight:{points:["tr","br"],overflow:Gt},rightTop:{points:["tr","tl"],overflow:Gt},rightBottom:{points:["br","bl"],overflow:Gt},leftTop:{points:["tl","tr"],overflow:Gt},leftBottom:{points:["bl","br"],overflow:Gt}};function ip(e,t,n){if(t)return t;if(n)return n[e]||n.other}var m2={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"};function h2(e){var t=e.prefixCls,n=e.visible,r=e.children,o=e.popup,a=e.popupStyle,i=e.popupClassName,s=e.popupOffset,u=e.disabled,c=e.mode,f=e.onVisibleChange,l=d.useContext(Mn),h=l.getPopupContainer,m=l.rtl,y=l.subMenuOpenDelay,w=l.subMenuCloseDelay,v=l.builtinPlacements,p=l.triggerSubMenuAction,g=l.forceSubMenuRender,b=l.rootClassName,C=l.motion,x=l.defaultMotions,S=d.useState(!1),E=X(S,2),M=E[0],k=E[1],T=re(m?re({},v2):re({},f2),v),R=m2[c],F=ip(c,C,x),V=d.useRef(F);c!=="inline"&&(V.current=F);var $=re(re({},V.current),{},{leavedClassName:"".concat(t,"-hidden"),removeOnLeave:!1,motionAppear:!0}),L=d.useRef();return d.useEffect(function(){return L.current=mt(function(){k(n)}),function(){mt.cancel(L.current)}},[n]),d.createElement(Qs,{prefixCls:t,popupClassName:Xe("".concat(t,"-popup"),ce({},"".concat(t,"-rtl"),m),i,b),stretch:c==="horizontal"?"minWidth":null,getPopupContainer:h,builtinPlacements:T,popupPlacement:R,popupVisible:M,popup:o,popupStyle:a,popupAlign:s&&{offset:s},action:u?[]:[p],mouseEnterDelay:y,mouseLeaveDelay:w,onPopupVisibleChange:f,forceRender:g,popupMotion:$,fresh:!0},r)}function p2(e){var t=e.id,n=e.open,r=e.keyPath,o=e.children,a="inline",i=d.useContext(Mn),s=i.prefixCls,u=i.forceSubMenuRender,c=i.motion,f=i.defaultMotions,l=i.mode,h=d.useRef(!1);h.current=l===a;var m=d.useState(!h.current),y=X(m,2),w=y[0],v=y[1],p=h.current?n:!1;d.useEffect(function(){h.current&&v(!1)},[l]);var g=re({},ip(a,c,f));r.length>1&&(g.motionAppear=!1);var b=g.onVisibleChanged;return g.onVisibleChanged=function(C){return!h.current&&!C&&v(!0),b==null?void 0:b(C)},w?null:d.createElement(Jo,{mode:a,locked:!h.current},d.createElement(ja,Ne({visible:p},g,{forceRender:u,removeOnLeave:!1,leavedClassName:"".concat(s,"-hidden")}),function(C){var x=C.className,S=C.style;return d.createElement(su,{id:t,className:x,style:S},o)}))}var g2=["style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","popupStyle","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave"],y2=["active"],b2=d.forwardRef(function(e,t){var n=e.style,r=e.className,o=e.title,a=e.eventKey;e.warnKey;var i=e.disabled,s=e.internalPopupClose,u=e.children,c=e.itemIcon,f=e.expandIcon,l=e.popupClassName,h=e.popupOffset,m=e.popupStyle,y=e.onClick,w=e.onMouseEnter,v=e.onMouseLeave,p=e.onTitleClick,g=e.onTitleMouseEnter,b=e.onTitleMouseLeave,C=pt(e,g2),x=qh(a),S=d.useContext(Mn),E=S.prefixCls,M=S.mode,k=S.openKeys,T=S.disabled,R=S.overflowDisabled,F=S.activeKey,V=S.selectedKeys,$=S.itemIcon,L=S.expandIcon,N=S.onItemClick,H=S.onOpenChange,_=S.onActive,z=d.useContext(Jl),B=z._internalRenderSubMenuItem,A=d.useContext(Xh),j=A.isSubPathKey,Y=ea(),U="".concat(E,"-submenu"),ne=T||i,te=d.useRef(),J=d.useRef(),G=c!=null?c:$,q=f!=null?f:L,Z=k.includes(a),O=!R&&Z,I=j(V,a),W=rp(a,ne,g,b),K=W.active,oe=pt(W,y2),Q=d.useState(!1),ae=X(Q,2),ee=ae[0],ie=ae[1],ve=function(Pe){ne||ie(Pe)},ye=function(Pe){ve(!0),w==null||w({key:a,domEvent:Pe})},de=function(Pe){ve(!1),v==null||v({key:a,domEvent:Pe})},se=d.useMemo(function(){return K||(M!=="inline"?ee||j([F],a):!1)},[M,K,F,ee,a,j]),He=op(Y.length),Le=function(Pe){ne||(p==null||p({key:a,domEvent:Pe}),M==="inline"&&H(a,!Z))},ge=ra(function(fe){y==null||y(Vi(fe)),N(fe)}),Ye=function(Pe){M!=="inline"&&H(a,Pe)},Fe=function(){_(a)},ze=x&&"".concat(x,"-popup"),Ge=d.useMemo(function(){return d.createElement(ap,{icon:M!=="horizontal"?q:void 0,props:re(re({},e),{},{isOpen:O,isSubMenu:!0})},d.createElement("i",{className:"".concat(U,"-arrow")}))},[M,q,e,O,U]),Ke=d.createElement("div",Ne({role:"menuitem",style:He,className:"".concat(U,"-title"),tabIndex:ne?null:-1,ref:te,title:typeof o=="string"?o:null,"data-menu-id":R&&x?null:x,"aria-expanded":O,"aria-haspopup":!0,"aria-controls":ze,"aria-disabled":ne,onClick:Le,onFocus:Fe},oe),o,Ge),Ee=d.useRef(M);if(M!=="inline"&&Y.length>1?Ee.current="vertical":Ee.current=M,!R){var $e=Ee.current;Ke=d.createElement(h2,{mode:$e,prefixCls:U,visible:!s&&O&&M!=="inline",popupClassName:l,popupOffset:h,popupStyle:m,popup:d.createElement(Jo,{mode:$e==="horizontal"?"vertical":$e},d.createElement(su,{id:ze,ref:J},u)),disabled:ne,onVisibleChange:Ye},Ke)}var le=d.createElement(Tn.Item,Ne({ref:t,role:"none"},C,{component:"li",style:n,className:Xe(U,"".concat(U,"-").concat(M),r,ce(ce(ce(ce({},"".concat(U,"-open"),O),"".concat(U,"-active"),se),"".concat(U,"-selected"),I),"".concat(U,"-disabled"),ne)),onMouseEnter:ye,onMouseLeave:de}),Ke,!R&&d.createElement(p2,{id:ze,open:O,keyPath:Y},u));return B&&(le=B(le,e,{selected:I,active:se,open:O,disabled:ne})),d.createElement(Jo,{onItemClick:ge,mode:M==="horizontal"?"vertical":M,itemIcon:G,expandIcon:q},le)}),Bi=d.forwardRef(function(e,t){var n=e.eventKey,r=e.children,o=ea(n),a=lu(r,o),i=Fi();d.useEffect(function(){if(i)return i.registerPath(n,o),function(){i.unregisterPath(n,o)}},[o]);var s;return i?s=a:s=d.createElement(b2,Ne({ref:t},e),a),d.createElement(Kh.Provider,{value:o},s)});function sp(e){var t=e.className,n=e.style,r=d.useContext(Mn),o=r.prefixCls,a=Fi();return a?null:d.createElement("li",{role:"separator",className:Xe("".concat(o,"-item-divider"),t),style:n})}var w2=["className","title","eventKey","children"],C2=d.forwardRef(function(e,t){var n=e.className,r=e.title;e.eventKey;var o=e.children,a=pt(e,w2),i=d.useContext(Mn),s=i.prefixCls,u="".concat(s,"-item-group");return d.createElement("li",Ne({ref:t,role:"presentation"},a,{onClick:function(f){return f.stopPropagation()},className:Xe(u,n)}),d.createElement("div",{role:"presentation",className:"".concat(u,"-title"),title:typeof r=="string"?r:void 0},r),d.createElement("ul",{role:"group",className:"".concat(u,"-list")},o))}),uu=d.forwardRef(function(e,t){var n=e.eventKey,r=e.children,o=ea(n),a=lu(r,o),i=Fi();return i?a:d.createElement(C2,Ne({ref:t},po(e,["warnKey"])),a)}),x2=["label","children","key","type","extra"];function cu(e,t,n){var r=t.item,o=t.group,a=t.submenu,i=t.divider;return(e||[]).map(function(s,u){if(s&&Ct(s)==="object"){var c=s,f=c.label,l=c.children,h=c.key,m=c.type,y=c.extra,w=pt(c,x2),v=h!=null?h:"tmp-".concat(u);return l||m==="group"?m==="group"?d.createElement(o,Ne({key:v},w,{title:f}),cu(l,t,n)):d.createElement(a,Ne({key:v},w,{title:f}),cu(l,t,n)):m==="divider"?d.createElement(i,Ne({key:v},w)):d.createElement(r,Ne({key:v},w,{extra:y}),f,(!!y||y===0)&&d.createElement("span",{className:"".concat(n,"-item-extra")},y))}return null}).filter(function(s){return s})}function lp(e,t,n,r,o){var a=e,i=re({divider:sp,item:Wi,group:uu,submenu:Bi},r);return t&&(a=cu(t,i,o)),lu(a,n)}var S2=["prefixCls","rootClassName","style","className","tabIndex","items","children","direction","id","mode","inlineCollapsed","disabled","disabledOverflow","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","defaultOpenKeys","openKeys","activeKey","defaultActiveFirst","selectable","multiple","defaultSelectedKeys","selectedKeys","onSelect","onDeselect","inlineIndent","motion","defaultMotions","triggerSubMenuAction","builtinPlacements","itemIcon","expandIcon","overflowedIndicator","overflowedIndicatorPopupClassName","getPopupContainer","onClick","onOpenChange","onKeyDown","openAnimation","openTransitionName","_internalRenderMenuItem","_internalRenderSubMenuItem","_internalComponents"],Or=[],E2=d.forwardRef(function(e,t){var n,r=e,o=r.prefixCls,a=o===void 0?"rc-menu":o,i=r.rootClassName,s=r.style,u=r.className,c=r.tabIndex,f=c===void 0?0:c,l=r.items,h=r.children,m=r.direction,y=r.id,w=r.mode,v=w===void 0?"vertical":w,p=r.inlineCollapsed,g=r.disabled,b=r.disabledOverflow,C=r.subMenuOpenDelay,x=C===void 0?.1:C,S=r.subMenuCloseDelay,E=S===void 0?.1:S,M=r.forceSubMenuRender,k=r.defaultOpenKeys,T=r.openKeys,R=r.activeKey,F=r.defaultActiveFirst,V=r.selectable,$=V===void 0?!0:V,L=r.multiple,N=L===void 0?!1:L,H=r.defaultSelectedKeys,_=r.selectedKeys,z=r.onSelect,B=r.onDeselect,A=r.inlineIndent,j=A===void 0?24:A,Y=r.motion,U=r.defaultMotions,ne=r.triggerSubMenuAction,te=ne===void 0?"hover":ne,J=r.builtinPlacements,G=r.itemIcon,q=r.expandIcon,Z=r.overflowedIndicator,O=Z===void 0?"...":Z,I=r.overflowedIndicatorPopupClassName,W=r.getPopupContainer,K=r.onClick,oe=r.onOpenChange,Q=r.onKeyDown;r.openAnimation,r.openTransitionName;var ae=r._internalRenderMenuItem,ee=r._internalRenderSubMenuItem,ie=r._internalComponents,ve=pt(r,S2),ye=d.useMemo(function(){return[lp(h,l,Or,ie,a),lp(h,l,Or,{},a)]},[h,l,ie]),de=X(ye,2),se=de[0],He=de[1],Le=d.useState(!1),ge=X(Le,2),Ye=ge[0],Fe=ge[1],ze=d.useRef(),Ge=n2(y),Ke=m==="rtl",Ee=ln(k,{value:T,postState:function(ot){return ot||Or}}),$e=X(Ee,2),le=$e[0],fe=$e[1],Pe=function(ot){var lt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;function Tt(){fe(ot),oe==null||oe(ot)}lt?It.flushSync(Tt):Tt()},ue=d.useState(le),he=X(ue,2),Ue=he[0],Je=he[1],nt=d.useRef(!1),yt=d.useMemo(function(){return(v==="inline"||v==="vertical")&&p?["vertical",p]:[v,!1]},[v,p]),tt=X(yt,2),be=tt[0],We=tt[1],Oe=be==="inline",Ce=d.useState(be),xe=X(Ce,2),pe=xe[0],Ve=xe[1],dt=d.useState(We),ut=X(dt,2),rt=ut[0],Jt=ut[1];d.useEffect(function(){Ve(be),Jt(We),nt.current&&(Oe?fe(Ue):Pe(Or))},[be,We]);var xt=d.useState(0),Vt=X(xt,2),en=Vt[0],dn=Vt[1],Wt=en>=se.length-1||pe!=="horizontal"||b;d.useEffect(function(){Oe&&Je(le)},[le]),d.useEffect(function(){return nt.current=!0,function(){nt.current=!1}},[]);var Nt=e2(),Kt=Nt.registerPath,Et=Nt.unregisterPath,Bt=Nt.refreshOverflowKeys,bt=Nt.isSubPathKey,sn=Nt.getKeyPath,Ot=Nt.getKeys,fn=Nt.getSubPathKeys,we=d.useMemo(function(){return{registerPath:Kt,unregisterPath:Et}},[Kt,Et]),Me=d.useMemo(function(){return{isSubPathKey:bt}},[bt]);d.useEffect(function(){Bt(Wt?Or:se.slice(en+1).map(function(ft){return ft.key}))},[en,Wt]);var Be=ln(R||F&&((n=se[0])===null||n===void 0?void 0:n.key),{value:R}),qe=X(Be,2),it=qe[0],Ft=qe[1],Rt=ra(function(ft){Ft(ft)}),tn=ra(function(){Ft(void 0)});D.useImperativeHandle(t,function(){return{list:ze.current,focus:function(ot){var lt,Tt=Ot(),Te=ou(Tt,Ge),Re=Te.elements,Mt=Te.key2element,Qt=Te.element2key,Pn=ru(ze.current,Re),Zn=it!=null?it:Pn[0]?Qt.get(Pn[0]):(lt=se.find(function(Ze){return!Ze.props.disabled}))===null||lt===void 0?void 0:lt.key,Dn=Mt.get(Zn);if(Zn&&Dn){var Qn;Dn==null||(Qn=Dn.focus)===null||Qn===void 0||Qn.call(Dn,ot)}}}});var nn=ln(H||[],{value:_,postState:function(ot){return Array.isArray(ot)?ot:ot==null?Or:[ot]}}),Xt=X(nn,2),zt=Xt[0],rn=Xt[1],zn=function(ot){if($){var lt=ot.key,Tt=zt.includes(lt),Te;N?Tt?Te=zt.filter(function(Mt){return Mt!==lt}):Te=[].concat(wt(zt),[lt]):Te=[lt],rn(Te);var Re=re(re({},ot),{},{selectedKeys:Te});Tt?B==null||B(Re):z==null||z(Re)}!N&&le.length&&pe!=="inline"&&Pe(Or)},Hn=ra(function(ft){K==null||K(Vi(ft)),zn(ft)}),jt=ra(function(ft,ot){var lt=le.filter(function(Te){return Te!==ft});if(ot)lt.push(ft);else if(pe!=="inline"){var Tt=fn(ft);lt=lt.filter(function(Te){return!Tt.has(Te)})}jh(le,lt,!0)||Pe(lt,!0)}),Yt=function(ot,lt){var Tt=lt!=null?lt:!le.includes(ot);jt(ot,Tt)},pn=ZM(pe,it,Ke,Ge,ze,Ot,sn,Ft,Yt,Q);d.useEffect(function(){Fe(!0)},[]);var gn=d.useMemo(function(){return{_internalRenderMenuItem:ae,_internalRenderSubMenuItem:ee}},[ae,ee]),Zt=pe!=="horizontal"||b?se:se.map(function(ft,ot){return d.createElement(Jo,{key:ft.key,overflowDisabled:ot>en},ft)}),Xn=d.createElement(Tn,Ne({id:y,ref:ze,prefixCls:"".concat(a,"-overflow"),component:"ul",itemComponent:Wi,className:Xe(a,"".concat(a,"-root"),"".concat(a,"-").concat(pe),u,ce(ce({},"".concat(a,"-inline-collapsed"),rt),"".concat(a,"-rtl"),Ke),i),dir:m,style:s,role:"menu",tabIndex:f,data:Zt,renderRawItem:function(ot){return ot},renderRawRest:function(ot){var lt=ot.length,Tt=lt?se.slice(-lt):null;return d.createElement(Bi,{eventKey:iu,title:O,disabled:Wt,internalPopupClose:lt===0,popupClassName:I},Tt)},maxCount:pe!=="horizontal"||b?Tn.INVALIDATE:Tn.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function(ot){dn(ot)},onKeyDown:pn},ve));return d.createElement(Jl.Provider,{value:gn},d.createElement(Yh.Provider,{value:Ge},d.createElement(Jo,{prefixCls:a,rootClassName:i,mode:pe,openKeys:le,rtl:Ke,disabled:g,motion:Ye?Y:null,defaultMotions:Ye?U:null,activeKey:it,onActive:Rt,onInactive:tn,selectedKeys:zt,inlineIndent:j,subMenuOpenDelay:x,subMenuCloseDelay:E,forceSubMenuRender:M,builtinPlacements:J,triggerSubMenuAction:te,getPopupContainer:W,itemIcon:G,expandIcon:q,onItemClick:Hn,onOpenChange:jt},d.createElement(Xh.Provider,{value:Me},Xn),d.createElement("div",{style:{display:"none"},"aria-hidden":!0},d.createElement(Gh.Provider,{value:we},He)))))}),oa=E2;oa.Item=Wi,oa.SubMenu=Bi,oa.ItemGroup=uu,oa.Divider=sp;var M2=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),P2="VisuallyHidden",up=d.forwardRef((e,t)=>P.jsx(gt.span,{...e,ref:t,style:{...M2,...e.style}}));up.displayName=P2;var D2=up,[ji,AD]=Wn("Tooltip",[vr]),Yi=vr(),cp="TooltipProvider",k2=700,du="tooltip.open",[_2,fu]=ji(cp),dp=e=>{const{__scopeTooltip:t,delayDuration:n=k2,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:a}=e,i=d.useRef(!0),s=d.useRef(!1),u=d.useRef(0);return d.useEffect(()=>{const c=u.current;return()=>window.clearTimeout(c)},[]),P.jsx(_2,{scope:t,isOpenDelayedRef:i,delayDuration:n,onOpen:d.useCallback(()=>{window.clearTimeout(u.current),i.current=!1},[]),onClose:d.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>i.current=!0,r)},[r]),isPointerInTransitRef:s,onPointerInTransitChange:d.useCallback(c=>{s.current=c},[]),disableHoverableContent:o,children:a})};dp.displayName=cp;var aa="Tooltip",[N2,ia]=ji(aa),fp=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o,onOpenChange:a,disableHoverableContent:i,delayDuration:s}=e,u=fu(aa,e.__scopeTooltip),c=Yi(t),[f,l]=d.useState(null),h=_n(),m=d.useRef(0),y=i!=null?i:u.disableHoverableContent,w=s!=null?s:u.delayDuration,v=d.useRef(!1),[p,g]=xr({prop:r,defaultProp:o!=null?o:!1,onChange:E=>{E?(u.onOpen(),document.dispatchEvent(new CustomEvent(du))):u.onClose(),a==null||a(E)},caller:aa}),b=d.useMemo(()=>p?v.current?"delayed-open":"instant-open":"closed",[p]),C=d.useCallback(()=>{window.clearTimeout(m.current),m.current=0,v.current=!1,g(!0)},[g]),x=d.useCallback(()=>{window.clearTimeout(m.current),m.current=0,g(!1)},[g]),S=d.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{v.current=!0,g(!0),m.current=0},w)},[w,g]);return d.useEffect(()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)},[]),P.jsx(Bo,{...c,children:P.jsx(N2,{scope:t,contentId:h,open:p,stateAttribute:b,trigger:f,onTriggerChange:l,onTriggerEnter:d.useCallback(()=>{u.isOpenDelayedRef.current?S():C()},[u.isOpenDelayedRef,S,C]),onTriggerLeave:d.useCallback(()=>{y?x():(window.clearTimeout(m.current),m.current=0)},[x,y]),onOpen:C,onClose:x,disableHoverableContent:y,children:n})})};fp.displayName=aa;var vu="TooltipTrigger",vp=d.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=ia(vu,n),a=fu(vu,n),i=Yi(n),s=d.useRef(null),u=Pt(t,s,o.onTriggerChange),c=d.useRef(!1),f=d.useRef(!1),l=d.useCallback(()=>c.current=!1,[]);return d.useEffect(()=>()=>document.removeEventListener("pointerup",l),[l]),P.jsx(jo,{asChild:!0,...i,children:P.jsx(gt.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:u,onPointerMove:Ie(e.onPointerMove,h=>{h.pointerType!=="touch"&&!f.current&&!a.isPointerInTransitRef.current&&(o.onTriggerEnter(),f.current=!0)}),onPointerLeave:Ie(e.onPointerLeave,()=>{o.onTriggerLeave(),f.current=!1}),onPointerDown:Ie(e.onPointerDown,()=>{o.open&&o.onClose(),c.current=!0,document.addEventListener("pointerup",l,{once:!0})}),onFocus:Ie(e.onFocus,()=>{c.current||o.onOpen()}),onBlur:Ie(e.onBlur,o.onClose),onClick:Ie(e.onClick,o.onClose)})})});vp.displayName=vu;var mu="TooltipPortal",[O2,T2]=ji(mu,{forceMount:void 0}),mp=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,a=ia(mu,t);return P.jsx(O2,{scope:t,forceMount:n,children:P.jsx(on,{present:n||a.open,children:P.jsx(Hr,{asChild:!0,container:o,children:r})})})};mp.displayName=mu;var uo="TooltipContent",hp=d.forwardRef((e,t)=>{const n=T2(uo,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...a}=e,i=ia(uo,e.__scopeTooltip);return P.jsx(on,{present:r||i.open,children:i.disableHoverableContent?P.jsx(pp,{side:o,...a,ref:t}):P.jsx(I2,{side:o,...a,ref:t})})}),I2=d.forwardRef((e,t)=>{const n=ia(uo,e.__scopeTooltip),r=fu(uo,e.__scopeTooltip),o=d.useRef(null),a=Pt(t,o),[i,s]=d.useState(null),{trigger:u,onClose:c}=n,f=o.current,{onPointerInTransitChange:l}=r,h=d.useCallback(()=>{s(null),l(!1)},[l]),m=d.useCallback((y,w)=>{const v=y.currentTarget,p={x:y.clientX,y:y.clientY},g=$2(p,v.getBoundingClientRect()),b=F2(p,g),C=z2(w.getBoundingClientRect()),x=V2([...b,...C]);s(x),l(!0)},[l]);return d.useEffect(()=>()=>h(),[h]),d.useEffect(()=>{if(u&&f){const y=v=>m(v,f),w=v=>m(v,u);return u.addEventListener("pointerleave",y),f.addEventListener("pointerleave",w),()=>{u.removeEventListener("pointerleave",y),f.removeEventListener("pointerleave",w)}}},[u,f,m,h]),d.useEffect(()=>{if(i){const y=w=>{const v=w.target,p={x:w.clientX,y:w.clientY},g=(u==null?void 0:u.contains(v))||(f==null?void 0:f.contains(v)),b=!H2(p,i);g?h():b&&(h(),c())};return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[u,f,i,c,h]),P.jsx(pp,{...e,ref:a})}),[R2,A2]=ji(aa,{isInside:!1}),L2=Zg("TooltipContent"),pp=d.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:a,onPointerDownOutside:i,...s}=e,u=ia(uo,n),c=Yi(n),{onClose:f}=u;return d.useEffect(()=>(document.addEventListener(du,f),()=>document.removeEventListener(du,f)),[f]),d.useEffect(()=>{if(u.trigger){const l=h=>{const m=h.target;m!=null&&m.contains(u.trigger)&&f()};return window.addEventListener("scroll",l,{capture:!0}),()=>window.removeEventListener("scroll",l,{capture:!0})}},[u.trigger,f]),P.jsx(zr,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:l=>l.preventDefault(),onDismiss:f,children:P.jsxs(Pi,{"data-state":u.stateAttribute,...c,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[P.jsx(L2,{children:r}),P.jsx(R2,{scope:n,isInside:!0,children:P.jsx(D2,{id:u.contentId,role:"tooltip",children:o||r})})]})})});hp.displayName=uo;var gp="TooltipArrow",yp=d.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Yi(n);return A2(gp,n).isInside?null:P.jsx(Di,{...o,...r,ref:t})});yp.displayName=gp;function $2(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,o,a)){case a:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function F2(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function z2(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function H2(e,t){const{x:n,y:r}=e;let o=!1;for(let a=0,i=t.length-1;a<t.length;i=a++){const s=t[a],u=t[i],c=s.x,f=s.y,l=u.x,h=u.y;f>r!=h>r&&n<(l-c)*(r-f)/(h-f)+c&&(o=!o)}return o}function V2(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),W2(t)}function W2(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const a=t[t.length-1],i=t[t.length-2];if((a.x-i.x)*(o.y-i.y)>=(a.y-i.y)*(o.x-i.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const a=n[n.length-1],i=n[n.length-2];if((a.x-i.x)*(o.y-i.y)>=(a.y-i.y)*(o.x-i.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var B2=dp,j2=fp,Y2=vp,U2=mp,q2=hp,G2=yp;const K2=B2,X2=j2,Z2=Y2,Q2=D.forwardRef(({className:e,sideOffset:t=4,children:n,...r},o)=>P.jsx(U2,{children:P.jsxs(q2,{ref:o,sideOffset:t,className:Se(`
1490
+ `,h),children:[P.jsx(kn,{className:"univer-relative !univer-h-1/2 univer-w-full univer-rounded-none univer-rounded-tr-md univer-border-none !univer-bg-transparent univer-text-xs after:univer-absolute after:-univer-bottom-px after:univer-block after:univer-h-px after:univer-w-full after:univer-bg-gray-200 after:univer-content-[''] dark:after:!univer-bg-gray-600",tabIndex:-1,disabled:m||o!==void 0&&x!==null&&x>=o,onClick:()=>B(!0),children:"+"}),P.jsx(kn,{className:"!univer-h-1/2 univer-w-full univer-rounded-none univer-rounded-br-md univer-border-none !univer-bg-transparent univer-text-xs",tabIndex:-1,disabled:m||r!==void 0&&x!==null&&x<=r,onClick:()=>B(!1),children:"-"})]})]})})});function BM(e){const{keyboard:t,className:n}=e,r=t.split("+");return P.jsx("span",{className:xe("univer-inline-block univer-h-6 univer-select-none univer-rounded-md univer-bg-gray-50 univer-px-2 univer-font-mono univer-text-xs/6 univer-font-medium univer-text-gray-700 dark:!univer-bg-gray-700 dark:!univer-text-white",mn,n),children:r.map((o,a)=>P.jsxs(P.Fragment,{children:[P.jsx("kbd",{className:"univer-inline-block univer-h-full",children:o}),a<r.length-1&&P.jsx("span",{className:"univer-inline-block univer-h-full univer-px-1",children:"+"})]},a))})}function jh(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,r=new Set;function o(a,i){var s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,u=r.has(a);if(Er(!u,"Warning: There may be circular references"),u)return!1;if(a===i)return!0;if(n&&s>1)return!1;r.add(a);var c=s+1;if(Array.isArray(a)){if(!Array.isArray(i)||a.length!==i.length)return!1;for(var d=0;d<a.length;d++)if(!o(a[d],i[d],c))return!1;return!0}if(a&&i&&Ct(a)==="object"&&Ct(i)==="object"){var l=Object.keys(a);return l.length!==Object.keys(i).length?!1:l.every(function(h){return o(a[h],i[h],c)})}return!1}return o(e,t)}var Yh=f.createContext(null);function Uh(e,t){return e===void 0?null:"".concat(e,"-").concat(t)}function qh(e){var t=f.useContext(Yh);return Uh(t,e)}var jM=["children","locked"],Mn=f.createContext(null);function YM(e,t){var n=re({},e);return Object.keys(t).forEach(function(r){var o=t[r];o!==void 0&&(n[r]=o)}),n}function Jo(e){var t=e.children,n=e.locked,r=pt(e,jM),o=f.useContext(Mn),a=pd(function(){return YM(o,r)},[o,r],function(i,s){return!n&&(i[0]!==s[0]||!jh(i[1],s[1],!0))});return f.createElement(Mn.Provider,{value:a},t)}var UM=[],Gh=f.createContext(null);function Fi(){return f.useContext(Gh)}var Kh=f.createContext(UM);function ea(e){var t=f.useContext(Kh);return f.useMemo(function(){return e!==void 0?[].concat(wt(t),[e]):t},[t,e])}var Xh=f.createContext(null),Jl=f.createContext({});function Zh(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(Xs(e)){var n=e.nodeName.toLowerCase(),r=["input","select","textarea","button"].includes(n)||e.isContentEditable||n==="a"&&!!e.getAttribute("href"),o=e.getAttribute("tabindex"),a=Number(o),i=null;return o&&!Number.isNaN(a)?i=a:r&&i===null&&(i=0),r&&e.disabled&&(i=null),i!==null&&(i>=0||t&&i<0)}return!1}function qM(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=wt(e.querySelectorAll("*")).filter(function(r){return Zh(r,t)});return Zh(e,t)&&n.unshift(e),n}var eu=xn.LEFT,tu=xn.RIGHT,nu=xn.UP,zi=xn.DOWN,Hi=xn.ENTER,Qh=xn.ESC,ta=xn.HOME,na=xn.END,Jh=[nu,zi,eu,tu];function GM(e,t,n,r){var o,a="prev",i="next",s="children",u="parent";if(e==="inline"&&r===Hi)return{inlineTrigger:!0};var c=ce(ce({},nu,a),zi,i),d=ce(ce(ce(ce({},eu,n?i:a),tu,n?a:i),zi,s),Hi,s),l=ce(ce(ce(ce(ce(ce({},nu,a),zi,i),Hi,s),Qh,u),eu,n?s:u),tu,n?u:s),h={inline:c,horizontal:d,vertical:l,inlineSub:c,horizontalSub:l,verticalSub:l},m=(o=h["".concat(e).concat(t?"":"Sub")])===null||o===void 0?void 0:o[r];switch(m){case a:return{offset:-1,sibling:!0};case i:return{offset:1,sibling:!0};case u:return{offset:-1,sibling:!1};case s:return{offset:1,sibling:!1};default:return null}}function KM(e){for(var t=e;t;){if(t.getAttribute("data-menu-list"))return t;t=t.parentElement}return null}function XM(e,t){for(var n=e||document.activeElement;n;){if(t.has(n))return n;n=n.parentElement}return null}function ru(e,t){var n=qM(e,!0);return n.filter(function(r){return t.has(r)})}function ep(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;if(!e)return null;var o=ru(e,t),a=o.length,i=o.findIndex(function(s){return n===s});return r<0?i===-1?i=a-1:i-=1:r>0&&(i+=1),i=(i+a)%a,o[i]}var ou=function(t,n){var r=new Set,o=new Map,a=new Map;return t.forEach(function(i){var s=document.querySelector("[data-menu-id='".concat(Uh(n,i),"']"));s&&(r.add(s),a.set(s,i),o.set(i,s))}),{elements:r,key2element:o,element2key:a}};function ZM(e,t,n,r,o,a,i,s,u,c){var d=f.useRef(),l=f.useRef();l.current=t;var h=function(){mt.cancel(d.current)};return f.useEffect(function(){return function(){h()}},[]),function(m){var y=m.which;if([].concat(Jh,[Hi,Qh,ta,na]).includes(y)){var w=a(),v=ou(w,r),p=v,g=p.elements,b=p.key2element,C=p.element2key,x=b.get(t),S=XM(x,g),E=C.get(S),M=GM(e,i(E,!0).length===1,n,y);if(!M&&y!==ta&&y!==na)return;(Jh.includes(y)||[ta,na].includes(y))&&m.preventDefault();var k=function(H){if(H){var N=H,z=H.querySelector("a");z!=null&&z.getAttribute("href")&&(N=z);var B=C.get(H);s(B),h(),d.current=mt(function(){l.current===B&&N.focus()})}};if([ta,na].includes(y)||M.sibling||!S){var T;!S||e==="inline"?T=o.current:T=KM(S);var R,F=ru(T,g);y===ta?R=F[0]:y===na?R=F[F.length-1]:R=ep(T,g,S,M.offset),k(R)}else if(M.inlineTrigger)u(E);else if(M.offset>0)u(E,!0),h(),d.current=mt(function(){v=ou(w,r);var _=S.getAttribute("aria-controls"),H=document.getElementById(_),N=ep(H,v.elements);k(N)},5);else if(M.offset<0){var V=i(E,!0),$=V[V.length-2],L=b.get($);u($,!1),k(L)}}c==null||c(m)}}function QM(e){Promise.resolve().then(e)}var au="__RC_UTIL_PATH_SPLIT__",tp=function(t){return t.join(au)},JM=function(t){return t.split(au)},iu="rc-menu-more";function e2(){var e=f.useState({}),t=X(e,2),n=t[1],r=D.useRef(new Map),o=D.useRef(new Map),a=f.useState([]),i=X(a,2),s=i[0],u=i[1],c=D.useRef(0),d=D.useRef(!1),l=function(){d.current||n({})},h=D.useCallback(function(b,C){var x=tp(C);o.current.set(x,b),r.current.set(b,x),c.current+=1;var S=c.current;QM(function(){S===c.current&&l()})},[]),m=D.useCallback(function(b,C){var x=tp(C);o.current.delete(x),r.current.delete(b)},[]),y=D.useCallback(function(b){u(b)},[]),w=D.useCallback(function(b,C){var x=r.current.get(b)||"",S=JM(x);return C&&s.includes(S[0])&&S.unshift(iu),S},[s]),v=D.useCallback(function(b,C){return b.filter(function(x){return x!==void 0}).some(function(x){var S=w(x,!0);return S.includes(C)})},[w]),p=function(){var C=wt(r.current.keys());return s.length&&C.push(iu),C},g=D.useCallback(function(b){var C="".concat(r.current.get(b)).concat(au),x=new Set;return wt(o.current.keys()).forEach(function(S){S.startsWith(C)&&x.add(o.current.get(S))}),x},[]);return f.useEffect(function(){return function(){d.current=!0}},[]),{registerPath:h,unregisterPath:m,refreshOverflowKeys:y,isSubPathKey:v,getKeyPath:w,getKeys:p,getSubPathKeys:g}}function ra(e){var t=f.useRef(e);t.current=e;var n=f.useCallback(function(){for(var r,o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];return(r=t.current)===null||r===void 0?void 0:r.call.apply(r,[t].concat(a))},[]);return e?n:void 0}var t2=Math.random().toFixed(5).toString().slice(2),np=0;function n2(e){var t=ln(e,{value:e}),n=X(t,2),r=n[0],o=n[1];return f.useEffect(function(){np+=1;var a="".concat(t2,"-").concat(np);o("rc-menu-uuid-".concat(a))},[]),r}function rp(e,t,n,r){var o=f.useContext(Mn),a=o.activeKey,i=o.onActive,s=o.onInactive,u={active:a===e};return t||(u.onMouseEnter=function(c){n==null||n({key:e,domEvent:c}),i(e)},u.onMouseLeave=function(c){r==null||r({key:e,domEvent:c}),s(e)}),u}function op(e){var t=f.useContext(Mn),n=t.mode,r=t.rtl,o=t.inlineIndent;if(n!=="inline")return null;var a=e;return r?{paddingRight:a*o}:{paddingLeft:a*o}}function ap(e){var t=e.icon,n=e.props,r=e.children,o;return t===null||t===!1?null:(typeof t=="function"?o=f.createElement(t,re({},n)):typeof t!="boolean"&&(o=t),o||r||null)}var r2=["item"];function Vi(e){var t=e.item,n=pt(e,r2);return Object.defineProperty(n,"item",{get:function(){return Er(!1,"`info.item` is deprecated since we will move to function component that not provides React Node instance in future."),t}}),n}var o2=["title","attribute","elementRef"],a2=["style","className","eventKey","warnKey","disabled","itemIcon","children","role","onMouseEnter","onMouseLeave","onClick","onKeyDown","onFocus"],i2=["active"],s2=function(e){$a(n,e);var t=za(n);function n(){return qr(this,n),t.apply(this,arguments)}return Gr(n,[{key:"render",value:function(){var o=this.props,a=o.title,i=o.attribute,s=o.elementRef,u=pt(o,o2),c=po(u,["eventKey","popupClassName","popupOffset","onTitleClick"]);return Er(!i,"`attribute` of Menu.Item is deprecated. Please pass attribute directly."),f.createElement(Tn.Item,_e({},i,{title:typeof a=="string"?a:void 0},c,{ref:s}))}}]),n}(f.Component),l2=f.forwardRef(function(e,t){var n=e.style,r=e.className,o=e.eventKey;e.warnKey;var a=e.disabled,i=e.itemIcon,s=e.children,u=e.role,c=e.onMouseEnter,d=e.onMouseLeave,l=e.onClick,h=e.onKeyDown,m=e.onFocus,y=pt(e,a2),w=qh(o),v=f.useContext(Mn),p=v.prefixCls,g=v.onItemClick,b=v.disabled,C=v.overflowDisabled,x=v.itemIcon,S=v.selectedKeys,E=v.onActive,M=f.useContext(Jl),k=M._internalRenderMenuItem,T="".concat(p,"-item"),R=f.useRef(),F=f.useRef(),V=b||a,$=Na(t,F),L=ea(o),_=function(q){return{key:o,keyPath:wt(L).reverse(),item:R.current,domEvent:q}},H=i||x,N=rp(o,V,c,d),z=N.active,B=pt(N,i2),A=S.includes(o),j=op(L.length),Y=function(q){if(!V){var Z=_(q);l==null||l(Vi(Z)),g(Z)}},U=function(q){if(h==null||h(q),q.which===xn.ENTER){var Z=_(q);l==null||l(Vi(Z)),g(Z)}},ne=function(q){E(o),m==null||m(q)},te={};e.role==="option"&&(te["aria-selected"]=A);var J=f.createElement(s2,_e({ref:R,elementRef:$,role:u===null?"none":u||"menuitem",tabIndex:a?null:-1,"data-menu-id":C&&w?null:w},po(y,["extra"]),B,te,{component:"li","aria-disabled":a,style:re(re({},j),n),className:Xe(T,ce(ce(ce({},"".concat(T,"-active"),z),"".concat(T,"-selected"),A),"".concat(T,"-disabled"),V),r),onClick:Y,onKeyDown:U,onFocus:ne}),s,f.createElement(ap,{props:re(re({},e),{},{isSelected:A}),icon:H}));return k&&(J=k(J,e,{selected:A})),J});function u2(e,t){var n=e.eventKey,r=Fi(),o=ea(n);return f.useEffect(function(){if(r)return r.registerPath(n,o),function(){r.unregisterPath(n,o)}},[o]),r?null:f.createElement(l2,_e({},e,{ref:t}))}const Wi=f.forwardRef(u2);var c2=["className","children"],d2=function(t,n){var r=t.className,o=t.children,a=pt(t,c2),i=f.useContext(Mn),s=i.prefixCls,u=i.mode,c=i.rtl;return f.createElement("ul",_e({className:Xe(s,c&&"".concat(s,"-rtl"),"".concat(s,"-sub"),"".concat(s,"-").concat(u==="inline"?"inline":"vertical"),r),role:"menu"},a,{"data-menu-list":!0,ref:n}),o)},su=f.forwardRef(d2);su.displayName="SubMenuList";function lu(e,t){return Oa(e).map(function(n,r){if(f.isValidElement(n)){var o,a,i=n.key,s=(o=(a=n.props)===null||a===void 0?void 0:a.eventKey)!==null&&o!==void 0?o:i,u=s==null;u&&(s="tmp_key-".concat([].concat(wt(t),[r]).join("-")));var c={key:s,eventKey:s};return f.cloneElement(n,c)}return n})}var Gt={adjustX:1,adjustY:1},f2={topLeft:{points:["bl","tl"],overflow:Gt},topRight:{points:["br","tr"],overflow:Gt},bottomLeft:{points:["tl","bl"],overflow:Gt},bottomRight:{points:["tr","br"],overflow:Gt},leftTop:{points:["tr","tl"],overflow:Gt},leftBottom:{points:["br","bl"],overflow:Gt},rightTop:{points:["tl","tr"],overflow:Gt},rightBottom:{points:["bl","br"],overflow:Gt}},v2={topLeft:{points:["bl","tl"],overflow:Gt},topRight:{points:["br","tr"],overflow:Gt},bottomLeft:{points:["tl","bl"],overflow:Gt},bottomRight:{points:["tr","br"],overflow:Gt},rightTop:{points:["tr","tl"],overflow:Gt},rightBottom:{points:["br","bl"],overflow:Gt},leftTop:{points:["tl","tr"],overflow:Gt},leftBottom:{points:["bl","br"],overflow:Gt}};function ip(e,t,n){if(t)return t;if(n)return n[e]||n.other}var m2={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"};function h2(e){var t=e.prefixCls,n=e.visible,r=e.children,o=e.popup,a=e.popupStyle,i=e.popupClassName,s=e.popupOffset,u=e.disabled,c=e.mode,d=e.onVisibleChange,l=f.useContext(Mn),h=l.getPopupContainer,m=l.rtl,y=l.subMenuOpenDelay,w=l.subMenuCloseDelay,v=l.builtinPlacements,p=l.triggerSubMenuAction,g=l.forceSubMenuRender,b=l.rootClassName,C=l.motion,x=l.defaultMotions,S=f.useState(!1),E=X(S,2),M=E[0],k=E[1],T=re(m?re({},v2):re({},f2),v),R=m2[c],F=ip(c,C,x),V=f.useRef(F);c!=="inline"&&(V.current=F);var $=re(re({},V.current),{},{leavedClassName:"".concat(t,"-hidden"),removeOnLeave:!1,motionAppear:!0}),L=f.useRef();return f.useEffect(function(){return L.current=mt(function(){k(n)}),function(){mt.cancel(L.current)}},[n]),f.createElement(Qs,{prefixCls:t,popupClassName:Xe("".concat(t,"-popup"),ce({},"".concat(t,"-rtl"),m),i,b),stretch:c==="horizontal"?"minWidth":null,getPopupContainer:h,builtinPlacements:T,popupPlacement:R,popupVisible:M,popup:o,popupStyle:a,popupAlign:s&&{offset:s},action:u?[]:[p],mouseEnterDelay:y,mouseLeaveDelay:w,onPopupVisibleChange:d,forceRender:g,popupMotion:$,fresh:!0},r)}function p2(e){var t=e.id,n=e.open,r=e.keyPath,o=e.children,a="inline",i=f.useContext(Mn),s=i.prefixCls,u=i.forceSubMenuRender,c=i.motion,d=i.defaultMotions,l=i.mode,h=f.useRef(!1);h.current=l===a;var m=f.useState(!h.current),y=X(m,2),w=y[0],v=y[1],p=h.current?n:!1;f.useEffect(function(){h.current&&v(!1)},[l]);var g=re({},ip(a,c,d));r.length>1&&(g.motionAppear=!1);var b=g.onVisibleChanged;return g.onVisibleChanged=function(C){return!h.current&&!C&&v(!0),b==null?void 0:b(C)},w?null:f.createElement(Jo,{mode:a,locked:!h.current},f.createElement(ja,_e({visible:p},g,{forceRender:u,removeOnLeave:!1,leavedClassName:"".concat(s,"-hidden")}),function(C){var x=C.className,S=C.style;return f.createElement(su,{id:t,className:x,style:S},o)}))}var g2=["style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","popupStyle","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave"],y2=["active"],b2=f.forwardRef(function(e,t){var n=e.style,r=e.className,o=e.title,a=e.eventKey;e.warnKey;var i=e.disabled,s=e.internalPopupClose,u=e.children,c=e.itemIcon,d=e.expandIcon,l=e.popupClassName,h=e.popupOffset,m=e.popupStyle,y=e.onClick,w=e.onMouseEnter,v=e.onMouseLeave,p=e.onTitleClick,g=e.onTitleMouseEnter,b=e.onTitleMouseLeave,C=pt(e,g2),x=qh(a),S=f.useContext(Mn),E=S.prefixCls,M=S.mode,k=S.openKeys,T=S.disabled,R=S.overflowDisabled,F=S.activeKey,V=S.selectedKeys,$=S.itemIcon,L=S.expandIcon,_=S.onItemClick,H=S.onOpenChange,N=S.onActive,z=f.useContext(Jl),B=z._internalRenderSubMenuItem,A=f.useContext(Xh),j=A.isSubPathKey,Y=ea(),U="".concat(E,"-submenu"),ne=T||i,te=f.useRef(),J=f.useRef(),G=c!=null?c:$,q=d!=null?d:L,Z=k.includes(a),O=!R&&Z,I=j(V,a),W=rp(a,ne,g,b),K=W.active,oe=pt(W,y2),Q=f.useState(!1),ae=X(Q,2),ee=ae[0],ie=ae[1],me=function(Pe){ne||ie(Pe)},ye=function(Pe){me(!0),w==null||w({key:a,domEvent:Pe})},de=function(Pe){me(!1),v==null||v({key:a,domEvent:Pe})},se=f.useMemo(function(){return K||(M!=="inline"?ee||j([F],a):!1)},[M,K,F,ee,a,j]),He=op(Y.length),Le=function(Pe){ne||(p==null||p({key:a,domEvent:Pe}),M==="inline"&&H(a,!Z))},ge=ra(function(fe){y==null||y(Vi(fe)),_(fe)}),Ye=function(Pe){M!=="inline"&&H(a,Pe)},Fe=function(){N(a)},ze=x&&"".concat(x,"-popup"),Ge=f.useMemo(function(){return f.createElement(ap,{icon:M!=="horizontal"?q:void 0,props:re(re({},e),{},{isOpen:O,isSubMenu:!0})},f.createElement("i",{className:"".concat(U,"-arrow")}))},[M,q,e,O,U]),Ke=f.createElement("div",_e({role:"menuitem",style:He,className:"".concat(U,"-title"),tabIndex:ne?null:-1,ref:te,title:typeof o=="string"?o:null,"data-menu-id":R&&x?null:x,"aria-expanded":O,"aria-haspopup":!0,"aria-controls":ze,"aria-disabled":ne,onClick:Le,onFocus:Fe},oe),o,Ge),Ee=f.useRef(M);if(M!=="inline"&&Y.length>1?Ee.current="vertical":Ee.current=M,!R){var $e=Ee.current;Ke=f.createElement(h2,{mode:$e,prefixCls:U,visible:!s&&O&&M!=="inline",popupClassName:l,popupOffset:h,popupStyle:m,popup:f.createElement(Jo,{mode:$e==="horizontal"?"vertical":$e},f.createElement(su,{id:ze,ref:J},u)),disabled:ne,onVisibleChange:Ye},Ke)}var le=f.createElement(Tn.Item,_e({ref:t,role:"none"},C,{component:"li",style:n,className:Xe(U,"".concat(U,"-").concat(M),r,ce(ce(ce(ce({},"".concat(U,"-open"),O),"".concat(U,"-active"),se),"".concat(U,"-selected"),I),"".concat(U,"-disabled"),ne)),onMouseEnter:ye,onMouseLeave:de}),Ke,!R&&f.createElement(p2,{id:ze,open:O,keyPath:Y},u));return B&&(le=B(le,e,{selected:I,active:se,open:O,disabled:ne})),f.createElement(Jo,{onItemClick:ge,mode:M==="horizontal"?"vertical":M,itemIcon:G,expandIcon:q},le)}),Bi=f.forwardRef(function(e,t){var n=e.eventKey,r=e.children,o=ea(n),a=lu(r,o),i=Fi();f.useEffect(function(){if(i)return i.registerPath(n,o),function(){i.unregisterPath(n,o)}},[o]);var s;return i?s=a:s=f.createElement(b2,_e({ref:t},e),a),f.createElement(Kh.Provider,{value:o},s)});function sp(e){var t=e.className,n=e.style,r=f.useContext(Mn),o=r.prefixCls,a=Fi();return a?null:f.createElement("li",{role:"separator",className:Xe("".concat(o,"-item-divider"),t),style:n})}var w2=["className","title","eventKey","children"],C2=f.forwardRef(function(e,t){var n=e.className,r=e.title;e.eventKey;var o=e.children,a=pt(e,w2),i=f.useContext(Mn),s=i.prefixCls,u="".concat(s,"-item-group");return f.createElement("li",_e({ref:t,role:"presentation"},a,{onClick:function(d){return d.stopPropagation()},className:Xe(u,n)}),f.createElement("div",{role:"presentation",className:"".concat(u,"-title"),title:typeof r=="string"?r:void 0},r),f.createElement("ul",{role:"group",className:"".concat(u,"-list")},o))}),uu=f.forwardRef(function(e,t){var n=e.eventKey,r=e.children,o=ea(n),a=lu(r,o),i=Fi();return i?a:f.createElement(C2,_e({ref:t},po(e,["warnKey"])),a)}),x2=["label","children","key","type","extra"];function cu(e,t,n){var r=t.item,o=t.group,a=t.submenu,i=t.divider;return(e||[]).map(function(s,u){if(s&&Ct(s)==="object"){var c=s,d=c.label,l=c.children,h=c.key,m=c.type,y=c.extra,w=pt(c,x2),v=h!=null?h:"tmp-".concat(u);return l||m==="group"?m==="group"?f.createElement(o,_e({key:v},w,{title:d}),cu(l,t,n)):f.createElement(a,_e({key:v},w,{title:d}),cu(l,t,n)):m==="divider"?f.createElement(i,_e({key:v},w)):f.createElement(r,_e({key:v},w,{extra:y}),d,(!!y||y===0)&&f.createElement("span",{className:"".concat(n,"-item-extra")},y))}return null}).filter(function(s){return s})}function lp(e,t,n,r,o){var a=e,i=re({divider:sp,item:Wi,group:uu,submenu:Bi},r);return t&&(a=cu(t,i,o)),lu(a,n)}var S2=["prefixCls","rootClassName","style","className","tabIndex","items","children","direction","id","mode","inlineCollapsed","disabled","disabledOverflow","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","defaultOpenKeys","openKeys","activeKey","defaultActiveFirst","selectable","multiple","defaultSelectedKeys","selectedKeys","onSelect","onDeselect","inlineIndent","motion","defaultMotions","triggerSubMenuAction","builtinPlacements","itemIcon","expandIcon","overflowedIndicator","overflowedIndicatorPopupClassName","getPopupContainer","onClick","onOpenChange","onKeyDown","openAnimation","openTransitionName","_internalRenderMenuItem","_internalRenderSubMenuItem","_internalComponents"],Or=[],E2=f.forwardRef(function(e,t){var n,r=e,o=r.prefixCls,a=o===void 0?"rc-menu":o,i=r.rootClassName,s=r.style,u=r.className,c=r.tabIndex,d=c===void 0?0:c,l=r.items,h=r.children,m=r.direction,y=r.id,w=r.mode,v=w===void 0?"vertical":w,p=r.inlineCollapsed,g=r.disabled,b=r.disabledOverflow,C=r.subMenuOpenDelay,x=C===void 0?.1:C,S=r.subMenuCloseDelay,E=S===void 0?.1:S,M=r.forceSubMenuRender,k=r.defaultOpenKeys,T=r.openKeys,R=r.activeKey,F=r.defaultActiveFirst,V=r.selectable,$=V===void 0?!0:V,L=r.multiple,_=L===void 0?!1:L,H=r.defaultSelectedKeys,N=r.selectedKeys,z=r.onSelect,B=r.onDeselect,A=r.inlineIndent,j=A===void 0?24:A,Y=r.motion,U=r.defaultMotions,ne=r.triggerSubMenuAction,te=ne===void 0?"hover":ne,J=r.builtinPlacements,G=r.itemIcon,q=r.expandIcon,Z=r.overflowedIndicator,O=Z===void 0?"...":Z,I=r.overflowedIndicatorPopupClassName,W=r.getPopupContainer,K=r.onClick,oe=r.onOpenChange,Q=r.onKeyDown;r.openAnimation,r.openTransitionName;var ae=r._internalRenderMenuItem,ee=r._internalRenderSubMenuItem,ie=r._internalComponents,me=pt(r,S2),ye=f.useMemo(function(){return[lp(h,l,Or,ie,a),lp(h,l,Or,{},a)]},[h,l,ie]),de=X(ye,2),se=de[0],He=de[1],Le=f.useState(!1),ge=X(Le,2),Ye=ge[0],Fe=ge[1],ze=f.useRef(),Ge=n2(y),Ke=m==="rtl",Ee=ln(k,{value:T,postState:function(ot){return ot||Or}}),$e=X(Ee,2),le=$e[0],fe=$e[1],Pe=function(ot){var lt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;function Tt(){fe(ot),oe==null||oe(ot)}lt?It.flushSync(Tt):Tt()},ue=f.useState(le),he=X(ue,2),Ue=he[0],Je=he[1],nt=f.useRef(!1),yt=f.useMemo(function(){return(v==="inline"||v==="vertical")&&p?["vertical",p]:[v,!1]},[v,p]),tt=X(yt,2),be=tt[0],We=tt[1],Oe=be==="inline",Ce=f.useState(be),Se=X(Ce,2),pe=Se[0],Ve=Se[1],dt=f.useState(We),ut=X(dt,2),rt=ut[0],Jt=ut[1];f.useEffect(function(){Ve(be),Jt(We),nt.current&&(Oe?fe(Ue):Pe(Or))},[be,We]);var xt=f.useState(0),Vt=X(xt,2),en=Vt[0],dn=Vt[1],Wt=en>=se.length-1||pe!=="horizontal"||b;f.useEffect(function(){Oe&&Je(le)},[le]),f.useEffect(function(){return nt.current=!0,function(){nt.current=!1}},[]);var _t=e2(),Kt=_t.registerPath,Et=_t.unregisterPath,Bt=_t.refreshOverflowKeys,bt=_t.isSubPathKey,sn=_t.getKeyPath,Ot=_t.getKeys,fn=_t.getSubPathKeys,we=f.useMemo(function(){return{registerPath:Kt,unregisterPath:Et}},[Kt,Et]),Me=f.useMemo(function(){return{isSubPathKey:bt}},[bt]);f.useEffect(function(){Bt(Wt?Or:se.slice(en+1).map(function(ft){return ft.key}))},[en,Wt]);var Be=ln(R||F&&((n=se[0])===null||n===void 0?void 0:n.key),{value:R}),qe=X(Be,2),it=qe[0],Ft=qe[1],Rt=ra(function(ft){Ft(ft)}),tn=ra(function(){Ft(void 0)});D.useImperativeHandle(t,function(){return{list:ze.current,focus:function(ot){var lt,Tt=Ot(),Te=ou(Tt,Ge),Re=Te.elements,Mt=Te.key2element,Qt=Te.element2key,Pn=ru(ze.current,Re),Zn=it!=null?it:Pn[0]?Qt.get(Pn[0]):(lt=se.find(function(Ze){return!Ze.props.disabled}))===null||lt===void 0?void 0:lt.key,Dn=Mt.get(Zn);if(Zn&&Dn){var Qn;Dn==null||(Qn=Dn.focus)===null||Qn===void 0||Qn.call(Dn,ot)}}}});var nn=ln(H||[],{value:N,postState:function(ot){return Array.isArray(ot)?ot:ot==null?Or:[ot]}}),Xt=X(nn,2),zt=Xt[0],rn=Xt[1],zn=function(ot){if($){var lt=ot.key,Tt=zt.includes(lt),Te;_?Tt?Te=zt.filter(function(Mt){return Mt!==lt}):Te=[].concat(wt(zt),[lt]):Te=[lt],rn(Te);var Re=re(re({},ot),{},{selectedKeys:Te});Tt?B==null||B(Re):z==null||z(Re)}!_&&le.length&&pe!=="inline"&&Pe(Or)},Hn=ra(function(ft){K==null||K(Vi(ft)),zn(ft)}),jt=ra(function(ft,ot){var lt=le.filter(function(Te){return Te!==ft});if(ot)lt.push(ft);else if(pe!=="inline"){var Tt=fn(ft);lt=lt.filter(function(Te){return!Tt.has(Te)})}jh(le,lt,!0)||Pe(lt,!0)}),Yt=function(ot,lt){var Tt=lt!=null?lt:!le.includes(ot);jt(ot,Tt)},gn=ZM(pe,it,Ke,Ge,ze,Ot,sn,Ft,Yt,Q);f.useEffect(function(){Fe(!0)},[]);var yn=f.useMemo(function(){return{_internalRenderMenuItem:ae,_internalRenderSubMenuItem:ee}},[ae,ee]),Zt=pe!=="horizontal"||b?se:se.map(function(ft,ot){return f.createElement(Jo,{key:ft.key,overflowDisabled:ot>en},ft)}),Xn=f.createElement(Tn,_e({id:y,ref:ze,prefixCls:"".concat(a,"-overflow"),component:"ul",itemComponent:Wi,className:Xe(a,"".concat(a,"-root"),"".concat(a,"-").concat(pe),u,ce(ce({},"".concat(a,"-inline-collapsed"),rt),"".concat(a,"-rtl"),Ke),i),dir:m,style:s,role:"menu",tabIndex:d,data:Zt,renderRawItem:function(ot){return ot},renderRawRest:function(ot){var lt=ot.length,Tt=lt?se.slice(-lt):null;return f.createElement(Bi,{eventKey:iu,title:O,disabled:Wt,internalPopupClose:lt===0,popupClassName:I},Tt)},maxCount:pe!=="horizontal"||b?Tn.INVALIDATE:Tn.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function(ot){dn(ot)},onKeyDown:gn},me));return f.createElement(Jl.Provider,{value:yn},f.createElement(Yh.Provider,{value:Ge},f.createElement(Jo,{prefixCls:a,rootClassName:i,mode:pe,openKeys:le,rtl:Ke,disabled:g,motion:Ye?Y:null,defaultMotions:Ye?U:null,activeKey:it,onActive:Rt,onInactive:tn,selectedKeys:zt,inlineIndent:j,subMenuOpenDelay:x,subMenuCloseDelay:E,forceSubMenuRender:M,builtinPlacements:J,triggerSubMenuAction:te,getPopupContainer:W,itemIcon:G,expandIcon:q,onItemClick:Hn,onOpenChange:jt},f.createElement(Xh.Provider,{value:Me},Xn),f.createElement("div",{style:{display:"none"},"aria-hidden":!0},f.createElement(Gh.Provider,{value:we},He)))))}),oa=E2;oa.Item=Wi,oa.SubMenu=Bi,oa.ItemGroup=uu,oa.Divider=sp;var M2=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),P2="VisuallyHidden",up=f.forwardRef((e,t)=>P.jsx(gt.span,{...e,ref:t,style:{...M2,...e.style}}));up.displayName=P2;var D2=up,[ji,LD]=Wn("Tooltip",[mr]),Yi=mr(),cp="TooltipProvider",k2=700,du="tooltip.open",[N2,fu]=ji(cp),dp=e=>{const{__scopeTooltip:t,delayDuration:n=k2,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:a}=e,i=f.useRef(!0),s=f.useRef(!1),u=f.useRef(0);return f.useEffect(()=>{const c=u.current;return()=>window.clearTimeout(c)},[]),P.jsx(N2,{scope:t,isOpenDelayedRef:i,delayDuration:n,onOpen:f.useCallback(()=>{window.clearTimeout(u.current),i.current=!1},[]),onClose:f.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>i.current=!0,r)},[r]),isPointerInTransitRef:s,onPointerInTransitChange:f.useCallback(c=>{s.current=c},[]),disableHoverableContent:o,children:a})};dp.displayName=cp;var aa="Tooltip",[_2,ia]=ji(aa),fp=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o,onOpenChange:a,disableHoverableContent:i,delayDuration:s}=e,u=fu(aa,e.__scopeTooltip),c=Yi(t),[d,l]=f.useState(null),h=Nn(),m=f.useRef(0),y=i!=null?i:u.disableHoverableContent,w=s!=null?s:u.delayDuration,v=f.useRef(!1),[p,g]=xr({prop:r,defaultProp:o!=null?o:!1,onChange:E=>{E?(u.onOpen(),document.dispatchEvent(new CustomEvent(du))):u.onClose(),a==null||a(E)},caller:aa}),b=f.useMemo(()=>p?v.current?"delayed-open":"instant-open":"closed",[p]),C=f.useCallback(()=>{window.clearTimeout(m.current),m.current=0,v.current=!1,g(!0)},[g]),x=f.useCallback(()=>{window.clearTimeout(m.current),m.current=0,g(!1)},[g]),S=f.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{v.current=!0,g(!0),m.current=0},w)},[w,g]);return f.useEffect(()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)},[]),P.jsx(Bo,{...c,children:P.jsx(_2,{scope:t,contentId:h,open:p,stateAttribute:b,trigger:d,onTriggerChange:l,onTriggerEnter:f.useCallback(()=>{u.isOpenDelayedRef.current?S():C()},[u.isOpenDelayedRef,S,C]),onTriggerLeave:f.useCallback(()=>{y?x():(window.clearTimeout(m.current),m.current=0)},[x,y]),onOpen:C,onClose:x,disableHoverableContent:y,children:n})})};fp.displayName=aa;var vu="TooltipTrigger",vp=f.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=ia(vu,n),a=fu(vu,n),i=Yi(n),s=f.useRef(null),u=Pt(t,s,o.onTriggerChange),c=f.useRef(!1),d=f.useRef(!1),l=f.useCallback(()=>c.current=!1,[]);return f.useEffect(()=>()=>document.removeEventListener("pointerup",l),[l]),P.jsx(jo,{asChild:!0,...i,children:P.jsx(gt.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:u,onPointerMove:Ie(e.onPointerMove,h=>{h.pointerType!=="touch"&&!d.current&&!a.isPointerInTransitRef.current&&(o.onTriggerEnter(),d.current=!0)}),onPointerLeave:Ie(e.onPointerLeave,()=>{o.onTriggerLeave(),d.current=!1}),onPointerDown:Ie(e.onPointerDown,()=>{o.open&&o.onClose(),c.current=!0,document.addEventListener("pointerup",l,{once:!0})}),onFocus:Ie(e.onFocus,()=>{c.current||o.onOpen()}),onBlur:Ie(e.onBlur,o.onClose),onClick:Ie(e.onClick,o.onClose)})})});vp.displayName=vu;var mu="TooltipPortal",[O2,T2]=ji(mu,{forceMount:void 0}),mp=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,a=ia(mu,t);return P.jsx(O2,{scope:t,forceMount:n,children:P.jsx(on,{present:n||a.open,children:P.jsx(Hr,{asChild:!0,container:o,children:r})})})};mp.displayName=mu;var uo="TooltipContent",hp=f.forwardRef((e,t)=>{const n=T2(uo,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...a}=e,i=ia(uo,e.__scopeTooltip);return P.jsx(on,{present:r||i.open,children:i.disableHoverableContent?P.jsx(pp,{side:o,...a,ref:t}):P.jsx(I2,{side:o,...a,ref:t})})}),I2=f.forwardRef((e,t)=>{const n=ia(uo,e.__scopeTooltip),r=fu(uo,e.__scopeTooltip),o=f.useRef(null),a=Pt(t,o),[i,s]=f.useState(null),{trigger:u,onClose:c}=n,d=o.current,{onPointerInTransitChange:l}=r,h=f.useCallback(()=>{s(null),l(!1)},[l]),m=f.useCallback((y,w)=>{const v=y.currentTarget,p={x:y.clientX,y:y.clientY},g=$2(p,v.getBoundingClientRect()),b=F2(p,g),C=z2(w.getBoundingClientRect()),x=V2([...b,...C]);s(x),l(!0)},[l]);return f.useEffect(()=>()=>h(),[h]),f.useEffect(()=>{if(u&&d){const y=v=>m(v,d),w=v=>m(v,u);return u.addEventListener("pointerleave",y),d.addEventListener("pointerleave",w),()=>{u.removeEventListener("pointerleave",y),d.removeEventListener("pointerleave",w)}}},[u,d,m,h]),f.useEffect(()=>{if(i){const y=w=>{const v=w.target,p={x:w.clientX,y:w.clientY},g=(u==null?void 0:u.contains(v))||(d==null?void 0:d.contains(v)),b=!H2(p,i);g?h():b&&(h(),c())};return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[u,d,i,c,h]),P.jsx(pp,{...e,ref:a})}),[R2,A2]=ji(aa,{isInside:!1}),L2=Zg("TooltipContent"),pp=f.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:a,onPointerDownOutside:i,...s}=e,u=ia(uo,n),c=Yi(n),{onClose:d}=u;return f.useEffect(()=>(document.addEventListener(du,d),()=>document.removeEventListener(du,d)),[d]),f.useEffect(()=>{if(u.trigger){const l=h=>{const m=h.target;m!=null&&m.contains(u.trigger)&&d()};return window.addEventListener("scroll",l,{capture:!0}),()=>window.removeEventListener("scroll",l,{capture:!0})}},[u.trigger,d]),P.jsx(zr,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:l=>l.preventDefault(),onDismiss:d,children:P.jsxs(Pi,{"data-state":u.stateAttribute,...c,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[P.jsx(L2,{children:r}),P.jsx(R2,{scope:n,isInside:!0,children:P.jsx(D2,{id:u.contentId,role:"tooltip",children:o||r})})]})})});hp.displayName=uo;var gp="TooltipArrow",yp=f.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Yi(n);return A2(gp,n).isInside?null:P.jsx(Di,{...o,...r,ref:t})});yp.displayName=gp;function $2(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,o,a)){case a:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function F2(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function z2(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function H2(e,t){const{x:n,y:r}=e;let o=!1;for(let a=0,i=t.length-1;a<t.length;i=a++){const s=t[a],u=t[i],c=s.x,d=s.y,l=u.x,h=u.y;d>r!=h>r&&n<(l-c)*(r-d)/(h-d)+c&&(o=!o)}return o}function V2(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),W2(t)}function W2(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const a=t[t.length-1],i=t[t.length-2];if((a.x-i.x)*(o.y-i.y)>=(a.y-i.y)*(o.x-i.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const a=n[n.length-1],i=n[n.length-2];if((a.x-i.x)*(o.y-i.y)>=(a.y-i.y)*(o.x-i.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var B2=dp,j2=fp,Y2=vp,U2=mp,q2=hp,G2=yp;const K2=B2,X2=j2,Z2=Y2,Q2=D.forwardRef(({className:e,sideOffset:t=4,children:n,...r},o)=>P.jsx(U2,{children:P.jsxs(q2,{ref:o,sideOffset:t,className:xe(`
1491
1491
  univer-animate-in univer-fade-in-0 univer-zoom-in-95 univer-z-[1080] univer-box-border univer-w-fit
1492
1492
  univer-text-balance univer-rounded-lg univer-bg-gray-700 univer-px-3 univer-py-2.5 univer-text-xs
1493
1493
  univer-font-medium univer-text-white
@@ -1497,17 +1497,24 @@ html body {
1497
1497
  data-[side=left]:univer-slide-in-from-right-2
1498
1498
  data-[side=right]:univer-slide-in-from-left-2
1499
1499
  data-[side=top]:univer-slide-in-from-bottom-2
1500
- `,e),...r,children:[n,P.jsx(G2,{className:"univer-z-[1080] univer-size-2.5 univer-translate-y-[calc(-50%_-_2px)] univer-rotate-45 univer-rounded-[2px] univer-bg-gray-700 univer-fill-gray-700"})]})}));function hu(e){const{children:t,className:n,asChild:r=!0,title:o,placement:a="bottom",showIfEllipsis:i=!1,visible:s,onVisibleChange:u}=e,[c,f]=D.useState(!1),l=s!==void 0,h=l?s:c,m=D.useRef(null);function y(p){return Math.abs(p.scrollWidth-p.clientWidth)>1}function w(){i&&m.current&&!y(m.current)||(l?u==null||u(!0):f(!0))}function v(){l?u==null||u(!1):f(!1)}return P.jsx(K2,{children:P.jsxs(X2,{open:h,children:[P.jsx(Z2,{ref:m,asChild:r,onMouseEnter:w,onMouseLeave:v,children:t}),P.jsx(Q2,{className:n,side:a,children:o})]})})}const J2=D.forwardRef((e,t)=>{const{mountContainer:n}=D.useContext(mn),{wrapperClass:r,...o}=e;return n&&P.jsx(oa,{ref:t,prefixCls:Se("univer-menu",e.className),getPopupContainer:()=>n,...o,className:r})});function eP(e){return P.jsx(Wi,{...e})}function tP(e){return P.jsx(Bi,{...e})}function nP(e){return P.jsx(uu,{...e})}function rP({items:e}){return P.jsx("div",{className:"univer-menu-item-group univer-flex univer-flex-wrap univer-gap-2.5 univer-p-1 univer-pl-0 univer-pr-0",children:e.map(t=>{const n=P.jsx("div",{className:Se("univer-flex univer-size-6 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded-md hover:univer-bg-gray-50 dark:hover:!univer-bg-gray-900",{"univer-bg-gray-50 dark:!univer-bg-gray-900":t.active},t.className),onClick:()=>t.onClick(),children:P.jsx(t.Icon,{className:"univer-size-4 univer-text-gray-900 dark:!univer-text-gray-200"})},t.key);return t.tooltip?P.jsx(hu,{title:t.tooltip,children:n},t.key):n})})}var bp=(e=>(e.Success="success",e.Info="info",e.Warning="warning",e.Error="error",e.Loading="loading",e))(bp||{});const oP={success:P.jsx(zu,{className:"univer-text-green-500"}),info:P.jsx(Ru,{className:"univer-text-indigo-600 dark:!univer-text-primary-500"}),warning:P.jsx(Hu,{className:"univer-text-yellow-400"}),error:P.jsx(Tu,{className:"univer-text-red-500"}),loading:P.jsx(Au,{className:"univer-animate-spin univer-text-yellow-400"})},aP=({content:e,type:t="info"})=>{const n=D.useMemo(()=>oP[t],[t]);return P.jsx("div",{className:Se(`
1500
+ `,e),...r,children:[n,P.jsx(G2,{className:"univer-z-[1080] univer-size-2.5 univer-translate-y-[calc(-50%_-_2px)] univer-rotate-45 univer-rounded-[2px] univer-bg-gray-700 univer-fill-gray-700"})]})}));function hu(e){const{children:t,className:n,asChild:r=!0,title:o,placement:a="bottom",showIfEllipsis:i=!1,visible:s,onVisibleChange:u}=e,[c,d]=D.useState(!1),l=s!==void 0,h=l?s:c,m=D.useRef(null);function y(p){return Math.abs(p.scrollWidth-p.clientWidth)>1}function w(){i&&m.current&&!y(m.current)||(l?u==null||u(!0):d(!0))}function v(){l?u==null||u(!1):d(!1)}return P.jsx(K2,{children:P.jsxs(X2,{open:h,children:[P.jsx(Z2,{ref:m,asChild:r,onMouseEnter:w,onMouseLeave:v,children:t}),P.jsx(Q2,{className:n,side:a,children:o})]})})}const J2=D.forwardRef((e,t)=>{const{mountContainer:n}=D.useContext(hn),{wrapperClass:r,...o}=e;return n&&P.jsx(oa,{ref:t,prefixCls:xe("univer-menu",e.className),getPopupContainer:()=>n,...o,className:r})});function eP(e){return P.jsx(Wi,{...e})}function tP(e){return P.jsx(Bi,{...e})}function nP(e){return P.jsx(uu,{...e})}function rP({items:e}){return P.jsx("div",{className:"univer-menu-item-group univer-flex univer-flex-wrap univer-gap-2.5 univer-p-1 univer-pl-0 univer-pr-0",children:e.map(t=>{const n=P.jsx("div",{className:xe("univer-flex univer-size-6 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded-md hover:univer-bg-gray-50 dark:hover:!univer-bg-gray-900",{"univer-bg-gray-50 dark:!univer-bg-gray-900":t.active},t.className),onClick:()=>t.onClick(),children:P.jsx(t.Icon,{className:"univer-size-4 univer-text-gray-900 dark:!univer-text-gray-200"})},t.key);return t.tooltip?P.jsx(hu,{title:t.tooltip,children:n},t.key):n})})}var bp=(e=>(e.Success="success",e.Info="info",e.Warning="warning",e.Error="error",e.Loading="loading",e))(bp||{});const oP={success:P.jsx(zu,{className:"univer-text-green-500"}),info:P.jsx(Ru,{className:"univer-text-indigo-600 dark:!univer-text-primary-500"}),warning:P.jsx(Hu,{className:"univer-text-yellow-400"}),error:P.jsx(Tu,{className:"univer-text-red-500"}),loading:P.jsx(Au,{className:"univer-animate-spin univer-text-yellow-400"})},aP=({content:e,type:t="info"})=>{const n=D.useMemo(()=>oP[t],[t]);return P.jsx("div",{className:xe(`
1501
1501
  univer-animate-in univer-fade-in univer-slide-in-from-top-4 univer-min-w-[320px] univer-max-w-[480px]
1502
1502
  univer-rounded-xl univer-border univer-border-solid univer-border-gray-200 univer-bg-white univer-p-4
1503
1503
  univer-font-sans univer-shadow-md univer-transition-all univer-duration-300
1504
1504
  dark:!univer-border-gray-600 dark:!univer-bg-gray-700
1505
- `),children:P.jsxs("div",{className:"univer-flex univer-gap-2",children:[P.jsx("span",{className:"[&>svg]:univer-relative [&>svg]:univer-top-0.5 [&>svg]:univer-block",children:n}),P.jsx("p",{className:"univer-m-0 univer-text-sm univer-text-gray-500 univer-opacity-90 dark:!univer-text-gray-400",children:e})]})})};let iP=0;const sP=(()=>{let e=()=>{},t=()=>{};return{Messager:()=>{if(!va())return null;const[r,o]=D.useState({messages:[]});return t=a=>{a||o({messages:[]}),o(i=>({messages:i.messages.filter(s=>s.id!==a)}))},D.useEffect(()=>{const a=[];return e=i=>{const s=String(iP++);if(o(u=>({messages:[...u.messages,{...i,id:s}]})),i.duration!==1/0){const u=window.setTimeout(()=>{o(c=>({messages:c.messages.filter(f=>f.id!==s)}))},i.duration||3e3);a.push(u)}},()=>{a.forEach(i=>{window.clearTimeout(i)})}},[]),It.createPortal(P.jsx("div",{className:"univer-fixed univer-left-1/2 univer-top-4 univer-z-50 univer-flex -univer-translate-x-1/2 univer-flex-col univer-items-center univer-gap-1",children:r.messages.map((a,i)=>P.jsx("div",{style:{position:"relative",top:`${i*4}px`,zIndex:50-i},children:P.jsx(aP,{...a,onClose:()=>t(a.id)})},a.id))}),document.body)},message:r=>e(r),removeMessage:t}})(),{Messager:lP,message:uP,removeMessage:cP}=sP;function wp(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,La(e,t)}function dP(e,t){return e.classList?!!t&&e.classList.contains(t):(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")!==-1}function fP(e,t){e.classList?e.classList.add(t):dP(e,t)||(typeof e.className=="string"?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))}function Cp(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function vP(e,t){e.classList?e.classList.remove(t):typeof e.className=="string"?e.className=Cp(e.className,t):e.setAttribute("class",Cp(e.className&&e.className.baseVal||"",t))}const xp={disabled:!1},Sp=D.createContext(null);var Ep=function(t){return t.scrollTop},sa="unmounted",Tr="exited",Ir="entering",co="entered",pu="exiting",Kn=function(e){wp(t,e);function t(r,o){var a;a=e.call(this,r,o)||this;var i=o,s=i&&!i.isMounting?r.enter:r.appear,u;return a.appearStatus=null,r.in?s?(u=Tr,a.appearStatus=Ir):u=co:r.unmountOnExit||r.mountOnEnter?u=sa:u=Tr,a.state={status:u},a.nextCallback=null,a}t.getDerivedStateFromProps=function(o,a){var i=o.in;return i&&a.status===sa?{status:Tr}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(o){var a=null;if(o!==this.props){var i=this.state.status;this.props.in?i!==Ir&&i!==co&&(a=Ir):(i===Ir||i===co)&&(a=pu)}this.updateStatus(!1,a)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var o=this.props.timeout,a,i,s;return a=i=s=o,o!=null&&typeof o!="number"&&(a=o.exit,i=o.enter,s=o.appear!==void 0?o.appear:i),{exit:a,enter:i,appear:s}},n.updateStatus=function(o,a){if(o===void 0&&(o=!1),a!==null)if(this.cancelNextCallback(),a===Ir){if(this.props.unmountOnExit||this.props.mountOnEnter){var i=this.props.nodeRef?this.props.nodeRef.current:It.findDOMNode(this);i&&Ep(i)}this.performEnter(o)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Tr&&this.setState({status:sa})},n.performEnter=function(o){var a=this,i=this.props.enter,s=this.context?this.context.isMounting:o,u=this.props.nodeRef?[s]:[It.findDOMNode(this),s],c=u[0],f=u[1],l=this.getTimeouts(),h=s?l.appear:l.enter;if(!o&&!i||xp.disabled){this.safeSetState({status:co},function(){a.props.onEntered(c)});return}this.props.onEnter(c,f),this.safeSetState({status:Ir},function(){a.props.onEntering(c,f),a.onTransitionEnd(h,function(){a.safeSetState({status:co},function(){a.props.onEntered(c,f)})})})},n.performExit=function(){var o=this,a=this.props.exit,i=this.getTimeouts(),s=this.props.nodeRef?void 0:It.findDOMNode(this);if(!a||xp.disabled){this.safeSetState({status:Tr},function(){o.props.onExited(s)});return}this.props.onExit(s),this.safeSetState({status:pu},function(){o.props.onExiting(s),o.onTransitionEnd(i.exit,function(){o.safeSetState({status:Tr},function(){o.props.onExited(s)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(o,a){a=this.setNextCallback(a),this.setState(o,a)},n.setNextCallback=function(o){var a=this,i=!0;return this.nextCallback=function(s){i&&(i=!1,a.nextCallback=null,o(s))},this.nextCallback.cancel=function(){i=!1},this.nextCallback},n.onTransitionEnd=function(o,a){this.setNextCallback(a);var i=this.props.nodeRef?this.props.nodeRef.current:It.findDOMNode(this),s=o==null&&!this.props.addEndListener;if(!i||s){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var u=this.props.nodeRef?[this.nextCallback]:[i,this.nextCallback],c=u[0],f=u[1];this.props.addEndListener(c,f)}o!=null&&setTimeout(this.nextCallback,o)},n.render=function(){var o=this.state.status;if(o===sa)return null;var a=this.props,i=a.children;a.in,a.mountOnEnter,a.unmountOnExit,a.appear,a.enter,a.exit,a.timeout,a.addEndListener,a.onEnter,a.onEntering,a.onEntered,a.onExit,a.onExiting,a.onExited,a.nodeRef;var s=Rs(a,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return D.createElement(Sp.Provider,{value:null},typeof i=="function"?i(o,s):D.cloneElement(D.Children.only(i),s))},t}(D.Component);Kn.contextType=Sp,Kn.propTypes={};function fo(){}Kn.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:fo,onEntering:fo,onEntered:fo,onExit:fo,onExiting:fo,onExited:fo},Kn.UNMOUNTED=sa,Kn.EXITED=Tr,Kn.ENTERING=Ir,Kn.ENTERED=co,Kn.EXITING=pu;var mP=function(t,n){return t&&n&&n.split(" ").forEach(function(r){return fP(t,r)})},gu=function(t,n){return t&&n&&n.split(" ").forEach(function(r){return vP(t,r)})},yu=function(e){wp(t,e);function t(){for(var r,o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];return r=e.call.apply(e,[this].concat(a))||this,r.appliedClasses={appear:{},enter:{},exit:{}},r.onEnter=function(s,u){var c=r.resolveArguments(s,u),f=c[0],l=c[1];r.removeClasses(f,"exit"),r.addClass(f,l?"appear":"enter","base"),r.props.onEnter&&r.props.onEnter(s,u)},r.onEntering=function(s,u){var c=r.resolveArguments(s,u),f=c[0],l=c[1],h=l?"appear":"enter";r.addClass(f,h,"active"),r.props.onEntering&&r.props.onEntering(s,u)},r.onEntered=function(s,u){var c=r.resolveArguments(s,u),f=c[0],l=c[1],h=l?"appear":"enter";r.removeClasses(f,h),r.addClass(f,h,"done"),r.props.onEntered&&r.props.onEntered(s,u)},r.onExit=function(s){var u=r.resolveArguments(s),c=u[0];r.removeClasses(c,"appear"),r.removeClasses(c,"enter"),r.addClass(c,"exit","base"),r.props.onExit&&r.props.onExit(s)},r.onExiting=function(s){var u=r.resolveArguments(s),c=u[0];r.addClass(c,"exit","active"),r.props.onExiting&&r.props.onExiting(s)},r.onExited=function(s){var u=r.resolveArguments(s),c=u[0];r.removeClasses(c,"exit"),r.addClass(c,"exit","done"),r.props.onExited&&r.props.onExited(s)},r.resolveArguments=function(s,u){return r.props.nodeRef?[r.props.nodeRef.current,s]:[s,u]},r.getClassNames=function(s){var u=r.props.classNames,c=typeof u=="string",f=c&&u?u+"-":"",l=c?""+f+s:u[s],h=c?l+"-active":u[s+"Active"],m=c?l+"-done":u[s+"Done"];return{baseClassName:l,activeClassName:h,doneClassName:m}},r}var n=t.prototype;return n.addClass=function(o,a,i){var s=this.getClassNames(a)[i+"ClassName"],u=this.getClassNames("enter"),c=u.doneClassName;a==="appear"&&i==="done"&&c&&(s+=" "+c),i==="active"&&o&&Ep(o),s&&(this.appliedClasses[a][i]=s,mP(o,s))},n.removeClasses=function(o,a){var i=this.appliedClasses[a],s=i.base,u=i.active,c=i.done;this.appliedClasses[a]={},s&&gu(o,s),u&&gu(o,u),c&&gu(o,c)},n.render=function(){var o=this.props;o.classNames;var a=Rs(o,["classNames"]);return D.createElement(Kn,Ne({},a,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t}(D.Component);yu.defaultProps={classNames:""},yu.propTypes={};function hP(e){const{children:t,visible:n=!1,offset:r=[0,0]}=e,o=D.useRef(null),[a,i]=D.useState(r),{mountContainer:s}=D.useContext(mn);D.useEffect(()=>{if(!n){i([-9999,-9999]);return}const[c,f]=r,{clientWidth:l,clientHeight:h}=o.current,{innerWidth:m,innerHeight:y}=window,w=c+l>m?m-l:c,v=f+h>y?y-h:f;i([w,v])},[r,n]);function u(c){c.preventDefault()}return It.createPortal(P.jsx(yu,{in:n,nodeRef:o,timeout:500,classNames:{enter:"univer-popup-enter",enterActive:"univer-popup-enter-active",enterDone:"univer-popup-enter-done",exitActive:"univer-popup-exit",exitDone:"univer-popup-exit-active"},children:P.jsx("section",{ref:o,className:"univer-popup",style:{left:a[0]+2,top:a[1]+2},onContextMenu:u,children:t})}),s)}function pP(e){const{children:t,className:n,style:r,value:o,disabled:a=!1,direction:i="horizontal",onChange:s}=e,u=c=>{s(c)};return P.jsx("div",{className:Se("univer-flex univer-gap-2",{"univer-flex-col":i==="vertical"},n),style:r,children:D.Children.map(t,(c,f)=>D.isValidElement(c)?D.cloneElement(c,{key:f,children:c.props.children,value:c.props.value,checked:o===c.props.value,disabled:a!=null?a:c.props.disabled,onChange:u}):c)})}function gP(e){const{children:t,checked:n,value:r,disabled:o=!1,onChange:a}=e,i=D.useRef(null);function s(u){var c;if(u.stopPropagation(),!(!a||o))if(typeof r<"u")a&&a(r);else{const f=(c=i==null?void 0:i.current)==null?void 0:c.checked;a&&a(f)}}return P.jsxs("label",{"data-u-comp":"radio",className:Se("univer-box-border univer-inline-flex univer-items-center univer-gap-2 univer-text-sm",{"univer-cursor-pointer univer-text-gray-900 dark:!univer-text-white":!o,"univer-text-gray-400":o}),children:[P.jsxs("span",{className:"univer-relative univer-block",children:[P.jsx("input",{ref:i,className:"univer-absolute univer-size-0 univer-opacity-0",type:"radio",checked:n,disabled:o,onChange:s}),P.jsx("span",{className:Se("univer-relative univer-box-border univer-flex univer-size-4 univer-items-center univer-justify-center univer-overflow-hidden univer-rounded-full univer-border univer-border-solid univer-transition-colors",{"univer-opacity-50":o,"univer-border-primary-600 univer-bg-primary-600 dark:!univer-bg-primary-600":n,"univer-border-gray-300 univer-bg-gray-50 dark:!univer-border-gray-500 dark:!univer-bg-gray-600":!n}),children:n&&P.jsx("span",{className:"univer-absolute univer-left-1/2 univer-top-1/2 univer-block univer-size-2 -univer-translate-x-1/2 -univer-translate-y-1/2 univer-rounded-full univer-bg-white"})})]}),P.jsx("span",{children:t})]})}function yP({items:e,value:t,defaultValue:n,onChange:r,className:o=""}){const[a,i]=D.useState(t!==void 0?t:n||e[0].value),[s,u]=D.useState({}),c=D.useRef(new Map),f=D.useRef(null);D.useEffect(()=>{t!==void 0&&t!==a&&i(t)},[t]);const l=(m,y)=>{const w=c.current.get(m),v=y?c.current.get(y):null;if(w&&f.current){const p=f.current.getBoundingClientRect(),g=w.getBoundingClientRect(),b=g.left-p.left-4;if(v){const x=v.getBoundingClientRect().left-p.left-4;u({"--slide-from":`${x}px`,"--slide-to":`${b}px`,width:`${g.width}px`,transform:`translateX(${b}px)`})}else u({width:`${g.width}px`,transform:`translateX(${b}px)`})}};D.useEffect(()=>{l(a)},[a]);const h=m=>{const y=a;i(m),r==null||r(m),l(m,y)};return P.jsxs("div",{"data-u-comp":"segmented",ref:f,className:Se("univer-relative univer-box-border univer-flex univer-gap-4 univer-rounded-lg univer-bg-gray-100 univer-p-1 dark:!univer-bg-gray-800",o),children:[P.jsx("div",{className:"univer-animate-univer-slide univer-absolute univer-h-6 univer-rounded-md univer-bg-white univer-shadow-sm univer-transition-all univer-duration-200 dark:!univer-bg-gray-700 dark:!univer-text-gray-400",style:s}),e.map(m=>P.jsx("button",{ref:y=>{y&&c.current.set(m.value,y)},className:Se("univer-relative univer-box-border univer-flex-1 univer-cursor-pointer univer-border-none univer-bg-transparent univer-px-3 univer-py-1 univer-text-xs univer-font-medium univer-transition-colors",{"univer-text-gray-900 dark:!univer-text-white":a===m.value,"univer-text-gray-500 hover:univer-text-gray-900 dark:hover:!univer-text-white":a!==m.value}),type:"button",onClick:()=>h(m.value),children:m.label},String(m.value)))]})}function bP(e){const{value:t,options:n=[],hideCheckMark:r=!1,onChange:o,multiple:a,className:i,optionClassName:s}=e,u=Array.isArray(t)?t:[t];function c(f){const l=u.indexOf(f);a?l>-1?o(u.filter(h=>h===f)):o([...u,f]):l>-1?o(void 0):o(f)}return P.jsx("ul",{className:Se("univer-m-0 univer-grid univer-max-h-80 univer-list-none univer-gap-1 univer-overflow-y-auto univer-rounded univer-p-1.5",yn,Cr,i),children:n.map((f,l)=>{const h=u.indexOf(f.value)>-1;return P.jsx("li",{children:P.jsxs("a",{className:Se("univer-relative univer-block univer-cursor-pointer univer-select-none univer-rounded univer-py-1.5 univer-pl-8 univer-pr-2 univer-text-sm univer-text-gray-900 univer-transition-colors hover:univer-bg-gray-100 dark:!univer-text-white dark:hover:!univer-bg-gray-600",s,{"univer-bg-gray-200 dark:!univer-bg-gray-500":h}),onClick:()=>c(f.value),children:[!r&&h&&P.jsx(Rr,{className:"univer-absolute univer-left-0 univer-top-1/2 -univer-translate-y-1/2 univer-pl-2 univer-text-primary-600"}),P.jsx("span",{style:{color:f.color},children:f.label})]})},l)})})}const Mp=Se("univer-box-border univer-inline-flex univer-h-8 univer-min-w-36 univer-items-center univer-justify-between univer-gap-2 univer-rounded-lg univer-bg-white univer-px-2.5 univer-transition-colors univer-duration-200 dark:!univer-bg-gray-700 dark:!univer-text-white",yn);function wP(e){const{className:t,value:n,disabled:r=!1,options:o=[],borderless:a=!1,onChange:i}=e,[s,u]=D.useState(!1);function c(h){u(h)}const f=D.useMemo(()=>{const h=[];for(const m of o)m.options?(m.options.forEach(y=>{h.push({label:y.label,value:y.value,disabled:y.disabled})}),h.push({type:"separator"})):h.push({label:m.label,value:m.value,disabled:m.disabled});return[{type:"radio",value:n,hideIndicator:!0,options:h,onSelect:m=>{i(m)}}]},[o]),l=D.useMemo(()=>{let h=null;for(const m of o)if(m.options){for(const y of m.options)if(y.value===n){h=y.label;break}}else if(m.value===n){h=m.label;break}return h||n},[o,n]);return P.jsx(Kl,{className:"max-h univer-w-[var(--radix-popper-anchor-width)] univer-min-w-36",align:"start",open:s,items:f,disabled:r,onOpenChange:c,children:P.jsxs("div",{"data-u-comp":"select",className:Se(Mp,{"univer-border-primary-600 univer-outline-none univer-ring-2 univer-ring-primary-50 dark:!univer-ring-primary-900":s&&!a,"univer-border-transparent univer-bg-transparent hover:univer-border-transparent":a,"univer-cursor-not-allowed":r,"hover:univer-border-primary-600":!r&&!a,"univer-cursor-pointer":!r&&!s},t),children:[P.jsx("div",{className:"univer-flex-1 univer-truncate univer-text-sm univer-text-gray-500 dark:!univer-text-white",children:l}),P.jsx(es,{className:"univer-flex-shrink-0 dark:!univer-text-white"})]})})}function CP(e){const{className:t,value:n=[],disabled:r=!1,options:o=[],borderless:a=!1,onChange:i}=e,[s,u]=D.useState(!1);function c(m){u(m)}const f=D.useMemo(()=>o.map(m=>({type:"checkbox",value:m.value,label:m.label,disabled:m.disabled,checked:n.includes(m.value),onSelect:y=>{const w=n.includes(y)?n.filter(v=>v!==y):[...n,y];i(w)}})),[o]);function l(m){const y=n.filter(w=>w!==m);i(y)}const h=D.useMemo(()=>o.filter(m=>n.includes(m.value)).map((m,y)=>P.jsx(sc,{className:"univer-max-w-32",closable:!0,onClose:()=>l(m.value),children:m.label},y)),[o,n]);return P.jsx(Kl,{className:"univer-w-[var(--radix-popper-anchor-width)] univer-min-w-36",align:"start",open:s,items:f,disabled:r,onOpenChange:c,children:P.jsxs("div",{"data-u-comp":"multiple-select",className:Se(Mp,{"univer-border-primary-600 univer-outline-none univer-ring-2 univer-ring-primary-50 dark:!univer-ring-primary-900":s&&!a,"univer-border-transparent univer-bg-transparent hover:univer-border-transparent":a,"univer-cursor-not-allowed":r,"hover:univer-border-primary-600":!r&&!a,"univer-cursor-pointer":!r&&!s},t),children:[P.jsx("div",{className:"univer-box-border univer-flex univer-w-[calc(100%-16px)] univer-gap-2 univer-pr-2",children:h}),P.jsx(es,{className:"univer-flex-shrink-0 dark:!univer-text-white"})]})})}var xP="Separator",Pp="horizontal",SP=["horizontal","vertical"],Dp=d.forwardRef((e,t)=>{const{decorative:n,orientation:r=Pp,...o}=e,a=EP(r)?r:Pp,s=n?{role:"none"}:{"aria-orientation":a==="vertical"?a:void 0,role:"separator"};return P.jsx(gt.div,{"data-orientation":a,...s,...o,ref:t})});Dp.displayName=xP;function EP(e){return SP.includes(e)}var MP=Dp;function PP({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return P.jsx(MP,{"data-slot":"separator-root",decorative:n,orientation:t,className:Se(`
1505
+ `),children:P.jsxs("div",{className:"univer-flex univer-gap-2",children:[P.jsx("span",{className:"[&>svg]:univer-relative [&>svg]:univer-top-0.5 [&>svg]:univer-block",children:n}),P.jsx("p",{className:"univer-m-0 univer-text-sm univer-text-gray-500 univer-opacity-90 dark:!univer-text-gray-400",children:e})]})})};let iP=0;const sP=(()=>{let e=()=>{},t=()=>{};return{Messager:()=>{if(!va())return null;const[r,o]=D.useState({messages:[]});return t=a=>{a||o({messages:[]}),o(i=>({messages:i.messages.filter(s=>s.id!==a)}))},D.useEffect(()=>{const a=[];return e=i=>{const s=String(iP++);if(o(u=>({messages:[...u.messages,{...i,id:s}]})),i.duration!==1/0){const u=window.setTimeout(()=>{o(c=>({messages:c.messages.filter(d=>d.id!==s)}))},i.duration||3e3);a.push(u)}},()=>{a.forEach(i=>{window.clearTimeout(i)})}},[]),It.createPortal(P.jsx("div",{className:"univer-fixed univer-left-1/2 univer-top-4 univer-z-50 univer-flex -univer-translate-x-1/2 univer-flex-col univer-items-center univer-gap-1",children:r.messages.map((a,i)=>P.jsx("div",{style:{position:"relative",top:`${i*4}px`,zIndex:50-i},children:P.jsx(aP,{...a,onClose:()=>t(a.id)})},a.id))}),document.body)},message:r=>e(r),removeMessage:t}})(),{Messager:lP,message:uP,removeMessage:cP}=sP;function wp(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,La(e,t)}function dP(e,t){return e.classList?!!t&&e.classList.contains(t):(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")!==-1}function fP(e,t){e.classList?e.classList.add(t):dP(e,t)||(typeof e.className=="string"?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))}function Cp(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function vP(e,t){e.classList?e.classList.remove(t):typeof e.className=="string"?e.className=Cp(e.className,t):e.setAttribute("class",Cp(e.className&&e.className.baseVal||"",t))}const xp={disabled:!1},Sp=D.createContext(null);var Ep=function(t){return t.scrollTop},sa="unmounted",Tr="exited",Ir="entering",co="entered",pu="exiting",Kn=function(e){wp(t,e);function t(r,o){var a;a=e.call(this,r,o)||this;var i=o,s=i&&!i.isMounting?r.enter:r.appear,u;return a.appearStatus=null,r.in?s?(u=Tr,a.appearStatus=Ir):u=co:r.unmountOnExit||r.mountOnEnter?u=sa:u=Tr,a.state={status:u},a.nextCallback=null,a}t.getDerivedStateFromProps=function(o,a){var i=o.in;return i&&a.status===sa?{status:Tr}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(o){var a=null;if(o!==this.props){var i=this.state.status;this.props.in?i!==Ir&&i!==co&&(a=Ir):(i===Ir||i===co)&&(a=pu)}this.updateStatus(!1,a)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var o=this.props.timeout,a,i,s;return a=i=s=o,o!=null&&typeof o!="number"&&(a=o.exit,i=o.enter,s=o.appear!==void 0?o.appear:i),{exit:a,enter:i,appear:s}},n.updateStatus=function(o,a){if(o===void 0&&(o=!1),a!==null)if(this.cancelNextCallback(),a===Ir){if(this.props.unmountOnExit||this.props.mountOnEnter){var i=this.props.nodeRef?this.props.nodeRef.current:It.findDOMNode(this);i&&Ep(i)}this.performEnter(o)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Tr&&this.setState({status:sa})},n.performEnter=function(o){var a=this,i=this.props.enter,s=this.context?this.context.isMounting:o,u=this.props.nodeRef?[s]:[It.findDOMNode(this),s],c=u[0],d=u[1],l=this.getTimeouts(),h=s?l.appear:l.enter;if(!o&&!i||xp.disabled){this.safeSetState({status:co},function(){a.props.onEntered(c)});return}this.props.onEnter(c,d),this.safeSetState({status:Ir},function(){a.props.onEntering(c,d),a.onTransitionEnd(h,function(){a.safeSetState({status:co},function(){a.props.onEntered(c,d)})})})},n.performExit=function(){var o=this,a=this.props.exit,i=this.getTimeouts(),s=this.props.nodeRef?void 0:It.findDOMNode(this);if(!a||xp.disabled){this.safeSetState({status:Tr},function(){o.props.onExited(s)});return}this.props.onExit(s),this.safeSetState({status:pu},function(){o.props.onExiting(s),o.onTransitionEnd(i.exit,function(){o.safeSetState({status:Tr},function(){o.props.onExited(s)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(o,a){a=this.setNextCallback(a),this.setState(o,a)},n.setNextCallback=function(o){var a=this,i=!0;return this.nextCallback=function(s){i&&(i=!1,a.nextCallback=null,o(s))},this.nextCallback.cancel=function(){i=!1},this.nextCallback},n.onTransitionEnd=function(o,a){this.setNextCallback(a);var i=this.props.nodeRef?this.props.nodeRef.current:It.findDOMNode(this),s=o==null&&!this.props.addEndListener;if(!i||s){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var u=this.props.nodeRef?[this.nextCallback]:[i,this.nextCallback],c=u[0],d=u[1];this.props.addEndListener(c,d)}o!=null&&setTimeout(this.nextCallback,o)},n.render=function(){var o=this.state.status;if(o===sa)return null;var a=this.props,i=a.children;a.in,a.mountOnEnter,a.unmountOnExit,a.appear,a.enter,a.exit,a.timeout,a.addEndListener,a.onEnter,a.onEntering,a.onEntered,a.onExit,a.onExiting,a.onExited,a.nodeRef;var s=Rs(a,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return D.createElement(Sp.Provider,{value:null},typeof i=="function"?i(o,s):D.cloneElement(D.Children.only(i),s))},t}(D.Component);Kn.contextType=Sp,Kn.propTypes={};function fo(){}Kn.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:fo,onEntering:fo,onEntered:fo,onExit:fo,onExiting:fo,onExited:fo},Kn.UNMOUNTED=sa,Kn.EXITED=Tr,Kn.ENTERING=Ir,Kn.ENTERED=co,Kn.EXITING=pu;var mP=function(t,n){return t&&n&&n.split(" ").forEach(function(r){return fP(t,r)})},gu=function(t,n){return t&&n&&n.split(" ").forEach(function(r){return vP(t,r)})},yu=function(e){wp(t,e);function t(){for(var r,o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];return r=e.call.apply(e,[this].concat(a))||this,r.appliedClasses={appear:{},enter:{},exit:{}},r.onEnter=function(s,u){var c=r.resolveArguments(s,u),d=c[0],l=c[1];r.removeClasses(d,"exit"),r.addClass(d,l?"appear":"enter","base"),r.props.onEnter&&r.props.onEnter(s,u)},r.onEntering=function(s,u){var c=r.resolveArguments(s,u),d=c[0],l=c[1],h=l?"appear":"enter";r.addClass(d,h,"active"),r.props.onEntering&&r.props.onEntering(s,u)},r.onEntered=function(s,u){var c=r.resolveArguments(s,u),d=c[0],l=c[1],h=l?"appear":"enter";r.removeClasses(d,h),r.addClass(d,h,"done"),r.props.onEntered&&r.props.onEntered(s,u)},r.onExit=function(s){var u=r.resolveArguments(s),c=u[0];r.removeClasses(c,"appear"),r.removeClasses(c,"enter"),r.addClass(c,"exit","base"),r.props.onExit&&r.props.onExit(s)},r.onExiting=function(s){var u=r.resolveArguments(s),c=u[0];r.addClass(c,"exit","active"),r.props.onExiting&&r.props.onExiting(s)},r.onExited=function(s){var u=r.resolveArguments(s),c=u[0];r.removeClasses(c,"exit"),r.addClass(c,"exit","done"),r.props.onExited&&r.props.onExited(s)},r.resolveArguments=function(s,u){return r.props.nodeRef?[r.props.nodeRef.current,s]:[s,u]},r.getClassNames=function(s){var u=r.props.classNames,c=typeof u=="string",d=c&&u?u+"-":"",l=c?""+d+s:u[s],h=c?l+"-active":u[s+"Active"],m=c?l+"-done":u[s+"Done"];return{baseClassName:l,activeClassName:h,doneClassName:m}},r}var n=t.prototype;return n.addClass=function(o,a,i){var s=this.getClassNames(a)[i+"ClassName"],u=this.getClassNames("enter"),c=u.doneClassName;a==="appear"&&i==="done"&&c&&(s+=" "+c),i==="active"&&o&&Ep(o),s&&(this.appliedClasses[a][i]=s,mP(o,s))},n.removeClasses=function(o,a){var i=this.appliedClasses[a],s=i.base,u=i.active,c=i.done;this.appliedClasses[a]={},s&&gu(o,s),u&&gu(o,u),c&&gu(o,c)},n.render=function(){var o=this.props;o.classNames;var a=Rs(o,["classNames"]);return D.createElement(Kn,_e({},a,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t}(D.Component);yu.defaultProps={classNames:""},yu.propTypes={};function hP(e){const{children:t,visible:n=!1,offset:r=[0,0]}=e,o=D.useRef(null),[a,i]=D.useState(r),{mountContainer:s}=D.useContext(hn);D.useEffect(()=>{if(!n){i([-9999,-9999]);return}const[c,d]=r,{clientWidth:l,clientHeight:h}=o.current,{innerWidth:m,innerHeight:y}=window,w=c+l>m?m-l:c,v=d+h>y?y-h:d;i([w,v])},[r,n]);function u(c){c.preventDefault()}return It.createPortal(P.jsx(yu,{in:n,nodeRef:o,timeout:500,classNames:{enter:"univer-popup-enter",enterActive:"univer-popup-enter-active",enterDone:"univer-popup-enter-done",exitActive:"univer-popup-exit",exitDone:"univer-popup-exit-active"},children:P.jsx("section",{ref:o,className:"univer-popup",style:{left:a[0]+2,top:a[1]+2},onContextMenu:u,children:t})}),s)}function pP(e){const{children:t,className:n,style:r,value:o,disabled:a=!1,direction:i="horizontal",onChange:s}=e,u=c=>{s(c)};return P.jsx("div",{className:xe("univer-flex univer-gap-2",{"univer-flex-col":i==="vertical"},n),style:r,children:D.Children.map(t,(c,d)=>D.isValidElement(c)?D.cloneElement(c,{key:d,children:c.props.children,value:c.props.value,checked:o===c.props.value,disabled:a!=null?a:c.props.disabled,onChange:u}):c)})}function gP(e){const{children:t,checked:n,value:r,disabled:o=!1,onChange:a}=e,i=D.useRef(null);function s(u){var c;if(u.stopPropagation(),!(!a||o))if(typeof r<"u")a&&a(r);else{const d=(c=i==null?void 0:i.current)==null?void 0:c.checked;a&&a(d)}}return P.jsxs("label",{"data-u-comp":"radio",className:xe("univer-box-border univer-inline-flex univer-items-center univer-gap-2 univer-text-sm",{"univer-cursor-pointer univer-text-gray-900 dark:!univer-text-white":!o,"univer-text-gray-400":o}),children:[P.jsxs("span",{className:"univer-relative univer-block",children:[P.jsx("input",{ref:i,className:"univer-absolute univer-size-0 univer-opacity-0",type:"radio",checked:n,disabled:o,onChange:s}),P.jsx("span",{className:xe("univer-relative univer-box-border univer-flex univer-size-4 univer-items-center univer-justify-center univer-overflow-hidden univer-rounded-full univer-border univer-border-solid univer-transition-colors",{"univer-opacity-50":o,"univer-border-primary-600 univer-bg-primary-600 dark:!univer-bg-primary-600":n,"univer-border-gray-300 univer-bg-gray-50 dark:!univer-border-gray-500 dark:!univer-bg-gray-600":!n}),children:n&&P.jsx("span",{className:"univer-absolute univer-left-1/2 univer-top-1/2 univer-block univer-size-2 -univer-translate-x-1/2 -univer-translate-y-1/2 univer-rounded-full univer-bg-white"})})]}),P.jsx("span",{children:t})]})}function yP({items:e,value:t,defaultValue:n,onChange:r,className:o=""}){const[a,i]=D.useState(t!==void 0?t:n||e[0].value),[s,u]=D.useState({}),c=D.useRef(new Map),d=D.useRef(null);D.useEffect(()=>{t!==void 0&&t!==a&&i(t)},[t]);const l=(m,y)=>{const w=c.current.get(m),v=y?c.current.get(y):null;if(w&&d.current){const p=d.current.getBoundingClientRect(),g=w.getBoundingClientRect(),b=g.left-p.left-4;if(v){const x=v.getBoundingClientRect().left-p.left-4;u({"--slide-from":`${x}px`,"--slide-to":`${b}px`,width:`${g.width}px`,transform:`translateX(${b}px)`})}else u({width:`${g.width}px`,transform:`translateX(${b}px)`})}};D.useEffect(()=>{l(a)},[a]);const h=m=>{const y=a;i(m),r==null||r(m),l(m,y)};return P.jsxs("div",{"data-u-comp":"segmented",ref:d,className:xe("univer-relative univer-box-border univer-flex univer-gap-4 univer-rounded-lg univer-bg-gray-100 univer-p-1 dark:!univer-bg-gray-800",o),children:[P.jsx("div",{className:"univer-animate-univer-slide univer-absolute univer-h-6 univer-rounded-md univer-bg-white univer-shadow-sm univer-transition-all univer-duration-200 dark:!univer-bg-gray-700 dark:!univer-text-gray-400",style:s}),e.map(m=>P.jsx("button",{ref:y=>{y&&c.current.set(m.value,y)},className:xe("univer-relative univer-box-border univer-flex-1 univer-cursor-pointer univer-border-none univer-bg-transparent univer-px-3 univer-py-1 univer-text-xs univer-font-medium univer-transition-colors",{"univer-text-gray-900 dark:!univer-text-white":a===m.value,"univer-text-gray-500 hover:univer-text-gray-900 dark:hover:!univer-text-white":a!==m.value}),type:"button",onClick:()=>h(m.value),children:m.label},String(m.value)))]})}function bP(e){const{value:t,options:n=[],hideCheckMark:r=!1,onChange:o,multiple:a,className:i,optionClassName:s}=e,u=Array.isArray(t)?t:[t];function c(d){const l=u.indexOf(d);a?l>-1?o(u.filter(h=>h===d)):o([...u,d]):l>-1?o(void 0):o(d)}return P.jsx("ul",{className:xe("univer-m-0 univer-grid univer-max-h-80 univer-list-none univer-gap-1 univer-overflow-y-auto univer-rounded univer-p-1.5",mn,er,i),children:n.map((d,l)=>{const h=u.indexOf(d.value)>-1;return P.jsx("li",{children:P.jsxs("a",{className:xe("univer-relative univer-block univer-cursor-pointer univer-select-none univer-rounded univer-py-1.5 univer-pl-8 univer-pr-2 univer-text-sm univer-text-gray-900 univer-transition-colors hover:univer-bg-gray-100 dark:!univer-text-white dark:hover:!univer-bg-gray-600",s,{"univer-bg-gray-200 dark:!univer-bg-gray-500":h}),onClick:()=>c(d.value),children:[!r&&h&&P.jsx(Rr,{className:"univer-absolute univer-left-0 univer-top-1/2 -univer-translate-y-1/2 univer-pl-2 univer-text-primary-600"}),P.jsx("span",{style:{color:d.color},children:d.label})]})},l)})})}const Mp=xe("univer-box-border univer-inline-flex univer-h-8 univer-min-w-36 univer-items-center univer-justify-between univer-gap-2 univer-rounded-lg univer-bg-white univer-px-2.5 univer-transition-colors univer-duration-200 dark:!univer-bg-gray-700 dark:!univer-text-white",mn);function wP(e){const{className:t,value:n,disabled:r=!1,options:o=[],borderless:a=!1,onChange:i}=e,[s,u]=D.useState(!1);function c(h){u(h)}const d=D.useMemo(()=>{const h=[];for(const m of o)m.options?(m.options.forEach(y=>{h.push({label:y.label,value:y.value,disabled:y.disabled})}),h.push({type:"separator"})):h.push({label:m.label,value:m.value,disabled:m.disabled});return[{type:"radio",value:n,hideIndicator:!0,options:h,onSelect:m=>{i(m)}}]},[o]),l=D.useMemo(()=>{let h=null;for(const m of o)if(m.options){for(const y of m.options)if(y.value===n){h=y.label;break}}else if(m.value===n){h=m.label;break}return h||n},[o,n]);return P.jsx(Kl,{className:"max-h univer-w-[var(--radix-popper-anchor-width)] univer-min-w-36",align:"start",open:s,items:d,disabled:r,onOpenChange:c,children:P.jsxs("div",{"data-u-comp":"select",className:xe(Mp,{"univer-border-primary-600 univer-outline-none univer-ring-2 univer-ring-primary-50 dark:!univer-ring-primary-900":s&&!a,"univer-border-transparent univer-bg-transparent hover:univer-border-transparent":a,"univer-cursor-not-allowed":r,"hover:univer-border-primary-600":!r&&!a,"univer-cursor-pointer":!r&&!s},t),children:[P.jsx("div",{className:"univer-flex-1 univer-truncate univer-text-sm univer-text-gray-500 dark:!univer-text-white",children:l}),P.jsx(es,{className:"univer-flex-shrink-0 dark:!univer-text-white"})]})})}function CP(e){const{className:t,value:n=[],disabled:r=!1,options:o=[],borderless:a=!1,onChange:i}=e,[s,u]=D.useState(!1);function c(m){u(m)}const d=D.useMemo(()=>o.map(m=>({type:"checkbox",value:m.value,label:m.label,disabled:m.disabled,checked:n.includes(m.value),onSelect:y=>{const w=n.includes(y)?n.filter(v=>v!==y):[...n,y];i(w)}})),[o]);function l(m){const y=n.filter(w=>w!==m);i(y)}const h=D.useMemo(()=>o.filter(m=>n.includes(m.value)).map((m,y)=>P.jsx(sc,{className:"univer-max-w-32",closable:!0,onClose:()=>l(m.value),children:m.label},y)),[o,n]);return P.jsx(Kl,{className:"univer-w-[var(--radix-popper-anchor-width)] univer-min-w-36",align:"start",open:s,items:d,disabled:r,onOpenChange:c,children:P.jsxs("div",{"data-u-comp":"multiple-select",className:xe(Mp,{"univer-border-primary-600 univer-outline-none univer-ring-2 univer-ring-primary-50 dark:!univer-ring-primary-900":s&&!a,"univer-border-transparent univer-bg-transparent hover:univer-border-transparent":a,"univer-cursor-not-allowed":r,"hover:univer-border-primary-600":!r&&!a,"univer-cursor-pointer":!r&&!s},t),children:[P.jsx("div",{className:"univer-box-border univer-flex univer-w-[calc(100%-16px)] univer-gap-2 univer-pr-2",children:h}),P.jsx(es,{className:"univer-flex-shrink-0 dark:!univer-text-white"})]})})}var xP="Separator",Pp="horizontal",SP=["horizontal","vertical"],Dp=f.forwardRef((e,t)=>{const{decorative:n,orientation:r=Pp,...o}=e,a=EP(r)?r:Pp,s=n?{role:"none"}:{"aria-orientation":a==="vertical"?a:void 0,role:"separator"};return P.jsx(gt.div,{"data-orientation":a,...s,...o,ref:t})});Dp.displayName=xP;function EP(e){return SP.includes(e)}var MP=Dp;function PP({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return P.jsx(MP,{"data-slot":"separator-root",decorative:n,orientation:t,className:xe(`
1506
1506
  univer-shrink-0 univer-bg-gray-200
1507
1507
  data-[orientation=horizontal]:univer-h-px data-[orientation=horizontal]:univer-w-full
1508
1508
  data-[orientation=vertical]:univer-h-full data-[orientation=vertical]:univer-w-px
1509
1509
  dark:!univer-bg-gray-600
1510
- `,e),...r})}const DP=e=>{const{defaultChecked:t=!1,onChange:n}=e,[r,o]=D.useState(t),a=()=>{o(!r),n==null||n(!r)};return D.useEffect(()=>{o(t)},[t]),P.jsx("div",{className:"univer-h-4",children:P.jsxs("label",{className:"univer-relative univer-inline-block univer-h-4 univer-w-7",children:[P.jsx("input",{className:"univer-size-0 univer-opacity-0",type:"checkbox",checked:r,onChange:a}),P.jsx("span",{className:Se("univer-absolute univer-inset-0 univer-cursor-pointer univer-rounded-2xl univer-bg-gray-50 univer-transition-colors univer-duration-200",{"univer-bg-primary-600":r}),children:P.jsx("span",{className:Se("univer-absolute univer-bottom-0.5 univer-left-0.5 univer-h-3 univer-w-3 univer-rounded-full univer-bg-white univer-transition-transform univer-duration-200",{"univer-translate-x-3":r})})})]})})};function kP(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const _P=e=>{switch(e){case"success":return TP;case"info":return RP;case"warning":return IP;case"error":return AP;default:return null}},NP=Array(12).fill(0),OP=({visible:e,className:t})=>D.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},D.createElement("div",{className:"sonner-spinner"},NP.map((n,r)=>D.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),TP=D.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},D.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),IP=D.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},D.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),RP=D.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},D.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),AP=D.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},D.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),LP=D.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},D.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),D.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),$P=()=>{const[e,t]=D.useState(document.hidden);return D.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let bu=1;class FP{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...o}=t,a=typeof(t==null?void 0:t.id)=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:bu++,i=this.toasts.find(u=>u.id===a),s=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(a)&&this.dismissedToasts.delete(a),i?this.toasts=this.toasts.map(u=>u.id===a?(this.publish({...u,...t,id:a,title:r}),{...u,...t,id:a,dismissible:s,title:r}):u):this.addToast({title:r,...o,dismissible:s,id:a}),a},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const o=Promise.resolve(t instanceof Function?t():t);let a=r!==void 0,i;const s=o.then(async c=>{if(i=["resolve",c],D.isValidElement(c))a=!1,this.create({id:r,type:"default",message:c});else if(HP(c)&&!c.ok){a=!1;const l=typeof n.error=="function"?await n.error(`HTTP error! status: ${c.status}`):n.error,h=typeof n.description=="function"?await n.description(`HTTP error! status: ${c.status}`):n.description,y=typeof l=="object"&&!D.isValidElement(l)?l:{message:l};this.create({id:r,type:"error",description:h,...y})}else if(c instanceof Error){a=!1;const l=typeof n.error=="function"?await n.error(c):n.error,h=typeof n.description=="function"?await n.description(c):n.description,y=typeof l=="object"&&!D.isValidElement(l)?l:{message:l};this.create({id:r,type:"error",description:h,...y})}else if(n.success!==void 0){a=!1;const l=typeof n.success=="function"?await n.success(c):n.success,h=typeof n.description=="function"?await n.description(c):n.description,y=typeof l=="object"&&!D.isValidElement(l)?l:{message:l};this.create({id:r,type:"success",description:h,...y})}}).catch(async c=>{if(i=["reject",c],n.error!==void 0){a=!1;const f=typeof n.error=="function"?await n.error(c):n.error,l=typeof n.description=="function"?await n.description(c):n.description,m=typeof f=="object"&&!D.isValidElement(f)?f:{message:f};this.create({id:r,type:"error",description:l,...m})}}).finally(()=>{a&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),u=()=>new Promise((c,f)=>s.then(()=>i[0]==="reject"?f(i[1]):c(i[1])).catch(f));return typeof r!="string"&&typeof r!="number"?{unwrap:u}:Object.assign(r,{unwrap:u})},this.custom=(t,n)=>{const r=(n==null?void 0:n.id)||bu++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const an=new FP,zP=(e,t)=>{const n=(t==null?void 0:t.id)||bu++;return an.addToast({title:e,...t,id:n}),n},HP=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",VP=zP,WP=()=>an.toasts,BP=()=>an.getActiveToasts(),jP=Object.assign(VP,{success:an.success,info:an.info,warning:an.warning,error:an.error,custom:an.custom,message:an.message,promise:an.promise,dismiss:an.dismiss,loading:an.loading},{getHistory:WP,getToasts:BP});kP("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Ui(e){return e.label!==void 0}const YP=3,UP="24px",qP="16px",kp=4e3,GP=356,KP=14,XP=45,ZP=200;function Fn(...e){return e.filter(Boolean).join(" ")}function QP(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const JP=e=>{var t,n,r,o,a,i,s,u,c;const{invert:f,toast:l,unstyled:h,interacting:m,setHeights:y,visibleToasts:w,heights:v,index:p,toasts:g,expanded:b,removeToast:C,defaultRichColors:x,closeButton:S,style:E,cancelButtonStyle:M,actionButtonStyle:k,className:T="",descriptionClassName:R="",duration:F,position:V,gap:$,expandByDefault:L,classNames:N,icons:H,closeButtonAriaLabel:_="Close toast"}=e,[z,B]=D.useState(null),[A,j]=D.useState(null),[Y,U]=D.useState(!1),[ne,te]=D.useState(!1),[J,G]=D.useState(!1),[q,Z]=D.useState(!1),[O,I]=D.useState(!1),[W,K]=D.useState(0),[oe,Q]=D.useState(0),ae=D.useRef(l.duration||F||kp),ee=D.useRef(null),ie=D.useRef(null),ve=p===0,ye=p+1<=w,de=l.type,se=l.dismissible!==!1,He=l.className||"",Le=l.descriptionClassName||"",ge=D.useMemo(()=>v.findIndex(be=>be.toastId===l.id)||0,[v,l.id]),Ye=D.useMemo(()=>{var be;return(be=l.closeButton)!=null?be:S},[l.closeButton,S]),Fe=D.useMemo(()=>l.duration||F||kp,[l.duration,F]),ze=D.useRef(0),Ge=D.useRef(0),Ke=D.useRef(0),Ee=D.useRef(null),[$e,le]=V.split("-"),fe=D.useMemo(()=>v.reduce((be,We,Oe)=>Oe>=ge?be:be+We.height,0),[v,ge]),Pe=$P(),ue=l.invert||f,he=de==="loading";Ge.current=D.useMemo(()=>ge*$+fe,[ge,fe]),D.useEffect(()=>{ae.current=Fe},[Fe]),D.useEffect(()=>{U(!0)},[]),D.useEffect(()=>{const be=ie.current;if(be){const We=be.getBoundingClientRect().height;return Q(We),y(Oe=>[{toastId:l.id,height:We,position:l.position},...Oe]),()=>y(Oe=>Oe.filter(Ce=>Ce.toastId!==l.id))}},[y,l.id]),D.useLayoutEffect(()=>{if(!Y)return;const be=ie.current,We=be.style.height;be.style.height="auto";const Oe=be.getBoundingClientRect().height;be.style.height=We,Q(Oe),y(Ce=>Ce.find(pe=>pe.toastId===l.id)?Ce.map(pe=>pe.toastId===l.id?{...pe,height:Oe}:pe):[{toastId:l.id,height:Oe,position:l.position},...Ce])},[Y,l.title,l.description,y,l.id,l.jsx,l.action,l.cancel]);const Ue=D.useCallback(()=>{te(!0),K(Ge.current),y(be=>be.filter(We=>We.toastId!==l.id)),setTimeout(()=>{C(l)},ZP)},[l,C,y,Ge]);D.useEffect(()=>{if(l.promise&&de==="loading"||l.duration===1/0||l.type==="loading")return;let be;return b||m||Pe?(()=>{if(Ke.current<ze.current){const Ce=new Date().getTime()-ze.current;ae.current=ae.current-Ce}Ke.current=new Date().getTime()})():(()=>{ae.current!==1/0&&(ze.current=new Date().getTime(),be=setTimeout(()=>{l.onAutoClose==null||l.onAutoClose.call(l,l),Ue()},ae.current))})(),()=>clearTimeout(be)},[b,m,l,de,Pe,Ue]),D.useEffect(()=>{l.delete&&(Ue(),l.onDismiss==null||l.onDismiss.call(l,l))},[Ue,l.delete]);function Je(){var be;if(H!=null&&H.loading){var We;return D.createElement("div",{className:Fn(N==null?void 0:N.loader,l==null||(We=l.classNames)==null?void 0:We.loader,"sonner-loader"),"data-visible":de==="loading"},H.loading)}return D.createElement(OP,{className:Fn(N==null?void 0:N.loader,l==null||(be=l.classNames)==null?void 0:be.loader),visible:de==="loading"})}const nt=l.icon||(H==null?void 0:H[de])||_P(de);var yt,tt;return D.createElement("li",{tabIndex:0,ref:ie,className:Fn(T,He,N==null?void 0:N.toast,l==null||(t=l.classNames)==null?void 0:t.toast,N==null?void 0:N.default,N==null?void 0:N[de],l==null||(n=l.classNames)==null?void 0:n[de]),"data-sonner-toast":"","data-rich-colors":(yt=l.richColors)!=null?yt:x,"data-styled":!(l.jsx||l.unstyled||h),"data-mounted":Y,"data-promise":!!l.promise,"data-swiped":O,"data-removed":ne,"data-visible":ye,"data-y-position":$e,"data-x-position":le,"data-index":p,"data-front":ve,"data-swiping":J,"data-dismissible":se,"data-type":de,"data-invert":ue,"data-swipe-out":q,"data-swipe-direction":A,"data-expanded":!!(b||L&&Y),style:{"--index":p,"--toasts-before":p,"--z-index":g.length-p,"--offset":`${ne?W:Ge.current}px`,"--initial-height":L?"auto":`${oe}px`,...E,...l.style},onDragEnd:()=>{G(!1),B(null),Ee.current=null},onPointerDown:be=>{be.button!==2&&(he||!se||(ee.current=new Date,K(Ge.current),be.target.setPointerCapture(be.pointerId),be.target.tagName!=="BUTTON"&&(G(!0),Ee.current={x:be.clientX,y:be.clientY})))},onPointerUp:()=>{var be,We,Oe;if(q||!se)return;Ee.current=null;const Ce=Number(((be=ie.current)==null?void 0:be.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),xe=Number(((We=ie.current)==null?void 0:We.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),pe=new Date().getTime()-((Oe=ee.current)==null?void 0:Oe.getTime()),Ve=z==="x"?Ce:xe,dt=Math.abs(Ve)/pe;if(Math.abs(Ve)>=XP||dt>.11){K(Ge.current),l.onDismiss==null||l.onDismiss.call(l,l),j(z==="x"?Ce>0?"right":"left":xe>0?"down":"up"),Ue(),Z(!0);return}else{var ut,rt;(ut=ie.current)==null||ut.style.setProperty("--swipe-amount-x","0px"),(rt=ie.current)==null||rt.style.setProperty("--swipe-amount-y","0px")}I(!1),G(!1),B(null)},onPointerMove:be=>{var We,Oe,Ce;if(!Ee.current||!se||((We=window.getSelection())==null?void 0:We.toString().length)>0)return;const pe=be.clientY-Ee.current.y,Ve=be.clientX-Ee.current.x;var dt;const ut=(dt=e.swipeDirections)!=null?dt:QP(V);!z&&(Math.abs(Ve)>1||Math.abs(pe)>1)&&B(Math.abs(Ve)>Math.abs(pe)?"x":"y");let rt={x:0,y:0};const Jt=xt=>1/(1.5+Math.abs(xt)/20);if(z==="y"){if(ut.includes("top")||ut.includes("bottom"))if(ut.includes("top")&&pe<0||ut.includes("bottom")&&pe>0)rt.y=pe;else{const xt=pe*Jt(pe);rt.y=Math.abs(xt)<Math.abs(pe)?xt:pe}}else if(z==="x"&&(ut.includes("left")||ut.includes("right")))if(ut.includes("left")&&Ve<0||ut.includes("right")&&Ve>0)rt.x=Ve;else{const xt=Ve*Jt(Ve);rt.x=Math.abs(xt)<Math.abs(Ve)?xt:Ve}(Math.abs(rt.x)>0||Math.abs(rt.y)>0)&&I(!0),(Oe=ie.current)==null||Oe.style.setProperty("--swipe-amount-x",`${rt.x}px`),(Ce=ie.current)==null||Ce.style.setProperty("--swipe-amount-y",`${rt.y}px`)}},Ye&&!l.jsx&&de!=="loading"?D.createElement("button",{"aria-label":_,"data-disabled":he,"data-close-button":!0,onClick:he||!se?()=>{}:()=>{Ue(),l.onDismiss==null||l.onDismiss.call(l,l)},className:Fn(N==null?void 0:N.closeButton,l==null||(r=l.classNames)==null?void 0:r.closeButton)},(tt=H==null?void 0:H.close)!=null?tt:LP):null,(de||l.icon||l.promise)&&l.icon!==null&&((H==null?void 0:H[de])!==null||l.icon)?D.createElement("div",{"data-icon":"",className:Fn(N==null?void 0:N.icon,l==null||(o=l.classNames)==null?void 0:o.icon)},l.promise||l.type==="loading"&&!l.icon?l.icon||Je():null,l.type!=="loading"?nt:null):null,D.createElement("div",{"data-content":"",className:Fn(N==null?void 0:N.content,l==null||(a=l.classNames)==null?void 0:a.content)},D.createElement("div",{"data-title":"",className:Fn(N==null?void 0:N.title,l==null||(i=l.classNames)==null?void 0:i.title)},l.jsx?l.jsx:typeof l.title=="function"?l.title():l.title),l.description?D.createElement("div",{"data-description":"",className:Fn(R,Le,N==null?void 0:N.description,l==null||(s=l.classNames)==null?void 0:s.description)},typeof l.description=="function"?l.description():l.description):null),D.isValidElement(l.cancel)?l.cancel:l.cancel&&Ui(l.cancel)?D.createElement("button",{"data-button":!0,"data-cancel":!0,style:l.cancelButtonStyle||M,onClick:be=>{Ui(l.cancel)&&se&&(l.cancel.onClick==null||l.cancel.onClick.call(l.cancel,be),Ue())},className:Fn(N==null?void 0:N.cancelButton,l==null||(u=l.classNames)==null?void 0:u.cancelButton)},l.cancel.label):null,D.isValidElement(l.action)?l.action:l.action&&Ui(l.action)?D.createElement("button",{"data-button":!0,"data-action":!0,style:l.actionButtonStyle||k,onClick:be=>{Ui(l.action)&&(l.action.onClick==null||l.action.onClick.call(l.action,be),!be.defaultPrevented&&Ue())},className:Fn(N==null?void 0:N.actionButton,l==null||(c=l.classNames)==null?void 0:c.actionButton)},l.action.label):null)};function _p(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function eD(e,t){const n={};return[e,t].forEach((r,o)=>{const a=o===1,i=a?"--mobile-offset":"--offset",s=a?qP:UP;function u(c){["top","right","bottom","left"].forEach(f=>{n[`${i}-${f}`]=typeof c=="number"?`${c}px`:c})}typeof r=="number"||typeof r=="string"?u(r):typeof r=="object"?["top","right","bottom","left"].forEach(c=>{r[c]===void 0?n[`${i}-${c}`]=s:n[`${i}-${c}`]=typeof r[c]=="number"?`${r[c]}px`:r[c]}):u(s)}),n}const tD=D.forwardRef(function(t,n){const{invert:r,position:o="bottom-right",hotkey:a=["altKey","KeyT"],expand:i,closeButton:s,className:u,offset:c,mobileOffset:f,theme:l="light",richColors:h,duration:m,style:y,visibleToasts:w=YP,toastOptions:v,dir:p=_p(),gap:g=KP,icons:b,containerAriaLabel:C="Notifications"}=t,[x,S]=D.useState([]),E=D.useMemo(()=>Array.from(new Set([o].concat(x.filter(A=>A.position).map(A=>A.position)))),[x,o]),[M,k]=D.useState([]),[T,R]=D.useState(!1),[F,V]=D.useState(!1),[$,L]=D.useState(l!=="system"?l:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),N=D.useRef(null),H=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),_=D.useRef(null),z=D.useRef(!1),B=D.useCallback(A=>{S(j=>{var Y;return(Y=j.find(U=>U.id===A.id))!=null&&Y.delete||an.dismiss(A.id),j.filter(({id:U})=>U!==A.id)})},[]);return D.useEffect(()=>an.subscribe(A=>{if(A.dismiss){requestAnimationFrame(()=>{S(j=>j.map(Y=>Y.id===A.id?{...Y,delete:!0}:Y))});return}setTimeout(()=>{It.flushSync(()=>{S(j=>{const Y=j.findIndex(U=>U.id===A.id);return Y!==-1?[...j.slice(0,Y),{...j[Y],...A},...j.slice(Y+1)]:[A,...j]})})})}),[x]),D.useEffect(()=>{if(l!=="system"){L(l);return}if(l==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?L("dark"):L("light")),typeof window>"u")return;const A=window.matchMedia("(prefers-color-scheme: dark)");try{A.addEventListener("change",({matches:j})=>{L(j?"dark":"light")})}catch{A.addListener(({matches:Y})=>{try{L(Y?"dark":"light")}catch(U){console.error(U)}})}},[l]),D.useEffect(()=>{x.length<=1&&R(!1)},[x]),D.useEffect(()=>{const A=j=>{var Y;if(a.every(te=>j[te]||j.code===te)){var ne;R(!0),(ne=N.current)==null||ne.focus()}j.code==="Escape"&&(document.activeElement===N.current||(Y=N.current)!=null&&Y.contains(document.activeElement))&&R(!1)};return document.addEventListener("keydown",A),()=>document.removeEventListener("keydown",A)},[a]),D.useEffect(()=>{if(N.current)return()=>{_.current&&(_.current.focus({preventScroll:!0}),_.current=null,z.current=!1)}},[N.current]),D.createElement("section",{ref:n,"aria-label":`${C} ${H}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},E.map((A,j)=>{var Y;const[U,ne]=A.split("-");return x.length?D.createElement("ol",{key:A,dir:p==="auto"?_p():p,tabIndex:-1,ref:N,className:u,"data-sonner-toaster":!0,"data-sonner-theme":$,"data-y-position":U,"data-x-position":ne,style:{"--front-toast-height":`${((Y=M[0])==null?void 0:Y.height)||0}px`,"--width":`${GP}px`,"--gap":`${g}px`,...y,...eD(c,f)},onBlur:te=>{z.current&&!te.currentTarget.contains(te.relatedTarget)&&(z.current=!1,_.current&&(_.current.focus({preventScroll:!0}),_.current=null))},onFocus:te=>{te.target instanceof HTMLElement&&te.target.dataset.dismissible==="false"||z.current||(z.current=!0,_.current=te.relatedTarget)},onMouseEnter:()=>R(!0),onMouseMove:()=>R(!0),onMouseLeave:()=>{F||R(!1)},onDragEnd:()=>R(!1),onPointerDown:te=>{te.target instanceof HTMLElement&&te.target.dataset.dismissible==="false"||V(!0)},onPointerUp:()=>V(!1)},x.filter(te=>!te.position&&j===0||te.position===A).map((te,J)=>{var G,q;return D.createElement(JP,{key:te.id,icons:b,index:J,toast:te,defaultRichColors:h,duration:(G=v==null?void 0:v.duration)!=null?G:m,className:v==null?void 0:v.className,descriptionClassName:v==null?void 0:v.descriptionClassName,invert:r,visibleToasts:w,closeButton:(q=v==null?void 0:v.closeButton)!=null?q:s,interacting:F,position:A,style:v==null?void 0:v.style,unstyled:v==null?void 0:v.unstyled,classNames:v==null?void 0:v.classNames,cancelButtonStyle:v==null?void 0:v.cancelButtonStyle,actionButtonStyle:v==null?void 0:v.actionButtonStyle,closeButtonAriaLabel:v==null?void 0:v.closeButtonAriaLabel,removeToast:B,toasts:x.filter(Z=>Z.position==te.position),heights:M.filter(Z=>Z.position==te.position),setHeights:k,expandByDefault:i,gap:g,expanded:T,swipeDirections:t.swipeDirections})})):null}))});function nD({visibleToasts:e,...t}){return P.jsx(tD,{className:"dark:![&_[data-description]]:univer-text-gray-200 [&_[data-description]]:univer-text-sm [&_[data-description]]:univer-text-gray-600 [&_[data-icon]>svg]:univer-relative [&_[data-icon]>svg]:univer-top-1 [&_[data-icon]]:univer-self-baseline [&_[data-sonner-toast]]:univer-shadow-md [&_[data-title]]:univer-text-sm [&_[data-title]]:univer-text-gray-900",toastOptions:{classNames:{content:"univer-leading-normal",success:"[&_[data-icon]]:univer-text-green-500",info:"[&_[data-icon]]:univer-text-primary-600",error:"[&_[data-icon]]:univer-text-red-500",warning:"[&_[data-icon]]:univer-text-yellow-500"}},visibleToasts:e!=null?e:5,...t})}var Np=d.forwardRef(function(e,t){var n=e.height,r=e.offsetY,o=e.offsetX,a=e.children,i=e.prefixCls,s=e.onInnerResize,u=e.innerProps,c=e.rtl,f=e.extra,l={},h={display:"flex",flexDirection:"column"};return r!==void 0&&(l={height:n,position:"relative",overflow:"hidden"},h=re(re({},h),{},ce(ce(ce(ce(ce({transform:"translateY(".concat(r,"px)")},c?"marginRight":"marginLeft",-o),"position","absolute"),"left",0),"right",0),"top",0))),d.createElement("div",{style:l},d.createElement(jn,{onResize:function(y){var w=y.offsetHeight;w&&s&&s()}},d.createElement("div",Ne({style:h,className:Xe(ce({},"".concat(i,"-holder-inner"),i)),ref:t},u),a,f)))});Np.displayName="Filler";function rD(e){var t=e.children,n=e.setRef,r=d.useCallback(function(o){n(o)},[]);return d.cloneElement(t,{ref:r})}function oD(e,t,n,r,o,a,i,s){var u=s.getKey;return e.slice(t,n+1).map(function(c,f){var l=t+f,h=i(c,l,{style:{width:r},offsetX:o}),m=u(c);return d.createElement(rD,{key:m,setRef:function(w){return a(c,w)}},h)})}function aD(e,t,n){var r=e.length,o=t.length,a,i;if(r===0&&o===0)return null;r<o?(a=e,i=t):(a=t,i=e);var s={__EMPTY_ITEM__:!0};function u(y){return y!==void 0?n(y):s}for(var c=null,f=Math.abs(r-o)!==1,l=0;l<i.length;l+=1){var h=u(a[l]),m=u(i[l]);if(h!==m){c=l,f=f||h!==u(i[l+1]);break}}return c===null?null:{index:c,multiple:f}}function iD(e,t,n){var r=d.useState(e),o=X(r,2),a=o[0],i=o[1],s=d.useState(null),u=X(s,2),c=u[0],f=u[1];return d.useEffect(function(){var l=aD(a||[],e||[],t);(l==null?void 0:l.index)!==void 0&&f(e[l.index]),i(e)},[e]),[c]}var Op=(typeof navigator>"u"?"undefined":Ct(navigator))==="object"&&/Firefox/i.test(navigator.userAgent);const Tp=function(e,t,n,r){var o=D.useRef(!1),a=D.useRef(null);function i(){clearTimeout(a.current),o.current=!0,a.current=setTimeout(function(){o.current=!1},50)}var s=D.useRef({top:e,bottom:t,left:n,right:r});return s.current.top=e,s.current.bottom=t,s.current.left=n,s.current.right=r,function(u,c){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,l=u?c<0&&s.current.left||c>0&&s.current.right:c<0&&s.current.top||c>0&&s.current.bottom;return f&&l?(clearTimeout(a.current),o.current=!1):(!l||o.current)&&i(),!o.current&&l}};function sD(e,t,n,r,o,a,i){var s=D.useRef(0),u=D.useRef(null),c=D.useRef(null),f=D.useRef(!1),l=Tp(t,n,r,o);function h(g,b){if(mt.cancel(u.current),!l(!1,b)){var C=g;if(!C._virtualHandled)C._virtualHandled=!0;else return;s.current+=b,c.current=b,Op||C.preventDefault(),u.current=mt(function(){var x=f.current?10:1;i(s.current*x,!1),s.current=0})}}function m(g,b){i(b,!0),Op||g.preventDefault()}var y=D.useRef(null),w=D.useRef(null);function v(g){if(e){mt.cancel(w.current),w.current=mt(function(){y.current=null},2);var b=g.deltaX,C=g.deltaY,x=g.shiftKey,S=b,E=C;(y.current==="sx"||!y.current&&x&&C&&!b)&&(S=C,E=0,y.current="sx");var M=Math.abs(S),k=Math.abs(E);y.current===null&&(y.current=a&&M>k?"x":"y"),y.current==="y"?h(g,E):m(g,S)}}function p(g){e&&(f.current=g.detail===c.current)}return[v,p]}function lD(e,t,n,r){var o=d.useMemo(function(){return[new Map,[]]},[e,n.id,r]),a=X(o,2),i=a[0],s=a[1],u=function(f){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f,h=i.get(f),m=i.get(l);if(h===void 0||m===void 0)for(var y=e.length,w=s.length;w<y;w+=1){var v,p=e[w],g=t(p);i.set(g,w);var b=(v=n.get(g))!==null&&v!==void 0?v:r;if(s[w]=(s[w-1]||0)+b,g===f&&(h=w),g===l&&(m=w),h!==void 0&&m!==void 0)break}return{top:s[h-1]||0,bottom:s[m]}};return u}var uD=function(){function e(){qr(this,e),ce(this,"maps",void 0),ce(this,"id",0),ce(this,"diffRecords",new Map),this.maps=Object.create(null)}return Gr(e,[{key:"set",value:function(n,r){this.diffRecords.set(n,this.maps[n]),this.maps[n]=r,this.id+=1}},{key:"get",value:function(n){return this.maps[n]}},{key:"resetRecord",value:function(){this.diffRecords.clear()}},{key:"getRecord",value:function(){return this.diffRecords}}]),e}();function Ip(e){var t=parseFloat(e);return isNaN(t)?0:t}function cD(e,t,n){var r=d.useState(0),o=X(r,2),a=o[0],i=o[1],s=D.useRef(new Map),u=D.useRef(new uD),c=D.useRef(0);function f(){c.current+=1}function l(){var m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;f();var y=function(){var p=!1;s.current.forEach(function(g,b){if(g&&g.offsetParent){var C=g.offsetHeight,x=getComputedStyle(g),S=x.marginTop,E=x.marginBottom,M=Ip(S),k=Ip(E),T=C+M+k;u.current.get(b)!==T&&(u.current.set(b,T),p=!0)}}),p&&i(function(g){return g+1})};if(m)y();else{c.current+=1;var w=c.current;Promise.resolve().then(function(){w===c.current&&y()})}}function h(m,y){var w=e(m);s.current.get(w),y?(s.current.set(w,y),l()):s.current.delete(w)}return D.useEffect(function(){return f},[]),[h,l,u.current,a]}var Rp=14/15;function dD(e,t,n){var r=D.useRef(!1),o=D.useRef(0),a=D.useRef(0),i=D.useRef(null),s=D.useRef(null),u,c=function(m){if(r.current){var y=Math.ceil(m.touches[0].pageX),w=Math.ceil(m.touches[0].pageY),v=o.current-y,p=a.current-w,g=Math.abs(v)>Math.abs(p);g?o.current=y:a.current=w;var b=n(g,g?v:p,!1,m);b&&m.preventDefault(),clearInterval(s.current),b&&(s.current=setInterval(function(){g?v*=Rp:p*=Rp;var C=Math.floor(g?v:p);(!n(g,C,!0)||Math.abs(C)<=.1)&&clearInterval(s.current)},16))}},f=function(){r.current=!1,u()},l=function(m){u(),m.touches.length===1&&!r.current&&(r.current=!0,o.current=Math.ceil(m.touches[0].pageX),a.current=Math.ceil(m.touches[0].pageY),i.current=m.target,i.current.addEventListener("touchmove",c,{passive:!1}),i.current.addEventListener("touchend",f,{passive:!0}))};u=function(){i.current&&(i.current.removeEventListener("touchmove",c),i.current.removeEventListener("touchend",f))},ht(function(){return e&&t.current.addEventListener("touchstart",l,{passive:!0}),function(){var h;(h=t.current)===null||h===void 0||h.removeEventListener("touchstart",l),u(),clearInterval(s.current)}},[e])}function Ap(e){return Math.floor(Math.pow(e,.5))}function wu(e,t){var n="touches"in e?e.touches[0]:e;return n[t?"pageX":"pageY"]-window[t?"scrollX":"scrollY"]}function fD(e,t,n){d.useEffect(function(){var r=t.current;if(e&&r){var o=!1,a,i,s=function(){mt.cancel(a)},u=function h(){s(),a=mt(function(){n(i),h()})},c=function(m){if(!(m.target.draggable||m.button!==0)){var y=m;y._virtualHandled||(y._virtualHandled=!0,o=!0)}},f=function(){o=!1,s()},l=function(m){if(o){var y=wu(m,!1),w=r.getBoundingClientRect(),v=w.top,p=w.bottom;if(y<=v){var g=v-y;i=-Ap(g),u()}else if(y>=p){var b=y-p;i=Ap(b),u()}else s()}};return r.addEventListener("mousedown",c),r.ownerDocument.addEventListener("mouseup",f),r.ownerDocument.addEventListener("mousemove",l),function(){r.removeEventListener("mousedown",c),r.ownerDocument.removeEventListener("mouseup",f),r.ownerDocument.removeEventListener("mousemove",l),s()}}},[e])}var vD=10;function mD(e,t,n,r,o,a,i,s){var u=d.useRef(),c=d.useState(null),f=X(c,2),l=f[0],h=f[1];return ht(function(){if(l&&l.times<vD){if(!e.current){h(function(z){return re({},z)});return}a();var m=l.targetAlign,y=l.originAlign,w=l.index,v=l.offset,p=e.current.clientHeight,g=!1,b=m,C=null;if(p){for(var x=m||y,S=0,E=0,M=0,k=Math.min(t.length-1,w),T=0;T<=k;T+=1){var R=o(t[T]);E=S;var F=n.get(R);M=E+(F===void 0?r:F),S=M}for(var V=x==="top"?v:p-v,$=k;$>=0;$-=1){var L=o(t[$]),N=n.get(L);if(N===void 0){g=!0;break}if(V-=N,V<=0)break}switch(x){case"top":C=E-v;break;case"bottom":C=M-p+v;break;default:{var H=e.current.scrollTop,_=H+p;E<H?b="top":M>_&&(b="bottom")}}C!==null&&i(C),C!==l.lastTop&&(g=!0)}g&&h(re(re({},l),{},{times:l.times+1,targetAlign:b,lastTop:C}))}},[l,e.current]),function(m){if(m==null){s();return}if(mt.cancel(u.current),typeof m=="number")i(m);else if(m&&Ct(m)==="object"){var y,w=m.align;"index"in m?y=m.index:y=t.findIndex(function(g){return o(g)===m.key});var v=m.offset,p=v===void 0?0:v;h({times:0,index:y,offset:p,originAlign:w})}}}var Lp=d.forwardRef(function(e,t){var n=e.prefixCls,r=e.rtl,o=e.scrollOffset,a=e.scrollRange,i=e.onStartMove,s=e.onStopMove,u=e.onScroll,c=e.horizontal,f=e.spinSize,l=e.containerSize,h=e.style,m=e.thumbStyle,y=e.showScrollBar,w=d.useState(!1),v=X(w,2),p=v[0],g=v[1],b=d.useState(null),C=X(b,2),x=C[0],S=C[1],E=d.useState(null),M=X(E,2),k=M[0],T=M[1],R=!r,F=d.useRef(),V=d.useRef(),$=d.useState(y),L=X($,2),N=L[0],H=L[1],_=d.useRef(),z=function(){y===!0||y===!1||(clearTimeout(_.current),H(!0),_.current=setTimeout(function(){H(!1)},3e3))},B=a-l||0,A=l-f||0,j=d.useMemo(function(){if(o===0||B===0)return 0;var O=o/B;return O*A},[o,B,A]),Y=function(I){I.stopPropagation(),I.preventDefault()},U=d.useRef({top:j,dragging:p,pageY:x,startTop:k});U.current={top:j,dragging:p,pageY:x,startTop:k};var ne=function(I){g(!0),S(wu(I,c)),T(U.current.top),i(),I.stopPropagation(),I.preventDefault()};d.useEffect(function(){var O=function(oe){oe.preventDefault()},I=F.current,W=V.current;return I.addEventListener("touchstart",O,{passive:!1}),W.addEventListener("touchstart",ne,{passive:!1}),function(){I.removeEventListener("touchstart",O),W.removeEventListener("touchstart",ne)}},[]);var te=d.useRef();te.current=B;var J=d.useRef();J.current=A,d.useEffect(function(){if(p){var O,I=function(oe){var Q=U.current,ae=Q.dragging,ee=Q.pageY,ie=Q.startTop;mt.cancel(O);var ve=F.current.getBoundingClientRect(),ye=l/(c?ve.width:ve.height);if(ae){var de=(wu(oe,c)-ee)*ye,se=ie;!R&&c?se-=de:se+=de;var He=te.current,Le=J.current,ge=Le?se/Le:0,Ye=Math.ceil(ge*He);Ye=Math.max(Ye,0),Ye=Math.min(Ye,He),O=mt(function(){u(Ye,c)})}},W=function(){g(!1),s()};return window.addEventListener("mousemove",I,{passive:!0}),window.addEventListener("touchmove",I,{passive:!0}),window.addEventListener("mouseup",W,{passive:!0}),window.addEventListener("touchend",W,{passive:!0}),function(){window.removeEventListener("mousemove",I),window.removeEventListener("touchmove",I),window.removeEventListener("mouseup",W),window.removeEventListener("touchend",W),mt.cancel(O)}}},[p]),d.useEffect(function(){return z(),function(){clearTimeout(_.current)}},[o]),d.useImperativeHandle(t,function(){return{delayHidden:z}});var G="".concat(n,"-scrollbar"),q={position:"absolute",visibility:N?null:"hidden"},Z={position:"absolute",background:"rgba(0, 0, 0, 0.5)",borderRadius:99,cursor:"pointer",userSelect:"none"};return c?(q.height=8,q.left=0,q.right=0,q.bottom=0,Z.height="100%",Z.width=f,R?Z.left=j:Z.right=j):(q.width=8,q.top=0,q.bottom=0,R?q.right=0:q.left=0,Z.width="100%",Z.height=f,Z.top=j),d.createElement("div",{ref:F,className:Xe(G,ce(ce(ce({},"".concat(G,"-horizontal"),c),"".concat(G,"-vertical"),!c),"".concat(G,"-visible"),N)),style:re(re({},q),h),onMouseDown:Y,onMouseMove:z},d.createElement("div",{ref:V,className:Xe("".concat(G,"-thumb"),ce({},"".concat(G,"-thumb-moving"),p)),style:re(re({},Z),m),onMouseDown:ne}))}),hD=20;function $p(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=e/t*e;return isNaN(n)&&(n=0),n=Math.max(n,hD),Math.floor(n)}var pD=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","direction","scrollWidth","component","onScroll","onVirtualScroll","onVisibleChange","innerProps","extraRender","styles","showScrollBar"],gD=[],yD={overflowY:"auto",overflowAnchor:"none"};function bD(e,t){var n=e.prefixCls,r=n===void 0?"rc-virtual-list":n,o=e.className,a=e.height,i=e.itemHeight,s=e.fullHeight,u=s===void 0?!0:s,c=e.style,f=e.data,l=e.children,h=e.itemKey,m=e.virtual,y=e.direction,w=e.scrollWidth,v=e.component,p=v===void 0?"div":v,g=e.onScroll,b=e.onVirtualScroll,C=e.onVisibleChange,x=e.innerProps,S=e.extraRender,E=e.styles,M=e.showScrollBar,k=M===void 0?"optional":M,T=pt(e,pD),R=d.useCallback(function(we){return typeof h=="function"?h(we):we==null?void 0:we[h]},[h]),F=cD(R),V=X(F,4),$=V[0],L=V[1],N=V[2],H=V[3],_=!!(m!==!1&&a&&i),z=d.useMemo(function(){return Object.values(N.maps).reduce(function(we,Me){return we+Me},0)},[N.id,N.maps]),B=_&&f&&(Math.max(i*f.length,z)>a||!!w),A=y==="rtl",j=Xe(r,ce({},"".concat(r,"-rtl"),A),o),Y=f||gD,U=D.useRef(),ne=D.useRef(),te=D.useRef(),J=D.useState(0),G=X(J,2),q=G[0],Z=G[1],O=D.useState(0),I=X(O,2),W=I[0],K=I[1],oe=D.useState(!1),Q=X(oe,2),ae=Q[0],ee=Q[1],ie=function(){ee(!0)},ve=function(){ee(!1)},ye={getKey:R};function de(we){Z(function(Me){var Be;typeof we=="function"?Be=we(Me):Be=we;var qe=be(Be);return U.current.scrollTop=qe,qe})}var se=D.useRef({start:0,end:Y.length}),He=D.useRef(),Le=iD(Y,R),ge=X(Le,1),Ye=ge[0];He.current=Ye;var Fe=d.useMemo(function(){if(!_)return{scrollHeight:void 0,start:0,end:Y.length-1,offset:void 0};if(!B){var we;return{scrollHeight:((we=ne.current)===null||we===void 0?void 0:we.offsetHeight)||0,start:0,end:Y.length-1,offset:void 0}}for(var Me=0,Be,qe,it,Ft=Y.length,Rt=0;Rt<Ft;Rt+=1){var tn=Y[Rt],nn=R(tn),Xt=N.get(nn),zt=Me+(Xt===void 0?i:Xt);zt>=q&&Be===void 0&&(Be=Rt,qe=Me),zt>q+a&&it===void 0&&(it=Rt),Me=zt}return Be===void 0&&(Be=0,qe=0,it=Math.ceil(a/i)),it===void 0&&(it=Y.length-1),it=Math.min(it+1,Y.length-1),{scrollHeight:Me,start:Be,end:it,offset:qe}},[B,_,q,Y,H,a]),ze=Fe.scrollHeight,Ge=Fe.start,Ke=Fe.end,Ee=Fe.offset;se.current.start=Ge,se.current.end=Ke,d.useLayoutEffect(function(){var we=N.getRecord();if(we.size===1){var Me=Array.from(we.keys())[0],Be=we.get(Me),qe=Y[Ge];if(qe&&Be===void 0){var it=R(qe);if(it===Me){var Ft=N.get(Me),Rt=Ft-i;de(function(tn){return tn+Rt})}}}N.resetRecord()},[ze]);var $e=d.useState({width:0,height:a}),le=X($e,2),fe=le[0],Pe=le[1],ue=function(Me){Pe({width:Me.offsetWidth,height:Me.offsetHeight})},he=D.useRef(),Ue=D.useRef(),Je=d.useMemo(function(){return $p(fe.width,w)},[fe.width,w]),nt=d.useMemo(function(){return $p(fe.height,ze)},[fe.height,ze]),yt=ze-a,tt=D.useRef(yt);tt.current=yt;function be(we){var Me=we;return Number.isNaN(tt.current)||(Me=Math.min(Me,tt.current)),Me=Math.max(Me,0),Me}var We=q<=0,Oe=q>=yt,Ce=W<=0,xe=W>=w,pe=Tp(We,Oe,Ce,xe),Ve=function(){return{x:A?-W:W,y:q}},dt=D.useRef(Ve()),ut=ct(function(we){if(b){var Me=re(re({},Ve()),we);(dt.current.x!==Me.x||dt.current.y!==Me.y)&&(b(Me),dt.current=Me)}});function rt(we,Me){var Be=we;Me?(It.flushSync(function(){K(Be)}),ut()):de(Be)}function Jt(we){var Me=we.currentTarget.scrollTop;Me!==q&&de(Me),g==null||g(we),ut()}var xt=function(Me){var Be=Me,qe=w?w-fe.width:0;return Be=Math.max(Be,0),Be=Math.min(Be,qe),Be},Vt=ct(function(we,Me){Me?(It.flushSync(function(){K(function(Be){var qe=Be+(A?-we:we);return xt(qe)})}),ut()):de(function(Be){var qe=Be+we;return qe})}),en=sD(_,We,Oe,Ce,xe,!!w,Vt),dn=X(en,2),Wt=dn[0],Nt=dn[1];dD(_,U,function(we,Me,Be,qe){var it=qe;return pe(we,Me,Be)?!1:!it||!it._virtualHandled?(it&&(it._virtualHandled=!0),Wt({preventDefault:function(){},deltaX:we?Me:0,deltaY:we?0:Me}),!0):!1}),fD(B,U,function(we){de(function(Me){return Me+we})}),ht(function(){function we(Be){var qe=We&&Be.detail<0,it=Oe&&Be.detail>0;_&&!qe&&!it&&Be.preventDefault()}var Me=U.current;return Me.addEventListener("wheel",Wt,{passive:!1}),Me.addEventListener("DOMMouseScroll",Nt,{passive:!0}),Me.addEventListener("MozMousePixelScroll",we,{passive:!1}),function(){Me.removeEventListener("wheel",Wt),Me.removeEventListener("DOMMouseScroll",Nt),Me.removeEventListener("MozMousePixelScroll",we)}},[_,We,Oe]),ht(function(){if(w){var we=xt(W);K(we),ut({x:we})}},[fe.width,w]);var Kt=function(){var Me,Be;(Me=he.current)===null||Me===void 0||Me.delayHidden(),(Be=Ue.current)===null||Be===void 0||Be.delayHidden()},Et=mD(U,Y,N,i,R,function(){return L(!0)},de,Kt);d.useImperativeHandle(t,function(){return{nativeElement:te.current,getScrollInfo:Ve,scrollTo:function(Me){function Be(qe){return qe&&Ct(qe)==="object"&&("left"in qe||"top"in qe)}Be(Me)?(Me.left!==void 0&&K(xt(Me.left)),Et(Me.top)):Et(Me)}}}),ht(function(){if(C){var we=Y.slice(Ge,Ke+1);C(we,Y)}},[Ge,Ke,Y]);var Bt=lD(Y,R,N,i),bt=S==null?void 0:S({start:Ge,end:Ke,virtual:B,offsetX:W,offsetY:Ee,rtl:A,getSize:Bt}),sn=oD(Y,Ge,Ke,w,W,$,l,ye),Ot=null;a&&(Ot=re(ce({},u?"height":"maxHeight",a),yD),_&&(Ot.overflowY="hidden",w&&(Ot.overflowX="hidden"),ae&&(Ot.pointerEvents="none")));var fn={};return A&&(fn.dir="rtl"),d.createElement("div",Ne({ref:te,style:re(re({},c),{},{position:"relative"}),className:j},fn,T),d.createElement(jn,{onResize:ue},d.createElement(p,{className:"".concat(r,"-holder"),style:Ot,ref:U,onScroll:Jt,onMouseEnter:Kt},d.createElement(Np,{prefixCls:r,height:ze,offsetX:W,offsetY:Ee,scrollWidth:w,onInnerResize:L,ref:ne,innerProps:x,rtl:A,extra:bt},sn))),B&&ze>a&&d.createElement(Lp,{ref:he,prefixCls:r,scrollOffset:q,scrollRange:ze,rtl:A,onScroll:rt,onStartMove:ie,onStopMove:ve,spinSize:nt,containerSize:fe.height,style:E==null?void 0:E.verticalScrollBar,thumbStyle:E==null?void 0:E.verticalScrollBarThumb,showScrollBar:k}),B&&w>fe.width&&d.createElement(Lp,{ref:Ue,prefixCls:r,scrollOffset:W,scrollRange:w,rtl:A,onScroll:rt,onStartMove:ie,onStopMove:ve,spinSize:Je,containerSize:fe.width,horizontal:!0,style:E==null?void 0:E.horizontalScrollBar,thumbStyle:E==null?void 0:E.horizontalScrollBarThumb,showScrollBar:k}))}var Fp=d.forwardRef(bD);Fp.displayName="List";const zp=(e,t)=>{const n=[],r=o=>{var a;if(n.push(o.key),t===o.key||(a=o.children)!=null&&a.length&&o.children.some(r))return!0;n.pop()};return e.some(r),n},Hp=(e,t)=>{const n=t!=null?t:new Map;let r=e;return{findNodePathFromTreeWithCache:o=>{const a=n.get(o);if(a)return a;const i=zp(r,o);return i.map((u,c,f)=>{const l=[];for(let h=0;h<=c;h++)l.push(f[h]);return l}).reverse().forEach(u=>{const c=u[u.length-1];n.set(c,u)}),i},reset:o=>{n.clear(),o&&(r=o)}}},qi=(e,t)=>t.length?t.reduce((n,r)=>{const o=n.find(a=>a.key===r);return(o==null?void 0:o.children)||[]},e):e,wD=(e,t)=>{const n=t.slice(0),r=n.pop();return qi(e,n).find(a=>a.key===r)},CD=(e,t,n)=>{const r=new Set(t),o=n[n.length-1],a=qi(e,n);if(r.has(o)){if(a.length){const s=u=>{r.delete(u.key),u.children&&u.children.forEach(c=>s(c))};a.forEach(s)}n.map((s,u,c)=>{const f=[];for(let l=0;l<=u;l++)f.push(c[l]);return f}).reverse().some(s=>{const u=qi(e,s),c=s[s.length-1];if(u.every(f=>!r.has(f.key)))r.delete(c);else return!0;return!1})}else{const i=s=>{r.add(s.key),s.children&&s.children.forEach(u=>i(u))};n.forEach(s=>r.add(s)),a.length&&a.forEach(i)}return[...r]},xD=(e,t)=>{const n=t.children||[],r=o=>{var a;return(a=o.children)!=null&&a.length?!!o.children.every(r):e.has(o.key)};return n.length?n.some(o=>!r(o)):!1},SD=(e,t)=>{const n=[],r=Hp(e);return t.forEach(o=>{var s;const a=r.findNodePathFromTreeWithCache(o),i=wD(e,a);i&&((s=i.children)!=null&&s.length||n.push(i))}),n};var Vp=(e=>(e[e.ONLY_LEAF_NODE=0]="ONLY_LEAF_NODE",e[e.ALL=1]="ALL",e))(Vp||{});function Wp(e,t,n=1){const r=[];return e.forEach(o=>{r.push({...o,level:n}),o.children&&t.has(o.key)&&r.push(...Wp(o.children,t,n+1))}),r}function ED(e){const{data:t=[],defaultCache:n,style:r,defaultExpandAll:o=!1,selectionMode:a=1,valueGroup:i=[],onChange:s,onExpend:u,height:c=200,itemHeight:f=32,attachRender:l}=e,[h,m]=D.useState({}),y=D.useMemo(()=>new Set,[]),w=D.useMemo(()=>Hp(t,n),[t,n]),v=D.useMemo(()=>{const C=new Set;return i.forEach(x=>{w.findNodePathFromTreeWithCache(x).forEach(E=>C.add(E))}),C},[i,w]);D.useEffect(()=>{function C(x){var S;y.add(x.key),(S=x.children)==null||S.forEach(C)}o&&t.forEach(C),m({})},[o,t]);const p=D.useMemo(()=>Wp(t,y),[t,h,y]);function g(C){var x;(x=C.children)!=null&&x.length&&(y.has(C.key)?y.delete(C.key):y.add(C.key),m({})),!(a===0&&C.children)&&(u==null||u(C.key))}function b(C){const{title:x,key:S,level:E=0}=C,M=e.treeNodeClassName,k=y.has(S),T=v.has(S),R=xD(v,C);return P.jsx("div",{className:Se("univer-tree-list-item",M),style:{paddingLeft:`${E*20}px`},children:P.jsxs("div",{className:Se("univer-tree-list-item-content",{"univer-tree-list-item-content-selected":T}),children:[C.children&&C.children.length>0&&P.jsx("span",{className:Se("univer-tree-icon",{"univer-tree-icon-expand":k}),onClick:F=>{F.stopPropagation(),g(C)},children:P.jsx(Ou,{})}),P.jsx(dc,{checked:T&&!R,indeterminate:T&&R,onChange:()=>{s==null||s(C)}}),P.jsx("div",{className:"univer-tree-list-item-title",onClick:F=>{F.stopPropagation(),g(C)},children:P.jsx(hu,{className:"univer-w-full univer-truncate",showIfEllipsis:!0,placement:"top",title:x,children:P.jsx("span",{children:x})})}),l&&l(C)]})},S)}return P.jsx("section",{className:"univer-tree",children:P.jsx("div",{className:"univer-tree-list",style:r,children:P.jsx(Fp,{data:p,itemKey:C=>C.key,height:c,itemHeight:f,children:C=>b(C)})})})}const Gi=new WeakMap;function MD(e,t){let n=Gi.get(t);n||(n=jp.createRoot(t),Gi.set(t,n)),n.render(e)}function PD(e){const t=Gi.get(e);t&&(t.unmount(),Gi.delete(e))}const Cu=new Set;let Ki;function DD(e){return Ki||(Ki=new ResizeObserver((...t)=>{Cu.forEach(n=>n(...t))})),{observe(t,n){Cu.add(e),Ki.observe(t,n)},unobserve(t){Cu.delete(e),Ki.unobserve(t)}}}Object.defineProperty(me,"defaultTheme",{enumerable:!0,get:()=>Pu.defaultTheme}),Object.defineProperty(me,"greenTheme",{enumerable:!0,get:()=>Pu.greenTheme}),me.Accordion=Ug,me.Avatar=Gg,me.Badge=sc,me.Button=kn,me.ButtonGroup=n0,me.CascaderList=d0,me.Checkbox=dc,me.CheckboxGroup=f0,me.ColorPicker=Qy,me.ConfigContext=mn,me.ConfigProvider=c0,me.Confirm=eb,me.DatePanel=xC,me.DatePicker=SC,me.DateRangePicker=EC,me.Dialog=Ss,me.DraggableList=WC,me.Dropdown=xM,me.DropdownLegacy=ZC,me.DropdownMenu=Kl,me.FormDualColumnLayout=MM,me.FormLayout=EM,me.Gallery=PM,me.HoverCard=HM,me.Input=Bh,me.InputNumber=WM,me.KBD=BM,me.Menu=J2,me.MenuItem=eP,me.MenuItemGroup=nP,me.MessageType=bp,me.Messager=lP,me.MultipleSelect=CP,me.Pager=Rh,me.Popup=hP,me.Radio=gP,me.RadioGroup=pP,me.ReactGridLayout=Gv,me.Segmented=yP,me.Select=wP,me.SelectList=bP,me.Separator=PP,me.SubMenu=tP,me.Switch=DP,me.TinyMenuGroup=rP,me.Toaster=nD,me.Tooltip=hu,me.Tree=ED,me.TreeSelectionMode=Vp,me.borderBottomClassName=i0,me.borderClassName=yn,me.borderLeftBottomClassName=r0,me.borderLeftClassName=o0,me.borderRightClassName=s0,me.borderTopClassName=a0,me.clsx=Se,me.divideXClassName=u0,me.divideYClassName=l0,me.filterLeafNode=SD,me.findNodePathFromTree=zp,me.findSubTreeFromPath=qi,me.isBrowser=va,me.mergeTreeSelected=CD,me.message=uP,me.removeMessage=cP,me.render=MD,me.resizeObserverCtor=DD,me.scrollbarClassName=Cr,me.toast=jP,me.unmount=PD,Object.defineProperty(me,Symbol.toStringTag,{value:"Module"})});
1510
+ `,e),...r})}const DP=e=>{const{defaultChecked:t=!1,onChange:n}=e,[r,o]=D.useState(t),a=()=>{o(!r),n==null||n(!r)};return D.useEffect(()=>{o(t)},[t]),P.jsx("div",{className:"univer-h-4",children:P.jsxs("label",{className:"univer-relative univer-inline-block univer-h-4 univer-w-7",children:[P.jsx("input",{className:"univer-size-0 univer-opacity-0",type:"checkbox",checked:r,onChange:a}),P.jsx("span",{className:xe("univer-absolute univer-inset-0 univer-cursor-pointer univer-rounded-2xl univer-bg-gray-50 univer-transition-colors univer-duration-200",{"univer-bg-primary-600":r}),children:P.jsx("span",{className:xe("univer-absolute univer-bottom-0.5 univer-left-0.5 univer-h-3 univer-w-3 univer-rounded-full univer-bg-white univer-transition-transform univer-duration-200",{"univer-translate-x-3":r})})})]})})},kP=D.forwardRef((e,t)=>{const n=D.useRef(null),r=D.useRef({width:0,height:0}),{className:o,onResize:a,onValueChange:i,...s}=e;D.useImperativeHandle(t,()=>n.current,[]),D.useLayoutEffect(()=>{const c=n.current;if(c&&a){const d=new ResizeObserver(l=>{const{width:h,height:m}=l[0].target.getBoundingClientRect();h===0||m===0||(r.current.width!==h||r.current.height!==m)&&(r.current={width:h,height:m},a(h,m))});return d.observe(c),()=>{d.unobserve(c),d.disconnect()}}},[a]);function u(c){const d=c.target.value;i==null||i(d)}return P.jsx("textarea",{ref:n,"data-slot":"textarea",className:xe(`
1511
+ univer-box-border univer-flex univer-w-full univer-resize univer-rounded-md univer-bg-transparent
1512
+ univer-p-2 univer-text-base univer-text-gray-900 univer-outline-none
1513
+ univer-transition-[color,box-shadow]
1514
+ placeholder:univer-text-gray-200
1515
+ disabled:univer-cursor-not-allowed disabled:univer-opacity-50
1516
+ dark:!univer-text-white
1517
+ `,mn,er,o),onChange:u,...s})});function NP(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const _P=e=>{switch(e){case"success":return IP;case"info":return AP;case"warning":return RP;case"error":return LP;default:return null}},OP=Array(12).fill(0),TP=({visible:e,className:t})=>D.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},D.createElement("div",{className:"sonner-spinner"},OP.map((n,r)=>D.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),IP=D.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},D.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),RP=D.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},D.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),AP=D.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},D.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),LP=D.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},D.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),$P=D.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},D.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),D.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),FP=()=>{const[e,t]=D.useState(document.hidden);return D.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let bu=1;class zP{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...o}=t,a=typeof(t==null?void 0:t.id)=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:bu++,i=this.toasts.find(u=>u.id===a),s=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(a)&&this.dismissedToasts.delete(a),i?this.toasts=this.toasts.map(u=>u.id===a?(this.publish({...u,...t,id:a,title:r}),{...u,...t,id:a,dismissible:s,title:r}):u):this.addToast({title:r,...o,dismissible:s,id:a}),a},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const o=Promise.resolve(t instanceof Function?t():t);let a=r!==void 0,i;const s=o.then(async c=>{if(i=["resolve",c],D.isValidElement(c))a=!1,this.create({id:r,type:"default",message:c});else if(VP(c)&&!c.ok){a=!1;const l=typeof n.error=="function"?await n.error(`HTTP error! status: ${c.status}`):n.error,h=typeof n.description=="function"?await n.description(`HTTP error! status: ${c.status}`):n.description,y=typeof l=="object"&&!D.isValidElement(l)?l:{message:l};this.create({id:r,type:"error",description:h,...y})}else if(c instanceof Error){a=!1;const l=typeof n.error=="function"?await n.error(c):n.error,h=typeof n.description=="function"?await n.description(c):n.description,y=typeof l=="object"&&!D.isValidElement(l)?l:{message:l};this.create({id:r,type:"error",description:h,...y})}else if(n.success!==void 0){a=!1;const l=typeof n.success=="function"?await n.success(c):n.success,h=typeof n.description=="function"?await n.description(c):n.description,y=typeof l=="object"&&!D.isValidElement(l)?l:{message:l};this.create({id:r,type:"success",description:h,...y})}}).catch(async c=>{if(i=["reject",c],n.error!==void 0){a=!1;const d=typeof n.error=="function"?await n.error(c):n.error,l=typeof n.description=="function"?await n.description(c):n.description,m=typeof d=="object"&&!D.isValidElement(d)?d:{message:d};this.create({id:r,type:"error",description:l,...m})}}).finally(()=>{a&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),u=()=>new Promise((c,d)=>s.then(()=>i[0]==="reject"?d(i[1]):c(i[1])).catch(d));return typeof r!="string"&&typeof r!="number"?{unwrap:u}:Object.assign(r,{unwrap:u})},this.custom=(t,n)=>{const r=(n==null?void 0:n.id)||bu++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const an=new zP,HP=(e,t)=>{const n=(t==null?void 0:t.id)||bu++;return an.addToast({title:e,...t,id:n}),n},VP=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",WP=HP,BP=()=>an.toasts,jP=()=>an.getActiveToasts(),YP=Object.assign(WP,{success:an.success,info:an.info,warning:an.warning,error:an.error,custom:an.custom,message:an.message,promise:an.promise,dismiss:an.dismiss,loading:an.loading},{getHistory:BP,getToasts:jP});NP("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Ui(e){return e.label!==void 0}const UP=3,qP="24px",GP="16px",kp=4e3,KP=356,XP=14,ZP=45,QP=200;function Fn(...e){return e.filter(Boolean).join(" ")}function JP(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const eD=e=>{var t,n,r,o,a,i,s,u,c;const{invert:d,toast:l,unstyled:h,interacting:m,setHeights:y,visibleToasts:w,heights:v,index:p,toasts:g,expanded:b,removeToast:C,defaultRichColors:x,closeButton:S,style:E,cancelButtonStyle:M,actionButtonStyle:k,className:T="",descriptionClassName:R="",duration:F,position:V,gap:$,expandByDefault:L,classNames:_,icons:H,closeButtonAriaLabel:N="Close toast"}=e,[z,B]=D.useState(null),[A,j]=D.useState(null),[Y,U]=D.useState(!1),[ne,te]=D.useState(!1),[J,G]=D.useState(!1),[q,Z]=D.useState(!1),[O,I]=D.useState(!1),[W,K]=D.useState(0),[oe,Q]=D.useState(0),ae=D.useRef(l.duration||F||kp),ee=D.useRef(null),ie=D.useRef(null),me=p===0,ye=p+1<=w,de=l.type,se=l.dismissible!==!1,He=l.className||"",Le=l.descriptionClassName||"",ge=D.useMemo(()=>v.findIndex(be=>be.toastId===l.id)||0,[v,l.id]),Ye=D.useMemo(()=>{var be;return(be=l.closeButton)!=null?be:S},[l.closeButton,S]),Fe=D.useMemo(()=>l.duration||F||kp,[l.duration,F]),ze=D.useRef(0),Ge=D.useRef(0),Ke=D.useRef(0),Ee=D.useRef(null),[$e,le]=V.split("-"),fe=D.useMemo(()=>v.reduce((be,We,Oe)=>Oe>=ge?be:be+We.height,0),[v,ge]),Pe=FP(),ue=l.invert||d,he=de==="loading";Ge.current=D.useMemo(()=>ge*$+fe,[ge,fe]),D.useEffect(()=>{ae.current=Fe},[Fe]),D.useEffect(()=>{U(!0)},[]),D.useEffect(()=>{const be=ie.current;if(be){const We=be.getBoundingClientRect().height;return Q(We),y(Oe=>[{toastId:l.id,height:We,position:l.position},...Oe]),()=>y(Oe=>Oe.filter(Ce=>Ce.toastId!==l.id))}},[y,l.id]),D.useLayoutEffect(()=>{if(!Y)return;const be=ie.current,We=be.style.height;be.style.height="auto";const Oe=be.getBoundingClientRect().height;be.style.height=We,Q(Oe),y(Ce=>Ce.find(pe=>pe.toastId===l.id)?Ce.map(pe=>pe.toastId===l.id?{...pe,height:Oe}:pe):[{toastId:l.id,height:Oe,position:l.position},...Ce])},[Y,l.title,l.description,y,l.id,l.jsx,l.action,l.cancel]);const Ue=D.useCallback(()=>{te(!0),K(Ge.current),y(be=>be.filter(We=>We.toastId!==l.id)),setTimeout(()=>{C(l)},QP)},[l,C,y,Ge]);D.useEffect(()=>{if(l.promise&&de==="loading"||l.duration===1/0||l.type==="loading")return;let be;return b||m||Pe?(()=>{if(Ke.current<ze.current){const Ce=new Date().getTime()-ze.current;ae.current=ae.current-Ce}Ke.current=new Date().getTime()})():(()=>{ae.current!==1/0&&(ze.current=new Date().getTime(),be=setTimeout(()=>{l.onAutoClose==null||l.onAutoClose.call(l,l),Ue()},ae.current))})(),()=>clearTimeout(be)},[b,m,l,de,Pe,Ue]),D.useEffect(()=>{l.delete&&(Ue(),l.onDismiss==null||l.onDismiss.call(l,l))},[Ue,l.delete]);function Je(){var be;if(H!=null&&H.loading){var We;return D.createElement("div",{className:Fn(_==null?void 0:_.loader,l==null||(We=l.classNames)==null?void 0:We.loader,"sonner-loader"),"data-visible":de==="loading"},H.loading)}return D.createElement(TP,{className:Fn(_==null?void 0:_.loader,l==null||(be=l.classNames)==null?void 0:be.loader),visible:de==="loading"})}const nt=l.icon||(H==null?void 0:H[de])||_P(de);var yt,tt;return D.createElement("li",{tabIndex:0,ref:ie,className:Fn(T,He,_==null?void 0:_.toast,l==null||(t=l.classNames)==null?void 0:t.toast,_==null?void 0:_.default,_==null?void 0:_[de],l==null||(n=l.classNames)==null?void 0:n[de]),"data-sonner-toast":"","data-rich-colors":(yt=l.richColors)!=null?yt:x,"data-styled":!(l.jsx||l.unstyled||h),"data-mounted":Y,"data-promise":!!l.promise,"data-swiped":O,"data-removed":ne,"data-visible":ye,"data-y-position":$e,"data-x-position":le,"data-index":p,"data-front":me,"data-swiping":J,"data-dismissible":se,"data-type":de,"data-invert":ue,"data-swipe-out":q,"data-swipe-direction":A,"data-expanded":!!(b||L&&Y),style:{"--index":p,"--toasts-before":p,"--z-index":g.length-p,"--offset":`${ne?W:Ge.current}px`,"--initial-height":L?"auto":`${oe}px`,...E,...l.style},onDragEnd:()=>{G(!1),B(null),Ee.current=null},onPointerDown:be=>{be.button!==2&&(he||!se||(ee.current=new Date,K(Ge.current),be.target.setPointerCapture(be.pointerId),be.target.tagName!=="BUTTON"&&(G(!0),Ee.current={x:be.clientX,y:be.clientY})))},onPointerUp:()=>{var be,We,Oe;if(q||!se)return;Ee.current=null;const Ce=Number(((be=ie.current)==null?void 0:be.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Se=Number(((We=ie.current)==null?void 0:We.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),pe=new Date().getTime()-((Oe=ee.current)==null?void 0:Oe.getTime()),Ve=z==="x"?Ce:Se,dt=Math.abs(Ve)/pe;if(Math.abs(Ve)>=ZP||dt>.11){K(Ge.current),l.onDismiss==null||l.onDismiss.call(l,l),j(z==="x"?Ce>0?"right":"left":Se>0?"down":"up"),Ue(),Z(!0);return}else{var ut,rt;(ut=ie.current)==null||ut.style.setProperty("--swipe-amount-x","0px"),(rt=ie.current)==null||rt.style.setProperty("--swipe-amount-y","0px")}I(!1),G(!1),B(null)},onPointerMove:be=>{var We,Oe,Ce;if(!Ee.current||!se||((We=window.getSelection())==null?void 0:We.toString().length)>0)return;const pe=be.clientY-Ee.current.y,Ve=be.clientX-Ee.current.x;var dt;const ut=(dt=e.swipeDirections)!=null?dt:JP(V);!z&&(Math.abs(Ve)>1||Math.abs(pe)>1)&&B(Math.abs(Ve)>Math.abs(pe)?"x":"y");let rt={x:0,y:0};const Jt=xt=>1/(1.5+Math.abs(xt)/20);if(z==="y"){if(ut.includes("top")||ut.includes("bottom"))if(ut.includes("top")&&pe<0||ut.includes("bottom")&&pe>0)rt.y=pe;else{const xt=pe*Jt(pe);rt.y=Math.abs(xt)<Math.abs(pe)?xt:pe}}else if(z==="x"&&(ut.includes("left")||ut.includes("right")))if(ut.includes("left")&&Ve<0||ut.includes("right")&&Ve>0)rt.x=Ve;else{const xt=Ve*Jt(Ve);rt.x=Math.abs(xt)<Math.abs(Ve)?xt:Ve}(Math.abs(rt.x)>0||Math.abs(rt.y)>0)&&I(!0),(Oe=ie.current)==null||Oe.style.setProperty("--swipe-amount-x",`${rt.x}px`),(Ce=ie.current)==null||Ce.style.setProperty("--swipe-amount-y",`${rt.y}px`)}},Ye&&!l.jsx&&de!=="loading"?D.createElement("button",{"aria-label":N,"data-disabled":he,"data-close-button":!0,onClick:he||!se?()=>{}:()=>{Ue(),l.onDismiss==null||l.onDismiss.call(l,l)},className:Fn(_==null?void 0:_.closeButton,l==null||(r=l.classNames)==null?void 0:r.closeButton)},(tt=H==null?void 0:H.close)!=null?tt:$P):null,(de||l.icon||l.promise)&&l.icon!==null&&((H==null?void 0:H[de])!==null||l.icon)?D.createElement("div",{"data-icon":"",className:Fn(_==null?void 0:_.icon,l==null||(o=l.classNames)==null?void 0:o.icon)},l.promise||l.type==="loading"&&!l.icon?l.icon||Je():null,l.type!=="loading"?nt:null):null,D.createElement("div",{"data-content":"",className:Fn(_==null?void 0:_.content,l==null||(a=l.classNames)==null?void 0:a.content)},D.createElement("div",{"data-title":"",className:Fn(_==null?void 0:_.title,l==null||(i=l.classNames)==null?void 0:i.title)},l.jsx?l.jsx:typeof l.title=="function"?l.title():l.title),l.description?D.createElement("div",{"data-description":"",className:Fn(R,Le,_==null?void 0:_.description,l==null||(s=l.classNames)==null?void 0:s.description)},typeof l.description=="function"?l.description():l.description):null),D.isValidElement(l.cancel)?l.cancel:l.cancel&&Ui(l.cancel)?D.createElement("button",{"data-button":!0,"data-cancel":!0,style:l.cancelButtonStyle||M,onClick:be=>{Ui(l.cancel)&&se&&(l.cancel.onClick==null||l.cancel.onClick.call(l.cancel,be),Ue())},className:Fn(_==null?void 0:_.cancelButton,l==null||(u=l.classNames)==null?void 0:u.cancelButton)},l.cancel.label):null,D.isValidElement(l.action)?l.action:l.action&&Ui(l.action)?D.createElement("button",{"data-button":!0,"data-action":!0,style:l.actionButtonStyle||k,onClick:be=>{Ui(l.action)&&(l.action.onClick==null||l.action.onClick.call(l.action,be),!be.defaultPrevented&&Ue())},className:Fn(_==null?void 0:_.actionButton,l==null||(c=l.classNames)==null?void 0:c.actionButton)},l.action.label):null)};function Np(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function tD(e,t){const n={};return[e,t].forEach((r,o)=>{const a=o===1,i=a?"--mobile-offset":"--offset",s=a?GP:qP;function u(c){["top","right","bottom","left"].forEach(d=>{n[`${i}-${d}`]=typeof c=="number"?`${c}px`:c})}typeof r=="number"||typeof r=="string"?u(r):typeof r=="object"?["top","right","bottom","left"].forEach(c=>{r[c]===void 0?n[`${i}-${c}`]=s:n[`${i}-${c}`]=typeof r[c]=="number"?`${r[c]}px`:r[c]}):u(s)}),n}const nD=D.forwardRef(function(t,n){const{invert:r,position:o="bottom-right",hotkey:a=["altKey","KeyT"],expand:i,closeButton:s,className:u,offset:c,mobileOffset:d,theme:l="light",richColors:h,duration:m,style:y,visibleToasts:w=UP,toastOptions:v,dir:p=Np(),gap:g=XP,icons:b,containerAriaLabel:C="Notifications"}=t,[x,S]=D.useState([]),E=D.useMemo(()=>Array.from(new Set([o].concat(x.filter(A=>A.position).map(A=>A.position)))),[x,o]),[M,k]=D.useState([]),[T,R]=D.useState(!1),[F,V]=D.useState(!1),[$,L]=D.useState(l!=="system"?l:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),_=D.useRef(null),H=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),N=D.useRef(null),z=D.useRef(!1),B=D.useCallback(A=>{S(j=>{var Y;return(Y=j.find(U=>U.id===A.id))!=null&&Y.delete||an.dismiss(A.id),j.filter(({id:U})=>U!==A.id)})},[]);return D.useEffect(()=>an.subscribe(A=>{if(A.dismiss){requestAnimationFrame(()=>{S(j=>j.map(Y=>Y.id===A.id?{...Y,delete:!0}:Y))});return}setTimeout(()=>{It.flushSync(()=>{S(j=>{const Y=j.findIndex(U=>U.id===A.id);return Y!==-1?[...j.slice(0,Y),{...j[Y],...A},...j.slice(Y+1)]:[A,...j]})})})}),[x]),D.useEffect(()=>{if(l!=="system"){L(l);return}if(l==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?L("dark"):L("light")),typeof window>"u")return;const A=window.matchMedia("(prefers-color-scheme: dark)");try{A.addEventListener("change",({matches:j})=>{L(j?"dark":"light")})}catch{A.addListener(({matches:Y})=>{try{L(Y?"dark":"light")}catch(U){console.error(U)}})}},[l]),D.useEffect(()=>{x.length<=1&&R(!1)},[x]),D.useEffect(()=>{const A=j=>{var Y;if(a.every(te=>j[te]||j.code===te)){var ne;R(!0),(ne=_.current)==null||ne.focus()}j.code==="Escape"&&(document.activeElement===_.current||(Y=_.current)!=null&&Y.contains(document.activeElement))&&R(!1)};return document.addEventListener("keydown",A),()=>document.removeEventListener("keydown",A)},[a]),D.useEffect(()=>{if(_.current)return()=>{N.current&&(N.current.focus({preventScroll:!0}),N.current=null,z.current=!1)}},[_.current]),D.createElement("section",{ref:n,"aria-label":`${C} ${H}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},E.map((A,j)=>{var Y;const[U,ne]=A.split("-");return x.length?D.createElement("ol",{key:A,dir:p==="auto"?Np():p,tabIndex:-1,ref:_,className:u,"data-sonner-toaster":!0,"data-sonner-theme":$,"data-y-position":U,"data-x-position":ne,style:{"--front-toast-height":`${((Y=M[0])==null?void 0:Y.height)||0}px`,"--width":`${KP}px`,"--gap":`${g}px`,...y,...tD(c,d)},onBlur:te=>{z.current&&!te.currentTarget.contains(te.relatedTarget)&&(z.current=!1,N.current&&(N.current.focus({preventScroll:!0}),N.current=null))},onFocus:te=>{te.target instanceof HTMLElement&&te.target.dataset.dismissible==="false"||z.current||(z.current=!0,N.current=te.relatedTarget)},onMouseEnter:()=>R(!0),onMouseMove:()=>R(!0),onMouseLeave:()=>{F||R(!1)},onDragEnd:()=>R(!1),onPointerDown:te=>{te.target instanceof HTMLElement&&te.target.dataset.dismissible==="false"||V(!0)},onPointerUp:()=>V(!1)},x.filter(te=>!te.position&&j===0||te.position===A).map((te,J)=>{var G,q;return D.createElement(eD,{key:te.id,icons:b,index:J,toast:te,defaultRichColors:h,duration:(G=v==null?void 0:v.duration)!=null?G:m,className:v==null?void 0:v.className,descriptionClassName:v==null?void 0:v.descriptionClassName,invert:r,visibleToasts:w,closeButton:(q=v==null?void 0:v.closeButton)!=null?q:s,interacting:F,position:A,style:v==null?void 0:v.style,unstyled:v==null?void 0:v.unstyled,classNames:v==null?void 0:v.classNames,cancelButtonStyle:v==null?void 0:v.cancelButtonStyle,actionButtonStyle:v==null?void 0:v.actionButtonStyle,closeButtonAriaLabel:v==null?void 0:v.closeButtonAriaLabel,removeToast:B,toasts:x.filter(Z=>Z.position==te.position),heights:M.filter(Z=>Z.position==te.position),setHeights:k,expandByDefault:i,gap:g,expanded:T,swipeDirections:t.swipeDirections})})):null}))});function rD({visibleToasts:e,...t}){return P.jsx(nD,{className:"dark:![&_[data-description]]:univer-text-gray-200 [&_[data-description]]:univer-text-sm [&_[data-description]]:univer-text-gray-600 [&_[data-icon]>svg]:univer-relative [&_[data-icon]>svg]:univer-top-1 [&_[data-icon]]:univer-self-baseline [&_[data-sonner-toast]]:univer-shadow-md [&_[data-title]]:univer-text-sm [&_[data-title]]:univer-text-gray-900",toastOptions:{classNames:{content:"univer-leading-normal",success:"[&_[data-icon]]:univer-text-green-500",info:"[&_[data-icon]]:univer-text-primary-600",error:"[&_[data-icon]]:univer-text-red-500",warning:"[&_[data-icon]]:univer-text-yellow-500"}},visibleToasts:e!=null?e:5,...t})}var _p=f.forwardRef(function(e,t){var n=e.height,r=e.offsetY,o=e.offsetX,a=e.children,i=e.prefixCls,s=e.onInnerResize,u=e.innerProps,c=e.rtl,d=e.extra,l={},h={display:"flex",flexDirection:"column"};return r!==void 0&&(l={height:n,position:"relative",overflow:"hidden"},h=re(re({},h),{},ce(ce(ce(ce(ce({transform:"translateY(".concat(r,"px)")},c?"marginRight":"marginLeft",-o),"position","absolute"),"left",0),"right",0),"top",0))),f.createElement("div",{style:l},f.createElement(jn,{onResize:function(y){var w=y.offsetHeight;w&&s&&s()}},f.createElement("div",_e({style:h,className:Xe(ce({},"".concat(i,"-holder-inner"),i)),ref:t},u),a,d)))});_p.displayName="Filler";function oD(e){var t=e.children,n=e.setRef,r=f.useCallback(function(o){n(o)},[]);return f.cloneElement(t,{ref:r})}function aD(e,t,n,r,o,a,i,s){var u=s.getKey;return e.slice(t,n+1).map(function(c,d){var l=t+d,h=i(c,l,{style:{width:r},offsetX:o}),m=u(c);return f.createElement(oD,{key:m,setRef:function(w){return a(c,w)}},h)})}function iD(e,t,n){var r=e.length,o=t.length,a,i;if(r===0&&o===0)return null;r<o?(a=e,i=t):(a=t,i=e);var s={__EMPTY_ITEM__:!0};function u(y){return y!==void 0?n(y):s}for(var c=null,d=Math.abs(r-o)!==1,l=0;l<i.length;l+=1){var h=u(a[l]),m=u(i[l]);if(h!==m){c=l,d=d||h!==u(i[l+1]);break}}return c===null?null:{index:c,multiple:d}}function sD(e,t,n){var r=f.useState(e),o=X(r,2),a=o[0],i=o[1],s=f.useState(null),u=X(s,2),c=u[0],d=u[1];return f.useEffect(function(){var l=iD(a||[],e||[],t);(l==null?void 0:l.index)!==void 0&&d(e[l.index]),i(e)},[e]),[c]}var Op=(typeof navigator>"u"?"undefined":Ct(navigator))==="object"&&/Firefox/i.test(navigator.userAgent);const Tp=function(e,t,n,r){var o=D.useRef(!1),a=D.useRef(null);function i(){clearTimeout(a.current),o.current=!0,a.current=setTimeout(function(){o.current=!1},50)}var s=D.useRef({top:e,bottom:t,left:n,right:r});return s.current.top=e,s.current.bottom=t,s.current.left=n,s.current.right=r,function(u,c){var d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,l=u?c<0&&s.current.left||c>0&&s.current.right:c<0&&s.current.top||c>0&&s.current.bottom;return d&&l?(clearTimeout(a.current),o.current=!1):(!l||o.current)&&i(),!o.current&&l}};function lD(e,t,n,r,o,a,i){var s=D.useRef(0),u=D.useRef(null),c=D.useRef(null),d=D.useRef(!1),l=Tp(t,n,r,o);function h(g,b){if(mt.cancel(u.current),!l(!1,b)){var C=g;if(!C._virtualHandled)C._virtualHandled=!0;else return;s.current+=b,c.current=b,Op||C.preventDefault(),u.current=mt(function(){var x=d.current?10:1;i(s.current*x,!1),s.current=0})}}function m(g,b){i(b,!0),Op||g.preventDefault()}var y=D.useRef(null),w=D.useRef(null);function v(g){if(e){mt.cancel(w.current),w.current=mt(function(){y.current=null},2);var b=g.deltaX,C=g.deltaY,x=g.shiftKey,S=b,E=C;(y.current==="sx"||!y.current&&x&&C&&!b)&&(S=C,E=0,y.current="sx");var M=Math.abs(S),k=Math.abs(E);y.current===null&&(y.current=a&&M>k?"x":"y"),y.current==="y"?h(g,E):m(g,S)}}function p(g){e&&(d.current=g.detail===c.current)}return[v,p]}function uD(e,t,n,r){var o=f.useMemo(function(){return[new Map,[]]},[e,n.id,r]),a=X(o,2),i=a[0],s=a[1],u=function(d){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:d,h=i.get(d),m=i.get(l);if(h===void 0||m===void 0)for(var y=e.length,w=s.length;w<y;w+=1){var v,p=e[w],g=t(p);i.set(g,w);var b=(v=n.get(g))!==null&&v!==void 0?v:r;if(s[w]=(s[w-1]||0)+b,g===d&&(h=w),g===l&&(m=w),h!==void 0&&m!==void 0)break}return{top:s[h-1]||0,bottom:s[m]}};return u}var cD=function(){function e(){qr(this,e),ce(this,"maps",void 0),ce(this,"id",0),ce(this,"diffRecords",new Map),this.maps=Object.create(null)}return Gr(e,[{key:"set",value:function(n,r){this.diffRecords.set(n,this.maps[n]),this.maps[n]=r,this.id+=1}},{key:"get",value:function(n){return this.maps[n]}},{key:"resetRecord",value:function(){this.diffRecords.clear()}},{key:"getRecord",value:function(){return this.diffRecords}}]),e}();function Ip(e){var t=parseFloat(e);return isNaN(t)?0:t}function dD(e,t,n){var r=f.useState(0),o=X(r,2),a=o[0],i=o[1],s=D.useRef(new Map),u=D.useRef(new cD),c=D.useRef(0);function d(){c.current+=1}function l(){var m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;d();var y=function(){var p=!1;s.current.forEach(function(g,b){if(g&&g.offsetParent){var C=g.offsetHeight,x=getComputedStyle(g),S=x.marginTop,E=x.marginBottom,M=Ip(S),k=Ip(E),T=C+M+k;u.current.get(b)!==T&&(u.current.set(b,T),p=!0)}}),p&&i(function(g){return g+1})};if(m)y();else{c.current+=1;var w=c.current;Promise.resolve().then(function(){w===c.current&&y()})}}function h(m,y){var w=e(m);s.current.get(w),y?(s.current.set(w,y),l()):s.current.delete(w)}return D.useEffect(function(){return d},[]),[h,l,u.current,a]}var Rp=14/15;function fD(e,t,n){var r=D.useRef(!1),o=D.useRef(0),a=D.useRef(0),i=D.useRef(null),s=D.useRef(null),u,c=function(m){if(r.current){var y=Math.ceil(m.touches[0].pageX),w=Math.ceil(m.touches[0].pageY),v=o.current-y,p=a.current-w,g=Math.abs(v)>Math.abs(p);g?o.current=y:a.current=w;var b=n(g,g?v:p,!1,m);b&&m.preventDefault(),clearInterval(s.current),b&&(s.current=setInterval(function(){g?v*=Rp:p*=Rp;var C=Math.floor(g?v:p);(!n(g,C,!0)||Math.abs(C)<=.1)&&clearInterval(s.current)},16))}},d=function(){r.current=!1,u()},l=function(m){u(),m.touches.length===1&&!r.current&&(r.current=!0,o.current=Math.ceil(m.touches[0].pageX),a.current=Math.ceil(m.touches[0].pageY),i.current=m.target,i.current.addEventListener("touchmove",c,{passive:!1}),i.current.addEventListener("touchend",d,{passive:!0}))};u=function(){i.current&&(i.current.removeEventListener("touchmove",c),i.current.removeEventListener("touchend",d))},ht(function(){return e&&t.current.addEventListener("touchstart",l,{passive:!0}),function(){var h;(h=t.current)===null||h===void 0||h.removeEventListener("touchstart",l),u(),clearInterval(s.current)}},[e])}function Ap(e){return Math.floor(Math.pow(e,.5))}function wu(e,t){var n="touches"in e?e.touches[0]:e;return n[t?"pageX":"pageY"]-window[t?"scrollX":"scrollY"]}function vD(e,t,n){f.useEffect(function(){var r=t.current;if(e&&r){var o=!1,a,i,s=function(){mt.cancel(a)},u=function h(){s(),a=mt(function(){n(i),h()})},c=function(m){if(!(m.target.draggable||m.button!==0)){var y=m;y._virtualHandled||(y._virtualHandled=!0,o=!0)}},d=function(){o=!1,s()},l=function(m){if(o){var y=wu(m,!1),w=r.getBoundingClientRect(),v=w.top,p=w.bottom;if(y<=v){var g=v-y;i=-Ap(g),u()}else if(y>=p){var b=y-p;i=Ap(b),u()}else s()}};return r.addEventListener("mousedown",c),r.ownerDocument.addEventListener("mouseup",d),r.ownerDocument.addEventListener("mousemove",l),function(){r.removeEventListener("mousedown",c),r.ownerDocument.removeEventListener("mouseup",d),r.ownerDocument.removeEventListener("mousemove",l),s()}}},[e])}var mD=10;function hD(e,t,n,r,o,a,i,s){var u=f.useRef(),c=f.useState(null),d=X(c,2),l=d[0],h=d[1];return ht(function(){if(l&&l.times<mD){if(!e.current){h(function(z){return re({},z)});return}a();var m=l.targetAlign,y=l.originAlign,w=l.index,v=l.offset,p=e.current.clientHeight,g=!1,b=m,C=null;if(p){for(var x=m||y,S=0,E=0,M=0,k=Math.min(t.length-1,w),T=0;T<=k;T+=1){var R=o(t[T]);E=S;var F=n.get(R);M=E+(F===void 0?r:F),S=M}for(var V=x==="top"?v:p-v,$=k;$>=0;$-=1){var L=o(t[$]),_=n.get(L);if(_===void 0){g=!0;break}if(V-=_,V<=0)break}switch(x){case"top":C=E-v;break;case"bottom":C=M-p+v;break;default:{var H=e.current.scrollTop,N=H+p;E<H?b="top":M>N&&(b="bottom")}}C!==null&&i(C),C!==l.lastTop&&(g=!0)}g&&h(re(re({},l),{},{times:l.times+1,targetAlign:b,lastTop:C}))}},[l,e.current]),function(m){if(m==null){s();return}if(mt.cancel(u.current),typeof m=="number")i(m);else if(m&&Ct(m)==="object"){var y,w=m.align;"index"in m?y=m.index:y=t.findIndex(function(g){return o(g)===m.key});var v=m.offset,p=v===void 0?0:v;h({times:0,index:y,offset:p,originAlign:w})}}}var Lp=f.forwardRef(function(e,t){var n=e.prefixCls,r=e.rtl,o=e.scrollOffset,a=e.scrollRange,i=e.onStartMove,s=e.onStopMove,u=e.onScroll,c=e.horizontal,d=e.spinSize,l=e.containerSize,h=e.style,m=e.thumbStyle,y=e.showScrollBar,w=f.useState(!1),v=X(w,2),p=v[0],g=v[1],b=f.useState(null),C=X(b,2),x=C[0],S=C[1],E=f.useState(null),M=X(E,2),k=M[0],T=M[1],R=!r,F=f.useRef(),V=f.useRef(),$=f.useState(y),L=X($,2),_=L[0],H=L[1],N=f.useRef(),z=function(){y===!0||y===!1||(clearTimeout(N.current),H(!0),N.current=setTimeout(function(){H(!1)},3e3))},B=a-l||0,A=l-d||0,j=f.useMemo(function(){if(o===0||B===0)return 0;var O=o/B;return O*A},[o,B,A]),Y=function(I){I.stopPropagation(),I.preventDefault()},U=f.useRef({top:j,dragging:p,pageY:x,startTop:k});U.current={top:j,dragging:p,pageY:x,startTop:k};var ne=function(I){g(!0),S(wu(I,c)),T(U.current.top),i(),I.stopPropagation(),I.preventDefault()};f.useEffect(function(){var O=function(oe){oe.preventDefault()},I=F.current,W=V.current;return I.addEventListener("touchstart",O,{passive:!1}),W.addEventListener("touchstart",ne,{passive:!1}),function(){I.removeEventListener("touchstart",O),W.removeEventListener("touchstart",ne)}},[]);var te=f.useRef();te.current=B;var J=f.useRef();J.current=A,f.useEffect(function(){if(p){var O,I=function(oe){var Q=U.current,ae=Q.dragging,ee=Q.pageY,ie=Q.startTop;mt.cancel(O);var me=F.current.getBoundingClientRect(),ye=l/(c?me.width:me.height);if(ae){var de=(wu(oe,c)-ee)*ye,se=ie;!R&&c?se-=de:se+=de;var He=te.current,Le=J.current,ge=Le?se/Le:0,Ye=Math.ceil(ge*He);Ye=Math.max(Ye,0),Ye=Math.min(Ye,He),O=mt(function(){u(Ye,c)})}},W=function(){g(!1),s()};return window.addEventListener("mousemove",I,{passive:!0}),window.addEventListener("touchmove",I,{passive:!0}),window.addEventListener("mouseup",W,{passive:!0}),window.addEventListener("touchend",W,{passive:!0}),function(){window.removeEventListener("mousemove",I),window.removeEventListener("touchmove",I),window.removeEventListener("mouseup",W),window.removeEventListener("touchend",W),mt.cancel(O)}}},[p]),f.useEffect(function(){return z(),function(){clearTimeout(N.current)}},[o]),f.useImperativeHandle(t,function(){return{delayHidden:z}});var G="".concat(n,"-scrollbar"),q={position:"absolute",visibility:_?null:"hidden"},Z={position:"absolute",background:"rgba(0, 0, 0, 0.5)",borderRadius:99,cursor:"pointer",userSelect:"none"};return c?(q.height=8,q.left=0,q.right=0,q.bottom=0,Z.height="100%",Z.width=d,R?Z.left=j:Z.right=j):(q.width=8,q.top=0,q.bottom=0,R?q.right=0:q.left=0,Z.width="100%",Z.height=d,Z.top=j),f.createElement("div",{ref:F,className:Xe(G,ce(ce(ce({},"".concat(G,"-horizontal"),c),"".concat(G,"-vertical"),!c),"".concat(G,"-visible"),_)),style:re(re({},q),h),onMouseDown:Y,onMouseMove:z},f.createElement("div",{ref:V,className:Xe("".concat(G,"-thumb"),ce({},"".concat(G,"-thumb-moving"),p)),style:re(re({},Z),m),onMouseDown:ne}))}),pD=20;function $p(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=e/t*e;return isNaN(n)&&(n=0),n=Math.max(n,pD),Math.floor(n)}var gD=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","direction","scrollWidth","component","onScroll","onVirtualScroll","onVisibleChange","innerProps","extraRender","styles","showScrollBar"],yD=[],bD={overflowY:"auto",overflowAnchor:"none"};function wD(e,t){var n=e.prefixCls,r=n===void 0?"rc-virtual-list":n,o=e.className,a=e.height,i=e.itemHeight,s=e.fullHeight,u=s===void 0?!0:s,c=e.style,d=e.data,l=e.children,h=e.itemKey,m=e.virtual,y=e.direction,w=e.scrollWidth,v=e.component,p=v===void 0?"div":v,g=e.onScroll,b=e.onVirtualScroll,C=e.onVisibleChange,x=e.innerProps,S=e.extraRender,E=e.styles,M=e.showScrollBar,k=M===void 0?"optional":M,T=pt(e,gD),R=f.useCallback(function(we){return typeof h=="function"?h(we):we==null?void 0:we[h]},[h]),F=dD(R),V=X(F,4),$=V[0],L=V[1],_=V[2],H=V[3],N=!!(m!==!1&&a&&i),z=f.useMemo(function(){return Object.values(_.maps).reduce(function(we,Me){return we+Me},0)},[_.id,_.maps]),B=N&&d&&(Math.max(i*d.length,z)>a||!!w),A=y==="rtl",j=Xe(r,ce({},"".concat(r,"-rtl"),A),o),Y=d||yD,U=D.useRef(),ne=D.useRef(),te=D.useRef(),J=D.useState(0),G=X(J,2),q=G[0],Z=G[1],O=D.useState(0),I=X(O,2),W=I[0],K=I[1],oe=D.useState(!1),Q=X(oe,2),ae=Q[0],ee=Q[1],ie=function(){ee(!0)},me=function(){ee(!1)},ye={getKey:R};function de(we){Z(function(Me){var Be;typeof we=="function"?Be=we(Me):Be=we;var qe=be(Be);return U.current.scrollTop=qe,qe})}var se=D.useRef({start:0,end:Y.length}),He=D.useRef(),Le=sD(Y,R),ge=X(Le,1),Ye=ge[0];He.current=Ye;var Fe=f.useMemo(function(){if(!N)return{scrollHeight:void 0,start:0,end:Y.length-1,offset:void 0};if(!B){var we;return{scrollHeight:((we=ne.current)===null||we===void 0?void 0:we.offsetHeight)||0,start:0,end:Y.length-1,offset:void 0}}for(var Me=0,Be,qe,it,Ft=Y.length,Rt=0;Rt<Ft;Rt+=1){var tn=Y[Rt],nn=R(tn),Xt=_.get(nn),zt=Me+(Xt===void 0?i:Xt);zt>=q&&Be===void 0&&(Be=Rt,qe=Me),zt>q+a&&it===void 0&&(it=Rt),Me=zt}return Be===void 0&&(Be=0,qe=0,it=Math.ceil(a/i)),it===void 0&&(it=Y.length-1),it=Math.min(it+1,Y.length-1),{scrollHeight:Me,start:Be,end:it,offset:qe}},[B,N,q,Y,H,a]),ze=Fe.scrollHeight,Ge=Fe.start,Ke=Fe.end,Ee=Fe.offset;se.current.start=Ge,se.current.end=Ke,f.useLayoutEffect(function(){var we=_.getRecord();if(we.size===1){var Me=Array.from(we.keys())[0],Be=we.get(Me),qe=Y[Ge];if(qe&&Be===void 0){var it=R(qe);if(it===Me){var Ft=_.get(Me),Rt=Ft-i;de(function(tn){return tn+Rt})}}}_.resetRecord()},[ze]);var $e=f.useState({width:0,height:a}),le=X($e,2),fe=le[0],Pe=le[1],ue=function(Me){Pe({width:Me.offsetWidth,height:Me.offsetHeight})},he=D.useRef(),Ue=D.useRef(),Je=f.useMemo(function(){return $p(fe.width,w)},[fe.width,w]),nt=f.useMemo(function(){return $p(fe.height,ze)},[fe.height,ze]),yt=ze-a,tt=D.useRef(yt);tt.current=yt;function be(we){var Me=we;return Number.isNaN(tt.current)||(Me=Math.min(Me,tt.current)),Me=Math.max(Me,0),Me}var We=q<=0,Oe=q>=yt,Ce=W<=0,Se=W>=w,pe=Tp(We,Oe,Ce,Se),Ve=function(){return{x:A?-W:W,y:q}},dt=D.useRef(Ve()),ut=ct(function(we){if(b){var Me=re(re({},Ve()),we);(dt.current.x!==Me.x||dt.current.y!==Me.y)&&(b(Me),dt.current=Me)}});function rt(we,Me){var Be=we;Me?(It.flushSync(function(){K(Be)}),ut()):de(Be)}function Jt(we){var Me=we.currentTarget.scrollTop;Me!==q&&de(Me),g==null||g(we),ut()}var xt=function(Me){var Be=Me,qe=w?w-fe.width:0;return Be=Math.max(Be,0),Be=Math.min(Be,qe),Be},Vt=ct(function(we,Me){Me?(It.flushSync(function(){K(function(Be){var qe=Be+(A?-we:we);return xt(qe)})}),ut()):de(function(Be){var qe=Be+we;return qe})}),en=lD(N,We,Oe,Ce,Se,!!w,Vt),dn=X(en,2),Wt=dn[0],_t=dn[1];fD(N,U,function(we,Me,Be,qe){var it=qe;return pe(we,Me,Be)?!1:!it||!it._virtualHandled?(it&&(it._virtualHandled=!0),Wt({preventDefault:function(){},deltaX:we?Me:0,deltaY:we?0:Me}),!0):!1}),vD(B,U,function(we){de(function(Me){return Me+we})}),ht(function(){function we(Be){var qe=We&&Be.detail<0,it=Oe&&Be.detail>0;N&&!qe&&!it&&Be.preventDefault()}var Me=U.current;return Me.addEventListener("wheel",Wt,{passive:!1}),Me.addEventListener("DOMMouseScroll",_t,{passive:!0}),Me.addEventListener("MozMousePixelScroll",we,{passive:!1}),function(){Me.removeEventListener("wheel",Wt),Me.removeEventListener("DOMMouseScroll",_t),Me.removeEventListener("MozMousePixelScroll",we)}},[N,We,Oe]),ht(function(){if(w){var we=xt(W);K(we),ut({x:we})}},[fe.width,w]);var Kt=function(){var Me,Be;(Me=he.current)===null||Me===void 0||Me.delayHidden(),(Be=Ue.current)===null||Be===void 0||Be.delayHidden()},Et=hD(U,Y,_,i,R,function(){return L(!0)},de,Kt);f.useImperativeHandle(t,function(){return{nativeElement:te.current,getScrollInfo:Ve,scrollTo:function(Me){function Be(qe){return qe&&Ct(qe)==="object"&&("left"in qe||"top"in qe)}Be(Me)?(Me.left!==void 0&&K(xt(Me.left)),Et(Me.top)):Et(Me)}}}),ht(function(){if(C){var we=Y.slice(Ge,Ke+1);C(we,Y)}},[Ge,Ke,Y]);var Bt=uD(Y,R,_,i),bt=S==null?void 0:S({start:Ge,end:Ke,virtual:B,offsetX:W,offsetY:Ee,rtl:A,getSize:Bt}),sn=aD(Y,Ge,Ke,w,W,$,l,ye),Ot=null;a&&(Ot=re(ce({},u?"height":"maxHeight",a),bD),N&&(Ot.overflowY="hidden",w&&(Ot.overflowX="hidden"),ae&&(Ot.pointerEvents="none")));var fn={};return A&&(fn.dir="rtl"),f.createElement("div",_e({ref:te,style:re(re({},c),{},{position:"relative"}),className:j},fn,T),f.createElement(jn,{onResize:ue},f.createElement(p,{className:"".concat(r,"-holder"),style:Ot,ref:U,onScroll:Jt,onMouseEnter:Kt},f.createElement(_p,{prefixCls:r,height:ze,offsetX:W,offsetY:Ee,scrollWidth:w,onInnerResize:L,ref:ne,innerProps:x,rtl:A,extra:bt},sn))),B&&ze>a&&f.createElement(Lp,{ref:he,prefixCls:r,scrollOffset:q,scrollRange:ze,rtl:A,onScroll:rt,onStartMove:ie,onStopMove:me,spinSize:nt,containerSize:fe.height,style:E==null?void 0:E.verticalScrollBar,thumbStyle:E==null?void 0:E.verticalScrollBarThumb,showScrollBar:k}),B&&w>fe.width&&f.createElement(Lp,{ref:Ue,prefixCls:r,scrollOffset:W,scrollRange:w,rtl:A,onScroll:rt,onStartMove:ie,onStopMove:me,spinSize:Je,containerSize:fe.width,horizontal:!0,style:E==null?void 0:E.horizontalScrollBar,thumbStyle:E==null?void 0:E.horizontalScrollBarThumb,showScrollBar:k}))}var Fp=f.forwardRef(wD);Fp.displayName="List";const zp=(e,t)=>{const n=[],r=o=>{var a;if(n.push(o.key),t===o.key||(a=o.children)!=null&&a.length&&o.children.some(r))return!0;n.pop()};return e.some(r),n},Hp=(e,t)=>{const n=t!=null?t:new Map;let r=e;return{findNodePathFromTreeWithCache:o=>{const a=n.get(o);if(a)return a;const i=zp(r,o);return i.map((u,c,d)=>{const l=[];for(let h=0;h<=c;h++)l.push(d[h]);return l}).reverse().forEach(u=>{const c=u[u.length-1];n.set(c,u)}),i},reset:o=>{n.clear(),o&&(r=o)}}},qi=(e,t)=>t.length?t.reduce((n,r)=>{const o=n.find(a=>a.key===r);return(o==null?void 0:o.children)||[]},e):e,CD=(e,t)=>{const n=t.slice(0),r=n.pop();return qi(e,n).find(a=>a.key===r)},xD=(e,t,n)=>{const r=new Set(t),o=n[n.length-1],a=qi(e,n);if(r.has(o)){if(a.length){const s=u=>{r.delete(u.key),u.children&&u.children.forEach(c=>s(c))};a.forEach(s)}n.map((s,u,c)=>{const d=[];for(let l=0;l<=u;l++)d.push(c[l]);return d}).reverse().some(s=>{const u=qi(e,s),c=s[s.length-1];if(u.every(d=>!r.has(d.key)))r.delete(c);else return!0;return!1})}else{const i=s=>{r.add(s.key),s.children&&s.children.forEach(u=>i(u))};n.forEach(s=>r.add(s)),a.length&&a.forEach(i)}return[...r]},SD=(e,t)=>{const n=t.children||[],r=o=>{var a;return(a=o.children)!=null&&a.length?!!o.children.every(r):e.has(o.key)};return n.length?n.some(o=>!r(o)):!1},ED=(e,t)=>{const n=[],r=Hp(e);return t.forEach(o=>{var s;const a=r.findNodePathFromTreeWithCache(o),i=CD(e,a);i&&((s=i.children)!=null&&s.length||n.push(i))}),n};var Vp=(e=>(e[e.ONLY_LEAF_NODE=0]="ONLY_LEAF_NODE",e[e.ALL=1]="ALL",e))(Vp||{});function Wp(e,t,n=1){const r=[];return e.forEach(o=>{r.push({...o,level:n}),o.children&&t.has(o.key)&&r.push(...Wp(o.children,t,n+1))}),r}function MD(e){const{data:t=[],defaultCache:n,style:r,defaultExpandAll:o=!1,selectionMode:a=1,valueGroup:i=[],onChange:s,onExpend:u,height:c=200,itemHeight:d=32,attachRender:l}=e,[h,m]=D.useState({}),y=D.useMemo(()=>new Set,[]),w=D.useMemo(()=>Hp(t,n),[t,n]),v=D.useMemo(()=>{const C=new Set;return i.forEach(x=>{w.findNodePathFromTreeWithCache(x).forEach(E=>C.add(E))}),C},[i,w]);D.useEffect(()=>{function C(x){var S;y.add(x.key),(S=x.children)==null||S.forEach(C)}o&&t.forEach(C),m({})},[o,t]);const p=D.useMemo(()=>Wp(t,y),[t,h,y]);function g(C){var x;(x=C.children)!=null&&x.length&&(y.has(C.key)?y.delete(C.key):y.add(C.key),m({})),!(a===0&&C.children)&&(u==null||u(C.key))}function b(C){const{title:x,key:S,level:E=0}=C,M=e.treeNodeClassName,k=y.has(S),T=v.has(S),R=SD(v,C);return P.jsx("div",{className:xe("univer-tree-list-item",M),style:{paddingLeft:`${E*20}px`},children:P.jsxs("div",{className:xe("univer-tree-list-item-content",{"univer-tree-list-item-content-selected":T}),children:[C.children&&C.children.length>0&&P.jsx("span",{className:xe("univer-tree-icon",{"univer-tree-icon-expand":k}),onClick:F=>{F.stopPropagation(),g(C)},children:P.jsx(Ou,{})}),P.jsx(dc,{checked:T&&!R,indeterminate:T&&R,onChange:()=>{s==null||s(C)}}),P.jsx("div",{className:"univer-tree-list-item-title",onClick:F=>{F.stopPropagation(),g(C)},children:P.jsx(hu,{className:"univer-w-full univer-truncate",showIfEllipsis:!0,placement:"top",title:x,children:P.jsx("span",{children:x})})}),l&&l(C)]})},S)}return P.jsx("section",{className:"univer-tree",children:P.jsx("div",{className:"univer-tree-list",style:r,children:P.jsx(Fp,{data:p,itemKey:C=>C.key,height:c,itemHeight:d,children:C=>b(C)})})})}const Gi=new WeakMap;function PD(e,t){let n=Gi.get(t);n||(n=jp.createRoot(t),Gi.set(t,n)),n.render(e)}function DD(e){const t=Gi.get(e);t&&(t.unmount(),Gi.delete(e))}const Cu=new Set;let Ki;function kD(e){return Ki||(Ki=new ResizeObserver((...t)=>{Cu.forEach(n=>n(...t))})),{observe(t,n){Cu.add(e),Ki.observe(t,n)},unobserve(t){Cu.delete(e),Ki.unobserve(t)}}}Object.defineProperty(ve,"defaultTheme",{enumerable:!0,get:()=>Pu.defaultTheme}),Object.defineProperty(ve,"greenTheme",{enumerable:!0,get:()=>Pu.greenTheme}),ve.Accordion=Ug,ve.Avatar=Gg,ve.Badge=sc,ve.Button=kn,ve.ButtonGroup=n0,ve.CascaderList=d0,ve.Checkbox=dc,ve.CheckboxGroup=f0,ve.ColorPicker=Qy,ve.ConfigContext=hn,ve.ConfigProvider=c0,ve.Confirm=eb,ve.DatePanel=xC,ve.DatePicker=SC,ve.DateRangePicker=EC,ve.Dialog=Ss,ve.DraggableList=WC,ve.Dropdown=xM,ve.DropdownLegacy=ZC,ve.DropdownMenu=Kl,ve.FormDualColumnLayout=MM,ve.FormLayout=EM,ve.Gallery=PM,ve.HoverCard=HM,ve.Input=Bh,ve.InputNumber=WM,ve.KBD=BM,ve.Menu=J2,ve.MenuItem=eP,ve.MenuItemGroup=nP,ve.MessageType=bp,ve.Messager=lP,ve.MultipleSelect=CP,ve.Pager=Rh,ve.Popup=hP,ve.Radio=gP,ve.RadioGroup=pP,ve.ReactGridLayout=Gv,ve.Segmented=yP,ve.Select=wP,ve.SelectList=bP,ve.Separator=PP,ve.SubMenu=tP,ve.Switch=DP,ve.Textarea=kP,ve.TinyMenuGroup=rP,ve.Toaster=rD,ve.Tooltip=hu,ve.Tree=MD,ve.TreeSelectionMode=Vp,ve.borderBottomClassName=i0,ve.borderClassName=mn,ve.borderLeftBottomClassName=r0,ve.borderLeftClassName=o0,ve.borderRightClassName=s0,ve.borderTopClassName=a0,ve.clsx=xe,ve.divideXClassName=u0,ve.divideYClassName=l0,ve.filterLeafNode=ED,ve.findNodePathFromTree=zp,ve.findSubTreeFromPath=qi,ve.isBrowser=va,ve.mergeTreeSelected=xD,ve.message=uP,ve.removeMessage=cP,ve.render=PD,ve.resizeObserverCtor=kD,ve.scrollbarClassName=er,ve.toast=YP,ve.unmount=DD,Object.defineProperty(ve,Symbol.toStringTag,{value:"Module"})});
1511
1518
 
1512
1519
 
1513
1520
  // @univerjs/engine-render/index