@nocobase/plugin-gantt 1.6.15 → 1.6.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/index.js +1 -1
- package/dist/externalVersion.js +4 -4
- package/package.json +2 -2
package/dist/client/index.js
CHANGED
|
@@ -7,4 +7,4 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@nocobase/client"),require("@formily/react"),require("react"),require("@emotion/css"),require("react-i18next"),require("antd"),require("antd-style"),require("@ant-design/icons"),require("@formily/antd-v5"),require("@formily/shared"),require("@nocobase/utils/client"),require("lodash")):"function"==typeof define&&define.amd?define("@nocobase/plugin-gantt",["@nocobase/client","@formily/react","react","@emotion/css","react-i18next","antd","antd-style","@ant-design/icons","@formily/antd-v5","@formily/shared","@nocobase/utils/client","lodash"],t):"object"==typeof exports?exports["@nocobase/plugin-gantt"]=t(require("@nocobase/client"),require("@formily/react"),require("react"),require("@emotion/css"),require("react-i18next"),require("antd"),require("antd-style"),require("@ant-design/icons"),require("@formily/antd-v5"),require("@formily/shared"),require("@nocobase/utils/client"),require("lodash")):e["@nocobase/plugin-gantt"]=t(e["@nocobase/client"],e["@formily/react"],e.react,e["@emotion/css"],e["react-i18next"],e.antd,e["antd-style"],e["@ant-design/icons"],e["@formily/antd-v5"],e["@formily/shared"],e["@nocobase/utils/client"],e.lodash)}(self,function(e,t,r,n,o,a,i,l,c,s,u,d){return function(){"use strict";var f,p,h,m={482:function(e){e.exports=l},964:function(e){e.exports=n},632:function(e){e.exports=c},505:function(e){e.exports=t},875:function(e){e.exports=s},772:function(t){t.exports=e},584:function(e){e.exports=u},721:function(e){e.exports=a},202:function(e){e.exports=i},467:function(e){e.exports=d},156:function(e){e.exports=r},238:function(e){e.exports=o}},v={};function g(e){var t=v[e];if(void 0!==t)return t.exports;var r=v[e]={exports:{}};return m[e](r,r.exports,g),r.exports}g.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return g.d(t,{a:t}),t},g.d=function(e,t){for(var r in t)g.o(t,r)&&!g.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},g.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},g.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var b={};g.r(b),g.d(b,{Gantt:function(){return rv},PluginGanttClient:function(){return rO},default:function(){return rP}});var y=g("772"),x=g("156"),S=g.n(x),w=g("505");function k(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function C(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(r=o.next()).done)&&(a.push(r.value),!t||a.length!==t);i=!0);}catch(e){l=!0,n=e}finally{try{!i&&null!=o.return&&o.return()}finally{if(l)throw n}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return k(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return k(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var O=(0,x.createContext)({});O.displayName="GanttBlockContext";var P=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0,o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a=arguments.length>5?arguments[5]:void 0,i=arguments.length>6?arguments[6]:void 0,l=arguments.length>7?arguments[7]:void 0;return e.forEach(function(e){var c,s,u=a(e),d=parseFloat((100*e[t.progress]).toFixed(2)),f=(0,y.getLabelFormatValue)(l,e[t.title]);e.children&&e.children.length?(r.push({start:new Date(null!==(c=e[t.start])&&void 0!==c?c:void 0),end:new Date(null!==(s=e[t.end])&&void 0!==s?s:void 0),name:f,id:e[i]+"",type:"project",progress:d>100?100:d||0,hideChildren:o,project:n,color:e.color,isDisabled:u}),P(e.children,t,r,e.id+"",o,a,i,l)):r.push({start:e[t.start]?new Date(e[t.start]):void 0,end:new Date(e[t.end]||e[t.start]),name:f,id:e[i]+"",type:t.end?"task":"milestone",progress:d>100?100:d||0,project:n,color:e.color,isDisabled:u})}),r},E=function(e){var t=e.fieldNames,r=e.timeRange,n=e.resource,o=(0,w.useField)(),a=(0,y.useBlockRequestContext)().service;return S().createElement(O.Provider,{value:{field:o,service:a,resource:n,fieldNames:t,timeRange:r}},e.children)},T=function(e){var t,r,n,o=(0,y.useCollectionManager_deprecated)(e.dataSource).getCollection(e.collection,e.dataSource),a={filter:null===(t=e.params)||void 0===t?void 0:t.filter,paginate:!1,sort:[(null==o?void 0:o.primaryKey)||"id"]};return(null==o?void 0:o.tree)&&(a.tree=!0),S().createElement("div",{"aria-label":"block-item-gantt",role:"button"},S().createElement(y.TableBlockProvider,(r=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n,o,a;n=e,o=t,a=r[t],o in n?Object.defineProperty(n,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[o]=a})}return e}({},e),n=(n={params:a},n),Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(n)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(n,e))}),r),S().createElement(E,e)))},j=function(){return(0,x.useContext)(O)},D=function(){var e,t,r=j(),n=r.fieldNames,o=C((0,x.useState)([]),2),a=o[0],i=o[1],l=(0,y.useCollection_deprecated)(),c=l.getPrimaryKey,s=l.name,u=l.template,d=l.writableView,f=(0,y.useACLRoleContext)().parseAction,p=(0,y.useTableBlockContext)(),h=C((0,x.useState)(!1),2),m=h[0],v=h[1],g=c(),b=null===(e=(0,y.useCollection)().fields.find(function(e){return e.name===(null==n?void 0:n.title)}))||void 0===e?void 0:e.uiSchema,S=function(e){var t=null==e?void 0:e[g],r=f("".concat(s,":update"),{schema:{},recordPkValue:t});return"view"===u&&!d||!r};return(0,x.useEffect)(function(){var e;if(v(!0),!(null==r?void 0:null===(e=r.service)||void 0===e?void 0:e.loading)){var t,n=P(null===(t=r.service.data)||void 0===t?void 0:t.data,r.fieldNames,[],void 0,!1,S,g,b);i(n),v(!1),r.field.data=n,a.length>0&&p.setExpandFlag(!0)}},[null==r?void 0:null===(t=r.service)||void 0===t?void 0:t.loading]),{fieldNames:r.fieldNames,timeRange:r.timeRange,onExpanderClick:function(e){var t=r.field.data.map(function(t){return t.id===e.id?e:t});i(t),r.field.data=t},expandAndCollapseAll:function(e){var t,n=P(null===(t=r.service.data)||void 0===t?void 0:t.data,r.fieldNames,[],void 0,e,S,g,b);i(n),r.field.data=n},tasks:a,loading:m}},M=g("238"),N=function(){return(0,M.useTranslation)("gantt")},A=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"string",r=(0,y.useCompile)(),n=(0,y.useCollection_deprecated)().fields;return null==n?void 0:null===(e=n.filter(function(e){return"string"==typeof t?e.type===t:t.includes(e.type)}))||void 0===e?void 0:e.map(function(e){var t;return{value:e.name,label:r(null==e?void 0:null===(t=e.uiSchema)||void 0===t?void 0:t.title)}})};function F(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var I=new y.SchemaSettings({name:"GanttBlockSettings",items:[{name:"title",Component:y.SchemaSettingsBlockTitleItem},{name:"titleField",Component:y.SchemaSettingsSelectItem,useComponentProps:function(){var e,t=N().t,r=(0,w.useFieldSchema)(),n=(null==r?void 0:null===(e=r["x-decorator-props"])||void 0===e?void 0:e.fieldNames)||{},o=j().service,a=(0,w.useField)(),i=(0,y.useDesignable)().dn;return{title:t("Title field"),value:n.title,options:A("string"),onChange:function(e){var t,n=a.decoratorProps.fieldNames||{};n.title=e,a.decoratorProps.params=n,r["x-decorator-props"].params=n,r["x-decorator-props"].fieldNames=n,o.refresh(),i.emit("patch",{schema:(F(t={},"x-uid",r["x-uid"]),F(t,"x-decorator-props",a.decoratorProps),t)}),i.refresh()}}}},{name:"timeScale",Component:y.SchemaSettingsSelectItem,useComponentProps:function(){var e,t=N().t,r=(0,w.useFieldSchema)(),n=(null==r?void 0:null===(e=r["x-decorator-props"])||void 0===e?void 0:e.fieldNames)||{},o=(0,w.useField)(),a=j().service,i=(0,y.useDesignable)().dn,l=(0,y.useCompile)();return{title:t("Time scale"),value:n.range||"day",options:[{label:l('{{t("Hour")}}'),value:"hour",color:"orange"},{label:l('{{t("Quarter of day")}}'),value:"quarterDay",color:"default"},{label:l('{{t("Half of day")}}'),value:"halfDay",color:"blue"},{label:l('{{t("Day")}}'),value:"day",color:"yellow"},{label:l('{{t("Week")}}'),value:"week",color:"pule"},{label:l('{{t("Month")}}'),value:"month",color:"green"},{label:l('{{t("QuarterYear")}}'),value:"quarterYear",color:"red"},{label:l('{{t("Year")}}'),value:"year",color:"green"}],onChange:function(e){var t,n=o.decoratorProps.fieldNames||{};n.range=e,o.decoratorProps.params=n,r["x-decorator-props"].params=n,r["x-decorator-props"].fieldNames=n,a.refresh(),i.emit("patch",{schema:(F(t={},"x-uid",r["x-uid"]),F(t,"x-decorator-props",o.decoratorProps),t)}),i.refresh()}}}},{name:"startDateField",Component:y.SchemaSettingsSelectItem,useComponentProps:function(){var e,t=N().t,r=(0,w.useFieldSchema)(),n=(null==r?void 0:null===(e=r["x-decorator-props"])||void 0===e?void 0:e.fieldNames)||{},o=(0,w.useField)(),a=(0,y.useDesignable)().dn,i=j().service;return{title:t("Start date field"),value:n.start,options:A("date"),onChange:function(e){var t,n=o.decoratorProps.fieldNames||{};n.start=e,o.decoratorProps.fieldNames=n,r["x-decorator-props"].fieldNames=n,i.refresh(),a.emit("patch",{schema:(F(t={},"x-uid",r["x-uid"]),F(t,"x-decorator-props",o.decoratorProps),t)}),a.refresh()}}}},{name:"endDateField",Component:y.SchemaSettingsSelectItem,useComponentProps:function(){var e,t=N().t,r=(0,w.useFieldSchema)(),n=(0,w.useField)(),o=j().service,a=(0,y.useDesignable)().dn,i=(null==r?void 0:null===(e=r["x-decorator-props"])||void 0===e?void 0:e.fieldNames)||{};return{title:t("End date field"),value:i.end,options:A("date"),onChange:function(e){var t,i=n.decoratorProps.fieldNames||{};i.end=e,n.decoratorProps.fieldNames=i,r["x-decorator-props"].fieldNames=i,o.refresh(),a.emit("patch",{schema:(F(t={},"x-uid",r["x-uid"]),F(t,"x-decorator-props",n.decoratorProps),t)}),a.refresh()}}}},{name:"processField",Component:y.SchemaSettingsSelectItem,useComponentProps:function(){var e,t=N().t,r=(0,w.useFieldSchema)(),n=(null==r?void 0:null===(e=r["x-decorator-props"])||void 0===e?void 0:e.fieldNames)||{},o=j().service,a=(0,y.useDesignable)().dn,i=(0,w.useField)();return{title:t("Progress field"),value:n.progress,options:A("float"),onChange:function(e){var t,n=i.decoratorProps.fieldNames||{};n.progress=e,i.decoratorProps.fieldNames=n,r["x-decorator-props"].fieldNames=n,o.refresh(),a.emit("patch",{schema:(F(t={},"x-uid",r["x-uid"]),F(t,"x-decorator-props",i.decoratorProps),t)}),a.refresh()}}}},{name:"dataScope",Component:y.SchemaSettingsDataScope,useComponentProps:function(){var e,t,r=(0,y.useCollection_deprecated)().name,n=(0,w.useFieldSchema)(),o=(0,y.useFormBlockContext)().form,a=(0,w.useField)(),i=(0,y.useDesignable)().dn;return{collectionName:r,defaultFilter:(null==n?void 0:null===(t=n["x-decorator-props"])||void 0===t?void 0:null===(e=t.params)||void 0===e?void 0:e.filter)||{},form:o,onSubmit:function(e){var t,r=e.filter;r=(0,y.removeNullCondition)(r);var o=a.decoratorProps.params||{};o.filter=r,a.decoratorProps.params=o,n["x-decorator-props"].params=o,i.emit("patch",{schema:(F(t={},"x-uid",n["x-uid"]),F(t,"x-decorator-props",n["x-decorator-props"]),t)})}}}},{name:"divider",type:"divider"},{name:"template",Component:y.SchemaSettingsTemplate,useComponentProps:function(){var e=(0,y.useCollection_deprecated)().name,t=(0,y.useBlockTemplateContext)().componentNamePrefix;return{componentName:"".concat(t,"Gantt"),collectionName:e}}},{name:"divider2",type:"divider"},{name:"remove",type:"remove",componentProps:{removeParentsIfNoChildren:!0,breakRemoveOn:{"x-component":"Grid"}}}]}),B=new y.SchemaSettings({name:"blockSettings:gantt",items:[{name:"title",Component:y.SchemaSettingsBlockTitleItem},{name:"titleField",Component:y.SchemaSettingsSelectItem,useComponentProps:function(){var e,t=N().t,r=(0,w.useFieldSchema)(),n=(null==r?void 0:null===(e=r["x-decorator-props"])||void 0===e?void 0:e.fieldNames)||{},o=j().service,a=(0,w.useField)(),i=(0,y.useDesignable)().dn;return{title:t("Title field"),value:n.title,options:A("string"),onChange:function(e){var t,n=a.decoratorProps.fieldNames||{};n.title=e,a.decoratorProps.params=n,r["x-decorator-props"].params=n,r["x-decorator-props"].fieldNames=n,o.refresh(),i.emit("patch",{schema:(F(t={},"x-uid",r["x-uid"]),F(t,"x-decorator-props",a.decoratorProps),t)}),i.refresh()}}}},{name:"timeScale",Component:y.SchemaSettingsSelectItem,useComponentProps:function(){var e,t=N().t,r=(0,w.useFieldSchema)(),n=(null==r?void 0:null===(e=r["x-decorator-props"])||void 0===e?void 0:e.fieldNames)||{},o=(0,w.useField)(),a=j().service,i=(0,y.useDesignable)().dn,l=(0,y.useCompile)();return{title:t("Time scale"),value:n.range||"day",options:[{label:l('{{t("Hour")}}'),value:"hour",color:"orange"},{label:l('{{t("Quarter of day")}}'),value:"quarterDay",color:"default"},{label:l('{{t("Half of day")}}'),value:"halfDay",color:"blue"},{label:l('{{t("Day")}}'),value:"day",color:"yellow"},{label:l('{{t("Week")}}'),value:"week",color:"pule"},{label:l('{{t("Month")}}'),value:"month",color:"green"},{label:l('{{t("QuarterYear")}}'),value:"quarterYear",color:"red"},{label:l('{{t("Year")}}'),value:"year",color:"green"}],onChange:function(e){var t,n=o.decoratorProps.fieldNames||{};n.range=e,o.decoratorProps.params=n,r["x-decorator-props"].params=n,r["x-decorator-props"].fieldNames=n,a.refresh(),i.emit("patch",{schema:(F(t={},"x-uid",r["x-uid"]),F(t,"x-decorator-props",o.decoratorProps),t)}),i.refresh()}}}},{name:"startDateField",Component:y.SchemaSettingsSelectItem,useComponentProps:function(){var e,t=N().t,r=(0,w.useFieldSchema)(),n=(null==r?void 0:null===(e=r["x-decorator-props"])||void 0===e?void 0:e.fieldNames)||{},o=(0,w.useField)(),a=(0,y.useDesignable)().dn,i=j().service;return{title:t("Start date field"),value:n.start,options:A(["date","datetime","dateOnly","datetimeNoTz"]),onChange:function(e){var t,n=o.decoratorProps.fieldNames||{};n.start=e,o.decoratorProps.fieldNames=n,r["x-decorator-props"].fieldNames=n,i.refresh(),a.emit("patch",{schema:(F(t={},"x-uid",r["x-uid"]),F(t,"x-decorator-props",o.decoratorProps),t)}),a.refresh()}}}},y.setDataLoadingModeSettingsItem,{name:"endDateField",Component:y.SchemaSettingsSelectItem,useComponentProps:function(){var e,t=N().t,r=(0,w.useFieldSchema)(),n=(0,w.useField)(),o=j().service,a=(0,y.useDesignable)().dn,i=(null==r?void 0:null===(e=r["x-decorator-props"])||void 0===e?void 0:e.fieldNames)||{};return{title:t("End date field"),value:i.end,options:A(["date","datetime","dateOnly","datetimeNoTz"]),onChange:function(e){var t,i=n.decoratorProps.fieldNames||{};i.end=e,n.decoratorProps.fieldNames=i,r["x-decorator-props"].fieldNames=i,o.refresh(),a.emit("patch",{schema:(F(t={},"x-uid",r["x-uid"]),F(t,"x-decorator-props",n.decoratorProps),t)}),a.refresh()}}}},{name:"processField",Component:y.SchemaSettingsSelectItem,useComponentProps:function(){var e,t=N().t,r=(0,w.useFieldSchema)(),n=(null==r?void 0:null===(e=r["x-decorator-props"])||void 0===e?void 0:e.fieldNames)||{},o=j().service,a=(0,y.useDesignable)().dn,i=(0,w.useField)();return{title:t("Progress field"),value:n.progress,options:A("float"),onChange:function(e){var t,n=i.decoratorProps.fieldNames||{};n.progress=e,i.decoratorProps.fieldNames=n,r["x-decorator-props"].fieldNames=n,o.refresh(),a.emit("patch",{schema:(F(t={},"x-uid",r["x-uid"]),F(t,"x-decorator-props",i.decoratorProps),t)}),a.refresh()}}}},{name:"dataScope",Component:y.SchemaSettingsDataScope,useComponentProps:function(){var e,t,r=(0,y.useCollection)().name,n=(0,w.useFieldSchema)(),o=(0,y.useFormBlockContext)().form,a=(0,w.useField)(),i=(0,y.useDesignable)().dn;return{collectionName:r,defaultFilter:(null==n?void 0:null===(t=n["x-decorator-props"])||void 0===t?void 0:null===(e=t.params)||void 0===e?void 0:e.filter)||{},form:o,onSubmit:function(e){var t,r=e.filter;r=(0,y.removeNullCondition)(r);var o=a.decoratorProps.params||{};o.filter=r,a.decoratorProps.params=o,n["x-decorator-props"].params=o,i.emit("patch",{schema:(F(t={},"x-uid",n["x-uid"]),F(t,"x-decorator-props",n["x-decorator-props"]),t)})}}}},{name:"divider",type:"divider"},{name:"template",Component:y.SchemaSettingsTemplate,useComponentProps:function(){var e=(0,y.useCollection)().name,t=(0,y.useBlockTemplateContext)().componentNamePrefix;return{componentName:"".concat(t,"Gantt"),collectionName:e}}},{name:"divider2",type:"divider"},{name:"remove",type:"remove",componentProps:{removeParentsIfNoChildren:!0,breakRemoveOn:{"x-component":"Grid"}}}]});function H(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n,o,a;n=e,o=t,a=r[t],o in n?Object.defineProperty(n,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[o]=a})}return e}var R={title:"{{t('Configure actions')}}",icon:"SettingOutlined",style:{marginLeft:8},items:[{type:"item",name:"filter",title:"{{t('Filter')}}",Component:"FilterActionInitializer",schema:{"x-align":"left"}},{type:"item",title:"{{t('Add new')}}",name:"addNew",Component:"CreateActionInitializer",schema:{"x-align":"right","x-decorator":"ACLActionProvider","x-acl-action-props":{skipScopeCheck:!0}},useVisible:function(){return(0,y.useActionAvailable)("create")}},{type:"item",title:"{{t('Delete')}}",name:"delete",Component:"BulkDestroyActionInitializer",schema:{"x-align":"right","x-decorator":"ACLActionProvider"},useVisible:function(){return(0,y.useActionAvailable)("destroyMany")}},{type:"item",title:"{{t('Refresh')}}",name:"refresh",Component:"RefreshActionInitializer",schema:{"x-align":"right"}},{name:"toggle",title:"{{t('Expand/Collapse')}}",Component:"ExpandableActionInitializer",schema:{"x-align":"right"},useVisible:function(){var e,t=(0,w.useFieldSchema)(),r=(0,y.useCollection)(),n=((null==t?void 0:null===(e=t.parent)||void 0===e?void 0:e["x-decorator-props"])||{}).treeTable;return r.tree&&n}},{name:"customRequest",title:'{{t("Custom request")}}',Component:"CustomRequestInitializer",schema:{"x-action":"customize:table:request:global"}}]},z=new y.CompatibleSchemaInitializer(H({name:"GanttActionInitializers"},R)),W=new y.CompatibleSchemaInitializer(H({name:"gantt:configureActions"},R),z),L=g("482"),q=g("632"),G=g("875"),Y=function(e){var t,r,n,o=e.collectionName,a=e.fieldNames,i=e.dataSource,l=e.association;var c={type:"void","x-acl-action":"".concat(l||o,":list"),"x-decorator":"GanttBlockProvider","x-decorator-props":{collection:o,dataSource:i,action:"list",fieldNames:a,params:{paginate:!1}},"x-toolbar":"BlockSchemaToolbar","x-settings":"blockSettings:gantt","x-component":"CardItem",properties:(t={},r=(0,G.uid)(),n={type:"void","x-component":"Gantt","x-use-component-props":"useGanttBlockProps",properties:{toolBar:{type:"void","x-component":"ActionBar","x-component-props":{style:{marginBottom:24}},"x-initializer":"gantt:configureActions",properties:{}},table:{type:"array","x-decorator":"div","x-decorator-props":{style:{float:"left",maxWidth:"35%"}},"x-initializer":"table:configureColumns","x-component":"TableV2","x-use-component-props":"useTableBlockProps","x-component-props":{rowKey:"id",rowSelection:{type:"checkbox"},pagination:!1},properties:{actions:{type:"void",title:'{{ t("Actions") }}',"x-action-column":"actions","x-decorator":"TableV2.Column.ActionBar","x-component":"TableV2.Column","x-toolbar":"TableColumnSchemaToolbar","x-initializer":"table:configureItemActions","x-settings":"fieldSettings:TableColumn","x-toolbar-props":{initializer:"table:configureItemActions"},properties:{actions:{type:"void","x-decorator":"DndContext","x-component":"Space","x-component-props":{split:"|"}}}}}},detail:{type:"void","x-component":"Gantt.Event",properties:{drawer:{type:"void","x-component":"Action.Drawer","x-component-props":{className:"nb-action-popup"},title:'{{ t("View record") }}',properties:{tabs:{type:"void","x-component":"Tabs","x-component-props":{},"x-initializer":"popup:addTab",properties:{tab1:{type:"void",title:'{{t("Details")}}',"x-component":"Tabs.TabPane","x-designer":"Tabs.Designer","x-component-props":{},properties:{grid:{type:"void","x-component":"Grid","x-initializer":"popup:common:addBlock"}}}}}}}}}}},r in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t)};return l&&(c["x-decorator-props"].association=l),c};function X(e,t,r,n,o,a,i){try{var l=e[a](i),c=l.value}catch(e){r(e);return}l.done?t(c):Promise.resolve(c).then(n,o)}function U(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var a=e.apply(t,r);function i(e){X(a,n,o,i,l,"next",e)}function l(e){X(a,n,o,i,l,"throw",e)}i(void 0)})}}function _(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n,o,a;n=e,o=t,a=r[t],o in n?Object.defineProperty(n,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[o]=a})}return e}function V(e,t){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(a){return function(l){return function(a){if(r)throw TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}var Q=function(e){var t,r,n,o=e.filterCollections,a=e.onlyCurrentDataSource,i=e.hideSearch,l=e.createBlockSchema,c=e.showAssociationFields,s=(0,y.useSchemaInitializerItem)(),u=$().createGanttBlock;return S().createElement(y.DataBlockInitializer,(r=_({},s),n=(n={componentType:"Gantt",icon:S().createElement(L.ProjectOutlined,{rotate:90}),onCreateBlockSchema:(t=U(function(e){return V(this,function(t){return l?[2,l(e)]:(u(e),[2])})}),function(e){return t.apply(this,arguments)}),onlyCurrentDataSource:a,hideSearch:i,filter:o,showAssociationFields:c},n),Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(n)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(n,e))}),r))},$=function(){var e,t=(0,y.useSchemaInitializer)().insert,r=(0,M.useTranslation)().t,n=(0,y.useCollectionManager_deprecated)().getCollectionFields,o=(0,x.useContext)(w.SchemaOptionsContext),a=(0,y.useGlobalTheme)().theme;return{createGanttBlock:(e=U(function(e){var i,l,c,s,u,d,f,p,h;return V(this,function(m){switch(m.label){case 0:return d=null==(u=n((i=e.item).name,i.dataSource))?void 0:null===(l=u.filter(function(e){return"string"===e.type}))||void 0===l?void 0:l.map(function(e){var t;return{label:null==e?void 0:null===(t=e.uiSchema)||void 0===t?void 0:t.title,value:e.name}}),f=null==u?void 0:null===(c=u.filter(function(e){return["date","datetime","dateOnly","datetimeNoTz"].includes(e.type)}))||void 0===c?void 0:c.map(function(e){var t;return{label:null==e?void 0:null===(t=e.uiSchema)||void 0===t?void 0:t.title,value:e.name}}),p=null==u?void 0:null===(s=u.filter(function(e){return"float"===e.type}))||void 0===s?void 0:s.map(function(e){var t;return{label:null==e?void 0:null===(t=e.uiSchema)||void 0===t?void 0:t.title,value:e.name}}),[4,(0,y.FormDialog)(r("Create gantt block"),function(){return S().createElement(y.SchemaComponentOptions,{scope:o.scope,components:_({},o.components)},S().createElement(q.FormLayout,{layout:"vertical"},S().createElement(y.SchemaComponent,{schema:{properties:{title:{title:r("Title field"),enum:d,required:!0,"x-component":"Select","x-decorator":"FormItem"},start:{title:r("Start date field"),enum:f,required:!0,default:"createdAt","x-component":"Select","x-decorator":"FormItem"},end:{title:r("End date field"),enum:f,required:!0,"x-component":"Select","x-decorator":"FormItem"},progress:{title:r("Progress field"),enum:p,"x-component":"Select","x-decorator":"FormItem"},range:{title:r("Time scale"),enum:[{label:'{{t("Hour")}}',value:"hour",color:"orange"},{label:'{{t("Quarter of day")}}',value:"quarterDay",color:"default"},{label:'{{t("Half of day")}}',value:"halfDay",color:"blue"},{label:'{{t("Day")}}',value:"day",color:"yellow"},{label:'{{t("Week")}}',value:"week",color:"pule"},{label:'{{t("Month")}}',value:"month",color:"green"},{label:'{{t("Year")}}',value:"year",color:"green"},{label:'{{t("QuarterYear")}}',value:"quarterYear",color:"red"}],default:"day","x-component":"Select","x-decorator":"FormItem"}}}})))},a).open({initialValues:{}})];case 1:return h=m.sent(),t(Y({collectionName:i.name,dataSource:i.dataSource,fieldNames:_({},h)})),[2]}})}),function(t){return e.apply(this,arguments)})}},K=(0,w.observer)(function(e){var t=(0,y.useCollectionRecordData)(),r=(0,y.useCollection)();return S().createElement(y.PopupContextProvider,null,S().createElement(y.VariablePopupRecordProvider,{recordData:t,collection:r},e.children))},{displayName:"Event"}),J=g("964"),Z=g("721"),ee=g("467");function et(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function er(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n,o,a;n=e,o=t,a=r[t],o in n?Object.defineProperty(n,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[o]=a})}return e}function en(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}function eo(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(r=o.next()).done)&&(a.push(r.value),!t||a.length!==t);i=!0);}catch(e){l=!0,n=e}finally{try{!i&&null!=o.return&&o.return()}finally{if(l)throw n}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return et(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return et(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var ea=function(e,t,r,n,o,a,i,l,c,s,u,d,f,p,h,m,v,g){var b=e.map(function(e,b){return ei(e,b,t,r,n,o,a,i,l,c,s,u,d,f,p,h,m,v,g)});return b=b.map(function(e){for(var t=function(t){var n=b.findIndex(function(e){return e.id===r[t]});-1!==n&&b[n].barChildren.push(e)},r=e.dependencies||[],n=0;n<r.length;n++)t(n);return e})},ei=function(e,t,r,n,o,a,i,l,c,s,u,d,f,p,h,m,v,g,b){var y;switch(e.type){case"milestone":y=ec(e,t,r,n,o,a,i,l,g,b);break;case"project":y=el(e,t,r,n,o,.5*a,i,l,c,p,h,m,v);break;default:y=el(e,t,r,n,o,a,i,l,c,s,u,d,f)}return y},el=function(e,t,r,n,o,a,i,l,c,s,u,d,f){c?(h=eu(e.start,r,n),p=eu(e.end,r,n)):(p=es(e.start,r,n),h=es(e.end,r,n));var p,h,m=e.type;"task"===m&&h-p<2*l&&(m="smalltask",h=p>0?p+2*l:p);var v=eo(ef(p,h,e.progress,c),2),g=v[0],b=v[1],y="project"===e.type?ed(t,o,a)+8:ed(t,o,a),x="project"===e.type?e.hideChildren:void 0,S=er({backgroundColor:d,backgroundSelectedColor:f,progressColor:s,progressSelectedColor:u},e.styles);return en(er({},e),{typeInternal:m,x1:p,x2:h,y:y,index:t,progressX:b,progressWidth:g,barCornerRadius:i,handleWidth:l,hideChildren:x,height:a,barChildren:[],styles:S})},ec=function(e,t,r,n,o,a,i,l,c,s){var u=es(e.start,r,n),d=ed(t,o,a),f=u-.5*a,p=u+.5*a,h=a/1.414,m=er({backgroundColor:c,backgroundSelectedColor:s,progressColor:"",progressSelectedColor:""},e.styles);return en(er({},e),{end:e.start,x1:f,x2:p,y:d,index:t,progressX:0,progressWidth:0,barCornerRadius:i,handleWidth:l,typeInternal:e.type,progress:0,height:h,hideChildren:void 0,barChildren:[],styles:m})},es=function(e,t,r){var n,o,a,i=t.findIndex(function(t){return(null==t?void 0:t.getTime())>=(null==e?void 0:e.getTime())})-1,l=((null==e?void 0:e.getTime())-(null===(n=t[i])||void 0===n?void 0:n.getTime()))/((null===(o=t[i+1])||void 0===o?void 0:o.getTime())-(null===(a=t[i])||void 0===a?void 0:a.getTime())),c=i*r+l*r;return isNaN(c)?0:c},eu=function(e,t,r){var n=es(e,t,r);return isNaN(n+=r)?0:n},ed=function(e,t,r){var n=e*t+(t-r)/2;return isNaN(n)?0:n},ef=function(e,t,r,n){var o,a=(t-e)*r*.01;return o=n?t-a:e,[a,o]},ep=function(e,t){if(e>=t.x2)return 100;if(e<=t.x1)return 0;var r=t.x2-t.x1;return Math.round((e-t.x1)*100/r)},eh=function(e,t){if(e>=t.x2)return 0;if(e<=t.x1)return 100;var r=t.x2-t.x1;return Math.round((t.x2-e)*100/r)},em=function(e,t,r){return[e-5,t+r,e+5,t+r,e,t+r-8.66].join(",")},ev=function(e,t,r){e>=r.x2-2*r.handleWidth&&(e=r.x2-2*r.handleWidth);var n=Math.round((e-r.x1)/t);return r.x1+n*t},eg=function(e,t,r){e<=r.x1+2*r.handleWidth&&(e=r.x1+2*r.handleWidth);var n=Math.round((e-r.x2)/t);return r.x2+n*t},eb=function(e,t,r){var n=Math.round((e-r.x1)/t),o=r.x1+n*t,a=o+r.x2-r.x1;return[o,a]},ey=function(e,t,r,n,o){var a,i,l=new Date((e-t)/n*o+(null==r?void 0:null===(a=r.getTime)||void 0===a?void 0:a.call(r)));return l=new Date((null==l?void 0:null===(i=l.getTime)||void 0===i?void 0:i.call(l))+((null==l?void 0:l.getTimezoneOffset())-(null==r?void 0:r.getTimezoneOffset()))*6e4)},ex=function(e,t,r,n,o,a,i){var l;if("milestone"===r.type)l=ew(e,t,r,n,o,a);else l=eS(e,t,r,n,o,a,i);return l},eS=function(e,t,r,n,o,a,i){var l=er({},r),c=!1;switch(t){case"progress":if(i?l.progress=eh(e,r):l.progress=ep(e,r),c=l.progress!==r.progress){var s=eo(ef(l.x1,l.x2,l.progress,i),2),u=s[0],d=s[1];l.progressWidth=u,l.progressX=d}break;case"start":var f=ev(e,n,r);if(l.x1=f,c=l.x1!==r.x1){i?l.end=ey(f,r.x1,r.end,n,o):l.start=ey(f,r.x1,r.start,n,o);var p=eo(ef(l.x1,l.x2,l.progress,i),2),h=p[0],m=p[1];l.progressWidth=h,l.progressX=m}break;case"end":var v=eg(e,n,r);if(l.x2=v,c=l.x2!==r.x2){i?l.start=ey(v,r.x2,r.start,n,o):l.end=ey(v,r.x2,r.end,n,o);var g=eo(ef(l.x1,l.x2,l.progress,i),2),b=g[0],y=g[1];l.progressWidth=b,l.progressX=y}break;case"move":var x=eo(eb(e-a,n,r),2),S=x[0],w=x[1];if(c=S!==r.x1){l.start=ey(S,r.x1,r.start,n,o),l.end=ey(w,r.x2,r.end,n,o),l.x1=S,l.x2=w;var k=eo(ef(l.x1,l.x2,l.progress,i),2),C=k[0],O=k[1];l.progressWidth=C,l.progressX=O}}return{isChanged:c,changedTask:l}},ew=function(e,t,r,n,o,a){var i=er({},r),l=!1;if("move"===t){var c=eo(eb(e-a,n,r),2),s=c[0],u=c[1];(l=s!==r.x1)&&(i.start=ey(s,r.x1,r.start,n,o),i.end=i.start,i.x1=s,i.x2=u)}return{isChanged:l,changedTask:i}};var ek=((f={}).Hour="hour",f.QuarterDay="quarterDay",f.HalfDay="halfDay",f.Day="day",f.Week="week",f.Month="month",f.QuarterYear="quarterYear",f.Year="year",f);Intl.DateTimeFormat,Intl.DateTimeFormatOptions;var eC={},eO=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=JSON.stringify([e,t]),n=eC[r];return!n&&(n=new Intl.DateTimeFormat(e,t),eC[r]=n),n},eP=function(e,t,r){return new Date(e.getFullYear()+("year"===r?t:0),e.getMonth()+("month"===r?t:0),e.getDate()+("day"===r?t:0),e.getHours()+("hour"===r?t:0),e.getMinutes()+("minute"===r?t:0),e.getSeconds()+("second"===r?t:0),e.getMilliseconds()+("millisecond"===r?t:0))},eE=function(e,t){var r=["millisecond","second","minute","hour","day","month","year"],n=function(e){var n=r.indexOf(t);return r.indexOf(e)<=n};return new Date(null==e?void 0:e.getFullYear(),n("year")?0:e.getMonth(),n("month")?1:e.getDate(),n("day")?0:e.getHours(),n("hour")?0:e.getMinutes(),n("minute")?0:e.getSeconds(),n("second")?0:e.getMilliseconds())},eT=function(e,t,r){var n=(null===(c=e[0])||void 0===c?void 0:c.start)||new Date,o=(null===(s=e[0])||void 0===s?void 0:s.start)||new Date,a=!0,i=!1,l=void 0;try{for(var c,s,u,d=e[Symbol.iterator]();!(a=(u=d.next()).done);a=!0){var f=u.value;f.start<n&&(n=f.start),f.end>o&&(o=f.end)}}catch(e){i=!0,l=e}finally{try{!a&&null!=d.return&&d.return()}finally{if(i)throw l}}switch(t){case ek.Year:n=eE(n=eP(n,-1,"year"),"year"),o=eE(o=eP(o,1,"year"),"year");break;case ek.QuarterYear:n=eE(n=eP(n,-3,"month"),"month"),o=eE(o=eP(o,3,"year"),"year");break;case ek.Month:n=eE(n=eP(n,-1*r,"month"),"month"),o=eE(o=eP(o,1,"year"),"year");break;case ek.Week:n=eP(eN(n=eE(n,"day")),-7*r,"day"),o=eP(o=eE(o,"day"),1.5,"month");break;case ek.Day:n=eP(n=eE(n,"day"),-1*r,"day"),o=eP(o=eE(o,"day"),19,"day");break;case ek.QuarterDay:n=eP(n=eE(n,"day"),-1*r,"day"),o=eP(o=eE(o,"day"),66,"hour");break;case ek.HalfDay:n=eP(n=eE(n,"day"),-1*r,"day"),o=eP(o=eE(o,"day"),108,"hour");break;case ek.Hour:n=eP(n=eE(n,"hour"),-1*r,"hour"),o=eP(o=eE(o,"day"),1,"day")}return[n,o]},ej=function(e,t,r){for(var n=new Date(e),o=[n];n<t;){switch(r){case ek.Year:n=eP(n,1,"year");break;case ek.QuarterYear:n=eP(n,3,"month");break;case ek.Month:n=eP(n,1,"month");break;case ek.Week:n=eP(n,7,"day");break;case ek.Day:n=eP(n,1,"day");break;case ek.HalfDay:n=eP(n,12,"hour");break;case ek.QuarterDay:n=eP(n,6,"hour");break;case ek.Hour:n=eP(n,1,"hour")}o.push(n)}return o},eD=function(e,t){var r=eO(t,{month:"long"}).format(e);return r=r.replace(r[0],r[0].toLocaleUpperCase())},eM=function(e,t,r){var n=eO(t,{weekday:r}).format(e);return n=n.replace(n[0],n[0].toLocaleUpperCase())},eN=function(e){var t=e.getDay(),r=e.getDate()-t+(0===t?-6:1);return new Date(e.setDate(r))},eA=function(e){var t=new Date(e.valueOf()),r=(t.getDay()+6)%7;t.setDate(t.getDate()-r+3);var n=t.valueOf();t.setMonth(0,1),4!==t.getDay()&&t.setMonth(0,1+(4-t.getDay()+7)%7);var o=(1+Math.ceil((n-t.valueOf())/6048e5)).toString();return 1===o.length?"0".concat(o):o};function eF(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var eI=function(e,t){var r=e.displayOrder||Number.MAX_VALUE,n=t.displayOrder||Number.MAX_VALUE;return r>n?1:r<n?-1:0},eB=function(e){var t;return isNaN(null==e?void 0:null===(t=e.getTime)||void 0===t?void 0:t.call(e))?0:e.getFullYear()+"/"+"".concat(e.getMonth()+1)+"/"+e.getDate()},eH=g("202");function eR(e,t){return!t&&(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function ez(){var e=eR(["\n overflow: auto;\n position: absolute;\n bottom: -8px;\n max-width: 100%;\n scrollbarWidth: thin;\n height: 1.2rem;\n &::-webkit-scrollbar: { width: 8, height: 8 };\n &::-webkit-scrollbar-corner: { background: transparent };\n &::-webkit-scrollbar-track: { background: var(--colorBgScrollTrack) };\n &::-webkit-scrollbar-thumb: {\n background: var(--colorBgScrollBar);\n borderRadius: 4;\n };\n &::-webkit-scrollbar-thumb:hover: {\n background: var(--colorBgScrollBarHover);\n };\n &::-webkit-scrollbar-thumb:active: {\n background: var(--colorBgScrollBarActive)\n }\n "]);return ez=function(){return e},e}function eW(){var e=eR(["\n padding: 12px;\n background-color: ",";\n background-clip: padding-box;\n border-radius: ",";\n box-shadow: ",";\n b: {\n display: block;\n margin-bottom: ",";\n }\n .tooltipdefaultcontainerparagraph: {\n font-size: ",";\n margin-bottom: "," + ",";\n color: ",";\n }\n "]);return eW=function(){return e},e}function eL(){var e=eR(["\n position: absolute;\n display: flex;\n flexshrink: 0;\n pointerevents: none;\n webkittouchcallout: none;\n webkituserselect: none;\n mozuserselect: none;\n msuserselect: none;\n userselect: none;\n "]);return eL=function(){return e},e}function eq(){var e=eR(["\n visibility: hidden;\n position: absolute;\n display: flex;\n pointerevents: none;\n "]);return eq=function(){return e},e}function eG(){var e=eR(["\n .horizontalScroll: {\n height: 1\n }\n \n .verticalScroll: {\n overflow: hidden auto;\n width: 1rem;\n flexShrink: 0;\n scrollbarWidth: thin;\n &::-webkit-scrollbar: { width: 8, height: 8 };\n &::-webkit-scrollbar-corner: { background: transparent};\n &::-webkit-scrollbar-track: { background: var(--colorBgScrollTrack) };\n &::-webkit-scrollbar-thumb: {\n background: var(--colorBgScrollBar);\n borderRadius: 4;\n }\n &::-webkit-scrollbar-thumb:hover': {\n background: var(--colorBgScrollBarHover)\n }\n &::-webkit-scrollbar-thumb:active': {\n background: var(--colorBgScrollBarActive)\n },\n }\n }\n "]);return eG=function(){return e},e}var eY=(0,eH.createStyles)(function(e){var t=e.token,r=e.css;return{scrollWrapper:r(ez()),tooltipDefaultContainer:r(eW(),t.colorBgElevated,t.borderRadius,t.boxShadow,t.marginXS,t.fontSizeSM,t.marginXXS,t.marginXS-t.marginXXS,t.colorText),tooltipDetailsContainer:r(eL()),tooltipDetailsContainerHidden:r(eq()),nbGridOther:r(eG())}}),eX=function(e){var t=e.scroll,r=e.svgWidth,n=e.taskListWidth,o=e.rtl,a=e.onScroll,i=eY().styles,l=(0,x.useRef)(null);return(0,x.useEffect)(function(){l.current&&(l.current.scrollLeft=t)},[t]),S().createElement("div",{dir:"ltr",style:{margin:o?"0px ".concat(n,"px 0px 0px"):"0px 0px 0px ".concat(n,"px")},className:(0,J.cx)(i.nbGridOther,i.scrollWrapper,"gantt-horizontal-scoll"),onScroll:a,ref:l},S().createElement("div",{style:{width:r,height:1},className:"horizontalScroll"}))};function eU(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function e_(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(r=o.next()).done)&&(a.push(r.value),!t||a.length!==t);i=!0);}catch(e){l=!0,n=e}finally{try{!i&&null!=o.return&&o.return()}finally{if(l)throw n}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return eU(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return eU(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var eV=function(e){var t=e.task,r=e.rowHeight,n=e.rtl,o=e.svgContainerHeight,a=e.svgContainerWidth,i=e.scrollX,l=e.scrollY,c=e.arrowIndent,s=e.fontSize,u=e.fontFamily,d=e.headerHeight,f=e.taskListWidth,p=e.TooltipContent,h=eY().styles,m=(0,x.useRef)(null),v=e_((0,x.useState)(0),2),g=v[0],b=v[1],y=e_((0,x.useState)(0),2),w=y[0],k=y[1];return(0,x.useEffect)(function(){if(m.current){var e,s=1.1*m.current.offsetHeight,u=1.1*m.current.offsetWidth,p=t.index*r-l+d;n?((e=t.x1-1.5*c-u-i)<0&&(e=t.x2+1.5*c-i),u+e>a&&(e=a-u,p+=r)):(u+(e=t.x2+1.5*c+f-i)>f+a&&(e=t.x1+f-1.5*c-i-u),e<f&&(e=a+f-u,p+=r)),s+p-l>o-l&&(p=o-s),b(p),k(e)}},[m,t,c,i,l,d,f,r,o,a,n]),S().createElement("div",{ref:m,className:(0,J.cx)(w?h.tooltipDetailsContainer:h.tooltipDetailsContainerHidden,h.nbGridOther),style:{left:w,top:g}},S().createElement(p,{task:t,fontSize:s,fontFamily:u}))},eQ=function(e){var t,r,n,o,a,i,l,c,s=e.task,u=e.fontSize,d=e.fontFamily,f=eY().styles;return S().createElement("div",{className:(0,J.cx)(f.nbGridOther,f.tooltipDefaultContainer),"aria-label":"nb-gantt-tooltip",style:{fontSize:u,fontFamily:d}},S().createElement("b",{style:{fontSize:u}},s.name,": ",eB(s.start)," ~ ",eB(s.end)),(null===(r=s.end)||void 0===r?void 0:null===(t=r.getTime)||void 0===t?void 0:t.call(r))-(null===(o=s.start)||void 0===o?void 0:null===(n=o.getTime)||void 0===n?void 0:n.call(o))!=0&&S().createElement("p",{className:"tooltipDefaultContainerParagraph"},"Duration: ".concat(Math.round(((null===(i=s.end)||void 0===i?void 0:null===(a=i.getTime)||void 0===a?void 0:a.call(i))-(null===(c=s.start)||void 0===c?void 0:null===(l=c.getTime)||void 0===l?void 0:l.call(c)))/864e5*10)/10||""," day(s)")),S().createElement("p",{className:"tooltipDefaultContainerParagraph"},!!s.progress&&"Progress: ".concat(s.progress,"%")))},e$=function(e){var t=e.scroll,r=e.ganttHeight,n=e.ganttFullHeight,o=e.headerHeight,a=e.rtl,i=e.onScroll,l=eY().styles,c=(0,x.useRef)(null);return(0,x.useEffect)(function(){c.current&&(c.current.scrollTop=t)},[t]),S().createElement("div",{style:{maxHeight:r,marginTop:o,marginLeft:a?"":"-1rem"},className:(0,J.cx)(l.nbGridOther,"verticalScroll"),onScroll:i,ref:c},S().createElement("div",{style:{height:n,width:1}}))},eK=function(e){var t=(0,w.useFieldSchema)().properties.detail;return t?S().createElement(y.NocoBaseRecursionField,{schema:t,name:t.name}):null};function eJ(e,t){return!t&&(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function eZ(){var e=eJ(["\n overflow: hidden;\n font-size: 0;\n margin: 0;\n padding: 0;\n width: 100%;\n border-left: 2px solid ",";\n overflow-x: auto;\n .ganttheader: {\n border-bottom: 1px solid ",";\n font-weight: 700;\n }\n .ganttbody: {\n border-bottom: 1px solid ",";\n }\n "]);return eZ=function(){return e},e}function e0(){var e=eJ(["\n margin: 0;\n padding: 0;\n overflow: hidden;\n margin-bottom: -5px;\n "]);return e0=function(){return e},e}function e1(){var e=eJ(["\n display: flex;\n padding: 0;\n margin: 0;\n liststyle: none;\n outline: none;\n position: relative;\n .gantt-horizontal-scoll: {\n display: none;\n }\n &:hover: {\n .gantt-horizontal-scoll: {\n display: block;\n }\n }\n "]);return e1=function(){return e},e}var e2=(0,y.createStyles)(function(e){var t=e.token,r=e.css;return{ganttverticalcontainer:r(eZ(),t.colorBorderSecondary,t.colorBorderSecondary,t.colorBorderSecondary),horizontalcontainer:r(e0()),wrapper:r(e1())}});function e5(e,t){(function(e){return"string"==typeof e&&-1!==e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var r=function(e){return"string"==typeof e&&-1!==e.indexOf("%")}(e);return(e=360===t?e:Math.min(t,Math.max(0,parseFloat(e))),r&&(e=parseInt(String(e*t),10)/100),1e-6>Math.abs(e-t))?1:e=360===t?(e<0?e%t+t:e%t)/parseFloat(String(t)):e%t/parseFloat(String(t))}function e6(e){return Math.min(1,Math.max(0,e))}function e8(e){return(isNaN(e=parseFloat(e))||e<0||e>1)&&(e=1),e}function e3(e){return e<=1?"".concat(100*Number(e),"%"):e}function e4(e){return 1===e.length?"0"+e:String(e)}function e9(e,t,r){e=e5(e,255),t=e5(t,255);var n=Math.max(e,t,r=e5(r,255)),o=Math.min(e,t,r),a=0,i=0,l=(n+o)/2;if(n===o)i=0,a=0;else{var c=n-o;switch(i=l>.5?c/(2-n-o):c/(n+o),n){case e:a=(t-r)/c+(t<r?6:0);break;case t:a=(r-e)/c+2;break;case r:a=(e-t)/c+4}a/=6}return{h:a,s:i,l:l}}function e7(e,t,r){return(r<0&&(r+=1),r>1&&(r-=1),r<1/6)?e+6*r*(t-e):r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function te(e,t,r){e=e5(e,255),t=e5(t,255);var n=Math.max(e,t,r=e5(r,255)),o=Math.min(e,t,r),a=0,i=n-o;if(n===o)a=0;else{switch(n){case e:a=(t-r)/i+(t<r?6:0);break;case t:a=(r-e)/i+2;break;case r:a=(e-t)/i+4}a/=6}return{h:a,s:0===n?0:i/n,v:n}}function tt(e,t,r,n){var o=[e4(Math.round(e).toString(16)),e4(Math.round(t).toString(16)),e4(Math.round(r).toString(16))];return n&&o[0].startsWith(o[0].charAt(1))&&o[1].startsWith(o[1].charAt(1))&&o[2].startsWith(o[2].charAt(1))?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0):o.join("")}function tr(e){return tn(e)/255}function tn(e){return parseInt(e,16)}var to={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},ta="(?:".concat("[-\\+]?\\d*\\.\\d+%?",")|(?:").concat("[-\\+]?\\d+%?",")"),ti="[\\s|\\(]+(".concat(ta,")[,|\\s]+(").concat(ta,")[,|\\s]+(").concat(ta,")\\s*\\)?"),tl="[\\s|\\(]+(".concat(ta,")[,|\\s]+(").concat(ta,")[,|\\s]+(").concat(ta,")[,|\\s]+(").concat(ta,")\\s*\\)?"),tc={CSS_UNIT:new RegExp(ta),rgb:RegExp("rgb"+ti),rgba:RegExp("rgba"+tl),hsl:RegExp("hsl"+ti),hsla:RegExp("hsla"+tl),hsv:RegExp("hsv"+ti),hsva:RegExp("hsva"+tl),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function ts(e){return!!tc.CSS_UNIT.exec(String(e))}var tu=function(){function e(t,r){if(void 0===t&&(t=""),void 0===r&&(r={}),t instanceof e)return t;if("number"==typeof t){var n;t={r:(n=t)>>16,g:(65280&n)>>8,b:255&n}}this.originalInput=t;var o,a=function(e){var t,r,n,o,a,i,l,c,s,u,d,f,p={r:0,g:0,b:0},h=1,m=null,v=null,g=null,b=!1,y=!1;if("string"==typeof e&&(e=function(e){if(0===(e=e.trim().toLowerCase()).length)return!1;var t=!1;if(to[e])e=to[e],t=!0;else if("transparent"===e)return{r:0,g:0,b:0,a:0,format:"name"};var r=tc.rgb.exec(e);if(r)return{r:r[1],g:r[2],b:r[3]};if(r=tc.rgba.exec(e))return{r:r[1],g:r[2],b:r[3],a:r[4]};if(r=tc.hsl.exec(e))return{h:r[1],s:r[2],l:r[3]};if(r=tc.hsla.exec(e))return{h:r[1],s:r[2],l:r[3],a:r[4]};if(r=tc.hsv.exec(e))return{h:r[1],s:r[2],v:r[3]};if(r=tc.hsva.exec(e))return{h:r[1],s:r[2],v:r[3],a:r[4]};if(r=tc.hex8.exec(e))return{r:tn(r[1]),g:tn(r[2]),b:tn(r[3]),a:tn(r[4])/255,format:t?"name":"hex8"};if(r=tc.hex6.exec(e))return{r:tn(r[1]),g:tn(r[2]),b:tn(r[3]),format:t?"name":"hex"};if(r=tc.hex4.exec(e))return{r:tn(r[1]+r[1]),g:tn(r[2]+r[2]),b:tn(r[3]+r[3]),a:tn(r[4]+r[4])/255,format:t?"name":"hex8"};return!!(r=tc.hex3.exec(e))&&{r:tn(r[1]+r[1]),g:tn(r[2]+r[2]),b:tn(r[3]+r[3]),format:t?"name":"hex"}}(e)),"object"==typeof e){;if(ts(e.r)&&ts(e.g)&&ts(e.b)){;t=e.r,r=e.g,n=e.b,p={r:255*e5(t,255),g:255*e5(r,255),b:255*e5(n,255)},b=!0,y="%"===String(e.r).substr(-1)?"prgb":"rgb"}else if(ts(e.h)&&ts(e.s)&&ts(e.v)){;m=e3(e.s),v=e3(e.v),o=e.h,a=m,i=v,o=6*e5(o,360),a=e5(a,100),i=e5(i,100),l=Math.floor(o),c=o-l,s=i*(1-a),u=i*(1-c*a),d=i*(1-(1-c)*a),p={r:255*[i,u,s,s,d,i][f=l%6],g:255*[d,i,i,u,s,s][f],b:255*[s,s,d,i,i,u][f]},b=!0,y="hsv"}else ts(e.h)&&ts(e.s)&&ts(e.l)&&(m=e3(e.s),g=e3(e.l),p=function(e,t,r){if(e=e5(e,360),t=e5(t,100),r=e5(r,100),0===t)o=r,a=r,n=r;else{var n,o,a,i=r<.5?r*(1+t):r+t-r*t,l=2*r-i;n=e7(l,i,e+1/3),o=e7(l,i,e),a=e7(l,i,e-1/3)}return{r:255*n,g:255*o,b:255*a}}(e.h,m,g),b=!0,y="hsl");Object.prototype.hasOwnProperty.call(e,"a")&&(h=e.a)}return h=e8(h),{ok:b,format:e.format||y,r:Math.min(255,Math.max(p.r,0)),g:Math.min(255,Math.max(p.g,0)),b:Math.min(255,Math.max(p.b,0)),a:h}}(t);this.originalInput=t,this.r=a.r,this.g=a.g,this.b=a.b,this.a=a.a,this.roundA=Math.round(100*this.a)/100,this.format=null!==(o=r.format)&&void 0!==o?o:a.format,this.gradientType=r.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=a.ok}return e.prototype.isDark=function(){return 128>this.getBrightness()},e.prototype.isLight=function(){return!this.isDark()},e.prototype.getBrightness=function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},e.prototype.getLuminance=function(){var e,t,r,n=this.toRgb(),o=n.r/255,a=n.g/255,i=n.b/255;return .2126*(e=o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4))+.7152*(t=a<=.03928?a/12.92:Math.pow((a+.055)/1.055,2.4))+.0722*(r=i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4))},e.prototype.getAlpha=function(){return this.a},e.prototype.setAlpha=function(e){return this.a=e8(e),this.roundA=Math.round(100*this.a)/100,this},e.prototype.isMonochrome=function(){return 0===this.toHsl().s},e.prototype.toHsv=function(){var e=te(this.r,this.g,this.b);return{h:360*e.h,s:e.s,v:e.v,a:this.a}},e.prototype.toHsvString=function(){var e=te(this.r,this.g,this.b),t=Math.round(360*e.h),r=Math.round(100*e.s),n=Math.round(100*e.v);return 1===this.a?"hsv(".concat(t,", ").concat(r,"%, ").concat(n,"%)"):"hsva(".concat(t,", ").concat(r,"%, ").concat(n,"%, ").concat(this.roundA,")")},e.prototype.toHsl=function(){var e=e9(this.r,this.g,this.b);return{h:360*e.h,s:e.s,l:e.l,a:this.a}},e.prototype.toHslString=function(){var e=e9(this.r,this.g,this.b),t=Math.round(360*e.h),r=Math.round(100*e.s),n=Math.round(100*e.l);return 1===this.a?"hsl(".concat(t,", ").concat(r,"%, ").concat(n,"%)"):"hsla(".concat(t,", ").concat(r,"%, ").concat(n,"%, ").concat(this.roundA,")")},e.prototype.toHex=function(e){return void 0===e&&(e=!1),tt(this.r,this.g,this.b,e)},e.prototype.toHexString=function(e){return void 0===e&&(e=!1),"#"+this.toHex(e)},e.prototype.toHex8=function(e){var t,r,n,o,a,i;return void 0===e&&(e=!1),t=this.r,r=this.g,n=this.b,o=this.a,a=e,i=[e4(Math.round(t).toString(16)),e4(Math.round(r).toString(16)),e4(Math.round(n).toString(16)),e4(function(e){return Math.round(255*parseFloat(e)).toString(16)}(o))],a&&i[0].startsWith(i[0].charAt(1))&&i[1].startsWith(i[1].charAt(1))&&i[2].startsWith(i[2].charAt(1))&&i[3].startsWith(i[3].charAt(1))?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0)+i[3].charAt(0):i.join("")},e.prototype.toHex8String=function(e){return void 0===e&&(e=!1),"#"+this.toHex8(e)},e.prototype.toHexShortString=function(e){return void 0===e&&(e=!1),1===this.a?this.toHexString(e):this.toHex8String(e)},e.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},e.prototype.toRgbString=function(){var e=Math.round(this.r),t=Math.round(this.g),r=Math.round(this.b);return 1===this.a?"rgb(".concat(e,", ").concat(t,", ").concat(r,")"):"rgba(".concat(e,", ").concat(t,", ").concat(r,", ").concat(this.roundA,")")},e.prototype.toPercentageRgb=function(){var e=function(e){return"".concat(Math.round(100*e5(e,255)),"%")};return{r:e(this.r),g:e(this.g),b:e(this.b),a:this.a}},e.prototype.toPercentageRgbString=function(){var e=function(e){return Math.round(100*e5(e,255))};return 1===this.a?"rgb(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%)"):"rgba(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%, ").concat(this.roundA,")")},e.prototype.toName=function(){if(0===this.a)return"transparent";if(this.a<1)return!1;for(var e="#"+tt(this.r,this.g,this.b,!1),t=0,r=Object.entries(to);t<r.length;t++){var n=r[t],o=n[0];if(e===n[1])return o}return!1},e.prototype.toString=function(e){var t=!!e;e=null!=e?e:this.format;var r=!1,n=this.a<1&&this.a>=0;if(!t&&n&&(e.startsWith("hex")||"name"===e))return"name"===e&&0===this.a?this.toName():this.toRgbString();return"rgb"===e&&(r=this.toRgbString()),"prgb"===e&&(r=this.toPercentageRgbString()),("hex"===e||"hex6"===e)&&(r=this.toHexString()),"hex3"===e&&(r=this.toHexString(!0)),"hex4"===e&&(r=this.toHex8String(!0)),"hex8"===e&&(r=this.toHex8String()),"name"===e&&(r=this.toName()),"hsl"===e&&(r=this.toHslString()),"hsv"===e&&(r=this.toHsvString()),r||this.toHexString()},e.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},e.prototype.clone=function(){return new e(this.toString())},e.prototype.lighten=function(t){void 0===t&&(t=10);var r=this.toHsl();return r.l+=t/100,r.l=e6(r.l),new e(r)},e.prototype.brighten=function(t){void 0===t&&(t=10);var r=this.toRgb();return r.r=Math.max(0,Math.min(255,r.r-Math.round(-(t/100*255)))),r.g=Math.max(0,Math.min(255,r.g-Math.round(-(t/100*255)))),r.b=Math.max(0,Math.min(255,r.b-Math.round(-(t/100*255)))),new e(r)},e.prototype.darken=function(t){void 0===t&&(t=10);var r=this.toHsl();return r.l-=t/100,r.l=e6(r.l),new e(r)},e.prototype.tint=function(e){return void 0===e&&(e=10),this.mix("white",e)},e.prototype.shade=function(e){return void 0===e&&(e=10),this.mix("black",e)},e.prototype.desaturate=function(t){void 0===t&&(t=10);var r=this.toHsl();return r.s-=t/100,r.s=e6(r.s),new e(r)},e.prototype.saturate=function(t){void 0===t&&(t=10);var r=this.toHsl();return r.s+=t/100,r.s=e6(r.s),new e(r)},e.prototype.greyscale=function(){return this.desaturate(100)},e.prototype.spin=function(t){var r=this.toHsl(),n=(r.h+t)%360;return r.h=n<0?360+n:n,new e(r)},e.prototype.mix=function(t,r){void 0===r&&(r=50);var n=this.toRgb(),o=new e(t).toRgb(),a=r/100;return new e({r:(o.r-n.r)*a+n.r,g:(o.g-n.g)*a+n.g,b:(o.b-n.b)*a+n.b,a:(o.a-n.a)*a+n.a})},e.prototype.analogous=function(t,r){void 0===t&&(t=6),void 0===r&&(r=30);var n=this.toHsl(),o=360/r,a=[this];for(n.h=(n.h-(o*t>>1)+720)%360;--t;)n.h=(n.h+o)%360,a.push(new e(n));return a},e.prototype.complement=function(){var t=this.toHsl();return t.h=(t.h+180)%360,new e(t)},e.prototype.monochromatic=function(t){void 0===t&&(t=6);for(var r=this.toHsv(),n=r.h,o=r.s,a=r.v,i=[],l=1/t;t--;)i.push(new e({h:n,s:o,v:a})),a=(a+l)%1;return i},e.prototype.splitcomplement=function(){var t=this.toHsl(),r=t.h;return[this,new e({h:(r+72)%360,s:t.s,l:t.l}),new e({h:(r+216)%360,s:t.s,l:t.l})]},e.prototype.onBackground=function(t){var r=this.toRgb(),n=new e(t).toRgb(),o=r.a+n.a*(1-r.a);return new e({r:(r.r*r.a+n.r*n.a*(1-r.a))/o,g:(r.g*r.a+n.g*n.a*(1-r.a))/o,b:(r.b*r.a+n.b*n.a*(1-r.a))/o,a:o})},e.prototype.triad=function(){return this.polyad(3)},e.prototype.tetrad=function(){return this.polyad(4)},e.prototype.polyad=function(t){for(var r=this.toHsl(),n=r.h,o=[this],a=360/t,i=1;i<t;i++)o.push(new e({h:(n+i*a)%360,s:r.s,l:r.l}));return o},e.prototype.equals=function(t){return this.toRgbString()===new e(t).toRgbString()},e}();function td(e,t){return!t&&(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function tf(){var e=td(["\n color: ",";\n fill: ",";\n stroke-width: 1.4;\n background: ",";\n border-bottom: 1px solid ",";\n "]);return tf=function(){return e},e}function tp(){var e=td(["\n .calendarbottomtext: {\n textanchor: middle;\n fill: ",";\n webkittouchcallout: none;\n webkituserselect: none;\n mozuserselect: none;\n msuserselect: none;\n userselect: none;\n pointerevents: none;\n font-weight: 500;\n }\n .calendartoptick: {\n stroke: ",";\n stroke-width: 0;\n }\n .calendartoptext: {\n textanchor: middle;\n webkittouchcallout: none;\n webkituserselect: none;\n mozuserselect: none;\n msuserselect: none;\n userselect: none;\n pointerevents: none;\n font-weight: 500;\n fill: ",";\n }\n "]);return tp=function(){return e},e}var th=(0,eH.createStyles)(function(e){var t=e.token,r=e.css,n=new tu(t.colorFillAlter).onBackground(t.colorBgContainer).toHexShortString();return{calendarheader:r(tf(),t.colorText,n,n,t.colorBorderSecondary),nbGanttCalendar:r(tp(),t.colorText,t.colorBorderSecondary,t.colorText)}}),tm=function(e){var t=e.value,r=e.x1Line,n=e.y1Line,o=e.y2Line,a=e.xText,i=e.yText;return S().createElement("g",{className:"calendarTop"},S().createElement("line",{x1:r,y1:n,x2:r,y2:o,className:(0,J.cx)("calendarTopTick"),key:t+"line"}),S().createElement("text",{key:t+"text",y:i,x:a,className:(0,J.cx)("calendarTopText")},t))};function tv(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function tg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(r=o.next()).done)&&(a.push(r.value),!t||a.length!==t);i=!0);}catch(e){l=!0,n=e}finally{try{!i&&null!=o.return&&o.return()}finally{if(l)throw n}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return tv(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return tv(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var tb=function(e){var t,r,n,o,a,i,l,c=e.dateSetup,s=e.locale,u=e.viewMode,d=e.rtl,f=e.headerHeight,p=e.columnWidth,h=e.fontFamily,m=e.fontSize,v=th().styles,g=[],b=[];switch(c.viewMode){case ek.Year:g=(t=tg(function(){for(var e=[],t=[],r=.5*f,n=0;n<c.dates.length;n++){var o=c.dates[n],a=o.getFullYear();if(t.push(S().createElement("text",{key:o.getTime(),y:.8*f,x:p*n+.5*p,className:(0,J.cx)("calendarBottomText")},a)),0===n||o.getFullYear()!==c.dates[n-1].getFullYear()){var i=o.getFullYear().toString(),l=void 0;l=d?(6+n+o.getFullYear()+1)*p:(6+n-o.getFullYear())*p,e.push(S().createElement(tm,{key:i,value:i,x1Line:p*n,y1Line:0,y2Line:f,xText:l,yText:.9*r}))}}return[e,t]}(),2))[0],b=t[1];break;case ek.QuarterYear:g=(r=tg(function(){for(var e=[],t=[],r=.5*f,n=0;n<c.dates.length;n++){var o=c.dates[n],a="Q"+Math.floor((o.getMonth()+3)/3);if(t.push(S().createElement("text",{key:o.getTime(),y:.8*f,x:p*n+.5*p,className:(0,J.cx)("calendarBottomText")},a)),0===n||o.getFullYear()!==c.dates[n-1].getFullYear()){var i=o.getFullYear().toString(),l=void 0;l=d?(6+n+o.getMonth()+1)*p:(6+n-o.getMonth())*p,e.push(S().createElement(tm,{key:i,value:i,x1Line:p*n,y1Line:0,y2Line:r,xText:Math.abs(l),yText:.9*r}))}}return[e,t]}(),2))[0],b=r[1];break;case ek.Month:g=(n=tg(function(){for(var e=[],t=[],r=.5*f,n=0;n<c.dates.length;n++){var o=c.dates[n],a=eD(o,s);if(t.push(S().createElement("text",{key:a+o.getFullYear(),y:.8*f,x:p*n+.5*p,className:(0,J.cx)("calendarBottomText")},a)),0===n||o.getFullYear()!==c.dates[n-1].getFullYear()){var i=o.getFullYear().toString(),l=void 0;l=d?(6+n+o.getMonth()+1)*p:(6+n-o.getMonth())*p,e.push(S().createElement(tm,{key:i,value:i,x1Line:p*n,y1Line:0,y2Line:r,xText:l,yText:.9*r}))}}return[e,t]}(),2))[0],b=n[1];break;case ek.Week:g=(o=tg(function(){for(var e=[],t=[],r=1,n=.5*f,o=c.dates,a=o.length-1;a>=0;a--){var i=o[a],l="";(0===a||i.getMonth()!==o[a-1].getMonth())&&(l="".concat(eD(i,s),", ").concat(i.getFullYear()));var u="W".concat(eA(i));t.push(S().createElement("text",{key:i.getTime(),y:.8*f,x:p*(a+ +d),className:(0,J.cx)("calendarBottomText")},u)),l&&(a!==o.length-1&&e.push(S().createElement(tm,{key:l,value:l,x1Line:p*a+r*p,y1Line:0,y2Line:n,xText:p*a+p*r*.5,yText:.9*n})),r=0),r++}return[e,t]}(),2))[0],b=o[1];break;case ek.Day:g=(a=tg(function(){for(var e=[],t=[],r=.5*f,n=c.dates,o=0;o<n.length;o++){var a=n[o],i="".concat(a.getDate().toString());if(t.push(S().createElement("text",{key:a.getTime(),y:.8*f,x:p*o+.5*p,className:(0,J.cx)("calendarBottomText")},i)),o+1!==n.length&&a.getMonth()!==n[o+1].getMonth()){var l,u=eD(a,s);e.push(S().createElement(tm,{key:u+a.getFullYear(),value:u,x1Line:p*(o+1),y1Line:0,y2Line:r,xText:p*(o+1)-(l=a.getMonth(),new Date(a.getFullYear(),l+1,0).getDate()*p*.5),yText:.9*r}))}}return[e,t]}(),2))[0],b=a[1];break;case ek.QuarterDay:case ek.HalfDay:g=(i=tg(function(){for(var e=[],t=[],r=u===ek.HalfDay?2:4,n=.5*f,o=c.dates,a=0;a<o.length;a++){var i=o[a],l=eO(s,{hour:"numeric"}).format(i).replace("时","");if(t.push(S().createElement("text",{key:i.getTime(),y:.8*f,x:p*(a+ +d),className:(0,J.cx)("calendarBottomText"),fontFamily:h},l)),0===a||i.getDate()!==o[a-1].getDate()){var m="".concat(eM(i,s,"short"),", ").concat(i.getDate()," ").concat(eD(i,s));e.push(S().createElement(tm,{key:m+i.getFullYear(),value:m,x1Line:p*a+r*p,y1Line:0,y2Line:n,xText:p*a+r*p*.5,yText:.9*n}))}}return[e,t]}(),2))[0],b=i[1];break;case ek.Hour:g=(l=tg(function(){for(var e=[],t=[],r=.5*f,n=c.dates,o=0;o<n.length;o++){var a,i=n[o],l=null===(a=eO(s,{hour:"numeric"}).format(i))||void 0===a?void 0:a.replace("时","");if(t.push(S().createElement("text",{key:i.getTime(),y:.8*f,x:p*(o+ +d),className:(0,J.cx)("calendarBottomText"),fontFamily:h},l)),0!==o&&i.getDate()!==n[o-1].getDate()){var u=n[o-1],m="".concat(eM(u,s,"long"),", ").concat(u.getDate()," ").concat(eD(u,s)),v=(i.getHours()-24)/2;e.push(S().createElement(tm,{key:m+u.getFullYear(),value:m,x1Line:p*o,y1Line:0,y2Line:r,xText:p*(o+v),yText:.9*r}))}}return[e,t]}(),2))[0],b=l[1]}return S().createElement("g",{className:v.nbGanttCalendar,fontSize:m,fontFamily:h},S().createElement("rect",{x:0,y:0,width:p*c.dates.length,height:f,className:v.calendarheader}),b," ",g)},ty=g("584");function tx(e,t){return!t&&(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function tS(){var e=tx(["\n fill: ",";\n "]);return tS=function(){return e},e}function tw(){var e=tx(["\n fill: #e6f7ff;\n border-color: ",";\n "]);return tw=function(){return e},e}function tk(){var e=tx(["\n .gridrowline: {\n stroke: ",";\n stroke-width: 0;\n border-bottom: 1px solid ",";\n }\n .gridtick: {\n stroke: ",";\n }\n "]);return tk=function(){return e},e}var tC=(0,eH.createStyles)(function(e){var t=e.token,r=e.css;return{gridRow:r(tS(),t.colorBgContainer),gridHeightRow:r(tw(),t.colorBorder),nbGridbody:r(tk(),t.colorBorderSecondary,t.colorBorderSecondary,t.colorBorderSecondary)}}),tO=[{id:(0,ty.uid)()},{id:(0,ty.uid)()},{id:(0,ty.uid)()}],tP=function(e){var t=e.tasks,r=e.dates,n=e.rowHeight,o=e.svgWidth,a=e.columnWidth,i=e.todayColor,l=e.rtl,c=e.selectedRowKeys,s=tC().styles,u=t.length?t:tO,d=0,f=[],p=[S().createElement("line",{key:"RowLineFirst",x:"0",y1:0,x2:o,y2:0,className:(0,J.cx)("gridRowLine")})],h=!0,m=!1,v=void 0;try{for(var g,b=u[Symbol.iterator]();!(h=(g=b.next()).done);h=!0){var y=g.value;f.push(S().createElement("rect",{key:"Row"+y.id,x:"0",y:d,width:o,height:n,className:(null==c?void 0:c.includes(+y.id))?s.gridHeightRow:s.gridRow})),p.push(S().createElement("line",{key:"RowLine"+y.id,x:"0",y1:d+n,x2:o,y2:d+n,className:(0,J.cx)("gridRowLine")})),d+=n}}catch(e){m=!0,v=e}finally{try{!h&&null!=b.return&&b.return()}finally{if(m)throw v}}for(var x=new Date,w=0,k=[],C=S().createElement("rect",null),O=0;O<r.length;O++){var P=r[O];k.push(S().createElement("line",{key:P.getTime(),x1:w,y1:0,x2:w,y2:d,className:(0,J.cx)("gridTick")})),(O+1!==r.length&&P.getTime()<x.getTime()&&r[O+1].getTime()>=x.getTime()||0!==O&&O+1===r.length&&P.getTime()<x.getTime()&&eP(P,P.getTime()-r[O-1].getTime(),"millisecond").getTime()>=x.getTime())&&(C=S().createElement("rect",{x:w,y:0,width:a,height:d,fill:i})),l&&O+1!==r.length&&P.getTime()>=x.getTime()&&r[O+1].getTime()<x.getTime()&&(C=S().createElement("rect",{x:w+a,y:0,width:a,height:d,fill:i})),w+=a}return S().createElement("g",{className:(0,J.cx)("gridBody",s.nbGridbody)},S().createElement("g",{className:"rows"},f),S().createElement("g",{className:"rowLines"},p),S().createElement("g",{className:"ticks"},k),S().createElement("g",{className:"today"},C))},tE=function(e){return S().createElement("g",{className:"grid"},S().createElement(tP,e))};function tT(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function tj(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(r=o.next()).done)&&(a.push(r.value),!t||a.length!==t);i=!0);}catch(e){l=!0,n=e}finally{try{!i&&null!=o.return&&o.return()}finally{if(l)throw n}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return tT(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return tT(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var tD=function(e){var t,r,n,o,a=e.taskFrom,i=e.taskTo,l=e.rowHeight,c=e.taskHeight,s=e.arrowIndent;return e.rtl?(t=(n=tj(tN(a,i,l,c,s),2))[0],r=n[1]):(t=(o=tj(tM(a,i,l,c,s),2))[0],r=o[1]),S().createElement("g",{className:"arrow"},S().createElement("path",{strokeWidth:"1.5",d:t,fill:"none"}),S().createElement("polygon",{points:r}))},tM=function(e,t,r,n,o){var a=e.index>t.index?-1:1,i=t.y+n/2,l=e.x2+2*o,c=l<t.x1?"":"H ".concat(t.x1-o),s=l>t.x1?o:t.x1-e.x2-o;return["M ".concat(e.x2," ").concat(e.y+n/2," \n h ").concat(o," \n v ").concat(a*r/2," \n ").concat(c,"\n V ").concat(i," \n h ").concat(s),"".concat(t.x1,",").concat(i," \n ").concat(t.x1-5,",").concat(i-5," \n ").concat(t.x1-5,",").concat(i+5)]},tN=function(e,t,r,n,o){var a=e.index>t.index?-1:1,i=t.y+n/2,l=e.x1-2*o,c=l>t.x2?"":"H ".concat(t.x2+o),s=l<t.x2?-o:t.x2-e.x1+o;return["M ".concat(e.x1," ").concat(e.y+n/2," \n h ").concat(-o," \n v ").concat(a*r/2," \n ").concat(c,"\n V ").concat(i," \n h ").concat(s),"".concat(t.x2,",").concat(i," \n ").concat(t.x2+5,",").concat(i+5," \n ").concat(t.x2+5,",").concat(i-5)]},tA=function(e){var t=e.x,r=e.y,n=e.width,o=e.height,a=e.barCornerRadius,i=e.onMouseDown;return S().createElement("rect",{x:t,y:r,width:n,height:o,className:"barHandle",role:"button",ry:a,rx:a,onMouseDown:i})};function tF(e,t){return!t&&(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function tI(){var e=tF(["\n cursor: pointer;\n outline: none;\n .barHandle {\n fill: #ddd;\n cursor: ew-resize;\n opacity: 0;\n // visibility: hidden;\n }\n &:hover .barHandle {\n visibility: visible;\n opacity: 1;\n }\n"]);return tI=function(){return e},e}function tB(){var e=tF(["\n user-select: none;\n stroke-width: 0;\n opacity: 0.6;\n"]);return tB=function(){return e},e}var tH=(0,J.css)(tI()),tR=(0,J.css)(tB()),tz=function(e){var t=e.x,r=e.y,n=e.color,o=e.width,a=e.height,i=e.isSelected,l=e.progressX,c=e.progressWidth,s=e.barCornerRadius,u=e.styles,d=e.onMouseDown;return S().createElement("g",{onMouseDown:d},S().createElement("rect",{x:t,width:o,y:r,height:a,ry:s,rx:s,fill:n?n:i?u.backgroundSelectedColor:u.backgroundColor,className:(0,J.cx)(tR)}),S().createElement("rect",{x:l,width:c,y:r,height:a,ry:s,rx:s,fill:n?n:i?u.progressSelectedColor:u.progressColor}))},tW=function(e){var t=e.progressPoint,r=e.onMouseDown;return S().createElement("polygon",{className:"barHandle",points:t,onMouseDown:r})},tL=function(e){var t=e.task,r=e.isProgressChangeable,n=e.isDateChangeable,o=e.rtl,a=e.onEventStart,i=e.isSelected,l=em(+!o*t.progressWidth+t.progressX,t.y,t.height),c=t.height-2;return S().createElement("g",{className:(0,J.cx)(tH),"aria-label":"task-bar",tabIndex:0},S().createElement(tz,{x:t.x1,y:t.y,color:t.color,width:t.x2-t.x1,height:t.height,progressX:t.progressX,progressWidth:t.progressWidth,barCornerRadius:t.barCornerRadius,styles:t.styles,isSelected:i,onMouseDown:function(e){n&&a("move",t,e)}}),S().createElement("g",{className:"handleGroup"},n&&S().createElement("g",null,S().createElement(tA,{x:t.x1+1,y:t.y+1,width:t.handleWidth,height:c,barCornerRadius:t.barCornerRadius,onMouseDown:function(e){a("start",t,e)}}),S().createElement(tA,{x:t.x2-t.handleWidth-1,y:t.y+1,width:t.handleWidth,height:c,barCornerRadius:t.barCornerRadius,onMouseDown:function(e){a("end",t,e)}})),r&&S().createElement(tW,{progressPoint:l,onMouseDown:function(e){a("progress",t,e)}})))},tq=function(e){var t=e.task,r=e.isProgressChangeable,n=e.isDateChangeable,o=e.onEventStart,a=e.isSelected,i=em(t.progressWidth+t.x1+10,t.y,t.height);return S().createElement("g",{className:(0,J.cx)(tH),tabIndex:0},S().createElement(tz,{x:t.x1,y:t.y,width:t.x2-t.x1,height:t.height,progressX:t.progressX,progressWidth:t.progressWidth,barCornerRadius:t.barCornerRadius,styles:t.styles,isSelected:a,onMouseDown:function(e){n&&o("move",t,e)}}),S().createElement("g",{className:"handleGroup"},r&&S().createElement(tW,{progressPoint:i,onMouseDown:function(e){o("progress",t,e)}})))};function tG(e,t){return!t&&(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function tY(){var e=tG(["\n cursor: pointer;\n outline: none;\n"]);return tY=function(){return e},e}function tX(){var e=tG(["\n user-select: none;\n"]);return tX=function(){return e},e}var tU=(0,J.css)(tY()),t_=(0,J.css)(tX()),tV=function(e){var t=e.task,r=e.isDateChangeable,n=e.onEventStart,o=e.isSelected,a="rotate(45 ".concat(t.x1+.356*t.height," \n ").concat(t.y+.85*t.height,")");return S().createElement("g",{tabIndex:0,className:(0,J.cx)(tU)},S().createElement("rect",{fill:o?t.styles.backgroundSelectedColor:t.styles.backgroundColor,x:t.x1,width:t.height,y:t.y,height:t.height,rx:t.barCornerRadius,ry:t.barCornerRadius,transform:a,className:(0,J.cx)(t_),onMouseDown:function(e){r&&n("move",t,e)}}))};function tQ(e,t){return!t&&(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function t$(){var e=tQ(["\n cursor: pointer;\n outline: none;\n"]);return t$=function(){return e},e}function tK(){var e=tQ(["\n user-select: none;\n opacity: 0.6;\n"]);return tK=function(){return e},e}function tJ(){var e=tQ(["\n user-select: none;\n"]);return tJ=function(){return e},e}var tZ=(0,J.css)(t$()),t0=(0,J.css)(tK());(0,J.css)(tJ());var t1=function(e){var t=e.task,r=e.isSelected,n=r?t.styles.backgroundSelectedColor:t.styles.backgroundColor,o=r?t.styles.progressSelectedColor:t.styles.progressColor,a=t.x2-t.x1;return S().createElement("g",{tabIndex:0,className:(0,J.cx)(tZ)},S().createElement("rect",{fill:t.color||n,x:t.x1,width:a,y:t.y,height:t.height,rx:t.barCornerRadius,ry:t.barCornerRadius,className:(0,J.cx)(t0)}),S().createElement("rect",{x:t.progressX,width:t.progressWidth,y:t.y,height:t.height,ry:t.barCornerRadius,rx:t.barCornerRadius,fill:t.color||o}))};function t2(){var e,t,r=(e=["\n .barLabel: {\n fill: ",",\n textAnchor: middle,\n font-weight: 400,\n dominantBaseline: central,\n WebkitTouchCallout: none,\n WebkitUserSelect: none,\n MozUserSelect: none,\n msUserSelect: none,\n userSelect: none,\n pointerEvents: none,\n },\n .projectLabel: {\n fill: #130d0d,\n fontWeight: 500,\n fontSize: 0.9em,\n dominantBaseline: central,\n WebkitTouchCallout: none,\n WebkitUserSelect: none,\n MozUserSelect: none,\n msUserSelect: none,\n userSelect: none,\n pointerEvents: none,\n },\n .barLabelOutside: {\n fill: ",",\n textAnchor: start,\n WebkitTouchCallout: none,\n WebkitUserSelect: none,\n MozUserSelect: none,\n msUserSelect: none,\n userSelect: none,\n pointerEvents: none,\n },\n }\n }"],!t&&(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return t2=function(){return r},r}var t5=(0,eH.createStyles)(function(e){var t=e.token;return{nbganttTaskitem:(0,e.css)(t2(),t.colorTextLightSolid,t.colorTextLabel)}});function t6(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function t8(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(r=o.next()).done)&&(a.push(r.value),!t||a.length!==t);i=!0);}catch(e){l=!0,n=e}finally{try{!i&&null!=o.return&&o.return()}finally{if(l)throw n}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return t6(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return t6(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var t3=function(e){var t,r,n=t5().styles,o=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n,o,a;n=e,o=t,a=r[t],o in n?Object.defineProperty(n,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[o]=a})}return e}({},e),a=o.task,i=o.arrowIndent,l=o.isDelete,c=o.taskHeight,s=o.isSelected,u=o.rtl,d=o.onEventStart,f=(0,x.useRef)(null),p=t8((0,x.useState)(S().createElement("div",null)),2),h=p[0],m=p[1],v=t8((0,x.useState)(!0),2),g=v[0],b=v[1],y="project"===a.typeInternal;(0,x.useEffect)(function(){switch(a.typeInternal){case"milestone":m(S().createElement(tV,e));break;case"project":m(S().createElement(t1,e));break;case"smalltask":m(S().createElement(tq,e));break;default:m(S().createElement(tL,e))}},[a,s]),(0,x.useEffect)(function(){f.current&&b(f.current.getBBox().width<a.x2-a.x1)},[f,a]);return S().createElement("g",{className:(0,J.cx)(n.nbganttTaskitem),onKeyDown:function(e){if("Delete"===e.key)l&&d("delete",a,e);e.stopPropagation()},onMouseEnter:function(e){d("mouseenter",a,e)},onMouseLeave:function(e){d("mouseleave",a,e)},onDoubleClick:function(e){d("dblclick",a,e)},onClick:function(e){d("click",a,e)},onFocus:function(){d("select",a)}},h,S().createElement("text",{x:y?a.x1:(t=a.x2-a.x1,r=a.barChildren.length>0,g?a.x1+.5*t:u&&f.current?a.x1-f.current.getBBox().width-i*+r-.2*i:a.x1+t+i*+r+.2*i),y:y?a.y-8:a.y+.65*c,className:y?(0,J.cx)("projectLabel"):g?(0,J.cx)("barLabel"):(0,J.cx)("barLabelOutside"),ref:f},y&&eB(a.start)&&eB(a.end)?"".concat(a.name,": ").concat(eB(a.start)," ~ ").concat(eB(a.end)):a.name))};function t4(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function t9(e,t,r,n,o,a,i){try{var l=e[a](i),c=l.value}catch(e){r(e);return}l.done?t(c):Promise.resolve(c).then(n,o)}function t7(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var a=e.apply(t,r);function i(e){t9(a,n,o,i,l,"next",e)}function l(e){t9(a,n,o,i,l,"throw",e)}i(void 0)})}}function re(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(r=o.next()).done)&&(a.push(r.value),!t||a.length!==t);i=!0);}catch(e){l=!0,n=e}finally{try{!i&&null!=o.return&&o.return()}finally{if(l)throw n}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return t4(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return t4(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function rt(e,t){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(a){return function(l){return function(a){if(r)throw TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}var rr=null,rn=null,ro=function(e){var t,r,n=e.tasks,o=e.dates,a=e.ganttEvent,i=e.selectedTask,l=e.rowHeight,c=e.columnWidth,s=e.timeStep,u=e.svg,d=e.taskHeight,f=e.arrowColor,p=e.arrowIndent,h=e.fontFamily,m=e.fontSize,v=e.rtl,g=e.setGanttEvent,b=e.setFailedTask,y=e.setSelectedTask,w=e.onDateChange,k=e.onProgressChange,C=e.onDoubleClick,O=e.onClick,P=e.onDelete,E=null==u?void 0:null===(r=u.current)||void 0===r?void 0:r.createSVGPoint(),T=re((0,x.useState)(0),2),j=T[0],D=T[1],M=re((0,x.useState)(0),2),N=M[0],A=M[1],F=re((0,x.useState)(!1),2),I=F[0],B=F[1];(0,x.useEffect)(function(){var e,t,r,n;D(s*c/((null===(e=o[1])||void 0===e?void 0:e.getTime())-(null===(t=o[0])||void 0===t?void 0:t.getTime())-(null===(r=o[1])||void 0===r?void 0:r.getTimezoneOffset())*6e4+(null===(n=o[0])||void 0===n?void 0:n.getTimezoneOffset())*6e4))},[c,o,s]),(0,x.useEffect)(function(){var e,t,r=(e=t7(function(e){var t,r,n,o;return rt(this,function(i){return a.changedTask&&E&&(null==u?void 0:u.current)?(e.preventDefault(),E.x=e.clientX,n=(r=ex(E.matrixTransform(null==u?void 0:null===(t=u.current.getScreenCTM())||void 0===t?void 0:t.inverse()).x,a.action,a.changedTask,j,s,N,v)).isChanged,o=r.changedTask,n&&g({action:a.action,changedTask:o}),[2]):[2]})}),function(t){return e.apply(this,arguments)});var n=(t=t7(function(e){var t,o,i,l,c,d,f,p,h,m,y;return rt(this,function(h){switch(h.label){case 0:if(o=a.action,i=a.originalSelectedTask,!(l=a.changedTask)||!E||!(null==u?void 0:u.current)||!i)return[2];if(e.preventDefault(),E.x=e.clientX,c=ex(E.matrixTransform(null==u?void 0:null===(t=u.current.getScreenCTM())||void 0===t?void 0:t.inverse()).x,o,l,j,s,N,v).changedTask,d=i.start!==c.start||i.end!==c.end||i.progress!==c.progress,u.current.removeEventListener("mousemove",r),u.current.removeEventListener("mouseup",n),g({action:""}),B(!1),f=!0,!(("move"===o||"end"===o||"start"===o)&&w&&d))return[3,5];h.label=1;case 1:return h.trys.push([1,3,,4]),[4,w(c,c.barChildren)];case 2:return void 0!==(p=h.sent())&&(f=p),[3,4];case 3:return h.sent(),f=!1,[3,4];case 4:return[3,9];case 5:if(!(k&&d))return[3,9];h.label=6;case 6:return h.trys.push([6,8,,9]),[4,k(c,c.barChildren)];case 7:return void 0!==(m=h.sent())&&(f=m),[3,9];case 8:return h.sent(),f=!1,[3,9];case 9:return!f&&b(i),[2]}})}),function(e){return t.apply(this,arguments)});!I&&("move"===a.action||"end"===a.action||"start"===a.action||"progress"===a.action)&&(null==u?void 0:u.current)&&(u.current.addEventListener("mousemove",r),u.current.addEventListener("mouseup",n),B(!0))},[a,j,N,k,s,w,u,I,E,v,b,g]);var H=(t=t7(function(e,t,r){var n,o;return rt(this,function(i){switch(i.label){case 0:if(r)return[3,1];return"select"===e&&y(t.id),[3,7];case 1:if(!(void 0!==r.key))return[3,6];if("delete"!==e||!P)return[3,5];i.label=2;case 2:return i.trys.push([2,4,,5]),[4,P(t)];case 3:return void 0!==(n=i.sent())&&n&&g({action:e,changedTask:t}),[3,5];case 4:return console.error("Error on Delete. "+i.sent()),[3,5];case 5:return[3,7];case 6:if("mouseenter"===e)!a.action&&g({action:e,changedTask:t,originalSelectedTask:t});else if("mouseleave"===e)"mouseenter"===a.action&&setTimeout(function(){g({action:""})},300);else if("dblclick"===e)C&&C(t);else if("click"===e)"rect"===r.target.tagName&&O&&O(t);else if("move"===e){if(!(null==u?void 0:u.current)||!E)return[2];E.x=r.clientX,A(E.matrixTransform(null===(o=u.current.getScreenCTM())||void 0===o?void 0:o.inverse()).x-t.x1),g({action:e,changedTask:t,originalSelectedTask:t})}else g({action:e,changedTask:t,originalSelectedTask:t});i.label=7;case 7:return[2]}})}),function(e,r,n){return t.apply(this,arguments)}),R=function(e,t,r){["click"].includes(e)?(!["start","end","progress"].includes(rr)&&(!rn||rn===t.start)&&H(e,t,r),rr=null,rn=null):(["move","select"].includes(e)?rn=t.start:(rn=t.start,rr=e),H(e,t,r))};return S().createElement("g",{className:"content"},S().createElement("g",{className:"arrows",fill:f,stroke:f},n.map(function(e){return e.barChildren.map(function(t){return S().createElement(tD,{key:"Arrow from ".concat(e.id," to ").concat(n[t.index].id),taskFrom:e,taskTo:n[t.index],rowHeight:l,taskHeight:d,arrowIndent:p,rtl:v})})})),S().createElement("g",{className:"bar",fontFamily:h,fontSize:m},n.map(function(e){return S().createElement(t3,{task:e,arrowIndent:p,taskHeight:d,isProgressChangeable:!!k&&!e.isDisabled,isDateChangeable:!!w&&!e.isDisabled,isDelete:!e.isDisabled,onEventStart:R,key:e.id,isSelected:!!i&&e.id===i.id,rtl:v})})))},ra=(0,x.forwardRef)(function(e,t){var r,n,o=e.gridProps,a=e.calendarProps,i=e.barProps,l=e.ganttHeight,c=e.scrollY,s=e.scrollX,u=(0,x.useRef)(null),d=(0,x.useRef)(null);var f=(r=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n,o,a;n=e,o=t,a=r[t],o in n?Object.defineProperty(n,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[o]=a})}return e}({},i),n=(n={svg:u},n),Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(n)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(n,e))}),r),p=e2().styles;return(0,x.useEffect)(function(){d.current&&(d.current.scrollTop=c)},[c]),(0,x.useEffect)(function(){t.current&&(t.current.scrollLeft=s)},[s]),S().createElement("div",{className:p.ganttverticalcontainer,ref:t,dir:"ltr"},S().createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:o.svgWidth,height:a.headerHeight,fontFamily:i.fontFamily,className:"ganttHeader"},S().createElement(tb,a)),S().createElement(Z.Spin,{spinning:null==i?void 0:i.loading},S().createElement("div",{ref:d,className:p.horizontalcontainer,style:l?{maxHeight:l,width:o.svgWidth}:{width:o.svgWidth}},S().createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:o.svgWidth,height:i.rowHeight*i.tasks.length||166,fontFamily:i.fontFamily,ref:u,className:"ganttBody"},S().createElement(tE,o),S().createElement(ro,f)))))});function ri(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}ra.displayName="TaskGantt";function rl(e,t,r,n,o,a,i){try{var l=e[a](i),c=l.value}catch(e){r(e);return}l.done?t(c):Promise.resolve(c).then(n,o)}function rc(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var a=e.apply(t,r);function i(e){rl(a,n,o,i,l,"next",e)}function l(e){rl(a,n,o,i,l,"throw",e)}i(void 0)})}}function rs(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ru(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(r=o.next()).done)&&(a.push(r.value),!t||a.length!==t);i=!0);}catch(e){l=!0,n=e}finally{try{!i&&null!=o.return&&o.return()}finally{if(l)throw n}}return a}}(e,t)||rd(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function rd(e,t){if(e){if("string"==typeof e)return ri(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ri(e,t)}}function rf(e,t){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(a){return function(l){return function(a){if(r)throw TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}function rp(){var e,t,r=(e=["\n .ant-table-container::after {\n box-shadow: none !important;\n }\n .ant-table-row {\n height: ","px;\n }\n .ant-table-thead {\n height: ","px;\n }\n "],!t&&(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return rp=function(){return r},r}var rh=(0,ee.debounce)((p=rc(function(e,t,r,n,o){var a;return rf(this,function(i){switch(i.label){case 0:return[4,t.update({filterByTk:e.id,values:(rs(a={},r.start,e.start),rs(a,r.end,e.end),a)})];case 1:return i.sent(),Z.message.success(o("Saved successfully")),[4,null==n?void 0:n.refresh()];case 2:return i.sent(),[2]}})}),function(e,t,r,n,o){return p.apply(this,arguments)}),300);var rm=(0,ee.debounce)((h=rc(function(e,t,r,n,o){return rf(this,function(a){switch(a.label){case 0:return[4,t.update({filterByTk:e.id,values:rs({},r.progress,e.progress/100)})];case 1:return a.sent(),Z.message.success(o("Saved successfully")),[4,null==n?void 0:n.refresh()];case 2:return a.sent(),[2]}})}),function(e,t,r,n,o){return h.apply(this,arguments)}),300),rv=(0,y.withDynamicSchemaProps)(function(e){var t,r,n,o,a,i,l,c=e2().styles,s=(0,y.useToken)().token,u=null===(a=JSON.parse((0,y.useAPIClient)().auth.getOption("theme")))||void 0===a?void 0:a.uid,d=(0,y.useProps)(e),f=d.listCellWidth,p=void 0===f?"155px":f,h=d.ganttHeight,m=void 0===h?0:h,v=d.preStepsCount,g=void 0===v?1:v,b=d.barFill,k=void 0===b?60:b,C=d.barCornerRadius,O=void 0===C?s.borderRadiusXS:C,P=d.barProgressColor,E=void 0===P?s.colorPrimary:P,T=d.barProgressSelectedColor,D=void 0===T?s.colorPrimary:T,N=d.barBackgroundColor,A=void 0===N?s.colorPrimary:N,F=d.barBackgroundSelectedColor,I=void 0===F?s.colorPrimary:F,B=d.projectProgressColor,H=void 0===B?s.colorPrimary:B,R=d.projectProgressSelectedColor,z=void 0===R?s.colorPrimary:R,W=d.projectBackgroundColor,L=void 0===W?s.colorPrimary:W,q=d.projectBackgroundSelectedColor,G=void 0===q?s.colorPrimary:q,Y=d.milestoneBackgroundColor,X=void 0===Y?"#f1c453":Y,U=d.milestoneBackgroundSelectedColor,_=void 0===U?"#f29e4c":U,V=d.rtl,Q=void 0!==V&&V,$=d.handleWidth,K=void 0===$?8:$,ee=d.timeStep,et=d.arrowColor,er=d.fontFamily,en=void 0===er?"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'":er,eo=d.fontSize,ei=void 0===eo?s.fontSize:eo,el=d.arrowIndent,ec=void 0===el?20:el,es=d.todayColor,eu=d.viewDate,ed=d.TooltipContent,ef=void 0===ed?eQ:ed,ep=d.onDoubleClick,eh=d.onDelete,em=d.onSelect,ev=d.onExpanderClick,eg=d.tasks,eb=d.expandAndCollapseAll,ey=d.fieldNames,ex=d.loading,eS=(0,y.useDesignable)().designable,ew=(null==u?void 0:u.includes("compact"))?45:eS?65:55,ek=(null==u?void 0:u.includes("compact"))?45:65,eC=j(),eO=(0,y.useCurrentAppInfo)(),eP=(0,M.useTranslation)().t,eE=null===(i=eO.data)||void 0===i?void 0:i.lang,eD=(0,y.useTableBlockContext)(),eM=(0,y.useBlockRequestContext)(),eN=eM.resource,eA=eM.service,eB=(0,w.useFieldSchema)(),eH=ey.range||"day",eR=(0,x.useRef)(null),ez=(0,x.useRef)(null),eW=(0,x.useRef)(null),eL=(0,x.useRef)(null),eq=ru((0,x.useState)(function(){var e=ru(eT(eg,eH,g),2);return{viewMode:eH,dates:ej(e[0],e[1],eH)}}),2),eG=eq[0],eY=eq[1],eU=ru((0,x.useState)(!1),2),e_=eU[0],eJ=eU[1],eZ=(0,y.usePopupUtils)({setVisible:eJ}).openPopup,e0=ru((0,x.useState)({}),2),e1=e0[0],e5=e0[1],e6=(0,y.useCollectionParentRecordData)(),e8=ru((0,x.useState)(void 0),2),e3=e8[0],e4=e8[1],e9=ru((0,x.useState)(0),2),e7=e9[0],te=e9[1],tt=ru((0,x.useState)(0),2),tr=tt[0],tn=tt[1],to=ru((0,x.useState)(m),2),ta=to[0],ti=to[1],tl=ru((0,x.useState)([]),2),tc=tl[0],ts=tl[1],tu=ru((0,x.useState)({action:""}),2),td=tu[0],tf=tu[1],tp=(0,x.useMemo)(function(){return ek*k/100},[ek,k]),th=ru((0,x.useState)(),2),tm=th[0],tv=th[1],tg=ru((0,x.useState)(null),2),tb=tg[0],ty=tg[1],tx=ru((0,x.useState)(0),2),tS=tx[0],tw=tx[1],tk=ru((0,x.useState)(-1),2),tC=tk[0],tO=tk[1],tP=ru((0,x.useState)(!1),2),tE=tP[0],tT=tP[1];var tj=(t=eG.dates.length,(r=null===(l=eW.current)||void 0===l?void 0:l.clientWidth)/t>50?Math.floor(r/t)+20:50),tD=eG.dates.length*tj,tM=tc.length*ek,tN=eD.expandFlag,tA=ru((0,x.useState)([]),2),tF=tA[0],tI=tA[1];(0,x.useEffect)(function(){eD.field.onExpandClick=tB,eD.field.onRowSelect=tH},[]),(0,x.useEffect)(function(){null==eb||eb(!tN)},[tN]),(0,x.useEffect)(function(){var e,t=ru(eT(e=(e=ev?function(e){var t=e.filter(function(e){return e.hideChildren&&"project"===e.type});if(t.length>0)for(var r=0;t.length>r;r++)!function(r){var n=t[r],o=function e(t,r){var n=[];n="project"!==r.type?t.filter(function(e){return e.dependencies&&-1!==e.dependencies.indexOf(r.id)}):t.filter(function(e){return e.project&&e.project===r.id});var o=[];return n.forEach(function(r){var n;o.push.apply(o,function(e){if(Array.isArray(e))return eF(e)}(n=e(t,r))||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(n)||function(e,t){if(e){if("string"==typeof e)return eF(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return eF(e,t)}}(n)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())}),n=n.concat(n,o)}(e,n);e=e.filter(function(e){return -1===o.indexOf(e)})}(r);return e}(eg):eg).sort(eI),eH,g),2),r=ej(t[0],t[1],eH);Q&&(r=r.reverse(),-1===tC&&tO(r.length*tj)),eY({dates:r,viewMode:eH}),ts(ea(e,r,tj,ek,tp,O,K,Q,E,D,A,I,H,z,L,G,X,_))},[eg,eH,g,ek,O,tj,tp,K,E,D,A,I,H,z,L,G,X,_,Q,tC]),(0,x.useEffect)(function(){if(eH===eG.viewMode&&(eu&&!e3||eu&&(null==e3?void 0:e3.valueOf())!==eu.valueOf())){var e=eG.dates,t=e.findIndex(function(t,r){return eu.valueOf()>=t.valueOf()&&r+1!==e.length&&eu.valueOf()<e[r+1].valueOf()});if(-1!==t)e4(eu),tO(tj*t)}},[eu,tj,eG.dates,eG.viewMode,eH,e3,e4]),(0,x.useEffect)(function(){var e=td.changedTask,t=td.action;if(e){if("delete"===t)tf({action:""}),ts(tc.filter(function(t){return t.id!==e.id}));else if("move"===t||"end"===t||"start"===t||"progress"===t){var r=tc.find(function(t){return t.id===e.id});r&&r.start&&r.end&&(r.start.getTime()!==e.start.getTime()||r.end.getTime()!==e.end.getTime()||r.progress!==e.progress)&&ts(tc.map(function(t){return t.id===e.id?e:t}))}}},[td,tc]),(0,x.useEffect)(function(){tb&&(ts(tc.map(function(e){return e.id!==tb.id?e:tb})),ty(null))},[tb,tc]),(0,x.useEffect)(function(){!p&&te(0),ez.current&&te(ez.current.offsetWidth)},[ez,p]),(0,x.useEffect)(function(){eR.current&&tn(eR.current.offsetWidth-e7)},[eR,e7]),(0,x.useEffect)(function(){m?ti(m+ew):ti(eg.length*ek+ew)},[m,eg,ew,ek]),(0,x.useEffect)(function(){var e,t=function(e){if(e.shiftKey||e.deltaX){var t=tC+(e.deltaX?e.deltaX:e.deltaY);t<0?t=0:t>tD&&(t=tD),tO(t),e.preventDefault()}else if(m){var r=tS+e.deltaY;r<0?r=0:r>tM-m&&(r=tM-m),r!==tS&&(tw(r),e.preventDefault())}tT(!0)};return null===(e=eR.current)||void 0===e||e.addEventListener("wheel",t,{passive:!1}),function(){var e;null===(e=eR.current)||void 0===e||e.removeEventListener("wheel",t)}},[eR,tS,tC,m,tD,Q,tM]);var tB=function(e,t){var r,n,o,a=null==eC?void 0:null===(o=eC.field)||void 0===o?void 0:o.data.find(function(e){return e.id===t.id+""});if(ev&&t.children.length){;ev((r=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){rs(e,t,r[t])})}return e}({},a),n=(n={hideChildren:!e},n),Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(n)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(n,e))}),r))}},tH=function(e){tI(e)};var tR=(n=rc(function(e){return rf(this,function(t){return rm(e,eN,ey,eA,eP),[2]})}),function(e){return n.apply(this,arguments)});var tz=(o=rc(function(e){return rf(this,function(t){return rh(e,eN,ey,eA,eP),[2]})}),function(e){return o.apply(this,arguments)}),tW={columnWidth:tj,svgWidth:tD,tasks:eg,rowHeight:ek,dates:eG.dates,todayColor:void 0===es?"rgba(252, 248, 227, 0.5)":es,rtl:Q,selectedRowKeys:tF},tL={tasks:tc,dates:eG.dates,ganttEvent:td,selectedTask:tm,rowHeight:ek,taskHeight:tp,columnWidth:tj,arrowColor:void 0===et?"grey":et,timeStep:void 0===ee?3e5:ee,fontFamily:en,fontSize:ei,arrowIndent:ec,svgWidth:tD,rtl:Q,setGanttEvent:tf,setFailedTask:ty,setSelectedTask:function(e){var t=tc.find(function(t){return t.id===e}),r=tc.find(function(e){return!!tm&&e.id===tm.id});em&&(r&&em(r,!1),t&&em(t,!0)),tv(t)},onDateChange:tz,onProgressChange:ey.progress&&tR,onDoubleClick:ep,onClick:function(e){var t,r=function(e){return e.reduce(function(e,t){var n;if(!t.children)return e.concat(t);return e.concat([t].concat(function(e){if(Array.isArray(e))return ri(e)}(n=r(t.children))||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(n)||rd(n)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()))},[])},n=r(null==eA?void 0:null===(t=eA.data)||void 0===t?void 0:t.data),o=null==n?void 0:n.find(function(t){return t.id===+e.id});if(!!o)e5(o),eZ({recordData:o,customActionSchema:eB.properties.detail})},onDelete:eh,loading:ex};return S().createElement("div",{className:(0,J.cx)((0,J.css)(rp(),ek,ew)),ref:eL},S().createElement(y.PopupContextProvider,{visible:e_,setVisible:eJ},S().createElement(y.RecordProvider,{record:e1,parent:e6},S().createElement(eK,null)),S().createElement(y.NocoBaseRecursionField,{name:"anctionBar",schema:eB.properties.toolBar}),S().createElement(y.NocoBaseRecursionField,{name:"table",schema:eB.properties.table}),S().createElement("div",{className:c.wrapper,onKeyDown:function(e){e.preventDefault();var t=tS,r=tC,n=!0;switch(e.key){case"Down":case"ArrowDown":t+=ek,n=!1;break;case"Up":case"ArrowUp":t-=ek,n=!1;break;case"Left":case"ArrowLeft":r-=tj;break;case"Right":case"ArrowRight":r+=tj}n?(r<0?r=0:r>tD&&(r=tD),tO(r)):(t<0?t=0:t>tM-m&&(t=tM-m),tw(t)),tT(!0)},tabIndex:0,ref:eR},S().createElement(ra,{gridProps:tW,calendarProps:{dateSetup:eG,locale:eE,viewMode:eH,headerHeight:ew,columnWidth:tj,fontFamily:en,fontSize:ei,rtl:Q},barProps:tL,ganttHeight:m,scrollY:tS,scrollX:tC,ref:eW}),td.changedTask&&S().createElement(eV,{arrowIndent:ec,rowHeight:ek,svgContainerHeight:ta,svgContainerWidth:tr,fontFamily:en,fontSize:ei,scrollX:tC,scrollY:tS,task:td.changedTask,headerHeight:ew,taskListWidth:e7,TooltipContent:ef,rtl:Q,svgWidth:tD}),S().createElement(e$,{ganttFullHeight:tM,ganttHeight:m,headerHeight:ew,scroll:tS,onScroll:function(e){tS===e.currentTarget.scrollTop||tE?tT(!1):(tw(e.currentTarget.scrollTop),tT(!0))},rtl:Q}),S().createElement(Z.Spin,{spinning:ex,style:{visibility:"hidden"}},S().createElement(eX,{svgWidth:tD,taskListWidth:e7,scroll:tC,rtl:Q,onScroll:function(e){tC===e.currentTarget.scrollLeft||tE?tT(!1):(tO(e.currentTarget.scrollLeft),tT(!0))}})))))});function rg(e,t,r,n,o,a,i){try{var l=e[a](i),c=l.value}catch(e){r(e);return}l.done?t(c):Promise.resolve(c).then(n,o)}function rb(e,t,r){return(rb=rk()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(e,n));return r&&rS(o,r.prototype),o}).apply(null,arguments)}function ry(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function rx(e){return(rx=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function rS(e,t){return(rS=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function rw(e){var t="function"==typeof Map?new Map:void 0;return(rw=function(e){var r;if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return rb(e,arguments,rx(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),rS(n,e)})(e)}function rk(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(rk=function(){return!!e})()}rv.ActionBar=y.ActionBar,rv.ViewMode=ek,rv.Designer=function(){var e=(0,y.useCollection_deprecated)(),t=e.name,r=e.title,n=(0,y.useSchemaTemplate)();return S().createElement(y.GeneralSchemaDesigner,{schemaSettings:"blockSettings:gantt",template:n,title:r||t})},rv.Event=K;var rC=S().memo(function(e){return S().createElement(y.SchemaComponentOptions,{components:{Gantt:rv,GanttBlockInitializer:Q,GanttBlockProvider:T},scope:{useGanttBlockProps:D}},e.children)});rC.displayName="GanttProvider";var rO=function(e){var t,r,n;function o(){var e,t,r;return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,o),e=this,t=o,r=arguments,t=rx(t),function(e,t){return t&&("object"===function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}(t)||"function"==typeof t)?t:function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,rk()?Reflect.construct(t,r||[],rx(e).constructor):t.apply(e,r))}return!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&rS(e,t)}(o,e),t=o,r=[{key:"load",value:function(){var e,t=this;return(e=function(){var e;return function(e,t){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(a){return function(l){return function(a){if(r)throw TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}(this,function(r){return t.app.use(rC),t.app.schemaSettingsManager.add(I),t.app.schemaSettingsManager.add(B),t.app.schemaInitializerManager.add(z),t.app.schemaInitializerManager.add(W),null==(e=t.app.schemaInitializerManager.get("page:addBlock"))||e.add("dataBlocks.gantt",{title:"{{t('Gantt')}}",Component:"GanttBlockInitializer"}),t.app.schemaInitializerManager.addItem("popup:common:addBlock","dataBlocks.gantt",{title:"{{t('Gantt')}}",Component:"GanttBlockInitializer",useComponentProps:function(){var e,t,r,n,o,a,i=(e=(0,y.useSchemaInitializer)().insert,t=(0,M.useTranslation)().t,r=(0,x.useContext)(w.SchemaOptionsContext),n=(0,y.useGlobalTheme)().theme,o=(0,y.useCollectionManager_deprecated)().getCollectionFields,{createAssociationGanttBlock:(a=U(function(a){var i,l,c,s,u,d,f,p,h,m;return V(this,function(v){switch(v.label){case 0:return u=(i=a.item).associationField,f=null==(d=o(i.name,i.dataSource))?void 0:null===(l=d.filter(function(e){return"string"===e.type}))||void 0===l?void 0:l.map(function(e){var t;return{label:null==e?void 0:null===(t=e.uiSchema)||void 0===t?void 0:t.title,value:e.name}}),p=null==d?void 0:null===(c=d.filter(function(e){return"date"===e.type}))||void 0===c?void 0:c.map(function(e){var t;return{label:null==e?void 0:null===(t=e.uiSchema)||void 0===t?void 0:t.title,value:e.name}}),h=null==d?void 0:null===(s=d.filter(function(e){return"float"===e.type}))||void 0===s?void 0:s.map(function(e){var t;return{label:null==e?void 0:null===(t=e.uiSchema)||void 0===t?void 0:t.title,value:e.name}}),[4,(0,y.FormDialog)(t("Create gantt block"),function(){return S().createElement(y.SchemaComponentOptions,{scope:r.scope,components:_({},r.components)},S().createElement(q.FormLayout,{layout:"vertical"},S().createElement(y.SchemaComponent,{schema:{properties:{title:{title:t("Title field"),enum:f,required:!0,"x-component":"Select","x-decorator":"FormItem"},start:{title:t("Start date field"),enum:p,required:!0,default:"createdAt","x-component":"Select","x-decorator":"FormItem"},end:{title:t("End date field"),enum:p,required:!0,"x-component":"Select","x-decorator":"FormItem"},progress:{title:t("Progress field"),enum:h,"x-component":"Select","x-decorator":"FormItem"},range:{title:t("Time scale"),enum:[{label:'{{t("Hour")}}',value:"hour",color:"orange"},{label:'{{t("Quarter of day")}}',value:"quarterDay",color:"default"},{label:'{{t("Half of day")}}',value:"halfDay",color:"blue"},{label:'{{t("Day")}}',value:"day",color:"yellow"},{label:'{{t("Week")}}',value:"week",color:"pule"},{label:'{{t("Month")}}',value:"month",color:"green"},{label:'{{t("Year")}}',value:"year",color:"green"},{label:'{{t("QuarterYear")}}',value:"quarterYear",color:"red"}],default:"day","x-component":"Select","x-decorator":"FormItem"}}}})))},n).open({initialValues:{}})];case 1:return m=v.sent(),e(Y({association:"".concat(u.collectionName,".").concat(u.name),dataSource:i.dataSource,fieldNames:_({},m)})),[2]}})}),function(e){return a.apply(this,arguments)})}).createAssociationGanttBlock,l=$().createGanttBlock;return{onlyCurrentDataSource:!0,filterCollections:function(e){var t=e.associationField;return!!t&&["hasMany","belongsToMany"].includes(t.type)},createBlockSchema:function(e){var t=e.item;if(e.fromOthersInPopup)return l({item:t});i({item:t})},showAssociationFields:!0,hideSearch:!0}}}),t.app.addScopes({useGanttBlockProps:D}),[2]})},function(){var t=this,r=arguments;return new Promise(function(n,o){var a=e.apply(t,r);function i(e){rg(a,n,o,i,l,"next",e)}function l(e){rg(a,n,o,i,l,"throw",e)}i(void 0)})})()}}],ry(t.prototype,r),o}(rw(y.Plugin)),rP=rO;return b}()});
|
|
10
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@nocobase/client"),require("@formily/react"),require("react"),require("@emotion/css"),require("react-i18next"),require("antd"),require("antd-style"),require("@ant-design/icons"),require("@formily/antd-v5"),require("@formily/shared"),require("@nocobase/utils/client"),require("lodash")):"function"==typeof define&&define.amd?define("@nocobase/plugin-gantt",["@nocobase/client","@formily/react","react","@emotion/css","react-i18next","antd","antd-style","@ant-design/icons","@formily/antd-v5","@formily/shared","@nocobase/utils/client","lodash"],t):"object"==typeof exports?exports["@nocobase/plugin-gantt"]=t(require("@nocobase/client"),require("@formily/react"),require("react"),require("@emotion/css"),require("react-i18next"),require("antd"),require("antd-style"),require("@ant-design/icons"),require("@formily/antd-v5"),require("@formily/shared"),require("@nocobase/utils/client"),require("lodash")):e["@nocobase/plugin-gantt"]=t(e["@nocobase/client"],e["@formily/react"],e.react,e["@emotion/css"],e["react-i18next"],e.antd,e["antd-style"],e["@ant-design/icons"],e["@formily/antd-v5"],e["@formily/shared"],e["@nocobase/utils/client"],e.lodash)}(self,function(e,t,r,n,o,a,i,l,c,s,u,d){return function(){"use strict";var f,p,h,m={482:function(e){e.exports=l},964:function(e){e.exports=n},632:function(e){e.exports=c},505:function(e){e.exports=t},875:function(e){e.exports=s},772:function(t){t.exports=e},584:function(e){e.exports=u},721:function(e){e.exports=a},202:function(e){e.exports=i},467:function(e){e.exports=d},156:function(e){e.exports=r},238:function(e){e.exports=o}},v={};function g(e){var t=v[e];if(void 0!==t)return t.exports;var r=v[e]={exports:{}};return m[e](r,r.exports,g),r.exports}g.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return g.d(t,{a:t}),t},g.d=function(e,t){for(var r in t)g.o(t,r)&&!g.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},g.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},g.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var b={};g.r(b),g.d(b,{Gantt:function(){return rv},PluginGanttClient:function(){return rO},default:function(){return rP}});var y=g("772"),x=g("156"),S=g.n(x),w=g("505");function k(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function C(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(r=o.next()).done)&&(a.push(r.value),!t||a.length!==t);i=!0);}catch(e){l=!0,n=e}finally{try{!i&&null!=o.return&&o.return()}finally{if(l)throw n}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return k(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return k(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var O=(0,x.createContext)({});O.displayName="GanttBlockContext";var P=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0,o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a=arguments.length>5?arguments[5]:void 0,i=arguments.length>6?arguments[6]:void 0,l=arguments.length>7?arguments[7]:void 0;return e.forEach(function(e){var c,s,u=a(e),d=parseFloat((100*e[t.progress]).toFixed(2)),f=(0,y.getLabelFormatValue)(l,e[t.title]);e.children&&e.children.length?(r.push({start:new Date(null!==(c=e[t.start])&&void 0!==c?c:void 0),end:new Date(null!==(s=e[t.end])&&void 0!==s?s:void 0),name:f,id:e[i]+"",type:"project",progress:d>100?100:d||0,hideChildren:o,project:n,color:e.color,isDisabled:u}),P(e.children,t,r,e.id+"",o,a,i,l)):r.push({start:e[t.start]?new Date(e[t.start]):void 0,end:new Date(e[t.end]||e[t.start]),name:f,id:e[i]+"",type:t.end?"task":"milestone",progress:d>100?100:d||0,project:n,color:e.color,isDisabled:u})}),r},E=function(e){var t=e.fieldNames,r=e.timeRange,n=e.resource,o=(0,w.useField)(),a=(0,y.useBlockRequestContext)().service;return S().createElement(O.Provider,{value:{field:o,service:a,resource:n,fieldNames:t,timeRange:r}},e.children)},T=function(e){var t,r,n,o=(0,y.useCollectionManager_deprecated)(e.dataSource).getCollection(e.collection,e.dataSource),a={filter:null===(t=e.params)||void 0===t?void 0:t.filter,paginate:!1,sort:[(null==o?void 0:o.primaryKey)||"id"]};return S().createElement("div",{"aria-label":"block-item-gantt",role:"button"},S().createElement(y.TableBlockProvider,(r=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n,o,a;n=e,o=t,a=r[t],o in n?Object.defineProperty(n,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[o]=a})}return e}({},e),n=(n={params:a},n),Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(n)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(n,e))}),r),S().createElement(E,e)))},j=function(){return(0,x.useContext)(O)},D=function(){var e,t,r=j(),n=r.fieldNames,o=C((0,x.useState)([]),2),a=o[0],i=o[1],l=(0,y.useCollection_deprecated)(),c=l.getPrimaryKey,s=l.name,u=l.template,d=l.writableView,f=(0,y.useACLRoleContext)().parseAction,p=(0,y.useTableBlockContext)(),h=C((0,x.useState)(!1),2),m=h[0],v=h[1],g=c(),b=null===(e=(0,y.useCollection)().fields.find(function(e){return e.name===(null==n?void 0:n.title)}))||void 0===e?void 0:e.uiSchema,S=function(e){var t=null==e?void 0:e[g],r=f("".concat(s,":update"),{schema:{},recordPkValue:t});return"view"===u&&!d||!r};return(0,x.useEffect)(function(){var e;if(v(!0),!(null==r?void 0:null===(e=r.service)||void 0===e?void 0:e.loading)){var t,n=P(null===(t=r.service.data)||void 0===t?void 0:t.data,r.fieldNames,[],void 0,!1,S,g,b);i(n),v(!1),r.field.data=n,a.length>0&&p.setExpandFlag(!0)}},[null==r?void 0:null===(t=r.service)||void 0===t?void 0:t.loading]),{fieldNames:r.fieldNames,timeRange:r.timeRange,onExpanderClick:function(e){var t=r.field.data.map(function(t){return t.id===e.id?e:t});i(t),r.field.data=t},expandAndCollapseAll:function(e){var t,n=P(null===(t=r.service.data)||void 0===t?void 0:t.data,r.fieldNames,[],void 0,e,S,g,b);i(n),r.field.data=n},tasks:a,loading:m}},M=g("238"),N=function(){return(0,M.useTranslation)("gantt")},A=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"string",r=(0,y.useCompile)(),n=(0,y.useCollection_deprecated)().fields;return null==n?void 0:null===(e=n.filter(function(e){return"string"==typeof t?e.type===t:t.includes(e.type)}))||void 0===e?void 0:e.map(function(e){var t;return{value:e.name,label:r(null==e?void 0:null===(t=e.uiSchema)||void 0===t?void 0:t.title)}})};function F(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var I=new y.SchemaSettings({name:"GanttBlockSettings",items:[{name:"title",Component:y.SchemaSettingsBlockTitleItem},{name:"titleField",Component:y.SchemaSettingsSelectItem,useComponentProps:function(){var e,t=N().t,r=(0,w.useFieldSchema)(),n=(null==r?void 0:null===(e=r["x-decorator-props"])||void 0===e?void 0:e.fieldNames)||{},o=j().service,a=(0,w.useField)(),i=(0,y.useDesignable)().dn;return{title:t("Title field"),value:n.title,options:A("string"),onChange:function(e){var t,n=a.decoratorProps.fieldNames||{};n.title=e,a.decoratorProps.params=n,r["x-decorator-props"].params=n,r["x-decorator-props"].fieldNames=n,o.refresh(),i.emit("patch",{schema:(F(t={},"x-uid",r["x-uid"]),F(t,"x-decorator-props",a.decoratorProps),t)}),i.refresh()}}}},{name:"timeScale",Component:y.SchemaSettingsSelectItem,useComponentProps:function(){var e,t=N().t,r=(0,w.useFieldSchema)(),n=(null==r?void 0:null===(e=r["x-decorator-props"])||void 0===e?void 0:e.fieldNames)||{},o=(0,w.useField)(),a=j().service,i=(0,y.useDesignable)().dn,l=(0,y.useCompile)();return{title:t("Time scale"),value:n.range||"day",options:[{label:l('{{t("Hour")}}'),value:"hour",color:"orange"},{label:l('{{t("Quarter of day")}}'),value:"quarterDay",color:"default"},{label:l('{{t("Half of day")}}'),value:"halfDay",color:"blue"},{label:l('{{t("Day")}}'),value:"day",color:"yellow"},{label:l('{{t("Week")}}'),value:"week",color:"pule"},{label:l('{{t("Month")}}'),value:"month",color:"green"},{label:l('{{t("QuarterYear")}}'),value:"quarterYear",color:"red"},{label:l('{{t("Year")}}'),value:"year",color:"green"}],onChange:function(e){var t,n=o.decoratorProps.fieldNames||{};n.range=e,o.decoratorProps.params=n,r["x-decorator-props"].params=n,r["x-decorator-props"].fieldNames=n,a.refresh(),i.emit("patch",{schema:(F(t={},"x-uid",r["x-uid"]),F(t,"x-decorator-props",o.decoratorProps),t)}),i.refresh()}}}},{name:"startDateField",Component:y.SchemaSettingsSelectItem,useComponentProps:function(){var e,t=N().t,r=(0,w.useFieldSchema)(),n=(null==r?void 0:null===(e=r["x-decorator-props"])||void 0===e?void 0:e.fieldNames)||{},o=(0,w.useField)(),a=(0,y.useDesignable)().dn,i=j().service;return{title:t("Start date field"),value:n.start,options:A("date"),onChange:function(e){var t,n=o.decoratorProps.fieldNames||{};n.start=e,o.decoratorProps.fieldNames=n,r["x-decorator-props"].fieldNames=n,i.refresh(),a.emit("patch",{schema:(F(t={},"x-uid",r["x-uid"]),F(t,"x-decorator-props",o.decoratorProps),t)}),a.refresh()}}}},{name:"endDateField",Component:y.SchemaSettingsSelectItem,useComponentProps:function(){var e,t=N().t,r=(0,w.useFieldSchema)(),n=(0,w.useField)(),o=j().service,a=(0,y.useDesignable)().dn,i=(null==r?void 0:null===(e=r["x-decorator-props"])||void 0===e?void 0:e.fieldNames)||{};return{title:t("End date field"),value:i.end,options:A("date"),onChange:function(e){var t,i=n.decoratorProps.fieldNames||{};i.end=e,n.decoratorProps.fieldNames=i,r["x-decorator-props"].fieldNames=i,o.refresh(),a.emit("patch",{schema:(F(t={},"x-uid",r["x-uid"]),F(t,"x-decorator-props",n.decoratorProps),t)}),a.refresh()}}}},{name:"processField",Component:y.SchemaSettingsSelectItem,useComponentProps:function(){var e,t=N().t,r=(0,w.useFieldSchema)(),n=(null==r?void 0:null===(e=r["x-decorator-props"])||void 0===e?void 0:e.fieldNames)||{},o=j().service,a=(0,y.useDesignable)().dn,i=(0,w.useField)();return{title:t("Progress field"),value:n.progress,options:A("float"),onChange:function(e){var t,n=i.decoratorProps.fieldNames||{};n.progress=e,i.decoratorProps.fieldNames=n,r["x-decorator-props"].fieldNames=n,o.refresh(),a.emit("patch",{schema:(F(t={},"x-uid",r["x-uid"]),F(t,"x-decorator-props",i.decoratorProps),t)}),a.refresh()}}}},{name:"dataScope",Component:y.SchemaSettingsDataScope,useComponentProps:function(){var e,t,r=(0,y.useCollection_deprecated)().name,n=(0,w.useFieldSchema)(),o=(0,y.useFormBlockContext)().form,a=(0,w.useField)(),i=(0,y.useDesignable)().dn;return{collectionName:r,defaultFilter:(null==n?void 0:null===(t=n["x-decorator-props"])||void 0===t?void 0:null===(e=t.params)||void 0===e?void 0:e.filter)||{},form:o,onSubmit:function(e){var t,r=e.filter;r=(0,y.removeNullCondition)(r);var o=a.decoratorProps.params||{};o.filter=r,a.decoratorProps.params=o,n["x-decorator-props"].params=o,i.emit("patch",{schema:(F(t={},"x-uid",n["x-uid"]),F(t,"x-decorator-props",n["x-decorator-props"]),t)})}}}},{name:"divider",type:"divider"},{name:"template",Component:y.SchemaSettingsTemplate,useComponentProps:function(){var e=(0,y.useCollection_deprecated)().name,t=(0,y.useBlockTemplateContext)().componentNamePrefix;return{componentName:"".concat(t,"Gantt"),collectionName:e}}},{name:"divider2",type:"divider"},{name:"remove",type:"remove",componentProps:{removeParentsIfNoChildren:!0,breakRemoveOn:{"x-component":"Grid"}}}]}),B=new y.SchemaSettings({name:"blockSettings:gantt",items:[{name:"title",Component:y.SchemaSettingsBlockTitleItem},{name:"titleField",Component:y.SchemaSettingsSelectItem,useComponentProps:function(){var e,t=N().t,r=(0,w.useFieldSchema)(),n=(null==r?void 0:null===(e=r["x-decorator-props"])||void 0===e?void 0:e.fieldNames)||{},o=j().service,a=(0,w.useField)(),i=(0,y.useDesignable)().dn;return{title:t("Title field"),value:n.title,options:A("string"),onChange:function(e){var t,n=a.decoratorProps.fieldNames||{};n.title=e,a.decoratorProps.params=n,r["x-decorator-props"].params=n,r["x-decorator-props"].fieldNames=n,o.refresh(),i.emit("patch",{schema:(F(t={},"x-uid",r["x-uid"]),F(t,"x-decorator-props",a.decoratorProps),t)}),i.refresh()}}}},{name:"timeScale",Component:y.SchemaSettingsSelectItem,useComponentProps:function(){var e,t=N().t,r=(0,w.useFieldSchema)(),n=(null==r?void 0:null===(e=r["x-decorator-props"])||void 0===e?void 0:e.fieldNames)||{},o=(0,w.useField)(),a=j().service,i=(0,y.useDesignable)().dn,l=(0,y.useCompile)();return{title:t("Time scale"),value:n.range||"day",options:[{label:l('{{t("Hour")}}'),value:"hour",color:"orange"},{label:l('{{t("Quarter of day")}}'),value:"quarterDay",color:"default"},{label:l('{{t("Half of day")}}'),value:"halfDay",color:"blue"},{label:l('{{t("Day")}}'),value:"day",color:"yellow"},{label:l('{{t("Week")}}'),value:"week",color:"pule"},{label:l('{{t("Month")}}'),value:"month",color:"green"},{label:l('{{t("QuarterYear")}}'),value:"quarterYear",color:"red"},{label:l('{{t("Year")}}'),value:"year",color:"green"}],onChange:function(e){var t,n=o.decoratorProps.fieldNames||{};n.range=e,o.decoratorProps.params=n,r["x-decorator-props"].params=n,r["x-decorator-props"].fieldNames=n,a.refresh(),i.emit("patch",{schema:(F(t={},"x-uid",r["x-uid"]),F(t,"x-decorator-props",o.decoratorProps),t)}),i.refresh()}}}},{name:"startDateField",Component:y.SchemaSettingsSelectItem,useComponentProps:function(){var e,t=N().t,r=(0,w.useFieldSchema)(),n=(null==r?void 0:null===(e=r["x-decorator-props"])||void 0===e?void 0:e.fieldNames)||{},o=(0,w.useField)(),a=(0,y.useDesignable)().dn,i=j().service;return{title:t("Start date field"),value:n.start,options:A(["date","datetime","dateOnly","datetimeNoTz"]),onChange:function(e){var t,n=o.decoratorProps.fieldNames||{};n.start=e,o.decoratorProps.fieldNames=n,r["x-decorator-props"].fieldNames=n,i.refresh(),a.emit("patch",{schema:(F(t={},"x-uid",r["x-uid"]),F(t,"x-decorator-props",o.decoratorProps),t)}),a.refresh()}}}},y.setDataLoadingModeSettingsItem,{name:"endDateField",Component:y.SchemaSettingsSelectItem,useComponentProps:function(){var e,t=N().t,r=(0,w.useFieldSchema)(),n=(0,w.useField)(),o=j().service,a=(0,y.useDesignable)().dn,i=(null==r?void 0:null===(e=r["x-decorator-props"])||void 0===e?void 0:e.fieldNames)||{};return{title:t("End date field"),value:i.end,options:A(["date","datetime","dateOnly","datetimeNoTz"]),onChange:function(e){var t,i=n.decoratorProps.fieldNames||{};i.end=e,n.decoratorProps.fieldNames=i,r["x-decorator-props"].fieldNames=i,o.refresh(),a.emit("patch",{schema:(F(t={},"x-uid",r["x-uid"]),F(t,"x-decorator-props",n.decoratorProps),t)}),a.refresh()}}}},{name:"processField",Component:y.SchemaSettingsSelectItem,useComponentProps:function(){var e,t=N().t,r=(0,w.useFieldSchema)(),n=(null==r?void 0:null===(e=r["x-decorator-props"])||void 0===e?void 0:e.fieldNames)||{},o=j().service,a=(0,y.useDesignable)().dn,i=(0,w.useField)();return{title:t("Progress field"),value:n.progress,options:A("float"),onChange:function(e){var t,n=i.decoratorProps.fieldNames||{};n.progress=e,i.decoratorProps.fieldNames=n,r["x-decorator-props"].fieldNames=n,o.refresh(),a.emit("patch",{schema:(F(t={},"x-uid",r["x-uid"]),F(t,"x-decorator-props",i.decoratorProps),t)}),a.refresh()}}}},{name:"dataScope",Component:y.SchemaSettingsDataScope,useComponentProps:function(){var e,t,r=(0,y.useCollection)().name,n=(0,w.useFieldSchema)(),o=(0,y.useFormBlockContext)().form,a=(0,w.useField)(),i=(0,y.useDesignable)().dn;return{collectionName:r,defaultFilter:(null==n?void 0:null===(t=n["x-decorator-props"])||void 0===t?void 0:null===(e=t.params)||void 0===e?void 0:e.filter)||{},form:o,onSubmit:function(e){var t,r=e.filter;r=(0,y.removeNullCondition)(r);var o=a.decoratorProps.params||{};o.filter=r,a.decoratorProps.params=o,n["x-decorator-props"].params=o,i.emit("patch",{schema:(F(t={},"x-uid",n["x-uid"]),F(t,"x-decorator-props",n["x-decorator-props"]),t)})}}}},{name:"divider",type:"divider"},{name:"template",Component:y.SchemaSettingsTemplate,useComponentProps:function(){var e=(0,y.useCollection)().name,t=(0,y.useBlockTemplateContext)().componentNamePrefix;return{componentName:"".concat(t,"Gantt"),collectionName:e}}},{name:"divider2",type:"divider"},{name:"remove",type:"remove",componentProps:{removeParentsIfNoChildren:!0,breakRemoveOn:{"x-component":"Grid"}}}]});function H(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n,o,a;n=e,o=t,a=r[t],o in n?Object.defineProperty(n,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[o]=a})}return e}var R={title:"{{t('Configure actions')}}",icon:"SettingOutlined",style:{marginLeft:8},items:[{type:"item",name:"filter",title:"{{t('Filter')}}",Component:"FilterActionInitializer",schema:{"x-align":"left"}},{type:"item",title:"{{t('Add new')}}",name:"addNew",Component:"CreateActionInitializer",schema:{"x-align":"right","x-decorator":"ACLActionProvider","x-acl-action-props":{skipScopeCheck:!0}},useVisible:function(){return(0,y.useActionAvailable)("create")}},{type:"item",title:"{{t('Delete')}}",name:"delete",Component:"BulkDestroyActionInitializer",schema:{"x-align":"right","x-decorator":"ACLActionProvider"},useVisible:function(){return(0,y.useActionAvailable)("destroyMany")}},{type:"item",title:"{{t('Refresh')}}",name:"refresh",Component:"RefreshActionInitializer",schema:{"x-align":"right"}},{name:"toggle",title:"{{t('Expand/Collapse')}}",Component:"ExpandableActionInitializer",schema:{"x-align":"right"},useVisible:function(){var e,t=(0,w.useFieldSchema)(),r=(0,y.useCollection)(),n=((null==t?void 0:null===(e=t.parent)||void 0===e?void 0:e["x-decorator-props"])||{}).treeTable;return r.tree&&n}},{name:"customRequest",title:'{{t("Custom request")}}',Component:"CustomRequestInitializer",schema:{"x-action":"customize:table:request:global"}}]},z=new y.CompatibleSchemaInitializer(H({name:"GanttActionInitializers"},R)),W=new y.CompatibleSchemaInitializer(H({name:"gantt:configureActions"},R),z),L=g("482"),q=g("632"),G=g("875"),Y=function(e){var t,r,n,o=e.collectionName,a=e.fieldNames,i=e.dataSource,l=e.association;var c={type:"void","x-acl-action":"".concat(l||o,":list"),"x-decorator":"GanttBlockProvider","x-decorator-props":{collection:o,dataSource:i,action:"list",fieldNames:a,params:{paginate:!1}},"x-toolbar":"BlockSchemaToolbar","x-settings":"blockSettings:gantt","x-component":"CardItem",properties:(t={},r=(0,G.uid)(),n={type:"void","x-component":"Gantt","x-use-component-props":"useGanttBlockProps",properties:{toolBar:{type:"void","x-component":"ActionBar","x-component-props":{style:{marginBottom:24}},"x-initializer":"gantt:configureActions",properties:{}},table:{type:"array","x-decorator":"div","x-decorator-props":{style:{float:"left",maxWidth:"35%"}},"x-initializer":"table:configureColumns","x-component":"TableV2","x-use-component-props":"useTableBlockProps","x-component-props":{rowKey:"id",rowSelection:{type:"checkbox"},pagination:!1},properties:{actions:{type:"void",title:'{{ t("Actions") }}',"x-action-column":"actions","x-decorator":"TableV2.Column.ActionBar","x-component":"TableV2.Column","x-toolbar":"TableColumnSchemaToolbar","x-initializer":"table:configureItemActions","x-settings":"fieldSettings:TableColumn","x-toolbar-props":{initializer:"table:configureItemActions"},properties:{actions:{type:"void","x-decorator":"DndContext","x-component":"Space","x-component-props":{split:"|"}}}}}},detail:{type:"void","x-component":"Gantt.Event",properties:{drawer:{type:"void","x-component":"Action.Drawer","x-component-props":{className:"nb-action-popup"},title:'{{ t("View record") }}',properties:{tabs:{type:"void","x-component":"Tabs","x-component-props":{},"x-initializer":"popup:addTab",properties:{tab1:{type:"void",title:'{{t("Details")}}',"x-component":"Tabs.TabPane","x-designer":"Tabs.Designer","x-component-props":{},properties:{grid:{type:"void","x-component":"Grid","x-initializer":"popup:common:addBlock"}}}}}}}}}}},r in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t)};return l&&(c["x-decorator-props"].association=l),c};function X(e,t,r,n,o,a,i){try{var l=e[a](i),c=l.value}catch(e){r(e);return}l.done?t(c):Promise.resolve(c).then(n,o)}function U(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var a=e.apply(t,r);function i(e){X(a,n,o,i,l,"next",e)}function l(e){X(a,n,o,i,l,"throw",e)}i(void 0)})}}function _(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n,o,a;n=e,o=t,a=r[t],o in n?Object.defineProperty(n,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[o]=a})}return e}function V(e,t){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(a){return function(l){return function(a){if(r)throw TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}var Q=function(e){var t,r,n,o=e.filterCollections,a=e.onlyCurrentDataSource,i=e.hideSearch,l=e.createBlockSchema,c=e.showAssociationFields,s=(0,y.useSchemaInitializerItem)(),u=$().createGanttBlock;return S().createElement(y.DataBlockInitializer,(r=_({},s),n=(n={componentType:"Gantt",icon:S().createElement(L.ProjectOutlined,{rotate:90}),onCreateBlockSchema:(t=U(function(e){return V(this,function(t){return l?[2,l(e)]:(u(e),[2])})}),function(e){return t.apply(this,arguments)}),onlyCurrentDataSource:a,hideSearch:i,filter:o,showAssociationFields:c},n),Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(n)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(n,e))}),r))},$=function(){var e,t=(0,y.useSchemaInitializer)().insert,r=(0,M.useTranslation)().t,n=(0,y.useCollectionManager_deprecated)().getCollectionFields,o=(0,x.useContext)(w.SchemaOptionsContext),a=(0,y.useGlobalTheme)().theme;return{createGanttBlock:(e=U(function(e){var i,l,c,s,u,d,f,p,h;return V(this,function(m){switch(m.label){case 0:return d=null==(u=n((i=e.item).name,i.dataSource))?void 0:null===(l=u.filter(function(e){return"string"===e.type}))||void 0===l?void 0:l.map(function(e){var t;return{label:null==e?void 0:null===(t=e.uiSchema)||void 0===t?void 0:t.title,value:e.name}}),f=null==u?void 0:null===(c=u.filter(function(e){return["date","datetime","dateOnly","datetimeNoTz"].includes(e.type)}))||void 0===c?void 0:c.map(function(e){var t;return{label:null==e?void 0:null===(t=e.uiSchema)||void 0===t?void 0:t.title,value:e.name}}),p=null==u?void 0:null===(s=u.filter(function(e){return"float"===e.type}))||void 0===s?void 0:s.map(function(e){var t;return{label:null==e?void 0:null===(t=e.uiSchema)||void 0===t?void 0:t.title,value:e.name}}),[4,(0,y.FormDialog)(r("Create gantt block"),function(){return S().createElement(y.SchemaComponentOptions,{scope:o.scope,components:_({},o.components)},S().createElement(q.FormLayout,{layout:"vertical"},S().createElement(y.SchemaComponent,{schema:{properties:{title:{title:r("Title field"),enum:d,required:!0,"x-component":"Select","x-decorator":"FormItem"},start:{title:r("Start date field"),enum:f,required:!0,default:"createdAt","x-component":"Select","x-decorator":"FormItem"},end:{title:r("End date field"),enum:f,required:!0,"x-component":"Select","x-decorator":"FormItem"},progress:{title:r("Progress field"),enum:p,"x-component":"Select","x-decorator":"FormItem"},range:{title:r("Time scale"),enum:[{label:'{{t("Hour")}}',value:"hour",color:"orange"},{label:'{{t("Quarter of day")}}',value:"quarterDay",color:"default"},{label:'{{t("Half of day")}}',value:"halfDay",color:"blue"},{label:'{{t("Day")}}',value:"day",color:"yellow"},{label:'{{t("Week")}}',value:"week",color:"pule"},{label:'{{t("Month")}}',value:"month",color:"green"},{label:'{{t("Year")}}',value:"year",color:"green"},{label:'{{t("QuarterYear")}}',value:"quarterYear",color:"red"}],default:"day","x-component":"Select","x-decorator":"FormItem"}}}})))},a).open({initialValues:{}})];case 1:return h=m.sent(),t(Y({collectionName:i.name,dataSource:i.dataSource,fieldNames:_({},h)})),[2]}})}),function(t){return e.apply(this,arguments)})}},K=(0,w.observer)(function(e){var t=(0,y.useCollectionRecordData)(),r=(0,y.useCollection)();return S().createElement(y.PopupContextProvider,null,S().createElement(y.VariablePopupRecordProvider,{recordData:t,collection:r},e.children))},{displayName:"Event"}),J=g("964"),Z=g("721"),ee=g("467");function et(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function er(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n,o,a;n=e,o=t,a=r[t],o in n?Object.defineProperty(n,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[o]=a})}return e}function en(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}function eo(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(r=o.next()).done)&&(a.push(r.value),!t||a.length!==t);i=!0);}catch(e){l=!0,n=e}finally{try{!i&&null!=o.return&&o.return()}finally{if(l)throw n}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return et(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return et(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var ea=function(e,t,r,n,o,a,i,l,c,s,u,d,f,p,h,m,v,g){var b=e.map(function(e,b){return ei(e,b,t,r,n,o,a,i,l,c,s,u,d,f,p,h,m,v,g)});return b=b.map(function(e){for(var t=function(t){var n=b.findIndex(function(e){return e.id===r[t]});-1!==n&&b[n].barChildren.push(e)},r=e.dependencies||[],n=0;n<r.length;n++)t(n);return e})},ei=function(e,t,r,n,o,a,i,l,c,s,u,d,f,p,h,m,v,g,b){var y;switch(e.type){case"milestone":y=ec(e,t,r,n,o,a,i,l,g,b);break;case"project":y=el(e,t,r,n,o,.5*a,i,l,c,p,h,m,v);break;default:y=el(e,t,r,n,o,a,i,l,c,s,u,d,f)}return y},el=function(e,t,r,n,o,a,i,l,c,s,u,d,f){c?(h=eu(e.start,r,n),p=eu(e.end,r,n)):(p=es(e.start,r,n),h=es(e.end,r,n));var p,h,m=e.type;"task"===m&&h-p<2*l&&(m="smalltask",h=p>0?p+2*l:p);var v=eo(ef(p,h,e.progress,c),2),g=v[0],b=v[1],y="project"===e.type?ed(t,o,a)+8:ed(t,o,a),x="project"===e.type?e.hideChildren:void 0,S=er({backgroundColor:d,backgroundSelectedColor:f,progressColor:s,progressSelectedColor:u},e.styles);return en(er({},e),{typeInternal:m,x1:p,x2:h,y:y,index:t,progressX:b,progressWidth:g,barCornerRadius:i,handleWidth:l,hideChildren:x,height:a,barChildren:[],styles:S})},ec=function(e,t,r,n,o,a,i,l,c,s){var u=es(e.start,r,n),d=ed(t,o,a),f=u-.5*a,p=u+.5*a,h=a/1.414,m=er({backgroundColor:c,backgroundSelectedColor:s,progressColor:"",progressSelectedColor:""},e.styles);return en(er({},e),{end:e.start,x1:f,x2:p,y:d,index:t,progressX:0,progressWidth:0,barCornerRadius:i,handleWidth:l,typeInternal:e.type,progress:0,height:h,hideChildren:void 0,barChildren:[],styles:m})},es=function(e,t,r){var n,o,a,i=t.findIndex(function(t){return(null==t?void 0:t.getTime())>=(null==e?void 0:e.getTime())})-1,l=((null==e?void 0:e.getTime())-(null===(n=t[i])||void 0===n?void 0:n.getTime()))/((null===(o=t[i+1])||void 0===o?void 0:o.getTime())-(null===(a=t[i])||void 0===a?void 0:a.getTime())),c=i*r+l*r;return isNaN(c)?0:c},eu=function(e,t,r){var n=es(e,t,r);return isNaN(n+=r)?0:n},ed=function(e,t,r){var n=e*t+(t-r)/2;return isNaN(n)?0:n},ef=function(e,t,r,n){var o,a=(t-e)*r*.01;return o=n?t-a:e,[a,o]},ep=function(e,t){if(e>=t.x2)return 100;if(e<=t.x1)return 0;var r=t.x2-t.x1;return Math.round((e-t.x1)*100/r)},eh=function(e,t){if(e>=t.x2)return 0;if(e<=t.x1)return 100;var r=t.x2-t.x1;return Math.round((t.x2-e)*100/r)},em=function(e,t,r){return[e-5,t+r,e+5,t+r,e,t+r-8.66].join(",")},ev=function(e,t,r){e>=r.x2-2*r.handleWidth&&(e=r.x2-2*r.handleWidth);var n=Math.round((e-r.x1)/t);return r.x1+n*t},eg=function(e,t,r){e<=r.x1+2*r.handleWidth&&(e=r.x1+2*r.handleWidth);var n=Math.round((e-r.x2)/t);return r.x2+n*t},eb=function(e,t,r){var n=Math.round((e-r.x1)/t),o=r.x1+n*t,a=o+r.x2-r.x1;return[o,a]},ey=function(e,t,r,n,o){var a,i,l=new Date((e-t)/n*o+(null==r?void 0:null===(a=r.getTime)||void 0===a?void 0:a.call(r)));return l=new Date((null==l?void 0:null===(i=l.getTime)||void 0===i?void 0:i.call(l))+((null==l?void 0:l.getTimezoneOffset())-(null==r?void 0:r.getTimezoneOffset()))*6e4)},ex=function(e,t,r,n,o,a,i){var l;if("milestone"===r.type)l=ew(e,t,r,n,o,a);else l=eS(e,t,r,n,o,a,i);return l},eS=function(e,t,r,n,o,a,i){var l=er({},r),c=!1;switch(t){case"progress":if(i?l.progress=eh(e,r):l.progress=ep(e,r),c=l.progress!==r.progress){var s=eo(ef(l.x1,l.x2,l.progress,i),2),u=s[0],d=s[1];l.progressWidth=u,l.progressX=d}break;case"start":var f=ev(e,n,r);if(l.x1=f,c=l.x1!==r.x1){i?l.end=ey(f,r.x1,r.end,n,o):l.start=ey(f,r.x1,r.start,n,o);var p=eo(ef(l.x1,l.x2,l.progress,i),2),h=p[0],m=p[1];l.progressWidth=h,l.progressX=m}break;case"end":var v=eg(e,n,r);if(l.x2=v,c=l.x2!==r.x2){i?l.start=ey(v,r.x2,r.start,n,o):l.end=ey(v,r.x2,r.end,n,o);var g=eo(ef(l.x1,l.x2,l.progress,i),2),b=g[0],y=g[1];l.progressWidth=b,l.progressX=y}break;case"move":var x=eo(eb(e-a,n,r),2),S=x[0],w=x[1];if(c=S!==r.x1){l.start=ey(S,r.x1,r.start,n,o),l.end=ey(w,r.x2,r.end,n,o),l.x1=S,l.x2=w;var k=eo(ef(l.x1,l.x2,l.progress,i),2),C=k[0],O=k[1];l.progressWidth=C,l.progressX=O}}return{isChanged:c,changedTask:l}},ew=function(e,t,r,n,o,a){var i=er({},r),l=!1;if("move"===t){var c=eo(eb(e-a,n,r),2),s=c[0],u=c[1];(l=s!==r.x1)&&(i.start=ey(s,r.x1,r.start,n,o),i.end=i.start,i.x1=s,i.x2=u)}return{isChanged:l,changedTask:i}};var ek=((f={}).Hour="hour",f.QuarterDay="quarterDay",f.HalfDay="halfDay",f.Day="day",f.Week="week",f.Month="month",f.QuarterYear="quarterYear",f.Year="year",f);Intl.DateTimeFormat,Intl.DateTimeFormatOptions;var eC={},eO=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=JSON.stringify([e,t]),n=eC[r];return!n&&(n=new Intl.DateTimeFormat(e,t),eC[r]=n),n},eP=function(e,t,r){return new Date(e.getFullYear()+("year"===r?t:0),e.getMonth()+("month"===r?t:0),e.getDate()+("day"===r?t:0),e.getHours()+("hour"===r?t:0),e.getMinutes()+("minute"===r?t:0),e.getSeconds()+("second"===r?t:0),e.getMilliseconds()+("millisecond"===r?t:0))},eE=function(e,t){var r=["millisecond","second","minute","hour","day","month","year"],n=function(e){var n=r.indexOf(t);return r.indexOf(e)<=n};return new Date(null==e?void 0:e.getFullYear(),n("year")?0:e.getMonth(),n("month")?1:e.getDate(),n("day")?0:e.getHours(),n("hour")?0:e.getMinutes(),n("minute")?0:e.getSeconds(),n("second")?0:e.getMilliseconds())},eT=function(e,t,r){var n=(null===(c=e[0])||void 0===c?void 0:c.start)||new Date,o=(null===(s=e[0])||void 0===s?void 0:s.start)||new Date,a=!0,i=!1,l=void 0;try{for(var c,s,u,d=e[Symbol.iterator]();!(a=(u=d.next()).done);a=!0){var f=u.value;f.start<n&&(n=f.start),f.end>o&&(o=f.end)}}catch(e){i=!0,l=e}finally{try{!a&&null!=d.return&&d.return()}finally{if(i)throw l}}switch(t){case ek.Year:n=eE(n=eP(n,-1,"year"),"year"),o=eE(o=eP(o,1,"year"),"year");break;case ek.QuarterYear:n=eE(n=eP(n,-3,"month"),"month"),o=eE(o=eP(o,3,"year"),"year");break;case ek.Month:n=eE(n=eP(n,-1*r,"month"),"month"),o=eE(o=eP(o,1,"year"),"year");break;case ek.Week:n=eP(eN(n=eE(n,"day")),-7*r,"day"),o=eP(o=eE(o,"day"),1.5,"month");break;case ek.Day:n=eP(n=eE(n,"day"),-1*r,"day"),o=eP(o=eE(o,"day"),19,"day");break;case ek.QuarterDay:n=eP(n=eE(n,"day"),-1*r,"day"),o=eP(o=eE(o,"day"),66,"hour");break;case ek.HalfDay:n=eP(n=eE(n,"day"),-1*r,"day"),o=eP(o=eE(o,"day"),108,"hour");break;case ek.Hour:n=eP(n=eE(n,"hour"),-1*r,"hour"),o=eP(o=eE(o,"day"),1,"day")}return[n,o]},ej=function(e,t,r){for(var n=new Date(e),o=[n];n<t;){switch(r){case ek.Year:n=eP(n,1,"year");break;case ek.QuarterYear:n=eP(n,3,"month");break;case ek.Month:n=eP(n,1,"month");break;case ek.Week:n=eP(n,7,"day");break;case ek.Day:n=eP(n,1,"day");break;case ek.HalfDay:n=eP(n,12,"hour");break;case ek.QuarterDay:n=eP(n,6,"hour");break;case ek.Hour:n=eP(n,1,"hour")}o.push(n)}return o},eD=function(e,t){var r=eO(t,{month:"long"}).format(e);return r=r.replace(r[0],r[0].toLocaleUpperCase())},eM=function(e,t,r){var n=eO(t,{weekday:r}).format(e);return n=n.replace(n[0],n[0].toLocaleUpperCase())},eN=function(e){var t=e.getDay(),r=e.getDate()-t+(0===t?-6:1);return new Date(e.setDate(r))},eA=function(e){var t=new Date(e.valueOf()),r=(t.getDay()+6)%7;t.setDate(t.getDate()-r+3);var n=t.valueOf();t.setMonth(0,1),4!==t.getDay()&&t.setMonth(0,1+(4-t.getDay()+7)%7);var o=(1+Math.ceil((n-t.valueOf())/6048e5)).toString();return 1===o.length?"0".concat(o):o};function eF(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var eI=function(e,t){var r=e.displayOrder||Number.MAX_VALUE,n=t.displayOrder||Number.MAX_VALUE;return r>n?1:r<n?-1:0},eB=function(e){var t;return isNaN(null==e?void 0:null===(t=e.getTime)||void 0===t?void 0:t.call(e))?0:e.getFullYear()+"/"+"".concat(e.getMonth()+1)+"/"+e.getDate()},eH=g("202");function eR(e,t){return!t&&(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function ez(){var e=eR(["\n overflow: auto;\n position: absolute;\n bottom: -8px;\n max-width: 100%;\n scrollbarWidth: thin;\n height: 1.2rem;\n &::-webkit-scrollbar: { width: 8, height: 8 };\n &::-webkit-scrollbar-corner: { background: transparent };\n &::-webkit-scrollbar-track: { background: var(--colorBgScrollTrack) };\n &::-webkit-scrollbar-thumb: {\n background: var(--colorBgScrollBar);\n borderRadius: 4;\n };\n &::-webkit-scrollbar-thumb:hover: {\n background: var(--colorBgScrollBarHover);\n };\n &::-webkit-scrollbar-thumb:active: {\n background: var(--colorBgScrollBarActive)\n }\n "]);return ez=function(){return e},e}function eW(){var e=eR(["\n padding: 12px;\n background-color: ",";\n background-clip: padding-box;\n border-radius: ",";\n box-shadow: ",";\n b: {\n display: block;\n margin-bottom: ",";\n }\n .tooltipdefaultcontainerparagraph: {\n font-size: ",";\n margin-bottom: "," + ",";\n color: ",";\n }\n "]);return eW=function(){return e},e}function eL(){var e=eR(["\n position: absolute;\n display: flex;\n flexshrink: 0;\n pointerevents: none;\n webkittouchcallout: none;\n webkituserselect: none;\n mozuserselect: none;\n msuserselect: none;\n userselect: none;\n "]);return eL=function(){return e},e}function eq(){var e=eR(["\n visibility: hidden;\n position: absolute;\n display: flex;\n pointerevents: none;\n "]);return eq=function(){return e},e}function eG(){var e=eR(["\n .horizontalScroll: {\n height: 1\n }\n \n .verticalScroll: {\n overflow: hidden auto;\n width: 1rem;\n flexShrink: 0;\n scrollbarWidth: thin;\n &::-webkit-scrollbar: { width: 8, height: 8 };\n &::-webkit-scrollbar-corner: { background: transparent};\n &::-webkit-scrollbar-track: { background: var(--colorBgScrollTrack) };\n &::-webkit-scrollbar-thumb: {\n background: var(--colorBgScrollBar);\n borderRadius: 4;\n }\n &::-webkit-scrollbar-thumb:hover': {\n background: var(--colorBgScrollBarHover)\n }\n &::-webkit-scrollbar-thumb:active': {\n background: var(--colorBgScrollBarActive)\n },\n }\n }\n "]);return eG=function(){return e},e}var eY=(0,eH.createStyles)(function(e){var t=e.token,r=e.css;return{scrollWrapper:r(ez()),tooltipDefaultContainer:r(eW(),t.colorBgElevated,t.borderRadius,t.boxShadow,t.marginXS,t.fontSizeSM,t.marginXXS,t.marginXS-t.marginXXS,t.colorText),tooltipDetailsContainer:r(eL()),tooltipDetailsContainerHidden:r(eq()),nbGridOther:r(eG())}}),eX=function(e){var t=e.scroll,r=e.svgWidth,n=e.taskListWidth,o=e.rtl,a=e.onScroll,i=eY().styles,l=(0,x.useRef)(null);return(0,x.useEffect)(function(){l.current&&(l.current.scrollLeft=t)},[t]),S().createElement("div",{dir:"ltr",style:{margin:o?"0px ".concat(n,"px 0px 0px"):"0px 0px 0px ".concat(n,"px")},className:(0,J.cx)(i.nbGridOther,i.scrollWrapper,"gantt-horizontal-scoll"),onScroll:a,ref:l},S().createElement("div",{style:{width:r,height:1},className:"horizontalScroll"}))};function eU(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function e_(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(r=o.next()).done)&&(a.push(r.value),!t||a.length!==t);i=!0);}catch(e){l=!0,n=e}finally{try{!i&&null!=o.return&&o.return()}finally{if(l)throw n}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return eU(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return eU(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var eV=function(e){var t=e.task,r=e.rowHeight,n=e.rtl,o=e.svgContainerHeight,a=e.svgContainerWidth,i=e.scrollX,l=e.scrollY,c=e.arrowIndent,s=e.fontSize,u=e.fontFamily,d=e.headerHeight,f=e.taskListWidth,p=e.TooltipContent,h=eY().styles,m=(0,x.useRef)(null),v=e_((0,x.useState)(0),2),g=v[0],b=v[1],y=e_((0,x.useState)(0),2),w=y[0],k=y[1];return(0,x.useEffect)(function(){if(m.current){var e,s=1.1*m.current.offsetHeight,u=1.1*m.current.offsetWidth,p=t.index*r-l+d;n?((e=t.x1-1.5*c-u-i)<0&&(e=t.x2+1.5*c-i),u+e>a&&(e=a-u,p+=r)):(u+(e=t.x2+1.5*c+f-i)>f+a&&(e=t.x1+f-1.5*c-i-u),e<f&&(e=a+f-u,p+=r)),s+p-l>o-l&&(p=o-s),b(p),k(e)}},[m,t,c,i,l,d,f,r,o,a,n]),S().createElement("div",{ref:m,className:(0,J.cx)(w?h.tooltipDetailsContainer:h.tooltipDetailsContainerHidden,h.nbGridOther),style:{left:w,top:g}},S().createElement(p,{task:t,fontSize:s,fontFamily:u}))},eQ=function(e){var t,r,n,o,a,i,l,c,s=e.task,u=e.fontSize,d=e.fontFamily,f=eY().styles;return S().createElement("div",{className:(0,J.cx)(f.nbGridOther,f.tooltipDefaultContainer),"aria-label":"nb-gantt-tooltip",style:{fontSize:u,fontFamily:d}},S().createElement("b",{style:{fontSize:u}},s.name,": ",eB(s.start)," ~ ",eB(s.end)),(null===(r=s.end)||void 0===r?void 0:null===(t=r.getTime)||void 0===t?void 0:t.call(r))-(null===(o=s.start)||void 0===o?void 0:null===(n=o.getTime)||void 0===n?void 0:n.call(o))!=0&&S().createElement("p",{className:"tooltipDefaultContainerParagraph"},"Duration: ".concat(Math.round(((null===(i=s.end)||void 0===i?void 0:null===(a=i.getTime)||void 0===a?void 0:a.call(i))-(null===(c=s.start)||void 0===c?void 0:null===(l=c.getTime)||void 0===l?void 0:l.call(c)))/864e5*10)/10||""," day(s)")),S().createElement("p",{className:"tooltipDefaultContainerParagraph"},!!s.progress&&"Progress: ".concat(s.progress,"%")))},e$=function(e){var t=e.scroll,r=e.ganttHeight,n=e.ganttFullHeight,o=e.headerHeight,a=e.rtl,i=e.onScroll,l=eY().styles,c=(0,x.useRef)(null);return(0,x.useEffect)(function(){c.current&&(c.current.scrollTop=t)},[t]),S().createElement("div",{style:{maxHeight:r,marginTop:o,marginLeft:a?"":"-1rem"},className:(0,J.cx)(l.nbGridOther,"verticalScroll"),onScroll:i,ref:c},S().createElement("div",{style:{height:n,width:1}}))},eK=function(e){var t=(0,w.useFieldSchema)().properties.detail;return t?S().createElement(y.NocoBaseRecursionField,{schema:t,name:t.name}):null};function eJ(e,t){return!t&&(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function eZ(){var e=eJ(["\n overflow: hidden;\n font-size: 0;\n margin: 0;\n padding: 0;\n width: 100%;\n border-left: 2px solid ",";\n overflow-x: auto;\n .ganttheader: {\n border-bottom: 1px solid ",";\n font-weight: 700;\n }\n .ganttbody: {\n border-bottom: 1px solid ",";\n }\n "]);return eZ=function(){return e},e}function e0(){var e=eJ(["\n margin: 0;\n padding: 0;\n overflow: hidden;\n margin-bottom: -5px;\n "]);return e0=function(){return e},e}function e1(){var e=eJ(["\n display: flex;\n padding: 0;\n margin: 0;\n liststyle: none;\n outline: none;\n position: relative;\n .gantt-horizontal-scoll: {\n display: none;\n }\n &:hover: {\n .gantt-horizontal-scoll: {\n display: block;\n }\n }\n "]);return e1=function(){return e},e}var e2=(0,y.createStyles)(function(e){var t=e.token,r=e.css;return{ganttverticalcontainer:r(eZ(),t.colorBorderSecondary,t.colorBorderSecondary,t.colorBorderSecondary),horizontalcontainer:r(e0()),wrapper:r(e1())}});function e5(e,t){(function(e){return"string"==typeof e&&-1!==e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var r=function(e){return"string"==typeof e&&-1!==e.indexOf("%")}(e);return(e=360===t?e:Math.min(t,Math.max(0,parseFloat(e))),r&&(e=parseInt(String(e*t),10)/100),1e-6>Math.abs(e-t))?1:e=360===t?(e<0?e%t+t:e%t)/parseFloat(String(t)):e%t/parseFloat(String(t))}function e6(e){return Math.min(1,Math.max(0,e))}function e8(e){return(isNaN(e=parseFloat(e))||e<0||e>1)&&(e=1),e}function e3(e){return e<=1?"".concat(100*Number(e),"%"):e}function e4(e){return 1===e.length?"0"+e:String(e)}function e9(e,t,r){e=e5(e,255),t=e5(t,255);var n=Math.max(e,t,r=e5(r,255)),o=Math.min(e,t,r),a=0,i=0,l=(n+o)/2;if(n===o)i=0,a=0;else{var c=n-o;switch(i=l>.5?c/(2-n-o):c/(n+o),n){case e:a=(t-r)/c+(t<r?6:0);break;case t:a=(r-e)/c+2;break;case r:a=(e-t)/c+4}a/=6}return{h:a,s:i,l:l}}function e7(e,t,r){return(r<0&&(r+=1),r>1&&(r-=1),r<1/6)?e+6*r*(t-e):r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function te(e,t,r){e=e5(e,255),t=e5(t,255);var n=Math.max(e,t,r=e5(r,255)),o=Math.min(e,t,r),a=0,i=n-o;if(n===o)a=0;else{switch(n){case e:a=(t-r)/i+(t<r?6:0);break;case t:a=(r-e)/i+2;break;case r:a=(e-t)/i+4}a/=6}return{h:a,s:0===n?0:i/n,v:n}}function tt(e,t,r,n){var o=[e4(Math.round(e).toString(16)),e4(Math.round(t).toString(16)),e4(Math.round(r).toString(16))];return n&&o[0].startsWith(o[0].charAt(1))&&o[1].startsWith(o[1].charAt(1))&&o[2].startsWith(o[2].charAt(1))?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0):o.join("")}function tr(e){return tn(e)/255}function tn(e){return parseInt(e,16)}var to={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},ta="(?:".concat("[-\\+]?\\d*\\.\\d+%?",")|(?:").concat("[-\\+]?\\d+%?",")"),ti="[\\s|\\(]+(".concat(ta,")[,|\\s]+(").concat(ta,")[,|\\s]+(").concat(ta,")\\s*\\)?"),tl="[\\s|\\(]+(".concat(ta,")[,|\\s]+(").concat(ta,")[,|\\s]+(").concat(ta,")[,|\\s]+(").concat(ta,")\\s*\\)?"),tc={CSS_UNIT:new RegExp(ta),rgb:RegExp("rgb"+ti),rgba:RegExp("rgba"+tl),hsl:RegExp("hsl"+ti),hsla:RegExp("hsla"+tl),hsv:RegExp("hsv"+ti),hsva:RegExp("hsva"+tl),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function ts(e){return!!tc.CSS_UNIT.exec(String(e))}var tu=function(){function e(t,r){if(void 0===t&&(t=""),void 0===r&&(r={}),t instanceof e)return t;if("number"==typeof t){var n;t={r:(n=t)>>16,g:(65280&n)>>8,b:255&n}}this.originalInput=t;var o,a=function(e){var t,r,n,o,a,i,l,c,s,u,d,f,p={r:0,g:0,b:0},h=1,m=null,v=null,g=null,b=!1,y=!1;if("string"==typeof e&&(e=function(e){if(0===(e=e.trim().toLowerCase()).length)return!1;var t=!1;if(to[e])e=to[e],t=!0;else if("transparent"===e)return{r:0,g:0,b:0,a:0,format:"name"};var r=tc.rgb.exec(e);if(r)return{r:r[1],g:r[2],b:r[3]};if(r=tc.rgba.exec(e))return{r:r[1],g:r[2],b:r[3],a:r[4]};if(r=tc.hsl.exec(e))return{h:r[1],s:r[2],l:r[3]};if(r=tc.hsla.exec(e))return{h:r[1],s:r[2],l:r[3],a:r[4]};if(r=tc.hsv.exec(e))return{h:r[1],s:r[2],v:r[3]};if(r=tc.hsva.exec(e))return{h:r[1],s:r[2],v:r[3],a:r[4]};if(r=tc.hex8.exec(e))return{r:tn(r[1]),g:tn(r[2]),b:tn(r[3]),a:tn(r[4])/255,format:t?"name":"hex8"};if(r=tc.hex6.exec(e))return{r:tn(r[1]),g:tn(r[2]),b:tn(r[3]),format:t?"name":"hex"};if(r=tc.hex4.exec(e))return{r:tn(r[1]+r[1]),g:tn(r[2]+r[2]),b:tn(r[3]+r[3]),a:tn(r[4]+r[4])/255,format:t?"name":"hex8"};return!!(r=tc.hex3.exec(e))&&{r:tn(r[1]+r[1]),g:tn(r[2]+r[2]),b:tn(r[3]+r[3]),format:t?"name":"hex"}}(e)),"object"==typeof e){;if(ts(e.r)&&ts(e.g)&&ts(e.b)){;t=e.r,r=e.g,n=e.b,p={r:255*e5(t,255),g:255*e5(r,255),b:255*e5(n,255)},b=!0,y="%"===String(e.r).substr(-1)?"prgb":"rgb"}else if(ts(e.h)&&ts(e.s)&&ts(e.v)){;m=e3(e.s),v=e3(e.v),o=e.h,a=m,i=v,o=6*e5(o,360),a=e5(a,100),i=e5(i,100),l=Math.floor(o),c=o-l,s=i*(1-a),u=i*(1-c*a),d=i*(1-(1-c)*a),p={r:255*[i,u,s,s,d,i][f=l%6],g:255*[d,i,i,u,s,s][f],b:255*[s,s,d,i,i,u][f]},b=!0,y="hsv"}else ts(e.h)&&ts(e.s)&&ts(e.l)&&(m=e3(e.s),g=e3(e.l),p=function(e,t,r){if(e=e5(e,360),t=e5(t,100),r=e5(r,100),0===t)o=r,a=r,n=r;else{var n,o,a,i=r<.5?r*(1+t):r+t-r*t,l=2*r-i;n=e7(l,i,e+1/3),o=e7(l,i,e),a=e7(l,i,e-1/3)}return{r:255*n,g:255*o,b:255*a}}(e.h,m,g),b=!0,y="hsl");Object.prototype.hasOwnProperty.call(e,"a")&&(h=e.a)}return h=e8(h),{ok:b,format:e.format||y,r:Math.min(255,Math.max(p.r,0)),g:Math.min(255,Math.max(p.g,0)),b:Math.min(255,Math.max(p.b,0)),a:h}}(t);this.originalInput=t,this.r=a.r,this.g=a.g,this.b=a.b,this.a=a.a,this.roundA=Math.round(100*this.a)/100,this.format=null!==(o=r.format)&&void 0!==o?o:a.format,this.gradientType=r.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=a.ok}return e.prototype.isDark=function(){return 128>this.getBrightness()},e.prototype.isLight=function(){return!this.isDark()},e.prototype.getBrightness=function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},e.prototype.getLuminance=function(){var e,t,r,n=this.toRgb(),o=n.r/255,a=n.g/255,i=n.b/255;return .2126*(e=o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4))+.7152*(t=a<=.03928?a/12.92:Math.pow((a+.055)/1.055,2.4))+.0722*(r=i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4))},e.prototype.getAlpha=function(){return this.a},e.prototype.setAlpha=function(e){return this.a=e8(e),this.roundA=Math.round(100*this.a)/100,this},e.prototype.isMonochrome=function(){return 0===this.toHsl().s},e.prototype.toHsv=function(){var e=te(this.r,this.g,this.b);return{h:360*e.h,s:e.s,v:e.v,a:this.a}},e.prototype.toHsvString=function(){var e=te(this.r,this.g,this.b),t=Math.round(360*e.h),r=Math.round(100*e.s),n=Math.round(100*e.v);return 1===this.a?"hsv(".concat(t,", ").concat(r,"%, ").concat(n,"%)"):"hsva(".concat(t,", ").concat(r,"%, ").concat(n,"%, ").concat(this.roundA,")")},e.prototype.toHsl=function(){var e=e9(this.r,this.g,this.b);return{h:360*e.h,s:e.s,l:e.l,a:this.a}},e.prototype.toHslString=function(){var e=e9(this.r,this.g,this.b),t=Math.round(360*e.h),r=Math.round(100*e.s),n=Math.round(100*e.l);return 1===this.a?"hsl(".concat(t,", ").concat(r,"%, ").concat(n,"%)"):"hsla(".concat(t,", ").concat(r,"%, ").concat(n,"%, ").concat(this.roundA,")")},e.prototype.toHex=function(e){return void 0===e&&(e=!1),tt(this.r,this.g,this.b,e)},e.prototype.toHexString=function(e){return void 0===e&&(e=!1),"#"+this.toHex(e)},e.prototype.toHex8=function(e){var t,r,n,o,a,i;return void 0===e&&(e=!1),t=this.r,r=this.g,n=this.b,o=this.a,a=e,i=[e4(Math.round(t).toString(16)),e4(Math.round(r).toString(16)),e4(Math.round(n).toString(16)),e4(function(e){return Math.round(255*parseFloat(e)).toString(16)}(o))],a&&i[0].startsWith(i[0].charAt(1))&&i[1].startsWith(i[1].charAt(1))&&i[2].startsWith(i[2].charAt(1))&&i[3].startsWith(i[3].charAt(1))?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0)+i[3].charAt(0):i.join("")},e.prototype.toHex8String=function(e){return void 0===e&&(e=!1),"#"+this.toHex8(e)},e.prototype.toHexShortString=function(e){return void 0===e&&(e=!1),1===this.a?this.toHexString(e):this.toHex8String(e)},e.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},e.prototype.toRgbString=function(){var e=Math.round(this.r),t=Math.round(this.g),r=Math.round(this.b);return 1===this.a?"rgb(".concat(e,", ").concat(t,", ").concat(r,")"):"rgba(".concat(e,", ").concat(t,", ").concat(r,", ").concat(this.roundA,")")},e.prototype.toPercentageRgb=function(){var e=function(e){return"".concat(Math.round(100*e5(e,255)),"%")};return{r:e(this.r),g:e(this.g),b:e(this.b),a:this.a}},e.prototype.toPercentageRgbString=function(){var e=function(e){return Math.round(100*e5(e,255))};return 1===this.a?"rgb(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%)"):"rgba(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%, ").concat(this.roundA,")")},e.prototype.toName=function(){if(0===this.a)return"transparent";if(this.a<1)return!1;for(var e="#"+tt(this.r,this.g,this.b,!1),t=0,r=Object.entries(to);t<r.length;t++){var n=r[t],o=n[0];if(e===n[1])return o}return!1},e.prototype.toString=function(e){var t=!!e;e=null!=e?e:this.format;var r=!1,n=this.a<1&&this.a>=0;if(!t&&n&&(e.startsWith("hex")||"name"===e))return"name"===e&&0===this.a?this.toName():this.toRgbString();return"rgb"===e&&(r=this.toRgbString()),"prgb"===e&&(r=this.toPercentageRgbString()),("hex"===e||"hex6"===e)&&(r=this.toHexString()),"hex3"===e&&(r=this.toHexString(!0)),"hex4"===e&&(r=this.toHex8String(!0)),"hex8"===e&&(r=this.toHex8String()),"name"===e&&(r=this.toName()),"hsl"===e&&(r=this.toHslString()),"hsv"===e&&(r=this.toHsvString()),r||this.toHexString()},e.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},e.prototype.clone=function(){return new e(this.toString())},e.prototype.lighten=function(t){void 0===t&&(t=10);var r=this.toHsl();return r.l+=t/100,r.l=e6(r.l),new e(r)},e.prototype.brighten=function(t){void 0===t&&(t=10);var r=this.toRgb();return r.r=Math.max(0,Math.min(255,r.r-Math.round(-(t/100*255)))),r.g=Math.max(0,Math.min(255,r.g-Math.round(-(t/100*255)))),r.b=Math.max(0,Math.min(255,r.b-Math.round(-(t/100*255)))),new e(r)},e.prototype.darken=function(t){void 0===t&&(t=10);var r=this.toHsl();return r.l-=t/100,r.l=e6(r.l),new e(r)},e.prototype.tint=function(e){return void 0===e&&(e=10),this.mix("white",e)},e.prototype.shade=function(e){return void 0===e&&(e=10),this.mix("black",e)},e.prototype.desaturate=function(t){void 0===t&&(t=10);var r=this.toHsl();return r.s-=t/100,r.s=e6(r.s),new e(r)},e.prototype.saturate=function(t){void 0===t&&(t=10);var r=this.toHsl();return r.s+=t/100,r.s=e6(r.s),new e(r)},e.prototype.greyscale=function(){return this.desaturate(100)},e.prototype.spin=function(t){var r=this.toHsl(),n=(r.h+t)%360;return r.h=n<0?360+n:n,new e(r)},e.prototype.mix=function(t,r){void 0===r&&(r=50);var n=this.toRgb(),o=new e(t).toRgb(),a=r/100;return new e({r:(o.r-n.r)*a+n.r,g:(o.g-n.g)*a+n.g,b:(o.b-n.b)*a+n.b,a:(o.a-n.a)*a+n.a})},e.prototype.analogous=function(t,r){void 0===t&&(t=6),void 0===r&&(r=30);var n=this.toHsl(),o=360/r,a=[this];for(n.h=(n.h-(o*t>>1)+720)%360;--t;)n.h=(n.h+o)%360,a.push(new e(n));return a},e.prototype.complement=function(){var t=this.toHsl();return t.h=(t.h+180)%360,new e(t)},e.prototype.monochromatic=function(t){void 0===t&&(t=6);for(var r=this.toHsv(),n=r.h,o=r.s,a=r.v,i=[],l=1/t;t--;)i.push(new e({h:n,s:o,v:a})),a=(a+l)%1;return i},e.prototype.splitcomplement=function(){var t=this.toHsl(),r=t.h;return[this,new e({h:(r+72)%360,s:t.s,l:t.l}),new e({h:(r+216)%360,s:t.s,l:t.l})]},e.prototype.onBackground=function(t){var r=this.toRgb(),n=new e(t).toRgb(),o=r.a+n.a*(1-r.a);return new e({r:(r.r*r.a+n.r*n.a*(1-r.a))/o,g:(r.g*r.a+n.g*n.a*(1-r.a))/o,b:(r.b*r.a+n.b*n.a*(1-r.a))/o,a:o})},e.prototype.triad=function(){return this.polyad(3)},e.prototype.tetrad=function(){return this.polyad(4)},e.prototype.polyad=function(t){for(var r=this.toHsl(),n=r.h,o=[this],a=360/t,i=1;i<t;i++)o.push(new e({h:(n+i*a)%360,s:r.s,l:r.l}));return o},e.prototype.equals=function(t){return this.toRgbString()===new e(t).toRgbString()},e}();function td(e,t){return!t&&(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function tf(){var e=td(["\n color: ",";\n fill: ",";\n stroke-width: 1.4;\n background: ",";\n border-bottom: 1px solid ",";\n "]);return tf=function(){return e},e}function tp(){var e=td(["\n .calendarbottomtext: {\n textanchor: middle;\n fill: ",";\n webkittouchcallout: none;\n webkituserselect: none;\n mozuserselect: none;\n msuserselect: none;\n userselect: none;\n pointerevents: none;\n font-weight: 500;\n }\n .calendartoptick: {\n stroke: ",";\n stroke-width: 0;\n }\n .calendartoptext: {\n textanchor: middle;\n webkittouchcallout: none;\n webkituserselect: none;\n mozuserselect: none;\n msuserselect: none;\n userselect: none;\n pointerevents: none;\n font-weight: 500;\n fill: ",";\n }\n "]);return tp=function(){return e},e}var th=(0,eH.createStyles)(function(e){var t=e.token,r=e.css,n=new tu(t.colorFillAlter).onBackground(t.colorBgContainer).toHexShortString();return{calendarheader:r(tf(),t.colorText,n,n,t.colorBorderSecondary),nbGanttCalendar:r(tp(),t.colorText,t.colorBorderSecondary,t.colorText)}}),tm=function(e){var t=e.value,r=e.x1Line,n=e.y1Line,o=e.y2Line,a=e.xText,i=e.yText;return S().createElement("g",{className:"calendarTop"},S().createElement("line",{x1:r,y1:n,x2:r,y2:o,className:(0,J.cx)("calendarTopTick"),key:t+"line"}),S().createElement("text",{key:t+"text",y:i,x:a,className:(0,J.cx)("calendarTopText")},t))};function tv(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function tg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(r=o.next()).done)&&(a.push(r.value),!t||a.length!==t);i=!0);}catch(e){l=!0,n=e}finally{try{!i&&null!=o.return&&o.return()}finally{if(l)throw n}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return tv(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return tv(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var tb=function(e){var t,r,n,o,a,i,l,c=e.dateSetup,s=e.locale,u=e.viewMode,d=e.rtl,f=e.headerHeight,p=e.columnWidth,h=e.fontFamily,m=e.fontSize,v=th().styles,g=[],b=[];switch(c.viewMode){case ek.Year:g=(t=tg(function(){for(var e=[],t=[],r=.5*f,n=0;n<c.dates.length;n++){var o=c.dates[n],a=o.getFullYear();if(t.push(S().createElement("text",{key:o.getTime(),y:.8*f,x:p*n+.5*p,className:(0,J.cx)("calendarBottomText")},a)),0===n||o.getFullYear()!==c.dates[n-1].getFullYear()){var i=o.getFullYear().toString(),l=void 0;l=d?(6+n+o.getFullYear()+1)*p:(6+n-o.getFullYear())*p,e.push(S().createElement(tm,{key:i,value:i,x1Line:p*n,y1Line:0,y2Line:f,xText:l,yText:.9*r}))}}return[e,t]}(),2))[0],b=t[1];break;case ek.QuarterYear:g=(r=tg(function(){for(var e=[],t=[],r=.5*f,n=0;n<c.dates.length;n++){var o=c.dates[n],a="Q"+Math.floor((o.getMonth()+3)/3);if(t.push(S().createElement("text",{key:o.getTime(),y:.8*f,x:p*n+.5*p,className:(0,J.cx)("calendarBottomText")},a)),0===n||o.getFullYear()!==c.dates[n-1].getFullYear()){var i=o.getFullYear().toString(),l=void 0;l=d?(6+n+o.getMonth()+1)*p:(6+n-o.getMonth())*p,e.push(S().createElement(tm,{key:i,value:i,x1Line:p*n,y1Line:0,y2Line:r,xText:Math.abs(l),yText:.9*r}))}}return[e,t]}(),2))[0],b=r[1];break;case ek.Month:g=(n=tg(function(){for(var e=[],t=[],r=.5*f,n=0;n<c.dates.length;n++){var o=c.dates[n],a=eD(o,s);if(t.push(S().createElement("text",{key:a+o.getFullYear(),y:.8*f,x:p*n+.5*p,className:(0,J.cx)("calendarBottomText")},a)),0===n||o.getFullYear()!==c.dates[n-1].getFullYear()){var i=o.getFullYear().toString(),l=void 0;l=d?(6+n+o.getMonth()+1)*p:(6+n-o.getMonth())*p,e.push(S().createElement(tm,{key:i,value:i,x1Line:p*n,y1Line:0,y2Line:r,xText:l,yText:.9*r}))}}return[e,t]}(),2))[0],b=n[1];break;case ek.Week:g=(o=tg(function(){for(var e=[],t=[],r=1,n=.5*f,o=c.dates,a=o.length-1;a>=0;a--){var i=o[a],l="";(0===a||i.getMonth()!==o[a-1].getMonth())&&(l="".concat(eD(i,s),", ").concat(i.getFullYear()));var u="W".concat(eA(i));t.push(S().createElement("text",{key:i.getTime(),y:.8*f,x:p*(a+ +d),className:(0,J.cx)("calendarBottomText")},u)),l&&(a!==o.length-1&&e.push(S().createElement(tm,{key:l,value:l,x1Line:p*a+r*p,y1Line:0,y2Line:n,xText:p*a+p*r*.5,yText:.9*n})),r=0),r++}return[e,t]}(),2))[0],b=o[1];break;case ek.Day:g=(a=tg(function(){for(var e=[],t=[],r=.5*f,n=c.dates,o=0;o<n.length;o++){var a=n[o],i="".concat(a.getDate().toString());if(t.push(S().createElement("text",{key:a.getTime(),y:.8*f,x:p*o+.5*p,className:(0,J.cx)("calendarBottomText")},i)),o+1!==n.length&&a.getMonth()!==n[o+1].getMonth()){var l,u=eD(a,s);e.push(S().createElement(tm,{key:u+a.getFullYear(),value:u,x1Line:p*(o+1),y1Line:0,y2Line:r,xText:p*(o+1)-(l=a.getMonth(),new Date(a.getFullYear(),l+1,0).getDate()*p*.5),yText:.9*r}))}}return[e,t]}(),2))[0],b=a[1];break;case ek.QuarterDay:case ek.HalfDay:g=(i=tg(function(){for(var e=[],t=[],r=u===ek.HalfDay?2:4,n=.5*f,o=c.dates,a=0;a<o.length;a++){var i=o[a],l=eO(s,{hour:"numeric"}).format(i).replace("时","");if(t.push(S().createElement("text",{key:i.getTime(),y:.8*f,x:p*(a+ +d),className:(0,J.cx)("calendarBottomText"),fontFamily:h},l)),0===a||i.getDate()!==o[a-1].getDate()){var m="".concat(eM(i,s,"short"),", ").concat(i.getDate()," ").concat(eD(i,s));e.push(S().createElement(tm,{key:m+i.getFullYear(),value:m,x1Line:p*a+r*p,y1Line:0,y2Line:n,xText:p*a+r*p*.5,yText:.9*n}))}}return[e,t]}(),2))[0],b=i[1];break;case ek.Hour:g=(l=tg(function(){for(var e=[],t=[],r=.5*f,n=c.dates,o=0;o<n.length;o++){var a,i=n[o],l=null===(a=eO(s,{hour:"numeric"}).format(i))||void 0===a?void 0:a.replace("时","");if(t.push(S().createElement("text",{key:i.getTime(),y:.8*f,x:p*(o+ +d),className:(0,J.cx)("calendarBottomText"),fontFamily:h},l)),0!==o&&i.getDate()!==n[o-1].getDate()){var u=n[o-1],m="".concat(eM(u,s,"long"),", ").concat(u.getDate()," ").concat(eD(u,s)),v=(i.getHours()-24)/2;e.push(S().createElement(tm,{key:m+u.getFullYear(),value:m,x1Line:p*o,y1Line:0,y2Line:r,xText:p*(o+v),yText:.9*r}))}}return[e,t]}(),2))[0],b=l[1]}return S().createElement("g",{className:v.nbGanttCalendar,fontSize:m,fontFamily:h},S().createElement("rect",{x:0,y:0,width:p*c.dates.length,height:f,className:v.calendarheader}),b," ",g)},ty=g("584");function tx(e,t){return!t&&(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function tS(){var e=tx(["\n fill: ",";\n "]);return tS=function(){return e},e}function tw(){var e=tx(["\n fill: #e6f7ff;\n border-color: ",";\n "]);return tw=function(){return e},e}function tk(){var e=tx(["\n .gridrowline: {\n stroke: ",";\n stroke-width: 0;\n border-bottom: 1px solid ",";\n }\n .gridtick: {\n stroke: ",";\n }\n "]);return tk=function(){return e},e}var tC=(0,eH.createStyles)(function(e){var t=e.token,r=e.css;return{gridRow:r(tS(),t.colorBgContainer),gridHeightRow:r(tw(),t.colorBorder),nbGridbody:r(tk(),t.colorBorderSecondary,t.colorBorderSecondary,t.colorBorderSecondary)}}),tO=[{id:(0,ty.uid)()},{id:(0,ty.uid)()},{id:(0,ty.uid)()}],tP=function(e){var t=e.tasks,r=e.dates,n=e.rowHeight,o=e.svgWidth,a=e.columnWidth,i=e.todayColor,l=e.rtl,c=e.selectedRowKeys,s=tC().styles,u=t.length?t:tO,d=0,f=[],p=[S().createElement("line",{key:"RowLineFirst",x:"0",y1:0,x2:o,y2:0,className:(0,J.cx)("gridRowLine")})],h=!0,m=!1,v=void 0;try{for(var g,b=u[Symbol.iterator]();!(h=(g=b.next()).done);h=!0){var y=g.value;f.push(S().createElement("rect",{key:"Row"+y.id,x:"0",y:d,width:o,height:n,className:(null==c?void 0:c.includes(+y.id))?s.gridHeightRow:s.gridRow})),p.push(S().createElement("line",{key:"RowLine"+y.id,x:"0",y1:d+n,x2:o,y2:d+n,className:(0,J.cx)("gridRowLine")})),d+=n}}catch(e){m=!0,v=e}finally{try{!h&&null!=b.return&&b.return()}finally{if(m)throw v}}for(var x=new Date,w=0,k=[],C=S().createElement("rect",null),O=0;O<r.length;O++){var P=r[O];k.push(S().createElement("line",{key:P.getTime(),x1:w,y1:0,x2:w,y2:d,className:(0,J.cx)("gridTick")})),(O+1!==r.length&&P.getTime()<x.getTime()&&r[O+1].getTime()>=x.getTime()||0!==O&&O+1===r.length&&P.getTime()<x.getTime()&&eP(P,P.getTime()-r[O-1].getTime(),"millisecond").getTime()>=x.getTime())&&(C=S().createElement("rect",{x:w,y:0,width:a,height:d,fill:i})),l&&O+1!==r.length&&P.getTime()>=x.getTime()&&r[O+1].getTime()<x.getTime()&&(C=S().createElement("rect",{x:w+a,y:0,width:a,height:d,fill:i})),w+=a}return S().createElement("g",{className:(0,J.cx)("gridBody",s.nbGridbody)},S().createElement("g",{className:"rows"},f),S().createElement("g",{className:"rowLines"},p),S().createElement("g",{className:"ticks"},k),S().createElement("g",{className:"today"},C))},tE=function(e){return S().createElement("g",{className:"grid"},S().createElement(tP,e))};function tT(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function tj(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(r=o.next()).done)&&(a.push(r.value),!t||a.length!==t);i=!0);}catch(e){l=!0,n=e}finally{try{!i&&null!=o.return&&o.return()}finally{if(l)throw n}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return tT(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return tT(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var tD=function(e){var t,r,n,o,a=e.taskFrom,i=e.taskTo,l=e.rowHeight,c=e.taskHeight,s=e.arrowIndent;return e.rtl?(t=(n=tj(tN(a,i,l,c,s),2))[0],r=n[1]):(t=(o=tj(tM(a,i,l,c,s),2))[0],r=o[1]),S().createElement("g",{className:"arrow"},S().createElement("path",{strokeWidth:"1.5",d:t,fill:"none"}),S().createElement("polygon",{points:r}))},tM=function(e,t,r,n,o){var a=e.index>t.index?-1:1,i=t.y+n/2,l=e.x2+2*o,c=l<t.x1?"":"H ".concat(t.x1-o),s=l>t.x1?o:t.x1-e.x2-o;return["M ".concat(e.x2," ").concat(e.y+n/2," \n h ").concat(o," \n v ").concat(a*r/2," \n ").concat(c,"\n V ").concat(i," \n h ").concat(s),"".concat(t.x1,",").concat(i," \n ").concat(t.x1-5,",").concat(i-5," \n ").concat(t.x1-5,",").concat(i+5)]},tN=function(e,t,r,n,o){var a=e.index>t.index?-1:1,i=t.y+n/2,l=e.x1-2*o,c=l>t.x2?"":"H ".concat(t.x2+o),s=l<t.x2?-o:t.x2-e.x1+o;return["M ".concat(e.x1," ").concat(e.y+n/2," \n h ").concat(-o," \n v ").concat(a*r/2," \n ").concat(c,"\n V ").concat(i," \n h ").concat(s),"".concat(t.x2,",").concat(i," \n ").concat(t.x2+5,",").concat(i+5," \n ").concat(t.x2+5,",").concat(i-5)]},tA=function(e){var t=e.x,r=e.y,n=e.width,o=e.height,a=e.barCornerRadius,i=e.onMouseDown;return S().createElement("rect",{x:t,y:r,width:n,height:o,className:"barHandle",role:"button",ry:a,rx:a,onMouseDown:i})};function tF(e,t){return!t&&(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function tI(){var e=tF(["\n cursor: pointer;\n outline: none;\n .barHandle {\n fill: #ddd;\n cursor: ew-resize;\n opacity: 0;\n // visibility: hidden;\n }\n &:hover .barHandle {\n visibility: visible;\n opacity: 1;\n }\n"]);return tI=function(){return e},e}function tB(){var e=tF(["\n user-select: none;\n stroke-width: 0;\n opacity: 0.6;\n"]);return tB=function(){return e},e}var tH=(0,J.css)(tI()),tR=(0,J.css)(tB()),tz=function(e){var t=e.x,r=e.y,n=e.color,o=e.width,a=e.height,i=e.isSelected,l=e.progressX,c=e.progressWidth,s=e.barCornerRadius,u=e.styles,d=e.onMouseDown;return S().createElement("g",{onMouseDown:d},S().createElement("rect",{x:t,width:o,y:r,height:a,ry:s,rx:s,fill:n?n:i?u.backgroundSelectedColor:u.backgroundColor,className:(0,J.cx)(tR)}),S().createElement("rect",{x:l,width:c,y:r,height:a,ry:s,rx:s,fill:n?n:i?u.progressSelectedColor:u.progressColor}))},tW=function(e){var t=e.progressPoint,r=e.onMouseDown;return S().createElement("polygon",{className:"barHandle",points:t,onMouseDown:r})},tL=function(e){var t=e.task,r=e.isProgressChangeable,n=e.isDateChangeable,o=e.rtl,a=e.onEventStart,i=e.isSelected,l=em(+!o*t.progressWidth+t.progressX,t.y,t.height),c=t.height-2;return S().createElement("g",{className:(0,J.cx)(tH),"aria-label":"task-bar",tabIndex:0},S().createElement(tz,{x:t.x1,y:t.y,color:t.color,width:t.x2-t.x1,height:t.height,progressX:t.progressX,progressWidth:t.progressWidth,barCornerRadius:t.barCornerRadius,styles:t.styles,isSelected:i,onMouseDown:function(e){n&&a("move",t,e)}}),S().createElement("g",{className:"handleGroup"},n&&S().createElement("g",null,S().createElement(tA,{x:t.x1+1,y:t.y+1,width:t.handleWidth,height:c,barCornerRadius:t.barCornerRadius,onMouseDown:function(e){a("start",t,e)}}),S().createElement(tA,{x:t.x2-t.handleWidth-1,y:t.y+1,width:t.handleWidth,height:c,barCornerRadius:t.barCornerRadius,onMouseDown:function(e){a("end",t,e)}})),r&&S().createElement(tW,{progressPoint:l,onMouseDown:function(e){a("progress",t,e)}})))},tq=function(e){var t=e.task,r=e.isProgressChangeable,n=e.isDateChangeable,o=e.onEventStart,a=e.isSelected,i=em(t.progressWidth+t.x1+10,t.y,t.height);return S().createElement("g",{className:(0,J.cx)(tH),tabIndex:0},S().createElement(tz,{x:t.x1,y:t.y,width:t.x2-t.x1,height:t.height,progressX:t.progressX,progressWidth:t.progressWidth,barCornerRadius:t.barCornerRadius,styles:t.styles,isSelected:a,onMouseDown:function(e){n&&o("move",t,e)}}),S().createElement("g",{className:"handleGroup"},r&&S().createElement(tW,{progressPoint:i,onMouseDown:function(e){o("progress",t,e)}})))};function tG(e,t){return!t&&(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function tY(){var e=tG(["\n cursor: pointer;\n outline: none;\n"]);return tY=function(){return e},e}function tX(){var e=tG(["\n user-select: none;\n"]);return tX=function(){return e},e}var tU=(0,J.css)(tY()),t_=(0,J.css)(tX()),tV=function(e){var t=e.task,r=e.isDateChangeable,n=e.onEventStart,o=e.isSelected,a="rotate(45 ".concat(t.x1+.356*t.height," \n ").concat(t.y+.85*t.height,")");return S().createElement("g",{tabIndex:0,className:(0,J.cx)(tU)},S().createElement("rect",{fill:o?t.styles.backgroundSelectedColor:t.styles.backgroundColor,x:t.x1,width:t.height,y:t.y,height:t.height,rx:t.barCornerRadius,ry:t.barCornerRadius,transform:a,className:(0,J.cx)(t_),onMouseDown:function(e){r&&n("move",t,e)}}))};function tQ(e,t){return!t&&(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function t$(){var e=tQ(["\n cursor: pointer;\n outline: none;\n"]);return t$=function(){return e},e}function tK(){var e=tQ(["\n user-select: none;\n opacity: 0.6;\n"]);return tK=function(){return e},e}function tJ(){var e=tQ(["\n user-select: none;\n"]);return tJ=function(){return e},e}var tZ=(0,J.css)(t$()),t0=(0,J.css)(tK());(0,J.css)(tJ());var t1=function(e){var t=e.task,r=e.isSelected,n=r?t.styles.backgroundSelectedColor:t.styles.backgroundColor,o=r?t.styles.progressSelectedColor:t.styles.progressColor,a=t.x2-t.x1;return S().createElement("g",{tabIndex:0,className:(0,J.cx)(tZ)},S().createElement("rect",{fill:t.color||n,x:t.x1,width:a,y:t.y,height:t.height,rx:t.barCornerRadius,ry:t.barCornerRadius,className:(0,J.cx)(t0)}),S().createElement("rect",{x:t.progressX,width:t.progressWidth,y:t.y,height:t.height,ry:t.barCornerRadius,rx:t.barCornerRadius,fill:t.color||o}))};function t2(){var e,t,r=(e=["\n .barLabel: {\n fill: ",",\n textAnchor: middle,\n font-weight: 400,\n dominantBaseline: central,\n WebkitTouchCallout: none,\n WebkitUserSelect: none,\n MozUserSelect: none,\n msUserSelect: none,\n userSelect: none,\n pointerEvents: none,\n },\n .projectLabel: {\n fill: #130d0d,\n fontWeight: 500,\n fontSize: 0.9em,\n dominantBaseline: central,\n WebkitTouchCallout: none,\n WebkitUserSelect: none,\n MozUserSelect: none,\n msUserSelect: none,\n userSelect: none,\n pointerEvents: none,\n },\n .barLabelOutside: {\n fill: ",",\n textAnchor: start,\n WebkitTouchCallout: none,\n WebkitUserSelect: none,\n MozUserSelect: none,\n msUserSelect: none,\n userSelect: none,\n pointerEvents: none,\n },\n }\n }"],!t&&(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return t2=function(){return r},r}var t5=(0,eH.createStyles)(function(e){var t=e.token;return{nbganttTaskitem:(0,e.css)(t2(),t.colorTextLightSolid,t.colorTextLabel)}});function t6(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function t8(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(r=o.next()).done)&&(a.push(r.value),!t||a.length!==t);i=!0);}catch(e){l=!0,n=e}finally{try{!i&&null!=o.return&&o.return()}finally{if(l)throw n}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return t6(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return t6(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var t3=function(e){var t,r,n=t5().styles,o=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n,o,a;n=e,o=t,a=r[t],o in n?Object.defineProperty(n,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[o]=a})}return e}({},e),a=o.task,i=o.arrowIndent,l=o.isDelete,c=o.taskHeight,s=o.isSelected,u=o.rtl,d=o.onEventStart,f=(0,x.useRef)(null),p=t8((0,x.useState)(S().createElement("div",null)),2),h=p[0],m=p[1],v=t8((0,x.useState)(!0),2),g=v[0],b=v[1],y="project"===a.typeInternal;(0,x.useEffect)(function(){switch(a.typeInternal){case"milestone":m(S().createElement(tV,e));break;case"project":m(S().createElement(t1,e));break;case"smalltask":m(S().createElement(tq,e));break;default:m(S().createElement(tL,e))}},[a,s]),(0,x.useEffect)(function(){f.current&&b(f.current.getBBox().width<a.x2-a.x1)},[f,a]);return S().createElement("g",{className:(0,J.cx)(n.nbganttTaskitem),onKeyDown:function(e){if("Delete"===e.key)l&&d("delete",a,e);e.stopPropagation()},onMouseEnter:function(e){d("mouseenter",a,e)},onMouseLeave:function(e){d("mouseleave",a,e)},onDoubleClick:function(e){d("dblclick",a,e)},onClick:function(e){d("click",a,e)},onFocus:function(){d("select",a)}},h,S().createElement("text",{x:y?a.x1:(t=a.x2-a.x1,r=a.barChildren.length>0,g?a.x1+.5*t:u&&f.current?a.x1-f.current.getBBox().width-i*+r-.2*i:a.x1+t+i*+r+.2*i),y:y?a.y-8:a.y+.65*c,className:y?(0,J.cx)("projectLabel"):g?(0,J.cx)("barLabel"):(0,J.cx)("barLabelOutside"),ref:f},y&&eB(a.start)&&eB(a.end)?"".concat(a.name,": ").concat(eB(a.start)," ~ ").concat(eB(a.end)):a.name))};function t4(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function t9(e,t,r,n,o,a,i){try{var l=e[a](i),c=l.value}catch(e){r(e);return}l.done?t(c):Promise.resolve(c).then(n,o)}function t7(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var a=e.apply(t,r);function i(e){t9(a,n,o,i,l,"next",e)}function l(e){t9(a,n,o,i,l,"throw",e)}i(void 0)})}}function re(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(r=o.next()).done)&&(a.push(r.value),!t||a.length!==t);i=!0);}catch(e){l=!0,n=e}finally{try{!i&&null!=o.return&&o.return()}finally{if(l)throw n}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return t4(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return t4(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function rt(e,t){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(a){return function(l){return function(a){if(r)throw TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}var rr=null,rn=null,ro=function(e){var t,r,n=e.tasks,o=e.dates,a=e.ganttEvent,i=e.selectedTask,l=e.rowHeight,c=e.columnWidth,s=e.timeStep,u=e.svg,d=e.taskHeight,f=e.arrowColor,p=e.arrowIndent,h=e.fontFamily,m=e.fontSize,v=e.rtl,g=e.setGanttEvent,b=e.setFailedTask,y=e.setSelectedTask,w=e.onDateChange,k=e.onProgressChange,C=e.onDoubleClick,O=e.onClick,P=e.onDelete,E=null==u?void 0:null===(r=u.current)||void 0===r?void 0:r.createSVGPoint(),T=re((0,x.useState)(0),2),j=T[0],D=T[1],M=re((0,x.useState)(0),2),N=M[0],A=M[1],F=re((0,x.useState)(!1),2),I=F[0],B=F[1];(0,x.useEffect)(function(){var e,t,r,n;D(s*c/((null===(e=o[1])||void 0===e?void 0:e.getTime())-(null===(t=o[0])||void 0===t?void 0:t.getTime())-(null===(r=o[1])||void 0===r?void 0:r.getTimezoneOffset())*6e4+(null===(n=o[0])||void 0===n?void 0:n.getTimezoneOffset())*6e4))},[c,o,s]),(0,x.useEffect)(function(){var e,t,r=(e=t7(function(e){var t,r,n,o;return rt(this,function(i){return a.changedTask&&E&&(null==u?void 0:u.current)?(e.preventDefault(),E.x=e.clientX,n=(r=ex(E.matrixTransform(null==u?void 0:null===(t=u.current.getScreenCTM())||void 0===t?void 0:t.inverse()).x,a.action,a.changedTask,j,s,N,v)).isChanged,o=r.changedTask,n&&g({action:a.action,changedTask:o}),[2]):[2]})}),function(t){return e.apply(this,arguments)});var n=(t=t7(function(e){var t,o,i,l,c,d,f,p,h,m,y;return rt(this,function(h){switch(h.label){case 0:if(o=a.action,i=a.originalSelectedTask,!(l=a.changedTask)||!E||!(null==u?void 0:u.current)||!i)return[2];if(e.preventDefault(),E.x=e.clientX,c=ex(E.matrixTransform(null==u?void 0:null===(t=u.current.getScreenCTM())||void 0===t?void 0:t.inverse()).x,o,l,j,s,N,v).changedTask,d=i.start!==c.start||i.end!==c.end||i.progress!==c.progress,u.current.removeEventListener("mousemove",r),u.current.removeEventListener("mouseup",n),g({action:""}),B(!1),f=!0,!(("move"===o||"end"===o||"start"===o)&&w&&d))return[3,5];h.label=1;case 1:return h.trys.push([1,3,,4]),[4,w(c,c.barChildren)];case 2:return void 0!==(p=h.sent())&&(f=p),[3,4];case 3:return h.sent(),f=!1,[3,4];case 4:return[3,9];case 5:if(!(k&&d))return[3,9];h.label=6;case 6:return h.trys.push([6,8,,9]),[4,k(c,c.barChildren)];case 7:return void 0!==(m=h.sent())&&(f=m),[3,9];case 8:return h.sent(),f=!1,[3,9];case 9:return!f&&b(i),[2]}})}),function(e){return t.apply(this,arguments)});!I&&("move"===a.action||"end"===a.action||"start"===a.action||"progress"===a.action)&&(null==u?void 0:u.current)&&(u.current.addEventListener("mousemove",r),u.current.addEventListener("mouseup",n),B(!0))},[a,j,N,k,s,w,u,I,E,v,b,g]);var H=(t=t7(function(e,t,r){var n,o;return rt(this,function(i){switch(i.label){case 0:if(r)return[3,1];return"select"===e&&y(t.id),[3,7];case 1:if(!(void 0!==r.key))return[3,6];if("delete"!==e||!P)return[3,5];i.label=2;case 2:return i.trys.push([2,4,,5]),[4,P(t)];case 3:return void 0!==(n=i.sent())&&n&&g({action:e,changedTask:t}),[3,5];case 4:return console.error("Error on Delete. "+i.sent()),[3,5];case 5:return[3,7];case 6:if("mouseenter"===e)!a.action&&g({action:e,changedTask:t,originalSelectedTask:t});else if("mouseleave"===e)"mouseenter"===a.action&&setTimeout(function(){g({action:""})},300);else if("dblclick"===e)C&&C(t);else if("click"===e)"rect"===r.target.tagName&&O&&O(t);else if("move"===e){if(!(null==u?void 0:u.current)||!E)return[2];E.x=r.clientX,A(E.matrixTransform(null===(o=u.current.getScreenCTM())||void 0===o?void 0:o.inverse()).x-t.x1),g({action:e,changedTask:t,originalSelectedTask:t})}else g({action:e,changedTask:t,originalSelectedTask:t});i.label=7;case 7:return[2]}})}),function(e,r,n){return t.apply(this,arguments)}),R=function(e,t,r){["click"].includes(e)?(!["start","end","progress"].includes(rr)&&(!rn||rn===t.start)&&H(e,t,r),rr=null,rn=null):(["move","select"].includes(e)?rn=t.start:(rn=t.start,rr=e),H(e,t,r))};return S().createElement("g",{className:"content"},S().createElement("g",{className:"arrows",fill:f,stroke:f},n.map(function(e){return e.barChildren.map(function(t){return S().createElement(tD,{key:"Arrow from ".concat(e.id," to ").concat(n[t.index].id),taskFrom:e,taskTo:n[t.index],rowHeight:l,taskHeight:d,arrowIndent:p,rtl:v})})})),S().createElement("g",{className:"bar",fontFamily:h,fontSize:m},n.map(function(e){return S().createElement(t3,{task:e,arrowIndent:p,taskHeight:d,isProgressChangeable:!!k&&!e.isDisabled,isDateChangeable:!!w&&!e.isDisabled,isDelete:!e.isDisabled,onEventStart:R,key:e.id,isSelected:!!i&&e.id===i.id,rtl:v})})))},ra=(0,x.forwardRef)(function(e,t){var r,n,o=e.gridProps,a=e.calendarProps,i=e.barProps,l=e.ganttHeight,c=e.scrollY,s=e.scrollX,u=(0,x.useRef)(null),d=(0,x.useRef)(null);var f=(r=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n,o,a;n=e,o=t,a=r[t],o in n?Object.defineProperty(n,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[o]=a})}return e}({},i),n=(n={svg:u},n),Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(n)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(n,e))}),r),p=e2().styles;return(0,x.useEffect)(function(){d.current&&(d.current.scrollTop=c)},[c]),(0,x.useEffect)(function(){t.current&&(t.current.scrollLeft=s)},[s]),S().createElement("div",{className:p.ganttverticalcontainer,ref:t,dir:"ltr"},S().createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:o.svgWidth,height:a.headerHeight,fontFamily:i.fontFamily,className:"ganttHeader"},S().createElement(tb,a)),S().createElement(Z.Spin,{spinning:null==i?void 0:i.loading},S().createElement("div",{ref:d,className:p.horizontalcontainer,style:l?{maxHeight:l,width:o.svgWidth}:{width:o.svgWidth}},S().createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:o.svgWidth,height:i.rowHeight*i.tasks.length||166,fontFamily:i.fontFamily,ref:u,className:"ganttBody"},S().createElement(tE,o),S().createElement(ro,f)))))});function ri(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}ra.displayName="TaskGantt";function rl(e,t,r,n,o,a,i){try{var l=e[a](i),c=l.value}catch(e){r(e);return}l.done?t(c):Promise.resolve(c).then(n,o)}function rc(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var a=e.apply(t,r);function i(e){rl(a,n,o,i,l,"next",e)}function l(e){rl(a,n,o,i,l,"throw",e)}i(void 0)})}}function rs(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ru(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(r=o.next()).done)&&(a.push(r.value),!t||a.length!==t);i=!0);}catch(e){l=!0,n=e}finally{try{!i&&null!=o.return&&o.return()}finally{if(l)throw n}}return a}}(e,t)||rd(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function rd(e,t){if(e){if("string"==typeof e)return ri(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ri(e,t)}}function rf(e,t){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(a){return function(l){return function(a){if(r)throw TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}function rp(){var e,t,r=(e=["\n .ant-table-container::after {\n box-shadow: none !important;\n }\n .ant-table-row {\n height: ","px;\n }\n .ant-table-thead {\n height: ","px;\n }\n "],!t&&(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return rp=function(){return r},r}var rh=(0,ee.debounce)((p=rc(function(e,t,r,n,o){var a;return rf(this,function(i){switch(i.label){case 0:return[4,t.update({filterByTk:e.id,values:(rs(a={},r.start,e.start),rs(a,r.end,e.end),a)})];case 1:return i.sent(),Z.message.success(o("Saved successfully")),[4,null==n?void 0:n.refresh()];case 2:return i.sent(),[2]}})}),function(e,t,r,n,o){return p.apply(this,arguments)}),300);var rm=(0,ee.debounce)((h=rc(function(e,t,r,n,o){return rf(this,function(a){switch(a.label){case 0:return[4,t.update({filterByTk:e.id,values:rs({},r.progress,e.progress/100)})];case 1:return a.sent(),Z.message.success(o("Saved successfully")),[4,null==n?void 0:n.refresh()];case 2:return a.sent(),[2]}})}),function(e,t,r,n,o){return h.apply(this,arguments)}),300),rv=(0,y.withDynamicSchemaProps)(function(e){var t,r,n,o,a,i,l,c=e2().styles,s=(0,y.useToken)().token,u=null===(a=JSON.parse((0,y.useAPIClient)().auth.getOption("theme")))||void 0===a?void 0:a.uid,d=(0,y.useProps)(e),f=d.listCellWidth,p=void 0===f?"155px":f,h=d.ganttHeight,m=void 0===h?0:h,v=d.preStepsCount,g=void 0===v?1:v,b=d.barFill,k=void 0===b?60:b,C=d.barCornerRadius,O=void 0===C?s.borderRadiusXS:C,P=d.barProgressColor,E=void 0===P?s.colorPrimary:P,T=d.barProgressSelectedColor,D=void 0===T?s.colorPrimary:T,N=d.barBackgroundColor,A=void 0===N?s.colorPrimary:N,F=d.barBackgroundSelectedColor,I=void 0===F?s.colorPrimary:F,B=d.projectProgressColor,H=void 0===B?s.colorPrimary:B,R=d.projectProgressSelectedColor,z=void 0===R?s.colorPrimary:R,W=d.projectBackgroundColor,L=void 0===W?s.colorPrimary:W,q=d.projectBackgroundSelectedColor,G=void 0===q?s.colorPrimary:q,Y=d.milestoneBackgroundColor,X=void 0===Y?"#f1c453":Y,U=d.milestoneBackgroundSelectedColor,_=void 0===U?"#f29e4c":U,V=d.rtl,Q=void 0!==V&&V,$=d.handleWidth,K=void 0===$?8:$,ee=d.timeStep,et=d.arrowColor,er=d.fontFamily,en=void 0===er?"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'":er,eo=d.fontSize,ei=void 0===eo?s.fontSize:eo,el=d.arrowIndent,ec=void 0===el?20:el,es=d.todayColor,eu=d.viewDate,ed=d.TooltipContent,ef=void 0===ed?eQ:ed,ep=d.onDoubleClick,eh=d.onDelete,em=d.onSelect,ev=d.onExpanderClick,eg=d.tasks,eb=d.expandAndCollapseAll,ey=d.fieldNames,ex=d.loading,eS=(0,y.useDesignable)().designable,ew=(null==u?void 0:u.includes("compact"))?45:eS?65:55,ek=(null==u?void 0:u.includes("compact"))?45:65,eC=j(),eO=(0,y.useCurrentAppInfo)(),eP=(0,M.useTranslation)().t,eE=null===(i=eO.data)||void 0===i?void 0:i.lang,eD=(0,y.useTableBlockContext)(),eM=(0,y.useBlockRequestContext)(),eN=eM.resource,eA=eM.service,eB=(0,w.useFieldSchema)(),eH=ey.range||"day",eR=(0,x.useRef)(null),ez=(0,x.useRef)(null),eW=(0,x.useRef)(null),eL=(0,x.useRef)(null),eq=ru((0,x.useState)(function(){var e=ru(eT(eg,eH,g),2);return{viewMode:eH,dates:ej(e[0],e[1],eH)}}),2),eG=eq[0],eY=eq[1],eU=ru((0,x.useState)(!1),2),e_=eU[0],eJ=eU[1],eZ=(0,y.usePopupUtils)({setVisible:eJ}).openPopup,e0=ru((0,x.useState)({}),2),e1=e0[0],e5=e0[1],e6=(0,y.useCollectionParentRecordData)(),e8=ru((0,x.useState)(void 0),2),e3=e8[0],e4=e8[1],e9=ru((0,x.useState)(0),2),e7=e9[0],te=e9[1],tt=ru((0,x.useState)(0),2),tr=tt[0],tn=tt[1],to=ru((0,x.useState)(m),2),ta=to[0],ti=to[1],tl=ru((0,x.useState)([]),2),tc=tl[0],ts=tl[1],tu=ru((0,x.useState)({action:""}),2),td=tu[0],tf=tu[1],tp=(0,x.useMemo)(function(){return ek*k/100},[ek,k]),th=ru((0,x.useState)(),2),tm=th[0],tv=th[1],tg=ru((0,x.useState)(null),2),tb=tg[0],ty=tg[1],tx=ru((0,x.useState)(0),2),tS=tx[0],tw=tx[1],tk=ru((0,x.useState)(-1),2),tC=tk[0],tO=tk[1],tP=ru((0,x.useState)(!1),2),tE=tP[0],tT=tP[1];var tj=(t=eG.dates.length,(r=null===(l=eW.current)||void 0===l?void 0:l.clientWidth)/t>50?Math.floor(r/t)+20:50),tD=eG.dates.length*tj,tM=tc.length*ek,tN=eD.expandFlag,tA=ru((0,x.useState)([]),2),tF=tA[0],tI=tA[1];(0,x.useEffect)(function(){eD.field.onExpandClick=tB,eD.field.onRowSelect=tH},[]),(0,x.useEffect)(function(){null==eb||eb(!tN)},[tN]),(0,x.useEffect)(function(){var e,t=ru(eT(e=(e=ev?function(e){var t=e.filter(function(e){return e.hideChildren&&"project"===e.type});if(t.length>0)for(var r=0;t.length>r;r++)!function(r){var n=t[r],o=function e(t,r){var n=[];n="project"!==r.type?t.filter(function(e){return e.dependencies&&-1!==e.dependencies.indexOf(r.id)}):t.filter(function(e){return e.project&&e.project===r.id});var o=[];return n.forEach(function(r){var n;o.push.apply(o,function(e){if(Array.isArray(e))return eF(e)}(n=e(t,r))||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(n)||function(e,t){if(e){if("string"==typeof e)return eF(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return eF(e,t)}}(n)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())}),n=n.concat(n,o)}(e,n);e=e.filter(function(e){return -1===o.indexOf(e)})}(r);return e}(eg):eg).sort(eI),eH,g),2),r=ej(t[0],t[1],eH);Q&&(r=r.reverse(),-1===tC&&tO(r.length*tj)),eY({dates:r,viewMode:eH}),ts(ea(e,r,tj,ek,tp,O,K,Q,E,D,A,I,H,z,L,G,X,_))},[eg,eH,g,ek,O,tj,tp,K,E,D,A,I,H,z,L,G,X,_,Q,tC]),(0,x.useEffect)(function(){if(eH===eG.viewMode&&(eu&&!e3||eu&&(null==e3?void 0:e3.valueOf())!==eu.valueOf())){var e=eG.dates,t=e.findIndex(function(t,r){return eu.valueOf()>=t.valueOf()&&r+1!==e.length&&eu.valueOf()<e[r+1].valueOf()});if(-1!==t)e4(eu),tO(tj*t)}},[eu,tj,eG.dates,eG.viewMode,eH,e3,e4]),(0,x.useEffect)(function(){var e=td.changedTask,t=td.action;if(e){if("delete"===t)tf({action:""}),ts(tc.filter(function(t){return t.id!==e.id}));else if("move"===t||"end"===t||"start"===t||"progress"===t){var r=tc.find(function(t){return t.id===e.id});r&&r.start&&r.end&&(r.start.getTime()!==e.start.getTime()||r.end.getTime()!==e.end.getTime()||r.progress!==e.progress)&&ts(tc.map(function(t){return t.id===e.id?e:t}))}}},[td,tc]),(0,x.useEffect)(function(){tb&&(ts(tc.map(function(e){return e.id!==tb.id?e:tb})),ty(null))},[tb,tc]),(0,x.useEffect)(function(){!p&&te(0),ez.current&&te(ez.current.offsetWidth)},[ez,p]),(0,x.useEffect)(function(){eR.current&&tn(eR.current.offsetWidth-e7)},[eR,e7]),(0,x.useEffect)(function(){m?ti(m+ew):ti(eg.length*ek+ew)},[m,eg,ew,ek]),(0,x.useEffect)(function(){var e,t=function(e){if(e.shiftKey||e.deltaX){var t=tC+(e.deltaX?e.deltaX:e.deltaY);t<0?t=0:t>tD&&(t=tD),tO(t),e.preventDefault()}else if(m){var r=tS+e.deltaY;r<0?r=0:r>tM-m&&(r=tM-m),r!==tS&&(tw(r),e.preventDefault())}tT(!0)};return null===(e=eR.current)||void 0===e||e.addEventListener("wheel",t,{passive:!1}),function(){var e;null===(e=eR.current)||void 0===e||e.removeEventListener("wheel",t)}},[eR,tS,tC,m,tD,Q,tM]);var tB=function(e,t){var r,n,o,a=null==eC?void 0:null===(o=eC.field)||void 0===o?void 0:o.data.find(function(e){return e.id===t.id+""});if(ev&&t.children.length){;ev((r=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){rs(e,t,r[t])})}return e}({},a),n=(n={hideChildren:!e},n),Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(n)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(n,e))}),r))}},tH=function(e){tI(e)};var tR=(n=rc(function(e){return rf(this,function(t){return rm(e,eN,ey,eA,eP),[2]})}),function(e){return n.apply(this,arguments)});var tz=(o=rc(function(e){return rf(this,function(t){return rh(e,eN,ey,eA,eP),[2]})}),function(e){return o.apply(this,arguments)}),tW={columnWidth:tj,svgWidth:tD,tasks:eg,rowHeight:ek,dates:eG.dates,todayColor:void 0===es?"rgba(252, 248, 227, 0.5)":es,rtl:Q,selectedRowKeys:tF},tL={tasks:tc,dates:eG.dates,ganttEvent:td,selectedTask:tm,rowHeight:ek,taskHeight:tp,columnWidth:tj,arrowColor:void 0===et?"grey":et,timeStep:void 0===ee?3e5:ee,fontFamily:en,fontSize:ei,arrowIndent:ec,svgWidth:tD,rtl:Q,setGanttEvent:tf,setFailedTask:ty,setSelectedTask:function(e){var t=tc.find(function(t){return t.id===e}),r=tc.find(function(e){return!!tm&&e.id===tm.id});em&&(r&&em(r,!1),t&&em(t,!0)),tv(t)},onDateChange:tz,onProgressChange:ey.progress&&tR,onDoubleClick:ep,onClick:function(e){var t,r=function(e){return e.reduce(function(e,t){var n;if(!t.children)return e.concat(t);return e.concat([t].concat(function(e){if(Array.isArray(e))return ri(e)}(n=r(t.children))||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(n)||rd(n)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()))},[])},n=r(null==eA?void 0:null===(t=eA.data)||void 0===t?void 0:t.data),o=null==n?void 0:n.find(function(t){return t.id===+e.id});if(!!o)e5(o),eZ({recordData:o,customActionSchema:eB.properties.detail})},onDelete:eh,loading:ex};return S().createElement("div",{className:(0,J.cx)((0,J.css)(rp(),ek,ew)),ref:eL},S().createElement(y.PopupContextProvider,{visible:e_,setVisible:eJ},S().createElement(y.RecordProvider,{record:e1,parent:e6},S().createElement(eK,null)),S().createElement(y.NocoBaseRecursionField,{name:"anctionBar",schema:eB.properties.toolBar}),S().createElement(y.NocoBaseRecursionField,{name:"table",schema:eB.properties.table}),S().createElement("div",{className:c.wrapper,onKeyDown:function(e){e.preventDefault();var t=tS,r=tC,n=!0;switch(e.key){case"Down":case"ArrowDown":t+=ek,n=!1;break;case"Up":case"ArrowUp":t-=ek,n=!1;break;case"Left":case"ArrowLeft":r-=tj;break;case"Right":case"ArrowRight":r+=tj}n?(r<0?r=0:r>tD&&(r=tD),tO(r)):(t<0?t=0:t>tM-m&&(t=tM-m),tw(t)),tT(!0)},tabIndex:0,ref:eR},S().createElement(ra,{gridProps:tW,calendarProps:{dateSetup:eG,locale:eE,viewMode:eH,headerHeight:ew,columnWidth:tj,fontFamily:en,fontSize:ei,rtl:Q},barProps:tL,ganttHeight:m,scrollY:tS,scrollX:tC,ref:eW}),td.changedTask&&S().createElement(eV,{arrowIndent:ec,rowHeight:ek,svgContainerHeight:ta,svgContainerWidth:tr,fontFamily:en,fontSize:ei,scrollX:tC,scrollY:tS,task:td.changedTask,headerHeight:ew,taskListWidth:e7,TooltipContent:ef,rtl:Q,svgWidth:tD}),S().createElement(e$,{ganttFullHeight:tM,ganttHeight:m,headerHeight:ew,scroll:tS,onScroll:function(e){tS===e.currentTarget.scrollTop||tE?tT(!1):(tw(e.currentTarget.scrollTop),tT(!0))},rtl:Q}),S().createElement(Z.Spin,{spinning:ex,style:{visibility:"hidden"}},S().createElement(eX,{svgWidth:tD,taskListWidth:e7,scroll:tC,rtl:Q,onScroll:function(e){tC===e.currentTarget.scrollLeft||tE?tT(!1):(tO(e.currentTarget.scrollLeft),tT(!0))}})))))});function rg(e,t,r,n,o,a,i){try{var l=e[a](i),c=l.value}catch(e){r(e);return}l.done?t(c):Promise.resolve(c).then(n,o)}function rb(e,t,r){return(rb=rk()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(e,n));return r&&rS(o,r.prototype),o}).apply(null,arguments)}function ry(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function rx(e){return(rx=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function rS(e,t){return(rS=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function rw(e){var t="function"==typeof Map?new Map:void 0;return(rw=function(e){var r;if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return rb(e,arguments,rx(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),rS(n,e)})(e)}function rk(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(rk=function(){return!!e})()}rv.ActionBar=y.ActionBar,rv.ViewMode=ek,rv.Designer=function(){var e=(0,y.useCollection_deprecated)(),t=e.name,r=e.title,n=(0,y.useSchemaTemplate)();return S().createElement(y.GeneralSchemaDesigner,{schemaSettings:"blockSettings:gantt",template:n,title:r||t})},rv.Event=K;var rC=S().memo(function(e){return S().createElement(y.SchemaComponentOptions,{components:{Gantt:rv,GanttBlockInitializer:Q,GanttBlockProvider:T},scope:{useGanttBlockProps:D}},e.children)});rC.displayName="GanttProvider";var rO=function(e){var t,r,n;function o(){var e,t,r;return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,o),e=this,t=o,r=arguments,t=rx(t),function(e,t){return t&&("object"===function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}(t)||"function"==typeof t)?t:function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,rk()?Reflect.construct(t,r||[],rx(e).constructor):t.apply(e,r))}return!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&rS(e,t)}(o,e),t=o,r=[{key:"load",value:function(){var e,t=this;return(e=function(){var e;return function(e,t){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(a){return function(l){return function(a){if(r)throw TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}(this,function(r){return t.app.use(rC),t.app.schemaSettingsManager.add(I),t.app.schemaSettingsManager.add(B),t.app.schemaInitializerManager.add(z),t.app.schemaInitializerManager.add(W),null==(e=t.app.schemaInitializerManager.get("page:addBlock"))||e.add("dataBlocks.gantt",{title:"{{t('Gantt')}}",Component:"GanttBlockInitializer"}),t.app.schemaInitializerManager.addItem("popup:common:addBlock","dataBlocks.gantt",{title:"{{t('Gantt')}}",Component:"GanttBlockInitializer",useComponentProps:function(){var e,t,r,n,o,a,i=(e=(0,y.useSchemaInitializer)().insert,t=(0,M.useTranslation)().t,r=(0,x.useContext)(w.SchemaOptionsContext),n=(0,y.useGlobalTheme)().theme,o=(0,y.useCollectionManager_deprecated)().getCollectionFields,{createAssociationGanttBlock:(a=U(function(a){var i,l,c,s,u,d,f,p,h,m;return V(this,function(v){switch(v.label){case 0:return u=(i=a.item).associationField,f=null==(d=o(i.name,i.dataSource))?void 0:null===(l=d.filter(function(e){return"string"===e.type}))||void 0===l?void 0:l.map(function(e){var t;return{label:null==e?void 0:null===(t=e.uiSchema)||void 0===t?void 0:t.title,value:e.name}}),p=null==d?void 0:null===(c=d.filter(function(e){return"date"===e.type}))||void 0===c?void 0:c.map(function(e){var t;return{label:null==e?void 0:null===(t=e.uiSchema)||void 0===t?void 0:t.title,value:e.name}}),h=null==d?void 0:null===(s=d.filter(function(e){return"float"===e.type}))||void 0===s?void 0:s.map(function(e){var t;return{label:null==e?void 0:null===(t=e.uiSchema)||void 0===t?void 0:t.title,value:e.name}}),[4,(0,y.FormDialog)(t("Create gantt block"),function(){return S().createElement(y.SchemaComponentOptions,{scope:r.scope,components:_({},r.components)},S().createElement(q.FormLayout,{layout:"vertical"},S().createElement(y.SchemaComponent,{schema:{properties:{title:{title:t("Title field"),enum:f,required:!0,"x-component":"Select","x-decorator":"FormItem"},start:{title:t("Start date field"),enum:p,required:!0,default:"createdAt","x-component":"Select","x-decorator":"FormItem"},end:{title:t("End date field"),enum:p,required:!0,"x-component":"Select","x-decorator":"FormItem"},progress:{title:t("Progress field"),enum:h,"x-component":"Select","x-decorator":"FormItem"},range:{title:t("Time scale"),enum:[{label:'{{t("Hour")}}',value:"hour",color:"orange"},{label:'{{t("Quarter of day")}}',value:"quarterDay",color:"default"},{label:'{{t("Half of day")}}',value:"halfDay",color:"blue"},{label:'{{t("Day")}}',value:"day",color:"yellow"},{label:'{{t("Week")}}',value:"week",color:"pule"},{label:'{{t("Month")}}',value:"month",color:"green"},{label:'{{t("Year")}}',value:"year",color:"green"},{label:'{{t("QuarterYear")}}',value:"quarterYear",color:"red"}],default:"day","x-component":"Select","x-decorator":"FormItem"}}}})))},n).open({initialValues:{}})];case 1:return m=v.sent(),e(Y({association:"".concat(u.collectionName,".").concat(u.name),dataSource:i.dataSource,fieldNames:_({},m)})),[2]}})}),function(e){return a.apply(this,arguments)})}).createAssociationGanttBlock,l=$().createGanttBlock;return{onlyCurrentDataSource:!0,filterCollections:function(e){var t=e.associationField;return!!t&&["hasMany","belongsToMany"].includes(t.type)},createBlockSchema:function(e){var t=e.item;if(e.fromOthersInPopup)return l({item:t});i({item:t})},showAssociationFields:!0,hideSearch:!0}}}),t.app.addScopes({useGanttBlockProps:D}),[2]})},function(){var t=this,r=arguments;return new Promise(function(n,o){var a=e.apply(t,r);function i(e){rg(a,n,o,i,l,"next",e)}function l(e){rg(a,n,o,i,l,"throw",e)}i(void 0)})})()}}],ry(t.prototype,r),o}(rw(y.Plugin)),rP=rO;return b}()});
|
package/dist/externalVersion.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
module.exports = {
|
|
11
|
-
"@nocobase/client": "1.6.
|
|
11
|
+
"@nocobase/client": "1.6.17",
|
|
12
12
|
"react": "18.2.0",
|
|
13
13
|
"@formily/react": "2.3.0",
|
|
14
14
|
"@ant-design/icons": "5.6.1",
|
|
@@ -16,10 +16,10 @@ module.exports = {
|
|
|
16
16
|
"react-i18next": "11.18.6",
|
|
17
17
|
"lodash": "4.17.21",
|
|
18
18
|
"@formily/shared": "2.3.2",
|
|
19
|
-
"@nocobase/server": "1.6.
|
|
20
|
-
"@nocobase/test": "1.6.
|
|
19
|
+
"@nocobase/server": "1.6.17",
|
|
20
|
+
"@nocobase/test": "1.6.17",
|
|
21
21
|
"@emotion/css": "11.13.0",
|
|
22
22
|
"antd-style": "3.7.1",
|
|
23
|
-
"@nocobase/utils": "1.6.
|
|
23
|
+
"@nocobase/utils": "1.6.17",
|
|
24
24
|
"antd": "5.12.8"
|
|
25
25
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/plugin-gantt",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.17",
|
|
4
4
|
"displayName": "Block: Gantt",
|
|
5
5
|
"displayName.zh-CN": "区块:甘特图",
|
|
6
6
|
"description": "Provides Gantt block.",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"@nocobase/server": "1.x",
|
|
18
18
|
"@nocobase/test": "1.x"
|
|
19
19
|
},
|
|
20
|
-
"gitHead": "
|
|
20
|
+
"gitHead": "9067874312fef0d31e8127c8b499f6c37e99846e",
|
|
21
21
|
"keywords": [
|
|
22
22
|
"Blocks"
|
|
23
23
|
]
|