@univerjs/sheets-hyper-link-ui 0.17.0 → 0.18.0

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.
Files changed (87) hide show
  1. package/lib/cjs/facade.js +1 -1
  2. package/lib/cjs/index.js +32 -1
  3. package/lib/cjs/locale/ca-ES.js +1 -1
  4. package/lib/cjs/locale/en-US.js +1 -1
  5. package/lib/cjs/locale/es-ES.js +1 -1
  6. package/lib/cjs/locale/fa-IR.js +1 -1
  7. package/lib/cjs/locale/fr-FR.js +1 -1
  8. package/lib/cjs/locale/ja-JP.js +1 -1
  9. package/lib/cjs/locale/ko-KR.js +1 -1
  10. package/lib/cjs/locale/ru-RU.js +1 -1
  11. package/lib/cjs/locale/sk-SK.js +1 -1
  12. package/lib/cjs/locale/vi-VN.js +1 -1
  13. package/lib/cjs/locale/zh-CN.js +1 -1
  14. package/lib/cjs/locale/zh-TW.js +1 -1
  15. package/lib/es/facade.js +1 -12
  16. package/lib/es/index.js +32 -2006
  17. package/lib/es/locale/ca-ES.js +1 -38
  18. package/lib/es/locale/en-US.js +1 -38
  19. package/lib/es/locale/es-ES.js +1 -38
  20. package/lib/es/locale/fa-IR.js +1 -38
  21. package/lib/es/locale/fr-FR.js +1 -38
  22. package/lib/es/locale/ja-JP.js +1 -38
  23. package/lib/es/locale/ko-KR.js +1 -38
  24. package/lib/es/locale/ru-RU.js +1 -38
  25. package/lib/es/locale/sk-SK.js +1 -38
  26. package/lib/es/locale/vi-VN.js +1 -38
  27. package/lib/es/locale/zh-CN.js +1 -38
  28. package/lib/es/locale/zh-TW.js +1 -38
  29. package/lib/facade.js +1 -12
  30. package/lib/index.css +168 -1
  31. package/lib/index.js +32 -2006
  32. package/lib/locale/ca-ES.js +1 -38
  33. package/lib/locale/en-US.js +1 -38
  34. package/lib/locale/es-ES.js +1 -38
  35. package/lib/locale/fa-IR.js +1 -38
  36. package/lib/locale/fr-FR.js +1 -38
  37. package/lib/locale/ja-JP.js +1 -38
  38. package/lib/locale/ko-KR.js +1 -38
  39. package/lib/locale/ru-RU.js +1 -38
  40. package/lib/locale/sk-SK.js +1 -38
  41. package/lib/locale/vi-VN.js +1 -38
  42. package/lib/locale/zh-CN.js +1 -38
  43. package/lib/locale/zh-TW.js +1 -38
  44. package/lib/types/commands/operations/popup.operations.d.ts +17 -2
  45. package/lib/types/config/config.d.ts +16 -1
  46. package/lib/types/controllers/auto-fill.controller.d.ts +15 -0
  47. package/lib/types/controllers/copy-paste.controller.d.ts +15 -0
  48. package/lib/types/controllers/hyper-link-permission.controller.d.ts +15 -0
  49. package/lib/types/controllers/popup.controller.d.ts +15 -0
  50. package/lib/types/controllers/render-controllers/render.controller.d.ts +18 -2
  51. package/lib/types/controllers/ui.controller.d.ts +15 -0
  52. package/lib/types/controllers/url.controller.d.ts +15 -0
  53. package/lib/types/facade/f-workbook.d.ts +15 -0
  54. package/lib/types/locale/ca-ES.d.ts +16 -1
  55. package/lib/types/locale/es-ES.d.ts +16 -1
  56. package/lib/types/locale/fa-IR.d.ts +16 -1
  57. package/lib/types/locale/fr-FR.d.ts +16 -1
  58. package/lib/types/locale/ja-JP.d.ts +16 -1
  59. package/lib/types/locale/ko-KR.d.ts +16 -1
  60. package/lib/types/locale/ru-RU.d.ts +16 -1
  61. package/lib/types/locale/sk-SK.d.ts +16 -1
  62. package/lib/types/locale/vi-VN.d.ts +16 -1
  63. package/lib/types/locale/zh-CN.d.ts +16 -1
  64. package/lib/types/locale/zh-TW.d.ts +16 -1
  65. package/lib/types/menu/menu.d.ts +22 -6
  66. package/lib/types/menu/schema.d.ts +16 -1
  67. package/lib/types/plugin.d.ts +16 -1
  68. package/lib/types/services/popup.service.d.ts +21 -5
  69. package/lib/types/services/resolver.service.d.ts +18 -2
  70. package/lib/types/services/side-panel.service.d.ts +18 -2
  71. package/lib/types/utils/index.d.ts +16 -1
  72. package/lib/types/views/CellLinkPopup/index.d.ts +16 -1
  73. package/lib/umd/facade.js +1 -1
  74. package/lib/umd/index.js +32 -1
  75. package/lib/umd/locale/ca-ES.js +1 -1
  76. package/lib/umd/locale/en-US.js +1 -1
  77. package/lib/umd/locale/es-ES.js +1 -1
  78. package/lib/umd/locale/fa-IR.js +1 -1
  79. package/lib/umd/locale/fr-FR.js +1 -1
  80. package/lib/umd/locale/ja-JP.js +1 -1
  81. package/lib/umd/locale/ko-KR.js +1 -1
  82. package/lib/umd/locale/ru-RU.js +1 -1
  83. package/lib/umd/locale/sk-SK.js +1 -1
  84. package/lib/umd/locale/vi-VN.js +1 -1
  85. package/lib/umd/locale/zh-CN.js +1 -1
  86. package/lib/umd/locale/zh-TW.js +1 -1
  87. package/package.json +18 -17
package/lib/umd/index.js CHANGED
@@ -1 +1,32 @@
1
- (function(v,s){typeof exports=="object"&&typeof module<"u"?s(exports,require("@univerjs/core"),require("@univerjs/sheets"),require("@univerjs/sheets-ui"),require("@univerjs/docs"),require("@univerjs/docs-ui"),require("@univerjs/engine-render"),require("@univerjs/ui"),require("rxjs"),require("react/jsx-runtime"),require("@univerjs/design"),require("@univerjs/engine-formula"),require("@univerjs/sheets-formula-ui"),require("@univerjs/sheets-hyper-link"),require("react"),require("@univerjs/sheets-data-validation")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/sheets","@univerjs/sheets-ui","@univerjs/docs","@univerjs/docs-ui","@univerjs/engine-render","@univerjs/ui","rxjs","react/jsx-runtime","@univerjs/design","@univerjs/engine-formula","@univerjs/sheets-formula-ui","@univerjs/sheets-hyper-link","react","@univerjs/sheets-data-validation"],s):(v=typeof globalThis<"u"?globalThis:v||self,s(v.UniverSheetsHyperLinkUi={},v.UniverCore,v.UniverSheets,v.UniverSheetsUi,v.UniverDocs,v.UniverDocsUi,v.UniverEngineRender,v.UniverUi,v.rxjs,v.React,v.UniverDesign,v.UniverEngineFormula,v.UniverSheetsFormulaUi,v.UniverSheetsHyperLink,v.React,v.UniverSheetsDataValidation))})(this,(function(v,s,f,R,de,X,pe,m,O,y,L,G,Ut,_,E,tt){"use strict";var bn=Object.defineProperty;var On=(v,s,f)=>s in v?bn(v,s,{enumerable:!0,configurable:!0,writable:!0,value:f}):v[s]=f;var F=(v,s,f)=>On(v,typeof s!="symbol"?s+"":s,f);var C=(t=>(t.EDITING="editing",t.VIEWING="viewing",t.ZEN_EDITOR="zen_mode",t))(C||{});function ye(t){return s.Tools.isLegalUrl(t)}function Mt(t){return/^[a-zA-Z]+:\/\//.test(t)}function Ht(t){return/^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/.test(t)}function xt(t){if(ye(t)){const n=Mt(t)?t:Ht(t)?`mailto://${t}`:`http://${t}`;let e;try{e=new URL(n)}catch{return t}return e.hostname===location.hostname&&e.port===location.port&&e.protocol===location.protocol&&e.pathname===location.pathname&&e.hash&&!e.search?e.hash:n}return t}const nt="sheets-hyper-link-ui.config",it={};var At=Object.getOwnPropertyDescriptor,$t=(t,n,e,i)=>{for(var r=i>1?void 0:i?At(n,e):n,o=t.length-1,a;o>=0;o--)(a=t[o])&&(r=a(r)||r);return r},ae=(t,n)=>(e,i)=>n(e,i,t);function Bt(t,n){const e=n.getMergeData(),i=n.getMaxColumns()-1,r=n.getMaxRows()-1;if(i<t.endColumn&&(t.endColumn=i),r<t.endRow&&(t.endRow=r),t.rangeType===s.RANGE_TYPE.COLUMN||s.RANGE_TYPE.ROW)return t;const o=[];return e.forEach(a=>{s.Rectangle.intersects(t,a)&&o.push(a)}),s.Rectangle.realUnion(t,...o)}v.SheetsHyperLinkResolverService=class{constructor(n,e,i,r,o,a){this._univerInstanceService=n,this._commandService=e,this._definedNamesService=i,this._messageService=r,this._localeService=o,this._configService=a}navigate(n){n.type===_.SheetHyperLinkType.URL?this.navigateToOtherWebsite(n.url):this._navigateToUniver(n.searchObj)}_navigateToUniver(n){const{gid:e,range:i,rangeid:r}=n,o=this._univerInstanceService.getCurrentUnitForType(s.UniverInstanceType.UNIVER_SHEET);if(!o)return;const a=o.getUnitId();if(r){const u=this._definedNamesService.getValueById(a,r);if(!u)return;const{formulaOrRefString:l}=u,h=this._definedNamesService.getWorksheetByRef(a,l);if(!h){this._messageService.show({content:this._localeService.t("hyperLink.message.refError"),type:L.MessageType.Error});return}if(h.isSheetHidden()){this._messageService.show({content:this._localeService.t("hyperLink.message.hiddenSheet"),type:L.MessageType.Error});return}this.navigateToDefineName(a,r)}if(e){if(i){const u=G.deserializeRangeWithSheet(i);s.isValidRange(u.range)&&i!==_.ERROR_RANGE&&this.navigateToRange(a,e,u.range);return}this.navigateToSheetById(a,e)}}async navigateToRange(n,e,i,r){const o=await this.navigateToSheetById(n,e);if(o){const a=Bt(i,o);await this._commandService.executeCommand(f.SetSelectionsOperation.id,{unitId:n,subUnitId:e,selections:[{range:a,primary:null}]}),await this._commandService.executeCommand(R.ScrollToRangeOperation.id,{range:a,forceTop:r})}}async navigateToSheetById(n,e){const i=this._univerInstanceService.getUnit(n,s.UniverInstanceType.UNIVER_SHEET);if(!i)return!1;const r=i.getActiveSheet();if(!r)return!1;if(r.getSheetId()===e)return r;const o=i.getSheetBySheetId(e);return o?i.getHiddenWorksheets().indexOf(e)>-1?(this._messageService.show({content:this._localeService.t("hyperLink.message.hiddenSheet"),type:L.MessageType.Error}),!1):await this._commandService.executeCommand(f.SetWorksheetActiveOperation.id,{unitId:n,subUnitId:e})?o:!1:(this._messageService.show({content:this._localeService.t("hyperLink.message.noSheet"),type:L.MessageType.Error}),!1)}async navigateToDefineName(n,e){return this._definedNamesService.focusRange(n,e),!0}async navigateToOtherWebsite(n){var i;const e=this._configService.getConfig(nt);if((i=e==null?void 0:e.urlHandler)!=null&&i.navigateToOtherWebsite)return e.urlHandler.navigateToOtherWebsite(n);window.open(n,"_blank","noopener noreferrer")}},v.SheetsHyperLinkResolverService=$t([ae(0,s.IUniverInstanceService),ae(1,s.ICommandService),ae(2,G.IDefinedNamesService),ae(3,m.IMessageService),ae(4,s.Inject(s.LocaleService)),ae(5,s.IConfigService)],v.SheetsHyperLinkResolverService);class Ve extends s.Disposable{constructor(){super(...arguments);F(this,"_customHyperLinks",new Map)}isBuiltInLinkType(e){return e!==_.SheetHyperLinkType.URL}getOptions(){return Array.from(this._customHyperLinks.values()).map(({option:e})=>e)}findCustomHyperLink(e){return Array.from(this._customHyperLinks.values()).find(r=>r.match(e))}registerCustomHyperLink(e){this._customHyperLinks.set(e.type,e)}getCustomHyperLink(e){return this._customHyperLinks.get(e)}removeCustomHyperLink(e){const{_customHyperLinks:i}=this;i.delete(e)}dispose(){super.dispose(),this._customHyperLinks.clear()}}const Ce=()=>{var mt;const[t,n]=E.useState(""),[e,i]=E.useState(!1),[r,o]=E.useState(""),[a,u]=E.useState(!0),[l,h]=E.useState(_.SheetHyperLinkType.URL),[d,p]=E.useState(""),S=m.useDependency(s.LocaleService),I=m.useDependency(G.IDefinedNamesService),P=m.useDependency(R.IEditorBridgeService),w=m.useDependency(s.IUniverInstanceService),T=m.useDependency(v.SheetsHyperLinkPopupService),c=m.useObservable(T.currentEditing$),D=m.useDependency(_.SheetsHyperLinkParserService),A=m.useDependency(v.SheetsHyperLinkResolverService),U=m.useDependency(s.ICommandService),M=m.useDependency(Ve),V=E.useMemo(()=>M.getOptions(),[M]),B=m.useDependency(m.IZenZoneService),z=m.useDependency(pe.IRenderManagerService),re=m.useDependency(R.IMarkSelectionService),Ae=m.useDependency(de.DocSelectionManagerService),se=m.useDependency(s.IContextService),Ie=m.useDependency(s.ThemeService),Se=m.useDependency(de.DocSelectionManagerService),[_e,$e]=E.useState(!1),ce=m.useDependency(f.SheetsSelectionsService),Rn=E.useMemo(()=>ce.getCurrentSelections(),[]),Be=E.useMemo(()=>{if(!M.isBuiltInLinkType(l))return M.getCustomHyperLink(l)},[M,l]),[ue,Tn]=E.useState(!1),[me,St]=E.useState(!1),j=E.useRef(!1),K=w.getCurrentUnitForType(s.UniverInstanceType.UNIVER_SHEET),Ln=(K==null?void 0:K.getActiveSheet().getSheetId())||"",J=E.useCallback(g=>{o(g.replaceAll(s.DataStreamTreeTokenType.CUSTOM_RANGE_START,"").replaceAll(s.DataStreamTreeTokenType.CUSTOM_RANGE_END,""))},[o]);E.useEffect(()=>{var g,k,b,N,x,W,ft,yt,Ct,Et,Pt,Rt,Tt,Lt,wt,Dt,kt;if((c==null?void 0:c.row)!==void 0&&c.col!==void 0){const{customRange:oe,row:Qe,col:et}=c;let{label:q}=c;typeof q=="number"&&(q=`${q}`);let Y;if(oe)Y={id:(g=oe==null?void 0:oe.rangeId)!=null?g:"",display:q!=null?q:"",payload:(b=(k=oe==null?void 0:oe.properties)==null?void 0:k.url)!=null?b:"",row:Qe,column:et};else if(c.type===C.VIEWING){const H=w.getUnit(c.unitId),ee=H==null?void 0:H.getSheetBySheetId(c.subUnitId),$=ee==null?void 0:ee.getCellRaw(c.row,c.col),le=(W=(x=(N=$==null?void 0:$.p)==null?void 0:N.body)==null?void 0:x.customRanges)==null?void 0:W.find(Ot=>{var Nt;return Ot.rangeType===s.CustomRangeType.HYPERLINK&&((Nt=Ot.properties)==null?void 0:Nt.url)}),fe=$==null?void 0:$.v;$&&(!s.BuildTextUtils.transform.isEmptyDocument((yt=(ft=$.p)==null?void 0:ft.body)==null?void 0:yt.dataStream)||s.Tools.isDefine(fe))&&u(!1),Y={id:"",display:"",payload:(Et=(Ct=le==null?void 0:le.properties)==null?void 0:Ct.url)!=null?Et:"",row:Qe,column:et}}else{const H=w.getCurrentUnitForType(s.UniverInstanceType.UNIVER_DOC),ee=Ae.getActiveTextRange(),$=H==null?void 0:H.getBody(),le=ee&&$?ee:null,fe=le&&((Rt=s.BuildTextUtils.customRange.getCustomRangesInterestsWithSelection(le,(Pt=$==null?void 0:$.customRanges)!=null?Pt:[]))==null?void 0:Rt[0]);u(!1),Y={id:"",display:q!=null?q:"",payload:(Lt=(Tt=fe==null?void 0:fe.properties)==null?void 0:Tt.url)!=null?Lt:"",row:Qe,column:et}}n(Y.id);const bt=M.findCustomHyperLink(Y);if(bt){const H=bt.convert(Y);h(H.type),p(H.payload),J(H.display);return}J(Y.display);const Q=D.parseHyperLink(Y.payload);switch(h(Q.type===_.SheetHyperLinkType.INVALID?_.SheetHyperLinkType.RANGE:Q.type),Q.type){case _.SheetHyperLinkType.URL:{p(Q.url),Q.url===Y.display&&(j.current=!0);break}case _.SheetHyperLinkType.RANGE:{const H=Q.searchObj,ee=H.gid&&(kt=(Dt=(wt=w.getUnit(c.unitId))==null?void 0:wt.getSheetBySheetId(H.gid))==null?void 0:Dt.getName())!=null?kt:"",$=G.serializeRangeWithSheet(ee,G.deserializeRangeWithSheet(H.range).range);p($),$===Y.display&&(j.current=!0);break}case _.SheetHyperLinkType.SHEET:{const H=Q.searchObj;p(H.gid);break}case _.SheetHyperLinkType.DEFINE_NAME:{const H=Q.searchObj;p(H.rangeid);break}default:p("");break}}},[c,A,M,Ae,w]),E.useEffect(()=>{let g=null;if(c&&!c.customRangeId&&c.type===C.VIEWING&&s.Tools.isDefine(c.row)&&s.Tools.isDefine(c.col)){const k=w.getUnit(c.unitId,s.UniverInstanceType.UNIVER_SHEET),b=k==null?void 0:k.getSheetBySheetId(c.subUnitId),N=b==null?void 0:b.getMergedCell(c.row,c.col),x=new s.ColorKit(Ie.getColorFromTheme("primary.600")).toRgb();g=re.addShape({range:N!=null?N:{startColumn:c.col,endColumn:c.col,startRow:c.row,endRow:c.row},style:{fill:`rgb(${x.r}, ${x.g}, ${x.b}, 0.12)`,strokeWidth:1,stroke:"#FFBD37",widgets:{}},primary:null},[],-1)}return()=>{g&&re.removeShape(g)}},[c,re,Ie,w]),E.useEffect(()=>{St(l===_.SheetHyperLinkType.RANGE)},[l]),E.useEffect(()=>{const g=(c==null?void 0:c.type)===C.ZEN_EDITOR?z.getRenderById(s.DOCS_ZEN_EDITOR_UNIT_ID_KEY):z.getRenderById(P.getCurrentEditorId()),k=new s.DisposableCollection;if(g){const b=g.with(X.DocSelectionRenderService);b.setReserveRangesStatus(!0),k.add(()=>{b.setReserveRangesStatus(!1)})}return()=>{P.disableForceKeepVisible(),k.dispose()}},[c==null?void 0:c.type,P,z]),E.useEffect(()=>(me&&T.setIsKeepVisible(me),T.setIsKeepVisible(_e),()=>{T.setIsKeepVisible(!1)}),[me,_e,T]),E.useEffect(()=>()=>{B.temporaryHidden&&(B.show(),se.setContextValue(s.FOCUSING_SHEET,!1))},[se,B]),E.useEffect(()=>{if(me)return P.enableForceKeepVisible(),()=>{P.disableForceKeepVisible()}},[me,P]);const wn=[{label:S.t("hyperLink.form.link"),value:_.SheetHyperLinkType.URL},{label:S.t("hyperLink.form.range"),value:_.SheetHyperLinkType.RANGE},{label:S.t("hyperLink.form.worksheet"),value:_.SheetHyperLinkType.SHEET},{label:S.t("hyperLink.form.definedName"),value:_.SheetHyperLinkType.DEFINE_NAME},...V];if(!K)return;const Dn=K.getHiddenWorksheets(),qe=K.getSheets().map(g=>({label:g.getName(),value:g.getSheetId()})).filter(g=>Dn.indexOf(g.value)===-1),Xe=Object.values((mt=I.getDefinedNameMap(K.getUnitId()))!=null?mt:{}).map(g=>({label:g.name,value:g.id})),_t=(g,k)=>{if(g===_.SheetHyperLinkType.URL)return xt(k);if(g===_.SheetHyperLinkType.RANGE){const b=G.deserializeRangeWithSheet(k),N=K.getSheetBySheetName(b.sheetName);if(N)return`#gid=${N.getSheetId()}&range=${G.serializeRange(b.range)}`}return`#${g}=${k}`},kn=m.useEvent(g=>{var x;const b=g.split(",").map(G.deserializeRangeWithSheet)[0];if(!b||!s.isValidRange(b.range))return;b.sheetName||(b.sheetName=((x=K.getActiveSheet())==null?void 0:x.getName())||"");const N=G.serializeRangeToRefString(b);p(N),N&&(j.current||!r)&&(J(N),j.current=!0)}),Je=async()=>{if(a&&!r||!d||l===_.SheetHyperLinkType.URL&&!ye(d)){Tn(!0);return}if(c)if(t){const g=c.type===C.ZEN_EDITOR||c.type===C.EDITING?_.UpdateRichHyperLinkCommand.id:_.UpdateHyperLinkCommand.id;await U.executeCommand(g,{id:t,unitId:c.unitId,subUnitId:c.subUnitId,payload:{display:a?r:"",payload:_t(l,d)},row:c.row,column:c.col,documentId:c.type===C.ZEN_EDITOR?s.DOCS_ZEN_EDITOR_UNIT_ID_KEY:P.getCurrentEditorId()})}else{const g=c.type===C.ZEN_EDITOR||c.type===C.EDITING?_.AddRichHyperLinkCommand.id:_.AddHyperLinkCommand.id;await U.executeCommand(g,{unitId:c.unitId,subUnitId:c.subUnitId,link:{id:s.generateRandomId(),row:c.row,column:c.col,payload:_t(l,d),display:a?r:""},documentId:c.type===C.ZEN_EDITOR?s.DOCS_ZEN_EDITOR_UNIT_ID_KEY:P.getCurrentEditorId()})}if((c==null?void 0:c.type)===C.VIEWING){await U.executeCommand(f.SetWorksheetActiveOperation.id,{unitId:c.unitId,subUnitId:c.subUnitId});const g=1;await U.executeCommand(R.ScrollToRangeOperation.id,{range:{startRow:Math.max(c.row-g,0),endRow:c.row+g,startColumn:Math.max(c.col-g,0),endColumn:c.col+g}})}U.executeCommand(ve.id)};return c?y.jsxs("div",{className:L.clsx("univer-box-border univer-w-[296px] univer-rounded-xl univer-bg-white univer-p-4 univer-shadow-md dark:!univer-bg-gray-900",L.borderClassName),children:[a?y.jsx(L.FormLayout,{label:S.t("hyperLink.form.label"),error:ue&&!r?S.t("hyperLink.form.inputError"):"",children:y.jsx(L.Input,{value:r,onChange:g=>{J(g),j.current=!1},placeholder:S.t("hyperLink.form.labelPlaceholder"),autoFocus:!0,onKeyDown:g=>{g.keyCode===m.KeyCode.ENTER&&Je()}})}):null,y.jsx(L.FormLayout,{label:S.t("hyperLink.form.type"),children:y.jsx(L.Select,{className:"univer-w-full",options:wn,value:l,onChange:g=>{h(g),p("")}})}),l===_.SheetHyperLinkType.URL&&y.jsx(L.FormLayout,{error:ue?d?ye(d)?"":S.t("hyperLink.form.linkError"):S.t("hyperLink.form.inputError"):"",children:y.jsx(L.Input,{value:d,onChange:g=>{p(g),g&&(j.current||!r||r===g)&&(J(g),j.current=!0)},placeholder:S.t("hyperLink.form.linkPlaceholder"),autoFocus:!0,onKeyDown:g=>{g.keyCode===m.KeyCode.ENTER&&Je()}})}),l===_.SheetHyperLinkType.RANGE&&y.jsx(L.FormLayout,{error:ue&&!d?S.t("hyperLink.form.inputError"):"",children:y.jsx(Ut.RangeSelector,{unitId:K.getUnitId(),subUnitId:Ln,maxRangeCount:1,supportAcrossSheet:!0,initialValue:d,resetRange:Rn,onChange:(g,k)=>kn(k),onRangeSelectorDialogVisibleChange:async g=>{var k,b;if($e(g),g)c.type===C.ZEN_EDITOR&&(B.hide(),se.setContextValue(s.FOCUSING_SHEET,!0)),c.type!==C.VIEWING&&P.enableForceKeepVisible(),i(!0);else{if(await A.navigateToRange(c.unitId,c.subUnitId,{startRow:c.row,endRow:c.row,startColumn:c.col,endColumn:c.col},!0),c.type===C.ZEN_EDITOR){await U.executeCommand(f.SetSelectionsOperation.id,{unitId:c.unitId,subUnitId:c.subUnitId,selections:[{range:{startRow:c.row,endRow:c.row,startColumn:c.col,endColumn:c.col}}]}),B.show(),se.setContextValue(s.FOCUSING_SHEET,!1);const N=(k=z.getRenderById(s.DOCS_ZEN_EDITOR_UNIT_ID_KEY))==null?void 0:k.with(X.DocBackScrollRenderController),x=(b=Se.getTextRanges({unitId:s.DOCS_ZEN_EDITOR_UNIT_ID_KEY,subUnitId:s.DOCS_ZEN_EDITOR_UNIT_ID_KEY}))==null?void 0:b[0];N&&x&&(N.scrollToRange(x),Se.refreshSelection({unitId:s.DOCS_ZEN_EDITOR_UNIT_ID_KEY,subUnitId:s.DOCS_ZEN_EDITOR_UNIT_ID_KEY}))}P.disableForceKeepVisible(),i(!1)}},onFocusChange:g=>St(g)})}),l===_.SheetHyperLinkType.SHEET&&y.jsx(L.FormLayout,{error:ue&&!d?S.t("hyperLink.form.selectError"):"",children:y.jsx(L.Select,{className:"univer-w-full",options:qe,value:d,onChange:g=>{var N,x;p(g);const k=(N=qe.find(W=>W.value===g))==null?void 0:N.label,b=(x=qe.find(W=>W.value===d))==null?void 0:x.label;k&&(j.current||!r||r===b)&&(J(k),j.current=!0)}})}),l===_.SheetHyperLinkType.DEFINE_NAME&&y.jsx(L.FormLayout,{error:ue&&!d?S.t("hyperLink.form.selectError"):"",children:y.jsx(L.Select,{className:"univer-w-full",options:Xe,value:d,onChange:g=>{var N,x;p(g);const k=(N=Xe.find(W=>W.value===g))==null?void 0:N.label,b=(x=Xe.find(W=>W.value===d))==null?void 0:x.label;k&&(j.current||!r||r===b)&&(J(k),j.current=!0)}})}),(Be==null?void 0:Be.Form)&&y.jsx(Be.Form,{linkId:t,payload:d,display:r,showError:ue,setByPayload:j,setDisplay:g=>{J(g),j.current=!0},setPayload:p}),y.jsxs("div",{className:"univer-flex univer-flex-row univer-justify-end univer-gap-2",children:[y.jsx(L.Button,{onClick:()=>{c&&A.navigateToRange(c.unitId,c.subUnitId,{startRow:c.row,endRow:c.row,startColumn:c.col,endColumn:c.col},!0),U.executeCommand(ve.id)},children:S.t("hyperLink.form.cancel")}),y.jsx(L.Button,{variant:"primary",onClick:async()=>{Je()},children:S.t("hyperLink.form.ok")})]})]}):null};Ce.componentKey="univer.sheet.cell-link-edit";function te({ref:t,...n}){const{icon:e,id:i,className:r,extend:o,...a}=n,u=`univerjs-icon univerjs-icon-${i} ${r||""}`.trim(),l=E.useRef(`_${Ft()}`);return rt(e,`${i}`,{defIds:e.defIds,idSuffix:l.current},{ref:t,className:u,...a},o)}function rt(t,n,e,i,r){return E.createElement(t.tag,{key:n,...Vt(t,e,r),...i},(jt(t,e).children||[]).map((o,a)=>rt(o,`${n}-${t.tag}-${a}`,e,void 0,r)))}function Vt(t,n,e){const i={...t.attrs};e!=null&&e.colorChannel1&&i.fill==="colorChannel1"&&(i.fill=e.colorChannel1),t.tag==="mask"&&i.id&&(i.id=i.id+n.idSuffix),Object.entries(i).forEach(([o,a])=>{o==="mask"&&typeof a=="string"&&(i[o]=a.replace(/url\(#(.*)\)/,`url(#$1${n.idSuffix})`))});const{defIds:r}=n;return!r||r.length===0||(t.tag==="use"&&i["xlink:href"]&&(i["xlink:href"]=i["xlink:href"]+n.idSuffix),Object.entries(i).forEach(([o,a])=>{typeof a=="string"&&(i[o]=a.replace(/url\(#(.*)\)/,`url(#$1${n.idSuffix})`))})),i}function jt(t,n){var i;const{defIds:e}=n;return!e||e.length===0?t:t.tag==="defs"&&((i=t.children)!=null&&i.length)?{...t,children:t.children.map(r=>typeof r.attrs.id=="string"&&e&&e.includes(r.attrs.id)?{...r,attrs:{...r.attrs,id:r.attrs.id+n.idSuffix}}:r)}:t}function Ft(){return Math.random().toString(36).substring(2,8)}te.displayName="UniverIcon";const Zt={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:"M7.9999 1.12915C8.03875 1.12915 8.07673 1.13284 8.11352 1.13989H12.2599C13.6958 1.13989 14.8599 2.30395 14.8599 3.73989V7.88619C14.867 7.92301 14.8707 7.96102 14.8707 7.9999C14.8707 8.03878 14.867 8.0768 14.8599 8.11362V12.2599C14.8599 13.6958 13.6958 14.8599 12.2599 14.8599H8.11362C8.0768 14.867 8.03878 14.8707 7.9999 14.8707C7.96102 14.8707 7.92301 14.867 7.88619 14.8599H3.73989C2.30396 14.8599 1.13989 13.6958 1.13989 12.2599V8.11352C1.13284 8.07673 1.12915 8.03875 1.12915 7.9999C1.12915 7.96106 1.13284 7.92308 1.13989 7.88629V3.73989C1.13989 2.30396 2.30395 1.13989 3.73989 1.13989H7.88629C7.92308 1.13284 7.96106 1.12915 7.9999 1.12915ZM2.33989 8.5999V12.2599C2.33989 13.0331 2.9667 13.6599 3.73989 13.6599H7.3999V8.5999H2.33989ZM7.3999 7.3999H2.33989V3.73989C2.33989 2.9667 2.96669 2.33989 3.73989 2.33989H7.3999V7.3999ZM8.5999 8.5999V13.6599H12.2599C13.0331 13.6599 13.6599 13.0331 13.6599 12.2599V8.5999H8.5999ZM13.6599 7.3999H8.5999V2.33989H12.2599C13.0331 2.33989 13.6599 2.96669 13.6599 3.73989V7.3999Z",fillRule:"evenodd",clipRule:"evenodd"}}]},Ee=E.forwardRef(function(n,e){return E.createElement(te,Object.assign({},n,{id:"all-border-icon",ref:e,icon:Zt}))});Ee.displayName="AllBorderIcon";const Kt={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.1302 12.4251C4.25802 13.7417 5.36779 14.7708 6.71792 14.7708H11.7179C13.1539 14.7708 14.3179 13.6067 14.3179 12.1708V6.1708C14.3179 4.78586 13.2351 3.65383 11.8698 3.57517C11.742 2.25858 10.6323 1.22949 9.28213 1.22949H4.28213C2.84619 1.22949 1.68213 2.39355 1.68213 3.82949V9.82949C1.68213 11.2144 2.76497 12.3465 4.1302 12.4251ZM10.6583 3.5708H6.71792C5.28198 3.5708 4.11792 4.73486 4.11792 6.1708V11.22C3.4221 11.1387 2.88213 10.5471 2.88213 9.82949V3.82949C2.88213 3.05629 3.50893 2.42949 4.28213 2.42949H9.28213C9.96695 2.42949 10.5369 2.92119 10.6583 3.5708ZM13.1179 6.1708C13.1179 5.3976 12.4911 4.7708 11.7179 4.7708H6.71792C5.94472 4.7708 5.31792 5.3976 5.31792 6.1708V12.1708C5.31792 12.944 5.94472 13.5708 6.71792 13.5708H11.7179C12.4911 13.5708 13.1179 12.944 13.1179 12.1708V6.1708Z",fillRule:"evenodd",clipRule:"evenodd"}}]},st=E.forwardRef(function(n,e){return E.createElement(te,Object.assign({},n,{id:"copy-icon",ref:e,icon:Kt}))});st.displayName="CopyIcon";const Wt={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M9.8816 1.97978C11.0177 0.843607 12.862 0.884962 14.0004 2.02342C15.1389 3.16188 15.1803 5.00612 14.0441 6.14228L11.399 8.78737C11.1608 9.02559 10.7746 9.02559 10.5363 8.78737C10.2981 8.54915 10.2981 8.16292 10.5363 7.9247L13.1814 5.2796C13.8195 4.64155 13.8217 3.57006 13.1378 2.8861C12.4538 2.20211 11.3823 2.20438 10.7443 2.84245L7.6976 5.88911L7.69317 5.89349C7.05959 6.53211 7.05894 7.60014 7.74132 8.28252C7.97954 8.52074 7.97954 8.90697 7.74132 9.14519C7.5031 9.38341 7.11687 9.38341 6.87865 9.14519C5.74016 8.00671 5.69884 6.16251 6.83497 5.02633L6.84021 5.02116L9.8816 1.97978Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M4.61426 7.2364C4.85248 6.99818 5.23871 6.99818 5.47693 7.2364C5.71515 7.47462 5.71515 7.86085 5.47693 8.09907L2.83183 10.7442C2.19375 11.3823 2.1915 12.4537 2.87547 13.1377C3.55945 13.8217 4.6309 13.8194 5.26899 13.1813L8.31566 10.1347C8.32262 10.1277 8.32971 10.121 8.33691 10.1144C8.34408 10.1064 8.3515 10.0986 8.35916 10.091C8.99721 9.45291 8.99949 8.38145 8.3155 7.69746C8.07728 7.45924 8.07728 7.07301 8.3155 6.83479C8.55372 6.59657 8.93995 6.59657 9.17817 6.83479C10.3166 7.97327 10.358 9.81748 9.22183 10.9536C9.21487 10.9606 9.20779 10.9673 9.20058 10.9739C9.19341 10.9819 9.18599 10.9897 9.17833 10.9973L6.13166 14.044C4.99548 15.1802 3.15127 15.1389 2.01279 14.0004C0.874362 12.8619 0.83297 11.0177 1.96916 9.8815L4.61426 7.2364Z"}}]},je=E.forwardRef(function(n,e){return E.createElement(te,Object.assign({},n,{id:"link-icon",ref:e,icon:Wt}))});je.displayName="LinkIcon";const Yt={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 17",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M12.5935 3.47302C11.6354 2.51492 10.082 2.51492 9.12388 3.47302L7.83534 4.76157C7.60102 4.99588 7.22112 4.99588 6.98681 4.76157C6.75249 4.52725 6.75249 4.14735 6.98681 3.91304L8.27535 2.62449C9.70209 1.19776 12.0153 1.19776 13.442 2.62449C14.8688 4.05123 14.8688 6.36442 13.442 7.79116L12.1535 9.0797C11.9192 9.31402 11.5393 9.31402 11.3049 9.0797C11.0706 8.84539 11.0706 8.46549 11.3049 8.23117L12.5935 6.94263C13.5516 5.98452 13.5516 4.43113 12.5935 3.47302Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M3.40637 12.6606C2.44827 11.7025 2.44827 10.1491 3.40637 9.19102L4.69492 7.90248C4.92923 7.66816 4.92923 7.28826 4.69492 7.05395C4.4606 6.81963 4.0807 6.81963 3.84639 7.05395L2.55784 8.34249C1.13111 9.76923 1.13111 12.0824 2.55784 13.5092C3.98458 14.9359 6.29777 14.9359 7.72451 13.5092L9.01305 12.2206C9.24737 11.9863 9.24737 11.6064 9.01305 11.3721C8.77874 11.1378 8.39884 11.1378 8.16452 11.3721L6.87598 12.6606C5.91787 13.6187 4.36448 13.6187 3.40637 12.6606Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M3.5852 2.80332C3.35088 2.569 2.97098 2.569 2.73667 2.80332C2.50235 3.03763 2.50235 3.41753 2.73667 3.65185L12.4151 13.3302C12.6494 13.5646 13.0293 13.5646 13.2636 13.3302C13.4979 13.0959 13.4979 12.716 13.2636 12.4817L3.5852 2.80332Z"}}]},ot=E.forwardRef(function(n,e){return E.createElement(te,Object.assign({},n,{id:"unlink-icon",ref:e,icon:Yt}))});ot.displayName="UnlinkIcon";const Gt={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:"M12.6551 1.98906C11.7476 1.08113 10.2757 1.08149 9.3686 1.98987L4.82542 6.53955C4.75087 6.61421 4.69336 6.70411 4.65682 6.80309L3.2461 10.625C3.16506 10.8446 3.21909 11.0912 3.3845 11.2568C3.54991 11.4224 3.79651 11.4767 4.01616 11.3959L7.85031 9.98517C7.94979 9.94856 8.04014 9.89077 8.11508 9.81579L12.6552 5.27327C13.5618 4.36621 13.5618 2.89607 12.6551 1.98906ZM10.2177 2.83779C10.6562 2.39869 11.3677 2.39851 11.8064 2.8374C12.2447 3.27584 12.2447 3.9865 11.8065 4.42497L7.3392 8.89457L4.82213 9.82068L5.74706 7.31487L10.2177 2.83779Z",fillRule:"evenodd",clipRule:"evenodd"}},{tag:"path",attrs:{fill:"currentColor",d:"M1.79238 13.2999C1.46101 13.2999 1.19238 13.5685 1.19238 13.8999C1.19238 14.2313 1.46101 14.4999 1.79238 14.4999H14.4924C14.8238 14.4999 15.0924 14.2313 15.0924 13.8999C15.0924 13.5685 14.8238 13.2999 14.4924 13.2999H1.79238Z"}}]},at=E.forwardRef(function(n,e){return E.createElement(te,Object.assign({},n,{id:"write-icon",ref:e,icon:Gt}))});at.displayName="WriteIcon";const zt={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:"#35BD4B",d:"M3.4535 1.12549C2.7002 1.12549 2.08954 1.73615 2.08954 2.48945V13.5104C2.08954 14.2637 2.7002 14.8744 3.4535 14.8744H12.5465C13.2998 14.8744 13.9105 14.2637 13.9105 13.5104V5.0992L10.0091 1.12549H3.4535Z"}},{tag:"path",attrs:{fill:"#32A846",d:"M10.0075 1.12549L13.9104 5.09842H10.6742C10.306 5.09842 10.0075 4.79994 10.0075 4.43175V1.12549Z"}},{tag:"path",attrs:{fill:"white",d:"M7.8088 10.2949L6.3764 12.403C6.26259 12.5705 6.03455 12.614 5.86705 12.5002C5.69955 12.3864 5.65603 12.1584 5.76984 11.9909L7.3655 9.64252L5.94042 7.54519C5.82661 7.37769 5.87013 7.14964 6.03763 7.03583C6.20512 6.92202 6.43317 6.96555 6.54698 7.13304L7.8088 8.9901L9.07062 7.13304C9.18443 6.96555 9.41248 6.92202 9.57997 7.03583C9.74747 7.14964 9.79099 7.37769 9.67718 7.54519L8.2521 9.64252L9.84776 11.9909C9.96157 12.1584 9.91805 12.3864 9.75055 12.5002C9.58305 12.614 9.35501 12.5705 9.2412 12.403L7.8088 10.2949Z",fillRule:"evenodd",clipRule:"evenodd"}}]},ct=E.forwardRef(function(n,e){return E.createElement(te,Object.assign({},n,{id:"xlsx-multi-icon",ref:e,icon:zt}))});ct.displayName="XlsxMultiIcon";const qt={[_.SheetHyperLinkType.URL]:y.jsx(je,{}),[_.SheetHyperLinkType.SHEET]:y.jsx(ct,{className:"univer-text-green-500"}),[_.SheetHyperLinkType.RANGE]:y.jsx(Ee,{}),[_.SheetHyperLinkType.DEFINE_NAME]:y.jsx(Ee,{}),[_.SheetHyperLinkType.INVALID]:y.jsx(Ee,{})},ut=t=>{var A,U;const n=m.useDependency(v.SheetsHyperLinkPopupService),e=m.useDependency(s.ICommandService),i=m.useDependency(m.IMessageService),r=m.useDependency(s.LocaleService),o=m.useDependency(v.SheetsHyperLinkResolverService),a=m.useDependency(R.IEditorBridgeService),u=m.useDependency(_.SheetsHyperLinkParserService),l=m.useDependency(m.IZenZoneService),{customRange:h,row:d,col:p,unitId:S,subUnitId:I,editPermission:P,copyPermission:w,type:T}=t;if(!((A=h==null?void 0:h.properties)!=null&&A.url))return null;const c=u.parseHyperLink((U=h.properties.url)!=null?U:""),D=c.type===_.SheetHyperLinkType.INVALID;return y.jsxs("div",{className:L.clsx("univer-mb-1 univer-flex univer-max-w-80 univer-flex-row univer-items-center univer-justify-between univer-overflow-hidden univer-rounded-lg univer-bg-white univer-p-3 univer-shadow-md dark:!univer-bg-gray-900",L.borderClassName),onClick:()=>n.hideCurrentPopup(),children:[y.jsxs("div",{className:L.clsx("univer-flex univer-h-6 univer-flex-1 univer-cursor-pointer univer-flex-row univer-items-center univer-truncate univer-text-sm univer-leading-5 univer-text-primary-600",{"univer-text-red-500":D}),onClick:()=>{l.visible||D||o.navigate(c)},children:[y.jsx("div",{className:"univer-mr-2 univer-flex univer-size-5 univer-flex-none univer-items-center univer-justify-center univer-text-base univer-text-gray-900 dark:!univer-text-white",children:qt[c.type]}),y.jsx(L.Tooltip,{showIfEllipsis:!0,title:c.name,asChild:!0,children:y.jsx("span",{className:"univer-flex-1 univer-truncate",children:c.name})})]}),y.jsxs("div",{className:"univer-flex univer-h-6 univer-flex-none univer-flex-row univer-items-center univer-justify-center",children:[w&&y.jsx("div",{className:L.clsx("univer-ml-2 univer-flex univer-size-6 univer-cursor-pointer univer-flex-row univer-items-center univer-justify-center univer-rounded univer-text-base hover:univer-bg-gray-100 dark:hover:!univer-bg-gray-700",{"univer-text-red-500":D}),onClick:()=>{if(!D){if(c.type!==_.SheetHyperLinkType.URL){const M=new URL(window.location.href);M.hash=c.url.slice(1),navigator.clipboard.writeText(M.href)}else navigator.clipboard.writeText(c.url);i.show({content:r.t("hyperLink.message.coped"),type:L.MessageType.Info})}},children:y.jsx(L.Tooltip,{placement:"bottom",title:r.t("hyperLink.popup.copy"),children:y.jsx(st,{className:"dark:!univer-text-white"})})}),P&&y.jsxs(y.Fragment,{children:[y.jsx("div",{className:"univer-ml-2 univer-flex univer-size-6 univer-cursor-pointer univer-flex-row univer-items-center univer-justify-center univer-rounded univer-text-base hover:univer-bg-gray-100 dark:hover:!univer-bg-gray-700",onClick:()=>{e.executeCommand(Re.id,{unitId:S,subUnitId:I,row:d,col:p,customRangeId:h.rangeId,type:T})},children:y.jsx(L.Tooltip,{placement:"bottom",title:r.t("hyperLink.popup.edit"),children:y.jsx(at,{className:"dark:!univer-text-white"})})}),y.jsx("div",{className:"univer-ml-2 univer-flex univer-size-6 univer-cursor-pointer univer-flex-row univer-items-center univer-justify-center univer-rounded univer-text-base hover:univer-bg-gray-100 dark:hover:!univer-bg-gray-700",onClick:()=>{const M=T===C.EDITING||T===C.ZEN_EDITOR?_.CancelRichHyperLinkCommand.id:_.CancelHyperLinkCommand.id;e.syncExecuteCommand(M,{unitId:S,subUnitId:I,id:h.rangeId,row:d,column:p,documentId:T===C.ZEN_EDITOR?s.DOCS_ZEN_EDITOR_UNIT_ID_KEY:a.getCurrentEditorId()})&&n.hideCurrentPopup(void 0,!0)},children:y.jsx(L.Tooltip,{placement:"bottom",title:r.t("hyperLink.popup.cancel"),children:y.jsx(ot,{className:"dark:!univer-text-white"})})})]})]})]})},Pe=()=>{var r,o;const t=m.useDependency(v.SheetsHyperLinkPopupService),[n,e]=E.useState(null),i=m.useDependency(s.IUniverInstanceService);if(E.useEffect(()=>{e(t.currentPopup);const a=t.currentPopup$.subscribe(u=>{e(u)});return()=>{a.unsubscribe()}},[t.currentPopup,t.currentPopup$]),!n)return null;if(n.showAll){const a=i.getUnit(n.unitId,s.UniverInstanceType.UNIVER_SHEET),u=a==null?void 0:a.getSheetBySheetId(n.subUnitId),l=u==null?void 0:u.getCell(n.row,n.col),h=(o=(r=l==null?void 0:l.p)==null?void 0:r.body)==null?void 0:o.customRanges;return h!=null&&h.length?y.jsx("div",{children:h.map(d=>y.jsx(ut,{...n,customRange:d},d.rangeId))}):null}return y.jsx(ut,{...n})};Pe.componentKey="univer.sheet.cell-link-popup";var Xt=Object.getOwnPropertyDescriptor,Jt=(t,n,e,i)=>{for(var r=i>1?void 0:i?Xt(n,e):n,o=t.length-1,a;o>=0;o--)(a=t[o])&&(r=a(r)||r);return r},ne=(t,n)=>(e,i)=>n(e,i,t);const lt=(t,n)=>{var e,i;return t.unitId===n.unitId&&t.subUnitId===n.subUnitId&&t.row===n.row&&t.col===n.col&&((e=t.customRange)==null?void 0:e.rangeId)===((i=n.customRange)==null?void 0:i.rangeId)&&t.type===n.type};v.SheetsHyperLinkPopupService=class extends s.Disposable{constructor(e,i,r,o,a,u,l){super();F(this,"_currentPopup",null);F(this,"_currentPopup$",new O.Subject);F(this,"currentPopup$",this._currentPopup$.asObservable());F(this,"_currentEditingPopup",null);F(this,"_currentEditing$",new O.BehaviorSubject(null));F(this,"currentEditing$",this._currentEditing$.asObservable());F(this,"_isKeepVisible",!1);this._sheetCanvasPopManagerService=e,this._injector=i,this._univerInstanceService=r,this._editorBridgeService=o,this._textSelectionManagerService=a,this._docCanvasPopManagerService=u,this._zenZoneService=l,this.disposeWithMe(()=>{this.hideCurrentPopup(),this.endEditing(),this._currentEditing$.complete(),this._currentPopup$.complete()})}get currentPopup(){return this._currentPopup}get currentEditing(){return this._currentEditing$.getValue()}setIsKeepVisible(e){this._isKeepVisible=e}getIsKeepVisible(){return this._isKeepVisible}showPopup(e){var S;if(this._currentPopup&&lt(e,this._currentPopup)||(this.hideCurrentPopup(void 0,!0),e.type!==C.ZEN_EDITOR&&this._zenZoneService.visible))return;const i=this._currentEditing$.getValue();if(i&&lt(e,i))return;const{unitId:r,subUnitId:o,row:a,col:u,customRangeRect:l,customRange:h}=e;let d;const p={componentKey:Pe.componentKey,direction:"bottom",onClickOutside:()=>{this.hideCurrentPopup()},onClick:()=>{this.hideCurrentPopup(e.type,!0)}};if(e.type===C.EDITING){if(!h)return;d=l&&this._sheetCanvasPopManagerService.attachPopupToAbsolutePosition(l,p)}else if(e.type===C.ZEN_EDITOR){if(!h)return;d=this._docCanvasPopManagerService.attachPopupToRange({startOffset:h.startIndex,endOffset:h.endIndex+1,collapsed:!1},p,s.DOCS_ZEN_EDITOR_UNIT_ID_KEY)}else if(e.showAll)d=this._sheetCanvasPopManagerService.attachPopupToCell(e.row,e.col,p,r,o);else{if(!h)return;d=l&&this._sheetCanvasPopManagerService.attachPopupByPosition(l,p,e)}d&&(this._currentPopup&&((S=this._currentPopup.disposable)==null||S.dispose()),this._currentPopup={unitId:r,subUnitId:o,disposable:d,row:a,col:u,editPermission:!!e.editPermission,copyPermission:!!e.copyPermission,customRange:h,type:e.type,showAll:e.showAll},this._currentPopup$.next(this._currentPopup))}hideCurrentPopup(e,i){var r,o;this._currentPopup&&((!e||e===this._currentPopup.type)&&this._currentPopup.disposable.canDispose()||i)&&((o=(r=this._currentPopup)==null?void 0:r.disposable)==null||o.dispose(),this._currentPopup=null,this._currentPopup$.next(null))}dispose(){super.dispose(),this.hideCurrentPopup(),this.endEditing(),this._currentPopup$.complete(),this._currentEditing$.complete()}_getEditingRange(){var r,o,a;const e=this._editorBridgeService.isVisible().visible,i=this._editorBridgeService.getEditCellState();if(e&&i){const u=this._textSelectionManagerService.getActiveTextRange(),l=(r=i.documentLayoutObject.documentModel)==null?void 0:r.getBody();if(!l)return null;if(!u||u.collapsed)return{startOffset:0,endOffset:l.dataStream.length-2,collapsed:l.dataStream.length-2===0,label:s.BuildTextUtils.transform.getPlainText(l.dataStream)};const h=s.BuildTextUtils.customRange.getCustomRangesInterestsWithSelection(u,(a=(o=l.customRanges)==null?void 0:o.filter(S=>S.rangeType===s.CustomRangeType.HYPERLINK))!=null?a:[]);let d=u.startOffset,p=u.endOffset;return h.forEach(S=>{d=Math.min(d,S.startIndex),p=Math.max(p,S.endIndex+1)}),{startOffset:d,endOffset:p,collapsed:d===p,label:s.BuildTextUtils.transform.getPlainText(l.dataStream.slice(d,p))}}return null}get _editPopup(){return{componentKey:Ce.componentKey,direction:"vertical",onClickOutside:()=>{this.endEditing()},onContextMenu:()=>{this.endEditing()},hiddenType:"hide"}}startAddEditing(e){var a,u,l,h,d;const{unitId:i,subUnitId:r,type:o}=e;if(o===C.ZEN_EDITOR){const p=this._univerInstanceService.getUnit(s.DOCS_ZEN_EDITOR_UNIT_ID_KEY,s.UniverInstanceType.UNIVER_DOC);if(!p)return;const S=this._textSelectionManagerService.getActiveTextRange();if(!S)return;this._currentEditingPopup=this._docCanvasPopManagerService.attachPopupToRange(S,this._editPopup,s.DOCS_ZEN_EDITOR_UNIT_ID_KEY);const I=(a=p.getBody())==null?void 0:a.dataStream.slice(S.startOffset,S.endOffset);this._currentEditing$.next({...e,label:I})}else if(o===C.EDITING){const p=this._getEditingRange();if(!p)return;this._textSelectionManagerService.replaceDocRanges([{...p}],{unitId:s.DOCS_NORMAL_EDITOR_UNIT_ID_KEY,subUnitId:s.DOCS_NORMAL_EDITOR_UNIT_ID_KEY});const S=this._injector.get(pe.IRenderManagerService).getRenderById(s.DOCS_NORMAL_EDITOR_UNIT_ID_KEY);if(!S)return;const I=X.calcDocRangePositions(p,S);if(!(I!=null&&I.length))return;this._currentEditingPopup=this._sheetCanvasPopManagerService.attachPopupToAbsolutePosition(I.pop(),this._editPopup,i,r),this._currentEditing$.next({...e,label:(u=p==null?void 0:p.label)!=null?u:""})}else{this._currentEditingPopup=this._sheetCanvasPopManagerService.attachPopupToCell(e.row,e.col,this._editPopup,i,r);const p=this._univerInstanceService.getUnit(i,s.UniverInstanceType.UNIVER_SHEET),S=p==null?void 0:p.getSheetBySheetId(r),I=S==null?void 0:S.getCellRaw(e.row,e.col);this._currentEditing$.next({...e,label:I!=null&&I.p?s.BuildTextUtils.transform.getPlainText((h=(l=I.p.body)==null?void 0:l.dataStream)!=null?h:""):((d=I==null?void 0:I.v)!=null?d:"").toString()})}}startEditing(e){var u,l,h,d,p,S;(u=this._currentEditingPopup)==null||u.dispose(),this.hideCurrentPopup(void 0,!0);const{unitId:i,subUnitId:r}=e;let o,a;if(e.type===C.ZEN_EDITOR){const I=this._univerInstanceService.getUnit(s.DOCS_ZEN_EDITOR_UNIT_ID_KEY,s.UniverInstanceType.UNIVER_DOC);if(o=(h=(l=I==null?void 0:I.getBody())==null?void 0:l.customRanges)==null?void 0:h.find(P=>P.rangeId===e.customRangeId),a=o?(d=I==null?void 0:I.getBody())==null?void 0:d.dataStream.slice(o.startIndex,o.endIndex+1):"",!o||!a)return;this._textSelectionManagerService.replaceTextRanges([{startOffset:o.startIndex,endOffset:o.endIndex+1}]),this._currentEditingPopup=this._docCanvasPopManagerService.attachPopupToRange({startOffset:o.startIndex,endOffset:o.endIndex,collapsed:!1},this._editPopup,s.DOCS_ZEN_EDITOR_UNIT_ID_KEY)}else if(e.type===C.EDITING){const I=R.getEditingCustomRangePosition(this._injector,e.unitId,e.subUnitId,e.row,e.col,e.customRangeId);if(!I||!((p=I.rects)!=null&&p.length))return;o=I.customRange,a=I.label,this._textSelectionManagerService.replaceTextRanges([{startOffset:o.startIndex,endOffset:o.endIndex+1}]),this._currentEditingPopup=this._sheetCanvasPopManagerService.attachPopupToAbsolutePosition(I.rects.pop(),this._editPopup,i,r)}else{const I=this._univerInstanceService.getUnit(i,s.UniverInstanceType.UNIVER_SHEET),P=I==null?void 0:I.getSheetBySheetId(r),w=P==null?void 0:P.getCellRaw(e.row,e.col),T=I==null?void 0:I.getStyles().getStyleByCell(w),c=T==null?void 0:T.tr,D=R.getCustomRangePosition(this._injector,e.unitId,e.subUnitId,e.row,e.col,e.customRangeId);if(!D||!((S=D.rects)!=null&&S.length))return;o=D.customRange,a=D.label,c?this._currentEditingPopup=this._sheetCanvasPopManagerService.attachPopupToCell(e.row,e.col,this._editPopup,i,r):this._currentEditingPopup=this._sheetCanvasPopManagerService.attachPopupByPosition(D.rects.pop(),this._editPopup,{unitId:i,subUnitId:r,row:e.row,col:e.col})}this._currentEditing$.next({...e,customRange:o,label:a})}endEditing(e){var r;if(this.getIsKeepVisible())return;const i=this._currentEditing$.getValue();i&&(!e||e===i.type)&&((r=this._currentEditingPopup)==null||r.dispose(),this._currentEditing$.next(null))}},v.SheetsHyperLinkPopupService=Jt([ne(0,s.Inject(R.SheetCanvasPopManagerService)),ne(1,s.Inject(s.Injector)),ne(2,s.IUniverInstanceService),ne(3,R.IEditorBridgeService),ne(4,s.Inject(de.DocSelectionManagerService)),ne(5,s.Inject(X.DocCanvasPopManagerService)),ne(6,m.IZenZoneService)],v.SheetsHyperLinkPopupService);var he=(t=>(t[t.ALLOWED=0]="ALLOWED",t[t.DISABLED_BY_CELL=1]="DISABLED_BY_CELL",t[t.ALLOW_ON_EDITING=2]="ALLOW_ON_EDITING",t))(he||{});const Qt=new Set([s.DataValidationType.CHECKBOX,s.DataValidationType.LIST,s.DataValidationType.LIST_MULTIPLE]),Fe=(t,n,e,i)=>{var u,l,h,d,p;const r=n.getCell(e,i);if(r!=null&&r.f||r!=null&&r.si||(h=(l=(u=r==null?void 0:r.p)==null?void 0:u.body)==null?void 0:l.customBlocks)!=null&&h.length)return 1;const o=t.has(tt.SheetDataValidationModel)?t.get(tt.SheetDataValidationModel):null,a=o==null?void 0:o.getRuleByLocation(n.getUnitId(),n.getSheetId(),e,i);return a&&Qt.has(a.type)?!0:(p=(d=r==null?void 0:r.p)==null?void 0:d.drawingsOrder)!=null&&p.length?2:0},en=t=>{const n=t.get(s.IUniverInstanceService).getCurrentUnitForType(s.UniverInstanceType.UNIVER_SHEET);if(!n)return!0;const e=n.getActiveSheet(),i=t.get(f.SheetsSelectionsService).getCurrentSelections();if(!i.length)return!0;const r=i[0].range.startRow,o=i[0].range.startColumn;return Fe(t,e,r,o)===1},tn=t=>{const n=t.get(de.DocSelectionManagerService),e=t.get(s.IUniverInstanceService),i=n.getTextRanges();if(!(i!=null&&i.length))return!0;const r=e.getCurrentUnitForType(s.UniverInstanceType.UNIVER_DOC);return!!(!r||i.every(a=>a.collapsed)||!r.getSelfOrHeaderFooterModel(i[0].segmentId).getBody())},Re={type:s.CommandType.OPERATION,id:"sheet.operation.open-hyper-link-edit-panel",handler(t,n){if(!n)return!1;const e=t.get(v.SheetsHyperLinkPopupService);return n.customRangeId?e.startEditing(n):e.startAddEditing(n),!0}},ve={type:s.CommandType.OPERATION,id:"sheet.operation.close-hyper-link-popup",handler(t){return t.get(v.SheetsHyperLinkPopupService).endEditing(),!0}},Te={type:s.CommandType.OPERATION,id:"sheet.operation.insert-hyper-link",handler(t){var p;const n=t.get(s.IUniverInstanceService),e=f.getSheetCommandTarget(n),i=t.get(R.IEditorBridgeService);if(!e)return!1;const r=t.get(s.ICommandService),a=t.get(f.SheetsSelectionsService).getCurrentLastSelection();if(!a)return!1;const u=a.range.startRow,l=a.range.startColumn,h=i.isVisible(),d=((p=n.getFocusedUnit())==null?void 0:p.getUnitId())===s.DOCS_ZEN_EDITOR_UNIT_ID_KEY;return r.executeCommand(Re.id,{unitId:e.unitId,subUnitId:e.subUnitId,row:u,col:l,type:d?C.ZEN_EDITOR:h.visible?C.EDITING:C.VIEWING})}},ie={type:s.CommandType.OPERATION,id:"sheet.operation.insert-hyper-link-toolbar",handler(t){if(en(t))return!1;const n=t.get(s.ICommandService);return t.get(v.SheetsHyperLinkPopupService).currentEditing?n.executeCommand(ve.id):n.executeCommand(Te.id)}},Ze="SHEET_HYPER_LINK_UI_PLUGIN";var nn=Object.getOwnPropertyDescriptor,rn=(t,n,e,i)=>{for(var r=i>1?void 0:i?nn(n,e):n,o=t.length-1,a;o>=0;o--)(a=t[o])&&(r=a(r)||r);return r},Le=(t,n)=>(e,i)=>n(e,i,t);v.SheetsHyperLinkCopyPasteController=class extends s.Disposable{constructor(e,i,r,o){super();F(this,"_plainTextFilter",new Set);F(this,"_copyInfo");this._sheetClipboardService=e,this._hyperLinkModel=i,this._injector=r,this._resolverService=o,this._initCopyPaste(),this.disposeWithMe(()=>{this._plainTextFilter.clear()})}registerPlainTextFilter(e){this._plainTextFilter.add(e)}removePlainTextFilter(e){this._plainTextFilter.delete(e)}_filterPlainText(e){return Array.from(this._plainTextFilter).every(i=>i(e))}_initCopyPaste(){this._sheetClipboardService.addClipboardHook({id:Ze,onBeforeCopy:(e,i,r)=>this._collect(e,i,r),onPasteCells:(e,i,r,o)=>{const{copyType:a=R.COPY_TYPE.COPY,pasteType:u}=o,{range:l}=e||{},{range:h,unitId:d,subUnitId:p}=i;return this._generateMutations(h,{copyType:a,pasteType:u,copyRange:l,unitId:d,subUnitId:p})},onPastePlainText:(e,i)=>{const r=this._filterPlainText(i);if(ye(i)&&r){const{range:o,unitId:a,subUnitId:u}=e,{ranges:[l],mapFunc:h}=R.virtualizeDiscreteRanges([o]),d=[],p=[];return s.Range.foreach(l,(S,I)=>{const{row:P,col:w}=h(S,I),T=this._hyperLinkModel.getHyperLinkByLocation(a,u,P,w);T&&d.push({id:_.RemoveHyperLinkMutation.id,params:{unitId:a,subUnitId:u,id:T.id}}),T&&p.push({id:_.AddHyperLinkMutation.id,params:{unitId:a,subUnitId:u,link:T}})}),{redos:d,undos:p}}return{undos:[],redos:[]}},priority:99})}_collect(e,i,r){const o=new s.ObjectMatrix;this._copyInfo={unitId:e,subUnitId:i,matrix:o};const a=this._injector.invoke(h=>f.rangeToDiscreteRange(r,h,e,i));if(!a)return;const{rows:u,cols:l}=a;u.forEach((h,d)=>{l.forEach((p,S)=>{var P;const I=this._hyperLinkModel.getHyperLinkByLocation(e,i,h,p);o.setValue(d,S,(P=I==null?void 0:I.id)!=null?P:"")})})}_generateMutations(e,i){if(!this._copyInfo)return{redos:[],undos:[]};if(!this._copyInfo||!this._copyInfo.matrix.getSizeOf()||!i.copyRange)return{redos:[],undos:[]};if([R.PREDEFINED_HOOK_NAME_PASTE.SPECIAL_PASTE_COL_WIDTH,R.PREDEFINED_HOOK_NAME_PASTE.SPECIAL_PASTE_VALUE,R.PREDEFINED_HOOK_NAME_PASTE.SPECIAL_PASTE_FORMAT,R.PREDEFINED_HOOK_NAME_PASTE.SPECIAL_PASTE_FORMULA].includes(i.pasteType))return{redos:[],undos:[]};const{unitId:o,subUnitId:a}=this._copyInfo,u=[],l=[],{ranges:[h,d],mapFunc:p}=R.virtualizeDiscreteRanges([i.copyRange,e]);return R.getRepeatRange(h,d,!0).forEach(({startRange:I})=>{var P;(P=this._copyInfo)==null||P.matrix.forValue((w,T,c)=>{const D=s.Rectangle.getPositionRange({startRow:w,endRow:w,startColumn:T,endColumn:T},I),A=this._hyperLinkModel.getHyperLink(o,a,c),{row:U,col:M}=p(D.startRow,D.startColumn),V=this._hyperLinkModel.getHyperLinkByLocation(i.unitId,i.subUnitId,U,M),B=s.generateRandomId();V&&u.push({id:_.RemoveHyperLinkMutation.id,params:{unitId:i.unitId,subUnitId:i.subUnitId,id:V.id}}),A&&(u.push({id:_.AddHyperLinkMutation.id,params:{unitId:i.unitId,subUnitId:i.subUnitId,link:{...A,id:B,row:U,column:M}}}),l.push({id:_.RemoveHyperLinkMutation.id,params:{unitId:i.unitId,subUnitId:i.subUnitId,id:B}})),V&&l.push({id:_.AddHyperLinkMutation.id,params:{unitId:i.unitId,subUnitId:i.subUnitId,link:V}})})}),{redos:u,undos:l}}},v.SheetsHyperLinkCopyPasteController=rn([Le(0,R.ISheetClipboardService),Le(1,s.Inject(_.HyperLinkModel)),Le(2,s.Inject(s.Injector)),Le(3,s.Inject(v.SheetsHyperLinkResolverService))],v.SheetsHyperLinkCopyPasteController);const Ke=(t,n=s.DOCS_ZEN_EDITOR_UNIT_ID_KEY)=>{var r;const e=t.get(s.IUniverInstanceService),i=(r=t.get(pe.IRenderManagerService).getRenderById(n))==null?void 0:r.with(X.DocSelectionRenderService);return i?i.textSelectionInner$.pipe(O.map(()=>{const a=t.get(R.IEditorBridgeService).getEditCellState();if(!a)return!0;const u=f.getSheetCommandTarget(e,{unitId:a.unitId,subUnitId:a.sheetId});return!(u!=null&&u.worksheet)||Fe(t,u.worksheet,a.row,a.column)===1?!0:tn(t)})):O.of(!0)},dt=t=>{var r;const n=t.get(s.IUniverInstanceService),e=t.has(R.IEditorBridgeService)?t.get(R.IEditorBridgeService):null;return((r=e==null?void 0:e.currentEditCellState$.pipe(O.map(o=>{if(!o)return he.DISABLED_BY_CELL;const a=f.getSheetCommandTarget(n,{unitId:o.unitId,subUnitId:o.sheetId});return a?Fe(t,a.worksheet,o.row,o.column):he.DISABLED_BY_CELL}),O.switchMap(o=>{if(o===he.DISABLED_BY_CELL)return O.of(!0);const a=e?e.visible$:O.of(null);return O.combineLatest([a,n.getCurrentTypeOfUnit$(s.UniverInstanceType.UNIVER_DOC)]).pipe(O.switchMap(([u,l])=>u!=null&&u.visible?(l==null?void 0:l.getUnitId())===s.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY?O.of(!0):Ke(t,s.DOCS_NORMAL_EDITOR_UNIT_ID_KEY):O.of(o!==he.ALLOWED)))})))!=null?r:O.of(!0)).pipe(O.switchMap(o=>o?O.of(!0):R.getCurrentRangeDisable$(t,{workbookTypes:[f.WorkbookEditablePermission],worksheetTypes:[f.WorksheetEditPermission,f.WorksheetSetCellValuePermission,f.WorksheetInsertHyperlinkPermission],rangeTypes:[f.RangeProtectionPermissionEditPoint]},!0)))},we={commandId:Te.id,type:m.MenuItemType.BUTTON,title:"hyperLink.menu.add",icon:"LinkIcon"},De=t=>`${t}-zen-editor`,sn=t=>({...we,id:we.commandId,hidden$:m.getMenuHiddenObservable(t,s.UniverInstanceType.UNIVER_SHEET),disabled$:dt(t)}),on=t=>({...we,id:De(we.commandId),hidden$:m.getMenuHiddenObservable(t,s.UniverInstanceType.UNIVER_DOC,s.DOCS_ZEN_EDITOR_UNIT_ID_KEY),disabled$:Ke(t)}),ke={tooltip:"hyperLink.form.addTitle",commandId:ie.id,type:m.MenuItemType.BUTTON,icon:"LinkIcon"},an=t=>({...ke,id:ke.commandId,hidden$:m.getMenuHiddenObservable(t,s.UniverInstanceType.UNIVER_SHEET),disabled$:dt(t)}),cn=t=>({...ke,id:De(ke.commandId),hidden$:m.getMenuHiddenObservable(t,s.UniverInstanceType.UNIVER_DOC,s.DOCS_ZEN_EDITOR_UNIT_ID_KEY),disabled$:Ke(t)}),We={id:ie.id,binding:m.KeyCode.K|m.MetaKeys.CTRL_COMMAND,preconditions:R.whenSheetEditorFocused},pt={name:"@univerjs/sheets-hyper-link-ui",version:"0.17.0"};var un=Object.getOwnPropertyDescriptor,ln=(t,n,e,i)=>{for(var r=i>1?void 0:i?un(n,e):n,o=t.length-1,a;o>=0;o--)(a=t[o])&&(r=a(r)||r);return r},ht=(t,n)=>(e,i)=>n(e,i,t);let be=class extends s.Disposable{constructor(t,n){super(),this._autoFillService=t,this._hyperLinkModel=n,this._initAutoFill()}_initAutoFill(){const t=()=>({redos:[],undos:[]}),n=(i,r)=>{const{source:o,target:a,unitId:u,subUnitId:l}=i,h=R.virtualizeDiscreteRanges([o,a]),[d,p]=h.ranges,{mapFunc:S}=h,I={row:d.startRow,col:d.startColumn},P=f.AutoFillTools.getAutoFillRepeatRange(d,p),w=[],T=[];return P.forEach(c=>{const D=c.repeatStartCell,A=c.relativeRange,U={startRow:I.row,startColumn:I.col,endColumn:I.col,endRow:I.row},M={startRow:D.row,startColumn:D.col,endColumn:D.col,endRow:D.row};s.Range.foreach(A,(V,B)=>{const z=s.Rectangle.getPositionRange({startRow:V,startColumn:B,endColumn:B,endRow:V},U),{row:re,col:Ae}=S(z.startRow,z.startColumn),se=this._hyperLinkModel.getHyperLinkByLocation(u,l,re,Ae),Ie=s.Rectangle.getPositionRange({startRow:V,startColumn:B,endColumn:B,endRow:V},M),{row:Se,col:_e}=S(Ie.startRow,Ie.startColumn),$e=s.generateRandomId(),ce=this._hyperLinkModel.getHyperLinkByLocation(u,l,Se,_e);ce&&w.push({id:_.RemoveHyperLinkMutation.id,params:{unitId:u,subUnitId:l,id:ce.id}}),(f.AUTO_FILL_APPLY_TYPE.COPY===r||f.AUTO_FILL_APPLY_TYPE.SERIES===r)&&se&&(w.push({id:_.AddHyperLinkMutation.id,params:{unitId:u,subUnitId:l,link:{...se,id:$e,row:Se,column:_e}}}),T.push({id:_.RemoveHyperLinkMutation.id,params:{unitId:u,subUnitId:l,id:$e}})),ce&&T.push({id:_.AddHyperLinkMutation.id,params:{unitId:u,subUnitId:l,link:ce}})})}),{undos:T,redos:w}},e={id:Ze,onFillData:(i,r,o)=>o===f.AUTO_FILL_APPLY_TYPE.COPY||o===f.AUTO_FILL_APPLY_TYPE.ONLY_FORMAT||o===f.AUTO_FILL_APPLY_TYPE.SERIES?n(i,o):t()};this.disposeWithMe(this._autoFillService.addHook(e))}};be=ln([ht(0,f.IAutoFillService),ht(1,s.Inject(_.HyperLinkModel))],be);var dn=Object.getOwnPropertyDescriptor,pn=(t,n,e,i)=>{for(var r=i>1?void 0:i?dn(n,e):n,o=t.length-1,a;o>=0;o--)(a=t[o])&&(r=a(r)||r);return r},Ye=(t,n)=>(e,i)=>n(e,i,t);let Oe=class extends s.Disposable{constructor(t,n,e){super(),this._localeService=t,this._commandService=n,this._sheetPermissionCheckController=e,this._commandExecutedListener()}_commandExecutedListener(){this.disposeWithMe(this._commandService.beforeCommandExecuted(t=>{t.id===We.id&&(this._sheetPermissionCheckController.permissionCheckWithRanges({workbookTypes:[f.WorkbookEditablePermission],rangeTypes:[f.RangeProtectionPermissionEditPoint],worksheetTypes:[f.WorksheetEditPermission,f.WorksheetSetCellValuePermission,f.WorksheetInsertHyperlinkPermission]})||this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t("permission.dialog.hyperLinkErr")))}))}};Oe=pn([Ye(0,s.Inject(s.LocaleService)),Ye(1,s.ICommandService),Ye(2,s.Inject(f.SheetPermissionCheckController))],Oe);var hn=Object.getOwnPropertyDescriptor,vn=(t,n,e,i)=>{for(var r=i>1?void 0:i?hn(n,e):n,o=t.length-1,a;o>=0;o--)(a=t[o])&&(r=a(r)||r);return r},Z=(t,n)=>(e,i)=>n(e,i,t);let Ne=class extends s.Disposable{constructor(t,n,e,i,r,o,a,u,l,h){super(),this._hoverManagerService=t,this._sheetsHyperLinkPopupService=n,this._renderManagerService=e,this._permissionService=i,this._sheetPermissionCheckController=r,this._commandService=o,this._editorBridgeService=a,this._textSelectionManagerService=u,this._univerInstanceService=l,this._zenZoneService=h,this._initHoverListener(),this._initCommandListener(),this._initHoverEditingListener(),this._initTextSelectionListener(),this._initZenEditor()}_getLinkPermission(t){const{unitId:n,subUnitId:e,row:i,col:r}=t,o=this._univerInstanceService.getUnit(n,s.UniverInstanceType.UNIVER_SHEET),a=o==null?void 0:o.getSheetBySheetId(e);if(!a)return{viewPermission:!1,editPermission:!1,copyPermission:!1};const u=this._sheetPermissionCheckController.permissionCheckWithRanges({workbookTypes:[f.WorkbookViewPermission],worksheetTypes:[f.WorksheetViewPermission],rangeTypes:[f.RangeProtectionPermissionViewPoint]},[{startRow:i,startColumn:r,endRow:i,endColumn:r}],n,e);let l=this._sheetPermissionCheckController.permissionCheckWithRanges({workbookTypes:[f.WorkbookEditablePermission],worksheetTypes:[f.WorksheetEditPermission,f.WorksheetInsertHyperlinkPermission],rangeTypes:[f.RangeProtectionPermissionEditPoint]},[{startRow:i,startColumn:r,endRow:i,endColumn:r}],n,e);const h=a.getCellRaw(i,r);h!=null&&h.f&&h.f.startsWith("=HYPERLINK(")&&(l=!1);const d=this._permissionService.composePermission([new f.WorkbookCopyPermission(n).id,new f.WorksheetCopyPermission(n,e).id]).every(p=>p.value);return{viewPermission:u,editPermission:l,copyPermission:d}}_initHoverListener(){this.disposeWithMe(this._hoverManagerService.currentRichText$.pipe(O.debounceTime(200)).subscribe(t=>{var U,M,V;if(!t||((U=t.customRange)==null?void 0:U.rangeType)!==s.CustomRangeType.HYPERLINK){this._sheetsHyperLinkPopupService.hideCurrentPopup();return}const{unitId:n,subUnitId:e,row:i,col:r}=t,o=this._renderManagerService.getRenderById(n);if(!o)return;const a=this._univerInstanceService.getUnit(n,s.UniverInstanceType.UNIVER_SHEET),u=a==null?void 0:a.getSheetBySheetId(e);if(!u)return;if(!o.with(R.HoverRenderController).active){this._sheetsHyperLinkPopupService.hideCurrentPopup(C.VIEWING);return}const h=(M=o==null?void 0:o.with(R.SheetSkeletonManagerService).getSkeletonParam(e))==null?void 0:M.skeleton,d=r,p=i;let S=p,I=d;h&&h.overflowCache.forValue((B,z,re)=>{s.Rectangle.contains(re,{startColumn:d,endColumn:d,startRow:p,endRow:p})&&(S=B,I=z)});const{viewPermission:P,editPermission:w,copyPermission:T}=this._getLinkPermission(t);if(!P){this._sheetsHyperLinkPopupService.hideCurrentPopup();return}const c=u.getCellStyleOnly(S,I),D=a.getStyles().getStyleByCell(c),A=(V=D==null?void 0:D.tr)==null?void 0:V.a;if(!A&&!t.customRange){this._sheetsHyperLinkPopupService.hideCurrentPopup();return}this._sheetsHyperLinkPopupService.showPopup({row:S,col:I,editPermission:w,copyPermission:T,customRange:t.customRange,customRangeRect:t.rect,type:C.VIEWING,unitId:n,subUnitId:e,showAll:!!A})}))}_initHoverEditingListener(){let t=null;this.disposeWithMe(this._editorBridgeService.currentEditCellState$.pipe(O.switchMap(n=>this._editorBridgeService.visible$.pipe(O.map(e=>({visible:e,state:n}))))).subscribe(({visible:n,state:e})=>{if(!e||e.editorUnitId!==s.DOCS_NORMAL_EDITOR_UNIT_ID_KEY)return;if(!n.visible){t==null||t.unsubscribe(),this._sheetsHyperLinkPopupService.hideCurrentPopup(C.EDITING),this._sheetsHyperLinkPopupService.endEditing(C.EDITING);return}const{editorUnitId:i,unitId:r,sheetId:o,row:a,column:u}=e,l=this._renderManagerService.getRenderById(i);if(!l)return;const{editPermission:h,viewPermission:d,copyPermission:p}=this._getLinkPermission({unitId:r,subUnitId:o,row:a,col:u}),S=l.with(X.DocEventManagerService);d&&(t==null||t.unsubscribe(),t=S.hoverCustomRanges$.pipe(O.debounceTime(200)).subscribe(I=>{var D,A;const P=I.find(U=>U.range.rangeType===s.CustomRangeType.HYPERLINK);if(!P){this._sheetsHyperLinkPopupService.hideCurrentPopup();return}const w=P.rects[P.rects.length-1];if(!((A=(D=this._renderManagerService.getRenderById(r))==null?void 0:D.with(R.SheetSkeletonManagerService).getSkeletonParam(o))==null?void 0:A.skeleton)||!w)return;const c=l.engine.getCanvasElement().getBoundingClientRect();this._sheetsHyperLinkPopupService.showPopup({unitId:r,subUnitId:o,row:a,col:u,customRange:P.range,customRangeRect:{left:w.left+c.left,top:w.top+c.top,bottom:w.bottom+c.top,right:w.right+c.left},editPermission:h,copyPermission:p,type:C.EDITING})}))})),this.disposeWithMe(()=>{t==null||t.unsubscribe()})}_initZenEditor(){this.disposeWithMe(this._zenZoneService.visible$.subscribe(t=>{t?(this._sheetsHyperLinkPopupService.hideCurrentPopup(C.VIEWING),this._sheetsHyperLinkPopupService.hideCurrentPopup(C.EDITING),this._sheetsHyperLinkPopupService.endEditing(C.EDITING),this._sheetsHyperLinkPopupService.hideCurrentPopup(C.VIEWING)):(this._sheetsHyperLinkPopupService.hideCurrentPopup(C.ZEN_EDITOR),this._sheetsHyperLinkPopupService.endEditing(C.ZEN_EDITOR))})),this.disposeWithMe(this._univerInstanceService.focused$.pipe(O.switchMap(t=>{const n=t===s.DOCS_ZEN_EDITOR_UNIT_ID_KEY?this._renderManagerService.getRenderById(t):null;return n?n.with(X.DocEventManagerService).hoverCustomRanges$.pipe(O.debounceTime(200)):new O.Observable(e=>{e.next(null)})})).subscribe(t=>{const n=t==null?void 0:t.find(i=>i.range.rangeType===s.CustomRangeType.HYPERLINK),e=this._editorBridgeService.getEditCellState();if(n&&e){const{unitId:i,sheetId:r,row:o,column:a}=e,{editPermission:u,viewPermission:l,copyPermission:h}=this._getLinkPermission({unitId:i,subUnitId:r,row:o,col:a});l&&this._sheetsHyperLinkPopupService.showPopup({type:C.ZEN_EDITOR,unitId:i,subUnitId:r,row:o,col:a,customRange:n.range,editPermission:u,copyPermission:h})}else this._sheetsHyperLinkPopupService.hideCurrentPopup(C.ZEN_EDITOR)}))}_initTextSelectionListener(){this.disposeWithMe(this._textSelectionManagerService.textSelection$.subscribe(t=>{t&&t.unitId===s.DOCS_NORMAL_EDITOR_UNIT_ID_KEY&&this._sheetsHyperLinkPopupService.endEditing(C.EDITING)}))}_initCommandListener(){const t=[f.ClearSelectionContentCommand.id,f.ClearSelectionAllCommand.id,f.ClearSelectionFormatCommand.id];this.disposeWithMe(this._commandService.onCommandExecuted(n=>{t.includes(n.id)&&this._sheetsHyperLinkPopupService.hideCurrentPopup()}))}};Ne=vn([Z(0,s.Inject(R.HoverManagerService)),Z(1,s.Inject(v.SheetsHyperLinkPopupService)),Z(2,s.Inject(pe.IRenderManagerService)),Z(3,s.Inject(s.IPermissionService)),Z(4,s.Inject(f.SheetPermissionCheckController)),Z(5,s.ICommandService),Z(6,R.IEditorBridgeService),Z(7,s.Inject(de.DocSelectionManagerService)),Z(8,s.IUniverInstanceService),Z(9,m.IZenZoneService)],Ne);var gn=Object.getOwnPropertyDescriptor,vt=(t,n,e,i)=>{for(var r=i>1?void 0:i?gn(n,e):n,o=t.length-1,a;o>=0;o--)(a=t[o])&&(r=a(r)||r);return r},Ge=(t,n)=>(e,i)=>n(e,i,t);let ze=class extends s.Disposable{constructor(t,n){super(),this._context=t,this._hyperLinkModel=n,this._initSkeletonChange()}_initSkeletonChange(){const t=()=>{var n;(n=this._context.mainComponent)==null||n.makeForceDirty()};this.disposeWithMe(this._hyperLinkModel.linkUpdate$.pipe(O.debounceTime(16)).subscribe(()=>{t()}))}};ze=vt([Ge(1,s.Inject(_.HyperLinkModel))],ze);let Ue=class extends s.Disposable{constructor(t,n){super(),this._sheetInterceptorService=t,this._hyperLinkModel=n,this._initViewModelIntercept()}_initViewModelIntercept(){this.disposeWithMe(this._sheetInterceptorService.intercept(f.INTERCEPTOR_POINT.CELL_CONTENT,{effect:s.InterceptorEffectEnum.Value,priority:100,handler:(t,n,e)=>{const{row:i,col:r,unitId:o,subUnitId:a}=n,u=this._hyperLinkModel.getHyperLinkByLocation(o,a,i,r);return u&&t&&(t===n.rawData&&(t={...n.rawData}),t.linkUrl=u.payload,t.linkId=u.id),e(t)}}))}};Ue=vt([Ge(0,s.Inject(f.SheetInterceptorService)),Ge(1,s.Inject(_.HyperLinkModel))],Ue);const In={[m.RibbonInsertGroup.MEDIA]:{[ie.id]:{order:1,menuItemFactory:an},[De(ie.id)]:{order:1,menuItemFactory:cn}},[m.ContextMenuPosition.MAIN_AREA]:{[m.ContextMenuGroup.OTHERS]:{order:1,[ie.id]:{order:0,menuItemFactory:sn},[De(ie.id)]:{order:0,menuItemFactory:on}}}};var Sn=Object.getOwnPropertyDescriptor,_n=(t,n,e,i)=>{for(var r=i>1?void 0:i?Sn(n,e):n,o=t.length-1,a;o>=0;o--)(a=t[o])&&(r=a(r)||r);return r},ge=(t,n)=>(e,i)=>n(e,i,t);let Me=class extends s.Disposable{constructor(t,n,e,i,r){super(),this._componentManager=t,this._commandService=n,this._menuManagerService=e,this._injector=i,this._shortcutService=r,this._initComponents(),this._initCommands(),this._initMenus(),this._initShortCut()}_initComponents(){[[Pe.componentKey,Pe],[Ce.componentKey,Ce],["LinkIcon",je]].forEach(([t,n])=>{this._componentManager.register(t,n)})}_initCommands(){[Re,ve,Te,ie].forEach(t=>{this._commandService.registerCommand(t)})}_initMenus(){this._menuManagerService.mergeMenu(In)}_initShortCut(){this._shortcutService.registerShortcut(We)}};Me=_n([ge(0,s.Inject(m.ComponentManager)),ge(1,s.ICommandService),ge(2,m.IMenuManagerService),ge(3,s.Inject(s.Injector)),ge(4,s.Inject(m.IShortcutService))],Me);var mn=Object.getOwnPropertyDescriptor,fn=(t,n,e,i)=>{for(var r=i>1?void 0:i?mn(n,e):n,o=t.length-1,a;o>=0;o--)(a=t[o])&&(r=a(r)||r);return r},gt=(t,n)=>(e,i)=>n(e,i,t);let He=class extends s.Disposable{constructor(t,n){super(),this._parserService=t,this._resolverService=n,this._handleInitUrl()}_handleInitUrl(){const t=location.hash;if(t){const n=this._parserService.parseHyperLink(t);this._resolverService.navigate(n)}}};He=fn([gt(0,s.Inject(_.SheetsHyperLinkParserService)),gt(1,s.Inject(v.SheetsHyperLinkResolverService))],He);var yn=Object.defineProperty,Cn=Object.getOwnPropertyDescriptor,En=(t,n,e)=>n in t?yn(t,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[n]=e,Pn=(t,n,e,i)=>{for(var r=i>1?void 0:i?Cn(n,e):n,o=t.length-1,a;o>=0;o--)(a=t[o])&&(r=a(r)||r);return r},It=(t,n)=>(e,i)=>n(e,i,t),xe=(t,n,e)=>En(t,typeof n!="symbol"?n+"":n,e);v.UniverSheetsHyperLinkUIPlugin=class extends s.Plugin{constructor(n=it,e,i){super(),this._config=n,this._injector=e,this._configService=i;const{menu:r,...o}=s.merge({},it,this._config);r&&this._configService.setConfig("menu",r,{merge:!0}),this._configService.setConfig(nt,o)}onStarting(){[[v.SheetsHyperLinkResolverService],[v.SheetsHyperLinkPopupService],[Ve],[Ue],[Ne],[Me],[be],[v.SheetsHyperLinkCopyPasteController],[Oe],[He]].forEach(e=>this._injector.add(e)),this._injector.get(Ue)}onReady(){this._injector.get(pe.IRenderManagerService).registerRenderModule(s.UniverInstanceType.UNIVER_SHEET,[ze]),this._injector.get(be),this._injector.get(v.SheetsHyperLinkCopyPasteController),this._injector.get(Me)}onRendered(){this._injector.get(Oe),this._injector.get(He),this._injector.get(Ne)}},xe(v.UniverSheetsHyperLinkUIPlugin,"pluginName",Ze),xe(v.UniverSheetsHyperLinkUIPlugin,"packageName",pt.name),xe(v.UniverSheetsHyperLinkUIPlugin,"version",pt.version),xe(v.UniverSheetsHyperLinkUIPlugin,"type",s.UniverInstanceType.UNIVER_SHEET),v.UniverSheetsHyperLinkUIPlugin=Pn([s.DependentOn(_.UniverSheetsHyperLinkPlugin,X.UniverDocsUIPlugin),It(1,s.Inject(s.Injector)),It(2,s.IConfigService)],v.UniverSheetsHyperLinkUIPlugin),v.CloseHyperLinkPopupOperation=ve,v.InsertHyperLinkOperation=Te,v.InsertLinkShortcut=We,v.OpenHyperLinkEditPanelOperation=Re,v.SheetsHyperLinkSidePanelService=Ve,Object.defineProperty(v,Symbol.toStringTag,{value:"Module"})}));
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`@univerjs/core`),require(`@univerjs/sheets`),require(`@univerjs/sheets-ui`),require(`@univerjs/docs`),require(`@univerjs/docs-ui`),require(`@univerjs/engine-render`),require(`@univerjs/ui`),require(`rxjs`),require(`@univerjs/design`),require(`@univerjs/engine-formula`),require(`@univerjs/sheets-formula-ui`),require(`@univerjs/sheets-hyper-link`),require(`react`),require(`react/jsx-runtime`),require(`@univerjs/sheets-data-validation`)):typeof define==`function`&&define.amd?define([`exports`,`@univerjs/core`,`@univerjs/sheets`,`@univerjs/sheets-ui`,`@univerjs/docs`,`@univerjs/docs-ui`,`@univerjs/engine-render`,`@univerjs/ui`,`rxjs`,`@univerjs/design`,`@univerjs/engine-formula`,`@univerjs/sheets-formula-ui`,`@univerjs/sheets-hyper-link`,`react`,`react/jsx-runtime`,`@univerjs/sheets-data-validation`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.UniverSheetsHyperLinkUi={},e.UniverCore,e.UniverSheets,e.UniverSheetsUi,e.UniverDocs,e.UniverDocsUi,e.UniverEngineRender,e.UniverUi,e.rxjs,e.UniverDesign,e.UniverEngineFormula,e.UniverSheetsFormulaUi,e.UniverSheetsHyperLink,e.React,e.React,e.UniverSheetsDataValidation))})(this,function(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});let g=function(e){return e.EDITING=`editing`,e.VIEWING=`viewing`,e.ZEN_EDITOR=`zen_mode`,e}({});function _(e){return t.Tools.isLegalUrl(e)}function v(e){return/^[a-zA-Z]+:\/\//.test(e)}function y(e){return/^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/.test(e)}function b(e){if(_(e)){let t=v(e)?e:y(e)?`mailto://${e}`:`http://${e}`,n;try{n=new URL(t)}catch{return e}return n.hostname===location.hostname&&n.port===location.port&&n.protocol===location.protocol&&n.pathname===location.pathname&&n.hash&&!n.search?n.hash:t}return e}let x=`sheets-hyper-link-ui.config`;Symbol(x);let S={};function C(e,t){return function(n,r){t(n,r,e)}}function w(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}function T(e,n){let r=n.getMergeData(),i=n.getMaxColumns()-1,a=n.getMaxRows()-1;if(i<e.endColumn&&(e.endColumn=i),a<e.endRow&&(e.endRow=a),e.rangeType===t.RANGE_TYPE.COLUMN||t.RANGE_TYPE.ROW)return e;let o=[];return r.forEach(n=>{t.Rectangle.intersects(e,n)&&o.push(n)}),t.Rectangle.realUnion(e,...o)}let E=class{constructor(e,t,n,r,i,a){this._univerInstanceService=e,this._commandService=t,this._definedNamesService=n,this._messageService=r,this._localeService=i,this._configService=a}navigate(e){switch(e.type){case f.SheetHyperLinkType.URL:this.navigateToOtherWebsite(e.url);break;default:this._navigateToUniver(e.searchObj)}}_navigateToUniver(e){let{gid:n,range:r,rangeid:i}=e,a=this._univerInstanceService.getCurrentUnitForType(t.UniverInstanceType.UNIVER_SHEET);if(!a)return;let o=a.getUnitId();if(i){let e=this._definedNamesService.getValueById(o,i);if(!e)return;let{formulaOrRefString:t}=e,n=this._definedNamesService.getWorksheetByRef(o,t);if(!n){this._messageService.show({content:this._localeService.t(`hyperLink.message.refError`),type:l.MessageType.Error});return}if(n.isSheetHidden()){this._messageService.show({content:this._localeService.t(`hyperLink.message.hiddenSheet`),type:l.MessageType.Error});return}this.navigateToDefineName(o,i)}if(n){if(r){let e=(0,u.deserializeRangeWithSheet)(r);(0,t.isValidRange)(e.range)&&r!==f.ERROR_RANGE&&this.navigateToRange(o,n,e.range);return}this.navigateToSheetById(o,n)}}async navigateToRange(e,t,i,a){let o=await this.navigateToSheetById(e,t);if(o){let s=T(i,o);await this._commandService.executeCommand(n.SetSelectionsOperation.id,{unitId:e,subUnitId:t,selections:[{range:s,primary:null}]}),await this._commandService.executeCommand(r.ScrollToRangeOperation.id,{range:s,forceTop:a})}}async navigateToSheetById(e,r){let i=this._univerInstanceService.getUnit(e,t.UniverInstanceType.UNIVER_SHEET);if(!i)return!1;let a=i.getActiveSheet();if(!a)return!1;if(a.getSheetId()===r)return a;let o=i.getSheetBySheetId(r);return o?i.getHiddenWorksheets().indexOf(r)>-1?(this._messageService.show({content:this._localeService.t(`hyperLink.message.hiddenSheet`),type:l.MessageType.Error}),!1):await this._commandService.executeCommand(n.SetWorksheetActiveOperation.id,{unitId:e,subUnitId:r})?o:!1:(this._messageService.show({content:this._localeService.t(`hyperLink.message.noSheet`),type:l.MessageType.Error}),!1)}async navigateToDefineName(e,t){return this._definedNamesService.focusRange(e,t),!0}async navigateToOtherWebsite(e){var t;let n=this._configService.getConfig(x);if(!(n==null||(t=n.urlHandler)==null)&&t.navigateToOtherWebsite)return n.urlHandler.navigateToOtherWebsite(e);window.open(e,`_blank`,`noopener noreferrer`)}};E=w([C(0,t.IUniverInstanceService),C(1,t.ICommandService),C(2,u.IDefinedNamesService),C(3,s.IMessageService),C(4,(0,t.Inject)(t.LocaleService)),C(5,t.IConfigService)],E);function D(e){"@babel/helpers - typeof";return D=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},D(e)}function O(e,t){if(D(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(D(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function k(e){var t=O(e,`string`);return D(t)==`symbol`?t:t+``}function A(e,t,n){return(t=k(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ee=class extends t.Disposable{constructor(...e){super(...e),A(this,`_customHyperLinks`,new Map)}isBuiltInLinkType(e){return e!==f.SheetHyperLinkType.URL}getOptions(){return Array.from(this._customHyperLinks.values()).map(({option:e})=>e)}findCustomHyperLink(e){return Array.from(this._customHyperLinks.values()).find(t=>t.match(e))}registerCustomHyperLink(e){this._customHyperLinks.set(e.type,e)}getCustomHyperLink(e){return this._customHyperLinks.get(e)}removeCustomHyperLink(e){let{_customHyperLinks:t}=this;t.delete(e)}dispose(){super.dispose(),this._customHyperLinks.clear()}};let j=()=>{var e;let[c,h]=(0,p.useState)(``),[v,y]=(0,p.useState)(!1),[x,S]=(0,p.useState)(``),[C,w]=(0,p.useState)(!0),[T,D]=(0,p.useState)(f.SheetHyperLinkType.URL),[O,k]=(0,p.useState)(``),A=(0,s.useDependency)(t.LocaleService),j=(0,s.useDependency)(u.IDefinedNamesService),M=(0,s.useDependency)(r.IEditorBridgeService),N=(0,s.useDependency)(t.IUniverInstanceService),P=(0,s.useDependency)(U),F=(0,s.useObservable)(P.currentEditing$),te=(0,s.useDependency)(f.SheetsHyperLinkParserService),ne=(0,s.useDependency)(E),I=(0,s.useDependency)(t.ICommandService),L=(0,s.useDependency)(ee),re=(0,p.useMemo)(()=>L.getOptions(),[L]),R=(0,s.useDependency)(s.IZenZoneService),z=(0,s.useDependency)(o.IRenderManagerService),ie=(0,s.useDependency)(r.IMarkSelectionService),ae=(0,s.useDependency)(i.DocSelectionManagerService),B=(0,s.useDependency)(t.IContextService),oe=(0,s.useDependency)(t.ThemeService),se=(0,s.useDependency)(i.DocSelectionManagerService),[ce,le]=(0,p.useState)(!1),ue=(0,s.useDependency)(n.SheetsSelectionsService),V=(0,p.useMemo)(()=>ue.getCurrentSelections(),[]),H=(0,p.useMemo)(()=>{if(!L.isBuiltInLinkType(T))return L.getCustomHyperLink(T)},[L,T]),[W,de]=(0,p.useState)(!1),[G,fe]=(0,p.useState)(!1),K=(0,p.useRef)(!1),q=N.getCurrentUnitForType(t.UniverInstanceType.UNIVER_SHEET),pe=(q==null?void 0:q.getActiveSheet().getSheetId())||``,Y=(0,p.useCallback)(e=>{S(e.replaceAll(t.DataStreamTreeTokenType.CUSTOM_RANGE_START,``).replaceAll(t.DataStreamTreeTokenType.CUSTOM_RANGE_END,``))},[S]);(0,p.useEffect)(()=>{if((F==null?void 0:F.row)!==void 0&&F.col!==void 0){let{customRange:b,row:x,col:S}=F,{label:C}=F;typeof C==`number`&&(C=`${C}`);let T;if(b){var e,n,r,i;T={id:(e=b==null?void 0:b.rangeId)==null?``:e,display:(n=C)==null?``:n,payload:(r=b==null||(i=b.properties)==null?void 0:i.url)==null?``:r,row:x,column:S}}else if(F.type===g.VIEWING){var a,o,s,c;let e=N.getUnit(F.unitId),n=e==null?void 0:e.getSheetBySheetId(F.subUnitId),r=n==null?void 0:n.getCellRaw(F.row,F.col),i=r==null||(a=r.p)==null||(a=a.body)==null||(a=a.customRanges)==null?void 0:a.find(e=>{var n;return e.rangeType===t.CustomRangeType.HYPERLINK&&((n=e.properties)==null?void 0:n.url)}),l=r==null?void 0:r.v;r&&(!t.BuildTextUtils.transform.isEmptyDocument((o=r.p)==null||(o=o.body)==null?void 0:o.dataStream)||t.Tools.isDefine(l))&&w(!1),T={id:``,display:``,payload:(s=i==null||(c=i.properties)==null?void 0:c.url)==null?``:s,row:x,column:S}}else{var l,d,p,m,_;let e=N.getCurrentUnitForType(t.UniverInstanceType.UNIVER_DOC),n=ae.getActiveTextRange(),r=e==null?void 0:e.getBody(),i=n&&r?n:null,a=i&&((l=t.BuildTextUtils.customRange.getCustomRangesInterestsWithSelection(i,(d=r==null?void 0:r.customRanges)==null?[]:d))==null?void 0:l[0]);w(!1),T={id:``,display:(p=C)==null?``:p,payload:(m=a==null||(_=a.properties)==null?void 0:_.url)==null?``:m,row:x,column:S}}h(T.id);let E=L.findCustomHyperLink(T);if(E){let e=E.convert(T);D(e.type),k(e.payload),Y(e.display);return}Y(T.display);let O=te.parseHyperLink(T.payload);switch(D(O.type===f.SheetHyperLinkType.INVALID?f.SheetHyperLinkType.RANGE:O.type),O.type){case f.SheetHyperLinkType.URL:k(O.url),O.url===T.display&&(K.current=!0);break;case f.SheetHyperLinkType.RANGE:{var v,y;let e=O.searchObj,t=(0,u.serializeRangeWithSheet)(e.gid?(v=(y=N.getUnit(F.unitId))==null||(y=y.getSheetBySheetId(e.gid))==null?void 0:y.getName())==null?``:v:``,(0,u.deserializeRangeWithSheet)(e.range).range);k(t),t===T.display&&(K.current=!0);break}case f.SheetHyperLinkType.SHEET:{let e=O.searchObj;k(e.gid);break}case f.SheetHyperLinkType.DEFINE_NAME:{let e=O.searchObj;k(e.rangeid);break}default:k(``);break}}},[F,ne,L,ae,N]),(0,p.useEffect)(()=>{let e=null;if(F&&!F.customRangeId&&F.type===g.VIEWING&&t.Tools.isDefine(F.row)&&t.Tools.isDefine(F.col)){let n=N.getUnit(F.unitId,t.UniverInstanceType.UNIVER_SHEET),r=n==null?void 0:n.getSheetBySheetId(F.subUnitId),i=r==null?void 0:r.getMergedCell(F.row,F.col),a=new t.ColorKit(oe.getColorFromTheme(`primary.600`)).toRgb();e=ie.addShape({range:i==null?{startColumn:F.col,endColumn:F.col,startRow:F.row,endRow:F.row}:i,style:{fill:`rgb(${a.r}, ${a.g}, ${a.b}, 0.12)`,strokeWidth:1,stroke:`#FFBD37`,widgets:{}},primary:null},[],-1)}return()=>{e&&ie.removeShape(e)}},[F,ie,oe,N]),(0,p.useEffect)(()=>{fe(T===f.SheetHyperLinkType.RANGE)},[T]),(0,p.useEffect)(()=>{let e=(F==null?void 0:F.type)===g.ZEN_EDITOR?z.getRenderById(t.DOCS_ZEN_EDITOR_UNIT_ID_KEY):z.getRenderById(M.getCurrentEditorId()),n=new t.DisposableCollection;if(e){let t=e.with(a.DocSelectionRenderService);t.setReserveRangesStatus(!0),n.add(()=>{t.setReserveRangesStatus(!1)})}return()=>{M.disableForceKeepVisible(),n.dispose()}},[F==null?void 0:F.type,M,z]),(0,p.useEffect)(()=>(G&&P.setIsKeepVisible(G),P.setIsKeepVisible(ce),()=>{P.setIsKeepVisible(!1)}),[G,ce,P]),(0,p.useEffect)(()=>()=>{R.temporaryHidden&&(R.show(),B.setContextValue(t.FOCUSING_SHEET,!1))},[B,R]),(0,p.useEffect)(()=>{if(G)return M.enableForceKeepVisible(),()=>{M.disableForceKeepVisible()}},[G,M]);let me=[{label:A.t(`hyperLink.form.link`),value:f.SheetHyperLinkType.URL},{label:A.t(`hyperLink.form.range`),value:f.SheetHyperLinkType.RANGE},{label:A.t(`hyperLink.form.worksheet`),value:f.SheetHyperLinkType.SHEET},{label:A.t(`hyperLink.form.definedName`),value:f.SheetHyperLinkType.DEFINE_NAME},...re];if(!q)return;let X=q.getHiddenWorksheets(),Z=q.getSheets().map(e=>({label:e.getName(),value:e.getSheetId()})).filter(e=>X.indexOf(e.value)===-1),he=Object.values((e=j.getDefinedNameMap(q.getUnitId()))==null?{}:e).map(e=>({label:e.name,value:e.id})),Q=(e,t)=>{if(e===f.SheetHyperLinkType.URL)return b(t);if(e===f.SheetHyperLinkType.RANGE){let e=(0,u.deserializeRangeWithSheet)(t),n=q.getSheetBySheetName(e.sheetName);if(n)return`#gid=${n.getSheetId()}&range=${(0,u.serializeRange)(e.range)}`}return`#${e}=${t}`},ge=(0,s.useEvent)(e=>{let n=e.split(`,`).map(u.deserializeRangeWithSheet)[0];if(!n||!(0,t.isValidRange)(n.range))return;if(!n.sheetName){var r;n.sheetName=((r=q.getActiveSheet())==null?void 0:r.getName())||``}let i=(0,u.serializeRangeToRefString)(n);k(i),i&&(K.current||!x)&&(Y(i),K.current=!0)}),_e=async()=>{if(C&&!x||!O||T===f.SheetHyperLinkType.URL&&!_(O)){de(!0);return}if(F)if(c){let e=F.type===g.ZEN_EDITOR||F.type===g.EDITING?f.UpdateRichHyperLinkCommand.id:f.UpdateHyperLinkCommand.id;await I.executeCommand(e,{id:c,unitId:F.unitId,subUnitId:F.subUnitId,payload:{display:C?x:``,payload:Q(T,O)},row:F.row,column:F.col,documentId:F.type===g.ZEN_EDITOR?t.DOCS_ZEN_EDITOR_UNIT_ID_KEY:M.getCurrentEditorId()})}else{let e=F.type===g.ZEN_EDITOR||F.type===g.EDITING?f.AddRichHyperLinkCommand.id:f.AddHyperLinkCommand.id;await I.executeCommand(e,{unitId:F.unitId,subUnitId:F.subUnitId,link:{id:(0,t.generateRandomId)(),row:F.row,column:F.col,payload:Q(T,O),display:C?x:``},documentId:F.type===g.ZEN_EDITOR?t.DOCS_ZEN_EDITOR_UNIT_ID_KEY:M.getCurrentEditorId()})}(F==null?void 0:F.type)===g.VIEWING&&(await I.executeCommand(n.SetWorksheetActiveOperation.id,{unitId:F.unitId,subUnitId:F.subUnitId}),await I.executeCommand(r.ScrollToRangeOperation.id,{range:{startRow:Math.max(F.row-1,0),endRow:F.row+1,startColumn:Math.max(F.col-1,0),endColumn:F.col+1}})),I.executeCommand(J.id)};return F?(0,m.jsxs)(`div`,{className:(0,l.clsx)(`
2
+ univer-box-border univer-w-[296px] univer-rounded-xl univer-bg-white univer-p-4 univer-shadow-md
3
+ dark:!univer-bg-gray-900
4
+ `,l.borderClassName),children:[C?(0,m.jsx)(l.FormLayout,{label:A.t(`hyperLink.form.label`),error:W&&!x?A.t(`hyperLink.form.inputError`):``,children:(0,m.jsx)(l.Input,{value:x,onChange:e=>{Y(e),K.current=!1},placeholder:A.t(`hyperLink.form.labelPlaceholder`),autoFocus:!0,onKeyDown:e=>{e.keyCode===s.KeyCode.ENTER&&_e()}})}):null,(0,m.jsx)(l.FormLayout,{label:A.t(`hyperLink.form.type`),children:(0,m.jsx)(l.Select,{className:`univer-w-full`,options:me,value:T,onChange:e=>{D(e),k(``)}})}),T===f.SheetHyperLinkType.URL&&(0,m.jsx)(l.FormLayout,{error:W?O?_(O)?``:A.t(`hyperLink.form.linkError`):A.t(`hyperLink.form.inputError`):``,children:(0,m.jsx)(l.Input,{value:O,onChange:e=>{k(e),e&&(K.current||!x||x===e)&&(Y(e),K.current=!0)},placeholder:A.t(`hyperLink.form.linkPlaceholder`),autoFocus:!0,onKeyDown:e=>{e.keyCode===s.KeyCode.ENTER&&_e()}})}),T===f.SheetHyperLinkType.RANGE&&(0,m.jsx)(l.FormLayout,{error:W&&!O?A.t(`hyperLink.form.inputError`):``,children:(0,m.jsx)(d.RangeSelector,{unitId:q.getUnitId(),subUnitId:pe,maxRangeCount:1,supportAcrossSheet:!0,initialValue:O,resetRange:V,onChange:(e,t)=>ge(t),onRangeSelectorDialogVisibleChange:async e=>{if(le(e),e)F.type===g.ZEN_EDITOR&&(R.hide(),B.setContextValue(t.FOCUSING_SHEET,!0)),F.type!==g.VIEWING&&M.enableForceKeepVisible(),y(!0);else{if(await ne.navigateToRange(F.unitId,F.subUnitId,{startRow:F.row,endRow:F.row,startColumn:F.col,endColumn:F.col},!0),F.type===g.ZEN_EDITOR){var r,i;await I.executeCommand(n.SetSelectionsOperation.id,{unitId:F.unitId,subUnitId:F.subUnitId,selections:[{range:{startRow:F.row,endRow:F.row,startColumn:F.col,endColumn:F.col}}]}),R.show(),B.setContextValue(t.FOCUSING_SHEET,!1);let e=(r=z.getRenderById(t.DOCS_ZEN_EDITOR_UNIT_ID_KEY))==null?void 0:r.with(a.DocBackScrollRenderController),o=(i=se.getTextRanges({unitId:t.DOCS_ZEN_EDITOR_UNIT_ID_KEY,subUnitId:t.DOCS_ZEN_EDITOR_UNIT_ID_KEY}))==null?void 0:i[0];e&&o&&(e.scrollToRange(o),se.refreshSelection({unitId:t.DOCS_ZEN_EDITOR_UNIT_ID_KEY,subUnitId:t.DOCS_ZEN_EDITOR_UNIT_ID_KEY}))}M.disableForceKeepVisible(),y(!1)}},onFocusChange:e=>fe(e)})}),T===f.SheetHyperLinkType.SHEET&&(0,m.jsx)(l.FormLayout,{error:W&&!O?A.t(`hyperLink.form.selectError`):``,children:(0,m.jsx)(l.Select,{className:`univer-w-full`,options:Z,value:O,onChange:e=>{var t,n;k(e);let r=(t=Z.find(t=>t.value===e))==null?void 0:t.label,i=(n=Z.find(e=>e.value===O))==null?void 0:n.label;r&&(K.current||!x||x===i)&&(Y(r),K.current=!0)}})}),T===f.SheetHyperLinkType.DEFINE_NAME&&(0,m.jsx)(l.FormLayout,{error:W&&!O?A.t(`hyperLink.form.selectError`):``,children:(0,m.jsx)(l.Select,{className:`univer-w-full`,options:he,value:O,onChange:e=>{var t,n;k(e);let r=(t=he.find(t=>t.value===e))==null?void 0:t.label,i=(n=he.find(e=>e.value===O))==null?void 0:n.label;r&&(K.current||!x||x===i)&&(Y(r),K.current=!0)}})}),(H==null?void 0:H.Form)&&(0,m.jsx)(H.Form,{linkId:c,payload:O,display:x,showError:W,setByPayload:K,setDisplay:e=>{Y(e),K.current=!0},setPayload:k}),(0,m.jsxs)(`div`,{className:`univer-flex univer-flex-row univer-justify-end univer-gap-2`,children:[(0,m.jsx)(l.Button,{onClick:()=>{F&&ne.navigateToRange(F.unitId,F.subUnitId,{startRow:F.row,endRow:F.row,startColumn:F.col,endColumn:F.col},!0),I.executeCommand(J.id)},children:A.t(`hyperLink.form.cancel`)}),(0,m.jsx)(l.Button,{variant:`primary`,onClick:async()=>{_e()},children:A.t(`hyperLink.form.ok`)})]})]}):null};j.componentKey=`univer.sheet.cell-link-edit`;function M({ref:e,...t}){let{icon:n,id:r,className:i,extend:a,...o}=t,s=`univerjs-icon univerjs-icon-${r} ${i||``}`.trim(),c=(0,p.useRef)(`_${te()}`);return N(n,`${r}`,{defIds:n.defIds,idSuffix:c.current},{ref:e,className:s,...o},a)}function N(e,t,n,r,i){return(0,p.createElement)(e.tag,{key:t,...P(e,n,i),...r},(F(e,n).children||[]).map((r,a)=>N(r,`${t}-${e.tag}-${a}`,n,void 0,i)))}function P(e,t,n){let r={...e.attrs};n!=null&&n.colorChannel1&&r.fill===`colorChannel1`&&(r.fill=n.colorChannel1),e.tag===`mask`&&r.id&&(r.id+=t.idSuffix),Object.entries(r).forEach(([e,n])=>{e===`mask`&&typeof n==`string`&&(r[e]=n.replace(/url\(#(.*)\)/,`url(#$1${t.idSuffix})`))});let{defIds:i}=t;return!i||i.length===0?r:(e.tag===`use`&&r[`xlink:href`]&&(r[`xlink:href`]+=t.idSuffix),Object.entries(r).forEach(([e,n])=>{typeof n==`string`&&(r[e]=n.replace(/url\(#(.*)\)/,`url(#$1${t.idSuffix})`))}),r)}function F(e,t){var n;let{defIds:r}=t;return!r||r.length===0?e:e.tag===`defs`&&(n=e.children)!=null&&n.length?{...e,children:e.children.map(e=>typeof e.attrs.id==`string`&&r&&r.includes(e.attrs.id)?{...e,attrs:{...e.attrs,id:e.attrs.id+t.idSuffix}}:e)}:e}function te(){return Math.random().toString(36).substring(2,8)}M.displayName=`UniverIcon`;let ne={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M7.9999 1.12915C8.03875 1.12915 8.07673 1.13284 8.11352 1.13989H12.2599C13.6958 1.13989 14.8599 2.30395 14.8599 3.73989V7.88619C14.867 7.92301 14.8707 7.96102 14.8707 7.9999C14.8707 8.03878 14.867 8.0768 14.8599 8.11362V12.2599C14.8599 13.6958 13.6958 14.8599 12.2599 14.8599H8.11362C8.0768 14.867 8.03878 14.8707 7.9999 14.8707C7.96102 14.8707 7.92301 14.867 7.88619 14.8599H3.73989C2.30396 14.8599 1.13989 13.6958 1.13989 12.2599V8.11352C1.13284 8.07673 1.12915 8.03875 1.12915 7.9999C1.12915 7.96106 1.13284 7.92308 1.13989 7.88629V3.73989C1.13989 2.30396 2.30395 1.13989 3.73989 1.13989H7.88629C7.92308 1.13284 7.96106 1.12915 7.9999 1.12915ZM2.33989 8.5999V12.2599C2.33989 13.0331 2.9667 13.6599 3.73989 13.6599H7.3999V8.5999H2.33989ZM7.3999 7.3999H2.33989V3.73989C2.33989 2.9667 2.96669 2.33989 3.73989 2.33989H7.3999V7.3999ZM8.5999 8.5999V13.6599H12.2599C13.0331 13.6599 13.6599 13.0331 13.6599 12.2599V8.5999H8.5999ZM13.6599 7.3999H8.5999V2.33989H12.2599C13.0331 2.33989 13.6599 2.96669 13.6599 3.73989V7.3999Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},I=(0,p.forwardRef)(function(e,t){return(0,p.createElement)(M,Object.assign({},e,{id:`all-border-icon`,ref:t,icon:ne}))});I.displayName=`AllBorderIcon`;let L={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.1302 12.4251C4.25802 13.7417 5.36779 14.7708 6.71792 14.7708H11.7179C13.1539 14.7708 14.3179 13.6067 14.3179 12.1708V6.1708C14.3179 4.78586 13.2351 3.65383 11.8698 3.57517C11.742 2.25858 10.6323 1.22949 9.28213 1.22949H4.28213C2.84619 1.22949 1.68213 2.39355 1.68213 3.82949V9.82949C1.68213 11.2144 2.76497 12.3465 4.1302 12.4251ZM10.6583 3.5708H6.71792C5.28198 3.5708 4.11792 4.73486 4.11792 6.1708V11.22C3.4221 11.1387 2.88213 10.5471 2.88213 9.82949V3.82949C2.88213 3.05629 3.50893 2.42949 4.28213 2.42949H9.28213C9.96695 2.42949 10.5369 2.92119 10.6583 3.5708ZM13.1179 6.1708C13.1179 5.3976 12.4911 4.7708 11.7179 4.7708H6.71792C5.94472 4.7708 5.31792 5.3976 5.31792 6.1708V12.1708C5.31792 12.944 5.94472 13.5708 6.71792 13.5708H11.7179C12.4911 13.5708 13.1179 12.944 13.1179 12.1708V6.1708Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},re=(0,p.forwardRef)(function(e,t){return(0,p.createElement)(M,Object.assign({},e,{id:`copy-icon`,ref:t,icon:L}))});re.displayName=`CopyIcon`;let R={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M9.8816 1.97978C11.0177 0.843607 12.862 0.884962 14.0004 2.02342C15.1389 3.16188 15.1803 5.00612 14.0441 6.14228L11.399 8.78737C11.1608 9.02559 10.7746 9.02559 10.5363 8.78737C10.2981 8.54915 10.2981 8.16292 10.5363 7.9247L13.1814 5.2796C13.8195 4.64155 13.8217 3.57006 13.1378 2.8861C12.4538 2.20211 11.3823 2.20438 10.7443 2.84245L7.6976 5.88911L7.69317 5.89349C7.05959 6.53211 7.05894 7.60014 7.74132 8.28252C7.97954 8.52074 7.97954 8.90697 7.74132 9.14519C7.5031 9.38341 7.11687 9.38341 6.87865 9.14519C5.74016 8.00671 5.69884 6.16251 6.83497 5.02633L6.84021 5.02116L9.8816 1.97978Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M4.61426 7.2364C4.85248 6.99818 5.23871 6.99818 5.47693 7.2364C5.71515 7.47462 5.71515 7.86085 5.47693 8.09907L2.83183 10.7442C2.19375 11.3823 2.1915 12.4537 2.87547 13.1377C3.55945 13.8217 4.6309 13.8194 5.26899 13.1813L8.31566 10.1347C8.32262 10.1277 8.32971 10.121 8.33691 10.1144C8.34408 10.1064 8.3515 10.0986 8.35916 10.091C8.99721 9.45291 8.99949 8.38145 8.3155 7.69746C8.07728 7.45924 8.07728 7.07301 8.3155 6.83479C8.55372 6.59657 8.93995 6.59657 9.17817 6.83479C10.3166 7.97327 10.358 9.81748 9.22183 10.9536C9.21487 10.9606 9.20779 10.9673 9.20058 10.9739C9.19341 10.9819 9.18599 10.9897 9.17833 10.9973L6.13166 14.044C4.99548 15.1802 3.15127 15.1389 2.01279 14.0004C0.874362 12.8619 0.83297 11.0177 1.96916 9.8815L4.61426 7.2364Z`}}]},z=(0,p.forwardRef)(function(e,t){return(0,p.createElement)(M,Object.assign({},e,{id:`link-icon`,ref:t,icon:R}))});z.displayName=`LinkIcon`;let ie={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 17`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M12.5935 3.47302C11.6354 2.51492 10.082 2.51492 9.12388 3.47302L7.83534 4.76157C7.60102 4.99588 7.22112 4.99588 6.98681 4.76157C6.75249 4.52725 6.75249 4.14735 6.98681 3.91304L8.27535 2.62449C9.70209 1.19776 12.0153 1.19776 13.442 2.62449C14.8688 4.05123 14.8688 6.36442 13.442 7.79116L12.1535 9.0797C11.9192 9.31402 11.5393 9.31402 11.3049 9.0797C11.0706 8.84539 11.0706 8.46549 11.3049 8.23117L12.5935 6.94263C13.5516 5.98452 13.5516 4.43113 12.5935 3.47302Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M3.40637 12.6606C2.44827 11.7025 2.44827 10.1491 3.40637 9.19102L4.69492 7.90248C4.92923 7.66816 4.92923 7.28826 4.69492 7.05395C4.4606 6.81963 4.0807 6.81963 3.84639 7.05395L2.55784 8.34249C1.13111 9.76923 1.13111 12.0824 2.55784 13.5092C3.98458 14.9359 6.29777 14.9359 7.72451 13.5092L9.01305 12.2206C9.24737 11.9863 9.24737 11.6064 9.01305 11.3721C8.77874 11.1378 8.39884 11.1378 8.16452 11.3721L6.87598 12.6606C5.91787 13.6187 4.36448 13.6187 3.40637 12.6606Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M3.5852 2.80332C3.35088 2.569 2.97098 2.569 2.73667 2.80332C2.50235 3.03763 2.50235 3.41753 2.73667 3.65185L12.4151 13.3302C12.6494 13.5646 13.0293 13.5646 13.2636 13.3302C13.4979 13.0959 13.4979 12.716 13.2636 12.4817L3.5852 2.80332Z`}}]},ae=(0,p.forwardRef)(function(e,t){return(0,p.createElement)(M,Object.assign({},e,{id:`unlink-icon`,ref:t,icon:ie}))});ae.displayName=`UnlinkIcon`;let B={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:`M12.6551 1.98906C11.7476 1.08113 10.2757 1.08149 9.3686 1.98987L4.82542 6.53955C4.75087 6.61421 4.69336 6.70411 4.65682 6.80309L3.2461 10.625C3.16506 10.8446 3.21909 11.0912 3.3845 11.2568C3.54991 11.4224 3.79651 11.4767 4.01616 11.3959L7.85031 9.98517C7.94979 9.94856 8.04014 9.89077 8.11508 9.81579L12.6552 5.27327C13.5618 4.36621 13.5618 2.89607 12.6551 1.98906ZM10.2177 2.83779C10.6562 2.39869 11.3677 2.39851 11.8064 2.8374C12.2447 3.27584 12.2447 3.9865 11.8065 4.42497L7.3392 8.89457L4.82213 9.82068L5.74706 7.31487L10.2177 2.83779Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M1.79238 13.2999C1.46101 13.2999 1.19238 13.5685 1.19238 13.8999C1.19238 14.2313 1.46101 14.4999 1.79238 14.4999H14.4924C14.8238 14.4999 15.0924 14.2313 15.0924 13.8999C15.0924 13.5685 14.8238 13.2999 14.4924 13.2999H1.79238Z`}}]},oe=(0,p.forwardRef)(function(e,t){return(0,p.createElement)(M,Object.assign({},e,{id:`write-icon`,ref:t,icon:B}))});oe.displayName=`WriteIcon`;let se={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:`#35BD4B`,d:`M3.4535 1.12549C2.7002 1.12549 2.08954 1.73615 2.08954 2.48945V13.5104C2.08954 14.2637 2.7002 14.8744 3.4535 14.8744H12.5465C13.2998 14.8744 13.9105 14.2637 13.9105 13.5104V5.0992L10.0091 1.12549H3.4535Z`}},{tag:`path`,attrs:{fill:`#32A846`,d:`M10.0075 1.12549L13.9104 5.09842H10.6742C10.306 5.09842 10.0075 4.79994 10.0075 4.43175V1.12549Z`}},{tag:`path`,attrs:{fill:`white`,d:`M7.8088 10.2949L6.3764 12.403C6.26259 12.5705 6.03455 12.614 5.86705 12.5002C5.69955 12.3864 5.65603 12.1584 5.76984 11.9909L7.3655 9.64252L5.94042 7.54519C5.82661 7.37769 5.87013 7.14964 6.03763 7.03583C6.20512 6.92202 6.43317 6.96555 6.54698 7.13304L7.8088 8.9901L9.07062 7.13304C9.18443 6.96555 9.41248 6.92202 9.57997 7.03583C9.74747 7.14964 9.79099 7.37769 9.67718 7.54519L8.2521 9.64252L9.84776 11.9909C9.96157 12.1584 9.91805 12.3864 9.75055 12.5002C9.58305 12.614 9.35501 12.5705 9.2412 12.403L7.8088 10.2949Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},ce=(0,p.forwardRef)(function(e,t){return(0,p.createElement)(M,Object.assign({},e,{id:`xlsx-multi-icon`,ref:t,icon:se}))});ce.displayName=`XlsxMultiIcon`;let le={[f.SheetHyperLinkType.URL]:(0,m.jsx)(z,{}),[f.SheetHyperLinkType.SHEET]:(0,m.jsx)(ce,{className:`univer-text-green-500`}),[f.SheetHyperLinkType.RANGE]:(0,m.jsx)(I,{}),[f.SheetHyperLinkType.DEFINE_NAME]:(0,m.jsx)(I,{}),[f.SheetHyperLinkType.INVALID]:(0,m.jsx)(I,{})},ue=e=>{var n,i;let a=(0,s.useDependency)(U),o=(0,s.useDependency)(t.ICommandService),c=(0,s.useDependency)(s.IMessageService),u=(0,s.useDependency)(t.LocaleService),d=(0,s.useDependency)(E),p=(0,s.useDependency)(r.IEditorBridgeService),h=(0,s.useDependency)(f.SheetsHyperLinkParserService),_=(0,s.useDependency)(s.IZenZoneService),{customRange:v,row:y,col:b,unitId:x,subUnitId:S,editPermission:C,copyPermission:w,type:T}=e;if(!(!(v==null||(n=v.properties)==null)&&n.url))return null;let D=h.parseHyperLink((i=v.properties.url)==null?``:i),O=D.type===f.SheetHyperLinkType.INVALID;return(0,m.jsxs)(`div`,{className:(0,l.clsx)(`
5
+ univer-mb-1 univer-flex univer-max-w-80 univer-flex-row univer-items-center univer-justify-between
6
+ univer-overflow-hidden univer-rounded-lg univer-bg-white univer-p-3 univer-shadow-md
7
+ dark:!univer-bg-gray-900
8
+ `,l.borderClassName),onClick:()=>a.hideCurrentPopup(),children:[(0,m.jsxs)(`div`,{className:(0,l.clsx)(`
9
+ univer-flex univer-h-6 univer-flex-1 univer-cursor-pointer univer-flex-row univer-items-center
10
+ univer-truncate univer-text-sm univer-leading-5 univer-text-primary-600
11
+ `,{"univer-text-red-500":O}),onClick:()=>{_.visible||O||d.navigate(D)},children:[(0,m.jsx)(`div`,{className:`
12
+ univer-mr-2 univer-flex univer-size-5 univer-flex-none univer-items-center univer-justify-center
13
+ univer-text-base univer-text-gray-900
14
+ dark:!univer-text-white
15
+ `,children:le[D.type]}),(0,m.jsx)(l.Tooltip,{showIfEllipsis:!0,title:D.name,asChild:!0,children:(0,m.jsx)(`span`,{className:`univer-flex-1 univer-truncate`,children:D.name})})]}),(0,m.jsxs)(`div`,{className:`
16
+ univer-flex univer-h-6 univer-flex-none univer-flex-row univer-items-center univer-justify-center
17
+ `,children:[w&&(0,m.jsx)(`div`,{className:(0,l.clsx)(`
18
+ univer-ml-2 univer-flex univer-size-6 univer-cursor-pointer univer-flex-row
19
+ univer-items-center univer-justify-center univer-rounded univer-text-base
20
+ hover:univer-bg-gray-100
21
+ dark:hover:!univer-bg-gray-700
22
+ `,{"univer-text-red-500":O}),onClick:()=>{if(!O){if(D.type!==f.SheetHyperLinkType.URL){let e=new URL(window.location.href);e.hash=D.url.slice(1),navigator.clipboard.writeText(e.href)}else navigator.clipboard.writeText(D.url);c.show({content:u.t(`hyperLink.message.coped`),type:l.MessageType.Info})}},children:(0,m.jsx)(l.Tooltip,{placement:`bottom`,title:u.t(`hyperLink.popup.copy`),children:(0,m.jsx)(re,{className:`dark:!univer-text-white`})})}),C&&(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`div`,{className:`
23
+ univer-ml-2 univer-flex univer-size-6 univer-cursor-pointer univer-flex-row
24
+ univer-items-center univer-justify-center univer-rounded univer-text-base
25
+ hover:univer-bg-gray-100
26
+ dark:hover:!univer-bg-gray-700
27
+ `,onClick:()=>{o.executeCommand(q.id,{unitId:x,subUnitId:S,row:y,col:b,customRangeId:v.rangeId,type:T})},children:(0,m.jsx)(l.Tooltip,{placement:`bottom`,title:u.t(`hyperLink.popup.edit`),children:(0,m.jsx)(oe,{className:`dark:!univer-text-white`})})}),(0,m.jsx)(`div`,{className:`
28
+ univer-ml-2 univer-flex univer-size-6 univer-cursor-pointer univer-flex-row
29
+ univer-items-center univer-justify-center univer-rounded univer-text-base
30
+ hover:univer-bg-gray-100
31
+ dark:hover:!univer-bg-gray-700
32
+ `,onClick:()=>{let e=T===g.EDITING||T===g.ZEN_EDITOR?f.CancelRichHyperLinkCommand.id:f.CancelHyperLinkCommand.id;o.syncExecuteCommand(e,{unitId:x,subUnitId:S,id:v.rangeId,row:y,column:b,documentId:T===g.ZEN_EDITOR?t.DOCS_ZEN_EDITOR_UNIT_ID_KEY:p.getCurrentEditorId()})&&a.hideCurrentPopup(void 0,!0)},children:(0,m.jsx)(l.Tooltip,{placement:`bottom`,title:u.t(`hyperLink.popup.cancel`),children:(0,m.jsx)(ae,{className:`dark:!univer-text-white`})})})]})]})]})},V=()=>{let e=(0,s.useDependency)(U),[n,r]=(0,p.useState)(null),i=(0,s.useDependency)(t.IUniverInstanceService);if((0,p.useEffect)(()=>{r(e.currentPopup);let t=e.currentPopup$.subscribe(e=>{r(e)});return()=>{t.unsubscribe()}},[e.currentPopup,e.currentPopup$]),!n)return null;if(n.showAll){var a;let e=i.getUnit(n.unitId,t.UniverInstanceType.UNIVER_SHEET),r=e==null?void 0:e.getSheetBySheetId(n.subUnitId),o=r==null?void 0:r.getCell(n.row,n.col),s=o==null||(a=o.p)==null||(a=a.body)==null?void 0:a.customRanges;return s!=null&&s.length?(0,m.jsx)(`div`,{children:s.map(e=>(0,m.jsx)(ue,{...n,customRange:e},e.rangeId))}):null}return(0,m.jsx)(ue,{...n})};V.componentKey=`univer.sheet.cell-link-popup`;let H=(e,t)=>{var n,r;return e.unitId===t.unitId&&e.subUnitId===t.subUnitId&&e.row===t.row&&e.col===t.col&&((n=e.customRange)==null?void 0:n.rangeId)===((r=t.customRange)==null?void 0:r.rangeId)&&e.type===t.type},U=class extends t.Disposable{get currentPopup(){return this._currentPopup}get currentEditing(){return this._currentEditing$.getValue()}constructor(e,t,n,r,i,a,o){super(),this._sheetCanvasPopManagerService=e,this._injector=t,this._univerInstanceService=n,this._editorBridgeService=r,this._textSelectionManagerService=i,this._docCanvasPopManagerService=a,this._zenZoneService=o,A(this,`_currentPopup`,null),A(this,`_currentPopup$`,new c.Subject),A(this,`currentPopup$`,this._currentPopup$.asObservable()),A(this,`_currentEditingPopup`,null),A(this,`_currentEditing$`,new c.BehaviorSubject(null)),A(this,`currentEditing$`,this._currentEditing$.asObservable()),A(this,`_isKeepVisible`,!1),this.disposeWithMe(()=>{this.hideCurrentPopup(),this.endEditing(),this._currentEditing$.complete(),this._currentPopup$.complete()})}setIsKeepVisible(e){this._isKeepVisible=e}getIsKeepVisible(){return this._isKeepVisible}showPopup(e){if(this._currentPopup&&H(e,this._currentPopup)||(this.hideCurrentPopup(void 0,!0),e.type!==g.ZEN_EDITOR&&this._zenZoneService.visible))return;let n=this._currentEditing$.getValue();if(n&&H(e,n))return;let{unitId:r,subUnitId:i,row:a,col:o,customRangeRect:s,customRange:c}=e,l,u={componentKey:V.componentKey,direction:`bottom`,onClickOutside:()=>{this.hideCurrentPopup()},onClick:()=>{this.hideCurrentPopup(e.type,!0)}};if(e.type===g.EDITING){if(!c)return;l=s&&this._sheetCanvasPopManagerService.attachPopupToAbsolutePosition(s,u)}else if(e.type===g.ZEN_EDITOR){if(!c)return;l=this._docCanvasPopManagerService.attachPopupToRange({startOffset:c.startIndex,endOffset:c.endIndex+1,collapsed:!1},u,t.DOCS_ZEN_EDITOR_UNIT_ID_KEY)}else if(e.showAll)l=this._sheetCanvasPopManagerService.attachPopupToCell(e.row,e.col,u,r,i);else{if(!c)return;l=s&&this._sheetCanvasPopManagerService.attachPopupByPosition(s,u,e)}if(l){if(this._currentPopup){var d;(d=this._currentPopup.disposable)==null||d.dispose()}this._currentPopup={unitId:r,subUnitId:i,disposable:l,row:a,col:o,editPermission:!!e.editPermission,copyPermission:!!e.copyPermission,customRange:c,type:e.type,showAll:e.showAll},this._currentPopup$.next(this._currentPopup)}}hideCurrentPopup(e,t){if(this._currentPopup&&((!e||e===this._currentPopup.type)&&this._currentPopup.disposable.canDispose()||t)){var n;(n=this._currentPopup)==null||(n=n.disposable)==null||n.dispose(),this._currentPopup=null,this._currentPopup$.next(null)}}dispose(){super.dispose(),this.hideCurrentPopup(),this.endEditing(),this._currentPopup$.complete(),this._currentEditing$.complete()}_getEditingRange(){let e=this._editorBridgeService.isVisible().visible,n=this._editorBridgeService.getEditCellState();if(e&&n){var r,i,a;let e=this._textSelectionManagerService.getActiveTextRange(),o=(r=n.documentLayoutObject.documentModel)==null?void 0:r.getBody();if(!o)return null;if(!e||e.collapsed)return{startOffset:0,endOffset:o.dataStream.length-2,collapsed:o.dataStream.length-2==0,label:t.BuildTextUtils.transform.getPlainText(o.dataStream)};let s=t.BuildTextUtils.customRange.getCustomRangesInterestsWithSelection(e,(i=(a=o.customRanges)==null?void 0:a.filter(e=>e.rangeType===t.CustomRangeType.HYPERLINK))==null?[]:i),c=e.startOffset,l=e.endOffset;return s.forEach(e=>{c=Math.min(c,e.startIndex),l=Math.max(l,e.endIndex+1)}),{startOffset:c,endOffset:l,collapsed:c===l,label:t.BuildTextUtils.transform.getPlainText(o.dataStream.slice(c,l))}}return null}get _editPopup(){return{componentKey:j.componentKey,direction:`vertical`,onClickOutside:()=>{this.endEditing()},onContextMenu:()=>{this.endEditing()},hiddenType:`hide`}}startAddEditing(e){let{unitId:n,subUnitId:r,type:i}=e;if(i===g.ZEN_EDITOR){var s;let n=this._univerInstanceService.getUnit(t.DOCS_ZEN_EDITOR_UNIT_ID_KEY,t.UniverInstanceType.UNIVER_DOC);if(!n)return;let r=this._textSelectionManagerService.getActiveTextRange();if(!r)return;this._currentEditingPopup=this._docCanvasPopManagerService.attachPopupToRange(r,this._editPopup,t.DOCS_ZEN_EDITOR_UNIT_ID_KEY);let i=(s=n.getBody())==null?void 0:s.dataStream.slice(r.startOffset,r.endOffset);this._currentEditing$.next({...e,label:i})}else if(i===g.EDITING){var c;let i=this._getEditingRange();if(!i)return;this._textSelectionManagerService.replaceDocRanges([{...i}],{unitId:t.DOCS_NORMAL_EDITOR_UNIT_ID_KEY,subUnitId:t.DOCS_NORMAL_EDITOR_UNIT_ID_KEY});let s=this._injector.get(o.IRenderManagerService).getRenderById(t.DOCS_NORMAL_EDITOR_UNIT_ID_KEY);if(!s)return;let l=(0,a.calcDocRangePositions)(i,s);if(!(l!=null&&l.length))return;this._currentEditingPopup=this._sheetCanvasPopManagerService.attachPopupToAbsolutePosition(l.pop(),this._editPopup,n,r),this._currentEditing$.next({...e,label:(c=i==null?void 0:i.label)==null?``:c})}else{var l,u,d;this._currentEditingPopup=this._sheetCanvasPopManagerService.attachPopupToCell(e.row,e.col,this._editPopup,n,r);let i=this._univerInstanceService.getUnit(n,t.UniverInstanceType.UNIVER_SHEET),a=i==null?void 0:i.getSheetBySheetId(r),o=a==null?void 0:a.getCellRaw(e.row,e.col);this._currentEditing$.next({...e,label:o!=null&&o.p?t.BuildTextUtils.transform.getPlainText((l=(u=o.p.body)==null?void 0:u.dataStream)==null?``:l):((d=o==null?void 0:o.v)==null?``:d).toString()})}}startEditing(e){var n;(n=this._currentEditingPopup)==null||n.dispose(),this.hideCurrentPopup(void 0,!0);let{unitId:i,subUnitId:a}=e,o,s;if(e.type===g.ZEN_EDITOR){var c,l;let n=this._univerInstanceService.getUnit(t.DOCS_ZEN_EDITOR_UNIT_ID_KEY,t.UniverInstanceType.UNIVER_DOC);if(o=n==null||(c=n.getBody())==null||(c=c.customRanges)==null?void 0:c.find(t=>t.rangeId===e.customRangeId),s=o?n==null||(l=n.getBody())==null?void 0:l.dataStream.slice(o.startIndex,o.endIndex+1):``,!o||!s)return;this._textSelectionManagerService.replaceTextRanges([{startOffset:o.startIndex,endOffset:o.endIndex+1}]),this._currentEditingPopup=this._docCanvasPopManagerService.attachPopupToRange({startOffset:o.startIndex,endOffset:o.endIndex,collapsed:!1},this._editPopup,t.DOCS_ZEN_EDITOR_UNIT_ID_KEY)}else if(e.type===g.EDITING){var u;let t=(0,r.getEditingCustomRangePosition)(this._injector,e.unitId,e.subUnitId,e.row,e.col,e.customRangeId);if(!t||!((u=t.rects)!=null&&u.length))return;o=t.customRange,s=t.label,this._textSelectionManagerService.replaceTextRanges([{startOffset:o.startIndex,endOffset:o.endIndex+1}]),this._currentEditingPopup=this._sheetCanvasPopManagerService.attachPopupToAbsolutePosition(t.rects.pop(),this._editPopup,i,a)}else{var d;let n=this._univerInstanceService.getUnit(i,t.UniverInstanceType.UNIVER_SHEET),c=n==null?void 0:n.getSheetBySheetId(a),l=c==null?void 0:c.getCellRaw(e.row,e.col),u=n==null?void 0:n.getStyles().getStyleByCell(l),f=u==null?void 0:u.tr,p=(0,r.getCustomRangePosition)(this._injector,e.unitId,e.subUnitId,e.row,e.col,e.customRangeId);if(!p||!((d=p.rects)!=null&&d.length))return;o=p.customRange,s=p.label,f?this._currentEditingPopup=this._sheetCanvasPopManagerService.attachPopupToCell(e.row,e.col,this._editPopup,i,a):this._currentEditingPopup=this._sheetCanvasPopManagerService.attachPopupByPosition(p.rects.pop(),this._editPopup,{unitId:i,subUnitId:a,row:e.row,col:e.col})}this._currentEditing$.next({...e,customRange:o,label:s})}endEditing(e){if(this.getIsKeepVisible())return;let t=this._currentEditing$.getValue();if(t&&(!e||e===t.type)){var n;(n=this._currentEditingPopup)==null||n.dispose(),this._currentEditing$.next(null)}}};U=w([C(0,(0,t.Inject)(r.SheetCanvasPopManagerService)),C(1,(0,t.Inject)(t.Injector)),C(2,t.IUniverInstanceService),C(3,r.IEditorBridgeService),C(4,(0,t.Inject)(i.DocSelectionManagerService)),C(5,(0,t.Inject)(a.DocCanvasPopManagerService)),C(6,s.IZenZoneService)],U);let W=function(e){return e[e.ALLOWED=0]=`ALLOWED`,e[e.DISABLED_BY_CELL=1]=`DISABLED_BY_CELL`,e[e.ALLOW_ON_EDITING=2]=`ALLOW_ON_EDITING`,e}({}),de=new Set([t.DataValidationType.CHECKBOX,t.DataValidationType.LIST,t.DataValidationType.LIST_MULTIPLE]),G=(e,t,n,r)=>{var i,a;let o=t.getCell(n,r);if(o!=null&&o.f||o!=null&&o.si||!(o==null||(i=o.p)==null||(i=i.body)==null||(i=i.customBlocks)==null)&&i.length)return W.DISABLED_BY_CELL;let s=e.has(h.SheetDataValidationModel)?e.get(h.SheetDataValidationModel):null,c=s==null?void 0:s.getRuleByLocation(t.getUnitId(),t.getSheetId(),n,r);return c&&de.has(c.type)?!0:!(o==null||(a=o.p)==null||(a=a.drawingsOrder)==null)&&a.length?W.ALLOW_ON_EDITING:W.ALLOWED},fe=e=>{let r=e.get(t.IUniverInstanceService).getCurrentUnitForType(t.UniverInstanceType.UNIVER_SHEET);if(!r)return!0;let i=r.getActiveSheet(),a=e.get(n.SheetsSelectionsService).getCurrentSelections();if(!a.length)return!0;let o=a[0].range.startRow,s=a[0].range.startColumn;return G(e,i,o,s)===W.DISABLED_BY_CELL},K=e=>{let n=e.get(i.DocSelectionManagerService),r=e.get(t.IUniverInstanceService),a=n.getTextRanges();if(!(a!=null&&a.length))return!0;let o=r.getCurrentUnitForType(t.UniverInstanceType.UNIVER_DOC);return!!(!o||a.every(e=>e.collapsed)||!o.getSelfOrHeaderFooterModel(a[0].segmentId).getBody())},q={type:t.CommandType.OPERATION,id:`sheet.operation.open-hyper-link-edit-panel`,handler(e,t){if(!t)return!1;let n=e.get(U);return t.customRangeId?n.startEditing(t):n.startAddEditing(t),!0}},J={type:t.CommandType.OPERATION,id:`sheet.operation.close-hyper-link-popup`,handler(e){return e.get(U).endEditing(),!0}},pe={type:t.CommandType.OPERATION,id:`sheet.operation.insert-hyper-link`,handler(e){var i;let a=e.get(t.IUniverInstanceService),o=(0,n.getSheetCommandTarget)(a),s=e.get(r.IEditorBridgeService);if(!o)return!1;let c=e.get(t.ICommandService),l=e.get(n.SheetsSelectionsService).getCurrentLastSelection();if(!l)return!1;let u=l.range.startRow,d=l.range.startColumn,f=s.isVisible(),p=((i=a.getFocusedUnit())==null?void 0:i.getUnitId())===t.DOCS_ZEN_EDITOR_UNIT_ID_KEY;return c.executeCommand(q.id,{unitId:o.unitId,subUnitId:o.subUnitId,row:u,col:d,type:p?g.ZEN_EDITOR:f.visible?g.EDITING:g.VIEWING})}},Y={type:t.CommandType.OPERATION,id:`sheet.operation.insert-hyper-link-toolbar`,handler(e){if(fe(e))return!1;let n=e.get(t.ICommandService);return e.get(U).currentEditing?n.executeCommand(J.id):n.executeCommand(pe.id)}},me=`SHEET_HYPER_LINK_UI_PLUGIN`,X=class extends t.Disposable{registerPlainTextFilter(e){this._plainTextFilter.add(e)}removePlainTextFilter(e){this._plainTextFilter.delete(e)}_filterPlainText(e){return Array.from(this._plainTextFilter).every(t=>t(e))}constructor(e,t,n,r){super(),this._sheetClipboardService=e,this._hyperLinkModel=t,this._injector=n,this._resolverService=r,A(this,`_plainTextFilter`,new Set),A(this,`_copyInfo`,void 0),this._initCopyPaste(),this.disposeWithMe(()=>{this._plainTextFilter.clear()})}_initCopyPaste(){this._sheetClipboardService.addClipboardHook({id:me,onBeforeCopy:(e,t,n)=>this._collect(e,t,n),onPasteCells:(e,t,n,i)=>{let{copyType:a=r.COPY_TYPE.COPY,pasteType:o}=i,{range:s}=e||{},{range:c,unitId:l,subUnitId:u}=t;return this._generateMutations(c,{copyType:a,pasteType:o,copyRange:s,unitId:l,subUnitId:u})},onPastePlainText:(e,n)=>{let i=this._filterPlainText(n);if(_(n)&&i){let{range:n,unitId:i,subUnitId:a}=e,{ranges:[o],mapFunc:s}=(0,r.virtualizeDiscreteRanges)([n]),c=[],l=[];return t.Range.foreach(o,(e,t)=>{let{row:n,col:r}=s(e,t),o=this._hyperLinkModel.getHyperLinkByLocation(i,a,n,r);o&&c.push({id:f.RemoveHyperLinkMutation.id,params:{unitId:i,subUnitId:a,id:o.id}}),o&&l.push({id:f.AddHyperLinkMutation.id,params:{unitId:i,subUnitId:a,link:o}})}),{redos:c,undos:l}}return{undos:[],redos:[]}},priority:99})}_collect(e,r,i){let a=new t.ObjectMatrix;this._copyInfo={unitId:e,subUnitId:r,matrix:a};let o=this._injector.invoke(t=>(0,n.rangeToDiscreteRange)(i,t,e,r));if(!o)return;let{rows:s,cols:c}=o;s.forEach((t,n)=>{c.forEach((i,o)=>{var s;let c=this._hyperLinkModel.getHyperLinkByLocation(e,r,t,i);a.setValue(n,o,(s=c==null?void 0:c.id)==null?``:s)})})}_generateMutations(e,n){if(!this._copyInfo||!this._copyInfo||!this._copyInfo.matrix.getSizeOf()||!n.copyRange||[r.PREDEFINED_HOOK_NAME_PASTE.SPECIAL_PASTE_COL_WIDTH,r.PREDEFINED_HOOK_NAME_PASTE.SPECIAL_PASTE_VALUE,r.PREDEFINED_HOOK_NAME_PASTE.SPECIAL_PASTE_FORMAT,r.PREDEFINED_HOOK_NAME_PASTE.SPECIAL_PASTE_FORMULA].includes(n.pasteType))return{redos:[],undos:[]};let{unitId:i,subUnitId:a}=this._copyInfo,o=[],s=[],{ranges:[c,l],mapFunc:u}=(0,r.virtualizeDiscreteRanges)([n.copyRange,e]);return(0,r.getRepeatRange)(c,l,!0).forEach(({startRange:e})=>{var r;(r=this._copyInfo)==null||r.matrix.forValue((r,c,l)=>{let d=t.Rectangle.getPositionRange({startRow:r,endRow:r,startColumn:c,endColumn:c},e),p=this._hyperLinkModel.getHyperLink(i,a,l),{row:m,col:h}=u(d.startRow,d.startColumn),g=this._hyperLinkModel.getHyperLinkByLocation(n.unitId,n.subUnitId,m,h),_=(0,t.generateRandomId)();g&&o.push({id:f.RemoveHyperLinkMutation.id,params:{unitId:n.unitId,subUnitId:n.subUnitId,id:g.id}}),p&&(o.push({id:f.AddHyperLinkMutation.id,params:{unitId:n.unitId,subUnitId:n.subUnitId,link:{...p,id:_,row:m,column:h}}}),s.push({id:f.RemoveHyperLinkMutation.id,params:{unitId:n.unitId,subUnitId:n.subUnitId,id:_}})),g&&s.push({id:f.AddHyperLinkMutation.id,params:{unitId:n.unitId,subUnitId:n.subUnitId,link:g}})})}),{redos:o,undos:s}}};X=w([C(0,r.ISheetClipboardService),C(1,(0,t.Inject)(f.HyperLinkModel)),C(2,(0,t.Inject)(t.Injector)),C(3,(0,t.Inject)(E))],X);let Z=(e,i=t.DOCS_ZEN_EDITOR_UNIT_ID_KEY)=>{var s;let l=e.get(t.IUniverInstanceService),u=(s=e.get(o.IRenderManagerService).getRenderById(i))==null?void 0:s.with(a.DocSelectionRenderService);return u?u.textSelectionInner$.pipe((0,c.map)(()=>{let t=e.get(r.IEditorBridgeService).getEditCellState();if(!t)return!0;let i=(0,n.getSheetCommandTarget)(l,{unitId:t.unitId,subUnitId:t.sheetId});return!(i!=null&&i.worksheet)||G(e,i.worksheet,t.row,t.column)===1?!0:K(e)})):(0,c.of)(!0)},he=e=>{var i;let a=e.get(t.IUniverInstanceService),o=e.has(r.IEditorBridgeService)?e.get(r.IEditorBridgeService):null;return((i=o==null?void 0:o.currentEditCellState$.pipe((0,c.map)(t=>{if(!t)return W.DISABLED_BY_CELL;let r=(0,n.getSheetCommandTarget)(a,{unitId:t.unitId,subUnitId:t.sheetId});return r?G(e,r.worksheet,t.row,t.column):W.DISABLED_BY_CELL}),(0,c.switchMap)(n=>n===W.DISABLED_BY_CELL?(0,c.of)(!0):(0,c.combineLatest)([o?o.visible$:(0,c.of)(null),a.getCurrentTypeOfUnit$(t.UniverInstanceType.UNIVER_DOC)]).pipe((0,c.switchMap)(([r,i])=>r!=null&&r.visible?(i==null?void 0:i.getUnitId())===t.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY?(0,c.of)(!0):Z(e,t.DOCS_NORMAL_EDITOR_UNIT_ID_KEY):(0,c.of)(n!==W.ALLOWED))))))==null?(0,c.of)(!0):i).pipe((0,c.switchMap)(t=>t?(0,c.of)(!0):(0,r.getCurrentRangeDisable$)(e,{workbookTypes:[n.WorkbookEditablePermission],worksheetTypes:[n.WorksheetEditPermission,n.WorksheetSetCellValuePermission,n.WorksheetInsertHyperlinkPermission],rangeTypes:[n.RangeProtectionPermissionEditPoint]},!0)))},Q={commandId:pe.id,type:s.MenuItemType.BUTTON,title:`hyperLink.menu.add`,icon:`LinkIcon`},ge=e=>`${e}-zen-editor`,_e=e=>({...Q,id:Q.commandId,hidden$:(0,s.getMenuHiddenObservable)(e,t.UniverInstanceType.UNIVER_SHEET),disabled$:he(e)}),ve=e=>({...Q,id:ge(Q.commandId),hidden$:(0,s.getMenuHiddenObservable)(e,t.UniverInstanceType.UNIVER_DOC,t.DOCS_ZEN_EDITOR_UNIT_ID_KEY),disabled$:Z(e)}),ye={tooltip:`hyperLink.form.addTitle`,commandId:Y.id,type:s.MenuItemType.BUTTON,icon:`LinkIcon`},be=e=>({...ye,id:ye.commandId,hidden$:(0,s.getMenuHiddenObservable)(e,t.UniverInstanceType.UNIVER_SHEET),disabled$:he(e)}),xe=e=>({...ye,id:ge(ye.commandId),hidden$:(0,s.getMenuHiddenObservable)(e,t.UniverInstanceType.UNIVER_DOC,t.DOCS_ZEN_EDITOR_UNIT_ID_KEY),disabled$:Z(e)}),Se={id:Y.id,binding:s.KeyCode.K|s.MetaKeys.CTRL_COMMAND,preconditions:r.whenSheetEditorFocused};var Ce=`@univerjs/sheets-hyper-link-ui`,we=`0.18.0`;let Te=class extends t.Disposable{constructor(e,t){super(),this._autoFillService=e,this._hyperLinkModel=t,this._initAutoFill()}_initAutoFill(){let e=()=>({redos:[],undos:[]}),i=(e,i)=>{let{source:a,target:o,unitId:s,subUnitId:c}=e,l=(0,r.virtualizeDiscreteRanges)([a,o]),[u,d]=l.ranges,{mapFunc:p}=l,m={row:u.startRow,col:u.startColumn},h=n.AutoFillTools.getAutoFillRepeatRange(u,d),g=[],_=[];return h.forEach(e=>{let r=e.repeatStartCell,a=e.relativeRange,o={startRow:m.row,startColumn:m.col,endColumn:m.col,endRow:m.row},l={startRow:r.row,startColumn:r.col,endColumn:r.col,endRow:r.row};t.Range.foreach(a,(e,r)=>{let a=t.Rectangle.getPositionRange({startRow:e,startColumn:r,endColumn:r,endRow:e},o),{row:u,col:d}=p(a.startRow,a.startColumn),m=this._hyperLinkModel.getHyperLinkByLocation(s,c,u,d),h=t.Rectangle.getPositionRange({startRow:e,startColumn:r,endColumn:r,endRow:e},l),{row:v,col:y}=p(h.startRow,h.startColumn),b=(0,t.generateRandomId)(),x=this._hyperLinkModel.getHyperLinkByLocation(s,c,v,y);x&&g.push({id:f.RemoveHyperLinkMutation.id,params:{unitId:s,subUnitId:c,id:x.id}}),(n.AUTO_FILL_APPLY_TYPE.COPY===i||n.AUTO_FILL_APPLY_TYPE.SERIES===i)&&m&&(g.push({id:f.AddHyperLinkMutation.id,params:{unitId:s,subUnitId:c,link:{...m,id:b,row:v,column:y}}}),_.push({id:f.RemoveHyperLinkMutation.id,params:{unitId:s,subUnitId:c,id:b}})),x&&_.push({id:f.AddHyperLinkMutation.id,params:{unitId:s,subUnitId:c,link:x}})})}),{undos:_,redos:g}},a={id:me,onFillData:(t,r,a)=>a===n.AUTO_FILL_APPLY_TYPE.COPY||a===n.AUTO_FILL_APPLY_TYPE.ONLY_FORMAT||a===n.AUTO_FILL_APPLY_TYPE.SERIES?i(t,a):e()};this.disposeWithMe(this._autoFillService.addHook(a))}};Te=w([C(0,n.IAutoFillService),C(1,(0,t.Inject)(f.HyperLinkModel))],Te);let Ee=class extends t.Disposable{constructor(e,t,n){super(),this._localeService=e,this._commandService=t,this._sheetPermissionCheckController=n,this._commandExecutedListener()}_commandExecutedListener(){this.disposeWithMe(this._commandService.beforeCommandExecuted(e=>{e.id===Se.id&&(this._sheetPermissionCheckController.permissionCheckWithRanges({workbookTypes:[n.WorkbookEditablePermission],rangeTypes:[n.RangeProtectionPermissionEditPoint],worksheetTypes:[n.WorksheetEditPermission,n.WorksheetSetCellValuePermission,n.WorksheetInsertHyperlinkPermission]})||this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t(`permission.dialog.hyperLinkErr`)))}))}};Ee=w([C(0,(0,t.Inject)(t.LocaleService)),C(1,t.ICommandService),C(2,(0,t.Inject)(n.SheetPermissionCheckController))],Ee);let De=class extends t.Disposable{constructor(e,t,n,r,i,a,o,s,c,l){super(),this._hoverManagerService=e,this._sheetsHyperLinkPopupService=t,this._renderManagerService=n,this._permissionService=r,this._sheetPermissionCheckController=i,this._commandService=a,this._editorBridgeService=o,this._textSelectionManagerService=s,this._univerInstanceService=c,this._zenZoneService=l,this._initHoverListener(),this._initCommandListener(),this._initHoverEditingListener(),this._initTextSelectionListener(),this._initZenEditor()}_getLinkPermission(e){let{unitId:r,subUnitId:i,row:a,col:o}=e,s=this._univerInstanceService.getUnit(r,t.UniverInstanceType.UNIVER_SHEET),c=s==null?void 0:s.getSheetBySheetId(i);if(!c)return{viewPermission:!1,editPermission:!1,copyPermission:!1};let l=this._sheetPermissionCheckController.permissionCheckWithRanges({workbookTypes:[n.WorkbookViewPermission],worksheetTypes:[n.WorksheetViewPermission],rangeTypes:[n.RangeProtectionPermissionViewPoint]},[{startRow:a,startColumn:o,endRow:a,endColumn:o}],r,i),u=this._sheetPermissionCheckController.permissionCheckWithRanges({workbookTypes:[n.WorkbookEditablePermission],worksheetTypes:[n.WorksheetEditPermission,n.WorksheetInsertHyperlinkPermission],rangeTypes:[n.RangeProtectionPermissionEditPoint]},[{startRow:a,startColumn:o,endRow:a,endColumn:o}],r,i),d=c.getCellRaw(a,o);d!=null&&d.f&&d.f.startsWith(`=HYPERLINK(`)&&(u=!1);let f=this._permissionService.composePermission([new n.WorkbookCopyPermission(r).id,new n.WorksheetCopyPermission(r,i).id]).every(e=>e.value);return{viewPermission:l,editPermission:u,copyPermission:f}}_initHoverListener(){this.disposeWithMe(this._hoverManagerService.currentRichText$.pipe((0,c.debounceTime)(200)).subscribe(e=>{var n,i,a;if(!e||((n=e.customRange)==null?void 0:n.rangeType)!==t.CustomRangeType.HYPERLINK){this._sheetsHyperLinkPopupService.hideCurrentPopup();return}let{unitId:o,subUnitId:s,row:c,col:l}=e,u=this._renderManagerService.getRenderById(o);if(!u)return;let d=this._univerInstanceService.getUnit(o,t.UniverInstanceType.UNIVER_SHEET),f=d==null?void 0:d.getSheetBySheetId(s);if(!f)return;if(!u.with(r.HoverRenderController).active){this._sheetsHyperLinkPopupService.hideCurrentPopup(g.VIEWING);return}let p=u==null||(i=u.with(r.SheetSkeletonManagerService).getSkeletonParam(s))==null?void 0:i.skeleton,m=l,h=c,_=h,v=m;p&&p.overflowCache.forValue((e,n,r)=>{t.Rectangle.contains(r,{startColumn:m,endColumn:m,startRow:h,endRow:h})&&(_=e,v=n)});let{viewPermission:y,editPermission:b,copyPermission:x}=this._getLinkPermission(e);if(!y){this._sheetsHyperLinkPopupService.hideCurrentPopup();return}let S=f.getCellStyleOnly(_,v),C=d.getStyles().getStyleByCell(S),w=C==null||(a=C.tr)==null?void 0:a.a;if(!w&&!e.customRange){this._sheetsHyperLinkPopupService.hideCurrentPopup();return}this._sheetsHyperLinkPopupService.showPopup({row:_,col:v,editPermission:b,copyPermission:x,customRange:e.customRange,customRangeRect:e.rect,type:g.VIEWING,unitId:o,subUnitId:s,showAll:!!w})}))}_initHoverEditingListener(){let e=null;this.disposeWithMe(this._editorBridgeService.currentEditCellState$.pipe((0,c.switchMap)(e=>this._editorBridgeService.visible$.pipe((0,c.map)(t=>({visible:t,state:e}))))).subscribe(({visible:n,state:i})=>{if(!i||i.editorUnitId!==t.DOCS_NORMAL_EDITOR_UNIT_ID_KEY)return;if(!n.visible){e==null||e.unsubscribe(),this._sheetsHyperLinkPopupService.hideCurrentPopup(g.EDITING),this._sheetsHyperLinkPopupService.endEditing(g.EDITING);return}let{editorUnitId:o,unitId:s,sheetId:l,row:u,column:d}=i,f=this._renderManagerService.getRenderById(o);if(!f)return;let{editPermission:p,viewPermission:m,copyPermission:h}=this._getLinkPermission({unitId:s,subUnitId:l,row:u,col:d}),_=f.with(a.DocEventManagerService);m&&(e==null||e.unsubscribe(),e=_.hoverCustomRanges$.pipe((0,c.debounceTime)(200)).subscribe(e=>{var n;let i=e.find(e=>e.range.rangeType===t.CustomRangeType.HYPERLINK);if(!i){this._sheetsHyperLinkPopupService.hideCurrentPopup();return}let a=i.rects[i.rects.length-1];if(!(!((n=this._renderManagerService.getRenderById(s))==null||(n=n.with(r.SheetSkeletonManagerService).getSkeletonParam(l))==null)&&n.skeleton)||!a)return;let o=f.engine.getCanvasElement().getBoundingClientRect();this._sheetsHyperLinkPopupService.showPopup({unitId:s,subUnitId:l,row:u,col:d,customRange:i.range,customRangeRect:{left:a.left+o.left,top:a.top+o.top,bottom:a.bottom+o.top,right:a.right+o.left},editPermission:p,copyPermission:h,type:g.EDITING})}))})),this.disposeWithMe(()=>{e==null||e.unsubscribe()})}_initZenEditor(){this.disposeWithMe(this._zenZoneService.visible$.subscribe(e=>{e?(this._sheetsHyperLinkPopupService.hideCurrentPopup(g.VIEWING),this._sheetsHyperLinkPopupService.hideCurrentPopup(g.EDITING),this._sheetsHyperLinkPopupService.endEditing(g.EDITING),this._sheetsHyperLinkPopupService.hideCurrentPopup(g.VIEWING)):(this._sheetsHyperLinkPopupService.hideCurrentPopup(g.ZEN_EDITOR),this._sheetsHyperLinkPopupService.endEditing(g.ZEN_EDITOR))})),this.disposeWithMe(this._univerInstanceService.focused$.pipe((0,c.switchMap)(e=>{let n=e===t.DOCS_ZEN_EDITOR_UNIT_ID_KEY?this._renderManagerService.getRenderById(e):null;return n?n.with(a.DocEventManagerService).hoverCustomRanges$.pipe((0,c.debounceTime)(200)):new c.Observable(e=>{e.next(null)})})).subscribe(e=>{let n=e==null?void 0:e.find(e=>e.range.rangeType===t.CustomRangeType.HYPERLINK),r=this._editorBridgeService.getEditCellState();if(n&&r){let{unitId:e,sheetId:t,row:i,column:a}=r,{editPermission:o,viewPermission:s,copyPermission:c}=this._getLinkPermission({unitId:e,subUnitId:t,row:i,col:a});s&&this._sheetsHyperLinkPopupService.showPopup({type:g.ZEN_EDITOR,unitId:e,subUnitId:t,row:i,col:a,customRange:n.range,editPermission:o,copyPermission:c})}else this._sheetsHyperLinkPopupService.hideCurrentPopup(g.ZEN_EDITOR)}))}_initTextSelectionListener(){this.disposeWithMe(this._textSelectionManagerService.textSelection$.subscribe(e=>{e&&e.unitId===t.DOCS_NORMAL_EDITOR_UNIT_ID_KEY&&this._sheetsHyperLinkPopupService.endEditing(g.EDITING)}))}_initCommandListener(){let e=[n.ClearSelectionContentCommand.id,n.ClearSelectionAllCommand.id,n.ClearSelectionFormatCommand.id];this.disposeWithMe(this._commandService.onCommandExecuted(t=>{e.includes(t.id)&&this._sheetsHyperLinkPopupService.hideCurrentPopup()}))}};De=w([C(0,(0,t.Inject)(r.HoverManagerService)),C(1,(0,t.Inject)(U)),C(2,(0,t.Inject)(o.IRenderManagerService)),C(3,(0,t.Inject)(t.IPermissionService)),C(4,(0,t.Inject)(n.SheetPermissionCheckController)),C(5,t.ICommandService),C(6,r.IEditorBridgeService),C(7,(0,t.Inject)(i.DocSelectionManagerService)),C(8,t.IUniverInstanceService),C(9,s.IZenZoneService)],De);let Oe=class extends t.Disposable{constructor(e,t){super(),this._context=e,this._hyperLinkModel=t,this._initSkeletonChange()}_initSkeletonChange(){let e=()=>{var e;(e=this._context.mainComponent)==null||e.makeForceDirty()};this.disposeWithMe(this._hyperLinkModel.linkUpdate$.pipe((0,c.debounceTime)(16)).subscribe(()=>{e()}))}};Oe=w([C(1,(0,t.Inject)(f.HyperLinkModel))],Oe);let ke=class extends t.Disposable{constructor(e,t){super(),this._sheetInterceptorService=e,this._hyperLinkModel=t,this._initViewModelIntercept()}_initViewModelIntercept(){this.disposeWithMe(this._sheetInterceptorService.intercept(n.INTERCEPTOR_POINT.CELL_CONTENT,{effect:t.InterceptorEffectEnum.Value,priority:100,handler:(e,t,n)=>{let{row:r,col:i,unitId:a,subUnitId:o}=t,s=this._hyperLinkModel.getHyperLinkByLocation(a,o,r,i);return s&&e?(e===t.rawData&&(e={...t.rawData}),e.linkUrl=s.payload,e.linkId=s.id,n(e)):n(e)}}))}};ke=w([C(0,(0,t.Inject)(n.SheetInterceptorService)),C(1,(0,t.Inject)(f.HyperLinkModel))],ke);let Ae={[s.RibbonInsertGroup.MEDIA]:{[Y.id]:{order:1,menuItemFactory:be},[ge(Y.id)]:{order:1,menuItemFactory:xe}},[s.ContextMenuPosition.MAIN_AREA]:{[s.ContextMenuGroup.OTHERS]:{order:1,[Y.id]:{order:0,menuItemFactory:_e},[ge(Y.id)]:{order:0,menuItemFactory:ve}}}},je=class extends t.Disposable{constructor(e,t,n,r,i){super(),this._componentManager=e,this._commandService=t,this._menuManagerService=n,this._injector=r,this._shortcutService=i,this._initComponents(),this._initCommands(),this._initMenus(),this._initShortCut()}_initComponents(){[[V.componentKey,V],[j.componentKey,j],[`LinkIcon`,z]].forEach(([e,t])=>{this._componentManager.register(e,t)})}_initCommands(){[q,J,pe,Y].forEach(e=>{this._commandService.registerCommand(e)})}_initMenus(){this._menuManagerService.mergeMenu(Ae)}_initShortCut(){this._shortcutService.registerShortcut(Se)}};je=w([C(0,(0,t.Inject)(s.ComponentManager)),C(1,t.ICommandService),C(2,s.IMenuManagerService),C(3,(0,t.Inject)(t.Injector)),C(4,(0,t.Inject)(s.IShortcutService))],je);let Me=class extends t.Disposable{constructor(e,t){super(),this._parserService=e,this._resolverService=t,this._handleInitUrl()}_handleInitUrl(){let e=location.hash;if(e){let t=this._parserService.parseHyperLink(e);this._resolverService.navigate(t)}}};Me=w([C(0,(0,t.Inject)(f.SheetsHyperLinkParserService)),C(1,(0,t.Inject)(E))],Me);let $=class extends t.Plugin{constructor(e=S,n,r){super(),this._config=e,this._injector=n,this._configService=r;let{menu:i,...a}=(0,t.merge)({},S,this._config);i&&this._configService.setConfig(`menu`,i,{merge:!0}),this._configService.setConfig(x,a)}onStarting(){[[E],[U],[ee],[ke],[De],[je],[Te],[X],[Ee],[Me]].forEach(e=>this._injector.add(e)),this._injector.get(ke)}onReady(){this._injector.get(o.IRenderManagerService).registerRenderModule(t.UniverInstanceType.UNIVER_SHEET,[Oe]),this._injector.get(Te),this._injector.get(X),this._injector.get(je)}onRendered(){this._injector.get(Ee),this._injector.get(Me),this._injector.get(De)}};A($,`pluginName`,me),A($,`packageName`,Ce),A($,`version`,we),A($,`type`,t.UniverInstanceType.UNIVER_SHEET),$=w([(0,t.DependentOn)(f.UniverSheetsHyperLinkPlugin,a.UniverDocsUIPlugin),C(1,(0,t.Inject)(t.Injector)),C(2,t.IConfigService)],$),e.CloseHyperLinkPopupOperation=J,e.InsertHyperLinkOperation=pe,e.InsertLinkShortcut=Se,e.OpenHyperLinkEditPanelOperation=q,Object.defineProperty(e,`SheetsHyperLinkCopyPasteController`,{enumerable:!0,get:function(){return X}}),Object.defineProperty(e,`SheetsHyperLinkPopupService`,{enumerable:!0,get:function(){return U}}),Object.defineProperty(e,`SheetsHyperLinkResolverService`,{enumerable:!0,get:function(){return E}}),e.SheetsHyperLinkSidePanelService=ee,Object.defineProperty(e,`UniverSheetsHyperLinkUIPlugin`,{enumerable:!0,get:function(){return $}})});
@@ -1 +1 @@
1
- (function(e,l){typeof exports=="object"&&typeof module<"u"?module.exports=l():typeof define=="function"&&define.amd?define(l):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsHyperLinkUiCaES=l())})(this,(function(){"use strict";return{hyperLink:{form:{editTitle:"Edita l'enllaç",addTitle:"Insereix enllaç",label:"Etiqueta",type:"Tipus",link:"Enllaç",linkPlaceholder:"Introdueix l'enllaç",range:"Interval",worksheet:"Full de càlcul",definedName:"Nom definit",ok:"Confirmar",cancel:"Cancel·lar",labelPlaceholder:"Introdueix l'etiqueta",inputError:"Si us plau, introdueix",selectError:"Si us plau, selecciona",linkError:"Si us plau, introdueix un enllaç vàlid"},menu:{add:"Insereix enllaç"},message:{noSheet:"El full de destinació ha estat eliminat",refError:"Interval no vàlid",hiddenSheet:"No es pot obrir l'enllaç perquè el full enllaçat està amagat",coped:"Enllaç copiat al porta-retalls"},popup:{copy:"Copia l'enllaç",edit:"Edita l'enllaç",cancel:"Cancel·la l'enllaç"}}}}));
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsHyperLinkUiCaES=t())})(this,function(){return{hyperLink:{form:{editTitle:`Edita l'enllaç`,addTitle:`Insereix enllaç`,label:`Etiqueta`,type:`Tipus`,link:`Enllaç`,linkPlaceholder:`Introdueix l'enllaç`,range:`Interval`,worksheet:`Full de càlcul`,definedName:`Nom definit`,ok:`Confirmar`,cancel:`Cancel·lar`,labelPlaceholder:`Introdueix l'etiqueta`,inputError:`Si us plau, introdueix`,selectError:`Si us plau, selecciona`,linkError:`Si us plau, introdueix un enllaç vàlid`},menu:{add:`Insereix enllaç`},message:{noSheet:`El full de destinació ha estat eliminat`,refError:`Interval no vàlid`,hiddenSheet:`No es pot obrir l'enllaç perquè el full enllaçat està amagat`,coped:`Enllaç copiat al porta-retalls`},popup:{copy:`Copia l'enllaç`,edit:`Edita l'enllaç`,cancel:`Cancel·la l'enllaç`}}}});
@@ -1 +1 @@
1
- (function(e,n){typeof exports=="object"&&typeof module<"u"?module.exports=n():typeof define=="function"&&define.amd?define(n):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsHyperLinkUiEnUS=n())})(this,(function(){"use strict";return{hyperLink:{form:{editTitle:"Edit Link",addTitle:"Insert Link",label:"Label",type:"Type",link:"Link",linkPlaceholder:"Enter link",range:"Range",worksheet:"Worksheet",definedName:"Defined Name",ok:"Confirm",cancel:"Cancel",labelPlaceholder:"Enter label",inputError:"Please enter",selectError:"Please select",linkError:"Please enter a legal link"},menu:{add:"Insert Link"},message:{noSheet:"Target sheet has been delete",refError:"Invalid Range",hiddenSheet:"Cannot open the link because the linked sheet is hidden",coped:"Link copied to clipboard"},popup:{copy:"Copy Link",edit:"Edit Link",cancel:"Cancel Link"}}}}));
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsHyperLinkUiEnUS=t())})(this,function(){return{hyperLink:{form:{editTitle:`Edit Link`,addTitle:`Insert Link`,label:`Label`,type:`Type`,link:`Link`,linkPlaceholder:`Enter link`,range:`Range`,worksheet:`Worksheet`,definedName:`Defined Name`,ok:`Confirm`,cancel:`Cancel`,labelPlaceholder:`Enter label`,inputError:`Please enter`,selectError:`Please select`,linkError:`Please enter a legal link`},menu:{add:`Insert Link`},message:{noSheet:`Target sheet has been delete`,refError:`Invalid Range`,hiddenSheet:`Cannot open the link because the linked sheet is hidden`,coped:`Link copied to clipboard`},popup:{copy:`Copy Link`,edit:`Edit Link`,cancel:`Cancel Link`}}}});
@@ -1 +1 @@
1
- (function(e,a){typeof exports=="object"&&typeof module<"u"?module.exports=a():typeof define=="function"&&define.amd?define(a):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsHyperLinkUiEsES=a())})(this,(function(){"use strict";return{hyperLink:{form:{editTitle:"Editar enlace",addTitle:"Insertar enlace",label:"Etiqueta",type:"Tipo",link:"Enlace",linkPlaceholder:"Introduce el enlace",range:"Rango",worksheet:"Hoja de cálculo",definedName:"Nombre definido",ok:"Confirmar",cancel:"Cancelar",labelPlaceholder:"Introduce la etiqueta",inputError:"Por favor, introduce",selectError:"Por favor, selecciona",linkError:"Por favor, introduce un enlace válido"},menu:{add:"Insertar enlace"},message:{noSheet:"La hoja de destino ha sido eliminada",refError:"Rango no válido",hiddenSheet:"No se puede abrir el enlace porque la hoja enlazada está oculta",coped:"Enlace copiado al portapapeles"},popup:{copy:"Copiar enlace",edit:"Editar enlace",cancel:"Cancelar enlace"}}}}));
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsHyperLinkUiEsES=t())})(this,function(){return{hyperLink:{form:{editTitle:`Editar enlace`,addTitle:`Insertar enlace`,label:`Etiqueta`,type:`Tipo`,link:`Enlace`,linkPlaceholder:`Introduce el enlace`,range:`Rango`,worksheet:`Hoja de cálculo`,definedName:`Nombre definido`,ok:`Confirmar`,cancel:`Cancelar`,labelPlaceholder:`Introduce la etiqueta`,inputError:`Por favor, introduce`,selectError:`Por favor, selecciona`,linkError:`Por favor, introduce un enlace válido`},menu:{add:`Insertar enlace`},message:{noSheet:`La hoja de destino ha sido eliminada`,refError:`Rango no válido`,hiddenSheet:`No se puede abrir el enlace porque la hoja enlazada está oculta`,coped:`Enlace copiado al portapapeles`},popup:{copy:`Copiar enlace`,edit:`Editar enlace`,cancel:`Cancelar enlace`}}}});
@@ -1 +1 @@
1
- (function(e,n){typeof exports=="object"&&typeof module<"u"?module.exports=n():typeof define=="function"&&define.amd?define(n):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsHyperLinkUiFaIR=n())})(this,(function(){"use strict";return{hyperLink:{form:{editTitle:"ویرایش لینک",addTitle:"درج لینک",label:"برچسب",type:"نوع",link:"لینک",linkPlaceholder:"لینک را وارد کنید",range:"محدوده",worksheet:"برگ کار",definedName:"نام تعریف شده",ok:"تایید",cancel:"انصراف",labelPlaceholder:"برچسب را وارد کنید",inputError:"لطفا وارد کنید",selectError:"لطفا انتخاب کنید",linkError:"لطفا یک لینک معتبر وارد کنید"},menu:{add:"درج لینک"},message:{noSheet:"برگ هدف حذف شده است",refError:"محدوده نامعتبر",hiddenSheet:"نمی‌توان لینک را باز کرد زیرا برگ مرتبط پنهان است",coped:"لینک به کلیپ بورد کپی شد"},popup:{copy:"کپی لینک",edit:"ویرایش لینک",cancel:"لینک را لغو کنید"}}}}));
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsHyperLinkUiFaIR=t())})(this,function(){return{hyperLink:{form:{editTitle:`ویرایش لینک`,addTitle:`درج لینک`,label:`برچسب`,type:`نوع`,link:`لینک`,linkPlaceholder:`لینک را وارد کنید`,range:`محدوده`,worksheet:`برگ کار`,definedName:`نام تعریف شده`,ok:`تایید`,cancel:`انصراف`,labelPlaceholder:`برچسب را وارد کنید`,inputError:`لطفا وارد کنید`,selectError:`لطفا انتخاب کنید`,linkError:`لطفا یک لینک معتبر وارد کنید`},menu:{add:`درج لینک`},message:{noSheet:`برگ هدف حذف شده است`,refError:`محدوده نامعتبر`,hiddenSheet:`نمی‌توان لینک را باز کرد زیرا برگ مرتبط پنهان است`,coped:`لینک به کلیپ بورد کپی شد`},popup:{copy:`کپی لینک`,edit:`ویرایش لینک`,cancel:`لینک را لغو کنید`}}}});
@@ -1 +1 @@
1
- (function(e,l){typeof exports=="object"&&typeof module<"u"?module.exports=l():typeof define=="function"&&define.amd?define(l):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsHyperLinkUiFrFR=l())})(this,(function(){"use strict";return{hyperLink:{form:{editTitle:"Modifier le lien",addTitle:"Insérer un lien",label:"Titre",type:"Type",link:"Lien",linkPlaceholder:"Entrez le lien",range:"Plage",worksheet:"Feuille de calcul",definedName:"Nom défini",ok:"Confirmer",cancel:"Annuler",labelPlaceholder:"Entrez le titre",inputError:"Veuillez entrer",selectError:"Veuillez sélectionner",linkError:"Veuillez entrer un lien valide"},menu:{add:"Insérer un lien"},message:{noSheet:"La feuille cible a été supprimée",refError:"Plage invalide",hiddenSheet:"Impossible d'ouvrir le lien car la feuille liée est masquée",coped:"Lien copié dans le presse-papiers"},popup:{copy:"Copier le lien",edit:"Modifier le lien",cancel:"Annuler le lien"}}}}));
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsHyperLinkUiFrFR=t())})(this,function(){return{hyperLink:{form:{editTitle:`Modifier le lien`,addTitle:`Insérer un lien`,label:`Titre`,type:`Type`,link:`Lien`,linkPlaceholder:`Entrez le lien`,range:`Plage`,worksheet:`Feuille de calcul`,definedName:`Nom défini`,ok:`Confirmer`,cancel:`Annuler`,labelPlaceholder:`Entrez le titre`,inputError:`Veuillez entrer`,selectError:`Veuillez sélectionner`,linkError:`Veuillez entrer un lien valide`},menu:{add:`Insérer un lien`},message:{noSheet:`La feuille cible a été supprimée`,refError:`Plage invalide`,hiddenSheet:`Impossible d'ouvrir le lien car la feuille liée est masquée`,coped:`Lien copié dans le presse-papiers`},popup:{copy:`Copier le lien`,edit:`Modifier le lien`,cancel:`Annuler le lien`}}}});
@@ -1 +1 @@
1
- (function(e,n){typeof exports=="object"&&typeof module<"u"?module.exports=n():typeof define=="function"&&define.amd?define(n):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsHyperLinkUiJaJP=n())})(this,(function(){"use strict";return{hyperLink:{form:{editTitle:"リンクの編集",addTitle:"リンクの挿入",label:"表示文字列",type:"種類",link:"リンク",linkPlaceholder:"リンクを入力",range:"範囲",worksheet:"ワークシート",definedName:"定義済みの名前",ok:"OK",cancel:"キャンセル",labelPlaceholder:"表示する文字列を入力",inputError:"値を入力してください",selectError:"選択してください",linkError:"有効なリンクを入力してください"},menu:{add:"リンクの挿入"},message:{noSheet:"対象のワークシートが削除されました",refError:"無効な範囲です",hiddenSheet:"リンクを開けません。参照先のワークシートが非表示です",coped:"リンクがクリップボードにコピーされました"},popup:{copy:"リンクをコピー",edit:"リンクの編集",cancel:"リンク解除"}}}}));
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsHyperLinkUiJaJP=t())})(this,function(){return{hyperLink:{form:{editTitle:`リンクの編集`,addTitle:`リンクの挿入`,label:`表示文字列`,type:`種類`,link:`リンク`,linkPlaceholder:`リンクを入力`,range:`範囲`,worksheet:`ワークシート`,definedName:`定義済みの名前`,ok:`OK`,cancel:`キャンセル`,labelPlaceholder:`表示する文字列を入力`,inputError:`値を入力してください`,selectError:`選択してください`,linkError:`有効なリンクを入力してください`},menu:{add:`リンクの挿入`},message:{noSheet:`対象のワークシートが削除されました`,refError:`無効な範囲です`,hiddenSheet:`リンクを開けません。参照先のワークシートが非表示です`,coped:`リンクがクリップボードにコピーされました`},popup:{copy:`リンクをコピー`,edit:`リンクの編集`,cancel:`リンク解除`}}}});
@@ -1 +1 @@
1
- (function(e,n){typeof exports=="object"&&typeof module<"u"?module.exports=n():typeof define=="function"&&define.amd?define(n):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsHyperLinkUiKoKR=n())})(this,(function(){"use strict";return{hyperLink:{form:{editTitle:"링크 편집",addTitle:"링크 삽입",label:"표시 텍스트",type:"유형",link:"링크",linkPlaceholder:"링크 입력",range:"범위",worksheet:"워크시트",definedName:"정의된 이름",ok:"확인",cancel:"취소",labelPlaceholder:"표시할 텍스트 입력",inputError:"값을 입력하세요",selectError:"선택하세요",linkError:"유효한 링크를 입력하세요"},menu:{add:"링크 삽입"},message:{noSheet:"대상 워크시트가 삭제되었습니다",refError:"잘못된 범위입니다",hiddenSheet:"링크를 열 수 없습니다. 연결된 워크시트가 숨겨져 있습니다",coped:"링크가 클립보드에 복사되었습니다"},popup:{copy:"링크 복사",edit:"링크 편집",cancel:"링크 취소"}}}}));
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsHyperLinkUiKoKR=t())})(this,function(){return{hyperLink:{form:{editTitle:`링크 편집`,addTitle:`링크 삽입`,label:`표시 텍스트`,type:`유형`,link:`링크`,linkPlaceholder:`링크 입력`,range:`범위`,worksheet:`워크시트`,definedName:`정의된 이름`,ok:`확인`,cancel:`취소`,labelPlaceholder:`표시할 텍스트 입력`,inputError:`값을 입력하세요`,selectError:`선택하세요`,linkError:`유효한 링크를 입력하세요`},menu:{add:`링크 삽입`},message:{noSheet:`대상 워크시트가 삭제되었습니다`,refError:`잘못된 범위입니다`,hiddenSheet:`링크를 열 수 없습니다. 연결된 워크시트가 숨겨져 있습니다`,coped:`링크가 클립보드에 복사되었습니다`},popup:{copy:`링크 복사`,edit:`링크 편집`,cancel:`링크 취소`}}}});
@@ -1 +1 @@
1
- (function(e,n){typeof exports=="object"&&typeof module<"u"?module.exports=n():typeof define=="function"&&define.amd?define(n):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsHyperLinkUiRuRU=n())})(this,(function(){"use strict";return{hyperLink:{form:{editTitle:"Редактировать ссылку",addTitle:"Вставить ссылку",label:"Метка",type:"Тип",link:"Ссылка",linkPlaceholder:"Введите ссылку",range:"Диапазон",worksheet:"Лист",definedName:"Определенное имя",ok:"ОК",cancel:"Отмена",labelPlaceholder:"Введите метку",inputError:"Пожалуйста, введите",selectError:"Пожалуйста, выберите",linkError:"Пожалуйста, введите корректную ссылку"},menu:{add:"Вставить ссылку"},message:{noSheet:"Целевой лист был удален",refError:"Недопустимый диапазон",hiddenSheet:"Невозможно открыть ссылку, так как связанный лист скрыт",coped:"Ссылка скопирована в буфер обмена"},popup:{copy:"Копировать ссылку",edit:"Редактировать ссылку",cancel:"Отменить ссылку"}}}}));
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsHyperLinkUiRuRU=t())})(this,function(){return{hyperLink:{form:{editTitle:`Редактировать ссылку`,addTitle:`Вставить ссылку`,label:`Метка`,type:`Тип`,link:`Ссылка`,linkPlaceholder:`Введите ссылку`,range:`Диапазон`,worksheet:`Лист`,definedName:`Определенное имя`,ok:`ОК`,cancel:`Отмена`,labelPlaceholder:`Введите метку`,inputError:`Пожалуйста, введите`,selectError:`Пожалуйста, выберите`,linkError:`Пожалуйста, введите корректную ссылку`},menu:{add:`Вставить ссылку`},message:{noSheet:`Целевой лист был удален`,refError:`Недопустимый диапазон`,hiddenSheet:`Невозможно открыть ссылку, так как связанный лист скрыт`,coped:`Ссылка скопирована в буфер обмена`},popup:{copy:`Копировать ссылку`,edit:`Редактировать ссылку`,cancel:`Отменить ссылку`}}}});
@@ -1 +1 @@
1
- (function(e,o){typeof exports=="object"&&typeof module<"u"?module.exports=o():typeof define=="function"&&define.amd?define(o):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsHyperLinkUiSkSK=o())})(this,(function(){"use strict";return{hyperLink:{form:{editTitle:"Upraviť odkaz",addTitle:"Vložiť odkaz",label:"Popisok",type:"Typ",link:"Odkaz",linkPlaceholder:"Zadajte odkaz",range:"Rozsah",worksheet:"Hárok",definedName:"Definovaný názov",ok:"Potvrdiť",cancel:"Zrušiť",labelPlaceholder:"Zadajte popisok",inputError:"Zadajte hodnotu",selectError:"Vyberte",linkError:"Zadajte platný odkaz"},menu:{add:"Vložiť odkaz"},message:{noSheet:"Cieľový hárok bol odstránený",refError:"Neplatný rozsah",hiddenSheet:"Odkaz nie je možné otvoriť, pretože prepojený hárok je skrytý",coped:"Odkaz skopírovaný do schránky"},popup:{copy:"Kopírovať odkaz",edit:"Upraviť odkaz",cancel:"Zrušiť odkaz"}}}}));
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsHyperLinkUiSkSK=t())})(this,function(){return{hyperLink:{form:{editTitle:`Upraviť odkaz`,addTitle:`Vložiť odkaz`,label:`Popisok`,type:`Typ`,link:`Odkaz`,linkPlaceholder:`Zadajte odkaz`,range:`Rozsah`,worksheet:`Hárok`,definedName:`Definovaný názov`,ok:`Potvrdiť`,cancel:`Zrušiť`,labelPlaceholder:`Zadajte popisok`,inputError:`Zadajte hodnotu`,selectError:`Vyberte`,linkError:`Zadajte platný odkaz`},menu:{add:`Vložiť odkaz`},message:{noSheet:`Cieľový hárok bol odstránený`,refError:`Neplatný rozsah`,hiddenSheet:`Odkaz nie je možné otvoriť, pretože prepojený hárok je skrytý`,coped:`Odkaz skopírovaný do schránky`},popup:{copy:`Kopírovať odkaz`,edit:`Upraviť odkaz`,cancel:`Zrušiť odkaz`}}}});
@@ -1 +1 @@
1
- (function(n,e){typeof exports=="object"&&typeof module<"u"?module.exports=e():typeof define=="function"&&define.amd?define(e):(n=typeof globalThis<"u"?globalThis:n||self,n.UniverSheetsHyperLinkUiViVN=e())})(this,(function(){"use strict";return{hyperLink:{form:{editTitle:"Chỉnh sửa liên kết",addTitle:"Chèn liên kết",label:"Văn bản",labelPlaceholder:"Nhập văn bản",type:"Loại",link:"Liên kết",linkPlaceholder:"Nhập địa chỉ liên kết",range:"Ô",worksheet:"Bảng tính",definedName:"Tên đã xác định",ok:"Xác nhận",cancel:"Hủy",inputError:"Vui lòng nhập",selectError:"Vui lòng chọn",linkError:"Vui lòng nhập liên kết hợp lệ"},menu:{add:"Thêm liên kết"},message:{noSheet:"Bảng con này đã bị xóa",refError:"Tham chiếu lỗi",hiddenSheet:"Không thể mở bảng con bị ẩn",coped:"Liên kết đã được sao chép vào clipboard"},popup:{copy:"Sao chép",edit:"Chỉnh sửa",cancel:"Hủy liên kết"}}}}));
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsHyperLinkUiViVN=t())})(this,function(){return{hyperLink:{form:{editTitle:`Chỉnh sửa liên kết`,addTitle:`Chèn liên kết`,label:`Văn bản`,labelPlaceholder:`Nhập văn bản`,type:`Loại`,link:`Liên kết`,linkPlaceholder:`Nhập địa chỉ liên kết`,range:`Ô`,worksheet:`Bảng tính`,definedName:`Tên đã xác định`,ok:`Xác nhận`,cancel:`Hủy`,inputError:`Vui lòng nhập`,selectError:`Vui lòng chọn`,linkError:`Vui lòng nhập liên kết hợp lệ`},menu:{add:`Thêm liên kết`},message:{noSheet:`Bảng con này đã bị xóa`,refError:`Tham chiếu lỗi`,hiddenSheet:`Không thể mở bảng con bị ẩn`,coped:`Liên kết đã được sao chép vào clipboard`},popup:{copy:`Sao chép`,edit:`Chỉnh sửa`,cancel:`Hủy liên kết`}}}});
@@ -1 +1 @@
1
- (function(e,n){typeof exports=="object"&&typeof module<"u"?module.exports=n():typeof define=="function"&&define.amd?define(n):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsHyperLinkUiZhCN=n())})(this,(function(){"use strict";return{hyperLink:{form:{editTitle:"编辑链接",addTitle:"插入链接",label:"文本",labelPlaceholder:"输入文本",type:"类型",link:"链接",linkPlaceholder:"输入链接地址",range:"单元格",worksheet:"工作表",definedName:"定义的名称",ok:"确认",cancel:"取消",inputError:"请输入",selectError:"请选择",linkError:"请输入合法的链接"},menu:{add:"添加链接"},message:{noSheet:"该子表已被删除",refError:"错误的引用",hiddenSheet:"无法打开被隐藏的子表",coped:"链接已被复制到剪贴板"},popup:{copy:"复制",edit:"编辑",cancel:"取消链接"}}}}));
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsHyperLinkUiZhCN=t())})(this,function(){return{hyperLink:{form:{editTitle:`编辑链接`,addTitle:`插入链接`,label:`文本`,labelPlaceholder:`输入文本`,type:`类型`,link:`链接`,linkPlaceholder:`输入链接地址`,range:`单元格`,worksheet:`工作表`,definedName:`定义的名称`,ok:`确认`,cancel:`取消`,inputError:`请输入`,selectError:`请选择`,linkError:`请输入合法的链接`},menu:{add:`添加链接`},message:{noSheet:`该子表已被删除`,refError:`错误的引用`,hiddenSheet:`无法打开被隐藏的子表`,coped:`链接已被复制到剪贴板`},popup:{copy:`复制`,edit:`编辑`,cancel:`取消链接`}}}});
@@ -1 +1 @@
1
- (function(e,n){typeof exports=="object"&&typeof module<"u"?module.exports=n():typeof define=="function"&&define.amd?define(n):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsHyperLinkUiZhTW=n())})(this,(function(){"use strict";return{hyperLink:{form:{editTitle:"編輯連結",addTitle:"插入連結",label:"文本",labelPlaceholder:"輸入文字",type:"類型",link:"連結",linkPlaceholder:"輸入連結位址",range:"儲存格",worksheet:"工作表",definedName:"定義的名稱",ok:"確認",cancel:"取消",inputError:"請輸入",selectError:"請選擇",linkError:"請輸入合法的連結"},menu:{add:"新增連結"},message:{noSheet:"該子表已被刪除",refError:"錯誤的引用",hiddenSheet:"無法開啟被隱藏的子表",coped:"連結已複製到剪貼簿"},popup:{copy:"複製",edit:"編輯",cancel:"取消連結"}}}}));
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsHyperLinkUiZhTW=t())})(this,function(){return{hyperLink:{form:{editTitle:`編輯連結`,addTitle:`插入連結`,label:`文本`,labelPlaceholder:`輸入文字`,type:`類型`,link:`連結`,linkPlaceholder:`輸入連結位址`,range:`儲存格`,worksheet:`工作表`,definedName:`定義的名稱`,ok:`確認`,cancel:`取消`,inputError:`請輸入`,selectError:`請選擇`,linkError:`請輸入合法的連結`},menu:{add:`新增連結`},message:{noSheet:`該子表已被刪除`,refError:`錯誤的引用`,hiddenSheet:`無法開啟被隱藏的子表`,coped:`連結已複製到剪貼簿`},popup:{copy:`複製`,edit:`編輯`,cancel:`取消連結`}}}});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@univerjs/sheets-hyper-link-ui",
3
- "version": "0.17.0",
3
+ "version": "0.18.0",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "author": "DreamNum <developer@univer.ai>",
@@ -65,18 +65,18 @@
65
65
  },
66
66
  "dependencies": {
67
67
  "@univerjs/icons": "^1.1.1",
68
- "@univerjs/docs": "0.17.0",
69
- "@univerjs/core": "0.17.0",
70
- "@univerjs/design": "0.17.0",
71
- "@univerjs/engine-formula": "0.17.0",
72
- "@univerjs/docs-ui": "0.17.0",
73
- "@univerjs/engine-render": "0.17.0",
74
- "@univerjs/sheets": "0.17.0",
75
- "@univerjs/sheets-data-validation": "0.17.0",
76
- "@univerjs/sheets-formula-ui": "0.17.0",
77
- "@univerjs/sheets-ui": "0.17.0",
78
- "@univerjs/sheets-hyper-link": "0.17.0",
79
- "@univerjs/ui": "0.17.0"
68
+ "@univerjs/core": "0.18.0",
69
+ "@univerjs/docs": "0.18.0",
70
+ "@univerjs/design": "0.18.0",
71
+ "@univerjs/docs-ui": "0.18.0",
72
+ "@univerjs/engine-formula": "0.18.0",
73
+ "@univerjs/engine-render": "0.18.0",
74
+ "@univerjs/sheets": "0.18.0",
75
+ "@univerjs/sheets-data-validation": "0.18.0",
76
+ "@univerjs/sheets-formula-ui": "0.18.0",
77
+ "@univerjs/sheets-hyper-link": "0.18.0",
78
+ "@univerjs/sheets-ui": "0.18.0",
79
+ "@univerjs/ui": "0.18.0"
80
80
  },
81
81
  "devDependencies": {
82
82
  "postcss": "^8.5.8",
@@ -84,16 +84,17 @@
84
84
  "rxjs": "^7.8.2",
85
85
  "tailwindcss": "3.4.18",
86
86
  "typescript": "^5.9.3",
87
- "vite": "^7.3.1",
88
- "vitest": "^4.0.18",
89
- "@univerjs-infra/shared": "0.17.0"
87
+ "vitest": "^4.1.0",
88
+ "@univerjs-infra/shared": "0.18.0"
90
89
  },
91
90
  "scripts": {
92
91
  "test": "vitest run",
93
92
  "test:watch": "vitest",
94
93
  "coverage": "vitest run --coverage",
95
94
  "typecheck": "tsc --noEmit",
96
- "build": "univer-cli build"
95
+ "build:bundle": "univer-cli build",
96
+ "build:types": "tsc -p tsconfig.node.json",
97
+ "build": "pnpm run build:bundle && pnpm run build:types"
97
98
  },
98
99
  "module": "./lib/es/index.js"
99
100
  }