@26lights/orcha 0.42.93 → 0.42.95
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/orcha.cjs.js +1 -1
- package/dist/orcha.css +1 -1
- package/dist/orcha.es.js +53 -55
- package/dist/orcha.umd.js +2 -2
- package/package.json +1 -1
package/dist/orcha.cjs.js
CHANGED
|
@@ -55,4 +55,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
55
55
|
* vue-color-kit v1.0.6
|
|
56
56
|
* (c) 2023
|
|
57
57
|
* @license MIT
|
|
58
|
-
*/function Ao(t){let e={r:0,g:0,b:0,a:1};/#/.test(t)?e=afe(t):/rgb/.test(t)?e=cp(t):typeof t=="string"?e=cp(`rgba(${t})`):Object.prototype.toString.call(t)==="[object Object]"&&(e=t);const{r:n,g:o,b:r,a:s}=e,{h:a,s:l,v:c}=lfe(e);return{r:n,g:o,b:r,a:s===void 0?1:s,h:a,s:l,v:c}}function Qu(t){const e=document.createElement("canvas"),n=e.getContext("2d"),o=t*2;return e.width=o,e.height=o,n.fillStyle="#ffffff",n.fillRect(0,0,o,o),n.fillStyle="#ccd5db",n.fillRect(0,0,t,t),n.fillRect(t,t,t,t),e}function Wc(t,e,n,o,r,s){const a=t==="l",l=e.createLinearGradient(0,0,a?n:0,a?0:o);l.addColorStop(.01,r),l.addColorStop(.99,s),e.fillStyle=l,e.fillRect(0,0,n,o)}function sfe({r:t,g:e,b:n},o){const r=a=>("0"+Number(a).toString(16)).slice(-2),s=`#${r(t)}${r(e)}${r(n)}`;return o?s.toUpperCase():s}function afe(t){t=t.slice(1);const e=n=>parseInt(n,16)||0;return{r:e(t.slice(0,2)),g:e(t.slice(2,4)),b:e(t.slice(4,6))}}function cp(t){return typeof t=="string"?(t=(/rgba?\((.*?)\)/.exec(t)||["","0,0,0,1"])[1].split(","),{r:Number(t[0])||0,g:Number(t[1])||0,b:Number(t[2])||0,a:Number(t[3]?t[3]:1)}):t}function lfe({r:t,g:e,b:n}){t=t/255,e=e/255,n=n/255;const o=Math.max(t,e,n),r=Math.min(t,e,n),s=o-r;let a=0;o===r?a=0:o===t?e>=n?a=60*(e-n)/s:a=60*(e-n)/s+360:o===e?a=60*(n-t)/s+120:o===n&&(a=60*(t-e)/s+240),a=Math.floor(a);let l=parseFloat((o===0?0:1-r/o).toFixed(2)),c=parseFloat(o.toFixed(2));return{h:a,s:l,v:c}}var ed=i.defineComponent({props:{color:{type:String,default:"#000000"},hsv:{type:Object,default:null},size:{type:Number,default:152}},emits:["selectSaturation"],data(){return{slideSaturationStyle:{}}},mounted(){this.renderColor(),this.renderSlide()},methods:{renderColor(){const t=this.$refs.canvasSaturation,e=this.size,n=t.getContext("2d");t.width=e,t.height=e,n.fillStyle=this.color,n.fillRect(0,0,e,e),Wc("l",n,e,e,"#FFFFFF","rgba(255,255,255,0)"),Wc("p",n,e,e,"rgba(0,0,0,0)","#000000")},renderSlide(){this.slideSaturationStyle={left:this.hsv.s*this.size-5+"px",top:(1-this.hsv.v)*this.size-5+"px"}},selectSaturation(t){const{top:e,left:n}=this.$el.getBoundingClientRect(),o=t.target.getContext("2d"),r=a=>{let l=a.clientX-n,c=a.clientY-e;l<0&&(l=0),c<0&&(c=0),l>this.size&&(l=this.size),c>this.size&&(c=this.size),this.slideSaturationStyle={left:l-5+"px",top:c-5+"px"};const u=o.getImageData(Math.min(l,this.size-1),Math.min(c,this.size-1),1,1),[d,f,p]=u.data;this.$emit("selectSaturation",{r:d,g:f,b:p})};r(t);const s=()=>{document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",s)};document.addEventListener("mousemove",r),document.addEventListener("mouseup",s)}}});const cfe={ref:"canvasSaturation"};function ufe(t,e,n,o,r,s){return i.openBlock(),i.createBlock("div",{class:"saturation",onMousedown:e[1]||(e[1]=i.withModifiers((...a)=>t.selectSaturation&&t.selectSaturation(...a),["prevent","stop"]))},[i.createVNode("canvas",cfe,null,512),i.createVNode("div",{style:t.slideSaturationStyle,class:"slide"},null,4)],32)}ed.render=ufe;ed.__file="src/color/Saturation.vue";var td=i.defineComponent({props:{hsv:{type:Object,default:null},width:{type:Number,default:15},height:{type:Number,default:152}},emits:["selectHue"],data(){return{slideHueStyle:{}}},mounted(){this.renderColor(),this.renderSlide()},methods:{renderColor(){const t=this.$refs.canvasHue,e=this.width,n=this.height,o=t.getContext("2d");t.width=e,t.height=n;const r=o.createLinearGradient(0,0,0,n);r.addColorStop(0,"#FF0000"),r.addColorStop(.17*1,"#FF00FF"),r.addColorStop(.17*2,"#0000FF"),r.addColorStop(.17*3,"#00FFFF"),r.addColorStop(.17*4,"#00FF00"),r.addColorStop(.17*5,"#FFFF00"),r.addColorStop(1,"#FF0000"),o.fillStyle=r,o.fillRect(0,0,e,n)},renderSlide(){this.slideHueStyle={top:(1-this.hsv.h/360)*this.height-2+"px"}},selectHue(t){const{top:e}=this.$el.getBoundingClientRect(),n=t.target.getContext("2d"),o=s=>{let a=s.clientY-e;a<0&&(a=0),a>this.height&&(a=this.height),this.slideHueStyle={top:a-2+"px"};const l=n.getImageData(0,Math.min(a,this.height-1),1,1),[c,u,d]=l.data;this.$emit("selectHue",{r:c,g:u,b:d})};o(t);const r=()=>{document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",r)};document.addEventListener("mousemove",o),document.addEventListener("mouseup",r)}}});const dfe={ref:"canvasHue"};function ffe(t,e,n,o,r,s){return i.openBlock(),i.createBlock("div",{class:"hue",onMousedown:e[1]||(e[1]=i.withModifiers((...a)=>t.selectHue&&t.selectHue(...a),["prevent","stop"]))},[i.createVNode("canvas",dfe,null,512),i.createVNode("div",{style:t.slideHueStyle,class:"slide"},null,4)],32)}td.render=ffe;td.__file="src/color/Hue.vue";var nd=i.defineComponent({props:{color:{type:String,default:"#000000"},rgba:{type:Object,default:null},width:{type:Number,default:15},height:{type:Number,default:152}},emits:["selectAlpha"],data(){return{slideAlphaStyle:{},alphaSize:5}},watch:{color(){this.renderColor()},"rgba.a"(){this.renderSlide()}},mounted(){this.renderColor(),this.renderSlide()},methods:{renderColor(){const t=this.$refs.canvasAlpha,e=this.width,n=this.height,o=this.alphaSize,r=Qu(o),s=t.getContext("2d");t.width=e,t.height=n,s.fillStyle=s.createPattern(r,"repeat"),s.fillRect(0,0,e,n),Wc("p",s,e,n,"rgba(255,255,255,0)",this.color)},renderSlide(){this.slideAlphaStyle={top:this.rgba.a*this.height-2+"px"}},selectAlpha(t){const{top:e}=this.$el.getBoundingClientRect(),n=r=>{let s=r.clientY-e;s<0&&(s=0),s>this.height&&(s=this.height);let a=parseFloat((s/this.height).toFixed(2));this.$emit("selectAlpha",a)};n(t);const o=()=>{document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",o)};document.addEventListener("mousemove",n),document.addEventListener("mouseup",o)}}});const pfe={ref:"canvasAlpha"};function mfe(t,e,n,o,r,s){return i.openBlock(),i.createBlock("div",{class:"color-alpha",onMousedown:e[1]||(e[1]=i.withModifiers((...a)=>t.selectAlpha&&t.selectAlpha(...a),["prevent","stop"]))},[i.createVNode("canvas",pfe,null,512),i.createVNode("div",{style:t.slideAlphaStyle,class:"slide"},null,4)],32)}nd.render=mfe;nd.__file="src/color/Alpha.vue";var od=i.defineComponent({props:{color:{type:String,default:"#000000"},width:{type:Number,default:100},height:{type:Number,default:30}},data(){return{alphaSize:5}},watch:{color(){this.renderColor()}},mounted(){this.renderColor()},methods:{renderColor(){const t=this.$el,e=this.width,n=this.height,o=this.alphaSize,r=Qu(o),s=t.getContext("2d");t.width=e,t.height=n,s.fillStyle=s.createPattern(r,"repeat"),s.fillRect(0,0,e,n),s.fillStyle=this.color,s.fillRect(0,0,e,n)}}});function hfe(t,e,n,o,r,s){return i.openBlock(),i.createBlock("canvas")}od.render=hfe;od.__file="src/color/Preview.vue";var rd=i.defineComponent({props:{suckerCanvas:{type:Object,default:null},suckerArea:{type:Array,default:()=>[]}},data(){return{isOpenSucker:!1,suckerPreview:null,isSucking:!1}},watch:{suckerCanvas(t){this.isSucking=!1,this.suckColor(t)}},methods:{openSucker(){this.isOpenSucker?this.keydownHandler({keyCode:27}):(this.isOpenSucker=!0,this.isSucking=!0,this.$emit("openSucker",!0),document.addEventListener("keydown",this.keydownHandler))},keydownHandler(t){t.keyCode===27&&(this.isOpenSucker=!1,this.isSucking=!1,this.$emit("openSucker",!1),document.removeEventListener("keydown",this.keydownHandler),document.removeEventListener("mousemove",this.mousemoveHandler),document.removeEventListener("mouseup",this.mousemoveHandler),this.suckerPreview&&(document.body.removeChild(this.suckerPreview),this.suckerPreview=null))},mousemoveHandler(t){const{clientX:e,clientY:n}=t,{top:o,left:r,width:s,height:a}=this.suckerCanvas.getBoundingClientRect(),l=e-r,c=n-o,d=this.suckerCanvas.getContext("2d").getImageData(Math.min(l,s-1),Math.min(c,a-1),1,1);let[f,p,m,h]=d.data;h=parseFloat((h/255).toFixed(2));const g=this.suckerPreview.style;Object.assign(g,{position:"absolute",left:e+20+"px",top:n-36+"px",width:"24px",height:"24px",borderRadius:"50%",border:"2px solid #fff",boxShadow:"0 0 8px 0 rgba(0, 0, 0, 0.16)",background:`rgba(${f}, ${p}, ${m}, ${h})`,zIndex:95}),this.suckerArea.length&&e>=this.suckerArea[0]&&n>=this.suckerArea[1]&&e<=this.suckerArea[2]&&n<=this.suckerArea[3]?g.display="":g.display="none"},suckColor(t){t&&t.tagName!=="CANVAS"||(this.suckerPreview=document.createElement("div"),this.suckerPreview&&document.body.appendChild(this.suckerPreview),document.addEventListener("mousemove",this.mousemoveHandler),document.addEventListener("mouseup",this.mousemoveHandler),t.addEventListener("click",e=>{const{clientX:n,clientY:o}=e,{top:r,left:s,width:a,height:l}=t.getBoundingClientRect(),c=n-s,u=o-r,f=t.getContext("2d").getImageData(Math.min(c,a-1),Math.min(u,l-1),1,1);let[p,m,h,g]=f.data;g=parseFloat((g/255).toFixed(2)),this.$emit("selectSucker",{r:p,g:m,b:h,a:g})}))}}});const gfe=i.createVNode("path",{d:"M13.1,8.2l5.6,5.6c0.4,0.4,0.5,1.1,0.1,1.5s-1.1,0.5-1.5,0.1c0,0-0.1,0-0.1-0.1l-1.4-1.4l-7.7,7.7C7.9,21.9,7.6,22,7.3,22H3.1C2.5,22,2,21.5,2,20.9l0,0v-4.2c0-0.3,0.1-0.6,0.3-0.8l5.8-5.8C8.5,9.7,9.2,9.6,9.7,10s0.5,1.1,0.1,1.5c0,0,0,0.1-0.1,0.1l-5.5,5.5v2.7h2.7l7.4-7.4L8.7,6.8c-0.5-0.4-0.5-1-0.1-1.5s1.1-0.5,1.5-0.1c0,0,0.1,0,0.1,0.1l1.4,1.4l3.5-3.5c1.6-1.6,4.1-1.6,5.8-0.1c1.6,1.6,1.6,4.1,0.1,5.8L20.9,9l-3.6,3.6c-0.4,0.4-1.1,0.5-1.5,0.1"},null,-1),vfe={key:1,class:"sucker",viewBox:"-16 -16 68 68",xmlns:"http://www.w3.org/2000/svg",stroke:"#9099a4"},yfe=i.createVNode("g",{fill:"none","fill-rule":"evenodd"},[i.createVNode("g",{transform:"translate(1 1)","stroke-width":"4"},[i.createVNode("circle",{"stroke-opacity":".5",cx:"18",cy:"18",r:"18"}),i.createVNode("path",{d:"M36 18c0-9.94-8.06-18-18-18"},[i.createVNode("animateTransform",{attributeName:"transform",type:"rotate",from:"0 18 18",to:"360 18 18",dur:"1s",repeatCount:"indefinite"})])])],-1);function _fe(t,e,n,o,r,s){return i.openBlock(),i.createBlock("div",null,[t.isSucking?i.createCommentVNode("v-if",!0):(i.openBlock(),i.createBlock("svg",{key:0,class:[{active:t.isOpenSucker},"sucker"],xmlns:"http://www.w3.org/2000/svg",viewBox:"-12 -12 48 48",onClick:e[1]||(e[1]=(...a)=>t.openSucker&&t.openSucker(...a))},[gfe],2)),t.isSucking?(i.openBlock(),i.createBlock("svg",vfe,[yfe])):i.createCommentVNode("v-if",!0)])}rd.render=_fe;rd.__file="src/color/Sucker.vue";var id=i.defineComponent({props:{name:{type:String,default:""},color:{type:String,default:""}},emits:["inputColor","inputFocus","inputBlur"],setup(t,{emit:e}){return{modelColor:i.computed({get(){return t.color||""},set(s){e("inputColor",s)}}),handleFocus:s=>{e("inputFocus",s)},handleBlur:s=>{e("inputBlur",s)}}}});const Cfe={class:"color-type"},bfe={class:"name"};function kfe(t,e,n,o,r,s){return i.openBlock(),i.createBlock("div",Cfe,[i.createVNode("span",bfe,i.toDisplayString(t.name),1),i.withDirectives(i.createVNode("input",{"onUpdate:modelValue":e[1]||(e[1]=a=>t.modelColor=a),class:"value",onFocus:e[2]||(e[2]=(...a)=>t.handleFocus&&t.handleFocus(...a)),onBlur:e[3]||(e[3]=(...a)=>t.handleBlur&&t.handleBlur(...a))},null,544),[[i.vModelText,t.modelColor]])])}id.render=kfe;id.__file="src/color/Box.vue";var sd=i.defineComponent({name:"ColorPicker",props:{color:{type:String,default:"#000000"},colorsDefault:{type:Array,default:()=>[]},colorsHistoryKey:{type:String,default:""}},emits:["selectColor"],setup(t,{emit:e}){const n=i.ref(),o=i.ref([]),r=i.ref();t.colorsHistoryKey&&localStorage&&(o.value=JSON.parse(localStorage.getItem(t.colorsHistoryKey))||[]),r.value=Qu(4).toDataURL(),i.onUnmounted(()=>{s(n.value)});function s(l){if(!l)return;const c=o.value||[],u=c.indexOf(l);u>=0&&c.splice(u,1),c.length>=8&&(c.length=7),c.unshift(l),o.value=c||[],localStorage&&t.colorsHistoryKey&&localStorage.setItem(t.colorsHistoryKey,JSON.stringify(c))}function a(l){e("selectColor",l)}return{setColorsHistory:s,colorsHistory:o,color:n,imgAlphaBase64:r,selectColor:a}}});const wfe={class:"colors"},Efe={key:0,class:"colors history"};function xfe(t,e,n,o,r,s){return i.openBlock(),i.createBlock("div",null,[i.createVNode("ul",wfe,[(i.openBlock(!0),i.createBlock(i.Fragment,null,i.renderList(t.colorsDefault,a=>(i.openBlock(),i.createBlock("li",{key:a,class:"item",onClick:l=>t.selectColor(a)},[i.createVNode("div",{style:{background:`url(${t.imgAlphaBase64})`},class:"alpha"},null,4),i.createVNode("div",{style:{background:a},class:"color"},null,4)],8,["onClick"]))),128))]),t.colorsHistory.length?(i.openBlock(),i.createBlock("ul",Efe,[(i.openBlock(!0),i.createBlock(i.Fragment,null,i.renderList(t.colorsHistory,a=>(i.openBlock(),i.createBlock("li",{key:a,class:"item",onClick:l=>t.selectColor(a)},[i.createVNode("div",{style:{background:`url(${t.imgAlphaBase64})`},class:"alpha"},null,4),i.createVNode("div",{style:{background:a},class:"color"},null,4)],8,["onClick"]))),128))])):i.createCommentVNode("v-if",!0)])}sd.render=xfe;sd.__file="src/color/Colors.vue";var Tr=i.defineComponent({components:{Saturation:ed,Hue:td,Alpha:nd,Preview:od,Sucker:rd,Box:id,Colors:sd},emits:["changeColor","openSucker","inputFocus","inputBlur"],props:{color:{type:String,default:"#000000"},theme:{type:String,default:"dark"},suckerHide:{type:Boolean,default:!0},suckerCanvas:{type:null,default:null},suckerArea:{type:Array,default:()=>[]},colorsDefault:{type:Array,default:()=>["#000000","#FFFFFF","#FF1900","#F47365","#FFB243","#FFE623","#6EFF2A","#1BC7B1","#00BEFF","#2E81FF","#5D61FF","#FF89CF","#FC3CAD","#BF3DCE","#8E00A7","rgba(0,0,0,0)"]},colorsHistoryKey:{type:String,default:"vue-colorpicker-history"}},data(){return{hueWidth:15,hueHeight:152,previewHeight:30,modelRgba:"",modelHex:"",r:0,g:0,b:0,a:1,h:0,s:0,v:0}},computed:{isLightTheme(){return this.theme==="light"},totalWidth(){return this.hueHeight+(this.hueWidth+8)*2},previewWidth(){return this.totalWidth-(this.suckerHide?0:this.previewHeight)},rgba(){return{r:this.r,g:this.g,b:this.b,a:this.a}},hsv(){return{h:this.h,s:this.s,v:this.v}},rgbString(){return`rgb(${this.r}, ${this.g}, ${this.b})`},rgbaStringShort(){return`${this.r}, ${this.g}, ${this.b}, ${this.a}`},rgbaString(){return`rgba(${this.rgbaStringShort})`},hexString(){return sfe(this.rgba,!0)}},created(){Object.assign(this,Ao(this.color)),this.setText(),this.$watch("rgba",()=>{this.$emit("changeColor",{rgba:this.rgba,hsv:this.hsv,hex:this.modelHex})})},methods:{selectSaturation(t){const{r:e,g:n,b:o,h:r,s,v:a}=Ao(t);Object.assign(this,{r:e,g:n,b:o,h:r,s,v:a}),this.setText()},handleFocus(t){this.$emit("inputFocus",t)},handleBlur(t){this.$emit("inputBlur",t)},selectHue(t){const{r:e,g:n,b:o,h:r,s,v:a}=Ao(t);Object.assign(this,{r:e,g:n,b:o,h:r,s,v:a}),this.setText(),this.$nextTick(()=>{this.$refs.saturation.renderColor(),this.$refs.saturation.renderSlide()})},selectAlpha(t){this.a=t,this.setText()},inputHex(t){const{r:e,g:n,b:o,a:r,h:s,s:a,v:l}=Ao(t);Object.assign(this,{r:e,g:n,b:o,a:r,h:s,s:a,v:l}),this.modelHex=t,this.modelRgba=this.rgbaStringShort,this.$nextTick(()=>{this.$refs.saturation.renderColor(),this.$refs.saturation.renderSlide(),this.$refs.hue.renderSlide()})},inputRgba(t){const{r:e,g:n,b:o,a:r,h:s,s:a,v:l}=Ao(t);Object.assign(this,{r:e,g:n,b:o,a:r,h:s,s:a,v:l}),this.modelHex=this.hexString,this.modelRgba=t,this.$nextTick(()=>{this.$refs.saturation.renderColor(),this.$refs.saturation.renderSlide(),this.$refs.hue.renderSlide()})},setText(){this.modelHex=this.hexString,this.modelRgba=this.rgbaStringShort},openSucker(t){this.$emit("openSucker",t)},selectSucker(t){const{r:e,g:n,b:o,a:r,h:s,s:a,v:l}=Ao(t);Object.assign(this,{r:e,g:n,b:o,a:r,h:s,s:a,v:l}),this.setText(),this.$nextTick(()=>{this.$refs.saturation.renderColor(),this.$refs.saturation.renderSlide(),this.$refs.hue.renderSlide()})},selectColor(t){const{r:e,g:n,b:o,a:r,h:s,s:a,v:l}=Ao(t);Object.assign(this,{r:e,g:n,b:o,a:r,h:s,s:a,v:l}),this.setText(),this.$nextTick(()=>{this.$refs.saturation.renderColor(),this.$refs.saturation.renderSlide(),this.$refs.hue.renderSlide()})}}});const Sfe={class:"color-set"};function Tfe(t,e,n,o,r,s){const a=i.resolveComponent("Saturation"),l=i.resolveComponent("Hue"),c=i.resolveComponent("Alpha"),u=i.resolveComponent("Preview"),d=i.resolveComponent("Sucker"),f=i.resolveComponent("Box"),p=i.resolveComponent("Colors");return i.openBlock(),i.createBlock("div",{class:["hu-color-picker",{light:t.isLightTheme}],style:{width:t.totalWidth+"px"}},[i.createVNode("div",Sfe,[i.createVNode(a,{ref:"saturation",color:t.rgbString,hsv:t.hsv,size:t.hueHeight,onSelectSaturation:t.selectSaturation},null,8,["color","hsv","size","onSelectSaturation"]),i.createVNode(l,{ref:"hue",hsv:t.hsv,width:t.hueWidth,height:t.hueHeight,onSelectHue:t.selectHue},null,8,["hsv","width","height","onSelectHue"]),i.createVNode(c,{ref:"alpha",color:t.rgbString,rgba:t.rgba,width:t.hueWidth,height:t.hueHeight,onSelectAlpha:t.selectAlpha},null,8,["color","rgba","width","height","onSelectAlpha"])]),i.createVNode("div",{style:{height:t.previewHeight+"px"},class:"color-show"},[i.createVNode(u,{color:t.rgbaString,width:t.previewWidth,height:t.previewHeight},null,8,["color","width","height"]),t.suckerHide?i.createCommentVNode("v-if",!0):(i.openBlock(),i.createBlock(d,{key:0,"sucker-canvas":t.suckerCanvas,"sucker-area":t.suckerArea,onOpenSucker:t.openSucker,onSelectSucker:t.selectSucker},null,8,["sucker-canvas","sucker-area","onOpenSucker","onSelectSucker"]))],4),i.createVNode(f,{name:"HEX",color:t.modelHex,onInputColor:t.inputHex,onInputFocus:t.handleFocus,onInputBlur:t.handleBlur},null,8,["color","onInputColor","onInputFocus","onInputBlur"]),i.createVNode(f,{name:"RGBA",color:t.modelRgba,onInputColor:t.inputRgba,onInputFocus:t.handleFocus,onInputBlur:t.handleBlur},null,8,["color","onInputColor","onInputFocus","onInputBlur"]),i.createVNode(p,{color:t.rgbaString,"colors-default":t.colorsDefault,"colors-history-key":t.colorsHistoryKey,onSelectColor:t.selectColor},null,8,["color","colors-default","colors-history-key","onSelectColor"]),i.createCommentVNode(" custom options "),i.renderSlot(t.$slots,"default")],6)}Tr.render=Tfe;Tr.__file="src/color/ColorPicker.vue";Tr.install=t=>{t.component(Tr.name,Tr)};const Afe={class:"color-picker-wrapper"},fl=i.defineComponent({__name:"AoColorPicker",props:{color:{}},emits:["update:color"],setup(t,{emit:e}){const n=t,o=e,r=i.ref(!1),s=i.ref(null),a=i.ref(null),l=i.ref(0),c=i.ref(0),u=async h=>{a.value=h,r.value=!0,await i.nextTick();const g=h.getBoundingClientRect(),y=s.value,C=(y==null?void 0:y.offsetHeight)||300,v=window.innerHeight-g.bottom,_=g.top,k=v<C&&_>C;console.log("pickerHeight = "+C),l.value=k?g.top-C-8:g.bottom+8,c.value=g.left,setTimeout(()=>{window.addEventListener("click",f)},0)},d=i.computed(()=>({position:"fixed",top:`${l.value}px`,left:`${c.value}px`,zIndex:1e3})),f=h=>{const g=h.target;s.value&&!s.value.contains(g)&&(r.value=!1,o("update:color",p.value),window.removeEventListener("click",f))};i.onBeforeUnmount(()=>{window.removeEventListener("click",f)}),i.watch(()=>n.color,h=>{r.value||(p.value=h)});const p=i.ref(n.color),m=h=>{const{r:g,g:y,b:C,a:v}=h.rgba;p.value=`rgba(${g}, ${y}, ${C}, ${v})`};return(h,g)=>(i.openBlock(),i.createElementBlock("div",Afe,[i.renderSlot(h.$slots,"clickable",{openPicker:u,bgColor:t.color}),r.value?(i.openBlock(),i.createElementBlock("div",{key:0,ref_key:"pickerRef",ref:s,class:"color-picker",style:i.normalizeStyle(d.value)},[i.createVNode(i.unref(Tr),{class:"color-picker-box",theme:"light",color:t.color,onChangeColor:m},null,8,["color"])],4)):i.createCommentVNode("",!0)]))}});const Nfe={class:"ao-card-project-phase__header"},Dfe={class:"ao-card-project-item__title-line"},Mfe={key:0,class:"ao-card-project-item-phase__estimation"},Bfe={class:"ao-card-project-phase__footer"},$fe={key:0,class:"ao-card-project-phase__footer-row ao-card-project-phase__footer-row--progress"},Ofe={class:"ao-card-project-phase__subitem"},Lfe={class:"ao-card-project-phase__subitem"},Ife={key:0,class:"ao-card-project-phase__secondary"},Pfe={class:"ao-card-project-phase__deadline ao-card-project-phase__deadline--readonly"},Ffe=i.defineComponent({__name:"AoCardProjectItemPhase",props:{id:{},projectName:{},name:{},milestones:{},isEditable:{type:Boolean},deadline:{},active:{type:Boolean},color:{},timeTrackingData:{},estimationUnit:{}},emits:["update:title","update:deadline","archivePhase","unarchivePhase","updatePhase"],setup(t,{emit:e}){const n=t,o=e,r=g=>{o("update:title",g)},s=i.computed(()=>{var g;return((g=n.milestones)==null?void 0:g.reduce((y,C)=>{var v;return y+((v=C.activities)==null?void 0:v.reduce((_,k)=>_+(k.estimation||0),0))},0))||0}),a=i.computed(()=>!n.milestones||!n.timeTrackingData?0:n.milestones.reduce((g,y)=>{var C;return g+(((C=y.activities)==null?void 0:C.reduce((v,_)=>{var w;const k=(w=n.timeTrackingData)==null?void 0:w[_.id];return v+((k==null?void 0:k.timeSpent)||0)},0))||0)},0)),l=i.computed(()=>n.estimationUnit==="days"?"d":"h"),c=i.computed(()=>Na(a.value,n.estimationUnit)),u=i.computed(()=>{var g;return(g=n.milestones)==null?void 0:g.length}),d=i.computed(()=>{var g;return(g=n.milestones)==null?void 0:g.filter(y=>y.status===$i.done).length}),f=i.computed(()=>(d.value||0)/(u.value||1)),p=i.computed({get:()=>n.deadline??"",set:g=>o("update:deadline",g!=null&&g.length?g:null)}),m=i.computed({get:()=>n.color,set:g=>{o("updatePhase",{id:n.id,color:g})}}),h=(g,y)=>{const C=g.target;C.closest("button")||C.closest("input")||C.closest(".ao-title")||y(C)};return(g,y)=>(i.openBlock(),i.createBlock(fl,{color:m.value,"onUpdate:color":y[2]||(y[2]=C=>m.value=C)},{clickable:i.withCtx(({openPicker:C,bgColor:v})=>[i.createVNode(ul,{class:"ao-card-project-phase","is-clickable":t.isEditable,color:v,"with-left-border":!0,onClick:_=>h(_,C)},i.createSlots({default:i.withCtx(()=>[i.createElementVNode("div",Dfe,[i.createVNode(ct,{id:t.id,class:"ao-card-project-phase__title",title:t.name||"",level:4,"is-editable":t.isEditable,"onUpdate:title":r},null,8,["id","title","is-editable"]),s.value||a.value?(i.openBlock(),i.createElementBlock("span",Mfe," ("+i.toDisplayString(c.value)+"/"+i.toDisplayString(s.value)+i.toDisplayString(l.value)+")",1)):i.createCommentVNode("",!0)])]),footer:i.withCtx(()=>[i.createElementVNode("div",Bfe,[u.value?(i.openBlock(),i.createElementBlock("div",$fe,[i.createElementVNode("div",Ofe,[i.createVNode(ve,{name:"MountainFlagOutlineRounded",size:"sm"}),i.createElementVNode("span",Lfe,i.toDisplayString(d.value)+" / "+i.toDisplayString(u.value),1)]),i.createVNode(dl,{percentages:f.value,class:"ao-card-project-phase__progress",color:t.color},null,8,["percentages","color"]),g.$slots.secondary?(i.openBlock(),i.createElementBlock("div",Ife,[i.renderSlot(g.$slots,"secondary")])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass(["ao-card-project-phase__footer-row",p.value?"":"ao-card-project-phase__no_deadline"])},[t.isEditable?i.withDirectives((i.openBlock(),i.createElementBlock("input",{key:0,"onUpdate:modelValue":y[1]||(y[1]=_=>p.value=_),class:"ao-card-project-phase__deadline ao-card-project-phase__deadline--input",type:"date"},null,512)),[[i.vModelText,p.value,void 0,{lazy:!0}]]):i.createCommentVNode("",!0),i.createElementVNode("span",Pfe,i.toDisplayString(i.unref(Da)(t.deadline)),1)],2)])]),_:2},[t.isEditable?{name:"header",fn:i.withCtx(()=>[i.createElementVNode("div",Nfe,[i.createVNode(me,{class:"ao-card-project-phase__archive",color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:t.active?g.$t("archive"):g.$t("unarchive"),onClick:y[0]||(y[0]=i.withModifiers(()=>t.active?g.$emit("archivePhase",{id:t.id}):g.$emit("unarchivePhase",{id:t.id}),["stop"]))},null,8,["label"])])]),key:"0"}:void 0]),1032,["is-clickable","color","onClick"])]),_:3},8,["color"]))}});const Vfe=i.defineComponent({__name:"AoBadge",props:{color:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("span",{class:"aoBadge",style:i.normalizeStyle({backgroundColor:t.color})},null,4))}});const Rfe={class:"ao-card-project-milestone__default"},zfe={class:"ao-title-with-badge-wrapper"},Ufe={class:"ao-card-project-item__title-line"},qfe={key:0,class:"ao-card-project-item-milestone__estimation"},Hfe={key:0,class:"ao-card-project-milestone__archive"},jfe={class:"ao-card-project-milestone__activities"},Wfe={class:"ao-card-project-milestone__activities-row"},Zfe={class:"ao-card-project-milestone__subitem"},Kfe={class:"ao-card-project-milestone__subitem"},Gfe={key:1,class:"ao-card-project-milestone__secondary"},Yfe={class:"ao-card-project-milestone__footer"},Jfe={key:1,class:"ao-field ao-card-project-milestone__deadline"},Xfe={class:"ao-field__label"},Qfe={key:2,class:"ao-card-project-milestone__assignee"},epe=i.defineComponent({__name:"AoCardProjectItemMilestone",props:{id:{},name:{},color:{},phaseColor:{},activities:{},closedStatus:{},isEditable:{type:Boolean},deadline:{},active:{type:Boolean},isSelected:{type:Boolean},assignee:{},important:{type:Boolean},readonly:{type:Boolean},timeTrackingData:{},estimationUnit:{}},emits:["updateMilestone","archiveMilestone","unarchiveMilestone"],setup(t,{emit:e}){const n=t,o=e,r=i.computed(()=>{var p;return((p=n.activities)==null?void 0:p.reduce((m,h)=>m+(h.estimation||0),0))||0}),s=i.computed(()=>!n.activities||!n.timeTrackingData?0:n.activities.reduce((p,m)=>{var g;const h=(g=n.timeTrackingData)==null?void 0:g[m.id];return p+((h==null?void 0:h.timeSpent)||0)},0)),a=i.computed(()=>n.estimationUnit==="days"?"d":"h"),l=i.computed(()=>Na(s.value,n.estimationUnit));i.computed(()=>{const p=s.value/60;return p%1===0?p.toString():p.toFixed(2)});const c=i.computed(()=>{var p;return(p=n.activities)==null?void 0:p.length}),u=i.computed(()=>{var p;return(p=n.activities)==null?void 0:p.filter(m=>Gc(m,n.closedStatus)).length}),d=i.computed(()=>(u.value||0)/(c.value||1)),f=p=>{o("updateMilestone",{id:n.id,name:p})};return(p,m)=>(i.openBlock(),i.createBlock(ul,{class:i.normalizeClass(["ao-card-project-milestone"]),"is-clickable":!t.readonly,"tag-name":"li","is-selected":t.isSelected,color:t.phaseColor},{default:i.withCtx(()=>[i.createElementVNode("div",Rfe,[i.createElementVNode("div",zfe,[i.createVNode(Vfe,{color:t.color||""},null,8,["color"]),i.createElementVNode("div",Ufe,[i.createVNode(ct,{id:t.id,title:t.name||"",level:5,"is-editable":!t.readonly&&t.isEditable,class:"ao-card-project-milestone__title","onUpdate:title":f},null,8,["id","title","is-editable"]),r.value||s.value?(i.openBlock(),i.createElementBlock("span",qfe," ("+i.toDisplayString(l.value)+"/"+i.toDisplayString(r.value)+i.toDisplayString(a.value)+")",1)):i.createCommentVNode("",!0)])]),!t.readonly&&t.isEditable?(i.openBlock(),i.createElementBlock("div",Hfe,[i.createVNode(me,{color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:t.active?p.$t("archive"):p.$t("unarchive"),onClick:m[0]||(m[0]=i.withModifiers(()=>t.active?p.$emit("archiveMilestone",{id:t.id}):p.$emit("unarchiveMilestone",{id:t.id}),["stop"]))},null,8,["label"])])):i.createCommentVNode("",!0)]),i.createElementVNode("div",jfe,[i.createElementVNode("div",Wfe,[c.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createElementVNode("div",Zfe,[i.createVNode(ve,{name:"SelectCheckBox",size:"sm"}),i.createElementVNode("span",Kfe,i.toDisplayString(u.value)+" / "+i.toDisplayString(c.value),1)]),i.createVNode(dl,{percentages:d.value,color:t.phaseColor,class:"ao-card-project-milestone__progress"},null,8,["percentages","color"])],64)):i.createCommentVNode("",!0),p.$slots.secondary?(i.openBlock(),i.createElementBlock("div",Gfe,[i.renderSlot(p.$slots,"secondary")])):i.createCommentVNode("",!0)])])]),footer:i.withCtx(()=>[i.createElementVNode("div",Yfe,[t.important?(i.openBlock(),i.createBlock(ve,{key:0,name:"FlagRounded",class:i.normalizeClass(t.isSelected?"ao-card-project-milestone__important--selected":"ao-card-project-milestone__important"),size:"sm"},null,8,["class"])):i.createCommentVNode("",!0),t.deadline?(i.openBlock(),i.createElementBlock("label",Jfe,[i.createElementVNode("span",Xfe,i.toDisplayString(i.unref(Da)(t.deadline)),1)])):i.createCommentVNode("",!0),t.assignee?(i.openBlock(),i.createElementBlock("div",Qfe,[i.createVNode(qn,{"user-name":i.unref(Bp)(t.assignee),"avatar-url":t.assignee.avatarUrl,color:t.isSelected?"black":"primary",size:"sm"},null,8,["user-name","avatar-url","color"])])):i.createCommentVNode("",!0)])]),_:3},8,["is-clickable","is-selected","color"]))}});const tpe={class:"ao-mapping-card-project-phase__header"},npe={class:"ao-card-project-item__title-line"},ope={key:0,class:"ao-card-project-item-phase__estimation"},rpe={class:"ao-mapping-card-project-phase__footer"},ipe={key:0,class:"ao-mapping-card-project-phase__footer-row ao-mapping-card-project-phase__footer-row--progress"},spe={class:"ao-mapping-card-project-phase__subitem"},ape={class:"ao-mapping-card-project-phase__subitem"},lpe={key:0,class:"ao-mapping-card-project-phase__secondary"},cpe={class:"ao-mapping-card-project-phase__deadline ao-mapping-card-project-phase__deadline--readonly"},upe=i.defineComponent({__name:"AoCondensedCardProjectItemPhase",props:{id:{},projectName:{},name:{},milestones:{},isEditable:{type:Boolean},deadline:{},active:{type:Boolean},color:{},timeTrackingData:{},estimationUnit:{}},emits:["update:title","update:deadline","archivePhase","updatePhase","unarchivePhase"],setup(t,{emit:e}){const n=t,o=e,r=g=>{o("update:title",g)},s=i.computed(()=>{var g;return((g=n.milestones)==null?void 0:g.reduce((y,C)=>{var v;return y+((v=C.activities)==null?void 0:v.reduce((_,k)=>_+(k.estimation||0),0))},0))||0}),a=i.computed(()=>!n.milestones||!n.timeTrackingData?0:n.milestones.reduce((g,y)=>{var C;return g+(((C=y.activities)==null?void 0:C.reduce((v,_)=>{var w;const k=(w=n.timeTrackingData)==null?void 0:w[_.id];return v+((k==null?void 0:k.timeSpent)||0)},0))||0)},0)),l=i.computed(()=>n.estimationUnit==="days"?"d":"h"),c=i.computed(()=>Na(a.value,n.estimationUnit)),u=i.computed(()=>{var g;return(g=n.milestones)==null?void 0:g.length}),d=i.computed(()=>{var g;return(g=n.milestones)==null?void 0:g.filter(y=>y.status===$i.done).length}),f=i.computed(()=>(d.value||0)/(u.value||1)),p=i.computed({get:()=>n.deadline??"",set:g=>o("update:deadline",g!=null&&g.length?g:null)}),m=i.computed({get:()=>n.color,set:g=>{o("updatePhase",{id:n.id,color:g})}}),h=(g,y)=>{const C=g.target;C.closest("button")||C.closest("input")||C.closest(".ao-title")||y()};return(g,y)=>(i.openBlock(),i.createBlock(fl,{color:m.value,"onUpdate:color":y[2]||(y[2]=C=>m.value=C)},{clickable:i.withCtx(({openPicker:C,bgColor:v})=>[i.createVNode(ul,{class:"ao-mapping-card-project-phase","is-clickable":t.isEditable,color:v,"with-left-border":!0,onClick:_=>h(_,C)},i.createSlots({default:i.withCtx(()=>[i.createElementVNode("div",npe,[i.createVNode(ct,{id:t.id,class:"ao-mapping-card-project-phase__title",title:t.name||"",level:4,"is-editable":t.isEditable,"onUpdate:title":r},null,8,["id","title","is-editable"]),s.value||a.value?(i.openBlock(),i.createElementBlock("span",ope," ("+i.toDisplayString(c.value)+"/"+i.toDisplayString(s.value)+i.toDisplayString(l.value)+")",1)):i.createCommentVNode("",!0)])]),footer:i.withCtx(()=>[i.createElementVNode("div",rpe,[u.value?(i.openBlock(),i.createElementBlock("div",ipe,[i.createElementVNode("div",spe,[i.createVNode(ve,{name:"MountainFlagOutlineRounded",size:"sm"}),i.createElementVNode("span",ape,i.toDisplayString(d.value)+" / "+i.toDisplayString(u.value),1)]),i.createVNode(dl,{percentages:f.value,class:"ao-mapping-card-project-phase__progress",color:m.value},null,8,["percentages","color"]),g.$slots.secondary?(i.openBlock(),i.createElementBlock("div",lpe,[i.renderSlot(g.$slots,"secondary")])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass(["ao-mapping-card-project-phase__footer-row",p.value?"":"ao-mapping-card-project-phase__no_deadline"])},[t.isEditable?i.withDirectives((i.openBlock(),i.createElementBlock("input",{key:0,"onUpdate:modelValue":y[1]||(y[1]=_=>p.value=_),class:"ao-mapping-card-project-phase__deadline ao-mapping-card-project-phase__deadline--input",type:"date"},null,512)),[[i.vModelText,p.value,void 0,{lazy:!0}]]):i.createCommentVNode("",!0),i.createElementVNode("span",cpe,i.toDisplayString(i.unref(Da)(t.deadline)),1)],2)])]),_:2},[t.isEditable?{name:"header",fn:i.withCtx(()=>[i.createElementVNode("div",tpe,[i.createVNode(me,{class:"ao-mapping-card-project-phase__archive",color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:t.active?g.$t("archive"):g.$t("unarchive"),onClick:y[0]||(y[0]=i.withModifiers(()=>t.active?g.$emit("archivePhase",{id:t.id}):g.$emit("unarchivePhase",{id:t.id}),["stop"]))},null,8,["label"])])]),key:"0"}:void 0]),1032,["is-clickable","color","onClick"])]),_:3},8,["color"]))}});const dpe={class:"ao-project-phase"},fpe={key:0,class:"ao-project-phase__drag ao-card__drag"},ppe={key:1,class:"ao-project-phase__col-phase"},mpe={key:2,class:"ao-mapping-project-phase__col-phase"},hpe={key:0,class:"ao-project-phase__col-milestones"},gpe=["title"],vpe={class:"ao-project-phase__milestones-list-footer"},ype=i.defineComponent({__name:"AoProjectPhase",props:{phase:{},closedStatus:{},users:{},isEditable:{type:Boolean},readonly:{type:Boolean},timeTrackingData:{},estimationUnit:{}},emits:["addMilestone","updateMilestone","archiveMilestone","unarchiveMilestone","updatePhase","archivePhase","unarchivePhase"],setup(t,{emit:e}){const{t:n}=wn(),o=t,r=e;i.watch(()=>o.phase.milestones,(w,b)=>{Pn(w,b)});const s=w=>{r("updatePhase",{id:o.phase.id,name:w})},a=w=>{r("updatePhase",{id:o.phase.id,deadline:w})},l=w=>{r("updatePhase",w)},c=i.computed(()=>o.phase.milestones.map(w=>g_(w,o.closedStatus))),u=w=>{const{name:b,rank:E}=Uo(c.value??[],"milestone",n);r("addMilestone",{name:b,rank:E,phaseId:w})},d=w=>{const b=n("template.defaultName.milestone",{idx:1}),E=Qi(c.value??[]);r("addMilestone",{name:b,rank:E,phaseId:w})},f=w=>{r("updateMilestone",w)},p=w=>{r("archiveMilestone",w)},m=w=>{r("unarchiveMilestone",w)},h=w=>{r("archivePhase",w)},g=w=>{r("unarchivePhase",w)},y=w=>{"added"in w?r("updateMilestone",{id:w.added.element.id,phaseId:o.phase.id,rank:Ar(c.value,w.added.newIndex)}):"removed"in w||"moved"in w&&r("updateMilestone",{id:w.moved.element.id,rank:Ar(c.value,w.moved.newIndex)})},C=Ki.useRoute(),v=i.computed(()=>C.path.includes("/mapping")),_=i.computed(()=>{var w;return o.phase.id===((w=C.params)==null?void 0:w.phaseId)});i.ref(!1);const k=i.computed(()=>{var w;return o.phase.id!==((w=C.params)==null?void 0:w.phaseId)?{backgroundColor:"var(--ao-color-sheet)"}:o.phase.color?{backgroundColor:y_(o.phase.color)}:{backgroundColor:"var(--ao-color-primary-lightest)"}});return(w,b)=>(i.openBlock(),i.createElementBlock("li",dpe,[i.createElementVNode("div",{class:"ao-project-phases__draggable-card",style:i.normalizeStyle(k.value)},[t.isEditable?(i.openBlock(),i.createElementBlock("div",fpe,[i.createVNode(ve,{name:"DragIndicator",class:"ao-project-phase__drag-handle"})])):i.createCommentVNode("",!0),v.value?(i.openBlock(),i.createElementBlock("div",mpe,[i.createVNode(upe,{id:t.phase.id,milestones:c.value,name:t.phase.name,deadline:t.phase.deadline,active:t.phase.active,"is-editable":t.isEditable,color:t.phase.color,"estimation-unit":t.estimationUnit,"onUpdate:deadline":a,"onUpdate:title":s,onArchivePhase:h,onUnarchivePhase:g,onUpdatePhase:l},null,8,["id","milestones","name","deadline","active","is-editable","color","estimation-unit"])])):(i.openBlock(),i.createElementBlock("div",ppe,[i.createVNode(Ffe,{id:t.phase.id,milestones:c.value,name:t.phase.name,deadline:t.phase.deadline,active:t.phase.active,"is-editable":t.isEditable,color:t.phase.color,"time-tracking-data":t.timeTrackingData,"estimation-unit":t.estimationUnit,"onUpdate:deadline":a,"onUpdate:title":s,onArchivePhase:h,onUnarchivePhase:g,onUpdatePhase:l},null,8,["id","milestones","name","deadline","active","is-editable","color","time-tracking-data","estimation-unit"])]))],4),v.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",hpe,[i.createElementVNode("div",{class:"ao-project-phase__milestones ao-project-phase__milestones--hoverable",style:i.normalizeStyle(k.value)},[t.isEditable?(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(["ao-project-phase__milestone-quick-add",{"ao-project-phase__milestone-quick-add--visible":_.value}]),title:w.$t("project.milestone.add"),onClick:b[0]||(b[0]=()=>d(t.phase.id))},[i.createVNode(ve,{name:"Add",class:"ao-project-phase__milestone-quick-add-icon"})],10,gpe)):i.createCommentVNode("",!0),i.createVNode(i.unref(ho),i.mergeProps({class:"ao-project-phase__milestones-list",list:c.value,disabled:t.readonly||!t.isEditable,"item-key":"id",group:"kanban"},w.$attrs,{onChange:y}),{item:i.withCtx(({element:E})=>{var T;return[i.createVNode(epe,{id:E.id,name:E.name,color:E.color,"phase-color":t.phase.color,activities:E.activities,deadline:E.deadline,active:E.active,"is-editable":!t.readonly&&t.isEditable,"is-draggable":!t.readonly&&t.isEditable,"closed-status":t.closedStatus,"is-selected":E.id===((T=w.$route.params)==null?void 0:T.milestoneId),assignee:E.assignee,important:E.important,readonly:t.readonly,"time-tracking-data":t.timeTrackingData,"estimation-unit":t.estimationUnit,class:i.normalizeClass(["ao-project-phase__milestone"]),onClick:S=>!t.readonly&&w.$router.push({name:i.unref(je).milestone,params:{phaseId:t.phase.id,milestoneId:E.id}}),onUpdateMilestone:f,onArchiveMilestone:p,onUnarchiveMilestone:m},null,8,["id","name","color","phase-color","activities","deadline","active","is-editable","is-draggable","closed-status","is-selected","assignee","important","readonly","time-tracking-data","estimation-unit","onClick"])]}),_:1},16,["list","disabled"]),i.createElementVNode("div",vpe,[t.isEditable?(i.openBlock(),i.createBlock(go,{key:0,label:w.$t("project.milestone.add"),class:"ao-project-phase__milestone-add","icon-name":"Add",onClick:b[1]||(b[1]=()=>u(t.phase.id))},null,8,["label"])):i.createCommentVNode("",!0)])],4)]))]))}});const _pe={class:"ao-project__phases"},Cpe={key:0,class:"ao-project-phase__phases-list-footer"},bpe={class:"ao-project-phase__col-phase"},ad=i.defineComponent({__name:"AoProjectPhases",props:{phases:{},closedStatus:{},isEditable:{type:Boolean},users:{},readonly:{type:Boolean},timeTrackingData:{},estimationUnit:{}},emits:["addMilestone","updateMilestone","archiveMilestone","unarchiveMilestone","addPhase","updatePhase","archivePhase","unarchivePhase"],setup(t,{emit:e}){const n=t,o=e;i.watch(()=>n.phases,(m,h)=>{Pn(m,h)});const r=m=>{o("addMilestone",m)},s=m=>{o("updateMilestone",m)},a=m=>{o("archiveMilestone",m)},l=m=>{o("unarchiveMilestone",m)},c=m=>{o("archivePhase",m)},u=m=>{o("unarchivePhase",m)},d=m=>{if(m.moved){const h=Xi(m,n.phases??[]);o("updatePhase",{id:m.moved.element.id,rank:h})}},f=m=>{o("updatePhase",m)},p=m=>{o("addPhase",m)};return(m,h)=>(i.openBlock(),i.createElementBlock("div",_pe,[i.createVNode(i.unref(ho),{class:"ao-project-phase__phases-list","model-value":t.phases,"item-key":"id",handle:".ao-card__drag",onChange:d},{item:i.withCtx(({element:g})=>[i.createVNode(ype,{phase:g,"is-editable":!t.readonly&&t.isEditable,"closed-status":t.closedStatus,users:t.users,readonly:t.readonly,"time-tracking-data":t.timeTrackingData,"estimation-unit":t.estimationUnit,onAddMilestone:r,onUpdateMilestone:s,onArchiveMilestone:a,onUnarchiveMilestone:l,onUpdatePhase:f,onArchivePhase:c,onUnarchivePhase:u},null,8,["phase","is-editable","closed-status","users","readonly","time-tracking-data","estimation-unit"])]),_:1},8,["model-value"]),t.isEditable?(i.openBlock(),i.createElementBlock("div",Cpe,[h[0]||(h[0]=i.createElementVNode("div",{class:"ao-project-phase__empty_drag"},null,-1)),i.createElementVNode("div",bpe,[i.createVNode(go,{label:m.$t("project.phases.add"),"icon-name":"Add",class:"ao-project-phase__add-phase",onClick:p},null,8,["label"])]),h[1]||(h[1]=i.createElementVNode("div",{class:"ao-project-phase__col-milestones"},null,-1))])):i.createCommentVNode("",!0)]))}});const kpe={class:"ao-add-template-modal__form-body"},wpe={class:"field__row"},Epe={class:"ao-add-template-modal__form-footer"},Pg=i.defineComponent({__name:"AoAddTemplateModal",props:{projectId:{},templates:{}},emits:["apply"],setup(t,{emit:e}){const n=t,o=e,r=i.computed(()=>n.templates.map(c=>({value:c.id,label:c.name}))),s=i.ref(null),a=c=>{s.value=c},l=()=>{s.value&&o("apply",s.value,n.projectId)};return(c,u)=>(i.openBlock(),i.createBlock(Ma,{size:"sm"},{header:i.withCtx(()=>[i.createVNode(ct,{title:c.$t("project.template.apply.title"),level:3},null,8,["title"])]),default:i.withCtx(()=>[i.createElementVNode("form",{class:"ao-add-template-modal__form",onSubmit:i.withModifiers(l,["prevent"])},[i.createElementVNode("p",null,i.toDisplayString(c.$t("project.template.apply.notice")),1),i.createElementVNode("div",kpe,[i.createElementVNode("div",wpe,[i.createVNode(Dt,{value:s.value,options:r.value,detached:!0,onChange:a},null,8,["value","options"])])]),i.createElementVNode("footer",Epe,[i.createVNode(me,{label:c.$t("project.template.apply.label"),type:"submit",color:"primary",variant:"solid",onClick:l},null,8,["label"])])],32)]),_:1}))}});const xpe={class:"ao-save-template-modal__form-body"},Spe={class:"field__row"},Tpe={class:"ao-field ao-field--inline"},Ape={class:"ao-field__label"},Npe={class:"ao-save-template-modal__phases"},Dpe={class:"ao-field__label"},Mpe={class:"ao-save-template-modal__phases-list"},Bpe=["value"],$pe={class:"ao-save-template-modal__form-footer"},Fg=i.defineComponent({__name:"AoSaveTemplateModal",props:{phases:{}},emits:["save"],setup(t,{emit:e}){const n=t,o=e,r=i.ref(""),s=i.ref([]);i.onMounted(()=>{s.value=n.phases.map(l=>l.id)});const a=()=>{r.value&&o("save",r.value,s.value)};return(l,c)=>(i.openBlock(),i.createBlock(Ma,{size:"sm"},{header:i.withCtx(()=>[i.createVNode(ct,{title:l.$t("project.template.save.title"),level:3},null,8,["title"])]),default:i.withCtx(()=>[i.createElementVNode("form",{class:"ao-save-template-modal__form",onSubmit:i.withModifiers(a,["prevent"])},[i.createElementVNode("div",xpe,[i.createElementVNode("div",Spe,[i.createElementVNode("label",Tpe,[i.createElementVNode("span",Ape,i.toDisplayString(l.$t("project.template.name.label"))+": ",1),i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":c[0]||(c[0]=u=>r.value=u),type:"text"},null,512),[[i.vModelText,r.value]])])]),i.createElementVNode("div",Npe,[i.createElementVNode("div",Dpe,i.toDisplayString(l.$t("project.template.phases.label")),1),i.createElementVNode("div",Mpe,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.phases,u=>(i.openBlock(),i.createElementBlock("label",{key:u.id,class:"ao-field ao-field--checkbox"},[i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":c[1]||(c[1]=d=>s.value=d),type:"checkbox",value:u.id},null,8,Bpe),[[i.vModelCheckbox,s.value]]),i.createElementVNode("span",null,i.toDisplayString(u.name),1)]))),128))])])]),i.createElementVNode("footer",$pe,[i.createVNode(me,{label:l.$t("project.template.save.label"),type:"submit",color:"primary",variant:"solid",onClick:a},null,8,["label"])])],32)]),_:1}))}});const Ope={class:"ao-project"},Lpe={class:"ao-project__body"},Ipe=i.defineComponent({__name:"AoProjectOverviewProject",props:{project:{},phases:{},closedStatus:{},users:{},userId:{},templates:{},isTaskCheckable:{type:Function},statuses:{},activityTypes:{},isEditable:{type:[Boolean,String]},showsArchived:{type:Boolean},attachmentEnabled:{type:Boolean},timeTrackingData:{},loadAttachmentPreview:{type:Function}},emits:["addPhase","updatePhase","archivePhase","unarchivePhase","addMilestone","updateMilestone","archiveMilestone","unarchiveMilestone","addActivity","update:activity","archiveActivity","copyPhaseToTemplate","unarchiveActivity","addSubtask","updateSubtask","deleteSubtask","addFiles","removeFile","addComment","updateComment","removeComment","applyTemplate","saveTemplate","update:showsArchived"],setup(t,{emit:e}){const{t:n}=wn(),o=t,r=e,s=i.computed(()=>o.phases.flatMap(F=>F.milestones)),a=()=>{const{name:F,rank:Q}=Uo(o.phases,"phase",n);r("addPhase",{name:F,rank:Q,projectId:o.project.id})},l=()=>{const F=n("template.defaultName.phase",{idx:1}),Q=Qi(o.phases);r("addPhase",{name:F,rank:Q,projectId:o.project.id})},c=F=>{r("updatePhase",F)},u=F=>{r("archivePhase",F)},d=F=>{r("unarchivePhase",F)},f=F=>{r("copyPhaseToTemplate",F)},p=F=>{r("addMilestone",F)},m=F=>{r("updateMilestone",F)},h=F=>{r("archiveMilestone",F)},g=F=>{r("unarchiveMilestone",F)},y=F=>{r("addActivity",F)},C=F=>{r("update:activity",F)},v=F=>{r("archiveActivity",F)},_=F=>{r("unarchiveActivity",F)},k=F=>{r("addSubtask",F)},w=F=>{r("updateSubtask",F)},b=F=>{r("deleteSubtask",F)},E=i.computed(()=>s.value.flatMap(F=>F.activities)),T=F=>{r("addFiles",F)},S=F=>{r("removeFile",F)},N=F=>{r("addComment",F)},O=F=>{r("updateComment",F)},A=F=>{r("removeComment",F)},D=i.ref(!1),M=i.ref(!1),L=(F,Q)=>{r("applyTemplate",{templateId:F,projectId:Q}),D.value=!1},I=(F,Q)=>{var oe;const P=(oe=o.templates)==null?void 0:oe.at(-1),re=P?Je.LexoRank.parse(P.rank).genNext():Je.LexoRank.middle();r("saveTemplate",{templateName:F,rank:re.format(),phaseIds:Q}),M.value=!1},j=Ki.useRouter(),R=i.ref("overview"),q=[{label:"Overview",value:"overview"},{label:"Feed",value:"feed"},{label:"Mapping",value:"mapping"}];return i.watch(R,F=>{F==="feed"?(j.push({name:je.feed}),console.log("Navigating to feed...")):F==="overview"?(j.push({name:je.project}),console.log("Navigating to feed...")):F==="mapping"&&(j.push({name:je.mapping}),console.log("Navigating to feed..."))}),(F,Q)=>{var re;const P=i.resolveComponent("RouterView");return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("div",i.mergeProps({class:"ao-project-overview"},F.$attrs),[i.createElementVNode("div",Ope,[i.createVNode(es,null,{primary:i.withCtx(()=>[i.createVNode(ps,{modelValue:R.value,"onUpdate:modelValue":Q[0]||(Q[0]=oe=>R.value=oe),tabs:q},null,8,["modelValue"]),t.isEditable===!0?(i.openBlock(),i.createBlock(me,{key:0,class:"ao-project-overview__quick-add-phase",size:"sm","icon-name":"Add","icon-position":"start",color:"primary",variant:"ghost",label:F.$t("project.phase.add"),onClick:l},null,8,["label"])):i.createCommentVNode("",!0),i.createVNode(me,{class:"ao-feed__show-archived",size:"sm","icon-name":t.showsArchived?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:F.$t("feed.filters.showsArchived.label"),role:"checkbox","aria-checked":t.showsArchived,onClick:Q[1]||(Q[1]=oe=>F.$emit("update:showsArchived",!t.showsArchived))},null,8,["icon-name","label","aria-checked"])]),secondary:i.withCtx(()=>[t.isEditable===!0?(i.openBlock(),i.createBlock(me,{key:0,class:"ao-project-overview__save-as-template",color:"primary",label:F.$t("project.template.save.label"),onClick:Q[2]||(Q[2]=oe=>M.value=!0)},null,8,["label"])):i.createCommentVNode("",!0),t.isEditable===!0?(i.openBlock(),i.createBlock(me,{key:1,class:"ao-project-overview__add-template",color:"primary",label:F.$t("project.template.apply.label"),onClick:Q[3]||(Q[3]=oe=>D.value=!0)},null,8,["label"])):i.createCommentVNode("",!0)]),_:1}),i.createElementVNode("div",Lpe,[i.createVNode(ad,{phases:t.phases,"closed-status":t.closedStatus,"is-editable":t.isEditable===!0,users:t.users,"time-tracking-data":t.timeTrackingData,"estimation-unit":(re=t.project)==null?void 0:re.estimationUnit,onAddMilestone:p,onUpdateMilestone:m,onArchiveMilestone:h,onUnarchiveMilestone:g,onAddPhase:a,onUpdatePhase:c,onArchivePhase:u,onUnarchivePhase:d,onCopyPhaseToTemplate:f},null,8,["phases","closed-status","is-editable","users","time-tracking-data","estimation-unit"])])]),i.createVNode(P,{class:"ao-project__sidebar",phases:t.phases,"project-id":t.project.id,"project-name":t.project.name,users:t.users,"is-editable":t.isEditable===!0,"closed-status":t.closedStatus,"time-tracking-data":t.timeTrackingData,onClose:Q[4]||(Q[4]=oe=>F.$router.push({name:i.unref(je).project})),onUpdateMilestone:m,onAddActivity:y,onUpdateActivity:C,onArchiveActivity:v,onUnarchiveActivity:_},null,8,["phases","project-id","project-name","users","is-editable","closed-status","time-tracking-data"]),(i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[i.createVNode(P,{name:"modal",activities:E.value,"is-task-checkable":t.isTaskCheckable,statuses:t.statuses,"activity-types":t.activityTypes,phases:t.phases,project:t.project,users:t.users,"user-id":t.userId,"is-editable":t.isEditable,"attachment-enabled":t.attachmentEnabled,"time-tracking-data":t.timeTrackingData,"load-attachment-preview":t.loadAttachmentPreview,"onUpdate:activity":C,onAddSubtask:k,onUpdateSubtask:w,onDeleteSubtask:b,onAddFiles:T,onRemoveFile:S,onAddComment:N,onUpdateComment:O,onRemoveComment:A},{default:i.withCtx(({Component:oe})=>[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(oe),null,{default:i.withCtx(G=>[i.renderSlot(F.$slots,"activityDetailsBody",i.normalizeProps(i.guardReactiveProps(G)))]),_:3}))]),_:3},8,["activities","is-task-checkable","statuses","activity-types","phases","project","users","user-id","is-editable","attachment-enabled","time-tracking-data","load-attachment-preview"])]))],16),(i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[M.value?(i.openBlock(),i.createBlock(Fg,{key:0,phases:t.phases,onClose:Q[5]||(Q[5]=oe=>M.value=!1),onSave:I},null,8,["phases"])):i.createCommentVNode("",!0),D.value?(i.openBlock(),i.createBlock(Pg,{key:1,"project-id":t.project.id,templates:t.templates,onClose:Q[6]||(Q[6]=oe=>D.value=!1),onApply:L},null,8,["project-id","templates"])):i.createCommentVNode("",!0)]))],64)}}});const Ppe={class:"ao-card-feed__header"},Fpe={key:1,class:"ao-card-feed__header-secondary ao-card-feed__header-icons"},Vpe={key:2,class:"ao-card-feed__header-secondary ao-card-feed__secondary"},Rpe={class:"ao-card-feed__body"},zpe={key:0,class:"ao-card-feed__breadcrumbs"},Upe={class:i.normalizeClass(["ao-card-feed__title-group"])},qpe={class:"ao-card-feed__title-line"},Hpe={key:0,class:"ao-card-feed__slug"},jpe={key:1,class:"ao-card-feed__deadline"},Wpe={class:"ao-card-feed__footer"},Zpe={class:"ao-card-feed__footer-row"},Kpe={class:"ao-assignees"},Gpe={key:0,class:"ao-assignee"},Ype={key:0,class:"ao-card-feed__subitems"},Jpe={key:0,class:"ao-card-feed__subitem"},Xpe={class:"ao-card-feed__subitem"},Qpe={key:1,class:"ao-card-feed__subitem"},eme={class:"ao-card-feed__subitem"},tme={class:"ao-card-feed__timer-wrapper"},nme={class:"ao-card-feed__footer-row"},ome={key:0,class:"ao-card-feed__progress-wrapper"},rme={class:"ao-card-feed__subitem"},ime={class:"ao-card-feed__subitem"},ld=i.defineComponent({__name:"AoCardFeed",props:{id:{},name:{},projectName:{},projectId:{},projectColor:{},phaseName:{},milestoneName:{},milestoneColor:{},deadline:{},important:{type:Boolean},assignee:{},slug:{},comments:{},attachments:{},tasks:{},isEditable:{type:Boolean},isPrivate:{type:Boolean},isClosed:{type:Boolean},tagType:{}},emits:["removeAssignee","updateActivity","startTimer"],setup(t,{emit:e}){const n=t,o=e,r=i.computed(()=>n.tagType==="milestone"?n.milestoneName:n.projectName),s=i.computed(()=>n.tagType==="milestone"?n.milestoneColor:n.projectColor),a=g=>{o("updateActivity",{id:n.id,name:g})},l=i.computed(()=>n.tagType==="milestone"&&n.phaseName?`${n.phaseName}`:n.phaseName&&n.milestoneName?`${n.phaseName} / ${n.milestoneName}`:""),c=i.computed(()=>n.assignee?[n.assignee]:[]),u=i.computed(()=>Da(n.deadline)),d=g=>{o("removeAssignee",g)},f=()=>{o("startTimer",{activityId:n.id,name:n.name,project:n.projectName,projectId:n.projectId,slug:n.slug})},p=i.computed(()=>{var g;return(g=n.tasks)==null?void 0:g.length}),m=i.computed(()=>{var g;return(g=n.tasks)==null?void 0:g.filter(y=>y.isDone).length}),h=i.computed(()=>(m.value||0)/(p.value||1));return(g,y)=>(i.openBlock(),i.createBlock(ul,{class:i.normalizeClass(["ao-card-feed",{"ao-card-feed--closed":t.isClosed}]),"is-clickable":!0},{header:i.withCtx(()=>[i.createElementVNode("div",Ppe,[r.value?(i.openBlock(),i.createBlock(Bi,{key:0,label:r.value,class:"ao-card-feed__project",variant:"solid",color:t.projectColor?void 0:"primary","raw-color":s.value},null,8,["label","color","raw-color"])):i.createCommentVNode("",!0),t.isPrivate||t.important||t.isClosed?(i.openBlock(),i.createElementBlock("div",Fpe,[t.isPrivate?(i.openBlock(),i.createBlock(ve,{key:0,name:"Lock",class:"ao-card-feed__warning",size:"sm"})):i.createCommentVNode("",!0),t.important?(i.openBlock(),i.createBlock(ve,{key:1,name:"FlagRounded",class:"ao-card-feed__important",size:"sm"})):i.createCommentVNode("",!0),t.isClosed?(i.openBlock(),i.createBlock(ve,{key:2,name:"CheckSmallRounded",class:"ao-card-feed__closed"})):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),g.$slots.secondary?(i.openBlock(),i.createElementBlock("div",Vpe,[i.renderSlot(g.$slots,"secondary")])):i.createCommentVNode("",!0)])]),default:i.withCtx(()=>[i.createElementVNode("div",Rpe,[l.value?(i.openBlock(),i.createElementBlock("span",zpe,i.toDisplayString(l.value),1)):i.createCommentVNode("",!0),i.createElementVNode("div",Upe,[i.createElementVNode("div",qpe,[t.slug?(i.openBlock(),i.createElementBlock("span",Hpe,i.toDisplayString(t.slug)+": ",1)):i.createCommentVNode("",!0),i.createVNode(ct,{id:t.id,title:t.name,level:5,"is-editable":t.isEditable,class:"ao-card-feed__title-inline","onUpdate:title":a},null,8,["id","title","is-editable"])])]),t.deadline?(i.openBlock(),i.createElementBlock("span",jpe,i.toDisplayString(u.value),1)):i.createCommentVNode("",!0)])]),footer:i.withCtx(()=>[i.createElementVNode("div",Wpe,[i.createElementVNode("div",Zpe,[i.createElementVNode("ul",Kpe,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(c.value,C=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:C.id},[C?(i.openBlock(),i.createElementBlock("li",Gpe,[i.createVNode(qn,{"user-name":i.unref(Bp)(C),"avatar-url":C.avatarUrl,"is-closable":!0,onClose:()=>d(C.id)},null,8,["user-name","avatar-url","onClose"])])):i.createCommentVNode("",!0)],64))),128))]),t.comments||t.attachments?(i.openBlock(),i.createElementBlock("ul",Ype,[t.comments?(i.openBlock(),i.createElementBlock("li",Jpe,[i.createVNode(ve,{name:"ChatOutline",size:"sm"}),i.createElementVNode("span",Xpe,i.toDisplayString(t.comments),1)])):i.createCommentVNode("",!0),t.attachments?(i.openBlock(),i.createElementBlock("li",Qpe,[i.createVNode(ve,{name:"AttachFileRounded",size:"sm"}),i.createElementVNode("span",eme,i.toDisplayString(t.attachments),1)])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),i.createElementVNode("div",tme,[i.createVNode(ve,{name:"TimerOutline",class:"ao-card-feed__timer",size:"md",onClick:i.withModifiers(f,["stop"])})])]),i.createElementVNode("div",nme,[t.tasks&&t.tasks.length?(i.openBlock(),i.createElementBlock("div",ome,[i.createElementVNode("div",rme,[i.createVNode(ve,{name:"SelectCheckBox",size:"sm"}),i.createElementVNode("span",ime,i.toDisplayString(m.value)+" / "+i.toDisplayString(p.value),1)]),i.createVNode(dl,{percentages:h.value,class:"ao-card-feed__progress"},null,8,["percentages"])])):i.createCommentVNode("",!0)])])]),_:3},8,["class"]))}});const sme={class:"ao-project-milestone"},ame={class:"ao-project-milestone__header"},lme={class:"ao-project-milestone__header_line"},cme={class:"ao-project-milestone__header_line"},ume={class:"ao-project-milestone__title"},dme={key:0,class:"ao-fieldset ao-milestone__fieldset"},fme={class:"ao-field__row ao-milestone__field-row"},pme={class:"ao-field ao-field--inline"},mme={class:"ao-field__row ao-milestone__field-row"},hme={class:"ao-field ao-milestone__field-multiselect"},gme=["onClick"],vme={class:"ao-project-milestone__body"},yme={key:0,class:"ao-project-milestone__activities-header"},_me=["title"],Cme={key:1,class:"ao-project-milestone__footer"},up=i.defineComponent({__name:"AoProjectOverviewMilestoneDetails",props:{milestoneId:{},users:{},projectId:{},phases:{},phaseId:{},isEditable:{type:Boolean},closedStatus:{},timeTrackingData:{}},emits:["close","addActivity","updateMilestone","updateActivity","archiveActivity","unarchiveActivity","startTimer"],setup(t,{emit:e}){const{t:n}=wn(),o=t,r=e,s=b=>{var E;r("startTimer",b),(E=window.parent)==null||E.postMessage({type:"startTimer",data:b},"*")},a=i.computed(()=>{var b;return(b=o.phases)==null?void 0:b.find(E=>E.id===o.phaseId)}),l=i.computed(()=>{var b;return(b=o.phases)==null?void 0:b.flatMap(E=>E.milestones)}),c=i.computed(()=>{var b;return(b=l.value)==null?void 0:b.find(E=>E.id===o.milestoneId)}),u=i.computed(()=>{var b;return(b=c.value)==null?void 0:b.activities});i.watch(u,(b,E)=>{Pn(b,E)});const d=b=>{r("close",b)},f=()=>{const{name:b,rank:E}=Uo(u.value??[],"activity",n);r("addActivity",{milestoneId:o.milestoneId,name:b,rank:E,projectId:o.projectId})},p=()=>{const b=n("template.defaultName.activity",{idx:1}),E=Qi(u.value??[]);r("addActivity",{milestoneId:o.milestoneId,name:b,rank:E,projectId:o.projectId})},m=b=>{r("updateActivity",b)},h=b=>{u.value&&"moved"in b&&r("updateActivity",{id:b.moved.element.id,rank:Ar(u.value,b.moved.newIndex)})},g=i.computed({get:()=>{var b;return(b=c.value)==null?void 0:b.color},set:b=>{c.value&&r("updateMilestone",{id:c.value.id,color:b})}}),y=i.computed({get:()=>{var b;return((b=c==null?void 0:c.value)==null?void 0:b.deadline)??""},set:b=>{c.value&&r("updateMilestone",{id:c.value.id,deadline:b!=null&&b.length?b:null})}}),C=b=>o.closedStatus?Gc(b,o.closedStatus):!1,v=i.computed(()=>{var b;return((b=o.users)==null?void 0:b.map(E=>({label:`${E.firstName} ${E.lastName}`,value:E.id,avatar:E.avatarUrl})))||[]}),_=i.computed({get(){var b,E;return(E=(b=c.value)==null?void 0:b.assignee)!=null&&E.id?[c.value.assignee.id]:[]},set(b){r("updateMilestone",{id:o.milestoneId,assigneeId:b[0]??null})}}),k=i.computed({get(){var b;return((b=c.value)==null?void 0:b.important)??!1},set(b){r("updateMilestone",{id:o.milestoneId,important:b})}}),w=(b,E)=>{const T=b.currentTarget;T instanceof HTMLElement&&E(T)};return(b,E)=>{var T;return i.openBlock(),i.createElementBlock("div",sme,[i.createElementVNode("header",ame,[i.createElementVNode("div",lme,[i.createVNode(me,{"icon-name":"CloseRounded",variant:"ghost",size:"sm",class:"ao-milestone__close",onClick:d})]),i.createElementVNode("div",cme,[i.createElementVNode("div",ume,[i.createVNode(ct,{title:((T=c.value)==null?void 0:T.name)||t.milestoneId,level:5},null,8,["title"]),i.createVNode(Lg,{modelValue:k.value,"onUpdate:modelValue":E[0]||(E[0]=S=>k.value=S),modelModifiers:{lazy:!0},disabled:!t.isEditable,class:"ao-milestone__important",color:"danger",label:b.$t("activity.important.label"),"icon-name":"FlagRounded",variant:"ghost",size:"sm"},null,8,["modelValue","disabled","label"])])]),c.value?(i.openBlock(),i.createElementBlock("div",dme,[i.createElementVNode("div",fme,[i.createElementVNode("label",pme,[i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":E[1]||(E[1]=S=>y.value=S),class:"ao-milestone__field ao-milestone__date-field",type:"date"},null,512),[[i.vModelText,y.value,void 0,{lazy:!0}]])])]),i.createElementVNode("div",mme,[i.createElementVNode("label",hme,[i.createVNode(Dt,{modelValue:_.value,"onUpdate:modelValue":E[2]||(E[2]=S=>_.value=S),options:v.value,"close-on-select":!0,searchable:!0,max:1,class:"ao-milestone__field ao-milestone__multiselect",placeholder:b.$t("activity.filters.assignee.placeholder"),mode:"tags",disabled:!t.isEditable,caret:t.isEditable},{tag:i.withCtx(({option:S,handleTagRemove:N})=>[i.createVNode(qn,{"user-name":S.label,"avatar-url":S.avatar,"is-closable":!0,onClose:O=>N(S,O)},null,8,["user-name","avatar-url","onClose"])]),_:1},8,["modelValue","options","placeholder","disabled","caret"])])]),i.createVNode(fl,{color:g.value,"onUpdate:color":E[3]||(E[3]=S=>g.value=S)},{clickable:i.withCtx(({openPicker:S,bgColor:N})=>[i.createElementVNode("button",{style:i.normalizeStyle({background:N}),class:"color-button",onClick:O=>w(O,S)},null,12,gme)]),_:1},8,["color"])])):i.createCommentVNode("",!0)]),i.createElementVNode("div",vme,[t.isEditable?(i.openBlock(),i.createElementBlock("div",yme,[i.createElementVNode("button",{type:"button",class:"ao-project-milestone__quick-add",title:b.$t("project.activity.add"),onClick:p},[i.createVNode(ve,{name:"Add",class:"ao-project-milestone__quick-add-icon"})],8,_me)])):i.createCommentVNode("",!0),i.createVNode(i.unref(ho),i.mergeProps({class:"ao-project-milestone__activities",list:u.value,disabled:!t.isEditable,"item-key":"id",group:"kanban"},b.$attrs,{onChange:h}),{item:i.withCtx(({element:S})=>{var N,O,A,D,M;return[i.createVNode(ld,{id:S.id,name:S.name||S.id,"project-id":t.projectId,"phase-name":(N=a.value)==null?void 0:N.name,"milestone-name":(O=c.value)==null?void 0:O.name,"milestone-color":(A=c.value)==null?void 0:A.color,deadline:S.deadline,important:S.important,users:t.users,assignee:S.assignee,slug:S.slug,comments:(D=S.comments)==null?void 0:D.length,attachments:(M=S.attachments)==null?void 0:M.length,tasks:S.tasks,"is-editable":t.isEditable,"is-private":S.private,"is-closed":C(S),onClick:L=>b.$router.push({name:i.unref(je).activity,params:{milestoneId:t.milestoneId,activityId:S.id}}),onUpdateActivity:m,onRemoveAssignee:()=>m({id:S.id,assigneeId:null}),onStartTimer:s},i.createSlots({_:2},[t.isEditable?{name:"secondary",fn:i.withCtx(()=>[t.isEditable&&S.active?(i.openBlock(),i.createBlock(me,{key:0,color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:b.$t("archive"),onClick:i.withModifiers(()=>b.$emit("archiveActivity",{id:S.id}),["stop"])},null,8,["label","onClick"])):i.createCommentVNode("",!0),t.isEditable&&!S.active?(i.openBlock(),i.createBlock(me,{key:1,color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:b.$t("feed.activity.unarchive"),onClick:i.withModifiers(()=>b.$emit("unarchiveActivity",{id:S.id}),["stop"])},null,8,["label","onClick"])):i.createCommentVNode("",!0)]),key:"0"}:void 0]),1032,["id","name","project-id","phase-name","milestone-name","milestone-color","deadline","important","users","assignee","slug","comments","attachments","tasks","is-editable","is-private","is-closed","onClick","onRemoveAssignee"])]}),_:1},16,["list","disabled"]),t.isEditable?(i.openBlock(),i.createElementBlock("div",Cme,[i.createVNode(go,{"icon-name":"Add",label:b.$t("project.activity.add"),onClick:f},null,8,["label"])])):i.createCommentVNode("",!0)])])}}});const bme=i.defineComponent({__name:"AoProjectOverviewActivityDetails",props:{phaseId:{},milestoneId:{},activityId:{},activityTypes:{},activities:{},isTaskCheckable:{type:Function},statuses:{},phases:{},users:{},project:{},userId:{},isEditable:{type:Boolean},attachmentEnabled:{type:Boolean},timeTrackingData:{},loadAttachmentPreview:{type:Function}},emits:["update:activity","addSubtask","updateSubtask","deleteSubtask","addFiles","removeFile","addComment","updateComment","removeComment"],setup(t,{emit:e}){const n=t,o=e,r=i.computed(()=>{var C;return(C=n.phases)==null?void 0:C.find(v=>v.id===n.phaseId)}),s=i.computed(()=>{var C;return(C=n.phases)==null?void 0:C.flatMap(v=>v.milestones)}),a=i.computed(()=>{var C;return(C=s.value)==null?void 0:C.find(v=>v.id===n.milestoneId)}),l=i.computed(()=>{var C;return(C=n.activities)==null?void 0:C.find(v=>v.id===n.activityId)}),c=C=>{o("update:activity",C)},u=C=>{o("addSubtask",C)},d=C=>{o("updateSubtask",C)},f=C=>{o("deleteSubtask",C)},p=C=>{o("addFiles",C)},m=C=>{o("removeFile",C)},h=C=>{o("addComment",C)},g=C=>{o("updateComment",C)},y=C=>{o("removeComment",C)};return(C,v)=>{var _,k;return l.value?(i.openBlock(),i.createBlock(Xu,{key:0,activity:l.value,"activity-types":t.activityTypes,"milestone-id":t.milestoneId,"template-activities":t.activities,"is-template":!1,users:t.users,"user-id":t.userId,"is-task-checkable":t.isTaskCheckable,statuses:t.statuses,breadcrumbs:`${(_=r.value)==null?void 0:_.name} / ${(k=a.value)==null?void 0:k.name}`,"is-editable":t.isEditable,"attachment-enabled":t.attachmentEnabled,projects:[t.project],"time-tracking-data":t.timeTrackingData,"load-attachment-preview":n.loadAttachmentPreview,onClose:C.$router.back,"onUpdate:activity":c,onAddSubtask:u,onUpdateSubtask:d,onDeleteSubtask:f,onAddFiles:p,onRemoveFile:m,onAddComment:h,onUpdateComment:g,onRemoveComment:y},{default:i.withCtx(w=>[i.renderSlot(C.$slots,"default",i.normalizeProps(i.guardReactiveProps(w)))]),_:3},8,["activity","activity-types","milestone-id","template-activities","users","user-id","is-task-checkable","statuses","breadcrumbs","is-editable","attachment-enabled","projects","time-tracking-data","load-attachment-preview","onClose"])):i.createCommentVNode("",!0)}}}),kme={class:"ao-col-header"},wme=i.defineComponent({__name:"AoColHeader",props:{title:{},items:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("header",kme,[i.createVNode(ct,{title:t.title,class:"ao-col-header__title",level:4},null,8,["title"]),t.items?(i.openBlock(),i.createBlock(Bi,{key:0,label:t.items,class:"ao-col-header__items",variant:"solid",color:"primary"},null,8,["label"])):i.createCommentVNode("",!0)]))}});function Eme(t){return i.getCurrentScope()?(i.onScopeDispose(t),!0):!1}function wa(t){return typeof t=="function"?t():i.unref(t)}const xme=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Sme=t=>t!=null,Mi=()=>{};function Tme(t,e){function n(...o){return new Promise((r,s)=>{Promise.resolve(t(()=>e.apply(this,o),{fn:e,thisArg:this,args:o})).then(r).catch(s)})}return n}function Ame(t,e={}){let n,o,r=Mi;const s=l=>{clearTimeout(l),r(),r=Mi};return l=>{const c=wa(t),u=wa(e.maxWait);return n&&s(n),c<=0||u!==void 0&&u<=0?(o&&(s(o),o=null),Promise.resolve(l())):new Promise((d,f)=>{r=e.rejectOnCancel?f:d,u&&!o&&(o=setTimeout(()=>{n&&s(n),o=null,d(l())},u)),n=setTimeout(()=>{o&&s(o),o=null,d(l())},c)})}}function Nme(t,e=200,n={}){return Tme(Ame(e,n),t)}function sc(t){var e;const n=wa(t);return(e=n==null?void 0:n.$el)!=null?e:n}const Dme=xme?window:void 0;function Mme(){const t=i.ref(!1),e=i.getCurrentInstance();return e&&i.onMounted(()=>{t.value=!0},e),t}function Bme(t){const e=Mme();return i.computed(()=>(e.value,!!t()))}function $me(t,e,n={}){const{root:o,rootMargin:r="0px",threshold:s=.1,window:a=Dme,immediate:l=!0}=n,c=Bme(()=>a&&"IntersectionObserver"in a),u=i.computed(()=>{const h=wa(t);return(Array.isArray(h)?h:[h]).map(sc).filter(Sme)});let d=Mi;const f=i.ref(l),p=c.value?i.watch(()=>[u.value,sc(o),f.value],([h,g])=>{if(d(),!f.value||!h.length)return;const y=new IntersectionObserver(e,{root:sc(g),rootMargin:r,threshold:s});h.forEach(C=>C&&y.observe(C)),d=()=>{y.disconnect(),d=Mi}},{immediate:l,flush:"post"}):Mi,m=()=>{d(),p(),f.value=!1};return Eme(m),{isSupported:c,isActive:f,pause(){d(),f.value=!1},resume(){f.value=!0},stop:m}}const Ome={class:i.normalizeClass(["ao-list-kanban"])},Lme={class:"ao-list-kanban__header"},Ime=["title"],Pme={key:0,class:"ao-list-kanban__end ao-list-kanban__end--loading"},Fme={key:1,class:"ao-list-kanban__end"},Vme={key:0,class:"ao-list-kanban__no-more"},Rme={key:1,class:"ao-list-kanban__divider"},zme={key:1,class:"ao-list-kanban__footer"},Ume=i.defineComponent({__name:"AoListKanban",props:{list:{},status:{},users:{},userId:{},title:{},footerLabel:{},isLoading:{type:Boolean},hasMore:{type:Boolean},noMoreLabel:{},isEditable:{type:[Boolean,String]},tagType:{},showHeaderAdd:{type:Boolean}},emits:["add","addAtBeginning","update:list","change:list","loadMore","selectActivity","archiveActivity","unarchiveActivity","updateActivity","startTimer"],setup(t,{emit:e}){const n=t,o=e,r=i.ref(!1),s=i.ref(null);$me(s,([{isIntersecting:f}])=>{r.value=f}),i.watch(r,f=>{f&&n.hasMore&&!n.isLoading&&o("loadMore")});const a=f=>{var p;return n.isEditable===!0?!0:n.userId&&n.isEditable==="only-own"?n.userId===((p=f.assignee)==null?void 0:p.id):!1},l=f=>{o("selectActivity",f)},c=f=>{o("updateActivity",f)},u=f=>{"added"in f?o("updateActivity",{id:f.added.element.id,statusId:n.status.id,rank:Ar(n.list,f.added.newIndex)}):"removed"in f||"moved"in f&&o("updateActivity",{id:f.moved.element.id,rank:Ar(n.list,f.moved.newIndex)})},d=i.ref(!1);return(f,p)=>(i.openBlock(),i.createElementBlock("div",Ome,[t.title||f.$slots.header?i.renderSlot(f.$slots,"header",{},()=>{var m;return[i.createElementVNode("div",Lme,[t.title?(i.openBlock(),i.createBlock(wme,{key:0,class:"ao-list-kanban__col-header",title:t.title,level:3,items:(m=t.list)==null?void 0:m.length},null,8,["title","items"])):i.createCommentVNode("",!0),t.showHeaderAdd?(i.openBlock(),i.createElementBlock("button",{key:1,class:"ao-list-kanban__header-add",title:f.$t("feed.activity.add"),onClick:p[0]||(p[0]=h=>f.$emit("addAtBeginning"))},[i.createVNode(ve,{name:"Add"})],8,Ime)):i.createCommentVNode("",!0)])]},void 0,0):i.createCommentVNode("",!0),i.createVNode(i.unref(ho),i.mergeProps({class:["ao-list-kanban__list",d.value?"ao-list-kanban__transition":void 0],list:t.list,"item-key":"id",group:"kanban","ghost-class":"ao-list-kanban__ghost",animation:"200"},f.$attrs,{draggable:".ao-list-draggable",disabled:!t.isEditable,"component-data":{tag:"transition-group",name:"ao-list-kanban__transition"},onChange:u,onStart:p[2]||(p[2]=m=>d.value=!0),onEnd:p[3]||(p[3]=m=>d.value=!1)}),{item:i.withCtx(({element:m})=>{var h,g,y,C,v,_,k,w,b,E;return[i.createVNode(ld,{id:m.id,class:i.normalizeClass(a(m)?"ao-list-draggable":""),name:m.name,"project-name":(h=m.project)==null?void 0:h.name,"project-id":(g=m.project)==null?void 0:g.id,"project-color":(y=m.project)==null?void 0:y.color,"phase-name":(v=(C=m.milestone)==null?void 0:C.phase)==null?void 0:v.name,"milestone-name":(_=m.milestone)==null?void 0:_.name,"milestone-color":(k=m.milestone)==null?void 0:k.color,deadline:m.deadline,rules:((w=m.rules)==null?void 0:w.length)||0,tasks:m.tasks,description:m.description,important:m.important,type:m.type,comments:(b=m.comments)==null?void 0:b.length,attachments:(E=m.attachments)==null?void 0:E.length,users:t.users,assignee:m.assignee,slug:m.slug,"is-editable":a(m),"is-private":m.private,"tag-type":t.tagType,onUpdateActivity:[T=>a(m)&&c(T),()=>a(m)&&c],onClick:()=>l(m.id),onRemoveAssignee:()=>a(m)&&c({id:m.id,assigneeId:null}),onStartTimer:p[1]||(p[1]=T=>f.$emit("startTimer",T))},{secondary:i.withCtx(()=>[a(m)&&m.active?(i.openBlock(),i.createBlock(me,{key:0,color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:f.$t("feed.activity.archive"),onClick:i.withModifiers(()=>f.$emit("archiveActivity",{id:m.id}),["stop"])},null,8,["label","onClick"])):i.createCommentVNode("",!0),a(m)&&!m.active?(i.openBlock(),i.createBlock(me,{key:1,color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:f.$t("feed.activity.unarchive"),onClick:i.withModifiers(()=>f.$emit("unarchiveActivity",{id:m.id}),["stop"])},null,8,["label","onClick"])):i.createCommentVNode("",!0)]),_:2},1032,["id","class","name","project-name","project-id","project-color","phase-name","milestone-name","milestone-color","deadline","rules","tasks","description","important","type","comments","attachments","users","assignee","slug","is-editable","is-private","tag-type","onUpdateActivity","onClick","onRemoveAssignee"])]}),footer:i.withCtx(()=>[t.isLoading?(i.openBlock(),i.createElementBlock("div",Pme,[i.createVNode(ve,{name:"Loading"})])):t.hasMore?(i.openBlock(),i.createElementBlock("div",{key:2,ref_key:"scrollEnd",ref:s,class:"ao-list-kanban__end"},null,512)):(i.openBlock(),i.createElementBlock("div",Fme,[t.noMoreLabel?(i.openBlock(),i.createElementBlock("span",Vme,i.toDisplayString(t.noMoreLabel),1)):t.isEditable?(i.openBlock(),i.createElementBlock("span",Rme)):i.createCommentVNode("",!0)]))]),_:1},16,["class","list","disabled"]),f.$slots.footer||t.footerLabel?(i.openBlock(),i.createElementBlock("div",zme,[i.renderSlot(f.$slots,"footer",{},()=>[t.isEditable?(i.openBlock(),i.createBlock(go,{key:0,"icon-name":"AddBoxOutlineRounded",label:t.footerLabel,onClick:p[4]||(p[4]=m=>f.$emit("add"))},null,8,["label"])):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0)]))}});const qme={class:"ao-field ao-search-field"},Hme=["value","placeholder"],jme=i.defineComponent({__name:"AoSearchField",props:{modelValue:{},delay:{default:250},placeholder:{default:"Search"}},emits:["update:modelValue","clear"],setup(t,{emit:e}){const n=t,o=e,r=async l=>{const u=l.target.value;o("update:modelValue",u,l)},s=Nme(r,n.delay),a=l=>{o("clear",l)};return(l,c)=>(i.openBlock(),i.createElementBlock("div",qme,[i.createElementVNode("input",{value:t.modelValue,type:"text",class:"ao-field__input ao-search-field__input",placeholder:t.placeholder,onInput:c[0]||(c[0]=(...u)=>i.unref(s)&&i.unref(s)(...u)),onKeypress:i.withKeys(r,["enter"])},null,40,Hme),i.createVNode(ve,{name:"SearchRounded",class:i.normalizeClass(`ao-search-field__icon ao-search-field__action ${t.modelValue?"":"ao-search-field__action--visible"}`)},null,8,["class"]),i.createVNode(me,{"icon-name":"CloseRounded",size:"sm",color:"primary",corners:"round",class:i.normalizeClass(`ao-search-field__button ao-search-field__action ${t.modelValue?"ao-search-field__action--visible":""}`),onClick:a},null,8,["class"])]))}});const Wme={class:"ao-feed"},Zme={class:"ao-feed__filters"},Kme={class:"ao-feed__body"},Vg=i.defineComponent({__name:"AoFeed",props:{activities:{},statuses:{},project:{},projects:{},filters:{},activityTypes:{},users:{},userId:{},initialActivityId:{},initialActivitySlug:{},searchText:{default:""},showsArchivedActivities:{type:Boolean},showsOnlyImportant:{type:Boolean},showsOnlyNonAssigned:{type:Boolean},selectedActivity:{},isTaskCheckable:{type:Function,default:void 0},isEditable:{type:[Boolean,String]},attachmentEnabled:{type:Boolean,default:!0},timeTrackingData:{},loadAttachmentPreview:{}},emits:["change:activities","addActivity","update:filters","selectActivity","update:activity","archiveActivity","unarchiveActivity","update:searchText","clear:searchText","update:showsArchivedActivities","update:showsOnlyImportant","update:showsOnlyNonAssigned","addSubtask","updateSubtask","deleteSubtask","addFiles","removeFile","addComment","updateComment","removeComment","toast","startTimer"],setup(t,{emit:e}){const{t:n}=wn(),o=t,r=e;function s(P,re){r("toast",P,re)}const a=i.toRef(o,"activities"),l=async(P,re)=>{await r("selectActivity",P,re)},c=i.ref({}),u=i.ref(!1),d=i.ref(!1),f=i.computed(()=>o.project?"milestone":"project");i.watch([()=>o.statuses,()=>o.activities,()=>o.initialActivityId,()=>o.initialActivitySlug],async([P,re,oe,G],[z,te])=>{c.value=Object.fromEntries(P.map(de=>[de.id,re.filter(xe=>{var V;return((V=xe.status)==null?void 0:V.id)===de.id})])),oe&&!u.value?(l(oe,null),u.value=!0):G&&!u.value&&(l(null,G),u.value=!0),d.value&&Pn(re,te)},{immediate:!0});const p=i.computed(()=>{var P;return!o.selectedActivity||!o.selectedActivity.milestone?"":`${((P=o.selectedActivity.milestone.phase)==null?void 0:P.name)??""} / ${o.selectedActivity.milestone.name??""}`}),m=P=>{var te,de;const re=(te=o.activities)==null?void 0:te.at(-1),oe=re?Je.LexoRank.parse(re.rank).genNext():Je.LexoRank.middle(),G=((de=o.activities)==null?void 0:de.length)??0,z={name:n("activity.defaultName",{idx:G+1}),rank:oe.format(),statusId:P.id};o.filters.assigneeId.length>0&&(z.assigneeId=o.filters.assigneeId[0]),o.filters.projectId.length>0&&(z.projectId=o.filters.projectId[0]),o.filters.typeId.length>0&&(z.typeId=o.filters.typeId[0]),d.value=!0,r("addActivity",z)},h=P=>{var te,de;const re=((te=o.activities)==null?void 0:te.filter(xe=>{var V;return((V=xe.status)==null?void 0:V.id)===P.id}))??[],oe=Qi(re),G=((de=o.activities)==null?void 0:de.length)??0,z={name:n("activity.defaultName",{idx:G+1}),rank:oe,statusId:P.id};o.filters.assigneeId.length>0&&(z.assigneeId=o.filters.assigneeId[0]),o.filters.projectId.length>0&&(z.projectId=o.filters.projectId[0]),o.filters.typeId.length>0&&(z.typeId=o.filters.typeId[0]),d.value=!0,r("addActivity",z)},g=(P,re)=>{d.value=!1,r("update:filters",{...o.filters,[P]:re})},y=i.computed(()=>o.project?[o.project]:o.projects??[]),C=i.computed(()=>y.value.map(P=>({value:P.id,label:P.name}))),v=i.computed(()=>{var P;return(P=o.activityTypes)==null?void 0:P.map(re=>({value:re.id,label:re.name}))}),_=i.computed(()=>o.users.map(P=>({value:P.id,label:`${P.firstName} ${P.lastName}`,avatar:P.avatarUrl}))),k=P=>{o.selectedActivity&&r("update:activity",P)},w=P=>{r("update:activity",P)},b=P=>{r("archiveActivity",P)},E=P=>{r("unarchiveActivity",P)},T=P=>{var re;r("startTimer",P),(re=window.parent)==null||re.postMessage({type:"startTimer",data:P},"*")},S=P=>{d.value=!1,r("update:searchText",P)},N=P=>{d.value=!1,r("clear:searchText",P)},O=P=>{o.selectedActivity&&r("addSubtask",P)},A=P=>{o.selectedActivity&&r("updateSubtask",P)},D=P=>{o.selectedActivity&&r("deleteSubtask",P)},M=P=>{r("addFiles",P)},L=P=>{r("removeFile",P)},I=P=>{o.selectedActivity&&r("addComment",{...P,activityId:o.selectedActivity.id})},j=P=>{const{id:re}=o.selectedActivity||{};re&&r("updateComment",P)},R=P=>{const{id:re}=o.selectedActivity||{};re&&r("removeComment",P)},q=Ki.useRouter(),F=i.ref("feed"),Q=[{label:"Overview",value:"overview"},{label:"Feed",value:"feed"},{label:"Mapping",value:"mapping"}];return i.watch(F,P=>{P==="feed"?(q.push({name:je.feed}),console.log("Navigating to feed...")):P==="overview"?(q.push({name:je.project}),console.log("Navigating to feed...")):P==="mapping"&&(q.push({name:je.mapping}),console.log("Navigating to feed..."))}),(P,re)=>{var oe;return i.openBlock(),i.createElementBlock("div",Wme,[i.createVNode(es,null,{primary:i.withCtx(()=>[i.createElementVNode("div",Zme,[i.createVNode(ps,{modelValue:F.value,"onUpdate:modelValue":re[0]||(re[0]=G=>F.value=G),tabs:Q},null,8,["modelValue"]),i.createVNode(jme,{"model-value":t.searchText,placeholder:P.$t("feed.search.placeholder"),class:"ao-feed__search","onUpdate:modelValue":S,onClear:N},null,8,["model-value","placeholder"]),o.project?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(Dt,{key:0,"model-value":t.filters[i.unref(No).project],mode:"tags",options:C.value,"close-on-select":!1,searchable:!0,class:"ao-feed__filter ao-feed__filter__projects",placeholder:P.$t("feed.filters.project.placeholder"),"onUpdate:modelValue":re[1]||(re[1]=G=>g(i.unref(No).project,G))},null,8,["model-value","options","placeholder"])),v.value?(i.openBlock(),i.createBlock(Dt,{key:1,"model-value":t.filters[i.unref(No).type],mode:"tags",options:v.value,"close-on-select":!1,searchable:!0,class:"ao-feed__filter ao-feed__filter__types",placeholder:P.$t("feed.filters.activityType.placeholder"),"onUpdate:modelValue":re[2]||(re[2]=G=>g(i.unref(No).type,G))},null,8,["model-value","options","placeholder"])):i.createCommentVNode("",!0),_.value.length?(i.openBlock(),i.createBlock(Dt,{key:2,"model-value":t.filters[i.unref(No).assignee],mode:"tags",options:_.value,"close-on-select":!1,searchable:!0,class:"ao-feed__filter ao-feed__filter__assignees",placeholder:P.$t("feed.filters.assignee.placeholder"),"onUpdate:modelValue":re[3]||(re[3]=G=>g(i.unref(No).assignee,G))},{tag:i.withCtx(({option:G,handleTagRemove:z})=>[i.createVNode(qn,{"user-name":G.label,"avatar-url":G.avatar,"is-closable":!0,onClose:te=>z(G,te)},null,8,["user-name","avatar-url","onClose"])]),_:1},8,["model-value","options","placeholder"])):i.createCommentVNode("",!0)]),i.createVNode(me,{class:"ao-feed__only-non-assigned",size:"sm","icon-name":t.showsOnlyNonAssigned?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:P.$t("feed.filters.showsOnlyNonAssigned.label"),role:"checkbox","aria-checked":t.showsOnlyNonAssigned,onClick:re[4]||(re[4]=G=>P.$emit("update:showsOnlyNonAssigned",!t.showsOnlyNonAssigned))},null,8,["icon-name","label","aria-checked"]),i.createVNode(me,{class:"ao-feed__only-important",size:"sm","icon-name":t.showsOnlyImportant?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:P.$t("feed.filters.showsOnlyImportant.label"),role:"checkbox","aria-checked":t.showsOnlyImportant,onClick:re[5]||(re[5]=G=>P.$emit("update:showsOnlyImportant",!t.showsOnlyImportant))},null,8,["icon-name","label","aria-checked"]),i.createVNode(me,{class:"ao-feed__show-archived",size:"sm","icon-name":t.showsArchivedActivities?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:P.$t("feed.filters.showsArchivedActivities.label"),role:"checkbox","aria-checked":t.showsArchivedActivities,onClick:re[6]||(re[6]=G=>P.$emit("update:showsArchivedActivities",!t.showsArchivedActivities))},null,8,["icon-name","label","aria-checked"])]),_:1}),i.createElementVNode("div",Kme,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.statuses,G=>(i.openBlock(),i.createBlock(Ume,{key:G.id,status:G,list:c.value[G.id],title:G.name,"footer-label":P.$t("feed.activity.add"),users:t.users,"user-id":t.userId,"is-editable":t.isEditable,"tag-type":f.value,"show-header-add":t.isEditable,onAdd:()=>m(G),onAddAtBeginning:()=>h(G),onSelectActivity:l,onArchiveActivity:b,onUnarchiveActivity:E,onUpdateActivity:w,onStartTimer:T},null,8,["status","list","title","footer-label","users","user-id","is-editable","tag-type","show-header-add","onAdd","onAddAtBeginning"]))),128))]),(i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[t.selectedActivity?(i.openBlock(),i.createBlock(Xu,{key:0,activity:t.selectedActivity,"activity-types":t.activityTypes,"milestone-id":(oe=t.selectedActivity.milestone)==null?void 0:oe.id,"template-activities":a.value,users:t.users,"user-id":t.userId,"is-task-checkable":t.isTaskCheckable,statuses:t.statuses,breadcrumbs:p.value,"is-editable":t.isEditable,"attachment-enabled":t.attachmentEnabled,projects:y.value,"time-tracking-data":t.timeTrackingData,"load-attachment-preview":o.loadAttachmentPreview,onClose:re[7]||(re[7]=()=>l(null,null)),"onUpdate:activity":k,onAddSubtask:O,onUpdateSubtask:A,onDeleteSubtask:D,onAddFiles:M,onRemoveFile:L,onAddComment:I,onUpdateComment:j,onRemoveComment:R,onToast:s},{default:i.withCtx(G=>[i.renderSlot(P.$slots,"activityDetailsBody",i.normalizeProps(i.guardReactiveProps(G)))]),_:3},8,["activity","activity-types","milestone-id","template-activities","users","user-id","is-task-checkable","statuses","breadcrumbs","is-editable","attachment-enabled","projects","time-tracking-data","load-attachment-preview"])):i.createCommentVNode("",!0)]))])}}});const Gme={class:"ao-project-mapping"},Yme={class:"ao-project-mapping-mapping__body"},Jme={class:"ao-project-mapping-mapping__phases"},Xme={key:0,class:"ao-project-mapping-mapping__image-wrapper"},Qme=["src","alt"],ehe=i.defineComponent({__name:"AoMapping",props:{project:{},phases:{},closedStatus:{},users:{},userId:{},templates:{},isTaskCheckable:{type:Function},statuses:{},activityTypes:{},isEditable:{type:[Boolean,String]},showsArchived:{type:Boolean},attachmentEnabled:{type:Boolean}},emits:["addPhase","updatePhase","archivePhase","unarchivePhase","copyPhaseToTemplate","applyTemplate","saveTemplate","update:showsArchived"],setup(t,{emit:e}){const{t:n}=wn(),o=t,r=e,s=()=>{const{name:v,rank:_}=Uo(o.phases,"phase",n);r("addPhase",{name:v,rank:_,projectId:o.project.id})},a=()=>{const v=n("template.defaultName.phase",{idx:1}),_=Qi(o.phases);r("addPhase",{name:v,rank:_,projectId:o.project.id})},l=v=>{r("updatePhase",v)},c=v=>{r("archivePhase",v)},u=v=>{r("unarchivePhase",v)},d=v=>{r("copyPhaseToTemplate",v)},f=i.ref(!1),p=i.ref(!1),m=(v,_)=>{r("applyTemplate",{templateId:v,projectId:_}),f.value=!1},h=(v,_)=>{var b;const k=(b=o.templates)==null?void 0:b.at(-1),w=k?Je.LexoRank.parse(k.rank).genNext():Je.LexoRank.middle();r("saveTemplate",{templateName:v,rank:w.format(),phaseIds:_}),p.value=!1},g=Ki.useRouter(),y=i.ref("mapping"),C=[{label:"Overview",value:"overview"},{label:"Feed",value:"feed"},{label:"Mapping",value:"mapping"}];return i.watch(y,v=>{v==="feed"?(g.push({name:je.feed}),console.log("Navigating to feed...")):v==="overview"?(g.push({name:je.project}),console.log("Navigating to feed...")):v==="mapping"&&(g.push({name:je.mapping}),console.log("Navigating to feed..."))}),(v,_)=>{var k;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("div",i.mergeProps({class:"ao-project-mapping-overview"},v.$attrs),[i.createElementVNode("div",Gme,[i.createVNode(es,null,{primary:i.withCtx(()=>[i.createVNode(ps,{modelValue:y.value,"onUpdate:modelValue":_[0]||(_[0]=w=>y.value=w),tabs:C},null,8,["modelValue"]),t.isEditable===!0?(i.openBlock(),i.createBlock(me,{key:0,class:"ao-mapping__quick-add-phase",size:"sm","icon-name":"Add","icon-position":"start",color:"primary",variant:"ghost",label:v.$t("project.phase.add"),onClick:a},null,8,["label"])):i.createCommentVNode("",!0),i.createVNode(me,{class:"ao-feed__show-archived",size:"sm","icon-name":t.showsArchived?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:v.$t("feed.filters.showsArchived.label"),role:"checkbox","aria-checked":t.showsArchived,onClick:_[1]||(_[1]=w=>v.$emit("update:showsArchived",!t.showsArchived))},null,8,["icon-name","label","aria-checked"])]),secondary:i.withCtx(()=>[t.isEditable===!0?(i.openBlock(),i.createBlock(me,{key:0,class:"ao-project-mapping-overview__save-as-template",color:"primary",label:v.$t("project.template.save.label"),onClick:_[2]||(_[2]=w=>p.value=!0)},null,8,["label"])):i.createCommentVNode("",!0),t.isEditable===!0?(i.openBlock(),i.createBlock(me,{key:1,class:"ao-project-mapping-overview__add-template",color:"primary",label:v.$t("project.template.apply.label"),onClick:_[3]||(_[3]=w=>f.value=!0)},null,8,["label"])):i.createCommentVNode("",!0)]),_:1}),i.createElementVNode("div",Yme,[i.createElementVNode("div",Jme,[i.createVNode(ad,{phases:t.phases,"closed-status":t.closedStatus,"is-editable":t.isEditable===!0,users:t.users,"estimation-unit":(k=t.project)==null?void 0:k.estimationUnit,onAddPhase:s,onUpdatePhase:l,onArchivePhase:c,onUnarchivePhase:u,onCopyPhaseToTemplate:d},null,8,["phases","closed-status","is-editable","users","estimation-unit"])]),t.project.architectureImage?(i.openBlock(),i.createElementBlock("div",Xme,[i.createElementVNode("img",{class:"architecture-image",src:t.project.architectureImage.url,alt:i.unref(n)("architectureImage.alt")},null,8,Qme)])):i.createCommentVNode("",!0)])])],16),(i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[p.value?(i.openBlock(),i.createBlock(Fg,{key:0,phases:t.phases,onClose:_[4]||(_[4]=w=>p.value=!1),onSave:h},null,8,["phases"])):i.createCommentVNode("",!0),f.value?(i.openBlock(),i.createBlock(Pg,{key:1,"project-id":t.project.id,templates:t.templates,onClose:_[5]||(_[5]=w=>f.value=!1),onApply:m},null,8,["project-id","templates"])):i.createCommentVNode("",!0)]))],64)}}});const Po={TEMPLATES:"templates",TEMPLATE_DETAILS:"template_details",TEMPLATES_LIST:"templates_list"},the=(t,e={})=>[{path:t,name:Po.TEMPLATES,redirect:{name:Po.TEMPLATES_LIST},...e,children:[{path:"",name:Po.TEMPLATES_LIST,component:Rg},{path:":templateId/:phaseId?/:milestoneId?/:activityId?",name:Po.TEMPLATE_DETAILS,component:Ig,props:!0}]}],je={project:"AoProject",feed:"AoProjectFeed",mapping:"AoProjectMapping",milestone:"AoMilestone",activity:"AoActivity"},nhe=(t,e={})=>[{path:t,...e,redirect:{name:je.project},children:[{path:"",name:je.project,component:Ipe,props:!0,children:[{path:":phaseId/:milestoneId",name:je.milestone,component:up,props:!0},{path:":phaseId/:milestoneId/:activityId",name:je.activity,props:{default:!0,modal:!0},components:{default:up,modal:bme}}]},{path:"feed",name:je.feed,component:Vg,props:!0},{path:"mapping",name:je.mapping,component:ehe,props:!0}]}],ohe={class:"ao-templates"},Rg=i.defineComponent({__name:"AoTemplatesList",props:{templates:{}},emits:["addTemplate","updateTemplates","updateItem","removeItem"],setup(t,{emit:e}){const{t:n}=wn(),o=t,r=e;i.watch(()=>o.templates,(u,d)=>{Pn(u,d)});const s=()=>{var m,h;const u=(m=o.templates)==null?void 0:m.at(-1),d=u?Je.LexoRank.parse(u.rank).genNext():Je.LexoRank.middle(),f=((h=o.templates)==null?void 0:h.length)??0,p={name:n("template.defaultName.template",{idx:f+1}),rank:d.format()};r("addTemplate",p)},a=(u,d)=>{r("updateItem",{itemType:Oe.TEMPLATES,id:u,templateId:u,data:{name:d}})},l=(u,d)=>{r("removeItem",{itemType:Oe.TEMPLATES,templateId:u,data:{id:u,...d?{name:d}:{}}})},c=u=>{if(u.moved){const d=Xi(u,o.templates??[]);r("updateItem",{itemType:Oe.TEMPLATES,id:u.moved.element.id,templateId:u.moved.element.id,data:{rank:d}})}};return(u,d)=>(i.openBlock(),i.createElementBlock("div",ohe,[i.createVNode(es,null,{secondary:i.withCtx(()=>[i.createVNode(me,{label:u.$t("templates.new"),color:"primary","icon-name":"Add","icon-position":"start",onClick:s},null,8,["label"])]),_:1}),i.createVNode(i.unref(ho),{"model-value":t.templates,class:"ao-templates__list","item-key":"id",handle:".ao-card__drag",onChange:c},{item:i.withCtx(({element:f})=>{var p;return[i.createVNode(U_,{id:f.id,title:f.name,phases:f.phases,milestones:(p=f.phases)!=null&&p.length?i.unref(f_)(f.phases):0,activities:f.phases?i.unref(p_)(f.phases):0,"updated-at":f.updatedAt,"updated-by":f.updatedBy,onUpdateTitle:m=>a(f.id,m),onClick:m=>u.$router.push({name:i.unref(Po).TEMPLATE_DETAILS,params:{templateId:f.id}}),onDeleteItem:d[0]||(d[0]=(m,h)=>l(m,h))},null,8,["id","title","phases","milestones","activities","updated-at","updated-by","onUpdateTitle","onClick"])]}),_:1},8,["model-value"])]))}});const rhe={class:"ao-field__label"},zg=i.defineComponent({__name:"AoField",props:{label:{},isMultiselect:{type:Boolean,default:!1}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("label",{class:i.normalizeClass(["ao-field",{"ao-field--multiselect":t.isMultiselect}])},[i.createElementVNode("span",rhe,i.toDisplayString(t.label),1),i.renderSlot(e.$slots,"default")],2))}}),ihe=["type","value","disabled","readonly"],she=i.defineComponent({__name:"AoInputField",props:{label:{default:""},type:{default:"text"},modelValue:{default:""},modelModifiers:{default:()=>({})},isDisabled:{type:Boolean,default:!1},isReadonly:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,o=e,r=i.computed(()=>n.modelModifiers.lazy?"change":"input"),s=a=>{n.modelModifiers.number&&(a=Number(a)),o("update:modelValue",a)};return(a,l)=>(i.openBlock(),i.createBlock(zg,{label:t.label},{default:i.withCtx(()=>[i.createElementVNode("input",i.mergeProps({class:"ao-field__input",type:t.type,value:t.modelValue,disabled:t.isDisabled,readonly:t.isReadonly},{[i.toHandlerKey(r.value)]:l[0]||(l[0]=c=>s(c.target.value))}),null,16,ihe)]),_:1},8,["label"]))}}),ahe={class:"ao-field"},lhe={class:"ao-field__label"},che=["checked","disabled"],uhe=i.defineComponent({__name:"AoCheckboxField",props:{label:{default:""},modelValue:{type:Boolean,default:!1},isReadonly:{type:Boolean,default:!1},isDisabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("label",ahe,[i.createElementVNode("span",lhe,i.toDisplayString(t.label),1),i.createElementVNode("input",{class:"ao-field__input",type:"checkbox",checked:t.modelValue,disabled:t.isDisabled,onChange:n[0]||(n[0]=o=>{var r;return e.$emit("update:modelValue",((r=o.target)==null?void 0:r.checked)??!1)})},null,40,che)]))}});exports.AoAvatar=qn;exports.AoCardFeed=ld;exports.AoCheckboxField=uhe;exports.AoColorPicker=fl;exports.AoFeed=Vg;exports.AoField=zg;exports.AoInputField=she;exports.AoMultiselect=Dt;exports.AoProjectPhases=ad;exports.AoTabBar=ps;exports.AoTemplateDetails=Ig;exports.AoTemplates=Yg;exports.AoTemplatesList=Rg;exports.EstimationUnit=vp;exports.TemplateItemTypeEnum=gp;exports.activityFeedStatus=Ey;exports.durationTypes=wy;exports.feedFilterTypes=No;exports.getProjectOverviewRoutes=nhe;exports.getTemplateRoutes=the;exports.listUpdateTypes=xy;exports.milestoneStatus=$i;exports.projectOverviewRoutes=je;exports.ruleComparators=pp;exports.ruleDurationUnits=hp;exports.ruleTriggerTypes=mp;exports.templateItemType=Oe;exports.templateRouteNames=Po;
|
|
58
|
+
*/function Ao(t){let e={r:0,g:0,b:0,a:1};/#/.test(t)?e=afe(t):/rgb/.test(t)?e=cp(t):typeof t=="string"?e=cp(`rgba(${t})`):Object.prototype.toString.call(t)==="[object Object]"&&(e=t);const{r:n,g:o,b:r,a:s}=e,{h:a,s:l,v:c}=lfe(e);return{r:n,g:o,b:r,a:s===void 0?1:s,h:a,s:l,v:c}}function Qu(t){const e=document.createElement("canvas"),n=e.getContext("2d"),o=t*2;return e.width=o,e.height=o,n.fillStyle="#ffffff",n.fillRect(0,0,o,o),n.fillStyle="#ccd5db",n.fillRect(0,0,t,t),n.fillRect(t,t,t,t),e}function Wc(t,e,n,o,r,s){const a=t==="l",l=e.createLinearGradient(0,0,a?n:0,a?0:o);l.addColorStop(.01,r),l.addColorStop(.99,s),e.fillStyle=l,e.fillRect(0,0,n,o)}function sfe({r:t,g:e,b:n},o){const r=a=>("0"+Number(a).toString(16)).slice(-2),s=`#${r(t)}${r(e)}${r(n)}`;return o?s.toUpperCase():s}function afe(t){t=t.slice(1);const e=n=>parseInt(n,16)||0;return{r:e(t.slice(0,2)),g:e(t.slice(2,4)),b:e(t.slice(4,6))}}function cp(t){return typeof t=="string"?(t=(/rgba?\((.*?)\)/.exec(t)||["","0,0,0,1"])[1].split(","),{r:Number(t[0])||0,g:Number(t[1])||0,b:Number(t[2])||0,a:Number(t[3]?t[3]:1)}):t}function lfe({r:t,g:e,b:n}){t=t/255,e=e/255,n=n/255;const o=Math.max(t,e,n),r=Math.min(t,e,n),s=o-r;let a=0;o===r?a=0:o===t?e>=n?a=60*(e-n)/s:a=60*(e-n)/s+360:o===e?a=60*(n-t)/s+120:o===n&&(a=60*(t-e)/s+240),a=Math.floor(a);let l=parseFloat((o===0?0:1-r/o).toFixed(2)),c=parseFloat(o.toFixed(2));return{h:a,s:l,v:c}}var ed=i.defineComponent({props:{color:{type:String,default:"#000000"},hsv:{type:Object,default:null},size:{type:Number,default:152}},emits:["selectSaturation"],data(){return{slideSaturationStyle:{}}},mounted(){this.renderColor(),this.renderSlide()},methods:{renderColor(){const t=this.$refs.canvasSaturation,e=this.size,n=t.getContext("2d");t.width=e,t.height=e,n.fillStyle=this.color,n.fillRect(0,0,e,e),Wc("l",n,e,e,"#FFFFFF","rgba(255,255,255,0)"),Wc("p",n,e,e,"rgba(0,0,0,0)","#000000")},renderSlide(){this.slideSaturationStyle={left:this.hsv.s*this.size-5+"px",top:(1-this.hsv.v)*this.size-5+"px"}},selectSaturation(t){const{top:e,left:n}=this.$el.getBoundingClientRect(),o=t.target.getContext("2d"),r=a=>{let l=a.clientX-n,c=a.clientY-e;l<0&&(l=0),c<0&&(c=0),l>this.size&&(l=this.size),c>this.size&&(c=this.size),this.slideSaturationStyle={left:l-5+"px",top:c-5+"px"};const u=o.getImageData(Math.min(l,this.size-1),Math.min(c,this.size-1),1,1),[d,f,p]=u.data;this.$emit("selectSaturation",{r:d,g:f,b:p})};r(t);const s=()=>{document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",s)};document.addEventListener("mousemove",r),document.addEventListener("mouseup",s)}}});const cfe={ref:"canvasSaturation"};function ufe(t,e,n,o,r,s){return i.openBlock(),i.createBlock("div",{class:"saturation",onMousedown:e[1]||(e[1]=i.withModifiers((...a)=>t.selectSaturation&&t.selectSaturation(...a),["prevent","stop"]))},[i.createVNode("canvas",cfe,null,512),i.createVNode("div",{style:t.slideSaturationStyle,class:"slide"},null,4)],32)}ed.render=ufe;ed.__file="src/color/Saturation.vue";var td=i.defineComponent({props:{hsv:{type:Object,default:null},width:{type:Number,default:15},height:{type:Number,default:152}},emits:["selectHue"],data(){return{slideHueStyle:{}}},mounted(){this.renderColor(),this.renderSlide()},methods:{renderColor(){const t=this.$refs.canvasHue,e=this.width,n=this.height,o=t.getContext("2d");t.width=e,t.height=n;const r=o.createLinearGradient(0,0,0,n);r.addColorStop(0,"#FF0000"),r.addColorStop(.17*1,"#FF00FF"),r.addColorStop(.17*2,"#0000FF"),r.addColorStop(.17*3,"#00FFFF"),r.addColorStop(.17*4,"#00FF00"),r.addColorStop(.17*5,"#FFFF00"),r.addColorStop(1,"#FF0000"),o.fillStyle=r,o.fillRect(0,0,e,n)},renderSlide(){this.slideHueStyle={top:(1-this.hsv.h/360)*this.height-2+"px"}},selectHue(t){const{top:e}=this.$el.getBoundingClientRect(),n=t.target.getContext("2d"),o=s=>{let a=s.clientY-e;a<0&&(a=0),a>this.height&&(a=this.height),this.slideHueStyle={top:a-2+"px"};const l=n.getImageData(0,Math.min(a,this.height-1),1,1),[c,u,d]=l.data;this.$emit("selectHue",{r:c,g:u,b:d})};o(t);const r=()=>{document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",r)};document.addEventListener("mousemove",o),document.addEventListener("mouseup",r)}}});const dfe={ref:"canvasHue"};function ffe(t,e,n,o,r,s){return i.openBlock(),i.createBlock("div",{class:"hue",onMousedown:e[1]||(e[1]=i.withModifiers((...a)=>t.selectHue&&t.selectHue(...a),["prevent","stop"]))},[i.createVNode("canvas",dfe,null,512),i.createVNode("div",{style:t.slideHueStyle,class:"slide"},null,4)],32)}td.render=ffe;td.__file="src/color/Hue.vue";var nd=i.defineComponent({props:{color:{type:String,default:"#000000"},rgba:{type:Object,default:null},width:{type:Number,default:15},height:{type:Number,default:152}},emits:["selectAlpha"],data(){return{slideAlphaStyle:{},alphaSize:5}},watch:{color(){this.renderColor()},"rgba.a"(){this.renderSlide()}},mounted(){this.renderColor(),this.renderSlide()},methods:{renderColor(){const t=this.$refs.canvasAlpha,e=this.width,n=this.height,o=this.alphaSize,r=Qu(o),s=t.getContext("2d");t.width=e,t.height=n,s.fillStyle=s.createPattern(r,"repeat"),s.fillRect(0,0,e,n),Wc("p",s,e,n,"rgba(255,255,255,0)",this.color)},renderSlide(){this.slideAlphaStyle={top:this.rgba.a*this.height-2+"px"}},selectAlpha(t){const{top:e}=this.$el.getBoundingClientRect(),n=r=>{let s=r.clientY-e;s<0&&(s=0),s>this.height&&(s=this.height);let a=parseFloat((s/this.height).toFixed(2));this.$emit("selectAlpha",a)};n(t);const o=()=>{document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",o)};document.addEventListener("mousemove",n),document.addEventListener("mouseup",o)}}});const pfe={ref:"canvasAlpha"};function mfe(t,e,n,o,r,s){return i.openBlock(),i.createBlock("div",{class:"color-alpha",onMousedown:e[1]||(e[1]=i.withModifiers((...a)=>t.selectAlpha&&t.selectAlpha(...a),["prevent","stop"]))},[i.createVNode("canvas",pfe,null,512),i.createVNode("div",{style:t.slideAlphaStyle,class:"slide"},null,4)],32)}nd.render=mfe;nd.__file="src/color/Alpha.vue";var od=i.defineComponent({props:{color:{type:String,default:"#000000"},width:{type:Number,default:100},height:{type:Number,default:30}},data(){return{alphaSize:5}},watch:{color(){this.renderColor()}},mounted(){this.renderColor()},methods:{renderColor(){const t=this.$el,e=this.width,n=this.height,o=this.alphaSize,r=Qu(o),s=t.getContext("2d");t.width=e,t.height=n,s.fillStyle=s.createPattern(r,"repeat"),s.fillRect(0,0,e,n),s.fillStyle=this.color,s.fillRect(0,0,e,n)}}});function hfe(t,e,n,o,r,s){return i.openBlock(),i.createBlock("canvas")}od.render=hfe;od.__file="src/color/Preview.vue";var rd=i.defineComponent({props:{suckerCanvas:{type:Object,default:null},suckerArea:{type:Array,default:()=>[]}},data(){return{isOpenSucker:!1,suckerPreview:null,isSucking:!1}},watch:{suckerCanvas(t){this.isSucking=!1,this.suckColor(t)}},methods:{openSucker(){this.isOpenSucker?this.keydownHandler({keyCode:27}):(this.isOpenSucker=!0,this.isSucking=!0,this.$emit("openSucker",!0),document.addEventListener("keydown",this.keydownHandler))},keydownHandler(t){t.keyCode===27&&(this.isOpenSucker=!1,this.isSucking=!1,this.$emit("openSucker",!1),document.removeEventListener("keydown",this.keydownHandler),document.removeEventListener("mousemove",this.mousemoveHandler),document.removeEventListener("mouseup",this.mousemoveHandler),this.suckerPreview&&(document.body.removeChild(this.suckerPreview),this.suckerPreview=null))},mousemoveHandler(t){const{clientX:e,clientY:n}=t,{top:o,left:r,width:s,height:a}=this.suckerCanvas.getBoundingClientRect(),l=e-r,c=n-o,d=this.suckerCanvas.getContext("2d").getImageData(Math.min(l,s-1),Math.min(c,a-1),1,1);let[f,p,m,h]=d.data;h=parseFloat((h/255).toFixed(2));const g=this.suckerPreview.style;Object.assign(g,{position:"absolute",left:e+20+"px",top:n-36+"px",width:"24px",height:"24px",borderRadius:"50%",border:"2px solid #fff",boxShadow:"0 0 8px 0 rgba(0, 0, 0, 0.16)",background:`rgba(${f}, ${p}, ${m}, ${h})`,zIndex:95}),this.suckerArea.length&&e>=this.suckerArea[0]&&n>=this.suckerArea[1]&&e<=this.suckerArea[2]&&n<=this.suckerArea[3]?g.display="":g.display="none"},suckColor(t){t&&t.tagName!=="CANVAS"||(this.suckerPreview=document.createElement("div"),this.suckerPreview&&document.body.appendChild(this.suckerPreview),document.addEventListener("mousemove",this.mousemoveHandler),document.addEventListener("mouseup",this.mousemoveHandler),t.addEventListener("click",e=>{const{clientX:n,clientY:o}=e,{top:r,left:s,width:a,height:l}=t.getBoundingClientRect(),c=n-s,u=o-r,f=t.getContext("2d").getImageData(Math.min(c,a-1),Math.min(u,l-1),1,1);let[p,m,h,g]=f.data;g=parseFloat((g/255).toFixed(2)),this.$emit("selectSucker",{r:p,g:m,b:h,a:g})}))}}});const gfe=i.createVNode("path",{d:"M13.1,8.2l5.6,5.6c0.4,0.4,0.5,1.1,0.1,1.5s-1.1,0.5-1.5,0.1c0,0-0.1,0-0.1-0.1l-1.4-1.4l-7.7,7.7C7.9,21.9,7.6,22,7.3,22H3.1C2.5,22,2,21.5,2,20.9l0,0v-4.2c0-0.3,0.1-0.6,0.3-0.8l5.8-5.8C8.5,9.7,9.2,9.6,9.7,10s0.5,1.1,0.1,1.5c0,0,0,0.1-0.1,0.1l-5.5,5.5v2.7h2.7l7.4-7.4L8.7,6.8c-0.5-0.4-0.5-1-0.1-1.5s1.1-0.5,1.5-0.1c0,0,0.1,0,0.1,0.1l1.4,1.4l3.5-3.5c1.6-1.6,4.1-1.6,5.8-0.1c1.6,1.6,1.6,4.1,0.1,5.8L20.9,9l-3.6,3.6c-0.4,0.4-1.1,0.5-1.5,0.1"},null,-1),vfe={key:1,class:"sucker",viewBox:"-16 -16 68 68",xmlns:"http://www.w3.org/2000/svg",stroke:"#9099a4"},yfe=i.createVNode("g",{fill:"none","fill-rule":"evenodd"},[i.createVNode("g",{transform:"translate(1 1)","stroke-width":"4"},[i.createVNode("circle",{"stroke-opacity":".5",cx:"18",cy:"18",r:"18"}),i.createVNode("path",{d:"M36 18c0-9.94-8.06-18-18-18"},[i.createVNode("animateTransform",{attributeName:"transform",type:"rotate",from:"0 18 18",to:"360 18 18",dur:"1s",repeatCount:"indefinite"})])])],-1);function _fe(t,e,n,o,r,s){return i.openBlock(),i.createBlock("div",null,[t.isSucking?i.createCommentVNode("v-if",!0):(i.openBlock(),i.createBlock("svg",{key:0,class:[{active:t.isOpenSucker},"sucker"],xmlns:"http://www.w3.org/2000/svg",viewBox:"-12 -12 48 48",onClick:e[1]||(e[1]=(...a)=>t.openSucker&&t.openSucker(...a))},[gfe],2)),t.isSucking?(i.openBlock(),i.createBlock("svg",vfe,[yfe])):i.createCommentVNode("v-if",!0)])}rd.render=_fe;rd.__file="src/color/Sucker.vue";var id=i.defineComponent({props:{name:{type:String,default:""},color:{type:String,default:""}},emits:["inputColor","inputFocus","inputBlur"],setup(t,{emit:e}){return{modelColor:i.computed({get(){return t.color||""},set(s){e("inputColor",s)}}),handleFocus:s=>{e("inputFocus",s)},handleBlur:s=>{e("inputBlur",s)}}}});const Cfe={class:"color-type"},bfe={class:"name"};function kfe(t,e,n,o,r,s){return i.openBlock(),i.createBlock("div",Cfe,[i.createVNode("span",bfe,i.toDisplayString(t.name),1),i.withDirectives(i.createVNode("input",{"onUpdate:modelValue":e[1]||(e[1]=a=>t.modelColor=a),class:"value",onFocus:e[2]||(e[2]=(...a)=>t.handleFocus&&t.handleFocus(...a)),onBlur:e[3]||(e[3]=(...a)=>t.handleBlur&&t.handleBlur(...a))},null,544),[[i.vModelText,t.modelColor]])])}id.render=kfe;id.__file="src/color/Box.vue";var sd=i.defineComponent({name:"ColorPicker",props:{color:{type:String,default:"#000000"},colorsDefault:{type:Array,default:()=>[]},colorsHistoryKey:{type:String,default:""}},emits:["selectColor"],setup(t,{emit:e}){const n=i.ref(),o=i.ref([]),r=i.ref();t.colorsHistoryKey&&localStorage&&(o.value=JSON.parse(localStorage.getItem(t.colorsHistoryKey))||[]),r.value=Qu(4).toDataURL(),i.onUnmounted(()=>{s(n.value)});function s(l){if(!l)return;const c=o.value||[],u=c.indexOf(l);u>=0&&c.splice(u,1),c.length>=8&&(c.length=7),c.unshift(l),o.value=c||[],localStorage&&t.colorsHistoryKey&&localStorage.setItem(t.colorsHistoryKey,JSON.stringify(c))}function a(l){e("selectColor",l)}return{setColorsHistory:s,colorsHistory:o,color:n,imgAlphaBase64:r,selectColor:a}}});const wfe={class:"colors"},Efe={key:0,class:"colors history"};function xfe(t,e,n,o,r,s){return i.openBlock(),i.createBlock("div",null,[i.createVNode("ul",wfe,[(i.openBlock(!0),i.createBlock(i.Fragment,null,i.renderList(t.colorsDefault,a=>(i.openBlock(),i.createBlock("li",{key:a,class:"item",onClick:l=>t.selectColor(a)},[i.createVNode("div",{style:{background:`url(${t.imgAlphaBase64})`},class:"alpha"},null,4),i.createVNode("div",{style:{background:a},class:"color"},null,4)],8,["onClick"]))),128))]),t.colorsHistory.length?(i.openBlock(),i.createBlock("ul",Efe,[(i.openBlock(!0),i.createBlock(i.Fragment,null,i.renderList(t.colorsHistory,a=>(i.openBlock(),i.createBlock("li",{key:a,class:"item",onClick:l=>t.selectColor(a)},[i.createVNode("div",{style:{background:`url(${t.imgAlphaBase64})`},class:"alpha"},null,4),i.createVNode("div",{style:{background:a},class:"color"},null,4)],8,["onClick"]))),128))])):i.createCommentVNode("v-if",!0)])}sd.render=xfe;sd.__file="src/color/Colors.vue";var Tr=i.defineComponent({components:{Saturation:ed,Hue:td,Alpha:nd,Preview:od,Sucker:rd,Box:id,Colors:sd},emits:["changeColor","openSucker","inputFocus","inputBlur"],props:{color:{type:String,default:"#000000"},theme:{type:String,default:"dark"},suckerHide:{type:Boolean,default:!0},suckerCanvas:{type:null,default:null},suckerArea:{type:Array,default:()=>[]},colorsDefault:{type:Array,default:()=>["#000000","#FFFFFF","#FF1900","#F47365","#FFB243","#FFE623","#6EFF2A","#1BC7B1","#00BEFF","#2E81FF","#5D61FF","#FF89CF","#FC3CAD","#BF3DCE","#8E00A7","rgba(0,0,0,0)"]},colorsHistoryKey:{type:String,default:"vue-colorpicker-history"}},data(){return{hueWidth:15,hueHeight:152,previewHeight:30,modelRgba:"",modelHex:"",r:0,g:0,b:0,a:1,h:0,s:0,v:0}},computed:{isLightTheme(){return this.theme==="light"},totalWidth(){return this.hueHeight+(this.hueWidth+8)*2},previewWidth(){return this.totalWidth-(this.suckerHide?0:this.previewHeight)},rgba(){return{r:this.r,g:this.g,b:this.b,a:this.a}},hsv(){return{h:this.h,s:this.s,v:this.v}},rgbString(){return`rgb(${this.r}, ${this.g}, ${this.b})`},rgbaStringShort(){return`${this.r}, ${this.g}, ${this.b}, ${this.a}`},rgbaString(){return`rgba(${this.rgbaStringShort})`},hexString(){return sfe(this.rgba,!0)}},created(){Object.assign(this,Ao(this.color)),this.setText(),this.$watch("rgba",()=>{this.$emit("changeColor",{rgba:this.rgba,hsv:this.hsv,hex:this.modelHex})})},methods:{selectSaturation(t){const{r:e,g:n,b:o,h:r,s,v:a}=Ao(t);Object.assign(this,{r:e,g:n,b:o,h:r,s,v:a}),this.setText()},handleFocus(t){this.$emit("inputFocus",t)},handleBlur(t){this.$emit("inputBlur",t)},selectHue(t){const{r:e,g:n,b:o,h:r,s,v:a}=Ao(t);Object.assign(this,{r:e,g:n,b:o,h:r,s,v:a}),this.setText(),this.$nextTick(()=>{this.$refs.saturation.renderColor(),this.$refs.saturation.renderSlide()})},selectAlpha(t){this.a=t,this.setText()},inputHex(t){const{r:e,g:n,b:o,a:r,h:s,s:a,v:l}=Ao(t);Object.assign(this,{r:e,g:n,b:o,a:r,h:s,s:a,v:l}),this.modelHex=t,this.modelRgba=this.rgbaStringShort,this.$nextTick(()=>{this.$refs.saturation.renderColor(),this.$refs.saturation.renderSlide(),this.$refs.hue.renderSlide()})},inputRgba(t){const{r:e,g:n,b:o,a:r,h:s,s:a,v:l}=Ao(t);Object.assign(this,{r:e,g:n,b:o,a:r,h:s,s:a,v:l}),this.modelHex=this.hexString,this.modelRgba=t,this.$nextTick(()=>{this.$refs.saturation.renderColor(),this.$refs.saturation.renderSlide(),this.$refs.hue.renderSlide()})},setText(){this.modelHex=this.hexString,this.modelRgba=this.rgbaStringShort},openSucker(t){this.$emit("openSucker",t)},selectSucker(t){const{r:e,g:n,b:o,a:r,h:s,s:a,v:l}=Ao(t);Object.assign(this,{r:e,g:n,b:o,a:r,h:s,s:a,v:l}),this.setText(),this.$nextTick(()=>{this.$refs.saturation.renderColor(),this.$refs.saturation.renderSlide(),this.$refs.hue.renderSlide()})},selectColor(t){const{r:e,g:n,b:o,a:r,h:s,s:a,v:l}=Ao(t);Object.assign(this,{r:e,g:n,b:o,a:r,h:s,s:a,v:l}),this.setText(),this.$nextTick(()=>{this.$refs.saturation.renderColor(),this.$refs.saturation.renderSlide(),this.$refs.hue.renderSlide()})}}});const Sfe={class:"color-set"};function Tfe(t,e,n,o,r,s){const a=i.resolveComponent("Saturation"),l=i.resolveComponent("Hue"),c=i.resolveComponent("Alpha"),u=i.resolveComponent("Preview"),d=i.resolveComponent("Sucker"),f=i.resolveComponent("Box"),p=i.resolveComponent("Colors");return i.openBlock(),i.createBlock("div",{class:["hu-color-picker",{light:t.isLightTheme}],style:{width:t.totalWidth+"px"}},[i.createVNode("div",Sfe,[i.createVNode(a,{ref:"saturation",color:t.rgbString,hsv:t.hsv,size:t.hueHeight,onSelectSaturation:t.selectSaturation},null,8,["color","hsv","size","onSelectSaturation"]),i.createVNode(l,{ref:"hue",hsv:t.hsv,width:t.hueWidth,height:t.hueHeight,onSelectHue:t.selectHue},null,8,["hsv","width","height","onSelectHue"]),i.createVNode(c,{ref:"alpha",color:t.rgbString,rgba:t.rgba,width:t.hueWidth,height:t.hueHeight,onSelectAlpha:t.selectAlpha},null,8,["color","rgba","width","height","onSelectAlpha"])]),i.createVNode("div",{style:{height:t.previewHeight+"px"},class:"color-show"},[i.createVNode(u,{color:t.rgbaString,width:t.previewWidth,height:t.previewHeight},null,8,["color","width","height"]),t.suckerHide?i.createCommentVNode("v-if",!0):(i.openBlock(),i.createBlock(d,{key:0,"sucker-canvas":t.suckerCanvas,"sucker-area":t.suckerArea,onOpenSucker:t.openSucker,onSelectSucker:t.selectSucker},null,8,["sucker-canvas","sucker-area","onOpenSucker","onSelectSucker"]))],4),i.createVNode(f,{name:"HEX",color:t.modelHex,onInputColor:t.inputHex,onInputFocus:t.handleFocus,onInputBlur:t.handleBlur},null,8,["color","onInputColor","onInputFocus","onInputBlur"]),i.createVNode(f,{name:"RGBA",color:t.modelRgba,onInputColor:t.inputRgba,onInputFocus:t.handleFocus,onInputBlur:t.handleBlur},null,8,["color","onInputColor","onInputFocus","onInputBlur"]),i.createVNode(p,{color:t.rgbaString,"colors-default":t.colorsDefault,"colors-history-key":t.colorsHistoryKey,onSelectColor:t.selectColor},null,8,["color","colors-default","colors-history-key","onSelectColor"]),i.createCommentVNode(" custom options "),i.renderSlot(t.$slots,"default")],6)}Tr.render=Tfe;Tr.__file="src/color/ColorPicker.vue";Tr.install=t=>{t.component(Tr.name,Tr)};const Afe={class:"color-picker-wrapper"},fl=i.defineComponent({__name:"AoColorPicker",props:{color:{}},emits:["update:color"],setup(t,{emit:e}){const n=t,o=e,r=i.ref(!1),s=i.ref(null),a=i.ref(null),l=i.ref(0),c=i.ref(0),u=async h=>{a.value=h,r.value=!0,await i.nextTick();const g=h.getBoundingClientRect(),y=s.value,C=(y==null?void 0:y.offsetHeight)||300,v=window.innerHeight-g.bottom,_=g.top,k=v<C&&_>C;console.log("pickerHeight = "+C),l.value=k?g.top-C-8:g.bottom+8,c.value=g.left,setTimeout(()=>{window.addEventListener("click",f)},0)},d=i.computed(()=>({position:"fixed",top:`${l.value}px`,left:`${c.value}px`,zIndex:1e3})),f=h=>{const g=h.target;s.value&&!s.value.contains(g)&&(r.value=!1,o("update:color",p.value),window.removeEventListener("click",f))};i.onBeforeUnmount(()=>{window.removeEventListener("click",f)}),i.watch(()=>n.color,h=>{r.value||(p.value=h)});const p=i.ref(n.color),m=h=>{const{r:g,g:y,b:C,a:v}=h.rgba;p.value=`rgba(${g}, ${y}, ${C}, ${v})`};return(h,g)=>(i.openBlock(),i.createElementBlock("div",Afe,[i.renderSlot(h.$slots,"clickable",{openPicker:u,bgColor:t.color}),r.value?(i.openBlock(),i.createElementBlock("div",{key:0,ref_key:"pickerRef",ref:s,class:"color-picker",style:i.normalizeStyle(d.value)},[i.createVNode(i.unref(Tr),{class:"color-picker-box",theme:"light",color:t.color,onChangeColor:m},null,8,["color"])],4)):i.createCommentVNode("",!0)]))}});const Nfe={class:"ao-card-project-phase__header"},Dfe={class:"ao-card-project-item__title-line"},Mfe={key:0,class:"ao-card-project-item-phase__estimation"},Bfe={class:"ao-card-project-phase__footer"},$fe={key:0,class:"ao-card-project-phase__footer-row ao-card-project-phase__footer-row--progress"},Ofe={class:"ao-card-project-phase__subitem"},Lfe={class:"ao-card-project-phase__subitem"},Ife={key:0,class:"ao-card-project-phase__secondary"},Pfe={class:"ao-card-project-phase__deadline ao-card-project-phase__deadline--readonly"},Ffe=i.defineComponent({__name:"AoCardProjectItemPhase",props:{id:{},projectName:{},name:{},milestones:{},isEditable:{type:Boolean},deadline:{},active:{type:Boolean},color:{},timeTrackingData:{},estimationUnit:{}},emits:["update:title","update:deadline","archivePhase","unarchivePhase","updatePhase"],setup(t,{emit:e}){const n=t,o=e,r=g=>{o("update:title",g)},s=i.computed(()=>{var g;return((g=n.milestones)==null?void 0:g.reduce((y,C)=>{var v;return y+((v=C.activities)==null?void 0:v.reduce((_,k)=>_+(k.estimation||0),0))},0))||0}),a=i.computed(()=>!n.milestones||!n.timeTrackingData?0:n.milestones.reduce((g,y)=>{var C;return g+(((C=y.activities)==null?void 0:C.reduce((v,_)=>{var w;const k=(w=n.timeTrackingData)==null?void 0:w[_.id];return v+((k==null?void 0:k.timeSpent)||0)},0))||0)},0)),l=i.computed(()=>n.estimationUnit==="days"?"d":"h"),c=i.computed(()=>Na(a.value,n.estimationUnit)),u=i.computed(()=>{var g;return(g=n.milestones)==null?void 0:g.length}),d=i.computed(()=>{var g;return(g=n.milestones)==null?void 0:g.filter(y=>y.status===$i.done).length}),f=i.computed(()=>(d.value||0)/(u.value||1)),p=i.computed({get:()=>n.deadline??"",set:g=>o("update:deadline",g!=null&&g.length?g:null)}),m=i.computed({get:()=>n.color,set:g=>{o("updatePhase",{id:n.id,color:g})}}),h=(g,y)=>{const C=g.target;C.closest("button")||C.closest("input")||C.closest(".ao-title")||y(C)};return(g,y)=>(i.openBlock(),i.createBlock(fl,{color:m.value,"onUpdate:color":y[2]||(y[2]=C=>m.value=C)},{clickable:i.withCtx(({openPicker:C,bgColor:v})=>[i.createVNode(ul,{class:"ao-card-project-phase","is-clickable":t.isEditable,color:v,"with-left-border":!0,onClick:_=>h(_,C)},i.createSlots({default:i.withCtx(()=>[i.createElementVNode("div",Dfe,[i.createVNode(ct,{id:t.id,class:"ao-card-project-phase__title",title:t.name||"",level:4,"is-editable":t.isEditable,"onUpdate:title":r},null,8,["id","title","is-editable"]),s.value||a.value?(i.openBlock(),i.createElementBlock("span",Mfe," ("+i.toDisplayString(c.value)+"/"+i.toDisplayString(s.value)+i.toDisplayString(l.value)+")",1)):i.createCommentVNode("",!0)])]),footer:i.withCtx(()=>[i.createElementVNode("div",Bfe,[u.value?(i.openBlock(),i.createElementBlock("div",$fe,[i.createElementVNode("div",Ofe,[i.createVNode(ve,{name:"MountainFlagOutlineRounded",size:"sm"}),i.createElementVNode("span",Lfe,i.toDisplayString(d.value)+" / "+i.toDisplayString(u.value),1)]),i.createVNode(dl,{percentages:f.value,class:"ao-card-project-phase__progress",color:t.color},null,8,["percentages","color"]),g.$slots.secondary?(i.openBlock(),i.createElementBlock("div",Ife,[i.renderSlot(g.$slots,"secondary")])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass(["ao-card-project-phase__footer-row",p.value?"":"ao-card-project-phase__no_deadline"])},[t.isEditable?i.withDirectives((i.openBlock(),i.createElementBlock("input",{key:0,"onUpdate:modelValue":y[1]||(y[1]=_=>p.value=_),class:"ao-card-project-phase__deadline ao-card-project-phase__deadline--input",type:"date"},null,512)),[[i.vModelText,p.value,void 0,{lazy:!0}]]):i.createCommentVNode("",!0),i.createElementVNode("span",Pfe,i.toDisplayString(i.unref(Da)(t.deadline)),1)],2)])]),_:2},[t.isEditable?{name:"header",fn:i.withCtx(()=>[i.createElementVNode("div",Nfe,[i.createVNode(me,{class:"ao-card-project-phase__archive",color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:t.active?g.$t("archive"):g.$t("unarchive"),onClick:y[0]||(y[0]=i.withModifiers(()=>t.active?g.$emit("archivePhase",{id:t.id}):g.$emit("unarchivePhase",{id:t.id}),["stop"]))},null,8,["label"])])]),key:"0"}:void 0]),1032,["is-clickable","color","onClick"])]),_:3},8,["color"]))}});const Vfe=i.defineComponent({__name:"AoBadge",props:{color:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("span",{class:"aoBadge",style:i.normalizeStyle({backgroundColor:t.color})},null,4))}});const Rfe={class:"ao-card-project-milestone__default"},zfe={class:"ao-title-with-badge-wrapper"},Ufe={class:"ao-card-project-item__title-line"},qfe={key:0,class:"ao-card-project-item-milestone__estimation"},Hfe={key:0,class:"ao-card-project-milestone__archive"},jfe={class:"ao-card-project-milestone__activities"},Wfe={class:"ao-card-project-milestone__activities-row"},Zfe={class:"ao-card-project-milestone__subitem"},Kfe={class:"ao-card-project-milestone__subitem"},Gfe={key:1,class:"ao-card-project-milestone__secondary"},Yfe={class:"ao-card-project-milestone__footer"},Jfe={key:1,class:"ao-field ao-card-project-milestone__deadline"},Xfe={class:"ao-field__label"},Qfe={key:2,class:"ao-card-project-milestone__assignee"},epe=i.defineComponent({__name:"AoCardProjectItemMilestone",props:{id:{},name:{},color:{},phaseColor:{},activities:{},closedStatus:{},isEditable:{type:Boolean},deadline:{},active:{type:Boolean},isSelected:{type:Boolean},assignee:{},important:{type:Boolean},readonly:{type:Boolean},timeTrackingData:{},estimationUnit:{}},emits:["updateMilestone","archiveMilestone","unarchiveMilestone"],setup(t,{emit:e}){const n=t,o=e,r=i.computed(()=>{var p;return((p=n.activities)==null?void 0:p.reduce((m,h)=>m+(h.estimation||0),0))||0}),s=i.computed(()=>!n.activities||!n.timeTrackingData?0:n.activities.reduce((p,m)=>{var g;const h=(g=n.timeTrackingData)==null?void 0:g[m.id];return p+((h==null?void 0:h.timeSpent)||0)},0)),a=i.computed(()=>n.estimationUnit==="days"?"d":"h"),l=i.computed(()=>Na(s.value,n.estimationUnit));i.computed(()=>{const p=s.value/60;return p%1===0?p.toString():p.toFixed(2)});const c=i.computed(()=>{var p;return(p=n.activities)==null?void 0:p.length}),u=i.computed(()=>{var p;return(p=n.activities)==null?void 0:p.filter(m=>Gc(m,n.closedStatus)).length}),d=i.computed(()=>(u.value||0)/(c.value||1)),f=p=>{o("updateMilestone",{id:n.id,name:p})};return(p,m)=>(i.openBlock(),i.createBlock(ul,{class:i.normalizeClass(["ao-card-project-milestone"]),"is-clickable":!t.readonly,"tag-name":"li","is-selected":t.isSelected,color:t.phaseColor},{default:i.withCtx(()=>[i.createElementVNode("div",Rfe,[i.createElementVNode("div",zfe,[i.createVNode(Vfe,{color:t.color||""},null,8,["color"]),i.createElementVNode("div",Ufe,[i.createVNode(ct,{id:t.id,title:t.name||"",level:5,"is-editable":!t.readonly&&t.isEditable,class:"ao-card-project-milestone__title","onUpdate:title":f},null,8,["id","title","is-editable"]),r.value||s.value?(i.openBlock(),i.createElementBlock("span",qfe," ("+i.toDisplayString(l.value)+"/"+i.toDisplayString(r.value)+i.toDisplayString(a.value)+")",1)):i.createCommentVNode("",!0)])]),!t.readonly&&t.isEditable?(i.openBlock(),i.createElementBlock("div",Hfe,[i.createVNode(me,{color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:t.active?p.$t("archive"):p.$t("unarchive"),onClick:m[0]||(m[0]=i.withModifiers(()=>t.active?p.$emit("archiveMilestone",{id:t.id}):p.$emit("unarchiveMilestone",{id:t.id}),["stop"]))},null,8,["label"])])):i.createCommentVNode("",!0)]),i.createElementVNode("div",jfe,[i.createElementVNode("div",Wfe,[c.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createElementVNode("div",Zfe,[i.createVNode(ve,{name:"SelectCheckBox",size:"sm"}),i.createElementVNode("span",Kfe,i.toDisplayString(u.value)+" / "+i.toDisplayString(c.value),1)]),i.createVNode(dl,{percentages:d.value,color:t.phaseColor,class:"ao-card-project-milestone__progress"},null,8,["percentages","color"])],64)):i.createCommentVNode("",!0),p.$slots.secondary?(i.openBlock(),i.createElementBlock("div",Gfe,[i.renderSlot(p.$slots,"secondary")])):i.createCommentVNode("",!0)])])]),footer:i.withCtx(()=>[i.createElementVNode("div",Yfe,[t.important?(i.openBlock(),i.createBlock(ve,{key:0,name:"FlagRounded",class:i.normalizeClass(t.isSelected?"ao-card-project-milestone__important--selected":"ao-card-project-milestone__important"),size:"sm"},null,8,["class"])):i.createCommentVNode("",!0),t.deadline?(i.openBlock(),i.createElementBlock("label",Jfe,[i.createElementVNode("span",Xfe,i.toDisplayString(i.unref(Da)(t.deadline)),1)])):i.createCommentVNode("",!0),t.assignee?(i.openBlock(),i.createElementBlock("div",Qfe,[i.createVNode(qn,{"user-name":i.unref(Bp)(t.assignee),"avatar-url":t.assignee.avatarUrl,color:t.isSelected?"black":"primary",size:"sm"},null,8,["user-name","avatar-url","color"])])):i.createCommentVNode("",!0)])]),_:3},8,["is-clickable","is-selected","color"]))}});const tpe={class:"ao-mapping-card-project-phase__header"},npe={class:"ao-card-project-item__title-line"},ope={key:0,class:"ao-card-project-item-phase__estimation"},rpe={class:"ao-mapping-card-project-phase__footer"},ipe={key:0,class:"ao-mapping-card-project-phase__footer-row ao-mapping-card-project-phase__footer-row--progress"},spe={class:"ao-mapping-card-project-phase__subitem"},ape={class:"ao-mapping-card-project-phase__subitem"},lpe={key:0,class:"ao-mapping-card-project-phase__secondary"},cpe={class:"ao-mapping-card-project-phase__deadline ao-mapping-card-project-phase__deadline--readonly"},upe=i.defineComponent({__name:"AoCondensedCardProjectItemPhase",props:{id:{},projectName:{},name:{},milestones:{},isEditable:{type:Boolean},deadline:{},active:{type:Boolean},color:{},timeTrackingData:{},estimationUnit:{}},emits:["update:title","update:deadline","archivePhase","updatePhase","unarchivePhase"],setup(t,{emit:e}){const n=t,o=e,r=g=>{o("update:title",g)},s=i.computed(()=>{var g;return((g=n.milestones)==null?void 0:g.reduce((y,C)=>{var v;return y+((v=C.activities)==null?void 0:v.reduce((_,k)=>_+(k.estimation||0),0))},0))||0}),a=i.computed(()=>!n.milestones||!n.timeTrackingData?0:n.milestones.reduce((g,y)=>{var C;return g+(((C=y.activities)==null?void 0:C.reduce((v,_)=>{var w;const k=(w=n.timeTrackingData)==null?void 0:w[_.id];return v+((k==null?void 0:k.timeSpent)||0)},0))||0)},0)),l=i.computed(()=>n.estimationUnit==="days"?"d":"h"),c=i.computed(()=>Na(a.value,n.estimationUnit)),u=i.computed(()=>{var g;return(g=n.milestones)==null?void 0:g.length}),d=i.computed(()=>{var g;return(g=n.milestones)==null?void 0:g.filter(y=>y.status===$i.done).length}),f=i.computed(()=>(d.value||0)/(u.value||1)),p=i.computed({get:()=>n.deadline??"",set:g=>o("update:deadline",g!=null&&g.length?g:null)}),m=i.computed({get:()=>n.color,set:g=>{o("updatePhase",{id:n.id,color:g})}}),h=(g,y)=>{const C=g.target;C.closest("button")||C.closest("input")||C.closest(".ao-title")||y()};return(g,y)=>(i.openBlock(),i.createBlock(fl,{color:m.value,"onUpdate:color":y[2]||(y[2]=C=>m.value=C)},{clickable:i.withCtx(({openPicker:C,bgColor:v})=>[i.createVNode(ul,{class:"ao-mapping-card-project-phase","is-clickable":t.isEditable,color:v,"with-left-border":!0,onClick:_=>h(_,C)},i.createSlots({default:i.withCtx(()=>[i.createElementVNode("div",npe,[i.createVNode(ct,{id:t.id,class:"ao-mapping-card-project-phase__title",title:t.name||"",level:4,"is-editable":t.isEditable,"onUpdate:title":r},null,8,["id","title","is-editable"]),s.value||a.value?(i.openBlock(),i.createElementBlock("span",ope," ("+i.toDisplayString(c.value)+"/"+i.toDisplayString(s.value)+i.toDisplayString(l.value)+")",1)):i.createCommentVNode("",!0)])]),footer:i.withCtx(()=>[i.createElementVNode("div",rpe,[u.value?(i.openBlock(),i.createElementBlock("div",ipe,[i.createElementVNode("div",spe,[i.createVNode(ve,{name:"MountainFlagOutlineRounded",size:"sm"}),i.createElementVNode("span",ape,i.toDisplayString(d.value)+" / "+i.toDisplayString(u.value),1)]),i.createVNode(dl,{percentages:f.value,class:"ao-mapping-card-project-phase__progress",color:m.value},null,8,["percentages","color"]),g.$slots.secondary?(i.openBlock(),i.createElementBlock("div",lpe,[i.renderSlot(g.$slots,"secondary")])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass(["ao-mapping-card-project-phase__footer-row",p.value?"":"ao-mapping-card-project-phase__no_deadline"])},[t.isEditable?i.withDirectives((i.openBlock(),i.createElementBlock("input",{key:0,"onUpdate:modelValue":y[1]||(y[1]=_=>p.value=_),class:"ao-mapping-card-project-phase__deadline ao-mapping-card-project-phase__deadline--input",type:"date"},null,512)),[[i.vModelText,p.value,void 0,{lazy:!0}]]):i.createCommentVNode("",!0),i.createElementVNode("span",cpe,i.toDisplayString(i.unref(Da)(t.deadline)),1)],2)])]),_:2},[t.isEditable?{name:"header",fn:i.withCtx(()=>[i.createElementVNode("div",tpe,[i.createVNode(me,{class:"ao-mapping-card-project-phase__archive",color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:t.active?g.$t("archive"):g.$t("unarchive"),onClick:y[0]||(y[0]=i.withModifiers(()=>t.active?g.$emit("archivePhase",{id:t.id}):g.$emit("unarchivePhase",{id:t.id}),["stop"]))},null,8,["label"])])]),key:"0"}:void 0]),1032,["is-clickable","color","onClick"])]),_:3},8,["color"]))}});const dpe={class:"ao-project-phase"},fpe={key:0,class:"ao-project-phase__drag ao-card__drag"},ppe={key:1,class:"ao-project-phase__col-phase"},mpe={key:2,class:"ao-mapping-project-phase__col-phase"},hpe={key:0,class:"ao-project-phase__col-milestones"},gpe=["title"],vpe={class:"ao-project-phase__milestones-list-footer"},ype=i.defineComponent({__name:"AoProjectPhase",props:{phase:{},closedStatus:{},users:{},isEditable:{type:Boolean},readonly:{type:Boolean},timeTrackingData:{},estimationUnit:{}},emits:["addMilestone","updateMilestone","archiveMilestone","unarchiveMilestone","updatePhase","archivePhase","unarchivePhase"],setup(t,{emit:e}){const{t:n}=wn(),o=t,r=e;i.watch(()=>o.phase.milestones,(w,b)=>{Pn(w,b)});const s=w=>{r("updatePhase",{id:o.phase.id,name:w})},a=w=>{r("updatePhase",{id:o.phase.id,deadline:w})},l=w=>{r("updatePhase",w)},c=i.computed(()=>o.phase.milestones.map(w=>g_(w,o.closedStatus))),u=w=>{const{name:b,rank:E}=Uo(c.value??[],"milestone",n);r("addMilestone",{name:b,rank:E,phaseId:w})},d=w=>{const b=n("template.defaultName.milestone",{idx:1}),E=Qi(c.value??[]);r("addMilestone",{name:b,rank:E,phaseId:w})},f=w=>{r("updateMilestone",w)},p=w=>{r("archiveMilestone",w)},m=w=>{r("unarchiveMilestone",w)},h=w=>{r("archivePhase",w)},g=w=>{r("unarchivePhase",w)},y=w=>{"added"in w?r("updateMilestone",{id:w.added.element.id,phaseId:o.phase.id,rank:Ar(c.value,w.added.newIndex)}):"removed"in w||"moved"in w&&r("updateMilestone",{id:w.moved.element.id,rank:Ar(c.value,w.moved.newIndex)})},C=Ki.useRoute(),v=i.computed(()=>C.path.includes("/mapping")),_=i.computed(()=>{var w;return o.phase.id===((w=C.params)==null?void 0:w.phaseId)});i.ref(!1);const k=i.computed(()=>{var w;return o.phase.id!==((w=C.params)==null?void 0:w.phaseId)?{backgroundColor:"var(--ao-color-sheet)"}:o.phase.color?{backgroundColor:y_(o.phase.color)}:{backgroundColor:"var(--ao-color-primary-lightest)"}});return(w,b)=>(i.openBlock(),i.createElementBlock("li",dpe,[i.createElementVNode("div",{class:"ao-project-phases__draggable-card",style:i.normalizeStyle(k.value)},[t.isEditable?(i.openBlock(),i.createElementBlock("div",fpe,[i.createVNode(ve,{name:"DragIndicator",class:"ao-project-phase__drag-handle"})])):i.createCommentVNode("",!0),v.value?(i.openBlock(),i.createElementBlock("div",mpe,[i.createVNode(upe,{id:t.phase.id,milestones:c.value,name:t.phase.name,deadline:t.phase.deadline,active:t.phase.active,"is-editable":t.isEditable,color:t.phase.color,"estimation-unit":t.estimationUnit,"onUpdate:deadline":a,"onUpdate:title":s,onArchivePhase:h,onUnarchivePhase:g,onUpdatePhase:l},null,8,["id","milestones","name","deadline","active","is-editable","color","estimation-unit"])])):(i.openBlock(),i.createElementBlock("div",ppe,[i.createVNode(Ffe,{id:t.phase.id,milestones:c.value,name:t.phase.name,deadline:t.phase.deadline,active:t.phase.active,"is-editable":t.isEditable,color:t.phase.color,"time-tracking-data":t.timeTrackingData,"estimation-unit":t.estimationUnit,"onUpdate:deadline":a,"onUpdate:title":s,onArchivePhase:h,onUnarchivePhase:g,onUpdatePhase:l},null,8,["id","milestones","name","deadline","active","is-editable","color","time-tracking-data","estimation-unit"])]))],4),v.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",hpe,[i.createElementVNode("div",{class:"ao-project-phase__milestones ao-project-phase__milestones--hoverable",style:i.normalizeStyle(k.value)},[t.isEditable?(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(["ao-project-phase__milestone-quick-add",{"ao-project-phase__milestone-quick-add--visible":_.value}]),title:w.$t("project.milestone.add"),onClick:b[0]||(b[0]=()=>d(t.phase.id))},[i.createVNode(ve,{name:"Add",class:"ao-project-phase__milestone-quick-add-icon"})],10,gpe)):i.createCommentVNode("",!0),i.createVNode(i.unref(ho),i.mergeProps({class:"ao-project-phase__milestones-list",list:c.value,disabled:t.readonly||!t.isEditable,"item-key":"id",group:"kanban"},w.$attrs,{onChange:y}),{item:i.withCtx(({element:E})=>{var T;return[i.createVNode(epe,{id:E.id,name:E.name,color:E.color,"phase-color":t.phase.color,activities:E.activities,deadline:E.deadline,active:E.active,"is-editable":!t.readonly&&t.isEditable,"is-draggable":!t.readonly&&t.isEditable,"closed-status":t.closedStatus,"is-selected":E.id===((T=w.$route.params)==null?void 0:T.milestoneId),assignee:E.assignee,important:E.important,readonly:t.readonly,"time-tracking-data":t.timeTrackingData,"estimation-unit":t.estimationUnit,class:i.normalizeClass(["ao-project-phase__milestone"]),onClick:S=>!t.readonly&&w.$router.push({name:i.unref(je).milestone,params:{phaseId:t.phase.id,milestoneId:E.id}}),onUpdateMilestone:f,onArchiveMilestone:p,onUnarchiveMilestone:m},null,8,["id","name","color","phase-color","activities","deadline","active","is-editable","is-draggable","closed-status","is-selected","assignee","important","readonly","time-tracking-data","estimation-unit","onClick"])]}),_:1},16,["list","disabled"]),i.createElementVNode("div",vpe,[t.isEditable?(i.openBlock(),i.createBlock(go,{key:0,label:w.$t("project.milestone.add"),class:"ao-project-phase__milestone-add","icon-name":"Add",onClick:b[1]||(b[1]=()=>u(t.phase.id))},null,8,["label"])):i.createCommentVNode("",!0)])],4)]))]))}});const _pe={class:"ao-project__phases"},Cpe={key:0,class:"ao-project-phase__phases-list-footer"},bpe={class:"ao-project-phase__col-phase"},ad=i.defineComponent({__name:"AoProjectPhases",props:{phases:{},closedStatus:{},isEditable:{type:Boolean},users:{},readonly:{type:Boolean},timeTrackingData:{},estimationUnit:{}},emits:["addMilestone","updateMilestone","archiveMilestone","unarchiveMilestone","addPhase","updatePhase","archivePhase","unarchivePhase"],setup(t,{emit:e}){const n=t,o=e;i.watch(()=>n.phases,(m,h)=>{Pn(m,h)});const r=m=>{o("addMilestone",m)},s=m=>{o("updateMilestone",m)},a=m=>{o("archiveMilestone",m)},l=m=>{o("unarchiveMilestone",m)},c=m=>{o("archivePhase",m)},u=m=>{o("unarchivePhase",m)},d=m=>{if(m.moved){const h=Xi(m,n.phases??[]);o("updatePhase",{id:m.moved.element.id,rank:h})}},f=m=>{o("updatePhase",m)},p=m=>{o("addPhase",m)};return(m,h)=>(i.openBlock(),i.createElementBlock("div",_pe,[i.createVNode(i.unref(ho),{class:"ao-project-phase__phases-list","model-value":t.phases,"item-key":"id",handle:".ao-card__drag",onChange:d},{item:i.withCtx(({element:g})=>[i.createVNode(ype,{phase:g,"is-editable":!t.readonly&&t.isEditable,"closed-status":t.closedStatus,users:t.users,readonly:t.readonly,"time-tracking-data":t.timeTrackingData,"estimation-unit":t.estimationUnit,onAddMilestone:r,onUpdateMilestone:s,onArchiveMilestone:a,onUnarchiveMilestone:l,onUpdatePhase:f,onArchivePhase:c,onUnarchivePhase:u},null,8,["phase","is-editable","closed-status","users","readonly","time-tracking-data","estimation-unit"])]),_:1},8,["model-value"]),t.isEditable?(i.openBlock(),i.createElementBlock("div",Cpe,[h[0]||(h[0]=i.createElementVNode("div",{class:"ao-project-phase__empty_drag"},null,-1)),i.createElementVNode("div",bpe,[i.createVNode(go,{label:m.$t("project.phases.add"),"icon-name":"Add",class:"ao-project-phase__add-phase",onClick:p},null,8,["label"])]),h[1]||(h[1]=i.createElementVNode("div",{class:"ao-project-phase__col-milestones"},null,-1))])):i.createCommentVNode("",!0)]))}});const kpe={class:"ao-add-template-modal__form-body"},wpe={class:"field__row"},Epe={class:"ao-add-template-modal__form-footer"},Pg=i.defineComponent({__name:"AoAddTemplateModal",props:{projectId:{},templates:{}},emits:["apply"],setup(t,{emit:e}){const n=t,o=e,r=i.computed(()=>n.templates.map(c=>({value:c.id,label:c.name}))),s=i.ref(null),a=c=>{s.value=c},l=()=>{s.value&&o("apply",s.value,n.projectId)};return(c,u)=>(i.openBlock(),i.createBlock(Ma,{size:"sm"},{header:i.withCtx(()=>[i.createVNode(ct,{title:c.$t("project.template.apply.title"),level:3},null,8,["title"])]),default:i.withCtx(()=>[i.createElementVNode("form",{class:"ao-add-template-modal__form",onSubmit:i.withModifiers(l,["prevent"])},[i.createElementVNode("p",null,i.toDisplayString(c.$t("project.template.apply.notice")),1),i.createElementVNode("div",kpe,[i.createElementVNode("div",wpe,[i.createVNode(Dt,{value:s.value,options:r.value,detached:!0,onChange:a},null,8,["value","options"])])]),i.createElementVNode("footer",Epe,[i.createVNode(me,{label:c.$t("project.template.apply.label"),type:"submit",color:"primary",variant:"solid",onClick:l},null,8,["label"])])],32)]),_:1}))}});const xpe={class:"ao-save-template-modal__form-body"},Spe={class:"field__row"},Tpe={class:"ao-field ao-field--inline"},Ape={class:"ao-field__label"},Npe={class:"ao-save-template-modal__phases"},Dpe={class:"ao-field__label"},Mpe={class:"ao-save-template-modal__phases-list"},Bpe=["value"],$pe={class:"ao-save-template-modal__form-footer"},Fg=i.defineComponent({__name:"AoSaveTemplateModal",props:{phases:{}},emits:["save"],setup(t,{emit:e}){const n=t,o=e,r=i.ref(""),s=i.ref([]);i.onMounted(()=>{s.value=n.phases.map(l=>l.id)});const a=()=>{r.value&&o("save",r.value,s.value)};return(l,c)=>(i.openBlock(),i.createBlock(Ma,{size:"sm"},{header:i.withCtx(()=>[i.createVNode(ct,{title:l.$t("project.template.save.title"),level:3},null,8,["title"])]),default:i.withCtx(()=>[i.createElementVNode("form",{class:"ao-save-template-modal__form",onSubmit:i.withModifiers(a,["prevent"])},[i.createElementVNode("div",xpe,[i.createElementVNode("div",Spe,[i.createElementVNode("label",Tpe,[i.createElementVNode("span",Ape,i.toDisplayString(l.$t("project.template.name.label"))+": ",1),i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":c[0]||(c[0]=u=>r.value=u),type:"text"},null,512),[[i.vModelText,r.value]])])]),i.createElementVNode("div",Npe,[i.createElementVNode("div",Dpe,i.toDisplayString(l.$t("project.template.phases.label")),1),i.createElementVNode("div",Mpe,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.phases,u=>(i.openBlock(),i.createElementBlock("label",{key:u.id,class:"ao-field ao-field--checkbox"},[i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":c[1]||(c[1]=d=>s.value=d),type:"checkbox",value:u.id},null,8,Bpe),[[i.vModelCheckbox,s.value]]),i.createElementVNode("span",null,i.toDisplayString(u.name),1)]))),128))])])]),i.createElementVNode("footer",$pe,[i.createVNode(me,{label:l.$t("project.template.save.label"),type:"submit",color:"primary",variant:"solid",onClick:a},null,8,["label"])])],32)]),_:1}))}});const Ope={class:"ao-project"},Lpe={class:"ao-project__body"},Ipe=i.defineComponent({__name:"AoProjectOverviewProject",props:{project:{},phases:{},closedStatus:{},users:{},userId:{},templates:{},isTaskCheckable:{type:Function},statuses:{},activityTypes:{},isEditable:{type:[Boolean,String]},showsArchived:{type:Boolean},attachmentEnabled:{type:Boolean},timeTrackingData:{},loadAttachmentPreview:{type:Function}},emits:["addPhase","updatePhase","archivePhase","unarchivePhase","addMilestone","updateMilestone","archiveMilestone","unarchiveMilestone","addActivity","update:activity","archiveActivity","copyPhaseToTemplate","unarchiveActivity","addSubtask","updateSubtask","deleteSubtask","addFiles","removeFile","addComment","updateComment","removeComment","applyTemplate","saveTemplate","update:showsArchived"],setup(t,{emit:e}){const{t:n}=wn(),o=t,r=e,s=i.computed(()=>o.phases.flatMap(F=>F.milestones)),a=()=>{const{name:F,rank:Q}=Uo(o.phases,"phase",n);r("addPhase",{name:F,rank:Q,projectId:o.project.id})},l=()=>{const F=n("template.defaultName.phase",{idx:1}),Q=Qi(o.phases);r("addPhase",{name:F,rank:Q,projectId:o.project.id})},c=F=>{r("updatePhase",F)},u=F=>{r("archivePhase",F)},d=F=>{r("unarchivePhase",F)},f=F=>{r("copyPhaseToTemplate",F)},p=F=>{r("addMilestone",F)},m=F=>{r("updateMilestone",F)},h=F=>{r("archiveMilestone",F)},g=F=>{r("unarchiveMilestone",F)},y=F=>{r("addActivity",F)},C=F=>{r("update:activity",F)},v=F=>{r("archiveActivity",F)},_=F=>{r("unarchiveActivity",F)},k=F=>{r("addSubtask",F)},w=F=>{r("updateSubtask",F)},b=F=>{r("deleteSubtask",F)},E=i.computed(()=>s.value.flatMap(F=>F.activities)),T=F=>{r("addFiles",F)},S=F=>{r("removeFile",F)},N=F=>{r("addComment",F)},O=F=>{r("updateComment",F)},A=F=>{r("removeComment",F)},D=i.ref(!1),M=i.ref(!1),L=(F,Q)=>{r("applyTemplate",{templateId:F,projectId:Q}),D.value=!1},I=(F,Q)=>{var oe;const P=(oe=o.templates)==null?void 0:oe.at(-1),re=P?Je.LexoRank.parse(P.rank).genNext():Je.LexoRank.middle();r("saveTemplate",{templateName:F,rank:re.format(),phaseIds:Q}),M.value=!1},j=Ki.useRouter(),R=i.ref("overview"),q=[{label:"Overview",value:"overview"},{label:"Feed",value:"feed"},{label:"Mapping",value:"mapping"}];return i.watch(R,F=>{F==="feed"?(j.push({name:je.feed}),console.log("Navigating to feed...")):F==="overview"?(j.push({name:je.project}),console.log("Navigating to feed...")):F==="mapping"&&(j.push({name:je.mapping}),console.log("Navigating to feed..."))}),(F,Q)=>{var re;const P=i.resolveComponent("RouterView");return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("div",i.mergeProps({class:"ao-project-overview"},F.$attrs),[i.createElementVNode("div",Ope,[i.createVNode(es,null,{primary:i.withCtx(()=>[i.createVNode(ps,{modelValue:R.value,"onUpdate:modelValue":Q[0]||(Q[0]=oe=>R.value=oe),tabs:q},null,8,["modelValue"]),i.createVNode(me,{class:"ao-feed__show-archived",size:"sm","icon-name":t.showsArchived?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:F.$t("feed.filters.showsArchived.label"),role:"checkbox","aria-checked":t.showsArchived,onClick:Q[1]||(Q[1]=oe=>F.$emit("update:showsArchived",!t.showsArchived))},null,8,["icon-name","label","aria-checked"])]),secondary:i.withCtx(()=>[t.isEditable===!0?(i.openBlock(),i.createBlock(me,{key:0,class:"ao-project-overview__quick-add-phase",size:"sm","icon-name":"Add","icon-position":"start",color:"primary",variant:"ghost",label:F.$t("project.phase.add"),onClick:l},null,8,["label"])):i.createCommentVNode("",!0),t.isEditable===!0?(i.openBlock(),i.createBlock(me,{key:1,class:"ao-project-overview__save-as-template",color:"primary",label:F.$t("project.template.save.label"),onClick:Q[2]||(Q[2]=oe=>M.value=!0)},null,8,["label"])):i.createCommentVNode("",!0),t.isEditable===!0?(i.openBlock(),i.createBlock(me,{key:2,class:"ao-project-overview__add-template",color:"primary",label:F.$t("project.template.apply.label"),onClick:Q[3]||(Q[3]=oe=>D.value=!0)},null,8,["label"])):i.createCommentVNode("",!0)]),_:1}),i.createElementVNode("div",Lpe,[i.createVNode(ad,{phases:t.phases,"closed-status":t.closedStatus,"is-editable":t.isEditable===!0,users:t.users,"time-tracking-data":t.timeTrackingData,"estimation-unit":(re=t.project)==null?void 0:re.estimationUnit,onAddMilestone:p,onUpdateMilestone:m,onArchiveMilestone:h,onUnarchiveMilestone:g,onAddPhase:a,onUpdatePhase:c,onArchivePhase:u,onUnarchivePhase:d,onCopyPhaseToTemplate:f},null,8,["phases","closed-status","is-editable","users","time-tracking-data","estimation-unit"])])]),i.createVNode(P,{class:"ao-project__sidebar",phases:t.phases,"project-id":t.project.id,"project-name":t.project.name,users:t.users,"is-editable":t.isEditable===!0,"closed-status":t.closedStatus,"time-tracking-data":t.timeTrackingData,onClose:Q[4]||(Q[4]=oe=>F.$router.push({name:i.unref(je).project})),onUpdateMilestone:m,onAddActivity:y,onUpdateActivity:C,onArchiveActivity:v,onUnarchiveActivity:_},null,8,["phases","project-id","project-name","users","is-editable","closed-status","time-tracking-data"]),(i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[i.createVNode(P,{name:"modal",activities:E.value,"is-task-checkable":t.isTaskCheckable,statuses:t.statuses,"activity-types":t.activityTypes,phases:t.phases,project:t.project,users:t.users,"user-id":t.userId,"is-editable":t.isEditable,"attachment-enabled":t.attachmentEnabled,"time-tracking-data":t.timeTrackingData,"load-attachment-preview":t.loadAttachmentPreview,"onUpdate:activity":C,onAddSubtask:k,onUpdateSubtask:w,onDeleteSubtask:b,onAddFiles:T,onRemoveFile:S,onAddComment:N,onUpdateComment:O,onRemoveComment:A},{default:i.withCtx(({Component:oe})=>[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(oe),null,{default:i.withCtx(G=>[i.renderSlot(F.$slots,"activityDetailsBody",i.normalizeProps(i.guardReactiveProps(G)))]),_:3}))]),_:3},8,["activities","is-task-checkable","statuses","activity-types","phases","project","users","user-id","is-editable","attachment-enabled","time-tracking-data","load-attachment-preview"])]))],16),(i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[M.value?(i.openBlock(),i.createBlock(Fg,{key:0,phases:t.phases,onClose:Q[5]||(Q[5]=oe=>M.value=!1),onSave:I},null,8,["phases"])):i.createCommentVNode("",!0),D.value?(i.openBlock(),i.createBlock(Pg,{key:1,"project-id":t.project.id,templates:t.templates,onClose:Q[6]||(Q[6]=oe=>D.value=!1),onApply:L},null,8,["project-id","templates"])):i.createCommentVNode("",!0)]))],64)}}});const Ppe={class:"ao-card-feed__header"},Fpe={key:1,class:"ao-card-feed__header-secondary ao-card-feed__header-icons"},Vpe={key:2,class:"ao-card-feed__header-secondary ao-card-feed__secondary"},Rpe={class:"ao-card-feed__body"},zpe={key:0,class:"ao-card-feed__breadcrumbs"},Upe={class:i.normalizeClass(["ao-card-feed__title-group"])},qpe={class:"ao-card-feed__title-line"},Hpe={key:0,class:"ao-card-feed__slug"},jpe={key:1,class:"ao-card-feed__deadline"},Wpe={class:"ao-card-feed__footer"},Zpe={class:"ao-card-feed__footer-row"},Kpe={class:"ao-assignees"},Gpe={key:0,class:"ao-assignee"},Ype={key:0,class:"ao-card-feed__subitems"},Jpe={key:0,class:"ao-card-feed__subitem"},Xpe={class:"ao-card-feed__subitem"},Qpe={key:1,class:"ao-card-feed__subitem"},eme={class:"ao-card-feed__subitem"},tme={class:"ao-card-feed__timer-wrapper"},nme={class:"ao-card-feed__footer-row"},ome={key:0,class:"ao-card-feed__progress-wrapper"},rme={class:"ao-card-feed__subitem"},ime={class:"ao-card-feed__subitem"},ld=i.defineComponent({__name:"AoCardFeed",props:{id:{},name:{},projectName:{},projectId:{},projectColor:{},phaseName:{},milestoneName:{},milestoneColor:{},deadline:{},important:{type:Boolean},assignee:{},slug:{},comments:{},attachments:{},tasks:{},isEditable:{type:Boolean},isPrivate:{type:Boolean},isClosed:{type:Boolean},tagType:{}},emits:["removeAssignee","updateActivity","startTimer"],setup(t,{emit:e}){const n=t,o=e,r=i.computed(()=>n.tagType==="milestone"?n.milestoneName:n.projectName),s=i.computed(()=>n.tagType==="milestone"?n.milestoneColor:n.projectColor),a=g=>{o("updateActivity",{id:n.id,name:g})},l=i.computed(()=>n.tagType==="milestone"&&n.phaseName?`${n.phaseName}`:n.phaseName&&n.milestoneName?`${n.phaseName} / ${n.milestoneName}`:""),c=i.computed(()=>n.assignee?[n.assignee]:[]),u=i.computed(()=>Da(n.deadline)),d=g=>{o("removeAssignee",g)},f=()=>{o("startTimer",{activityId:n.id,name:n.name,project:n.projectName,projectId:n.projectId,slug:n.slug})},p=i.computed(()=>{var g;return(g=n.tasks)==null?void 0:g.length}),m=i.computed(()=>{var g;return(g=n.tasks)==null?void 0:g.filter(y=>y.isDone).length}),h=i.computed(()=>(m.value||0)/(p.value||1));return(g,y)=>(i.openBlock(),i.createBlock(ul,{class:i.normalizeClass(["ao-card-feed",{"ao-card-feed--closed":t.isClosed}]),"is-clickable":!0},{header:i.withCtx(()=>[i.createElementVNode("div",Ppe,[r.value?(i.openBlock(),i.createBlock(Bi,{key:0,label:r.value,class:"ao-card-feed__project",variant:"solid",color:t.projectColor?void 0:"primary","raw-color":s.value},null,8,["label","color","raw-color"])):i.createCommentVNode("",!0),t.isPrivate||t.important||t.isClosed?(i.openBlock(),i.createElementBlock("div",Fpe,[t.isPrivate?(i.openBlock(),i.createBlock(ve,{key:0,name:"Lock",class:"ao-card-feed__warning",size:"sm"})):i.createCommentVNode("",!0),t.important?(i.openBlock(),i.createBlock(ve,{key:1,name:"FlagRounded",class:"ao-card-feed__important",size:"sm"})):i.createCommentVNode("",!0),t.isClosed?(i.openBlock(),i.createBlock(ve,{key:2,name:"CheckSmallRounded",class:"ao-card-feed__closed"})):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),g.$slots.secondary?(i.openBlock(),i.createElementBlock("div",Vpe,[i.renderSlot(g.$slots,"secondary")])):i.createCommentVNode("",!0)])]),default:i.withCtx(()=>[i.createElementVNode("div",Rpe,[l.value?(i.openBlock(),i.createElementBlock("span",zpe,i.toDisplayString(l.value),1)):i.createCommentVNode("",!0),i.createElementVNode("div",Upe,[i.createElementVNode("div",qpe,[t.slug?(i.openBlock(),i.createElementBlock("span",Hpe,i.toDisplayString(t.slug)+": ",1)):i.createCommentVNode("",!0),i.createVNode(ct,{id:t.id,title:t.name,level:5,"is-editable":t.isEditable,class:"ao-card-feed__title-inline","onUpdate:title":a},null,8,["id","title","is-editable"])])]),t.deadline?(i.openBlock(),i.createElementBlock("span",jpe,i.toDisplayString(u.value),1)):i.createCommentVNode("",!0)])]),footer:i.withCtx(()=>[i.createElementVNode("div",Wpe,[i.createElementVNode("div",Zpe,[i.createElementVNode("ul",Kpe,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(c.value,C=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:C.id},[C?(i.openBlock(),i.createElementBlock("li",Gpe,[i.createVNode(qn,{"user-name":i.unref(Bp)(C),"avatar-url":C.avatarUrl,"is-closable":!0,onClose:()=>d(C.id)},null,8,["user-name","avatar-url","onClose"])])):i.createCommentVNode("",!0)],64))),128))]),t.comments||t.attachments?(i.openBlock(),i.createElementBlock("ul",Ype,[t.comments?(i.openBlock(),i.createElementBlock("li",Jpe,[i.createVNode(ve,{name:"ChatOutline",size:"sm"}),i.createElementVNode("span",Xpe,i.toDisplayString(t.comments),1)])):i.createCommentVNode("",!0),t.attachments?(i.openBlock(),i.createElementBlock("li",Qpe,[i.createVNode(ve,{name:"AttachFileRounded",size:"sm"}),i.createElementVNode("span",eme,i.toDisplayString(t.attachments),1)])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),i.createElementVNode("div",tme,[i.createVNode(ve,{name:"TimerOutline",class:"ao-card-feed__timer",size:"md",onClick:i.withModifiers(f,["stop"])})])]),i.createElementVNode("div",nme,[t.tasks&&t.tasks.length?(i.openBlock(),i.createElementBlock("div",ome,[i.createElementVNode("div",rme,[i.createVNode(ve,{name:"SelectCheckBox",size:"sm"}),i.createElementVNode("span",ime,i.toDisplayString(m.value)+" / "+i.toDisplayString(p.value),1)]),i.createVNode(dl,{percentages:h.value,class:"ao-card-feed__progress"},null,8,["percentages"])])):i.createCommentVNode("",!0)])])]),_:3},8,["class"]))}});const sme={class:"ao-project-milestone"},ame={class:"ao-project-milestone__header"},lme={class:"ao-project-milestone__header_line"},cme={class:"ao-project-milestone__header_line"},ume={class:"ao-project-milestone__title"},dme={key:0,class:"ao-fieldset ao-milestone__fieldset"},fme={class:"ao-field__row ao-milestone__field-row"},pme={class:"ao-field ao-field--inline"},mme={class:"ao-field__row ao-milestone__field-row"},hme={class:"ao-field ao-milestone__field-multiselect"},gme={class:"ao-milestone__color-actions"},vme=["onClick"],yme=["title"],_me={class:"ao-project-milestone__body"},Cme={key:0,class:"ao-project-milestone__footer"},up=i.defineComponent({__name:"AoProjectOverviewMilestoneDetails",props:{milestoneId:{},users:{},projectId:{},phases:{},phaseId:{},isEditable:{type:Boolean},closedStatus:{},timeTrackingData:{}},emits:["close","addActivity","updateMilestone","updateActivity","archiveActivity","unarchiveActivity","startTimer"],setup(t,{emit:e}){const{t:n}=wn(),o=t,r=e,s=b=>{var E;r("startTimer",b),(E=window.parent)==null||E.postMessage({type:"startTimer",data:b},"*")},a=i.computed(()=>{var b;return(b=o.phases)==null?void 0:b.find(E=>E.id===o.phaseId)}),l=i.computed(()=>{var b;return(b=o.phases)==null?void 0:b.flatMap(E=>E.milestones)}),c=i.computed(()=>{var b;return(b=l.value)==null?void 0:b.find(E=>E.id===o.milestoneId)}),u=i.computed(()=>{var b;return(b=c.value)==null?void 0:b.activities});i.watch(u,(b,E)=>{Pn(b,E)});const d=b=>{r("close",b)},f=()=>{const{name:b,rank:E}=Uo(u.value??[],"activity",n);r("addActivity",{milestoneId:o.milestoneId,name:b,rank:E,projectId:o.projectId})},p=()=>{const b=n("template.defaultName.activity",{idx:1}),E=Qi(u.value??[]);r("addActivity",{milestoneId:o.milestoneId,name:b,rank:E,projectId:o.projectId})},m=b=>{r("updateActivity",b)},h=b=>{u.value&&"moved"in b&&r("updateActivity",{id:b.moved.element.id,rank:Ar(u.value,b.moved.newIndex)})},g=i.computed({get:()=>{var b;return(b=c.value)==null?void 0:b.color},set:b=>{c.value&&r("updateMilestone",{id:c.value.id,color:b})}}),y=i.computed({get:()=>{var b;return((b=c==null?void 0:c.value)==null?void 0:b.deadline)??""},set:b=>{c.value&&r("updateMilestone",{id:c.value.id,deadline:b!=null&&b.length?b:null})}}),C=b=>o.closedStatus?Gc(b,o.closedStatus):!1,v=i.computed(()=>{var b;return((b=o.users)==null?void 0:b.map(E=>({label:`${E.firstName} ${E.lastName}`,value:E.id,avatar:E.avatarUrl})))||[]}),_=i.computed({get(){var b,E;return(E=(b=c.value)==null?void 0:b.assignee)!=null&&E.id?[c.value.assignee.id]:[]},set(b){r("updateMilestone",{id:o.milestoneId,assigneeId:b[0]??null})}}),k=i.computed({get(){var b;return((b=c.value)==null?void 0:b.important)??!1},set(b){r("updateMilestone",{id:o.milestoneId,important:b})}}),w=(b,E)=>{const T=b.currentTarget;T instanceof HTMLElement&&E(T)};return(b,E)=>{var T;return i.openBlock(),i.createElementBlock("div",sme,[i.createElementVNode("header",ame,[i.createElementVNode("div",lme,[i.createVNode(me,{"icon-name":"CloseRounded",variant:"ghost",size:"sm",class:"ao-milestone__close",onClick:d})]),i.createElementVNode("div",cme,[i.createElementVNode("div",ume,[i.createVNode(ct,{title:((T=c.value)==null?void 0:T.name)||t.milestoneId,level:5},null,8,["title"]),i.createVNode(Lg,{modelValue:k.value,"onUpdate:modelValue":E[0]||(E[0]=S=>k.value=S),modelModifiers:{lazy:!0},disabled:!t.isEditable,class:"ao-milestone__important",color:"danger",label:b.$t("activity.important.label"),"icon-name":"FlagRounded",variant:"ghost",size:"sm"},null,8,["modelValue","disabled","label"])])]),c.value?(i.openBlock(),i.createElementBlock("div",dme,[i.createElementVNode("div",fme,[i.createElementVNode("label",pme,[i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":E[1]||(E[1]=S=>y.value=S),class:"ao-milestone__field ao-milestone__date-field",type:"date"},null,512),[[i.vModelText,y.value,void 0,{lazy:!0}]])])]),i.createElementVNode("div",mme,[i.createElementVNode("label",hme,[i.createVNode(Dt,{modelValue:_.value,"onUpdate:modelValue":E[2]||(E[2]=S=>_.value=S),options:v.value,"close-on-select":!0,searchable:!0,max:1,class:"ao-milestone__field ao-milestone__multiselect",placeholder:b.$t("activity.filters.assignee.placeholder"),mode:"tags",disabled:!t.isEditable,caret:t.isEditable},{tag:i.withCtx(({option:S,handleTagRemove:N})=>[i.createVNode(qn,{"user-name":S.label,"avatar-url":S.avatar,"is-closable":!0,onClose:O=>N(S,O)},null,8,["user-name","avatar-url","onClose"])]),_:1},8,["modelValue","options","placeholder","disabled","caret"])])]),i.createElementVNode("div",gme,[i.createVNode(fl,{color:g.value,"onUpdate:color":E[3]||(E[3]=S=>g.value=S)},{clickable:i.withCtx(({openPicker:S,bgColor:N})=>[i.createElementVNode("button",{style:i.normalizeStyle({background:N}),class:"color-button",onClick:O=>w(O,S)},null,12,vme)]),_:1},8,["color"]),t.isEditable?(i.openBlock(),i.createElementBlock("button",{key:0,type:"button",class:"ao-project-milestone__quick-add",title:b.$t("project.activity.add"),onClick:p},[i.createVNode(ve,{name:"Add",class:"ao-project-milestone__quick-add-icon"})],8,yme)):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0)]),i.createElementVNode("div",_me,[i.createVNode(i.unref(ho),i.mergeProps({class:"ao-project-milestone__activities",list:u.value,disabled:!t.isEditable,"item-key":"id",group:"kanban"},b.$attrs,{onChange:h}),{item:i.withCtx(({element:S})=>{var N,O,A,D,M;return[i.createVNode(ld,{id:S.id,name:S.name||S.id,"project-id":t.projectId,"phase-name":(N=a.value)==null?void 0:N.name,"milestone-name":(O=c.value)==null?void 0:O.name,"milestone-color":(A=c.value)==null?void 0:A.color,deadline:S.deadline,important:S.important,users:t.users,assignee:S.assignee,slug:S.slug,comments:(D=S.comments)==null?void 0:D.length,attachments:(M=S.attachments)==null?void 0:M.length,tasks:S.tasks,"is-editable":t.isEditable,"is-private":S.private,"is-closed":C(S),onClick:L=>b.$router.push({name:i.unref(je).activity,params:{milestoneId:t.milestoneId,activityId:S.id}}),onUpdateActivity:m,onRemoveAssignee:()=>m({id:S.id,assigneeId:null}),onStartTimer:s},i.createSlots({_:2},[t.isEditable?{name:"secondary",fn:i.withCtx(()=>[t.isEditable&&S.active?(i.openBlock(),i.createBlock(me,{key:0,color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:b.$t("archive"),onClick:i.withModifiers(()=>b.$emit("archiveActivity",{id:S.id}),["stop"])},null,8,["label","onClick"])):i.createCommentVNode("",!0),t.isEditable&&!S.active?(i.openBlock(),i.createBlock(me,{key:1,color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:b.$t("feed.activity.unarchive"),onClick:i.withModifiers(()=>b.$emit("unarchiveActivity",{id:S.id}),["stop"])},null,8,["label","onClick"])):i.createCommentVNode("",!0)]),key:"0"}:void 0]),1032,["id","name","project-id","phase-name","milestone-name","milestone-color","deadline","important","users","assignee","slug","comments","attachments","tasks","is-editable","is-private","is-closed","onClick","onRemoveAssignee"])]}),_:1},16,["list","disabled"]),t.isEditable?(i.openBlock(),i.createElementBlock("div",Cme,[i.createVNode(go,{"icon-name":"Add",label:b.$t("project.activity.add"),onClick:f},null,8,["label"])])):i.createCommentVNode("",!0)])])}}});const bme=i.defineComponent({__name:"AoProjectOverviewActivityDetails",props:{phaseId:{},milestoneId:{},activityId:{},activityTypes:{},activities:{},isTaskCheckable:{type:Function},statuses:{},phases:{},users:{},project:{},userId:{},isEditable:{type:Boolean},attachmentEnabled:{type:Boolean},timeTrackingData:{},loadAttachmentPreview:{type:Function}},emits:["update:activity","addSubtask","updateSubtask","deleteSubtask","addFiles","removeFile","addComment","updateComment","removeComment"],setup(t,{emit:e}){const n=t,o=e,r=i.computed(()=>{var C;return(C=n.phases)==null?void 0:C.find(v=>v.id===n.phaseId)}),s=i.computed(()=>{var C;return(C=n.phases)==null?void 0:C.flatMap(v=>v.milestones)}),a=i.computed(()=>{var C;return(C=s.value)==null?void 0:C.find(v=>v.id===n.milestoneId)}),l=i.computed(()=>{var C;return(C=n.activities)==null?void 0:C.find(v=>v.id===n.activityId)}),c=C=>{o("update:activity",C)},u=C=>{o("addSubtask",C)},d=C=>{o("updateSubtask",C)},f=C=>{o("deleteSubtask",C)},p=C=>{o("addFiles",C)},m=C=>{o("removeFile",C)},h=C=>{o("addComment",C)},g=C=>{o("updateComment",C)},y=C=>{o("removeComment",C)};return(C,v)=>{var _,k;return l.value?(i.openBlock(),i.createBlock(Xu,{key:0,activity:l.value,"activity-types":t.activityTypes,"milestone-id":t.milestoneId,"template-activities":t.activities,"is-template":!1,users:t.users,"user-id":t.userId,"is-task-checkable":t.isTaskCheckable,statuses:t.statuses,breadcrumbs:`${(_=r.value)==null?void 0:_.name} / ${(k=a.value)==null?void 0:k.name}`,"is-editable":t.isEditable,"attachment-enabled":t.attachmentEnabled,projects:[t.project],"time-tracking-data":t.timeTrackingData,"load-attachment-preview":n.loadAttachmentPreview,onClose:C.$router.back,"onUpdate:activity":c,onAddSubtask:u,onUpdateSubtask:d,onDeleteSubtask:f,onAddFiles:p,onRemoveFile:m,onAddComment:h,onUpdateComment:g,onRemoveComment:y},{default:i.withCtx(w=>[i.renderSlot(C.$slots,"default",i.normalizeProps(i.guardReactiveProps(w)))]),_:3},8,["activity","activity-types","milestone-id","template-activities","users","user-id","is-task-checkable","statuses","breadcrumbs","is-editable","attachment-enabled","projects","time-tracking-data","load-attachment-preview","onClose"])):i.createCommentVNode("",!0)}}}),kme={class:"ao-col-header"},wme=i.defineComponent({__name:"AoColHeader",props:{title:{},items:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("header",kme,[i.createVNode(ct,{title:t.title,class:"ao-col-header__title",level:4},null,8,["title"]),t.items?(i.openBlock(),i.createBlock(Bi,{key:0,label:t.items,class:"ao-col-header__items",variant:"solid",color:"primary"},null,8,["label"])):i.createCommentVNode("",!0)]))}});function Eme(t){return i.getCurrentScope()?(i.onScopeDispose(t),!0):!1}function wa(t){return typeof t=="function"?t():i.unref(t)}const xme=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Sme=t=>t!=null,Mi=()=>{};function Tme(t,e){function n(...o){return new Promise((r,s)=>{Promise.resolve(t(()=>e.apply(this,o),{fn:e,thisArg:this,args:o})).then(r).catch(s)})}return n}function Ame(t,e={}){let n,o,r=Mi;const s=l=>{clearTimeout(l),r(),r=Mi};return l=>{const c=wa(t),u=wa(e.maxWait);return n&&s(n),c<=0||u!==void 0&&u<=0?(o&&(s(o),o=null),Promise.resolve(l())):new Promise((d,f)=>{r=e.rejectOnCancel?f:d,u&&!o&&(o=setTimeout(()=>{n&&s(n),o=null,d(l())},u)),n=setTimeout(()=>{o&&s(o),o=null,d(l())},c)})}}function Nme(t,e=200,n={}){return Tme(Ame(e,n),t)}function sc(t){var e;const n=wa(t);return(e=n==null?void 0:n.$el)!=null?e:n}const Dme=xme?window:void 0;function Mme(){const t=i.ref(!1),e=i.getCurrentInstance();return e&&i.onMounted(()=>{t.value=!0},e),t}function Bme(t){const e=Mme();return i.computed(()=>(e.value,!!t()))}function $me(t,e,n={}){const{root:o,rootMargin:r="0px",threshold:s=.1,window:a=Dme,immediate:l=!0}=n,c=Bme(()=>a&&"IntersectionObserver"in a),u=i.computed(()=>{const h=wa(t);return(Array.isArray(h)?h:[h]).map(sc).filter(Sme)});let d=Mi;const f=i.ref(l),p=c.value?i.watch(()=>[u.value,sc(o),f.value],([h,g])=>{if(d(),!f.value||!h.length)return;const y=new IntersectionObserver(e,{root:sc(g),rootMargin:r,threshold:s});h.forEach(C=>C&&y.observe(C)),d=()=>{y.disconnect(),d=Mi}},{immediate:l,flush:"post"}):Mi,m=()=>{d(),p(),f.value=!1};return Eme(m),{isSupported:c,isActive:f,pause(){d(),f.value=!1},resume(){f.value=!0},stop:m}}const Ome={class:i.normalizeClass(["ao-list-kanban"])},Lme={class:"ao-list-kanban__header"},Ime=["title"],Pme={key:0,class:"ao-list-kanban__end ao-list-kanban__end--loading"},Fme={key:1,class:"ao-list-kanban__end"},Vme={key:0,class:"ao-list-kanban__no-more"},Rme={key:1,class:"ao-list-kanban__divider"},zme={key:1,class:"ao-list-kanban__footer"},Ume=i.defineComponent({__name:"AoListKanban",props:{list:{},status:{},users:{},userId:{},title:{},footerLabel:{},isLoading:{type:Boolean},hasMore:{type:Boolean},noMoreLabel:{},isEditable:{type:[Boolean,String]},tagType:{},showHeaderAdd:{type:Boolean}},emits:["add","addAtBeginning","update:list","change:list","loadMore","selectActivity","archiveActivity","unarchiveActivity","updateActivity","startTimer"],setup(t,{emit:e}){const n=t,o=e,r=i.ref(!1),s=i.ref(null);$me(s,([{isIntersecting:f}])=>{r.value=f}),i.watch(r,f=>{f&&n.hasMore&&!n.isLoading&&o("loadMore")});const a=f=>{var p;return n.isEditable===!0?!0:n.userId&&n.isEditable==="only-own"?n.userId===((p=f.assignee)==null?void 0:p.id):!1},l=f=>{o("selectActivity",f)},c=f=>{o("updateActivity",f)},u=f=>{"added"in f?o("updateActivity",{id:f.added.element.id,statusId:n.status.id,rank:Ar(n.list,f.added.newIndex)}):"removed"in f||"moved"in f&&o("updateActivity",{id:f.moved.element.id,rank:Ar(n.list,f.moved.newIndex)})},d=i.ref(!1);return(f,p)=>(i.openBlock(),i.createElementBlock("div",Ome,[t.title||f.$slots.header?i.renderSlot(f.$slots,"header",{},()=>{var m;return[i.createElementVNode("div",Lme,[t.title?(i.openBlock(),i.createBlock(wme,{key:0,class:"ao-list-kanban__col-header",title:t.title,level:3,items:(m=t.list)==null?void 0:m.length},null,8,["title","items"])):i.createCommentVNode("",!0),t.showHeaderAdd?(i.openBlock(),i.createElementBlock("button",{key:1,class:"ao-list-kanban__header-add",title:f.$t("feed.activity.add"),onClick:p[0]||(p[0]=h=>f.$emit("addAtBeginning"))},[i.createVNode(ve,{name:"Add"})],8,Ime)):i.createCommentVNode("",!0)])]},void 0,0):i.createCommentVNode("",!0),i.createVNode(i.unref(ho),i.mergeProps({class:["ao-list-kanban__list",d.value?"ao-list-kanban__transition":void 0],list:t.list,"item-key":"id",group:"kanban","ghost-class":"ao-list-kanban__ghost",animation:"200"},f.$attrs,{draggable:".ao-list-draggable",disabled:!t.isEditable,"component-data":{tag:"transition-group",name:"ao-list-kanban__transition"},onChange:u,onStart:p[2]||(p[2]=m=>d.value=!0),onEnd:p[3]||(p[3]=m=>d.value=!1)}),{item:i.withCtx(({element:m})=>{var h,g,y,C,v,_,k,w,b,E;return[i.createVNode(ld,{id:m.id,class:i.normalizeClass(a(m)?"ao-list-draggable":""),name:m.name,"project-name":(h=m.project)==null?void 0:h.name,"project-id":(g=m.project)==null?void 0:g.id,"project-color":(y=m.project)==null?void 0:y.color,"phase-name":(v=(C=m.milestone)==null?void 0:C.phase)==null?void 0:v.name,"milestone-name":(_=m.milestone)==null?void 0:_.name,"milestone-color":(k=m.milestone)==null?void 0:k.color,deadline:m.deadline,rules:((w=m.rules)==null?void 0:w.length)||0,tasks:m.tasks,description:m.description,important:m.important,type:m.type,comments:(b=m.comments)==null?void 0:b.length,attachments:(E=m.attachments)==null?void 0:E.length,users:t.users,assignee:m.assignee,slug:m.slug,"is-editable":a(m),"is-private":m.private,"tag-type":t.tagType,onUpdateActivity:[T=>a(m)&&c(T),()=>a(m)&&c],onClick:()=>l(m.id),onRemoveAssignee:()=>a(m)&&c({id:m.id,assigneeId:null}),onStartTimer:p[1]||(p[1]=T=>f.$emit("startTimer",T))},{secondary:i.withCtx(()=>[a(m)&&m.active?(i.openBlock(),i.createBlock(me,{key:0,color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:f.$t("feed.activity.archive"),onClick:i.withModifiers(()=>f.$emit("archiveActivity",{id:m.id}),["stop"])},null,8,["label","onClick"])):i.createCommentVNode("",!0),a(m)&&!m.active?(i.openBlock(),i.createBlock(me,{key:1,color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:f.$t("feed.activity.unarchive"),onClick:i.withModifiers(()=>f.$emit("unarchiveActivity",{id:m.id}),["stop"])},null,8,["label","onClick"])):i.createCommentVNode("",!0)]),_:2},1032,["id","class","name","project-name","project-id","project-color","phase-name","milestone-name","milestone-color","deadline","rules","tasks","description","important","type","comments","attachments","users","assignee","slug","is-editable","is-private","tag-type","onUpdateActivity","onClick","onRemoveAssignee"])]}),footer:i.withCtx(()=>[t.isLoading?(i.openBlock(),i.createElementBlock("div",Pme,[i.createVNode(ve,{name:"Loading"})])):t.hasMore?(i.openBlock(),i.createElementBlock("div",{key:2,ref_key:"scrollEnd",ref:s,class:"ao-list-kanban__end"},null,512)):(i.openBlock(),i.createElementBlock("div",Fme,[t.noMoreLabel?(i.openBlock(),i.createElementBlock("span",Vme,i.toDisplayString(t.noMoreLabel),1)):t.isEditable?(i.openBlock(),i.createElementBlock("span",Rme)):i.createCommentVNode("",!0)]))]),_:1},16,["class","list","disabled"]),f.$slots.footer||t.footerLabel?(i.openBlock(),i.createElementBlock("div",zme,[i.renderSlot(f.$slots,"footer",{},()=>[t.isEditable?(i.openBlock(),i.createBlock(go,{key:0,"icon-name":"AddBoxOutlineRounded",label:t.footerLabel,onClick:p[4]||(p[4]=m=>f.$emit("add"))},null,8,["label"])):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0)]))}});const qme={class:"ao-field ao-search-field"},Hme=["value","placeholder"],jme=i.defineComponent({__name:"AoSearchField",props:{modelValue:{},delay:{default:250},placeholder:{default:"Search"}},emits:["update:modelValue","clear"],setup(t,{emit:e}){const n=t,o=e,r=async l=>{const u=l.target.value;o("update:modelValue",u,l)},s=Nme(r,n.delay),a=l=>{o("clear",l)};return(l,c)=>(i.openBlock(),i.createElementBlock("div",qme,[i.createElementVNode("input",{value:t.modelValue,type:"text",class:"ao-field__input ao-search-field__input",placeholder:t.placeholder,onInput:c[0]||(c[0]=(...u)=>i.unref(s)&&i.unref(s)(...u)),onKeypress:i.withKeys(r,["enter"])},null,40,Hme),i.createVNode(ve,{name:"SearchRounded",class:i.normalizeClass(`ao-search-field__icon ao-search-field__action ${t.modelValue?"":"ao-search-field__action--visible"}`)},null,8,["class"]),i.createVNode(me,{"icon-name":"CloseRounded",size:"sm",color:"primary",corners:"round",class:i.normalizeClass(`ao-search-field__button ao-search-field__action ${t.modelValue?"ao-search-field__action--visible":""}`),onClick:a},null,8,["class"])]))}});const Wme={class:"ao-feed"},Zme={class:"ao-feed__filters"},Kme={class:"ao-feed__body"},Vg=i.defineComponent({__name:"AoFeed",props:{activities:{},statuses:{},project:{},projects:{},filters:{},activityTypes:{},users:{},userId:{},initialActivityId:{},initialActivitySlug:{},searchText:{default:""},showsArchivedActivities:{type:Boolean},showsOnlyImportant:{type:Boolean},showsOnlyNonAssigned:{type:Boolean},selectedActivity:{},isTaskCheckable:{type:Function,default:void 0},isEditable:{type:[Boolean,String]},attachmentEnabled:{type:Boolean,default:!0},timeTrackingData:{},loadAttachmentPreview:{}},emits:["change:activities","addActivity","update:filters","selectActivity","update:activity","archiveActivity","unarchiveActivity","update:searchText","clear:searchText","update:showsArchivedActivities","update:showsOnlyImportant","update:showsOnlyNonAssigned","addSubtask","updateSubtask","deleteSubtask","addFiles","removeFile","addComment","updateComment","removeComment","toast","startTimer"],setup(t,{emit:e}){const{t:n}=wn(),o=t,r=e;function s(P,re){r("toast",P,re)}const a=i.toRef(o,"activities"),l=async(P,re)=>{await r("selectActivity",P,re)},c=i.ref({}),u=i.ref(!1),d=i.ref(!1),f=i.computed(()=>o.project?"milestone":"project");i.watch([()=>o.statuses,()=>o.activities,()=>o.initialActivityId,()=>o.initialActivitySlug],async([P,re,oe,G],[z,te])=>{c.value=Object.fromEntries(P.map(de=>[de.id,re.filter(xe=>{var V;return((V=xe.status)==null?void 0:V.id)===de.id})])),oe&&!u.value?(l(oe,null),u.value=!0):G&&!u.value&&(l(null,G),u.value=!0),d.value&&Pn(re,te)},{immediate:!0});const p=i.computed(()=>{var P;return!o.selectedActivity||!o.selectedActivity.milestone?"":`${((P=o.selectedActivity.milestone.phase)==null?void 0:P.name)??""} / ${o.selectedActivity.milestone.name??""}`}),m=P=>{var te,de;const re=(te=o.activities)==null?void 0:te.at(-1),oe=re?Je.LexoRank.parse(re.rank).genNext():Je.LexoRank.middle(),G=((de=o.activities)==null?void 0:de.length)??0,z={name:n("activity.defaultName",{idx:G+1}),rank:oe.format(),statusId:P.id};o.filters.assigneeId.length>0&&(z.assigneeId=o.filters.assigneeId[0]),o.filters.projectId.length>0&&(z.projectId=o.filters.projectId[0]),o.filters.typeId.length>0&&(z.typeId=o.filters.typeId[0]),d.value=!0,r("addActivity",z)},h=P=>{var te,de;const re=((te=o.activities)==null?void 0:te.filter(xe=>{var V;return((V=xe.status)==null?void 0:V.id)===P.id}))??[],oe=Qi(re),G=((de=o.activities)==null?void 0:de.length)??0,z={name:n("activity.defaultName",{idx:G+1}),rank:oe,statusId:P.id};o.filters.assigneeId.length>0&&(z.assigneeId=o.filters.assigneeId[0]),o.filters.projectId.length>0&&(z.projectId=o.filters.projectId[0]),o.filters.typeId.length>0&&(z.typeId=o.filters.typeId[0]),d.value=!0,r("addActivity",z)},g=(P,re)=>{d.value=!1,r("update:filters",{...o.filters,[P]:re})},y=i.computed(()=>o.project?[o.project]:o.projects??[]),C=i.computed(()=>y.value.map(P=>({value:P.id,label:P.name}))),v=i.computed(()=>{var P;return(P=o.activityTypes)==null?void 0:P.map(re=>({value:re.id,label:re.name}))}),_=i.computed(()=>o.users.map(P=>({value:P.id,label:`${P.firstName} ${P.lastName}`,avatar:P.avatarUrl}))),k=P=>{o.selectedActivity&&r("update:activity",P)},w=P=>{r("update:activity",P)},b=P=>{r("archiveActivity",P)},E=P=>{r("unarchiveActivity",P)},T=P=>{var re;r("startTimer",P),(re=window.parent)==null||re.postMessage({type:"startTimer",data:P},"*")},S=P=>{d.value=!1,r("update:searchText",P)},N=P=>{d.value=!1,r("clear:searchText",P)},O=P=>{o.selectedActivity&&r("addSubtask",P)},A=P=>{o.selectedActivity&&r("updateSubtask",P)},D=P=>{o.selectedActivity&&r("deleteSubtask",P)},M=P=>{r("addFiles",P)},L=P=>{r("removeFile",P)},I=P=>{o.selectedActivity&&r("addComment",{...P,activityId:o.selectedActivity.id})},j=P=>{const{id:re}=o.selectedActivity||{};re&&r("updateComment",P)},R=P=>{const{id:re}=o.selectedActivity||{};re&&r("removeComment",P)},q=Ki.useRouter(),F=i.ref("feed"),Q=[{label:"Overview",value:"overview"},{label:"Feed",value:"feed"},{label:"Mapping",value:"mapping"}];return i.watch(F,P=>{P==="feed"?(q.push({name:je.feed}),console.log("Navigating to feed...")):P==="overview"?(q.push({name:je.project}),console.log("Navigating to feed...")):P==="mapping"&&(q.push({name:je.mapping}),console.log("Navigating to feed..."))}),(P,re)=>{var oe;return i.openBlock(),i.createElementBlock("div",Wme,[i.createVNode(es,null,{primary:i.withCtx(()=>[i.createElementVNode("div",Zme,[i.createVNode(ps,{modelValue:F.value,"onUpdate:modelValue":re[0]||(re[0]=G=>F.value=G),tabs:Q},null,8,["modelValue"]),i.createVNode(jme,{"model-value":t.searchText,placeholder:P.$t("feed.search.placeholder"),class:"ao-feed__search","onUpdate:modelValue":S,onClear:N},null,8,["model-value","placeholder"]),o.project?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(Dt,{key:0,"model-value":t.filters[i.unref(No).project],mode:"tags",options:C.value,"close-on-select":!1,searchable:!0,class:"ao-feed__filter ao-feed__filter__projects",placeholder:P.$t("feed.filters.project.placeholder"),"onUpdate:modelValue":re[1]||(re[1]=G=>g(i.unref(No).project,G))},null,8,["model-value","options","placeholder"])),v.value?(i.openBlock(),i.createBlock(Dt,{key:1,"model-value":t.filters[i.unref(No).type],mode:"tags",options:v.value,"close-on-select":!1,searchable:!0,class:"ao-feed__filter ao-feed__filter__types",placeholder:P.$t("feed.filters.activityType.placeholder"),"onUpdate:modelValue":re[2]||(re[2]=G=>g(i.unref(No).type,G))},null,8,["model-value","options","placeholder"])):i.createCommentVNode("",!0),_.value.length?(i.openBlock(),i.createBlock(Dt,{key:2,"model-value":t.filters[i.unref(No).assignee],mode:"tags",options:_.value,"close-on-select":!1,searchable:!0,class:"ao-feed__filter ao-feed__filter__assignees",placeholder:P.$t("feed.filters.assignee.placeholder"),"onUpdate:modelValue":re[3]||(re[3]=G=>g(i.unref(No).assignee,G))},{tag:i.withCtx(({option:G,handleTagRemove:z})=>[i.createVNode(qn,{"user-name":G.label,"avatar-url":G.avatar,"is-closable":!0,onClose:te=>z(G,te)},null,8,["user-name","avatar-url","onClose"])]),_:1},8,["model-value","options","placeholder"])):i.createCommentVNode("",!0)]),i.createVNode(me,{class:"ao-feed__only-non-assigned",size:"sm","icon-name":t.showsOnlyNonAssigned?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:P.$t("feed.filters.showsOnlyNonAssigned.label"),role:"checkbox","aria-checked":t.showsOnlyNonAssigned,onClick:re[4]||(re[4]=G=>P.$emit("update:showsOnlyNonAssigned",!t.showsOnlyNonAssigned))},null,8,["icon-name","label","aria-checked"]),i.createVNode(me,{class:"ao-feed__only-important",size:"sm","icon-name":t.showsOnlyImportant?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:P.$t("feed.filters.showsOnlyImportant.label"),role:"checkbox","aria-checked":t.showsOnlyImportant,onClick:re[5]||(re[5]=G=>P.$emit("update:showsOnlyImportant",!t.showsOnlyImportant))},null,8,["icon-name","label","aria-checked"]),i.createVNode(me,{class:"ao-feed__show-archived",size:"sm","icon-name":t.showsArchivedActivities?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:P.$t("feed.filters.showsArchivedActivities.label"),role:"checkbox","aria-checked":t.showsArchivedActivities,onClick:re[6]||(re[6]=G=>P.$emit("update:showsArchivedActivities",!t.showsArchivedActivities))},null,8,["icon-name","label","aria-checked"])]),_:1}),i.createElementVNode("div",Kme,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.statuses,G=>(i.openBlock(),i.createBlock(Ume,{key:G.id,status:G,list:c.value[G.id],title:G.name,"footer-label":P.$t("feed.activity.add"),users:t.users,"user-id":t.userId,"is-editable":t.isEditable,"tag-type":f.value,"show-header-add":t.isEditable,onAdd:()=>m(G),onAddAtBeginning:()=>h(G),onSelectActivity:l,onArchiveActivity:b,onUnarchiveActivity:E,onUpdateActivity:w,onStartTimer:T},null,8,["status","list","title","footer-label","users","user-id","is-editable","tag-type","show-header-add","onAdd","onAddAtBeginning"]))),128))]),(i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[t.selectedActivity?(i.openBlock(),i.createBlock(Xu,{key:0,activity:t.selectedActivity,"activity-types":t.activityTypes,"milestone-id":(oe=t.selectedActivity.milestone)==null?void 0:oe.id,"template-activities":a.value,users:t.users,"user-id":t.userId,"is-task-checkable":t.isTaskCheckable,statuses:t.statuses,breadcrumbs:p.value,"is-editable":t.isEditable,"attachment-enabled":t.attachmentEnabled,projects:y.value,"time-tracking-data":t.timeTrackingData,"load-attachment-preview":o.loadAttachmentPreview,onClose:re[7]||(re[7]=()=>l(null,null)),"onUpdate:activity":k,onAddSubtask:O,onUpdateSubtask:A,onDeleteSubtask:D,onAddFiles:M,onRemoveFile:L,onAddComment:I,onUpdateComment:j,onRemoveComment:R,onToast:s},{default:i.withCtx(G=>[i.renderSlot(P.$slots,"activityDetailsBody",i.normalizeProps(i.guardReactiveProps(G)))]),_:3},8,["activity","activity-types","milestone-id","template-activities","users","user-id","is-task-checkable","statuses","breadcrumbs","is-editable","attachment-enabled","projects","time-tracking-data","load-attachment-preview"])):i.createCommentVNode("",!0)]))])}}});const Gme={class:"ao-project-mapping"},Yme={class:"ao-project-mapping-mapping__body"},Jme={class:"ao-project-mapping-mapping__phases"},Xme={key:0,class:"ao-project-mapping-mapping__image-wrapper"},Qme=["src","alt"],ehe=i.defineComponent({__name:"AoMapping",props:{project:{},phases:{},closedStatus:{},users:{},userId:{},templates:{},isTaskCheckable:{type:Function},statuses:{},activityTypes:{},isEditable:{type:[Boolean,String]},showsArchived:{type:Boolean},attachmentEnabled:{type:Boolean}},emits:["addPhase","updatePhase","archivePhase","unarchivePhase","copyPhaseToTemplate","applyTemplate","saveTemplate","update:showsArchived"],setup(t,{emit:e}){const{t:n}=wn(),o=t,r=e,s=()=>{const{name:v,rank:_}=Uo(o.phases,"phase",n);r("addPhase",{name:v,rank:_,projectId:o.project.id})},a=()=>{const v=n("template.defaultName.phase",{idx:1}),_=Qi(o.phases);r("addPhase",{name:v,rank:_,projectId:o.project.id})},l=v=>{r("updatePhase",v)},c=v=>{r("archivePhase",v)},u=v=>{r("unarchivePhase",v)},d=v=>{r("copyPhaseToTemplate",v)},f=i.ref(!1),p=i.ref(!1),m=(v,_)=>{r("applyTemplate",{templateId:v,projectId:_}),f.value=!1},h=(v,_)=>{var b;const k=(b=o.templates)==null?void 0:b.at(-1),w=k?Je.LexoRank.parse(k.rank).genNext():Je.LexoRank.middle();r("saveTemplate",{templateName:v,rank:w.format(),phaseIds:_}),p.value=!1},g=Ki.useRouter(),y=i.ref("mapping"),C=[{label:"Overview",value:"overview"},{label:"Feed",value:"feed"},{label:"Mapping",value:"mapping"}];return i.watch(y,v=>{v==="feed"?(g.push({name:je.feed}),console.log("Navigating to feed...")):v==="overview"?(g.push({name:je.project}),console.log("Navigating to feed...")):v==="mapping"&&(g.push({name:je.mapping}),console.log("Navigating to feed..."))}),(v,_)=>{var k;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("div",i.mergeProps({class:"ao-project-mapping-overview"},v.$attrs),[i.createElementVNode("div",Gme,[i.createVNode(es,null,{primary:i.withCtx(()=>[i.createVNode(ps,{modelValue:y.value,"onUpdate:modelValue":_[0]||(_[0]=w=>y.value=w),tabs:C},null,8,["modelValue"]),i.createVNode(me,{class:"ao-feed__show-archived",size:"sm","icon-name":t.showsArchived?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:v.$t("feed.filters.showsArchived.label"),role:"checkbox","aria-checked":t.showsArchived,onClick:_[1]||(_[1]=w=>v.$emit("update:showsArchived",!t.showsArchived))},null,8,["icon-name","label","aria-checked"])]),secondary:i.withCtx(()=>[t.isEditable===!0?(i.openBlock(),i.createBlock(me,{key:0,class:"ao-mapping__quick-add-phase",size:"sm","icon-name":"Add","icon-position":"start",color:"primary",variant:"ghost",label:v.$t("project.phase.add"),onClick:a},null,8,["label"])):i.createCommentVNode("",!0),t.isEditable===!0?(i.openBlock(),i.createBlock(me,{key:1,class:"ao-project-mapping-overview__save-as-template",color:"primary",label:v.$t("project.template.save.label"),onClick:_[2]||(_[2]=w=>p.value=!0)},null,8,["label"])):i.createCommentVNode("",!0),t.isEditable===!0?(i.openBlock(),i.createBlock(me,{key:2,class:"ao-project-mapping-overview__add-template",color:"primary",label:v.$t("project.template.apply.label"),onClick:_[3]||(_[3]=w=>f.value=!0)},null,8,["label"])):i.createCommentVNode("",!0)]),_:1}),i.createElementVNode("div",Yme,[i.createElementVNode("div",Jme,[i.createVNode(ad,{phases:t.phases,"closed-status":t.closedStatus,"is-editable":t.isEditable===!0,users:t.users,"estimation-unit":(k=t.project)==null?void 0:k.estimationUnit,onAddPhase:s,onUpdatePhase:l,onArchivePhase:c,onUnarchivePhase:u,onCopyPhaseToTemplate:d},null,8,["phases","closed-status","is-editable","users","estimation-unit"])]),t.project.architectureImage?(i.openBlock(),i.createElementBlock("div",Xme,[i.createElementVNode("img",{class:"architecture-image",src:t.project.architectureImage.url,alt:i.unref(n)("architectureImage.alt")},null,8,Qme)])):i.createCommentVNode("",!0)])])],16),(i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[p.value?(i.openBlock(),i.createBlock(Fg,{key:0,phases:t.phases,onClose:_[4]||(_[4]=w=>p.value=!1),onSave:h},null,8,["phases"])):i.createCommentVNode("",!0),f.value?(i.openBlock(),i.createBlock(Pg,{key:1,"project-id":t.project.id,templates:t.templates,onClose:_[5]||(_[5]=w=>f.value=!1),onApply:m},null,8,["project-id","templates"])):i.createCommentVNode("",!0)]))],64)}}});const Po={TEMPLATES:"templates",TEMPLATE_DETAILS:"template_details",TEMPLATES_LIST:"templates_list"},the=(t,e={})=>[{path:t,name:Po.TEMPLATES,redirect:{name:Po.TEMPLATES_LIST},...e,children:[{path:"",name:Po.TEMPLATES_LIST,component:Rg},{path:":templateId/:phaseId?/:milestoneId?/:activityId?",name:Po.TEMPLATE_DETAILS,component:Ig,props:!0}]}],je={project:"AoProject",feed:"AoProjectFeed",mapping:"AoProjectMapping",milestone:"AoMilestone",activity:"AoActivity"},nhe=(t,e={})=>[{path:t,...e,redirect:{name:je.project},children:[{path:"",name:je.project,component:Ipe,props:!0,children:[{path:":phaseId/:milestoneId",name:je.milestone,component:up,props:!0},{path:":phaseId/:milestoneId/:activityId",name:je.activity,props:{default:!0,modal:!0},components:{default:up,modal:bme}}]},{path:"feed",name:je.feed,component:Vg,props:!0},{path:"mapping",name:je.mapping,component:ehe,props:!0}]}],ohe={class:"ao-templates"},Rg=i.defineComponent({__name:"AoTemplatesList",props:{templates:{}},emits:["addTemplate","updateTemplates","updateItem","removeItem"],setup(t,{emit:e}){const{t:n}=wn(),o=t,r=e;i.watch(()=>o.templates,(u,d)=>{Pn(u,d)});const s=()=>{var m,h;const u=(m=o.templates)==null?void 0:m.at(-1),d=u?Je.LexoRank.parse(u.rank).genNext():Je.LexoRank.middle(),f=((h=o.templates)==null?void 0:h.length)??0,p={name:n("template.defaultName.template",{idx:f+1}),rank:d.format()};r("addTemplate",p)},a=(u,d)=>{r("updateItem",{itemType:Oe.TEMPLATES,id:u,templateId:u,data:{name:d}})},l=(u,d)=>{r("removeItem",{itemType:Oe.TEMPLATES,templateId:u,data:{id:u,...d?{name:d}:{}}})},c=u=>{if(u.moved){const d=Xi(u,o.templates??[]);r("updateItem",{itemType:Oe.TEMPLATES,id:u.moved.element.id,templateId:u.moved.element.id,data:{rank:d}})}};return(u,d)=>(i.openBlock(),i.createElementBlock("div",ohe,[i.createVNode(es,null,{secondary:i.withCtx(()=>[i.createVNode(me,{label:u.$t("templates.new"),color:"primary","icon-name":"Add","icon-position":"start",onClick:s},null,8,["label"])]),_:1}),i.createVNode(i.unref(ho),{"model-value":t.templates,class:"ao-templates__list","item-key":"id",handle:".ao-card__drag",onChange:c},{item:i.withCtx(({element:f})=>{var p;return[i.createVNode(U_,{id:f.id,title:f.name,phases:f.phases,milestones:(p=f.phases)!=null&&p.length?i.unref(f_)(f.phases):0,activities:f.phases?i.unref(p_)(f.phases):0,"updated-at":f.updatedAt,"updated-by":f.updatedBy,onUpdateTitle:m=>a(f.id,m),onClick:m=>u.$router.push({name:i.unref(Po).TEMPLATE_DETAILS,params:{templateId:f.id}}),onDeleteItem:d[0]||(d[0]=(m,h)=>l(m,h))},null,8,["id","title","phases","milestones","activities","updated-at","updated-by","onUpdateTitle","onClick"])]}),_:1},8,["model-value"])]))}});const rhe={class:"ao-field__label"},zg=i.defineComponent({__name:"AoField",props:{label:{},isMultiselect:{type:Boolean,default:!1}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("label",{class:i.normalizeClass(["ao-field",{"ao-field--multiselect":t.isMultiselect}])},[i.createElementVNode("span",rhe,i.toDisplayString(t.label),1),i.renderSlot(e.$slots,"default")],2))}}),ihe=["type","value","disabled","readonly"],she=i.defineComponent({__name:"AoInputField",props:{label:{default:""},type:{default:"text"},modelValue:{default:""},modelModifiers:{default:()=>({})},isDisabled:{type:Boolean,default:!1},isReadonly:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,o=e,r=i.computed(()=>n.modelModifiers.lazy?"change":"input"),s=a=>{n.modelModifiers.number&&(a=Number(a)),o("update:modelValue",a)};return(a,l)=>(i.openBlock(),i.createBlock(zg,{label:t.label},{default:i.withCtx(()=>[i.createElementVNode("input",i.mergeProps({class:"ao-field__input",type:t.type,value:t.modelValue,disabled:t.isDisabled,readonly:t.isReadonly},{[i.toHandlerKey(r.value)]:l[0]||(l[0]=c=>s(c.target.value))}),null,16,ihe)]),_:1},8,["label"]))}}),ahe={class:"ao-field"},lhe={class:"ao-field__label"},che=["checked","disabled"],uhe=i.defineComponent({__name:"AoCheckboxField",props:{label:{default:""},modelValue:{type:Boolean,default:!1},isReadonly:{type:Boolean,default:!1},isDisabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("label",ahe,[i.createElementVNode("span",lhe,i.toDisplayString(t.label),1),i.createElementVNode("input",{class:"ao-field__input",type:"checkbox",checked:t.modelValue,disabled:t.isDisabled,onChange:n[0]||(n[0]=o=>{var r;return e.$emit("update:modelValue",((r=o.target)==null?void 0:r.checked)??!1)})},null,40,che)]))}});exports.AoAvatar=qn;exports.AoCardFeed=ld;exports.AoCheckboxField=uhe;exports.AoColorPicker=fl;exports.AoFeed=Vg;exports.AoField=zg;exports.AoInputField=she;exports.AoMultiselect=Dt;exports.AoProjectPhases=ad;exports.AoTabBar=ps;exports.AoTemplateDetails=Ig;exports.AoTemplates=Yg;exports.AoTemplatesList=Rg;exports.EstimationUnit=vp;exports.TemplateItemTypeEnum=gp;exports.activityFeedStatus=Ey;exports.durationTypes=wy;exports.feedFilterTypes=No;exports.getProjectOverviewRoutes=nhe;exports.getTemplateRoutes=the;exports.listUpdateTypes=xy;exports.milestoneStatus=$i;exports.projectOverviewRoutes=je;exports.ruleComparators=pp;exports.ruleDurationUnits=hp;exports.ruleTriggerTypes=mp;exports.templateItemType=Oe;exports.templateRouteNames=Po;
|