@26lights/orcha 0.42.119 → 0.42.120
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.es.js +3 -2
- package/dist/orcha.umd.js +1 -1
- 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 $o(t){let e={r:0,g:0,b:0,a:1};/#/.test(t)?e=Dfe(t):/rgb/.test(t)?e=dp(t):typeof t=="string"?e=dp(`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}=Mfe(e);return{r:n,g:o,b:r,a:s===void 0?1:s,h:a,s:l,v:c}}function td(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 Zc(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 Nfe({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 Dfe(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 dp(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 Mfe({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 nd=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),Zc("l",n,e,e,"#FFFFFF","rgba(255,255,255,0)"),Zc("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 $fe={ref:"canvasSaturation"};function Bfe(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",$fe,null,512),i.createVNode("div",{style:t.slideSaturationStyle,class:"slide"},null,4)],32)}nd.render=Bfe;nd.__file="src/color/Saturation.vue";var od=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 Ofe={ref:"canvasHue"};function Lfe(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",Ofe,null,512),i.createVNode("div",{style:t.slideHueStyle,class:"slide"},null,4)],32)}od.render=Lfe;od.__file="src/color/Hue.vue";var rd=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=td(o),s=t.getContext("2d");t.width=e,t.height=n,s.fillStyle=s.createPattern(r,"repeat"),s.fillRect(0,0,e,n),Zc("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 Ife={ref:"canvasAlpha"};function Pfe(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",Ife,null,512),i.createVNode("div",{style:t.slideAlphaStyle,class:"slide"},null,4)],32)}rd.render=Pfe;rd.__file="src/color/Alpha.vue";var id=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=td(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 Ffe(t,e,n,o,r,s){return i.openBlock(),i.createBlock("canvas")}id.render=Ffe;id.__file="src/color/Preview.vue";var sd=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 Vfe=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),Rfe={key:1,class:"sucker",viewBox:"-16 -16 68 68",xmlns:"http://www.w3.org/2000/svg",stroke:"#9099a4"},zfe=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 Ufe(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))},[Vfe],2)),t.isSucking?(i.openBlock(),i.createBlock("svg",Rfe,[zfe])):i.createCommentVNode("v-if",!0)])}sd.render=Ufe;sd.__file="src/color/Sucker.vue";var ad=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 qfe={class:"color-type"},Hfe={class:"name"};function jfe(t,e,n,o,r,s){return i.openBlock(),i.createBlock("div",qfe,[i.createVNode("span",Hfe,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]])])}ad.render=jfe;ad.__file="src/color/Box.vue";var ld=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=td(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"},Zfe={key:0,class:"colors history"};function Kfe(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",Zfe,[(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)])}ld.render=Kfe;ld.__file="src/color/Colors.vue";var Dr=i.defineComponent({components:{Saturation:nd,Hue:od,Alpha:rd,Preview:id,Sucker:sd,Box:ad,Colors:ld},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 Nfe(this.rgba,!0)}},created(){Object.assign(this,$o(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}=$o(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}=$o(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}=$o(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}=$o(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}=$o(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}=$o(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 Gfe={class:"color-set"};function Yfe(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",Gfe,[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)}Dr.render=Yfe;Dr.__file="src/color/ColorPicker.vue";Dr.install=t=>{t.component(Dr.name,Dr)};const Jfe={class:"color-picker-wrapper"},pl=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",Jfe,[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(Dr),{class:"color-picker-box",theme:"light",color:t.color,onChangeColor:m},null,8,["color"])],4)):i.createCommentVNode("",!0)]))}});const Xfe={class:"ao-card-project-phase__header"},Qfe={class:"ao-card-project-item__title-line"},epe={key:0,class:"ao-card-project-item-phase__estimation"},tpe={class:"ao-card-project-phase__footer"},npe={key:0,class:"ao-card-project-phase__footer-row ao-card-project-phase__footer-row--progress"},ope={class:"ao-card-project-phase__subitem"},rpe={class:"ao-card-project-phase__subitem"},ipe={key:0,class:"ao-card-project-phase__secondary"},spe={class:"ao-card-project-phase__deadline ao-card-project-phase__deadline--readonly"},ape=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(()=>Da(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===Ii.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(pl,{color:m.value,"onUpdate:color":y[2]||(y[2]=C=>m.value=C)},{clickable:i.withCtx(({openPicker:C,bgColor:v})=>[i.createVNode(dl,{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",Qfe,[i.createVNode(_t,{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",epe," ("+i.toDisplayString(c.value)+"/"+i.toDisplayString(s.value)+i.toDisplayString(l.value)+")",1)):i.createCommentVNode("",!0)])]),footer:i.withCtx(()=>[i.createElementVNode("div",tpe,[u.value?(i.openBlock(),i.createElementBlock("div",npe,[i.createElementVNode("div",ope,[i.createVNode(be,{name:"MountainFlagOutlineRounded",size:"sm"}),i.createElementVNode("span",rpe,i.toDisplayString(d.value)+" / "+i.toDisplayString(u.value),1)]),i.createVNode(fl,{percentages:f.value,class:"ao-card-project-phase__progress",color:t.color},null,8,["percentages","color"]),g.$slots.secondary?(i.openBlock(),i.createElementBlock("div",ipe,[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",spe,i.toDisplayString(i.unref(Ma)(t.deadline)),1)],2)])]),_:2},[t.isEditable?{name:"header",fn:i.withCtx(()=>[i.createElementVNode("div",Xfe,[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 lpe=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 cpe={class:"ao-card-project-milestone__default"},upe={class:"ao-title-with-badge-wrapper"},dpe={class:"ao-card-project-item__title-line"},fpe={key:0,class:"ao-card-project-item-milestone__estimation"},ppe={key:0,class:"ao-card-project-milestone__archive"},mpe={class:"ao-card-project-milestone__activities"},hpe={class:"ao-card-project-milestone__activities-row"},gpe={class:"ao-card-project-milestone__subitem"},vpe={class:"ao-card-project-milestone__subitem"},ype={key:1,class:"ao-card-project-milestone__secondary"},_pe={class:"ao-card-project-milestone__footer"},Cpe={key:1,class:"ao-field ao-card-project-milestone__deadline"},bpe={class:"ao-field__label"},kpe={key:2,class:"ao-card-project-milestone__assignee"},wpe=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(()=>Da(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=>Jc(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(dl,{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",cpe,[i.createElementVNode("div",upe,[i.createVNode(lpe,{color:t.color||""},null,8,["color"]),i.createElementVNode("div",dpe,[i.createVNode(_t,{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",fpe," ("+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",ppe,[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",mpe,[i.createElementVNode("div",hpe,[c.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createElementVNode("div",gpe,[i.createVNode(be,{name:"SelectCheckBox",size:"sm"}),i.createElementVNode("span",vpe,i.toDisplayString(u.value)+" / "+i.toDisplayString(c.value),1)]),i.createVNode(fl,{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",ype,[i.renderSlot(p.$slots,"secondary")])):i.createCommentVNode("",!0)])])]),footer:i.withCtx(()=>[i.createElementVNode("div",_pe,[t.important?(i.openBlock(),i.createBlock(be,{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",Cpe,[i.createElementVNode("span",bpe,i.toDisplayString(i.unref(Ma)(t.deadline)),1)])):i.createCommentVNode("",!0),t.assignee?(i.openBlock(),i.createElementBlock("div",kpe,[i.createVNode(Jn,{"user-name":i.unref(Op)(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 Epe={class:"ao-mapping-card-project-phase__header"},Spe={class:"ao-card-project-item__title-line"},xpe={key:0,class:"ao-card-project-item-phase__estimation"},Tpe={class:"ao-mapping-card-project-phase__footer"},Ape={key:0,class:"ao-mapping-card-project-phase__footer-row ao-mapping-card-project-phase__footer-row--progress"},Npe={class:"ao-mapping-card-project-phase__subitem"},Dpe={class:"ao-mapping-card-project-phase__subitem"},Mpe={key:0,class:"ao-mapping-card-project-phase__secondary"},$pe={class:"ao-mapping-card-project-phase__deadline ao-mapping-card-project-phase__deadline--readonly"},Bpe=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(()=>Da(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===Ii.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(pl,{color:m.value,"onUpdate:color":y[2]||(y[2]=C=>m.value=C)},{clickable:i.withCtx(({openPicker:C,bgColor:v})=>[i.createVNode(dl,{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",Spe,[i.createVNode(_t,{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",xpe," ("+i.toDisplayString(c.value)+"/"+i.toDisplayString(s.value)+i.toDisplayString(l.value)+")",1)):i.createCommentVNode("",!0)])]),footer:i.withCtx(()=>[i.createElementVNode("div",Tpe,[u.value?(i.openBlock(),i.createElementBlock("div",Ape,[i.createElementVNode("div",Npe,[i.createVNode(be,{name:"MountainFlagOutlineRounded",size:"sm"}),i.createElementVNode("span",Dpe,i.toDisplayString(d.value)+" / "+i.toDisplayString(u.value),1)]),i.createVNode(fl,{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",Mpe,[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",$pe,i.toDisplayString(i.unref(Ma)(t.deadline)),1)],2)])]),_:2},[t.isEditable?{name:"header",fn:i.withCtx(()=>[i.createElementVNode("div",Epe,[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 Ope={class:"ao-project-phase"},Lpe={key:0,class:"ao-project-phase__drag ao-card__drag"},Ipe={key:1,class:"ao-project-phase__col-phase"},Ppe={key:2,class:"ao-mapping-project-phase__col-phase"},Fpe={key:0,class:"ao-project-phase__col-milestones"},Vpe=["title"],Rpe={class:"ao-project-phase__milestones-list-footer"},zpe=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}=$n(),o=t,r=e;i.watch(()=>o.phase.milestones,(w,b)=>{jn(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=>v_(w,o.closedStatus))),u=w=>{const{name:b,rank:E}=Zo(c.value??[],"milestone",n);r("addMilestone",{name:b,rank:E,phaseId:w})},d=w=>{const b=n("template.defaultName.milestone",{idx:1}),E=ts(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:$r(c.value,w.added.newIndex)}):"removed"in w||"moved"in w&&r("updateMilestone",{id:w.moved.element.id,rank:$r(c.value,w.moved.newIndex)})},C=Mr.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:__(o.phase.color)}:{backgroundColor:"var(--ao-color-primary-lightest)"}});return(w,b)=>(i.openBlock(),i.createElementBlock("li",Ope,[i.createElementVNode("div",{class:"ao-project-phases__draggable-card",style:i.normalizeStyle(k.value)},[t.isEditable?(i.openBlock(),i.createElementBlock("div",Lpe,[i.createVNode(be,{name:"DragIndicator",class:"ao-project-phase__drag-handle"})])):i.createCommentVNode("",!0),v.value?(i.openBlock(),i.createElementBlock("div",Ppe,[i.createVNode(Bpe,{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",Ipe,[i.createVNode(ape,{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",Fpe,[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(be,{name:"Add",class:"ao-project-phase__milestone-quick-add-icon"})],10,Vpe)):i.createCommentVNode("",!0),i.createVNode(i.unref(Co),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(wpe,{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:x=>!t.readonly&&w.$router.push({name:i.unref(Pe).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",Rpe,[t.isEditable?(i.openBlock(),i.createBlock(bo,{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 Upe={class:"ao-project__phases"},qpe={key:0,class:"ao-project-phase__phases-list-footer"},Hpe={class:"ao-project-phase__col-phase"},cd=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)=>{jn(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=es(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",Upe,[i.createVNode(i.unref(Co),{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(zpe,{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",qpe,[h[0]||(h[0]=i.createElementVNode("div",{class:"ao-project-phase__empty_drag"},null,-1)),i.createElementVNode("div",Hpe,[i.createVNode(bo,{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 jpe={class:"ao-add-template-modal__form-body"},Wpe={class:"field__row"},Zpe={class:"ao-add-template-modal__form-footer"},Vg=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($a,{size:"sm"},{header:i.withCtx(()=>[i.createVNode(_t,{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",jpe,[i.createElementVNode("div",Wpe,[i.createVNode(wt,{value:s.value,options:r.value,detached:!0,onChange:a},null,8,["value","options"])])]),i.createElementVNode("footer",Zpe,[i.createVNode(me,{label:c.$t("project.template.apply.label"),type:"submit",color:"primary",variant:"solid",onClick:l},null,8,["label"])])],32)]),_:1}))}});const Kpe={class:"ao-save-template-modal__form-body"},Gpe={class:"field__row"},Ype={class:"ao-field ao-field--inline"},Jpe={class:"ao-field__label"},Xpe={class:"ao-save-template-modal__phases"},Qpe={class:"ao-field__label"},eme={class:"ao-save-template-modal__phases-list"},tme=["value"],nme={class:"ao-save-template-modal__form-footer"},Rg=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($a,{size:"sm"},{header:i.withCtx(()=>[i.createVNode(_t,{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",Kpe,[i.createElementVNode("div",Gpe,[i.createElementVNode("label",Ype,[i.createElementVNode("span",Jpe,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",Xpe,[i.createElementVNode("div",Qpe,i.toDisplayString(l.$t("project.template.phases.label")),1),i.createElementVNode("div",eme,[(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,tme),[[i.vModelCheckbox,s.value]]),i.createElementVNode("span",null,i.toDisplayString(u.name),1)]))),128))])])]),i.createElementVNode("footer",nme,[i.createVNode(me,{label:l.$t("project.template.save.label"),type:"submit",color:"primary",variant:"solid",onClick:a},null,8,["label"])])],32)]),_:1}))}});const ome={class:"ao-project"},rme={class:"ao-project__body"},ime=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}=$n(),o=t,r=e,s=i.computed(()=>o.phases.flatMap(V=>V.milestones)),a=()=>{const{name:V,rank:Q}=Zo(o.phases,"phase",n);r("addPhase",{name:V,rank:Q,projectId:o.project.id})},l=()=>{const V=n("template.defaultName.phase",{idx:1}),Q=ts(o.phases);r("addPhase",{name:V,rank:Q,projectId:o.project.id})},c=V=>{r("updatePhase",V)},u=V=>{r("archivePhase",V)},d=V=>{r("unarchivePhase",V)},f=V=>{r("copyPhaseToTemplate",V)},p=V=>{r("addMilestone",V)},m=V=>{r("updateMilestone",V)},h=V=>{r("archiveMilestone",V)},g=V=>{r("unarchiveMilestone",V)},y=V=>{r("addActivity",V)},C=V=>{r("update:activity",V)},v=V=>{r("archiveActivity",V)},_=V=>{r("unarchiveActivity",V)},k=V=>{r("addSubtask",V)},w=V=>{r("updateSubtask",V)},b=V=>{r("deleteSubtask",V)},E=i.computed(()=>s.value.flatMap(V=>V.activities)),T=V=>{r("addFiles",V)},x=V=>{r("removeFile",V)},N=V=>{r("addComment",V)},I=V=>{r("updateComment",V)},A=V=>{r("removeComment",V)},D=i.ref(!1),M=i.ref(!1),L=(V,Q)=>{r("applyTemplate",{templateId:V,projectId:Q}),D.value=!1},P=(V,Q)=>{var se;const ee=(se=o.templates)==null?void 0:se.at(-1),he=ee?lt.LexoRank.parse(ee.rank).genNext():lt.LexoRank.middle();r("saveTemplate",{templateName:V,rank:he.format(),phaseIds:Q}),M.value=!1},j=Mr.useRouter(),F=i.ref("overview"),H=[{label:"Overview",value:"overview"},{label:"Feed",value:"feed"},{label:"Dev",value:"dev"},{label:"Mapping",value:"mapping"}];return i.watch(F,V=>{V==="feed"?(j.push({name:Pe.feed}),console.log("Navigating to feed...")):V==="dev"?(j.push({name:Pe.dev}),console.log("Navigating to dev...")):V==="overview"?(j.push({name:Pe.project}),console.log("Navigating to feed...")):V==="mapping"&&(j.push({name:Pe.mapping}),console.log("Navigating to feed..."))}),(V,Q)=>{var he;const ee=i.resolveComponent("RouterView");return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("div",i.mergeProps({class:"ao-project-overview"},V.$attrs),[i.createElementVNode("div",ome,[i.createVNode(ns,null,{primary:i.withCtx(()=>[i.createVNode(hs,{modelValue:F.value,"onUpdate:modelValue":Q[0]||(Q[0]=se=>F.value=se),tabs:H},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:Q[1]||(Q[1]=se=>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-overview__quick-add-phase",size:"sm","icon-name":"Add","icon-position":"start",color:"primary",variant:"ghost",label:V.$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:V.$t("project.template.save.label"),onClick:Q[2]||(Q[2]=se=>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:V.$t("project.template.apply.label"),onClick:Q[3]||(Q[3]=se=>D.value=!0)},null,8,["label"])):i.createCommentVNode("",!0)]),_:1}),i.createElementVNode("div",rme,[i.createVNode(cd,{phases:t.phases,"closed-status":t.closedStatus,"is-editable":t.isEditable===!0,users:t.users,"time-tracking-data":t.timeTrackingData,"estimation-unit":(he=t.project)==null?void 0:he.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(ee,{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]=se=>V.$router.push({name:i.unref(Pe).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(ee,{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:x,onAddComment:N,onUpdateComment:I,onRemoveComment:A},{default:i.withCtx(({Component:se})=>[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(se),null,{default:i.withCtx(ae=>[i.renderSlot(V.$slots,"activityDetailsBody",i.normalizeProps(i.guardReactiveProps(ae)))]),_: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(Rg,{key:0,phases:t.phases,onClose:Q[5]||(Q[5]=se=>M.value=!1),onSave:P},null,8,["phases"])):i.createCommentVNode("",!0),D.value?(i.openBlock(),i.createBlock(Vg,{key:1,"project-id":t.project.id,templates:t.templates,onClose:Q[6]||(Q[6]=se=>D.value=!1),onApply:L},null,8,["project-id","templates"])):i.createCommentVNode("",!0)]))],64)}}});const sme={class:"ao-card-feed__header"},ame={key:1,class:"ao-card-feed__header-secondary ao-card-feed__header-icons"},lme={key:2,class:"ao-card-feed__header-secondary ao-card-feed__secondary"},cme={class:"ao-card-feed__body"},ume={key:0,class:"ao-card-feed__breadcrumbs"},dme={class:i.normalizeClass(["ao-card-feed__title-group"])},fme={class:"ao-card-feed__title-line"},pme={key:0,class:"ao-card-feed__slug"},mme={key:1,class:"ao-card-feed__deadline"},hme={class:"ao-card-feed__footer"},gme={class:"ao-card-feed__footer-row"},vme={class:"ao-assignees"},yme={key:0,class:"ao-assignee"},_me={key:0,class:"ao-card-feed__subitems"},Cme={key:0,class:"ao-card-feed__subitem"},bme={class:"ao-card-feed__subitem"},kme={key:1,class:"ao-card-feed__subitem"},wme={class:"ao-card-feed__subitem"},Eme={class:"ao-card-feed__timer-wrapper"},Sme={class:"ao-card-feed__footer-row"},xme={key:0,class:"ao-card-feed__progress-wrapper"},Tme={class:"ao-card-feed__subitem"},Ame={class:"ao-card-feed__subitem"},ud=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(()=>Ma(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(dl,{class:i.normalizeClass(["ao-card-feed",{"ao-card-feed--closed":t.isClosed}]),"is-clickable":!0},{header:i.withCtx(()=>[i.createElementVNode("div",sme,[r.value?(i.openBlock(),i.createBlock(Li,{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",ame,[t.isPrivate?(i.openBlock(),i.createBlock(be,{key:0,name:"Lock",class:"ao-card-feed__warning",size:"sm"})):i.createCommentVNode("",!0),t.important?(i.openBlock(),i.createBlock(be,{key:1,name:"FlagRounded",class:"ao-card-feed__important",size:"sm"})):i.createCommentVNode("",!0),t.isClosed?(i.openBlock(),i.createBlock(be,{key:2,name:"CheckSmallRounded",class:"ao-card-feed__closed"})):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),g.$slots.secondary?(i.openBlock(),i.createElementBlock("div",lme,[i.renderSlot(g.$slots,"secondary")])):i.createCommentVNode("",!0)])]),default:i.withCtx(()=>[i.createElementVNode("div",cme,[l.value?(i.openBlock(),i.createElementBlock("span",ume,i.toDisplayString(l.value),1)):i.createCommentVNode("",!0),i.createElementVNode("div",dme,[i.createElementVNode("div",fme,[t.slug?(i.openBlock(),i.createElementBlock("span",pme,i.toDisplayString(t.slug)+": ",1)):i.createCommentVNode("",!0),i.createVNode(_t,{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",mme,i.toDisplayString(u.value),1)):i.createCommentVNode("",!0)])]),footer:i.withCtx(()=>[i.createElementVNode("div",hme,[i.createElementVNode("div",gme,[i.createElementVNode("ul",vme,[(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",yme,[i.createVNode(Jn,{"user-name":i.unref(Op)(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",_me,[t.comments?(i.openBlock(),i.createElementBlock("li",Cme,[i.createVNode(be,{name:"ChatOutline",size:"sm"}),i.createElementVNode("span",bme,i.toDisplayString(t.comments),1)])):i.createCommentVNode("",!0),t.attachments?(i.openBlock(),i.createElementBlock("li",kme,[i.createVNode(be,{name:"AttachFileRounded",size:"sm"}),i.createElementVNode("span",wme,i.toDisplayString(t.attachments),1)])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),i.createElementVNode("div",Eme,[i.createVNode(be,{name:"TimerOutline",class:"ao-card-feed__timer",size:"md",onClick:i.withModifiers(f,["stop"])})])]),i.createElementVNode("div",Sme,[t.tasks&&t.tasks.length?(i.openBlock(),i.createElementBlock("div",xme,[i.createElementVNode("div",Tme,[i.createVNode(be,{name:"SelectCheckBox",size:"sm"}),i.createElementVNode("span",Ame,i.toDisplayString(m.value)+" / "+i.toDisplayString(p.value),1)]),i.createVNode(fl,{percentages:h.value,class:"ao-card-feed__progress"},null,8,["percentages"])])):i.createCommentVNode("",!0)])])]),_:3},8,["class"]))}});const Nme={class:"ao-project-milestone"},Dme={class:"ao-project-milestone__header"},Mme={class:"ao-project-milestone__header_line"},$me={class:"ao-project-milestone__header_line"},Bme={class:"ao-project-milestone__title"},Ome={key:0,class:"ao-fieldset ao-milestone__fieldset"},Lme={class:"ao-field__row ao-milestone__field-row"},Ime={class:"ao-field ao-field--inline"},Pme={class:"ao-field__row ao-milestone__field-row"},Fme={class:"ao-field ao-milestone__field-multiselect"},Vme={class:"ao-milestone__color-actions"},Rme=["onClick"],zme=["title"],Ume={class:"ao-project-milestone__body"},qme={key:0,class:"ao-project-milestone__footer"},fp=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}=$n(),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)=>{jn(b,E)});const d=b=>{r("close",b)},f=()=>{const{name:b,rank:E}=Zo(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=ts(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:$r(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?Jc(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",Nme,[i.createElementVNode("header",Dme,[i.createElementVNode("div",Mme,[i.createVNode(me,{"icon-name":"CloseRounded",variant:"ghost",size:"sm",class:"ao-milestone__close",onClick:d})]),i.createElementVNode("div",$me,[i.createElementVNode("div",Bme,[i.createVNode(_t,{title:((T=c.value)==null?void 0:T.name)||t.milestoneId,level:5},null,8,["title"]),i.createVNode(Pg,{modelValue:k.value,"onUpdate:modelValue":E[0]||(E[0]=x=>k.value=x),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",Ome,[i.createElementVNode("div",Lme,[i.createElementVNode("label",Ime,[i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":E[1]||(E[1]=x=>y.value=x),class:"ao-milestone__field ao-milestone__date-field",type:"date"},null,512),[[i.vModelText,y.value,void 0,{lazy:!0}]])])]),i.createElementVNode("div",Pme,[i.createElementVNode("label",Fme,[i.createVNode(wt,{modelValue:_.value,"onUpdate:modelValue":E[2]||(E[2]=x=>_.value=x),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:x,handleTagRemove:N})=>[i.createVNode(Jn,{"user-name":x.label,"avatar-url":x.avatar,"is-closable":!0,onClose:I=>N(x,I)},null,8,["user-name","avatar-url","onClose"])]),_:1},8,["modelValue","options","placeholder","disabled","caret"])])]),i.createElementVNode("div",Vme,[i.createVNode(pl,{color:g.value,"onUpdate:color":E[3]||(E[3]=x=>g.value=x)},{clickable:i.withCtx(({openPicker:x,bgColor:N})=>[i.createElementVNode("button",{style:i.normalizeStyle({background:N}),class:"color-button",onClick:I=>w(I,x)},null,12,Rme)]),_: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(be,{name:"Add",class:"ao-project-milestone__quick-add-icon"})],8,zme)):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0)]),i.createElementVNode("div",Ume,[i.createVNode(i.unref(Co),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:x})=>{var N,I,A,D,M;return[i.createVNode(ud,{id:x.id,name:x.name||x.id,"project-id":t.projectId,"phase-name":(N=a.value)==null?void 0:N.name,"milestone-name":(I=c.value)==null?void 0:I.name,"milestone-color":(A=c.value)==null?void 0:A.color,deadline:x.deadline,important:x.important,users:t.users,assignee:x.assignee,slug:x.slug,comments:(D=x.comments)==null?void 0:D.length,attachments:(M=x.attachments)==null?void 0:M.length,tasks:x.tasks,"is-editable":t.isEditable,"is-private":x.private,"is-closed":C(x),onClick:L=>b.$router.push({name:i.unref(Pe).activity,params:{milestoneId:t.milestoneId,activityId:x.id}}),onUpdateActivity:m,onRemoveAssignee:()=>m({id:x.id,assigneeId:null}),onStartTimer:s},i.createSlots({_:2},[t.isEditable?{name:"secondary",fn:i.withCtx(()=>[t.isEditable&&x.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:x.id}),["stop"])},null,8,["label","onClick"])):i.createCommentVNode("",!0),t.isEditable&&!x.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:x.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",qme,[i.createVNode(bo,{"icon-name":"Add",label:b.$t("project.activity.add"),onClick:f},null,8,["label"])])):i.createCommentVNode("",!0)])])}}});const Hme=i.defineComponent({__name:"AoProjectOverviewActivityDetails",props:{phaseId:{},milestoneId:{},activityId:{},activityTypes:{},devStatuses:{},activities:{},isTaskCheckable:{type:Function},statuses:{},phases:{},users:{},project:{},userId:{},isEditable:{type:Boolean},attachmentEnabled:{type:Boolean},timeTrackingData:{},loadAttachmentPreview:{type:Function},sprints:{}},emits:["update:activity","addSubtask","updateSubtask","deleteSubtask","addFiles","removeFile","addComment","updateComment","removeComment","createSprint"],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(ed,{key:0,activity:l.value,"activity-types":t.activityTypes,"dev-statuses":t.devStatuses,"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,sprints:t.sprints,onClose:C.$router.back,"onUpdate:activity":c,onAddSubtask:u,onUpdateSubtask:d,onDeleteSubtask:f,onAddFiles:p,onRemoveFile:m,onAddComment:h,onUpdateComment:g,onRemoveComment:y,onCreateSprint:v[0]||(v[0]=w=>o("createSprint",w))},{default:i.withCtx(w=>[i.renderSlot(C.$slots,"default",i.normalizeProps(i.guardReactiveProps(w)))]),_:3},8,["activity","activity-types","dev-statuses","milestone-id","template-activities","users","user-id","is-task-checkable","statuses","breadcrumbs","is-editable","attachment-enabled","projects","time-tracking-data","load-attachment-preview","sprints","onClose"])):i.createCommentVNode("",!0)}}}),jme={class:"ao-col-header"},Wme=i.defineComponent({__name:"AoColHeader",props:{title:{},items:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("header",jme,[i.createVNode(_t,{title:t.title,class:"ao-col-header__title",level:4},null,8,["title"]),t.items?(i.openBlock(),i.createBlock(Li,{key:0,label:t.items,class:"ao-col-header__items",variant:"solid",color:"primary"},null,8,["label"])):i.createCommentVNode("",!0)]))}});function Zme(t){return i.getCurrentScope()?(i.onScopeDispose(t),!0):!1}function Ea(t){return typeof t=="function"?t():i.unref(t)}const Kme=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Gme=t=>t!=null,Oi=()=>{};function Yme(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 Jme(t,e={}){let n,o,r=Oi;const s=l=>{clearTimeout(l),r(),r=Oi};return l=>{const c=Ea(t),u=Ea(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 Xme(t,e=200,n={}){return Yme(Jme(e,n),t)}function ac(t){var e;const n=Ea(t);return(e=n==null?void 0:n.$el)!=null?e:n}const Qme=Kme?window:void 0;function ehe(){const t=i.ref(!1),e=i.getCurrentInstance();return e&&i.onMounted(()=>{t.value=!0},e),t}function the(t){const e=ehe();return i.computed(()=>(e.value,!!t()))}function nhe(t,e,n={}){const{root:o,rootMargin:r="0px",threshold:s=.1,window:a=Qme,immediate:l=!0}=n,c=the(()=>a&&"IntersectionObserver"in a),u=i.computed(()=>{const h=Ea(t);return(Array.isArray(h)?h:[h]).map(ac).filter(Gme)});let d=Oi;const f=i.ref(l),p=c.value?i.watch(()=>[u.value,ac(o),f.value],([h,g])=>{if(d(),!f.value||!h.length)return;const y=new IntersectionObserver(e,{root:ac(g),rootMargin:r,threshold:s});h.forEach(C=>C&&y.observe(C)),d=()=>{y.disconnect(),d=Oi}},{immediate:l,flush:"post"}):Oi,m=()=>{d(),p(),f.value=!1};return Zme(m),{isSupported:c,isActive:f,pause(){d(),f.value=!1},resume(){f.value=!0},stop:m}}const ohe={class:i.normalizeClass(["ao-list-kanban"])},rhe={class:"ao-list-kanban__header"},ihe=["title"],she={key:0,class:"ao-list-kanban__end ao-list-kanban__end--loading"},ahe={key:1,class:"ao-list-kanban__end"},lhe={key:0,class:"ao-list-kanban__no-more"},che={key:1,class:"ao-list-kanban__divider"},uhe={key:1,class:"ao-list-kanban__footer"},dhe=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},isDevMode:{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);nhe(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=>{if("added"in f){const p={id:f.added.element.id,rank:$r(n.list,f.added.newIndex)};n.isDevMode?p.statusDevId=n.status.id:p.statusId=n.status.id,o("updateActivity",p)}else"removed"in f||"moved"in f&&o("updateActivity",{id:f.moved.element.id,rank:$r(n.list,f.moved.newIndex)})},d=i.ref(!1);return(f,p)=>(i.openBlock(),i.createElementBlock("div",ohe,[t.title||f.$slots.header?i.renderSlot(f.$slots,"header",{},()=>{var m;return[i.createElementVNode("div",rhe,[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(be,{name:"Add"})],8,ihe)):i.createCommentVNode("",!0)])]},void 0,0):i.createCommentVNode("",!0),i.createVNode(i.unref(Co),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(ud,{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",she,[i.createVNode(be,{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",ahe,[t.noMoreLabel?(i.openBlock(),i.createElementBlock("span",lhe,i.toDisplayString(t.noMoreLabel),1)):t.isEditable?(i.openBlock(),i.createElementBlock("span",che)):i.createCommentVNode("",!0)]))]),_:1},16,["class","list","disabled"]),f.$slots.footer||t.footerLabel?(i.openBlock(),i.createElementBlock("div",uhe,[i.renderSlot(f.$slots,"footer",{},()=>[t.isEditable?(i.openBlock(),i.createBlock(bo,{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 fhe={class:"ao-field ao-search-field"},phe=["value","placeholder"],mhe=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=Xme(r,n.delay),a=l=>{o("clear",l)};return(l,c)=>(i.openBlock(),i.createElementBlock("div",fhe,[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,phe),i.createVNode(be,{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 hhe={class:"ao-feed"},ghe={class:"ao-feed__filters"},vhe={class:"ao-feed__body"},Kc=i.defineComponent({__name:"AoFeed",props:{activities:{},statuses:{},devStatuses:{default:()=>[]},project:{default:void 0},projects:{default:()=>[]},filters:{},activityTypes:{default:()=>[]},users:{},userId:{},initialActivityId:{default:void 0},initialActivitySlug:{default:void 0},searchText:{default:""},showsArchivedActivities:{type:Boolean},showsOnlyImportant:{type:Boolean},showsOnlyNonAssigned:{type:Boolean},selectedActivity:{default:void 0},isTaskCheckable:{type:Function,default:void 0},isEditable:{type:[Boolean,String]},attachmentEnabled:{type:Boolean,default:!0},timeTrackingData:{default:()=>({})},loadAttachmentPreview:{type:Function,default:void 0},feedMode:{default:"standard"},sprints:{default:()=>[]}},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","createSprint"],setup(t,{emit:e}){const{t:n}=$n(),o=t,r=e;function s(U,te){r("toast",U,te)}const a=i.toRef(o,"activities"),l=i.computed(()=>o.feedMode==="dev"?o.devStatuses:o.statuses),c=i.computed(()=>o.feedMode==="dev"?a.value.filter(U=>U.activityType==="dev"):a.value),u=async(U,te)=>{await r("selectActivity",U,te)},d=i.ref({}),f=i.ref(!1),p=i.ref(!1),m=i.computed(()=>o.project?"milestone":"project");i.watch([()=>l.value,()=>c.value,()=>o.initialActivityId,()=>o.initialActivitySlug,()=>o.feedMode],async([U,te,Be,le],[Ke,Ce])=>{const Ae=o.feedMode==="dev"?"devStatus":"status";d.value=Object.fromEntries(U.map(Fe=>[Fe.id,te.filter(ke=>{const Oe=ke[Ae];return(Oe==null?void 0:Oe.id)===Fe.id})])),Be&&!f.value?(u(Be,null),f.value=!0):le&&!f.value&&(u(null,le),f.value=!0),p.value&&jn(te,Ce)},{immediate:!0});const h=i.computed(()=>{var U;return!o.selectedActivity||!o.selectedActivity.milestone?"":`${((U=o.selectedActivity.milestone.phase)==null?void 0:U.name)??""} / ${o.selectedActivity.milestone.name??""}`}),g=U=>{var Fe;const te=o.feedMode==="dev"?o.activities.filter(ke=>ke.activityType==="dev"):o.activities,Be=te==null?void 0:te.at(-1),le=Be?lt.LexoRank.parse(Be.rank).genNext():lt.LexoRank.middle(),Ke=((Fe=o.activities)==null?void 0:Fe.length)??0,Ce=o.feedMode==="dev",Ae={name:n("activity.defaultName",{idx:Ke+1}),rank:le.format(),...Ce?{statusDevId:U.id,type:"dev"}:{statusId:U.id}};if(o.filters.assigneeId.length>0&&(Ae.assigneeId=o.filters.assigneeId[0]),o.filters.projectId.length>0&&(Ae.projectId=o.filters.projectId[0]),o.filters.sprintId&&o.filters.sprintId.length===1){const ke=o.sprints.find(Oe=>Oe.id===o.filters.sprintId[0]);ke&&(Ae.sprintId=ke.id,Ae.projectId=ke.projectId)}p.value=!0,r("addActivity",Ae)},y=U=>{var Fe,ke;const te=o.feedMode==="dev"?"devStatus":"status",Be=((Fe=o.activities)==null?void 0:Fe.filter(Oe=>{const We=Oe[te];return(We==null?void 0:We.id)===U.id}))??[],le=ts(Be),Ke=((ke=o.activities)==null?void 0:ke.length)??0,Ce=o.feedMode==="dev",Ae={name:n("activity.defaultName",{idx:Ke+1}),rank:le,...Ce?{statusDevId:U.id,type:"dev"}:{statusId:U.id}};if(o.filters.assigneeId.length>0&&(Ae.assigneeId=o.filters.assigneeId[0]),o.filters.projectId.length>0&&(Ae.projectId=o.filters.projectId[0]),o.filters.sprintId&&o.filters.sprintId.length===1){const Oe=o.sprints.find(We=>We.id===o.filters.sprintId[0]);Oe&&(Ae.sprintId=Oe.id,Ae.projectId=Oe.projectId)}p.value=!0,r("addActivity",Ae)},C=(U,te)=>{p.value=!1,r("update:filters",{...o.filters,[U]:te})},v=i.computed(()=>o.project?[o.project]:o.projects??[]),_=i.computed(()=>v.value.map(U=>({value:U.id,label:U.name}))),k=i.computed(()=>o.sprints.map(U=>({value:U.id,label:`${U.name} · ${U.startDate} – ${U.endDate}`,startDate:U.startDate,endDate:U.endDate,projectId:U.projectId})));i.computed(()=>{var U;return(U=o.activityTypes)==null?void 0:U.map(te=>({value:te.id,label:te.name}))});const w=i.computed(()=>o.users.map(U=>({value:U.id,label:`${U.firstName} ${U.lastName}`,avatar:U.avatarUrl}))),b=U=>{o.selectedActivity&&r("update:activity",U)},E=U=>{r("update:activity",U)},T=U=>{r("archiveActivity",U)},x=U=>{r("unarchiveActivity",U)},N=U=>{var te;r("startTimer",U),(te=window.parent)==null||te.postMessage({type:"startTimer",data:U},"*")},I=U=>{p.value=!1,r("update:searchText",U)},A=U=>{p.value=!1,r("clear:searchText",U)},D=U=>{o.selectedActivity&&r("addSubtask",U)},M=U=>{o.selectedActivity&&r("updateSubtask",U)},L=U=>{o.selectedActivity&&r("deleteSubtask",U)},P=U=>{r("addFiles",U)},j=U=>{r("removeFile",U)},F=U=>{o.selectedActivity&&r("addComment",{...U,activityId:o.selectedActivity.id})},H=U=>{const{id:te}=o.selectedActivity||{};te&&r("updateComment",U)},V=U=>{const{id:te}=o.selectedActivity||{};te&&r("removeComment",U)},Q=Mr.useRouter(),ee=Mr.useRoute(),he=i.ref("feed");i.watch(()=>ee.name,U=>{U===Po.feed||U==="ActivityFeed"||U==="ActivityFeedWithActivity"?he.value="feed":U===Po.dev||U==="ActivityFeedDev"||U==="ActivityFeedDevWithActivity"?he.value="dev":U===Pe.feed?he.value="feed":U===Pe.dev?he.value="dev":U===Pe.project?he.value="overview":U===Pe.mapping&&(he.value="mapping")},{immediate:!0});const se=[{label:"Overview",value:"overview"},{label:"Feed",value:"feed"},{label:"Dev",value:"dev"},{label:"Mapping",value:"mapping"}],ae=i.computed(()=>z.value?se.filter(U=>U.value==="feed"||U.value==="dev"):se),z=i.computed(()=>!o.project&&ee.name&&(ee.name===Po.feed||ee.name===Po.dev||ee.name==="ActivityFeed"||ee.name==="ActivityFeedDev"||ee.name==="ActivityFeedWithActivity"||ee.name==="ActivityFeedDevWithActivity")),re=i.computed(()=>z.value?Po.feed:Pe.feed),ye=i.computed(()=>z.value?Po.dev:Pe.dev),$e=i.computed(()=>Pe.project),ot=i.computed(()=>Pe.mapping);return i.watch(he,U=>{U==="feed"?Q.push({name:re.value}):U==="dev"?Q.push({name:ye.value}):U==="overview"?Q.push({name:$e.value}):U==="mapping"&&Q.push({name:ot.value})}),(U,te)=>{var Be;return i.openBlock(),i.createElementBlock("div",hhe,[i.createVNode(ns,null,{primary:i.withCtx(()=>[i.createElementVNode("div",ghe,[i.createVNode(hs,{modelValue:he.value,"onUpdate:modelValue":te[0]||(te[0]=le=>he.value=le),tabs:ae.value},null,8,["modelValue","tabs"]),i.createVNode(mhe,{"model-value":t.searchText,placeholder:U.$t("feed.search.placeholder"),class:"ao-feed__search","onUpdate:modelValue":I,onClear:A},null,8,["model-value","placeholder"]),o.project?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(wt,{key:0,"model-value":t.filters[i.unref(Bo).project],mode:"tags",options:_.value,"close-on-select":!1,searchable:!0,class:"ao-feed__filter ao-feed__filter__projects",placeholder:U.$t("feed.filters.project.placeholder"),"onUpdate:modelValue":te[1]||(te[1]=le=>C(i.unref(Bo).project,le))},null,8,["model-value","options","placeholder"])),k.value.length?(i.openBlock(),i.createBlock(wt,{key:1,"model-value":t.filters[i.unref(Bo).sprint],mode:"tags",options:k.value,"close-on-select":!1,searchable:!0,class:"ao-feed__filter ao-feed__filter__sprints",placeholder:U.$t("feed.filters.sprint.placeholder"),"onUpdate:modelValue":te[2]||(te[2]=le=>C(i.unref(Bo).sprint,le))},null,8,["model-value","options","placeholder"])):i.createCommentVNode("",!0),w.value.length?(i.openBlock(),i.createBlock(wt,{key:2,"model-value":t.filters[i.unref(Bo).assignee],mode:"tags",options:w.value,"close-on-select":!1,searchable:!0,class:"ao-feed__filter ao-feed__filter__assignees",placeholder:U.$t("feed.filters.assignee.placeholder"),"onUpdate:modelValue":te[3]||(te[3]=le=>C(i.unref(Bo).assignee,le))},{tag:i.withCtx(({option:le,handleTagRemove:Ke})=>[i.createVNode(Jn,{"user-name":le.label,"avatar-url":le.avatar,"is-closable":!0,onClose:Ce=>Ke(le,Ce)},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:U.$t("feed.filters.showsOnlyNonAssigned.label"),role:"checkbox","aria-checked":t.showsOnlyNonAssigned,onClick:te[4]||(te[4]=le=>U.$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:U.$t("feed.filters.showsOnlyImportant.label"),role:"checkbox","aria-checked":t.showsOnlyImportant,onClick:te[5]||(te[5]=le=>U.$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:U.$t("feed.filters.showsArchivedActivities.label"),role:"checkbox","aria-checked":t.showsArchivedActivities,onClick:te[6]||(te[6]=le=>U.$emit("update:showsArchivedActivities",!t.showsArchivedActivities))},null,8,["icon-name","label","aria-checked"])]),_:1}),i.createElementVNode("div",vhe,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(l.value,le=>(i.openBlock(),i.createBlock(dhe,{key:le.id,status:le,list:d.value[le.id],title:le.name,"footer-label":U.$t("feed.activity.add"),users:t.users,"user-id":t.userId,"is-editable":t.isEditable,"tag-type":m.value,"show-header-add":t.isEditable,"is-dev-mode":t.feedMode==="dev",onAdd:()=>g(le),onAddAtBeginning:()=>y(le),onSelectActivity:u,onArchiveActivity:T,onUnarchiveActivity:x,onUpdateActivity:E,onStartTimer:N},null,8,["status","list","title","footer-label","users","user-id","is-editable","tag-type","show-header-add","is-dev-mode","onAdd","onAddAtBeginning"]))),128))]),(i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[t.selectedActivity?(i.openBlock(),i.createBlock(ed,{key:0,activity:t.selectedActivity,"activity-types":t.activityTypes,"dev-statuses":t.devStatuses,"milestone-id":(Be=t.selectedActivity.milestone)==null?void 0:Be.id,"template-activities":a.value,users:t.users,"user-id":t.userId,"is-task-checkable":t.isTaskCheckable,statuses:t.statuses,breadcrumbs:h.value,"is-editable":t.isEditable,"attachment-enabled":t.attachmentEnabled,projects:v.value,"time-tracking-data":t.timeTrackingData,"load-attachment-preview":o.loadAttachmentPreview,sprints:t.sprints,onClose:te[7]||(te[7]=()=>u(null,null)),"onUpdate:activity":b,onAddSubtask:D,onUpdateSubtask:M,onDeleteSubtask:L,onAddFiles:P,onRemoveFile:j,onAddComment:F,onUpdateComment:H,onRemoveComment:V,onToast:s,onCreateSprint:te[8]||(te[8]=le=>r("createSprint",le))},{default:i.withCtx(le=>[i.renderSlot(U.$slots,"activityDetailsBody",i.normalizeProps(i.guardReactiveProps(le)))]),_:3},8,["activity","activity-types","dev-statuses","milestone-id","template-activities","users","user-id","is-task-checkable","statuses","breadcrumbs","is-editable","attachment-enabled","projects","time-tracking-data","load-attachment-preview","sprints"])):i.createCommentVNode("",!0)]))])}}});const yhe={class:"ao-project-mapping"},_he={class:"ao-project-mapping-mapping__body"},Che={class:"ao-project-mapping-mapping__phases"},bhe={key:0,class:"ao-project-mapping-mapping__image-wrapper"},khe=["src","alt"],whe=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}=$n(),o=t,r=e,s=()=>{const{name:v,rank:_}=Zo(o.phases,"phase",n);r("addPhase",{name:v,rank:_,projectId:o.project.id})},a=()=>{const v=n("template.defaultName.phase",{idx:1}),_=ts(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?lt.LexoRank.parse(k.rank).genNext():lt.LexoRank.middle();r("saveTemplate",{templateName:v,rank:w.format(),phaseIds:_}),p.value=!1},g=Mr.useRouter(),y=i.ref("mapping"),C=[{label:"Overview",value:"overview"},{label:"Feed",value:"feed"},{label:"Dev",value:"dev"},{label:"Mapping",value:"mapping"}];return i.watch(y,v=>{v==="feed"?(g.push({name:Pe.feed}),console.log("Navigating to feed...")):v==="dev"?(g.push({name:Pe.dev}),console.log("Navigating to dev...")):v==="overview"?(g.push({name:Pe.project}),console.log("Navigating to feed...")):v==="mapping"&&(g.push({name:Pe.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",yhe,[i.createVNode(ns,null,{primary:i.withCtx(()=>[i.createVNode(hs,{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",_he,[i.createElementVNode("div",Che,[i.createVNode(cd,{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",bhe,[i.createElementVNode("img",{class:"architecture-image",src:t.project.architectureImage.url,alt:i.unref(n)("architectureImage.alt")},null,8,khe)])):i.createCommentVNode("",!0)])])],16),(i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[p.value?(i.openBlock(),i.createBlock(Rg,{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(Vg,{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 Uo={TEMPLATES:"templates",TEMPLATE_DETAILS:"template_details",TEMPLATES_LIST:"templates_list"},Ehe=(t,e={})=>[{path:t,name:Uo.TEMPLATES,redirect:{name:Uo.TEMPLATES_LIST},...e,children:[{path:"",name:Uo.TEMPLATES_LIST,component:zg},{path:":templateId/:phaseId?/:milestoneId?/:activityId?",name:Uo.TEMPLATE_DETAILS,component:Fg,props:!0}]}],Pe={project:"AoProject",feed:"AoProjectFeed",dev:"AoProjectDev",mapping:"AoProjectMapping",milestone:"AoMilestone",activity:"AoActivity"},Po={feed:"ActivityFeed",dev:"ActivityFeedDev"},She=(t,e={})=>[{path:t,...e,redirect:{name:Pe.project},children:[{path:"",name:Pe.project,component:ime,props:!0,children:[{path:":phaseId/:milestoneId",name:Pe.milestone,component:fp,props:!0},{path:":phaseId/:milestoneId/:activityId",name:Pe.activity,props:{default:!0,modal:!0},components:{default:fp,modal:Hme}}]},{path:"feed",name:Pe.feed,component:Kc,props:n=>({...n.params,feedMode:"standard"})},{path:"dev",name:Pe.dev,component:Kc,props:n=>({...n.params,feedMode:"dev"})},{path:"mapping",name:Pe.mapping,component:whe,props:!0}]}],xhe={class:"ao-templates"},zg=i.defineComponent({__name:"AoTemplatesList",props:{templates:{}},emits:["addTemplate","updateTemplates","updateItem","removeItem"],setup(t,{emit:e}){const{t:n}=$n(),o=t,r=e;i.watch(()=>o.templates,(u,d)=>{jn(u,d)});const s=()=>{var m,h;const u=(m=o.templates)==null?void 0:m.at(-1),d=u?lt.LexoRank.parse(u.rank).genNext():lt.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:qe.TEMPLATES,id:u,templateId:u,data:{name:d}})},l=(u,d)=>{r("removeItem",{itemType:qe.TEMPLATES,templateId:u,data:{id:u,...d?{name:d}:{}}})},c=u=>{if(u.moved){const d=es(u,o.templates??[]);r("updateItem",{itemType:qe.TEMPLATES,id:u.moved.element.id,templateId:u.moved.element.id,data:{rank:d}})}};return(u,d)=>(i.openBlock(),i.createElementBlock("div",xhe,[i.createVNode(ns,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(Co),{"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(q_,{id:f.id,title:f.name,phases:f.phases,milestones:(p=f.phases)!=null&&p.length?i.unref(p_)(f.phases):0,activities:f.phases?i.unref(m_)(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(Uo).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 The={class:"ao-field__label"},Ug=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",The,i.toDisplayString(t.label),1),i.renderSlot(e.$slots,"default")],2))}}),Ahe=["type","value","disabled","readonly"],Nhe=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(Ug,{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,Ahe)]),_:1},8,["label"]))}}),Dhe={class:"ao-field"},Mhe={class:"ao-field__label"},$he=["checked","disabled"],Bhe=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",Dhe,[i.createElementVNode("span",Mhe,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,$he)]))}});exports.AoAvatar=Jn;exports.AoCardFeed=ud;exports.AoCheckboxField=Bhe;exports.AoColorPicker=pl;exports.AoFeed=Kc;exports.AoField=Ug;exports.AoInputField=Nhe;exports.AoMultiselect=wt;exports.AoProjectPhases=cd;exports.AoTabBar=hs;exports.AoTemplateDetails=Fg;exports.AoTemplates=Jg;exports.AoTemplatesList=zg;exports.EstimationUnit=_p;exports.TemplateItemTypeEnum=yp;exports.activityFeedRoutes=Po;exports.activityFeedStatus=Sy;exports.durationTypes=Ey;exports.feedFilterTypes=Bo;exports.getProjectOverviewRoutes=She;exports.getTemplateRoutes=Ehe;exports.listUpdateTypes=xy;exports.milestoneStatus=Ii;exports.projectOverviewRoutes=Pe;exports.ruleComparators=hp;exports.ruleDurationUnits=vp;exports.ruleTriggerTypes=gp;exports.templateItemType=qe;exports.templateRouteNames=Uo;
|
|
58
|
+
*/function $o(t){let e={r:0,g:0,b:0,a:1};/#/.test(t)?e=Dfe(t):/rgb/.test(t)?e=dp(t):typeof t=="string"?e=dp(`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}=Mfe(e);return{r:n,g:o,b:r,a:s===void 0?1:s,h:a,s:l,v:c}}function td(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 Zc(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 Nfe({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 Dfe(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 dp(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 Mfe({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 nd=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),Zc("l",n,e,e,"#FFFFFF","rgba(255,255,255,0)"),Zc("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 $fe={ref:"canvasSaturation"};function Bfe(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",$fe,null,512),i.createVNode("div",{style:t.slideSaturationStyle,class:"slide"},null,4)],32)}nd.render=Bfe;nd.__file="src/color/Saturation.vue";var od=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 Ofe={ref:"canvasHue"};function Lfe(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",Ofe,null,512),i.createVNode("div",{style:t.slideHueStyle,class:"slide"},null,4)],32)}od.render=Lfe;od.__file="src/color/Hue.vue";var rd=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=td(o),s=t.getContext("2d");t.width=e,t.height=n,s.fillStyle=s.createPattern(r,"repeat"),s.fillRect(0,0,e,n),Zc("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 Ife={ref:"canvasAlpha"};function Pfe(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",Ife,null,512),i.createVNode("div",{style:t.slideAlphaStyle,class:"slide"},null,4)],32)}rd.render=Pfe;rd.__file="src/color/Alpha.vue";var id=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=td(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 Ffe(t,e,n,o,r,s){return i.openBlock(),i.createBlock("canvas")}id.render=Ffe;id.__file="src/color/Preview.vue";var sd=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 Vfe=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),Rfe={key:1,class:"sucker",viewBox:"-16 -16 68 68",xmlns:"http://www.w3.org/2000/svg",stroke:"#9099a4"},zfe=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 Ufe(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))},[Vfe],2)),t.isSucking?(i.openBlock(),i.createBlock("svg",Rfe,[zfe])):i.createCommentVNode("v-if",!0)])}sd.render=Ufe;sd.__file="src/color/Sucker.vue";var ad=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 qfe={class:"color-type"},Hfe={class:"name"};function jfe(t,e,n,o,r,s){return i.openBlock(),i.createBlock("div",qfe,[i.createVNode("span",Hfe,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]])])}ad.render=jfe;ad.__file="src/color/Box.vue";var ld=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=td(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"},Zfe={key:0,class:"colors history"};function Kfe(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",Zfe,[(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)])}ld.render=Kfe;ld.__file="src/color/Colors.vue";var Dr=i.defineComponent({components:{Saturation:nd,Hue:od,Alpha:rd,Preview:id,Sucker:sd,Box:ad,Colors:ld},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 Nfe(this.rgba,!0)}},created(){Object.assign(this,$o(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}=$o(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}=$o(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}=$o(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}=$o(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}=$o(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}=$o(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 Gfe={class:"color-set"};function Yfe(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",Gfe,[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)}Dr.render=Yfe;Dr.__file="src/color/ColorPicker.vue";Dr.install=t=>{t.component(Dr.name,Dr)};const Jfe={class:"color-picker-wrapper"},pl=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",Jfe,[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(Dr),{class:"color-picker-box",theme:"light",color:t.color,onChangeColor:m},null,8,["color"])],4)):i.createCommentVNode("",!0)]))}});const Xfe={class:"ao-card-project-phase__header"},Qfe={class:"ao-card-project-item__title-line"},epe={key:0,class:"ao-card-project-item-phase__estimation"},tpe={class:"ao-card-project-phase__footer"},npe={key:0,class:"ao-card-project-phase__footer-row ao-card-project-phase__footer-row--progress"},ope={class:"ao-card-project-phase__subitem"},rpe={class:"ao-card-project-phase__subitem"},ipe={key:0,class:"ao-card-project-phase__secondary"},spe={class:"ao-card-project-phase__deadline ao-card-project-phase__deadline--readonly"},ape=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(()=>Da(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===Ii.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(pl,{color:m.value,"onUpdate:color":y[2]||(y[2]=C=>m.value=C)},{clickable:i.withCtx(({openPicker:C,bgColor:v})=>[i.createVNode(dl,{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",Qfe,[i.createVNode(_t,{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",epe," ("+i.toDisplayString(c.value)+"/"+i.toDisplayString(s.value)+i.toDisplayString(l.value)+")",1)):i.createCommentVNode("",!0)])]),footer:i.withCtx(()=>[i.createElementVNode("div",tpe,[u.value?(i.openBlock(),i.createElementBlock("div",npe,[i.createElementVNode("div",ope,[i.createVNode(be,{name:"MountainFlagOutlineRounded",size:"sm"}),i.createElementVNode("span",rpe,i.toDisplayString(d.value)+" / "+i.toDisplayString(u.value),1)]),i.createVNode(fl,{percentages:f.value,class:"ao-card-project-phase__progress",color:t.color},null,8,["percentages","color"]),g.$slots.secondary?(i.openBlock(),i.createElementBlock("div",ipe,[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",spe,i.toDisplayString(i.unref(Ma)(t.deadline)),1)],2)])]),_:2},[t.isEditable?{name:"header",fn:i.withCtx(()=>[i.createElementVNode("div",Xfe,[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 lpe=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 cpe={class:"ao-card-project-milestone__default"},upe={class:"ao-title-with-badge-wrapper"},dpe={class:"ao-card-project-item__title-line"},fpe={key:0,class:"ao-card-project-item-milestone__estimation"},ppe={key:0,class:"ao-card-project-milestone__archive"},mpe={class:"ao-card-project-milestone__activities"},hpe={class:"ao-card-project-milestone__activities-row"},gpe={class:"ao-card-project-milestone__subitem"},vpe={class:"ao-card-project-milestone__subitem"},ype={key:1,class:"ao-card-project-milestone__secondary"},_pe={class:"ao-card-project-milestone__footer"},Cpe={key:1,class:"ao-field ao-card-project-milestone__deadline"},bpe={class:"ao-field__label"},kpe={key:2,class:"ao-card-project-milestone__assignee"},wpe=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(()=>Da(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=>Jc(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(dl,{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",cpe,[i.createElementVNode("div",upe,[i.createVNode(lpe,{color:t.color||""},null,8,["color"]),i.createElementVNode("div",dpe,[i.createVNode(_t,{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",fpe," ("+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",ppe,[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",mpe,[i.createElementVNode("div",hpe,[c.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createElementVNode("div",gpe,[i.createVNode(be,{name:"SelectCheckBox",size:"sm"}),i.createElementVNode("span",vpe,i.toDisplayString(u.value)+" / "+i.toDisplayString(c.value),1)]),i.createVNode(fl,{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",ype,[i.renderSlot(p.$slots,"secondary")])):i.createCommentVNode("",!0)])])]),footer:i.withCtx(()=>[i.createElementVNode("div",_pe,[t.important?(i.openBlock(),i.createBlock(be,{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",Cpe,[i.createElementVNode("span",bpe,i.toDisplayString(i.unref(Ma)(t.deadline)),1)])):i.createCommentVNode("",!0),t.assignee?(i.openBlock(),i.createElementBlock("div",kpe,[i.createVNode(Jn,{"user-name":i.unref(Op)(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 Epe={class:"ao-mapping-card-project-phase__header"},Spe={class:"ao-card-project-item__title-line"},xpe={key:0,class:"ao-card-project-item-phase__estimation"},Tpe={class:"ao-mapping-card-project-phase__footer"},Ape={key:0,class:"ao-mapping-card-project-phase__footer-row ao-mapping-card-project-phase__footer-row--progress"},Npe={class:"ao-mapping-card-project-phase__subitem"},Dpe={class:"ao-mapping-card-project-phase__subitem"},Mpe={key:0,class:"ao-mapping-card-project-phase__secondary"},$pe={class:"ao-mapping-card-project-phase__deadline ao-mapping-card-project-phase__deadline--readonly"},Bpe=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(()=>Da(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===Ii.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(pl,{color:m.value,"onUpdate:color":y[2]||(y[2]=C=>m.value=C)},{clickable:i.withCtx(({openPicker:C,bgColor:v})=>[i.createVNode(dl,{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",Spe,[i.createVNode(_t,{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",xpe," ("+i.toDisplayString(c.value)+"/"+i.toDisplayString(s.value)+i.toDisplayString(l.value)+")",1)):i.createCommentVNode("",!0)])]),footer:i.withCtx(()=>[i.createElementVNode("div",Tpe,[u.value?(i.openBlock(),i.createElementBlock("div",Ape,[i.createElementVNode("div",Npe,[i.createVNode(be,{name:"MountainFlagOutlineRounded",size:"sm"}),i.createElementVNode("span",Dpe,i.toDisplayString(d.value)+" / "+i.toDisplayString(u.value),1)]),i.createVNode(fl,{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",Mpe,[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",$pe,i.toDisplayString(i.unref(Ma)(t.deadline)),1)],2)])]),_:2},[t.isEditable?{name:"header",fn:i.withCtx(()=>[i.createElementVNode("div",Epe,[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 Ope={class:"ao-project-phase"},Lpe={key:0,class:"ao-project-phase__drag ao-card__drag"},Ipe={key:1,class:"ao-project-phase__col-phase"},Ppe={key:2,class:"ao-mapping-project-phase__col-phase"},Fpe={key:0,class:"ao-project-phase__col-milestones"},Vpe=["title"],Rpe={class:"ao-project-phase__milestones-list-footer"},zpe=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}=$n(),o=t,r=e;i.watch(()=>o.phase.milestones,(w,b)=>{jn(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=>v_(w,o.closedStatus))),u=w=>{const{name:b,rank:E}=Zo(c.value??[],"milestone",n);r("addMilestone",{name:b,rank:E,phaseId:w})},d=w=>{const b=n("template.defaultName.milestone",{idx:1}),E=ts(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:$r(c.value,w.added.newIndex)}):"removed"in w||"moved"in w&&r("updateMilestone",{id:w.moved.element.id,rank:$r(c.value,w.moved.newIndex)})},C=Mr.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:__(o.phase.color)}:{backgroundColor:"var(--ao-color-primary-lightest)"}});return(w,b)=>(i.openBlock(),i.createElementBlock("li",Ope,[i.createElementVNode("div",{class:"ao-project-phases__draggable-card",style:i.normalizeStyle(k.value)},[t.isEditable?(i.openBlock(),i.createElementBlock("div",Lpe,[i.createVNode(be,{name:"DragIndicator",class:"ao-project-phase__drag-handle"})])):i.createCommentVNode("",!0),v.value?(i.openBlock(),i.createElementBlock("div",Ppe,[i.createVNode(Bpe,{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",Ipe,[i.createVNode(ape,{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",Fpe,[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(be,{name:"Add",class:"ao-project-phase__milestone-quick-add-icon"})],10,Vpe)):i.createCommentVNode("",!0),i.createVNode(i.unref(Co),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(wpe,{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:x=>!t.readonly&&w.$router.push({name:i.unref(Pe).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",Rpe,[t.isEditable?(i.openBlock(),i.createBlock(bo,{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 Upe={class:"ao-project__phases"},qpe={key:0,class:"ao-project-phase__phases-list-footer"},Hpe={class:"ao-project-phase__col-phase"},cd=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)=>{jn(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=es(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",Upe,[i.createVNode(i.unref(Co),{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(zpe,{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",qpe,[h[0]||(h[0]=i.createElementVNode("div",{class:"ao-project-phase__empty_drag"},null,-1)),i.createElementVNode("div",Hpe,[i.createVNode(bo,{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 jpe={class:"ao-add-template-modal__form-body"},Wpe={class:"field__row"},Zpe={class:"ao-add-template-modal__form-footer"},Vg=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($a,{size:"sm"},{header:i.withCtx(()=>[i.createVNode(_t,{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",jpe,[i.createElementVNode("div",Wpe,[i.createVNode(wt,{value:s.value,options:r.value,detached:!0,onChange:a},null,8,["value","options"])])]),i.createElementVNode("footer",Zpe,[i.createVNode(me,{label:c.$t("project.template.apply.label"),type:"submit",color:"primary",variant:"solid",onClick:l},null,8,["label"])])],32)]),_:1}))}});const Kpe={class:"ao-save-template-modal__form-body"},Gpe={class:"field__row"},Ype={class:"ao-field ao-field--inline"},Jpe={class:"ao-field__label"},Xpe={class:"ao-save-template-modal__phases"},Qpe={class:"ao-field__label"},eme={class:"ao-save-template-modal__phases-list"},tme=["value"],nme={class:"ao-save-template-modal__form-footer"},Rg=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($a,{size:"sm"},{header:i.withCtx(()=>[i.createVNode(_t,{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",Kpe,[i.createElementVNode("div",Gpe,[i.createElementVNode("label",Ype,[i.createElementVNode("span",Jpe,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",Xpe,[i.createElementVNode("div",Qpe,i.toDisplayString(l.$t("project.template.phases.label")),1),i.createElementVNode("div",eme,[(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,tme),[[i.vModelCheckbox,s.value]]),i.createElementVNode("span",null,i.toDisplayString(u.name),1)]))),128))])])]),i.createElementVNode("footer",nme,[i.createVNode(me,{label:l.$t("project.template.save.label"),type:"submit",color:"primary",variant:"solid",onClick:a},null,8,["label"])])],32)]),_:1}))}});const ome={class:"ao-project"},rme={class:"ao-project__body"},ime=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}=$n(),o=t,r=e,s=i.computed(()=>o.phases.flatMap(V=>V.milestones)),a=()=>{const{name:V,rank:Q}=Zo(o.phases,"phase",n);r("addPhase",{name:V,rank:Q,projectId:o.project.id})},l=()=>{const V=n("template.defaultName.phase",{idx:1}),Q=ts(o.phases);r("addPhase",{name:V,rank:Q,projectId:o.project.id})},c=V=>{r("updatePhase",V)},u=V=>{r("archivePhase",V)},d=V=>{r("unarchivePhase",V)},f=V=>{r("copyPhaseToTemplate",V)},p=V=>{r("addMilestone",V)},m=V=>{r("updateMilestone",V)},h=V=>{r("archiveMilestone",V)},g=V=>{r("unarchiveMilestone",V)},y=V=>{r("addActivity",V)},C=V=>{r("update:activity",V)},v=V=>{r("archiveActivity",V)},_=V=>{r("unarchiveActivity",V)},k=V=>{r("addSubtask",V)},w=V=>{r("updateSubtask",V)},b=V=>{r("deleteSubtask",V)},E=i.computed(()=>s.value.flatMap(V=>V.activities)),T=V=>{r("addFiles",V)},x=V=>{r("removeFile",V)},N=V=>{r("addComment",V)},I=V=>{r("updateComment",V)},A=V=>{r("removeComment",V)},D=i.ref(!1),M=i.ref(!1),L=(V,Q)=>{r("applyTemplate",{templateId:V,projectId:Q}),D.value=!1},P=(V,Q)=>{var se;const ee=(se=o.templates)==null?void 0:se.at(-1),he=ee?lt.LexoRank.parse(ee.rank).genNext():lt.LexoRank.middle();r("saveTemplate",{templateName:V,rank:he.format(),phaseIds:Q}),M.value=!1},j=Mr.useRouter(),F=i.ref("overview"),H=[{label:"Overview",value:"overview"},{label:"Feed",value:"feed"},{label:"Dev",value:"dev"},{label:"Mapping",value:"mapping"}];return i.watch(F,V=>{V==="feed"?(j.push({name:Pe.feed}),console.log("Navigating to feed...")):V==="dev"?(j.push({name:Pe.dev}),console.log("Navigating to dev...")):V==="overview"?(j.push({name:Pe.project}),console.log("Navigating to feed...")):V==="mapping"&&(j.push({name:Pe.mapping}),console.log("Navigating to feed..."))}),(V,Q)=>{var he;const ee=i.resolveComponent("RouterView");return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("div",i.mergeProps({class:"ao-project-overview"},V.$attrs),[i.createElementVNode("div",ome,[i.createVNode(ns,null,{primary:i.withCtx(()=>[i.createVNode(hs,{modelValue:F.value,"onUpdate:modelValue":Q[0]||(Q[0]=se=>F.value=se),tabs:H},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:Q[1]||(Q[1]=se=>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-overview__quick-add-phase",size:"sm","icon-name":"Add","icon-position":"start",color:"primary",variant:"ghost",label:V.$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:V.$t("project.template.save.label"),onClick:Q[2]||(Q[2]=se=>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:V.$t("project.template.apply.label"),onClick:Q[3]||(Q[3]=se=>D.value=!0)},null,8,["label"])):i.createCommentVNode("",!0)]),_:1}),i.createElementVNode("div",rme,[i.createVNode(cd,{phases:t.phases,"closed-status":t.closedStatus,"is-editable":t.isEditable===!0,users:t.users,"time-tracking-data":t.timeTrackingData,"estimation-unit":(he=t.project)==null?void 0:he.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(ee,{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]=se=>V.$router.push({name:i.unref(Pe).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(ee,{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:x,onAddComment:N,onUpdateComment:I,onRemoveComment:A},{default:i.withCtx(({Component:se})=>[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(se),null,{default:i.withCtx(ae=>[i.renderSlot(V.$slots,"activityDetailsBody",i.normalizeProps(i.guardReactiveProps(ae)))]),_: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(Rg,{key:0,phases:t.phases,onClose:Q[5]||(Q[5]=se=>M.value=!1),onSave:P},null,8,["phases"])):i.createCommentVNode("",!0),D.value?(i.openBlock(),i.createBlock(Vg,{key:1,"project-id":t.project.id,templates:t.templates,onClose:Q[6]||(Q[6]=se=>D.value=!1),onApply:L},null,8,["project-id","templates"])):i.createCommentVNode("",!0)]))],64)}}});const sme={class:"ao-card-feed__header"},ame={key:1,class:"ao-card-feed__header-secondary ao-card-feed__header-icons"},lme={key:2,class:"ao-card-feed__header-secondary ao-card-feed__secondary"},cme={class:"ao-card-feed__body"},ume={key:0,class:"ao-card-feed__breadcrumbs"},dme={class:i.normalizeClass(["ao-card-feed__title-group"])},fme={class:"ao-card-feed__title-line"},pme={key:0,class:"ao-card-feed__slug"},mme={key:1,class:"ao-card-feed__deadline"},hme={class:"ao-card-feed__footer"},gme={class:"ao-card-feed__footer-row"},vme={class:"ao-assignees"},yme={key:0,class:"ao-assignee"},_me={key:0,class:"ao-card-feed__subitems"},Cme={key:0,class:"ao-card-feed__subitem"},bme={class:"ao-card-feed__subitem"},kme={key:1,class:"ao-card-feed__subitem"},wme={class:"ao-card-feed__subitem"},Eme={class:"ao-card-feed__timer-wrapper"},Sme={class:"ao-card-feed__footer-row"},xme={key:0,class:"ao-card-feed__progress-wrapper"},Tme={class:"ao-card-feed__subitem"},Ame={class:"ao-card-feed__subitem"},ud=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(()=>Ma(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(dl,{class:i.normalizeClass(["ao-card-feed",{"ao-card-feed--closed":t.isClosed}]),"is-clickable":!0},{header:i.withCtx(()=>[i.createElementVNode("div",sme,[r.value?(i.openBlock(),i.createBlock(Li,{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",ame,[t.isPrivate?(i.openBlock(),i.createBlock(be,{key:0,name:"Lock",class:"ao-card-feed__warning",size:"sm"})):i.createCommentVNode("",!0),t.important?(i.openBlock(),i.createBlock(be,{key:1,name:"FlagRounded",class:"ao-card-feed__important",size:"sm"})):i.createCommentVNode("",!0),t.isClosed?(i.openBlock(),i.createBlock(be,{key:2,name:"CheckSmallRounded",class:"ao-card-feed__closed"})):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),g.$slots.secondary?(i.openBlock(),i.createElementBlock("div",lme,[i.renderSlot(g.$slots,"secondary")])):i.createCommentVNode("",!0)])]),default:i.withCtx(()=>[i.createElementVNode("div",cme,[l.value?(i.openBlock(),i.createElementBlock("span",ume,i.toDisplayString(l.value),1)):i.createCommentVNode("",!0),i.createElementVNode("div",dme,[i.createElementVNode("div",fme,[t.slug?(i.openBlock(),i.createElementBlock("span",pme,i.toDisplayString(t.slug)+": ",1)):i.createCommentVNode("",!0),i.createVNode(_t,{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",mme,i.toDisplayString(u.value),1)):i.createCommentVNode("",!0)])]),footer:i.withCtx(()=>[i.createElementVNode("div",hme,[i.createElementVNode("div",gme,[i.createElementVNode("ul",vme,[(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",yme,[i.createVNode(Jn,{"user-name":i.unref(Op)(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",_me,[t.comments?(i.openBlock(),i.createElementBlock("li",Cme,[i.createVNode(be,{name:"ChatOutline",size:"sm"}),i.createElementVNode("span",bme,i.toDisplayString(t.comments),1)])):i.createCommentVNode("",!0),t.attachments?(i.openBlock(),i.createElementBlock("li",kme,[i.createVNode(be,{name:"AttachFileRounded",size:"sm"}),i.createElementVNode("span",wme,i.toDisplayString(t.attachments),1)])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),i.createElementVNode("div",Eme,[i.createVNode(be,{name:"TimerOutline",class:"ao-card-feed__timer",size:"md",onClick:i.withModifiers(f,["stop"])})])]),i.createElementVNode("div",Sme,[t.tasks&&t.tasks.length?(i.openBlock(),i.createElementBlock("div",xme,[i.createElementVNode("div",Tme,[i.createVNode(be,{name:"SelectCheckBox",size:"sm"}),i.createElementVNode("span",Ame,i.toDisplayString(m.value)+" / "+i.toDisplayString(p.value),1)]),i.createVNode(fl,{percentages:h.value,class:"ao-card-feed__progress"},null,8,["percentages"])])):i.createCommentVNode("",!0)])])]),_:3},8,["class"]))}});const Nme={class:"ao-project-milestone"},Dme={class:"ao-project-milestone__header"},Mme={class:"ao-project-milestone__header_line"},$me={class:"ao-project-milestone__header_line"},Bme={class:"ao-project-milestone__title"},Ome={key:0,class:"ao-fieldset ao-milestone__fieldset"},Lme={class:"ao-field__row ao-milestone__field-row"},Ime={class:"ao-field ao-field--inline"},Pme={class:"ao-field__row ao-milestone__field-row"},Fme={class:"ao-field ao-milestone__field-multiselect"},Vme={class:"ao-milestone__color-actions"},Rme=["onClick"],zme=["title"],Ume={class:"ao-project-milestone__body"},qme={key:0,class:"ao-project-milestone__footer"},fp=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}=$n(),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)=>{jn(b,E)});const d=b=>{r("close",b)},f=()=>{const{name:b,rank:E}=Zo(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=ts(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:$r(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?Jc(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",Nme,[i.createElementVNode("header",Dme,[i.createElementVNode("div",Mme,[i.createVNode(me,{"icon-name":"CloseRounded",variant:"ghost",size:"sm",class:"ao-milestone__close",onClick:d})]),i.createElementVNode("div",$me,[i.createElementVNode("div",Bme,[i.createVNode(_t,{title:((T=c.value)==null?void 0:T.name)||t.milestoneId,level:5},null,8,["title"]),i.createVNode(Pg,{modelValue:k.value,"onUpdate:modelValue":E[0]||(E[0]=x=>k.value=x),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",Ome,[i.createElementVNode("div",Lme,[i.createElementVNode("label",Ime,[i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":E[1]||(E[1]=x=>y.value=x),class:"ao-milestone__field ao-milestone__date-field",type:"date"},null,512),[[i.vModelText,y.value,void 0,{lazy:!0}]])])]),i.createElementVNode("div",Pme,[i.createElementVNode("label",Fme,[i.createVNode(wt,{modelValue:_.value,"onUpdate:modelValue":E[2]||(E[2]=x=>_.value=x),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:x,handleTagRemove:N})=>[i.createVNode(Jn,{"user-name":x.label,"avatar-url":x.avatar,"is-closable":!0,onClose:I=>N(x,I)},null,8,["user-name","avatar-url","onClose"])]),_:1},8,["modelValue","options","placeholder","disabled","caret"])])]),i.createElementVNode("div",Vme,[i.createVNode(pl,{color:g.value,"onUpdate:color":E[3]||(E[3]=x=>g.value=x)},{clickable:i.withCtx(({openPicker:x,bgColor:N})=>[i.createElementVNode("button",{style:i.normalizeStyle({background:N}),class:"color-button",onClick:I=>w(I,x)},null,12,Rme)]),_: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(be,{name:"Add",class:"ao-project-milestone__quick-add-icon"})],8,zme)):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0)]),i.createElementVNode("div",Ume,[i.createVNode(i.unref(Co),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:x})=>{var N,I,A,D,M;return[i.createVNode(ud,{id:x.id,name:x.name||x.id,"project-id":t.projectId,"phase-name":(N=a.value)==null?void 0:N.name,"milestone-name":(I=c.value)==null?void 0:I.name,"milestone-color":(A=c.value)==null?void 0:A.color,deadline:x.deadline,important:x.important,users:t.users,assignee:x.assignee,slug:x.slug,comments:(D=x.comments)==null?void 0:D.length,attachments:(M=x.attachments)==null?void 0:M.length,tasks:x.tasks,"is-editable":t.isEditable,"is-private":x.private,"is-closed":C(x),onClick:L=>b.$router.push({name:i.unref(Pe).activity,params:{milestoneId:t.milestoneId,activityId:x.id}}),onUpdateActivity:m,onRemoveAssignee:()=>m({id:x.id,assigneeId:null}),onStartTimer:s},i.createSlots({_:2},[t.isEditable?{name:"secondary",fn:i.withCtx(()=>[t.isEditable&&x.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:x.id}),["stop"])},null,8,["label","onClick"])):i.createCommentVNode("",!0),t.isEditable&&!x.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:x.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",qme,[i.createVNode(bo,{"icon-name":"Add",label:b.$t("project.activity.add"),onClick:f},null,8,["label"])])):i.createCommentVNode("",!0)])])}}});const Hme=i.defineComponent({__name:"AoProjectOverviewActivityDetails",props:{phaseId:{},milestoneId:{},activityId:{},activityTypes:{},devStatuses:{},activities:{},isTaskCheckable:{type:Function},statuses:{},phases:{},users:{},project:{},userId:{},isEditable:{type:Boolean},attachmentEnabled:{type:Boolean},timeTrackingData:{},loadAttachmentPreview:{type:Function},sprints:{}},emits:["update:activity","addSubtask","updateSubtask","deleteSubtask","addFiles","removeFile","addComment","updateComment","removeComment","createSprint"],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(ed,{key:0,activity:l.value,"activity-types":t.activityTypes,"dev-statuses":t.devStatuses,"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,sprints:t.sprints,onClose:C.$router.back,"onUpdate:activity":c,onAddSubtask:u,onUpdateSubtask:d,onDeleteSubtask:f,onAddFiles:p,onRemoveFile:m,onAddComment:h,onUpdateComment:g,onRemoveComment:y,onCreateSprint:v[0]||(v[0]=w=>o("createSprint",w))},{default:i.withCtx(w=>[i.renderSlot(C.$slots,"default",i.normalizeProps(i.guardReactiveProps(w)))]),_:3},8,["activity","activity-types","dev-statuses","milestone-id","template-activities","users","user-id","is-task-checkable","statuses","breadcrumbs","is-editable","attachment-enabled","projects","time-tracking-data","load-attachment-preview","sprints","onClose"])):i.createCommentVNode("",!0)}}}),jme={class:"ao-col-header"},Wme=i.defineComponent({__name:"AoColHeader",props:{title:{},items:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("header",jme,[i.createVNode(_t,{title:t.title,class:"ao-col-header__title",level:4},null,8,["title"]),t.items?(i.openBlock(),i.createBlock(Li,{key:0,label:t.items,class:"ao-col-header__items",variant:"solid",color:"primary"},null,8,["label"])):i.createCommentVNode("",!0)]))}});function Zme(t){return i.getCurrentScope()?(i.onScopeDispose(t),!0):!1}function Ea(t){return typeof t=="function"?t():i.unref(t)}const Kme=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Gme=t=>t!=null,Oi=()=>{};function Yme(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 Jme(t,e={}){let n,o,r=Oi;const s=l=>{clearTimeout(l),r(),r=Oi};return l=>{const c=Ea(t),u=Ea(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 Xme(t,e=200,n={}){return Yme(Jme(e,n),t)}function ac(t){var e;const n=Ea(t);return(e=n==null?void 0:n.$el)!=null?e:n}const Qme=Kme?window:void 0;function ehe(){const t=i.ref(!1),e=i.getCurrentInstance();return e&&i.onMounted(()=>{t.value=!0},e),t}function the(t){const e=ehe();return i.computed(()=>(e.value,!!t()))}function nhe(t,e,n={}){const{root:o,rootMargin:r="0px",threshold:s=.1,window:a=Qme,immediate:l=!0}=n,c=the(()=>a&&"IntersectionObserver"in a),u=i.computed(()=>{const h=Ea(t);return(Array.isArray(h)?h:[h]).map(ac).filter(Gme)});let d=Oi;const f=i.ref(l),p=c.value?i.watch(()=>[u.value,ac(o),f.value],([h,g])=>{if(d(),!f.value||!h.length)return;const y=new IntersectionObserver(e,{root:ac(g),rootMargin:r,threshold:s});h.forEach(C=>C&&y.observe(C)),d=()=>{y.disconnect(),d=Oi}},{immediate:l,flush:"post"}):Oi,m=()=>{d(),p(),f.value=!1};return Zme(m),{isSupported:c,isActive:f,pause(){d(),f.value=!1},resume(){f.value=!0},stop:m}}const ohe={class:i.normalizeClass(["ao-list-kanban"])},rhe={class:"ao-list-kanban__header"},ihe=["title"],she={key:0,class:"ao-list-kanban__end ao-list-kanban__end--loading"},ahe={key:1,class:"ao-list-kanban__end"},lhe={key:0,class:"ao-list-kanban__no-more"},che={key:1,class:"ao-list-kanban__divider"},uhe={key:1,class:"ao-list-kanban__footer"},dhe=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},isDevMode:{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);nhe(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=>{if("added"in f){const p={id:f.added.element.id,rank:$r(n.list,f.added.newIndex)};n.isDevMode?p.statusDevId=n.status.id:p.statusId=n.status.id,o("updateActivity",p)}else"removed"in f||"moved"in f&&o("updateActivity",{id:f.moved.element.id,rank:$r(n.list,f.moved.newIndex)})},d=i.ref(!1);return(f,p)=>(i.openBlock(),i.createElementBlock("div",ohe,[t.title||f.$slots.header?i.renderSlot(f.$slots,"header",{},()=>{var m;return[i.createElementVNode("div",rhe,[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(be,{name:"Add"})],8,ihe)):i.createCommentVNode("",!0)])]},void 0,0):i.createCommentVNode("",!0),i.createVNode(i.unref(Co),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(ud,{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",she,[i.createVNode(be,{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",ahe,[t.noMoreLabel?(i.openBlock(),i.createElementBlock("span",lhe,i.toDisplayString(t.noMoreLabel),1)):t.isEditable?(i.openBlock(),i.createElementBlock("span",che)):i.createCommentVNode("",!0)]))]),_:1},16,["class","list","disabled"]),f.$slots.footer||t.footerLabel?(i.openBlock(),i.createElementBlock("div",uhe,[i.renderSlot(f.$slots,"footer",{},()=>[t.isEditable?(i.openBlock(),i.createBlock(bo,{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 fhe={class:"ao-field ao-search-field"},phe=["value","placeholder"],mhe=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=Xme(r,n.delay),a=l=>{o("clear",l)};return(l,c)=>(i.openBlock(),i.createElementBlock("div",fhe,[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,phe),i.createVNode(be,{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 hhe={class:"ao-feed"},ghe={class:"ao-feed__filters"},vhe={class:"ao-feed__body"},Kc=i.defineComponent({__name:"AoFeed",props:{activities:{},statuses:{},devStatuses:{default:()=>[]},project:{default:void 0},projects:{default:()=>[]},filters:{},activityTypes:{default:()=>[]},users:{},userId:{},initialActivityId:{default:void 0},initialActivitySlug:{default:void 0},searchText:{default:""},showsArchivedActivities:{type:Boolean},showsOnlyImportant:{type:Boolean},showsOnlyNonAssigned:{type:Boolean},selectedActivity:{default:void 0},isTaskCheckable:{type:Function,default:void 0},isEditable:{type:[Boolean,String]},attachmentEnabled:{type:Boolean,default:!0},timeTrackingData:{default:()=>({})},loadAttachmentPreview:{type:Function,default:void 0},feedMode:{default:"standard"},sprints:{default:()=>[]}},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","createSprint"],setup(t,{emit:e}){const{t:n}=$n(),o=t,r=e;function s(U,te){r("toast",U,te)}const a=i.toRef(o,"activities"),l=i.computed(()=>o.feedMode==="dev"?o.devStatuses:o.statuses),c=i.computed(()=>o.feedMode==="dev"?a.value.filter(U=>U.activityType==="dev"):a.value),u=async(U,te)=>{await r("selectActivity",U,te)},d=i.ref({}),f=i.ref(!1),p=i.ref(!1),m=i.computed(()=>o.project?"milestone":"project");i.watch([()=>l.value,()=>c.value,()=>o.initialActivityId,()=>o.initialActivitySlug,()=>o.feedMode],async([U,te,Be,le],[Ke,Ce])=>{const Ae=o.feedMode==="dev"?"devStatus":"status";d.value=Object.fromEntries(U.map(Fe=>[Fe.id,te.filter(ke=>{const Oe=ke[Ae];return(Oe==null?void 0:Oe.id)===Fe.id})])),Be&&!f.value?(u(Be,null),f.value=!0):le&&!f.value&&(u(null,le),f.value=!0),p.value&&jn(te,Ce)},{immediate:!0});const h=i.computed(()=>{var U;return!o.selectedActivity||!o.selectedActivity.milestone?"":`${((U=o.selectedActivity.milestone.phase)==null?void 0:U.name)??""} / ${o.selectedActivity.milestone.name??""}`}),g=U=>{var Fe;const te=o.feedMode==="dev"?o.activities.filter(ke=>ke.activityType==="dev"):o.activities,Be=te==null?void 0:te.at(-1),le=Be?lt.LexoRank.parse(Be.rank).genNext():lt.LexoRank.middle(),Ke=((Fe=o.activities)==null?void 0:Fe.length)??0,Ce=o.feedMode==="dev",Ae={name:n("activity.defaultName",{idx:Ke+1}),rank:le.format(),...Ce?{statusDevId:U.id,type:"dev"}:{statusId:U.id}};if(o.filters.assigneeId.length>0&&(Ae.assigneeId=o.filters.assigneeId[0]),o.filters.projectId.length>0&&(Ae.projectId=o.filters.projectId[0]),o.filters.sprintId&&o.filters.sprintId.length===1){const ke=o.sprints.find(Oe=>Oe.id===o.filters.sprintId[0]);ke&&(Ae.sprintId=ke.id,Ae.projectId=ke.projectId)}p.value=!0,r("addActivity",Ae)},y=U=>{var Fe,ke;const te=o.feedMode==="dev"?"devStatus":"status",Be=((Fe=o.activities)==null?void 0:Fe.filter(Oe=>{const We=Oe[te];return(We==null?void 0:We.id)===U.id}))??[],le=ts(Be),Ke=((ke=o.activities)==null?void 0:ke.length)??0,Ce=o.feedMode==="dev",Ae={name:n("activity.defaultName",{idx:Ke+1}),rank:le,...Ce?{statusDevId:U.id,type:"dev"}:{statusId:U.id}};if(o.filters.assigneeId.length>0&&(Ae.assigneeId=o.filters.assigneeId[0]),o.filters.projectId.length>0&&(Ae.projectId=o.filters.projectId[0]),o.filters.sprintId&&o.filters.sprintId.length===1){const Oe=o.sprints.find(We=>We.id===o.filters.sprintId[0]);Oe&&(Ae.sprintId=Oe.id,Ae.projectId=Oe.projectId)}p.value=!0,r("addActivity",Ae)},C=(U,te)=>{p.value=!1,r("update:filters",{...o.filters,[U]:te})},v=i.computed(()=>o.project?[o.project]:o.projects??[]),_=i.computed(()=>v.value.map(U=>({value:U.id,label:U.name}))),k=i.computed(()=>o.sprints.map(U=>({value:U.id,label:`${U.name} · ${U.startDate} – ${U.endDate}`,startDate:U.startDate,endDate:U.endDate,projectId:U.projectId})));i.computed(()=>{var U;return(U=o.activityTypes)==null?void 0:U.map(te=>({value:te.id,label:te.name}))});const w=i.computed(()=>o.users.map(U=>({value:U.id,label:`${U.firstName} ${U.lastName}`,avatar:U.avatarUrl}))),b=U=>{o.selectedActivity&&r("update:activity",U)},E=U=>{r("update:activity",U)},T=U=>{r("archiveActivity",U)},x=U=>{r("unarchiveActivity",U)},N=U=>{var te;r("startTimer",U),(te=window.parent)==null||te.postMessage({type:"startTimer",data:U},"*")},I=U=>{p.value=!1,r("update:searchText",U)},A=U=>{p.value=!1,r("clear:searchText",U)},D=U=>{o.selectedActivity&&r("addSubtask",U)},M=U=>{o.selectedActivity&&r("updateSubtask",U)},L=U=>{o.selectedActivity&&r("deleteSubtask",U)},P=U=>{r("addFiles",U)},j=U=>{r("removeFile",U)},F=U=>{o.selectedActivity&&r("addComment",{...U,activityId:o.selectedActivity.id})},H=U=>{const{id:te}=o.selectedActivity||{};te&&r("updateComment",U)},V=U=>{const{id:te}=o.selectedActivity||{};te&&r("removeComment",U)},Q=Mr.useRouter(),ee=Mr.useRoute(),he=i.ref("feed");i.watch(()=>ee.name,U=>{U===Po.feed||U==="ActivityFeed"||U==="ActivityFeedWithActivity"?he.value="feed":U===Po.dev||U==="ActivityFeedDev"||U==="ActivityFeedDevWithActivity"?he.value="dev":U===Pe.feed?he.value="feed":U===Pe.dev?he.value="dev":U===Pe.project?he.value="overview":U===Pe.mapping&&(he.value="mapping")},{immediate:!0});const se=[{label:"Overview",value:"overview"},{label:"Feed",value:"feed"},{label:"Dev",value:"dev"},{label:"Mapping",value:"mapping"}],ae=i.computed(()=>z.value?se.filter(U=>U.value==="feed"||U.value==="dev"):se),z=i.computed(()=>!o.project&&ee.name&&(ee.name===Po.feed||ee.name===Po.dev||ee.name==="ActivityFeed"||ee.name==="ActivityFeedDev"||ee.name==="ActivityFeedWithActivity"||ee.name==="ActivityFeedDevWithActivity")),re=i.computed(()=>z.value?Po.feed:Pe.feed),ye=i.computed(()=>z.value?Po.dev:Pe.dev),$e=i.computed(()=>Pe.project),ot=i.computed(()=>Pe.mapping);return i.watch(he,U=>{U==="feed"?Q.push({name:re.value}):U==="dev"?Q.push({name:ye.value}):U==="overview"?Q.push({name:$e.value}):U==="mapping"&&Q.push({name:ot.value})}),(U,te)=>{var Be;return i.openBlock(),i.createElementBlock("div",hhe,[i.createVNode(ns,null,{primary:i.withCtx(()=>[i.createElementVNode("div",ghe,[i.createVNode(hs,{modelValue:he.value,"onUpdate:modelValue":te[0]||(te[0]=le=>he.value=le),tabs:ae.value},null,8,["modelValue","tabs"]),i.createVNode(mhe,{"model-value":t.searchText,placeholder:U.$t("feed.search.placeholder"),class:"ao-feed__search","onUpdate:modelValue":I,onClear:A},null,8,["model-value","placeholder"]),o.project?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(wt,{key:0,"model-value":t.filters[i.unref(Bo).project],mode:"tags",options:_.value,"close-on-select":!1,searchable:!0,class:"ao-feed__filter ao-feed__filter__projects",placeholder:U.$t("feed.filters.project.placeholder"),"onUpdate:modelValue":te[1]||(te[1]=le=>C(i.unref(Bo).project,le))},null,8,["model-value","options","placeholder"])),t.feedMode==="dev"?(i.openBlock(),i.createBlock(wt,{key:1,"model-value":t.filters[i.unref(Bo).sprint],mode:"tags",options:k.value,"close-on-select":!1,searchable:!0,disabled:!k.value.length,class:"ao-feed__filter ao-feed__filter__sprints",placeholder:U.$t("feed.filters.sprint.placeholder"),"onUpdate:modelValue":te[2]||(te[2]=le=>C(i.unref(Bo).sprint,le))},null,8,["model-value","options","disabled","placeholder"])):i.createCommentVNode("",!0),w.value.length?(i.openBlock(),i.createBlock(wt,{key:2,"model-value":t.filters[i.unref(Bo).assignee],mode:"tags",options:w.value,"close-on-select":!1,searchable:!0,class:"ao-feed__filter ao-feed__filter__assignees",placeholder:U.$t("feed.filters.assignee.placeholder"),"onUpdate:modelValue":te[3]||(te[3]=le=>C(i.unref(Bo).assignee,le))},{tag:i.withCtx(({option:le,handleTagRemove:Ke})=>[i.createVNode(Jn,{"user-name":le.label,"avatar-url":le.avatar,"is-closable":!0,onClose:Ce=>Ke(le,Ce)},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:U.$t("feed.filters.showsOnlyNonAssigned.label"),role:"checkbox","aria-checked":t.showsOnlyNonAssigned,onClick:te[4]||(te[4]=le=>U.$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:U.$t("feed.filters.showsOnlyImportant.label"),role:"checkbox","aria-checked":t.showsOnlyImportant,onClick:te[5]||(te[5]=le=>U.$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:U.$t("feed.filters.showsArchivedActivities.label"),role:"checkbox","aria-checked":t.showsArchivedActivities,onClick:te[6]||(te[6]=le=>U.$emit("update:showsArchivedActivities",!t.showsArchivedActivities))},null,8,["icon-name","label","aria-checked"])]),_:1}),i.createElementVNode("div",vhe,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(l.value,le=>(i.openBlock(),i.createBlock(dhe,{key:le.id,status:le,list:d.value[le.id],title:le.name,"footer-label":U.$t("feed.activity.add"),users:t.users,"user-id":t.userId,"is-editable":t.isEditable,"tag-type":m.value,"show-header-add":t.isEditable,"is-dev-mode":t.feedMode==="dev",onAdd:()=>g(le),onAddAtBeginning:()=>y(le),onSelectActivity:u,onArchiveActivity:T,onUnarchiveActivity:x,onUpdateActivity:E,onStartTimer:N},null,8,["status","list","title","footer-label","users","user-id","is-editable","tag-type","show-header-add","is-dev-mode","onAdd","onAddAtBeginning"]))),128))]),(i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[t.selectedActivity?(i.openBlock(),i.createBlock(ed,{key:0,activity:t.selectedActivity,"activity-types":t.activityTypes,"dev-statuses":t.devStatuses,"milestone-id":(Be=t.selectedActivity.milestone)==null?void 0:Be.id,"template-activities":a.value,users:t.users,"user-id":t.userId,"is-task-checkable":t.isTaskCheckable,statuses:t.statuses,breadcrumbs:h.value,"is-editable":t.isEditable,"attachment-enabled":t.attachmentEnabled,projects:v.value,"time-tracking-data":t.timeTrackingData,"load-attachment-preview":o.loadAttachmentPreview,sprints:t.sprints,onClose:te[7]||(te[7]=()=>u(null,null)),"onUpdate:activity":b,onAddSubtask:D,onUpdateSubtask:M,onDeleteSubtask:L,onAddFiles:P,onRemoveFile:j,onAddComment:F,onUpdateComment:H,onRemoveComment:V,onToast:s,onCreateSprint:te[8]||(te[8]=le=>r("createSprint",le))},{default:i.withCtx(le=>[i.renderSlot(U.$slots,"activityDetailsBody",i.normalizeProps(i.guardReactiveProps(le)))]),_:3},8,["activity","activity-types","dev-statuses","milestone-id","template-activities","users","user-id","is-task-checkable","statuses","breadcrumbs","is-editable","attachment-enabled","projects","time-tracking-data","load-attachment-preview","sprints"])):i.createCommentVNode("",!0)]))])}}});const yhe={class:"ao-project-mapping"},_he={class:"ao-project-mapping-mapping__body"},Che={class:"ao-project-mapping-mapping__phases"},bhe={key:0,class:"ao-project-mapping-mapping__image-wrapper"},khe=["src","alt"],whe=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}=$n(),o=t,r=e,s=()=>{const{name:v,rank:_}=Zo(o.phases,"phase",n);r("addPhase",{name:v,rank:_,projectId:o.project.id})},a=()=>{const v=n("template.defaultName.phase",{idx:1}),_=ts(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?lt.LexoRank.parse(k.rank).genNext():lt.LexoRank.middle();r("saveTemplate",{templateName:v,rank:w.format(),phaseIds:_}),p.value=!1},g=Mr.useRouter(),y=i.ref("mapping"),C=[{label:"Overview",value:"overview"},{label:"Feed",value:"feed"},{label:"Dev",value:"dev"},{label:"Mapping",value:"mapping"}];return i.watch(y,v=>{v==="feed"?(g.push({name:Pe.feed}),console.log("Navigating to feed...")):v==="dev"?(g.push({name:Pe.dev}),console.log("Navigating to dev...")):v==="overview"?(g.push({name:Pe.project}),console.log("Navigating to feed...")):v==="mapping"&&(g.push({name:Pe.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",yhe,[i.createVNode(ns,null,{primary:i.withCtx(()=>[i.createVNode(hs,{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",_he,[i.createElementVNode("div",Che,[i.createVNode(cd,{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",bhe,[i.createElementVNode("img",{class:"architecture-image",src:t.project.architectureImage.url,alt:i.unref(n)("architectureImage.alt")},null,8,khe)])):i.createCommentVNode("",!0)])])],16),(i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[p.value?(i.openBlock(),i.createBlock(Rg,{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(Vg,{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 Uo={TEMPLATES:"templates",TEMPLATE_DETAILS:"template_details",TEMPLATES_LIST:"templates_list"},Ehe=(t,e={})=>[{path:t,name:Uo.TEMPLATES,redirect:{name:Uo.TEMPLATES_LIST},...e,children:[{path:"",name:Uo.TEMPLATES_LIST,component:zg},{path:":templateId/:phaseId?/:milestoneId?/:activityId?",name:Uo.TEMPLATE_DETAILS,component:Fg,props:!0}]}],Pe={project:"AoProject",feed:"AoProjectFeed",dev:"AoProjectDev",mapping:"AoProjectMapping",milestone:"AoMilestone",activity:"AoActivity"},Po={feed:"ActivityFeed",dev:"ActivityFeedDev"},She=(t,e={})=>[{path:t,...e,redirect:{name:Pe.project},children:[{path:"",name:Pe.project,component:ime,props:!0,children:[{path:":phaseId/:milestoneId",name:Pe.milestone,component:fp,props:!0},{path:":phaseId/:milestoneId/:activityId",name:Pe.activity,props:{default:!0,modal:!0},components:{default:fp,modal:Hme}}]},{path:"feed",name:Pe.feed,component:Kc,props:n=>({...n.params,feedMode:"standard"})},{path:"dev",name:Pe.dev,component:Kc,props:n=>({...n.params,feedMode:"dev"})},{path:"mapping",name:Pe.mapping,component:whe,props:!0}]}],xhe={class:"ao-templates"},zg=i.defineComponent({__name:"AoTemplatesList",props:{templates:{}},emits:["addTemplate","updateTemplates","updateItem","removeItem"],setup(t,{emit:e}){const{t:n}=$n(),o=t,r=e;i.watch(()=>o.templates,(u,d)=>{jn(u,d)});const s=()=>{var m,h;const u=(m=o.templates)==null?void 0:m.at(-1),d=u?lt.LexoRank.parse(u.rank).genNext():lt.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:qe.TEMPLATES,id:u,templateId:u,data:{name:d}})},l=(u,d)=>{r("removeItem",{itemType:qe.TEMPLATES,templateId:u,data:{id:u,...d?{name:d}:{}}})},c=u=>{if(u.moved){const d=es(u,o.templates??[]);r("updateItem",{itemType:qe.TEMPLATES,id:u.moved.element.id,templateId:u.moved.element.id,data:{rank:d}})}};return(u,d)=>(i.openBlock(),i.createElementBlock("div",xhe,[i.createVNode(ns,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(Co),{"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(q_,{id:f.id,title:f.name,phases:f.phases,milestones:(p=f.phases)!=null&&p.length?i.unref(p_)(f.phases):0,activities:f.phases?i.unref(m_)(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(Uo).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 The={class:"ao-field__label"},Ug=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",The,i.toDisplayString(t.label),1),i.renderSlot(e.$slots,"default")],2))}}),Ahe=["type","value","disabled","readonly"],Nhe=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(Ug,{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,Ahe)]),_:1},8,["label"]))}}),Dhe={class:"ao-field"},Mhe={class:"ao-field__label"},$he=["checked","disabled"],Bhe=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",Dhe,[i.createElementVNode("span",Mhe,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,$he)]))}});exports.AoAvatar=Jn;exports.AoCardFeed=ud;exports.AoCheckboxField=Bhe;exports.AoColorPicker=pl;exports.AoFeed=Kc;exports.AoField=Ug;exports.AoInputField=Nhe;exports.AoMultiselect=wt;exports.AoProjectPhases=cd;exports.AoTabBar=hs;exports.AoTemplateDetails=Fg;exports.AoTemplates=Jg;exports.AoTemplatesList=zg;exports.EstimationUnit=_p;exports.TemplateItemTypeEnum=yp;exports.activityFeedRoutes=Po;exports.activityFeedStatus=Sy;exports.durationTypes=Ey;exports.feedFilterTypes=Bo;exports.getProjectOverviewRoutes=She;exports.getTemplateRoutes=Ehe;exports.listUpdateTypes=xy;exports.milestoneStatus=Ii;exports.projectOverviewRoutes=Pe;exports.ruleComparators=hp;exports.ruleDurationUnits=vp;exports.ruleTriggerTypes=gp;exports.templateItemType=qe;exports.templateRouteNames=Uo;
|
package/dist/orcha.es.js
CHANGED
|
@@ -30829,17 +30829,18 @@ const l0e = { class: "ao-feed" }, c0e = { class: "ao-feed__filters" }, u0e = { c
|
|
|
30829
30829
|
placeholder: Z.$t("feed.filters.project.placeholder"),
|
|
30830
30830
|
"onUpdate:modelValue": ce[1] || (ce[1] = (_e) => _(ve(Uo).project, _e))
|
|
30831
30831
|
}, null, 8, ["model-value", "options", "placeholder"])),
|
|
30832
|
-
|
|
30832
|
+
t.feedMode === "dev" ? (x(), Y(Kt, {
|
|
30833
30833
|
key: 1,
|
|
30834
30834
|
"model-value": t.filters[ve(Uo).sprint],
|
|
30835
30835
|
mode: "tags",
|
|
30836
30836
|
options: C.value,
|
|
30837
30837
|
"close-on-select": !1,
|
|
30838
30838
|
searchable: !0,
|
|
30839
|
+
disabled: !C.value.length,
|
|
30839
30840
|
class: "ao-feed__filter ao-feed__filter__sprints",
|
|
30840
30841
|
placeholder: Z.$t("feed.filters.sprint.placeholder"),
|
|
30841
30842
|
"onUpdate:modelValue": ce[2] || (ce[2] = (_e) => _(ve(Uo).sprint, _e))
|
|
30842
|
-
}, null, 8, ["model-value", "options", "placeholder"])) : R("", !0),
|
|
30843
|
+
}, null, 8, ["model-value", "options", "disabled", "placeholder"])) : R("", !0),
|
|
30843
30844
|
w.value.length ? (x(), Y(Kt, {
|
|
30844
30845
|
key: 2,
|
|
30845
30846
|
"model-value": t.filters[ve(Uo).assignee],
|
package/dist/orcha.umd.js
CHANGED
|
@@ -56,4 +56,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
56
56
|
* vue-color-kit v1.0.6
|
|
57
57
|
* (c) 2023
|
|
58
58
|
* @license MIT
|
|
59
|
-
*/function ir(t){let e={r:0,g:0,b:0,a:1};/#/.test(t)?e=QT(t):/rgb/.test(t)?e=Sg(t):typeof t=="string"?e=Sg(`rgba(${t})`):Object.prototype.toString.call(t)==="[object Object]"&&(e=t);const{r:n,g:o,b:r,a:i}=e,{h:s,s:l,v:c}=eA(e);return{r:n,g:o,b:r,a:i===void 0?1:i,h:s,s:l,v:c}}function Gd(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 Kd(t,e,n,o,r,i){const s=t==="l",l=e.createLinearGradient(0,0,s?n:0,s?0:o);l.addColorStop(.01,r),l.addColorStop(.99,i),e.fillStyle=l,e.fillRect(0,0,n,o)}function XT({r:t,g:e,b:n},o){const r=s=>("0"+Number(s).toString(16)).slice(-2),i=`#${r(t)}${r(e)}${r(n)}`;return o?i.toUpperCase():i}function QT(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 Sg(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 eA({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),i=o-r;let s=0;o===r?s=0:o===t?e>=n?s=60*(e-n)/i:s=60*(e-n)/i+360:o===e?s=60*(n-t)/i+120:o===n&&(s=60*(t-e)/i+240),s=Math.floor(s);let l=parseFloat((o===0?0:1-r/o).toFixed(2)),c=parseFloat(o.toFixed(2));return{h:s,s:l,v:c}}var Yd=a.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),Kd("l",n,e,e,"#FFFFFF","rgba(255,255,255,0)"),Kd("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=s=>{let l=s.clientX-n,c=s.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 d=o.getImageData(Math.min(l,this.size-1),Math.min(c,this.size-1),1,1),[u,p,f]=d.data;this.$emit("selectSaturation",{r:u,g:p,b:f})};r(t);const i=()=>{document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",i)};document.addEventListener("mousemove",r),document.addEventListener("mouseup",i)}}});const tA={ref:"canvasSaturation"};function nA(t,e,n,o,r,i){return a.openBlock(),a.createBlock("div",{class:"saturation",onMousedown:e[1]||(e[1]=a.withModifiers((...s)=>t.selectSaturation&&t.selectSaturation(...s),["prevent","stop"]))},[a.createVNode("canvas",tA,null,512),a.createVNode("div",{style:t.slideSaturationStyle,class:"slide"},null,4)],32)}Yd.render=nA,Yd.__file="src/color/Saturation.vue";var Jd=a.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=i=>{let s=i.clientY-e;s<0&&(s=0),s>this.height&&(s=this.height),this.slideHueStyle={top:s-2+"px"};const l=n.getImageData(0,Math.min(s,this.height-1),1,1),[c,d,u]=l.data;this.$emit("selectHue",{r:c,g:d,b:u})};o(t);const r=()=>{document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",r)};document.addEventListener("mousemove",o),document.addEventListener("mouseup",r)}}});const oA={ref:"canvasHue"};function rA(t,e,n,o,r,i){return a.openBlock(),a.createBlock("div",{class:"hue",onMousedown:e[1]||(e[1]=a.withModifiers((...s)=>t.selectHue&&t.selectHue(...s),["prevent","stop"]))},[a.createVNode("canvas",oA,null,512),a.createVNode("div",{style:t.slideHueStyle,class:"slide"},null,4)],32)}Jd.render=rA,Jd.__file="src/color/Hue.vue";var Xd=a.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=Gd(o),i=t.getContext("2d");t.width=e,t.height=n,i.fillStyle=i.createPattern(r,"repeat"),i.fillRect(0,0,e,n),Kd("p",i,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 i=r.clientY-e;i<0&&(i=0),i>this.height&&(i=this.height);let s=parseFloat((i/this.height).toFixed(2));this.$emit("selectAlpha",s)};n(t);const o=()=>{document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",o)};document.addEventListener("mousemove",n),document.addEventListener("mouseup",o)}}});const aA={ref:"canvasAlpha"};function iA(t,e,n,o,r,i){return a.openBlock(),a.createBlock("div",{class:"color-alpha",onMousedown:e[1]||(e[1]=a.withModifiers((...s)=>t.selectAlpha&&t.selectAlpha(...s),["prevent","stop"]))},[a.createVNode("canvas",aA,null,512),a.createVNode("div",{style:t.slideAlphaStyle,class:"slide"},null,4)],32)}Xd.render=iA,Xd.__file="src/color/Alpha.vue";var Qd=a.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=Gd(o),i=t.getContext("2d");t.width=e,t.height=n,i.fillStyle=i.createPattern(r,"repeat"),i.fillRect(0,0,e,n),i.fillStyle=this.color,i.fillRect(0,0,e,n)}}});function sA(t,e,n,o,r,i){return a.openBlock(),a.createBlock("canvas")}Qd.render=sA,Qd.__file="src/color/Preview.vue";var eu=a.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:i,height:s}=this.suckerCanvas.getBoundingClientRect(),l=e-r,c=n-o,u=this.suckerCanvas.getContext("2d").getImageData(Math.min(l,i-1),Math.min(c,s-1),1,1);let[p,f,m,h]=u.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(${p}, ${f}, ${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:i,width:s,height:l}=t.getBoundingClientRect(),c=n-i,d=o-r,p=t.getContext("2d").getImageData(Math.min(c,s-1),Math.min(d,l-1),1,1);let[f,m,h,g]=p.data;g=parseFloat((g/255).toFixed(2)),this.$emit("selectSucker",{r:f,g:m,b:h,a:g})}))}}});const lA=a.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),cA={key:1,class:"sucker",viewBox:"-16 -16 68 68",xmlns:"http://www.w3.org/2000/svg",stroke:"#9099a4"},dA=a.createVNode("g",{fill:"none","fill-rule":"evenodd"},[a.createVNode("g",{transform:"translate(1 1)","stroke-width":"4"},[a.createVNode("circle",{"stroke-opacity":".5",cx:"18",cy:"18",r:"18"}),a.createVNode("path",{d:"M36 18c0-9.94-8.06-18-18-18"},[a.createVNode("animateTransform",{attributeName:"transform",type:"rotate",from:"0 18 18",to:"360 18 18",dur:"1s",repeatCount:"indefinite"})])])],-1);function uA(t,e,n,o,r,i){return a.openBlock(),a.createBlock("div",null,[t.isSucking?a.createCommentVNode("v-if",!0):(a.openBlock(),a.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]=(...s)=>t.openSucker&&t.openSucker(...s))},[lA],2)),t.isSucking?(a.openBlock(),a.createBlock("svg",cA,[dA])):a.createCommentVNode("v-if",!0)])}eu.render=uA,eu.__file="src/color/Sucker.vue";var tu=a.defineComponent({props:{name:{type:String,default:""},color:{type:String,default:""}},emits:["inputColor","inputFocus","inputBlur"],setup(t,{emit:e}){return{modelColor:a.computed({get(){return t.color||""},set(i){e("inputColor",i)}}),handleFocus:i=>{e("inputFocus",i)},handleBlur:i=>{e("inputBlur",i)}}}});const pA={class:"color-type"},fA={class:"name"};function mA(t,e,n,o,r,i){return a.openBlock(),a.createBlock("div",pA,[a.createVNode("span",fA,a.toDisplayString(t.name),1),a.withDirectives(a.createVNode("input",{"onUpdate:modelValue":e[1]||(e[1]=s=>t.modelColor=s),class:"value",onFocus:e[2]||(e[2]=(...s)=>t.handleFocus&&t.handleFocus(...s)),onBlur:e[3]||(e[3]=(...s)=>t.handleBlur&&t.handleBlur(...s))},null,544),[[a.vModelText,t.modelColor]])])}tu.render=mA,tu.__file="src/color/Box.vue";var nu=a.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=a.ref(),o=a.ref([]),r=a.ref();t.colorsHistoryKey&&localStorage&&(o.value=JSON.parse(localStorage.getItem(t.colorsHistoryKey))||[]),r.value=Gd(4).toDataURL(),a.onUnmounted(()=>{i(n.value)});function i(l){if(!l)return;const c=o.value||[],d=c.indexOf(l);d>=0&&c.splice(d,1),c.length>=8&&(c.length=7),c.unshift(l),o.value=c||[],localStorage&&t.colorsHistoryKey&&localStorage.setItem(t.colorsHistoryKey,JSON.stringify(c))}function s(l){e("selectColor",l)}return{setColorsHistory:i,colorsHistory:o,color:n,imgAlphaBase64:r,selectColor:s}}});const hA={class:"colors"},gA={key:0,class:"colors history"};function bA(t,e,n,o,r,i){return a.openBlock(),a.createBlock("div",null,[a.createVNode("ul",hA,[(a.openBlock(!0),a.createBlock(a.Fragment,null,a.renderList(t.colorsDefault,s=>(a.openBlock(),a.createBlock("li",{key:s,class:"item",onClick:l=>t.selectColor(s)},[a.createVNode("div",{style:{background:`url(${t.imgAlphaBase64})`},class:"alpha"},null,4),a.createVNode("div",{style:{background:s},class:"color"},null,4)],8,["onClick"]))),128))]),t.colorsHistory.length?(a.openBlock(),a.createBlock("ul",gA,[(a.openBlock(!0),a.createBlock(a.Fragment,null,a.renderList(t.colorsHistory,s=>(a.openBlock(),a.createBlock("li",{key:s,class:"item",onClick:l=>t.selectColor(s)},[a.createVNode("div",{style:{background:`url(${t.imgAlphaBase64})`},class:"alpha"},null,4),a.createVNode("div",{style:{background:s},class:"color"},null,4)],8,["onClick"]))),128))])):a.createCommentVNode("v-if",!0)])}nu.render=bA,nu.__file="src/color/Colors.vue";var Yr=a.defineComponent({components:{Saturation:Yd,Hue:Jd,Alpha:Xd,Preview:Qd,Sucker:eu,Box:tu,Colors:nu},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 XT(this.rgba,!0)}},created(){Object.assign(this,ir(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:i,v:s}=ir(t);Object.assign(this,{r:e,g:n,b:o,h:r,s:i,v:s}),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:i,v:s}=ir(t);Object.assign(this,{r:e,g:n,b:o,h:r,s:i,v:s}),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:i,s,v:l}=ir(t);Object.assign(this,{r:e,g:n,b:o,a:r,h:i,s,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:i,s,v:l}=ir(t);Object.assign(this,{r:e,g:n,b:o,a:r,h:i,s,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:i,s,v:l}=ir(t);Object.assign(this,{r:e,g:n,b:o,a:r,h:i,s,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:i,s,v:l}=ir(t);Object.assign(this,{r:e,g:n,b:o,a:r,h:i,s,v:l}),this.setText(),this.$nextTick(()=>{this.$refs.saturation.renderColor(),this.$refs.saturation.renderSlide(),this.$refs.hue.renderSlide()})}}});const vA={class:"color-set"};function yA(t,e,n,o,r,i){const s=a.resolveComponent("Saturation"),l=a.resolveComponent("Hue"),c=a.resolveComponent("Alpha"),d=a.resolveComponent("Preview"),u=a.resolveComponent("Sucker"),p=a.resolveComponent("Box"),f=a.resolveComponent("Colors");return a.openBlock(),a.createBlock("div",{class:["hu-color-picker",{light:t.isLightTheme}],style:{width:t.totalWidth+"px"}},[a.createVNode("div",vA,[a.createVNode(s,{ref:"saturation",color:t.rgbString,hsv:t.hsv,size:t.hueHeight,onSelectSaturation:t.selectSaturation},null,8,["color","hsv","size","onSelectSaturation"]),a.createVNode(l,{ref:"hue",hsv:t.hsv,width:t.hueWidth,height:t.hueHeight,onSelectHue:t.selectHue},null,8,["hsv","width","height","onSelectHue"]),a.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"])]),a.createVNode("div",{style:{height:t.previewHeight+"px"},class:"color-show"},[a.createVNode(d,{color:t.rgbaString,width:t.previewWidth,height:t.previewHeight},null,8,["color","width","height"]),t.suckerHide?a.createCommentVNode("v-if",!0):(a.openBlock(),a.createBlock(u,{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),a.createVNode(p,{name:"HEX",color:t.modelHex,onInputColor:t.inputHex,onInputFocus:t.handleFocus,onInputBlur:t.handleBlur},null,8,["color","onInputColor","onInputFocus","onInputBlur"]),a.createVNode(p,{name:"RGBA",color:t.modelRgba,onInputColor:t.inputRgba,onInputFocus:t.handleFocus,onInputBlur:t.handleBlur},null,8,["color","onInputColor","onInputFocus","onInputBlur"]),a.createVNode(f,{color:t.rgbaString,"colors-default":t.colorsDefault,"colors-history-key":t.colorsHistoryKey,onSelectColor:t.selectColor},null,8,["color","colors-default","colors-history-key","onSelectColor"]),a.createCommentVNode(" custom options "),a.renderSlot(t.$slots,"default")],6)}Yr.render=yA,Yr.__file="src/color/ColorPicker.vue",Yr.install=t=>{t.component(Yr.name,Yr)};const hge="",_A={class:"color-picker-wrapper"},al=a.defineComponent({__name:"AoColorPicker",props:{color:{}},emits:["update:color"],setup(t,{emit:e}){const n=t,o=e,r=a.ref(!1),i=a.ref(null),s=a.ref(null),l=a.ref(0),c=a.ref(0),d=async h=>{s.value=h,r.value=!0,await a.nextTick();const g=h.getBoundingClientRect(),v=i.value,_=(v==null?void 0:v.offsetHeight)||300,b=window.innerHeight-g.bottom,y=g.top,w=b<_&&y>_;console.log("pickerHeight = "+_),l.value=w?g.top-_-8:g.bottom+8,c.value=g.left,setTimeout(()=>{window.addEventListener("click",p)},0)},u=a.computed(()=>({position:"fixed",top:`${l.value}px`,left:`${c.value}px`,zIndex:1e3})),p=h=>{const g=h.target;i.value&&!i.value.contains(g)&&(r.value=!1,o("update:color",f.value),window.removeEventListener("click",p))};a.onBeforeUnmount(()=>{window.removeEventListener("click",p)}),a.watch(()=>n.color,h=>{r.value||(f.value=h)});const f=a.ref(n.color),m=h=>{const{r:g,g:v,b:_,a:b}=h.rgba;f.value=`rgba(${g}, ${v}, ${_}, ${b})`};return(h,g)=>(a.openBlock(),a.createElementBlock("div",_A,[a.renderSlot(h.$slots,"clickable",{openPicker:d,bgColor:t.color}),r.value?(a.openBlock(),a.createElementBlock("div",{key:0,ref_key:"pickerRef",ref:i,class:"color-picker",style:a.normalizeStyle(u.value)},[a.createVNode(a.unref(Yr),{class:"color-picker-box",theme:"light",color:t.color,onChangeColor:m},null,8,["color"])],4)):a.createCommentVNode("",!0)]))}}),gge="",CA={class:"ao-card-project-phase__header"},wA={class:"ao-card-project-item__title-line"},kA={key:0,class:"ao-card-project-item-phase__estimation"},xA={class:"ao-card-project-phase__footer"},EA={key:0,class:"ao-card-project-phase__footer-row ao-card-project-phase__footer-row--progress"},SA={class:"ao-card-project-phase__subitem"},TA={class:"ao-card-project-phase__subitem"},AA={key:0,class:"ao-card-project-phase__secondary"},NA={class:"ao-card-project-phase__deadline ao-card-project-phase__deadline--readonly"},DA=a.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)},i=a.computed(()=>{var g;return((g=n.milestones)==null?void 0:g.reduce((v,_)=>{var b;return v+((b=_.activities)==null?void 0:b.reduce((y,w)=>y+(w.estimation||0),0))},0))||0}),s=a.computed(()=>!n.milestones||!n.timeTrackingData?0:n.milestones.reduce((g,v)=>{var _;return g+(((_=v.activities)==null?void 0:_.reduce((b,y)=>{var k;const w=(k=n.timeTrackingData)==null?void 0:k[y.id];return b+((w==null?void 0:w.timeSpent)||0)},0))||0)},0)),l=a.computed(()=>n.estimationUnit==="days"?"d":"h"),c=a.computed(()=>Ai(s.value,n.estimationUnit)),d=a.computed(()=>{var g;return(g=n.milestones)==null?void 0:g.length}),u=a.computed(()=>{var g;return(g=n.milestones)==null?void 0:g.filter(v=>v.status===na.done).length}),p=a.computed(()=>(u.value||0)/(d.value||1)),f=a.computed({get:()=>n.deadline??"",set:g=>o("update:deadline",g!=null&&g.length?g:null)}),m=a.computed({get:()=>n.color,set:g=>{o("updatePhase",{id:n.id,color:g})}}),h=(g,v)=>{const _=g.target;_.closest("button")||_.closest("input")||_.closest(".ao-title")||v(_)};return(g,v)=>(a.openBlock(),a.createBlock(al,{color:m.value,"onUpdate:color":v[2]||(v[2]=_=>m.value=_)},{clickable:a.withCtx(({openPicker:_,bgColor:b})=>[a.createVNode(ol,{class:"ao-card-project-phase","is-clickable":t.isEditable,color:b,"with-left-border":!0,onClick:y=>h(y,_)},a.createSlots({default:a.withCtx(()=>[a.createElementVNode("div",wA,[a.createVNode(bt,{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"]),i.value||s.value?(a.openBlock(),a.createElementBlock("span",kA," ("+a.toDisplayString(c.value)+"/"+a.toDisplayString(i.value)+a.toDisplayString(l.value)+")",1)):a.createCommentVNode("",!0)])]),footer:a.withCtx(()=>[a.createElementVNode("div",xA,[d.value?(a.openBlock(),a.createElementBlock("div",EA,[a.createElementVNode("div",SA,[a.createVNode(Ce,{name:"MountainFlagOutlineRounded",size:"sm"}),a.createElementVNode("span",TA,a.toDisplayString(u.value)+" / "+a.toDisplayString(d.value),1)]),a.createVNode(rl,{percentages:p.value,class:"ao-card-project-phase__progress",color:t.color},null,8,["percentages","color"]),g.$slots.secondary?(a.openBlock(),a.createElementBlock("div",AA,[a.renderSlot(g.$slots,"secondary")])):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0),a.createElementVNode("div",{class:a.normalizeClass(["ao-card-project-phase__footer-row",f.value?"":"ao-card-project-phase__no_deadline"])},[t.isEditable?a.withDirectives((a.openBlock(),a.createElementBlock("input",{key:0,"onUpdate:modelValue":v[1]||(v[1]=y=>f.value=y),class:"ao-card-project-phase__deadline ao-card-project-phase__deadline--input",type:"date"},null,512)),[[a.vModelText,f.value,void 0,{lazy:!0}]]):a.createCommentVNode("",!0),a.createElementVNode("span",NA,a.toDisplayString(a.unref(Ni)(t.deadline)),1)],2)])]),_:2},[t.isEditable?{name:"header",fn:a.withCtx(()=>[a.createElementVNode("div",CA,[a.createVNode(fe,{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:v[0]||(v[0]=a.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"]))}}),bge="",BA=a.defineComponent({__name:"AoBadge",props:{color:{}},setup(t){return(e,n)=>(a.openBlock(),a.createElementBlock("span",{class:"aoBadge",style:a.normalizeStyle({backgroundColor:t.color})},null,4))}}),vge="",$A={class:"ao-card-project-milestone__default"},MA={class:"ao-title-with-badge-wrapper"},LA={class:"ao-card-project-item__title-line"},OA={key:0,class:"ao-card-project-item-milestone__estimation"},IA={key:0,class:"ao-card-project-milestone__archive"},VA={class:"ao-card-project-milestone__activities"},PA={class:"ao-card-project-milestone__activities-row"},RA={class:"ao-card-project-milestone__subitem"},FA={class:"ao-card-project-milestone__subitem"},zA={key:1,class:"ao-card-project-milestone__secondary"},qA={class:"ao-card-project-milestone__footer"},jA={key:1,class:"ao-field ao-card-project-milestone__deadline"},UA={class:"ao-field__label"},HA={key:2,class:"ao-card-project-milestone__assignee"},WA=a.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=a.computed(()=>{var f;return((f=n.activities)==null?void 0:f.reduce((m,h)=>m+(h.estimation||0),0))||0}),i=a.computed(()=>!n.activities||!n.timeTrackingData?0:n.activities.reduce((f,m)=>{var g;const h=(g=n.timeTrackingData)==null?void 0:g[m.id];return f+((h==null?void 0:h.timeSpent)||0)},0)),s=a.computed(()=>n.estimationUnit==="days"?"d":"h"),l=a.computed(()=>Ai(i.value,n.estimationUnit));a.computed(()=>{const f=i.value/60;return f%1===0?f.toString():f.toFixed(2)});const c=a.computed(()=>{var f;return(f=n.activities)==null?void 0:f.length}),d=a.computed(()=>{var f;return(f=n.activities)==null?void 0:f.filter(m=>_l(m,n.closedStatus)).length}),u=a.computed(()=>(d.value||0)/(c.value||1)),p=f=>{o("updateMilestone",{id:n.id,name:f})};return(f,m)=>(a.openBlock(),a.createBlock(ol,{class:a.normalizeClass(["ao-card-project-milestone"]),"is-clickable":!t.readonly,"tag-name":"li","is-selected":t.isSelected,color:t.phaseColor},{default:a.withCtx(()=>[a.createElementVNode("div",$A,[a.createElementVNode("div",MA,[a.createVNode(BA,{color:t.color||""},null,8,["color"]),a.createElementVNode("div",LA,[a.createVNode(bt,{id:t.id,title:t.name||"",level:5,"is-editable":!t.readonly&&t.isEditable,class:"ao-card-project-milestone__title","onUpdate:title":p},null,8,["id","title","is-editable"]),r.value||i.value?(a.openBlock(),a.createElementBlock("span",OA," ("+a.toDisplayString(l.value)+"/"+a.toDisplayString(r.value)+a.toDisplayString(s.value)+")",1)):a.createCommentVNode("",!0)])]),!t.readonly&&t.isEditable?(a.openBlock(),a.createElementBlock("div",IA,[a.createVNode(fe,{color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:t.active?f.$t("archive"):f.$t("unarchive"),onClick:m[0]||(m[0]=a.withModifiers(()=>t.active?f.$emit("archiveMilestone",{id:t.id}):f.$emit("unarchiveMilestone",{id:t.id}),["stop"]))},null,8,["label"])])):a.createCommentVNode("",!0)]),a.createElementVNode("div",VA,[a.createElementVNode("div",PA,[c.value?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createElementVNode("div",RA,[a.createVNode(Ce,{name:"SelectCheckBox",size:"sm"}),a.createElementVNode("span",FA,a.toDisplayString(d.value)+" / "+a.toDisplayString(c.value),1)]),a.createVNode(rl,{percentages:u.value,color:t.phaseColor,class:"ao-card-project-milestone__progress"},null,8,["percentages","color"])],64)):a.createCommentVNode("",!0),f.$slots.secondary?(a.openBlock(),a.createElementBlock("div",zA,[a.renderSlot(f.$slots,"secondary")])):a.createCommentVNode("",!0)])])]),footer:a.withCtx(()=>[a.createElementVNode("div",qA,[t.important?(a.openBlock(),a.createBlock(Ce,{key:0,name:"FlagRounded",class:a.normalizeClass(t.isSelected?"ao-card-project-milestone__important--selected":"ao-card-project-milestone__important"),size:"sm"},null,8,["class"])):a.createCommentVNode("",!0),t.deadline?(a.openBlock(),a.createElementBlock("label",jA,[a.createElementVNode("span",UA,a.toDisplayString(a.unref(Ni)(t.deadline)),1)])):a.createCommentVNode("",!0),t.assignee?(a.openBlock(),a.createElementBlock("div",HA,[a.createVNode(Pn,{"user-name":a.unref(zu)(t.assignee),"avatar-url":t.assignee.avatarUrl,color:t.isSelected?"black":"primary",size:"sm"},null,8,["user-name","avatar-url","color"])])):a.createCommentVNode("",!0)])]),_:3},8,["is-clickable","is-selected","color"]))}}),yge="",ZA={class:"ao-mapping-card-project-phase__header"},GA={class:"ao-card-project-item__title-line"},KA={key:0,class:"ao-card-project-item-phase__estimation"},YA={class:"ao-mapping-card-project-phase__footer"},JA={key:0,class:"ao-mapping-card-project-phase__footer-row ao-mapping-card-project-phase__footer-row--progress"},XA={class:"ao-mapping-card-project-phase__subitem"},QA={class:"ao-mapping-card-project-phase__subitem"},eN={key:0,class:"ao-mapping-card-project-phase__secondary"},tN={class:"ao-mapping-card-project-phase__deadline ao-mapping-card-project-phase__deadline--readonly"},nN=a.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)},i=a.computed(()=>{var g;return((g=n.milestones)==null?void 0:g.reduce((v,_)=>{var b;return v+((b=_.activities)==null?void 0:b.reduce((y,w)=>y+(w.estimation||0),0))},0))||0}),s=a.computed(()=>!n.milestones||!n.timeTrackingData?0:n.milestones.reduce((g,v)=>{var _;return g+(((_=v.activities)==null?void 0:_.reduce((b,y)=>{var k;const w=(k=n.timeTrackingData)==null?void 0:k[y.id];return b+((w==null?void 0:w.timeSpent)||0)},0))||0)},0)),l=a.computed(()=>n.estimationUnit==="days"?"d":"h"),c=a.computed(()=>Ai(s.value,n.estimationUnit)),d=a.computed(()=>{var g;return(g=n.milestones)==null?void 0:g.length}),u=a.computed(()=>{var g;return(g=n.milestones)==null?void 0:g.filter(v=>v.status===na.done).length}),p=a.computed(()=>(u.value||0)/(d.value||1)),f=a.computed({get:()=>n.deadline??"",set:g=>o("update:deadline",g!=null&&g.length?g:null)}),m=a.computed({get:()=>n.color,set:g=>{o("updatePhase",{id:n.id,color:g})}}),h=(g,v)=>{const _=g.target;_.closest("button")||_.closest("input")||_.closest(".ao-title")||v()};return(g,v)=>(a.openBlock(),a.createBlock(al,{color:m.value,"onUpdate:color":v[2]||(v[2]=_=>m.value=_)},{clickable:a.withCtx(({openPicker:_,bgColor:b})=>[a.createVNode(ol,{class:"ao-mapping-card-project-phase","is-clickable":t.isEditable,color:b,"with-left-border":!0,onClick:y=>h(y,_)},a.createSlots({default:a.withCtx(()=>[a.createElementVNode("div",GA,[a.createVNode(bt,{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"]),i.value||s.value?(a.openBlock(),a.createElementBlock("span",KA," ("+a.toDisplayString(c.value)+"/"+a.toDisplayString(i.value)+a.toDisplayString(l.value)+")",1)):a.createCommentVNode("",!0)])]),footer:a.withCtx(()=>[a.createElementVNode("div",YA,[d.value?(a.openBlock(),a.createElementBlock("div",JA,[a.createElementVNode("div",XA,[a.createVNode(Ce,{name:"MountainFlagOutlineRounded",size:"sm"}),a.createElementVNode("span",QA,a.toDisplayString(u.value)+" / "+a.toDisplayString(d.value),1)]),a.createVNode(rl,{percentages:p.value,class:"ao-mapping-card-project-phase__progress",color:m.value},null,8,["percentages","color"]),g.$slots.secondary?(a.openBlock(),a.createElementBlock("div",eN,[a.renderSlot(g.$slots,"secondary")])):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0),a.createElementVNode("div",{class:a.normalizeClass(["ao-mapping-card-project-phase__footer-row",f.value?"":"ao-mapping-card-project-phase__no_deadline"])},[t.isEditable?a.withDirectives((a.openBlock(),a.createElementBlock("input",{key:0,"onUpdate:modelValue":v[1]||(v[1]=y=>f.value=y),class:"ao-mapping-card-project-phase__deadline ao-mapping-card-project-phase__deadline--input",type:"date"},null,512)),[[a.vModelText,f.value,void 0,{lazy:!0}]]):a.createCommentVNode("",!0),a.createElementVNode("span",tN,a.toDisplayString(a.unref(Ni)(t.deadline)),1)],2)])]),_:2},[t.isEditable?{name:"header",fn:a.withCtx(()=>[a.createElementVNode("div",ZA,[a.createVNode(fe,{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:v[0]||(v[0]=a.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"]))}}),_ge="",oN={class:"ao-project-phase"},rN={key:0,class:"ao-project-phase__drag ao-card__drag"},aN={key:1,class:"ao-project-phase__col-phase"},iN={key:2,class:"ao-mapping-project-phase__col-phase"},sN={key:0,class:"ao-project-phase__col-milestones"},lN=["title"],cN={class:"ao-project-phase__milestones-list-footer"},dN=a.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}=kn(),o=t,r=e;a.watch(()=>o.phase.milestones,(k,C)=>{jn(k,C)});const i=k=>{r("updatePhase",{id:o.phase.id,name:k})},s=k=>{r("updatePhase",{id:o.phase.id,deadline:k})},l=k=>{r("updatePhase",k)},c=a.computed(()=>o.phase.milestones.map(k=>i5(k,o.closedStatus))),d=k=>{const{name:C,rank:x}=ar(c.value??[],"milestone",n);r("addMilestone",{name:C,rank:x,phaseId:k})},u=k=>{const C=n("template.defaultName.milestone",{idx:1}),x=ha(c.value??[]);r("addMilestone",{name:C,rank:x,phaseId:k})},p=k=>{r("updateMilestone",k)},f=k=>{r("archiveMilestone",k)},m=k=>{r("unarchiveMilestone",k)},h=k=>{r("archivePhase",k)},g=k=>{r("unarchivePhase",k)},v=k=>{"added"in k?r("updateMilestone",{id:k.added.element.id,phaseId:o.phase.id,rank:mr(c.value,k.added.newIndex)}):"removed"in k||"moved"in k&&r("updateMilestone",{id:k.moved.element.id,rank:mr(c.value,k.moved.newIndex)})},_=Ct.useRoute(),b=a.computed(()=>_.path.includes("/mapping")),y=a.computed(()=>{var k;return o.phase.id===((k=_.params)==null?void 0:k.phaseId)});a.ref(!1);const w=a.computed(()=>{var k;return o.phase.id!==((k=_.params)==null?void 0:k.phaseId)?{backgroundColor:"var(--ao-color-sheet)"}:o.phase.color?{backgroundColor:l5(o.phase.color)}:{backgroundColor:"var(--ao-color-primary-lightest)"}});return(k,C)=>(a.openBlock(),a.createElementBlock("li",oN,[a.createElementVNode("div",{class:"ao-project-phases__draggable-card",style:a.normalizeStyle(w.value)},[t.isEditable?(a.openBlock(),a.createElementBlock("div",rN,[a.createVNode(Ce,{name:"DragIndicator",class:"ao-project-phase__drag-handle"})])):a.createCommentVNode("",!0),b.value?(a.openBlock(),a.createElementBlock("div",iN,[a.createVNode(nN,{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":s,"onUpdate:title":i,onArchivePhase:h,onUnarchivePhase:g,onUpdatePhase:l},null,8,["id","milestones","name","deadline","active","is-editable","color","estimation-unit"])])):(a.openBlock(),a.createElementBlock("div",aN,[a.createVNode(DA,{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":s,"onUpdate:title":i,onArchivePhase:h,onUnarchivePhase:g,onUpdatePhase:l},null,8,["id","milestones","name","deadline","active","is-editable","color","time-tracking-data","estimation-unit"])]))],4),b.value?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("div",sN,[a.createElementVNode("div",{class:"ao-project-phase__milestones ao-project-phase__milestones--hoverable",style:a.normalizeStyle(w.value)},[t.isEditable?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(["ao-project-phase__milestone-quick-add",{"ao-project-phase__milestone-quick-add--visible":y.value}]),title:k.$t("project.milestone.add"),onClick:C[0]||(C[0]=()=>u(t.phase.id))},[a.createVNode(Ce,{name:"Add",class:"ao-project-phase__milestone-quick-add-icon"})],10,lN)):a.createCommentVNode("",!0),a.createVNode(a.unref(no),a.mergeProps({class:"ao-project-phase__milestones-list",list:c.value,disabled:t.readonly||!t.isEditable,"item-key":"id",group:"kanban"},k.$attrs,{onChange:v}),{item:a.withCtx(({element:x})=>{var T;return[a.createVNode(WA,{id:x.id,name:x.name,color:x.color,"phase-color":t.phase.color,activities:x.activities,deadline:x.deadline,active:x.active,"is-editable":!t.readonly&&t.isEditable,"is-draggable":!t.readonly&&t.isEditable,"closed-status":t.closedStatus,"is-selected":x.id===((T=k.$route.params)==null?void 0:T.milestoneId),assignee:x.assignee,important:x.important,readonly:t.readonly,"time-tracking-data":t.timeTrackingData,"estimation-unit":t.estimationUnit,class:a.normalizeClass(["ao-project-phase__milestone"]),onClick:S=>!t.readonly&&k.$router.push({name:a.unref(Pe).milestone,params:{phaseId:t.phase.id,milestoneId:x.id}}),onUpdateMilestone:p,onArchiveMilestone:f,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"]),a.createElementVNode("div",cN,[t.isEditable?(a.openBlock(),a.createBlock(ro,{key:0,label:k.$t("project.milestone.add"),class:"ao-project-phase__milestone-add","icon-name":"Add",onClick:C[1]||(C[1]=()=>d(t.phase.id))},null,8,["label"])):a.createCommentVNode("",!0)])],4)]))]))}}),Cge="",uN={class:"ao-project__phases"},pN={key:0,class:"ao-project-phase__phases-list-footer"},fN={class:"ao-project-phase__col-phase"},ou=a.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;a.watch(()=>n.phases,(m,h)=>{jn(m,h)});const r=m=>{o("addMilestone",m)},i=m=>{o("updateMilestone",m)},s=m=>{o("archiveMilestone",m)},l=m=>{o("unarchiveMilestone",m)},c=m=>{o("archivePhase",m)},d=m=>{o("unarchivePhase",m)},u=m=>{if(m.moved){const h=ma(m,n.phases??[]);o("updatePhase",{id:m.moved.element.id,rank:h})}},p=m=>{o("updatePhase",m)},f=m=>{o("addPhase",m)};return(m,h)=>(a.openBlock(),a.createElementBlock("div",uN,[a.createVNode(a.unref(no),{class:"ao-project-phase__phases-list","model-value":t.phases,"item-key":"id",handle:".ao-card__drag",onChange:u},{item:a.withCtx(({element:g})=>[a.createVNode(dN,{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:i,onArchiveMilestone:s,onUnarchiveMilestone:l,onUpdatePhase:p,onArchivePhase:c,onUnarchivePhase:d},null,8,["phase","is-editable","closed-status","users","readonly","time-tracking-data","estimation-unit"])]),_:1},8,["model-value"]),t.isEditable?(a.openBlock(),a.createElementBlock("div",pN,[h[0]||(h[0]=a.createElementVNode("div",{class:"ao-project-phase__empty_drag"},null,-1)),a.createElementVNode("div",fN,[a.createVNode(ro,{label:m.$t("project.phases.add"),"icon-name":"Add",class:"ao-project-phase__add-phase",onClick:f},null,8,["label"])]),h[1]||(h[1]=a.createElementVNode("div",{class:"ao-project-phase__col-milestones"},null,-1))])):a.createCommentVNode("",!0)]))}}),wge="",mN={class:"ao-add-template-modal__form-body"},hN={class:"field__row"},gN={class:"ao-add-template-modal__form-footer"},Tg=a.defineComponent({__name:"AoAddTemplateModal",props:{projectId:{},templates:{}},emits:["apply"],setup(t,{emit:e}){const n=t,o=e,r=a.computed(()=>n.templates.map(c=>({value:c.id,label:c.name}))),i=a.ref(null),s=c=>{i.value=c},l=()=>{i.value&&o("apply",i.value,n.projectId)};return(c,d)=>(a.openBlock(),a.createBlock(Di,{size:"sm"},{header:a.withCtx(()=>[a.createVNode(bt,{title:c.$t("project.template.apply.title"),level:3},null,8,["title"])]),default:a.withCtx(()=>[a.createElementVNode("form",{class:"ao-add-template-modal__form",onSubmit:a.withModifiers(l,["prevent"])},[a.createElementVNode("p",null,a.toDisplayString(c.$t("project.template.apply.notice")),1),a.createElementVNode("div",mN,[a.createElementVNode("div",hN,[a.createVNode(kt,{value:i.value,options:r.value,detached:!0,onChange:s},null,8,["value","options"])])]),a.createElementVNode("footer",gN,[a.createVNode(fe,{label:c.$t("project.template.apply.label"),type:"submit",color:"primary",variant:"solid",onClick:l},null,8,["label"])])],32)]),_:1}))}}),kge="",bN={class:"ao-save-template-modal__form-body"},vN={class:"field__row"},yN={class:"ao-field ao-field--inline"},_N={class:"ao-field__label"},CN={class:"ao-save-template-modal__phases"},wN={class:"ao-field__label"},kN={class:"ao-save-template-modal__phases-list"},xN=["value"],EN={class:"ao-save-template-modal__form-footer"},Ag=a.defineComponent({__name:"AoSaveTemplateModal",props:{phases:{}},emits:["save"],setup(t,{emit:e}){const n=t,o=e,r=a.ref(""),i=a.ref([]);a.onMounted(()=>{i.value=n.phases.map(l=>l.id)});const s=()=>{r.value&&o("save",r.value,i.value)};return(l,c)=>(a.openBlock(),a.createBlock(Di,{size:"sm"},{header:a.withCtx(()=>[a.createVNode(bt,{title:l.$t("project.template.save.title"),level:3},null,8,["title"])]),default:a.withCtx(()=>[a.createElementVNode("form",{class:"ao-save-template-modal__form",onSubmit:a.withModifiers(s,["prevent"])},[a.createElementVNode("div",bN,[a.createElementVNode("div",vN,[a.createElementVNode("label",yN,[a.createElementVNode("span",_N,a.toDisplayString(l.$t("project.template.name.label"))+": ",1),a.withDirectives(a.createElementVNode("input",{"onUpdate:modelValue":c[0]||(c[0]=d=>r.value=d),type:"text"},null,512),[[a.vModelText,r.value]])])]),a.createElementVNode("div",CN,[a.createElementVNode("div",wN,a.toDisplayString(l.$t("project.template.phases.label")),1),a.createElementVNode("div",kN,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.phases,d=>(a.openBlock(),a.createElementBlock("label",{key:d.id,class:"ao-field ao-field--checkbox"},[a.withDirectives(a.createElementVNode("input",{"onUpdate:modelValue":c[1]||(c[1]=u=>i.value=u),type:"checkbox",value:d.id},null,8,xN),[[a.vModelCheckbox,i.value]]),a.createElementVNode("span",null,a.toDisplayString(d.name),1)]))),128))])])]),a.createElementVNode("footer",EN,[a.createVNode(fe,{label:l.$t("project.template.save.label"),type:"submit",color:"primary",variant:"solid",onClick:s},null,8,["label"])])],32)]),_:1}))}}),xge="",SN={class:"ao-project"},TN={class:"ao-project__body"},AN=a.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}=kn(),o=t,r=e,i=a.computed(()=>o.phases.flatMap(R=>R.milestones)),s=()=>{const{name:R,rank:Q}=ar(o.phases,"phase",n);r("addPhase",{name:R,rank:Q,projectId:o.project.id})},l=()=>{const R=n("template.defaultName.phase",{idx:1}),Q=ha(o.phases);r("addPhase",{name:R,rank:Q,projectId:o.project.id})},c=R=>{r("updatePhase",R)},d=R=>{r("archivePhase",R)},u=R=>{r("unarchivePhase",R)},p=R=>{r("copyPhaseToTemplate",R)},f=R=>{r("addMilestone",R)},m=R=>{r("updateMilestone",R)},h=R=>{r("archiveMilestone",R)},g=R=>{r("unarchiveMilestone",R)},v=R=>{r("addActivity",R)},_=R=>{r("update:activity",R)},b=R=>{r("archiveActivity",R)},y=R=>{r("unarchiveActivity",R)},w=R=>{r("addSubtask",R)},k=R=>{r("updateSubtask",R)},C=R=>{r("deleteSubtask",R)},x=a.computed(()=>i.value.flatMap(R=>R.activities)),T=R=>{r("addFiles",R)},S=R=>{r("removeFile",R)},N=R=>{r("addComment",R)},I=R=>{r("updateComment",R)},A=R=>{r("removeComment",R)},D=a.ref(!1),B=a.ref(!1),O=(R,Q)=>{r("applyTemplate",{templateId:R,projectId:Q}),D.value=!1},V=(R,Q)=>{var ie;const ee=(ie=o.templates)==null?void 0:ie.at(-1),be=ee?rt.LexoRank.parse(ee.rank).genNext():rt.LexoRank.middle();r("saveTemplate",{templateName:R,rank:be.format(),phaseIds:Q}),B.value=!1},H=Ct.useRouter(),P=a.ref("overview"),U=[{label:"Overview",value:"overview"},{label:"Feed",value:"feed"},{label:"Dev",value:"dev"},{label:"Mapping",value:"mapping"}];return a.watch(P,R=>{R==="feed"?(H.push({name:Pe.feed}),console.log("Navigating to feed...")):R==="dev"?(H.push({name:Pe.dev}),console.log("Navigating to dev...")):R==="overview"?(H.push({name:Pe.project}),console.log("Navigating to feed...")):R==="mapping"&&(H.push({name:Pe.mapping}),console.log("Navigating to feed..."))}),(R,Q)=>{var be;const ee=a.resolveComponent("RouterView");return a.openBlock(),a.createElementBlock(a.Fragment,null,[a.createElementVNode("div",a.mergeProps({class:"ao-project-overview"},R.$attrs),[a.createElementVNode("div",SN,[a.createVNode(ga,null,{primary:a.withCtx(()=>[a.createVNode(ai,{modelValue:P.value,"onUpdate:modelValue":Q[0]||(Q[0]=ie=>P.value=ie),tabs:U},null,8,["modelValue"]),a.createVNode(fe,{class:"ao-feed__show-archived",size:"sm","icon-name":t.showsArchived?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:R.$t("feed.filters.showsArchived.label"),role:"checkbox","aria-checked":t.showsArchived,onClick:Q[1]||(Q[1]=ie=>R.$emit("update:showsArchived",!t.showsArchived))},null,8,["icon-name","label","aria-checked"])]),secondary:a.withCtx(()=>[t.isEditable===!0?(a.openBlock(),a.createBlock(fe,{key:0,class:"ao-project-overview__quick-add-phase",size:"sm","icon-name":"Add","icon-position":"start",color:"primary",variant:"ghost",label:R.$t("project.phase.add"),onClick:l},null,8,["label"])):a.createCommentVNode("",!0),t.isEditable===!0?(a.openBlock(),a.createBlock(fe,{key:1,class:"ao-project-overview__save-as-template",color:"primary",label:R.$t("project.template.save.label"),onClick:Q[2]||(Q[2]=ie=>B.value=!0)},null,8,["label"])):a.createCommentVNode("",!0),t.isEditable===!0?(a.openBlock(),a.createBlock(fe,{key:2,class:"ao-project-overview__add-template",color:"primary",label:R.$t("project.template.apply.label"),onClick:Q[3]||(Q[3]=ie=>D.value=!0)},null,8,["label"])):a.createCommentVNode("",!0)]),_:1}),a.createElementVNode("div",TN,[a.createVNode(ou,{phases:t.phases,"closed-status":t.closedStatus,"is-editable":t.isEditable===!0,users:t.users,"time-tracking-data":t.timeTrackingData,"estimation-unit":(be=t.project)==null?void 0:be.estimationUnit,onAddMilestone:f,onUpdateMilestone:m,onArchiveMilestone:h,onUnarchiveMilestone:g,onAddPhase:s,onUpdatePhase:c,onArchivePhase:d,onUnarchivePhase:u,onCopyPhaseToTemplate:p},null,8,["phases","closed-status","is-editable","users","time-tracking-data","estimation-unit"])])]),a.createVNode(ee,{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]=ie=>R.$router.push({name:a.unref(Pe).project})),onUpdateMilestone:m,onAddActivity:v,onUpdateActivity:_,onArchiveActivity:b,onUnarchiveActivity:y},null,8,["phases","project-id","project-name","users","is-editable","closed-status","time-tracking-data"]),(a.openBlock(),a.createBlock(a.Teleport,{to:"body"},[a.createVNode(ee,{name:"modal",activities:x.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":_,onAddSubtask:w,onUpdateSubtask:k,onDeleteSubtask:C,onAddFiles:T,onRemoveFile:S,onAddComment:N,onUpdateComment:I,onRemoveComment:A},{default:a.withCtx(({Component:ie})=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(ie),null,{default:a.withCtx(se=>[a.renderSlot(R.$slots,"activityDetailsBody",a.normalizeProps(a.guardReactiveProps(se)))]),_: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),(a.openBlock(),a.createBlock(a.Teleport,{to:"body"},[B.value?(a.openBlock(),a.createBlock(Ag,{key:0,phases:t.phases,onClose:Q[5]||(Q[5]=ie=>B.value=!1),onSave:V},null,8,["phases"])):a.createCommentVNode("",!0),D.value?(a.openBlock(),a.createBlock(Tg,{key:1,"project-id":t.project.id,templates:t.templates,onClose:Q[6]||(Q[6]=ie=>D.value=!1),onApply:O},null,8,["project-id","templates"])):a.createCommentVNode("",!0)]))],64)}}}),Ege="",NN={class:"ao-card-feed__header"},DN={key:1,class:"ao-card-feed__header-secondary ao-card-feed__header-icons"},BN={key:2,class:"ao-card-feed__header-secondary ao-card-feed__secondary"},$N={class:"ao-card-feed__body"},MN={key:0,class:"ao-card-feed__breadcrumbs"},LN={class:a.normalizeClass(["ao-card-feed__title-group"])},ON={class:"ao-card-feed__title-line"},IN={key:0,class:"ao-card-feed__slug"},VN={key:1,class:"ao-card-feed__deadline"},PN={class:"ao-card-feed__footer"},RN={class:"ao-card-feed__footer-row"},FN={class:"ao-assignees"},zN={key:0,class:"ao-assignee"},qN={key:0,class:"ao-card-feed__subitems"},jN={key:0,class:"ao-card-feed__subitem"},UN={class:"ao-card-feed__subitem"},HN={key:1,class:"ao-card-feed__subitem"},WN={class:"ao-card-feed__subitem"},ZN={class:"ao-card-feed__timer-wrapper"},GN={class:"ao-card-feed__footer-row"},KN={key:0,class:"ao-card-feed__progress-wrapper"},YN={class:"ao-card-feed__subitem"},JN={class:"ao-card-feed__subitem"},ru=a.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=a.computed(()=>n.tagType==="milestone"?n.milestoneName:n.projectName),i=a.computed(()=>n.tagType==="milestone"?n.milestoneColor:n.projectColor),s=g=>{o("updateActivity",{id:n.id,name:g})},l=a.computed(()=>n.tagType==="milestone"&&n.phaseName?`${n.phaseName}`:n.phaseName&&n.milestoneName?`${n.phaseName} / ${n.milestoneName}`:""),c=a.computed(()=>n.assignee?[n.assignee]:[]),d=a.computed(()=>Ni(n.deadline)),u=g=>{o("removeAssignee",g)},p=()=>{o("startTimer",{activityId:n.id,name:n.name,project:n.projectName,projectId:n.projectId,slug:n.slug})},f=a.computed(()=>{var g;return(g=n.tasks)==null?void 0:g.length}),m=a.computed(()=>{var g;return(g=n.tasks)==null?void 0:g.filter(v=>v.isDone).length}),h=a.computed(()=>(m.value||0)/(f.value||1));return(g,v)=>(a.openBlock(),a.createBlock(ol,{class:a.normalizeClass(["ao-card-feed",{"ao-card-feed--closed":t.isClosed}]),"is-clickable":!0},{header:a.withCtx(()=>[a.createElementVNode("div",NN,[r.value?(a.openBlock(),a.createBlock(ta,{key:0,label:r.value,class:"ao-card-feed__project",variant:"solid",color:t.projectColor?void 0:"primary","raw-color":i.value},null,8,["label","color","raw-color"])):a.createCommentVNode("",!0),t.isPrivate||t.important||t.isClosed?(a.openBlock(),a.createElementBlock("div",DN,[t.isPrivate?(a.openBlock(),a.createBlock(Ce,{key:0,name:"Lock",class:"ao-card-feed__warning",size:"sm"})):a.createCommentVNode("",!0),t.important?(a.openBlock(),a.createBlock(Ce,{key:1,name:"FlagRounded",class:"ao-card-feed__important",size:"sm"})):a.createCommentVNode("",!0),t.isClosed?(a.openBlock(),a.createBlock(Ce,{key:2,name:"CheckSmallRounded",class:"ao-card-feed__closed"})):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0),g.$slots.secondary?(a.openBlock(),a.createElementBlock("div",BN,[a.renderSlot(g.$slots,"secondary")])):a.createCommentVNode("",!0)])]),default:a.withCtx(()=>[a.createElementVNode("div",$N,[l.value?(a.openBlock(),a.createElementBlock("span",MN,a.toDisplayString(l.value),1)):a.createCommentVNode("",!0),a.createElementVNode("div",LN,[a.createElementVNode("div",ON,[t.slug?(a.openBlock(),a.createElementBlock("span",IN,a.toDisplayString(t.slug)+": ",1)):a.createCommentVNode("",!0),a.createVNode(bt,{id:t.id,title:t.name,level:5,"is-editable":t.isEditable,class:"ao-card-feed__title-inline","onUpdate:title":s},null,8,["id","title","is-editable"])])]),t.deadline?(a.openBlock(),a.createElementBlock("span",VN,a.toDisplayString(d.value),1)):a.createCommentVNode("",!0)])]),footer:a.withCtx(()=>[a.createElementVNode("div",PN,[a.createElementVNode("div",RN,[a.createElementVNode("ul",FN,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(c.value,_=>(a.openBlock(),a.createElementBlock(a.Fragment,{key:_.id},[_?(a.openBlock(),a.createElementBlock("li",zN,[a.createVNode(Pn,{"user-name":a.unref(zu)(_),"avatar-url":_.avatarUrl,"is-closable":!0,onClose:()=>u(_.id)},null,8,["user-name","avatar-url","onClose"])])):a.createCommentVNode("",!0)],64))),128))]),t.comments||t.attachments?(a.openBlock(),a.createElementBlock("ul",qN,[t.comments?(a.openBlock(),a.createElementBlock("li",jN,[a.createVNode(Ce,{name:"ChatOutline",size:"sm"}),a.createElementVNode("span",UN,a.toDisplayString(t.comments),1)])):a.createCommentVNode("",!0),t.attachments?(a.openBlock(),a.createElementBlock("li",HN,[a.createVNode(Ce,{name:"AttachFileRounded",size:"sm"}),a.createElementVNode("span",WN,a.toDisplayString(t.attachments),1)])):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0),a.createElementVNode("div",ZN,[a.createVNode(Ce,{name:"TimerOutline",class:"ao-card-feed__timer",size:"md",onClick:a.withModifiers(p,["stop"])})])]),a.createElementVNode("div",GN,[t.tasks&&t.tasks.length?(a.openBlock(),a.createElementBlock("div",KN,[a.createElementVNode("div",YN,[a.createVNode(Ce,{name:"SelectCheckBox",size:"sm"}),a.createElementVNode("span",JN,a.toDisplayString(m.value)+" / "+a.toDisplayString(f.value),1)]),a.createVNode(rl,{percentages:h.value,class:"ao-card-feed__progress"},null,8,["percentages"])])):a.createCommentVNode("",!0)])])]),_:3},8,["class"]))}}),Sge="",XN={class:"ao-project-milestone"},QN={class:"ao-project-milestone__header"},eD={class:"ao-project-milestone__header_line"},tD={class:"ao-project-milestone__header_line"},nD={class:"ao-project-milestone__title"},oD={key:0,class:"ao-fieldset ao-milestone__fieldset"},rD={class:"ao-field__row ao-milestone__field-row"},aD={class:"ao-field ao-field--inline"},iD={class:"ao-field__row ao-milestone__field-row"},sD={class:"ao-field ao-milestone__field-multiselect"},lD={class:"ao-milestone__color-actions"},cD=["onClick"],dD=["title"],uD={class:"ao-project-milestone__body"},pD={key:0,class:"ao-project-milestone__footer"},Ng=a.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}=kn(),o=t,r=e,i=C=>{var x;r("startTimer",C),(x=window.parent)==null||x.postMessage({type:"startTimer",data:C},"*")},s=a.computed(()=>{var C;return(C=o.phases)==null?void 0:C.find(x=>x.id===o.phaseId)}),l=a.computed(()=>{var C;return(C=o.phases)==null?void 0:C.flatMap(x=>x.milestones)}),c=a.computed(()=>{var C;return(C=l.value)==null?void 0:C.find(x=>x.id===o.milestoneId)}),d=a.computed(()=>{var C;return(C=c.value)==null?void 0:C.activities});a.watch(d,(C,x)=>{jn(C,x)});const u=C=>{r("close",C)},p=()=>{const{name:C,rank:x}=ar(d.value??[],"activity",n);r("addActivity",{milestoneId:o.milestoneId,name:C,rank:x,projectId:o.projectId})},f=()=>{const C=n("template.defaultName.activity",{idx:1}),x=ha(d.value??[]);r("addActivity",{milestoneId:o.milestoneId,name:C,rank:x,projectId:o.projectId})},m=C=>{r("updateActivity",C)},h=C=>{d.value&&"moved"in C&&r("updateActivity",{id:C.moved.element.id,rank:mr(d.value,C.moved.newIndex)})},g=a.computed({get:()=>{var C;return(C=c.value)==null?void 0:C.color},set:C=>{c.value&&r("updateMilestone",{id:c.value.id,color:C})}}),v=a.computed({get:()=>{var C;return((C=c==null?void 0:c.value)==null?void 0:C.deadline)??""},set:C=>{c.value&&r("updateMilestone",{id:c.value.id,deadline:C!=null&&C.length?C:null})}}),_=C=>o.closedStatus?_l(C,o.closedStatus):!1,b=a.computed(()=>{var C;return((C=o.users)==null?void 0:C.map(x=>({label:`${x.firstName} ${x.lastName}`,value:x.id,avatar:x.avatarUrl})))||[]}),y=a.computed({get(){var C,x;return(x=(C=c.value)==null?void 0:C.assignee)!=null&&x.id?[c.value.assignee.id]:[]},set(C){r("updateMilestone",{id:o.milestoneId,assigneeId:C[0]??null})}}),w=a.computed({get(){var C;return((C=c.value)==null?void 0:C.important)??!1},set(C){r("updateMilestone",{id:o.milestoneId,important:C})}}),k=(C,x)=>{const T=C.currentTarget;T instanceof HTMLElement&&x(T)};return(C,x)=>{var T;return a.openBlock(),a.createElementBlock("div",XN,[a.createElementVNode("header",QN,[a.createElementVNode("div",eD,[a.createVNode(fe,{"icon-name":"CloseRounded",variant:"ghost",size:"sm",class:"ao-milestone__close",onClick:u})]),a.createElementVNode("div",tD,[a.createElementVNode("div",nD,[a.createVNode(bt,{title:((T=c.value)==null?void 0:T.name)||t.milestoneId,level:5},null,8,["title"]),a.createVNode(xg,{modelValue:w.value,"onUpdate:modelValue":x[0]||(x[0]=S=>w.value=S),modelModifiers:{lazy:!0},disabled:!t.isEditable,class:"ao-milestone__important",color:"danger",label:C.$t("activity.important.label"),"icon-name":"FlagRounded",variant:"ghost",size:"sm"},null,8,["modelValue","disabled","label"])])]),c.value?(a.openBlock(),a.createElementBlock("div",oD,[a.createElementVNode("div",rD,[a.createElementVNode("label",aD,[a.withDirectives(a.createElementVNode("input",{"onUpdate:modelValue":x[1]||(x[1]=S=>v.value=S),class:"ao-milestone__field ao-milestone__date-field",type:"date"},null,512),[[a.vModelText,v.value,void 0,{lazy:!0}]])])]),a.createElementVNode("div",iD,[a.createElementVNode("label",sD,[a.createVNode(kt,{modelValue:y.value,"onUpdate:modelValue":x[2]||(x[2]=S=>y.value=S),options:b.value,"close-on-select":!0,searchable:!0,max:1,class:"ao-milestone__field ao-milestone__multiselect",placeholder:C.$t("activity.filters.assignee.placeholder"),mode:"tags",disabled:!t.isEditable,caret:t.isEditable},{tag:a.withCtx(({option:S,handleTagRemove:N})=>[a.createVNode(Pn,{"user-name":S.label,"avatar-url":S.avatar,"is-closable":!0,onClose:I=>N(S,I)},null,8,["user-name","avatar-url","onClose"])]),_:1},8,["modelValue","options","placeholder","disabled","caret"])])]),a.createElementVNode("div",lD,[a.createVNode(al,{color:g.value,"onUpdate:color":x[3]||(x[3]=S=>g.value=S)},{clickable:a.withCtx(({openPicker:S,bgColor:N})=>[a.createElementVNode("button",{style:a.normalizeStyle({background:N}),class:"color-button",onClick:I=>k(I,S)},null,12,cD)]),_:1},8,["color"]),t.isEditable?(a.openBlock(),a.createElementBlock("button",{key:0,type:"button",class:"ao-project-milestone__quick-add",title:C.$t("project.activity.add"),onClick:f},[a.createVNode(Ce,{name:"Add",class:"ao-project-milestone__quick-add-icon"})],8,dD)):a.createCommentVNode("",!0)])])):a.createCommentVNode("",!0)]),a.createElementVNode("div",uD,[a.createVNode(a.unref(no),a.mergeProps({class:"ao-project-milestone__activities",list:d.value,disabled:!t.isEditable,"item-key":"id",group:"kanban"},C.$attrs,{onChange:h}),{item:a.withCtx(({element:S})=>{var N,I,A,D,B;return[a.createVNode(ru,{id:S.id,name:S.name||S.id,"project-id":t.projectId,"phase-name":(N=s.value)==null?void 0:N.name,"milestone-name":(I=c.value)==null?void 0:I.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:(B=S.attachments)==null?void 0:B.length,tasks:S.tasks,"is-editable":t.isEditable,"is-private":S.private,"is-closed":_(S),onClick:O=>C.$router.push({name:a.unref(Pe).activity,params:{milestoneId:t.milestoneId,activityId:S.id}}),onUpdateActivity:m,onRemoveAssignee:()=>m({id:S.id,assigneeId:null}),onStartTimer:i},a.createSlots({_:2},[t.isEditable?{name:"secondary",fn:a.withCtx(()=>[t.isEditable&&S.active?(a.openBlock(),a.createBlock(fe,{key:0,color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:C.$t("archive"),onClick:a.withModifiers(()=>C.$emit("archiveActivity",{id:S.id}),["stop"])},null,8,["label","onClick"])):a.createCommentVNode("",!0),t.isEditable&&!S.active?(a.openBlock(),a.createBlock(fe,{key:1,color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:C.$t("feed.activity.unarchive"),onClick:a.withModifiers(()=>C.$emit("unarchiveActivity",{id:S.id}),["stop"])},null,8,["label","onClick"])):a.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?(a.openBlock(),a.createElementBlock("div",pD,[a.createVNode(ro,{"icon-name":"Add",label:C.$t("project.activity.add"),onClick:p},null,8,["label"])])):a.createCommentVNode("",!0)])])}}}),Tge="",fD=a.defineComponent({__name:"AoProjectOverviewActivityDetails",props:{phaseId:{},milestoneId:{},activityId:{},activityTypes:{},devStatuses:{},activities:{},isTaskCheckable:{type:Function},statuses:{},phases:{},users:{},project:{},userId:{},isEditable:{type:Boolean},attachmentEnabled:{type:Boolean},timeTrackingData:{},loadAttachmentPreview:{type:Function},sprints:{}},emits:["update:activity","addSubtask","updateSubtask","deleteSubtask","addFiles","removeFile","addComment","updateComment","removeComment","createSprint"],setup(t,{emit:e}){const n=t,o=e,r=a.computed(()=>{var _;return(_=n.phases)==null?void 0:_.find(b=>b.id===n.phaseId)}),i=a.computed(()=>{var _;return(_=n.phases)==null?void 0:_.flatMap(b=>b.milestones)}),s=a.computed(()=>{var _;return(_=i.value)==null?void 0:_.find(b=>b.id===n.milestoneId)}),l=a.computed(()=>{var _;return(_=n.activities)==null?void 0:_.find(b=>b.id===n.activityId)}),c=_=>{o("update:activity",_)},d=_=>{o("addSubtask",_)},u=_=>{o("updateSubtask",_)},p=_=>{o("deleteSubtask",_)},f=_=>{o("addFiles",_)},m=_=>{o("removeFile",_)},h=_=>{o("addComment",_)},g=_=>{o("updateComment",_)},v=_=>{o("removeComment",_)};return(_,b)=>{var y,w;return l.value?(a.openBlock(),a.createBlock(Zd,{key:0,activity:l.value,"activity-types":t.activityTypes,"dev-statuses":t.devStatuses,"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:`${(y=r.value)==null?void 0:y.name} / ${(w=s.value)==null?void 0:w.name}`,"is-editable":t.isEditable,"attachment-enabled":t.attachmentEnabled,projects:[t.project],"time-tracking-data":t.timeTrackingData,"load-attachment-preview":n.loadAttachmentPreview,sprints:t.sprints,onClose:_.$router.back,"onUpdate:activity":c,onAddSubtask:d,onUpdateSubtask:u,onDeleteSubtask:p,onAddFiles:f,onRemoveFile:m,onAddComment:h,onUpdateComment:g,onRemoveComment:v,onCreateSprint:b[0]||(b[0]=k=>o("createSprint",k))},{default:a.withCtx(k=>[a.renderSlot(_.$slots,"default",a.normalizeProps(a.guardReactiveProps(k)))]),_:3},8,["activity","activity-types","dev-statuses","milestone-id","template-activities","users","user-id","is-task-checkable","statuses","breadcrumbs","is-editable","attachment-enabled","projects","time-tracking-data","load-attachment-preview","sprints","onClose"])):a.createCommentVNode("",!0)}}}),mD={class:"ao-col-header"},hD=a.defineComponent({__name:"AoColHeader",props:{title:{},items:{}},setup(t){return(e,n)=>(a.openBlock(),a.createElementBlock("header",mD,[a.createVNode(bt,{title:t.title,class:"ao-col-header__title",level:4},null,8,["title"]),t.items?(a.openBlock(),a.createBlock(ta,{key:0,label:t.items,class:"ao-col-header__items",variant:"solid",color:"primary"},null,8,["label"])):a.createCommentVNode("",!0)]))}}),Age="";function gD(t){return a.getCurrentScope()?(a.onScopeDispose(t),!0):!1}function il(t){return typeof t=="function"?t():a.unref(t)}const bD=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const vD=t=>t!=null,ii=()=>{};function yD(t,e){function n(...o){return new Promise((r,i)=>{Promise.resolve(t(()=>e.apply(this,o),{fn:e,thisArg:this,args:o})).then(r).catch(i)})}return n}function _D(t,e={}){let n,o,r=ii;const i=l=>{clearTimeout(l),r(),r=ii};return l=>{const c=il(t),d=il(e.maxWait);return n&&i(n),c<=0||d!==void 0&&d<=0?(o&&(i(o),o=null),Promise.resolve(l())):new Promise((u,p)=>{r=e.rejectOnCancel?p:u,d&&!o&&(o=setTimeout(()=>{n&&i(n),o=null,u(l())},d)),n=setTimeout(()=>{o&&i(o),o=null,u(l())},c)})}}function CD(t,e=200,n={}){return yD(_D(e,n),t)}function au(t){var e;const n=il(t);return(e=n==null?void 0:n.$el)!=null?e:n}const wD=bD?window:void 0;function kD(){const t=a.ref(!1),e=a.getCurrentInstance();return e&&a.onMounted(()=>{t.value=!0},e),t}function xD(t){const e=kD();return a.computed(()=>(e.value,!!t()))}function ED(t,e,n={}){const{root:o,rootMargin:r="0px",threshold:i=.1,window:s=wD,immediate:l=!0}=n,c=xD(()=>s&&"IntersectionObserver"in s),d=a.computed(()=>{const h=il(t);return(Array.isArray(h)?h:[h]).map(au).filter(vD)});let u=ii;const p=a.ref(l),f=c.value?a.watch(()=>[d.value,au(o),p.value],([h,g])=>{if(u(),!p.value||!h.length)return;const v=new IntersectionObserver(e,{root:au(g),rootMargin:r,threshold:i});h.forEach(_=>_&&v.observe(_)),u=()=>{v.disconnect(),u=ii}},{immediate:l,flush:"post"}):ii,m=()=>{u(),f(),p.value=!1};return gD(m),{isSupported:c,isActive:p,pause(){u(),p.value=!1},resume(){p.value=!0},stop:m}}const SD={class:a.normalizeClass(["ao-list-kanban"])},TD={class:"ao-list-kanban__header"},AD=["title"],ND={key:0,class:"ao-list-kanban__end ao-list-kanban__end--loading"},DD={key:1,class:"ao-list-kanban__end"},BD={key:0,class:"ao-list-kanban__no-more"},$D={key:1,class:"ao-list-kanban__divider"},MD={key:1,class:"ao-list-kanban__footer"},LD=a.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},isDevMode:{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=a.ref(!1),i=a.ref(null);ED(i,([{isIntersecting:p}])=>{r.value=p}),a.watch(r,p=>{p&&n.hasMore&&!n.isLoading&&o("loadMore")});const s=p=>{var f;return n.isEditable===!0?!0:n.userId&&n.isEditable==="only-own"?n.userId===((f=p.assignee)==null?void 0:f.id):!1},l=p=>{o("selectActivity",p)},c=p=>{o("updateActivity",p)},d=p=>{if("added"in p){const f={id:p.added.element.id,rank:mr(n.list,p.added.newIndex)};n.isDevMode?f.statusDevId=n.status.id:f.statusId=n.status.id,o("updateActivity",f)}else"removed"in p||"moved"in p&&o("updateActivity",{id:p.moved.element.id,rank:mr(n.list,p.moved.newIndex)})},u=a.ref(!1);return(p,f)=>(a.openBlock(),a.createElementBlock("div",SD,[t.title||p.$slots.header?a.renderSlot(p.$slots,"header",{},()=>{var m;return[a.createElementVNode("div",TD,[t.title?(a.openBlock(),a.createBlock(hD,{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"])):a.createCommentVNode("",!0),t.showHeaderAdd?(a.openBlock(),a.createElementBlock("button",{key:1,class:"ao-list-kanban__header-add",title:p.$t("feed.activity.add"),onClick:f[0]||(f[0]=h=>p.$emit("addAtBeginning"))},[a.createVNode(Ce,{name:"Add"})],8,AD)):a.createCommentVNode("",!0)])]},void 0,0):a.createCommentVNode("",!0),a.createVNode(a.unref(no),a.mergeProps({class:["ao-list-kanban__list",u.value?"ao-list-kanban__transition":void 0],list:t.list,"item-key":"id",group:"kanban","ghost-class":"ao-list-kanban__ghost",animation:"200"},p.$attrs,{draggable:".ao-list-draggable",disabled:!t.isEditable,"component-data":{tag:"transition-group",name:"ao-list-kanban__transition"},onChange:d,onStart:f[2]||(f[2]=m=>u.value=!0),onEnd:f[3]||(f[3]=m=>u.value=!1)}),{item:a.withCtx(({element:m})=>{var h,g,v,_,b,y,w,k,C,x;return[a.createVNode(ru,{id:m.id,class:a.normalizeClass(s(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":(v=m.project)==null?void 0:v.color,"phase-name":(b=(_=m.milestone)==null?void 0:_.phase)==null?void 0:b.name,"milestone-name":(y=m.milestone)==null?void 0:y.name,"milestone-color":(w=m.milestone)==null?void 0:w.color,deadline:m.deadline,rules:((k=m.rules)==null?void 0:k.length)||0,tasks:m.tasks,description:m.description,important:m.important,type:m.type,comments:(C=m.comments)==null?void 0:C.length,attachments:(x=m.attachments)==null?void 0:x.length,users:t.users,assignee:m.assignee,slug:m.slug,"is-editable":s(m),"is-private":m.private,"tag-type":t.tagType,onUpdateActivity:[T=>s(m)&&c(T),()=>s(m)&&c],onClick:()=>l(m.id),onRemoveAssignee:()=>s(m)&&c({id:m.id,assigneeId:null}),onStartTimer:f[1]||(f[1]=T=>p.$emit("startTimer",T))},{secondary:a.withCtx(()=>[s(m)&&m.active?(a.openBlock(),a.createBlock(fe,{key:0,color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:p.$t("feed.activity.archive"),onClick:a.withModifiers(()=>p.$emit("archiveActivity",{id:m.id}),["stop"])},null,8,["label","onClick"])):a.createCommentVNode("",!0),s(m)&&!m.active?(a.openBlock(),a.createBlock(fe,{key:1,color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:p.$t("feed.activity.unarchive"),onClick:a.withModifiers(()=>p.$emit("unarchiveActivity",{id:m.id}),["stop"])},null,8,["label","onClick"])):a.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:a.withCtx(()=>[t.isLoading?(a.openBlock(),a.createElementBlock("div",ND,[a.createVNode(Ce,{name:"Loading"})])):t.hasMore?(a.openBlock(),a.createElementBlock("div",{key:2,ref_key:"scrollEnd",ref:i,class:"ao-list-kanban__end"},null,512)):(a.openBlock(),a.createElementBlock("div",DD,[t.noMoreLabel?(a.openBlock(),a.createElementBlock("span",BD,a.toDisplayString(t.noMoreLabel),1)):t.isEditable?(a.openBlock(),a.createElementBlock("span",$D)):a.createCommentVNode("",!0)]))]),_:1},16,["class","list","disabled"]),p.$slots.footer||t.footerLabel?(a.openBlock(),a.createElementBlock("div",MD,[a.renderSlot(p.$slots,"footer",{},()=>[t.isEditable?(a.openBlock(),a.createBlock(ro,{key:0,"icon-name":"AddBoxOutlineRounded",label:t.footerLabel,onClick:f[4]||(f[4]=m=>p.$emit("add"))},null,8,["label"])):a.createCommentVNode("",!0)])])):a.createCommentVNode("",!0)]))}}),Nge="",OD={class:"ao-field ao-search-field"},ID=["value","placeholder"],VD=a.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 d=l.target.value;o("update:modelValue",d,l)},i=CD(r,n.delay),s=l=>{o("clear",l)};return(l,c)=>(a.openBlock(),a.createElementBlock("div",OD,[a.createElementVNode("input",{value:t.modelValue,type:"text",class:"ao-field__input ao-search-field__input",placeholder:t.placeholder,onInput:c[0]||(c[0]=(...d)=>a.unref(i)&&a.unref(i)(...d)),onKeypress:a.withKeys(r,["enter"])},null,40,ID),a.createVNode(Ce,{name:"SearchRounded",class:a.normalizeClass(`ao-search-field__icon ao-search-field__action ${t.modelValue?"":"ao-search-field__action--visible"}`)},null,8,["class"]),a.createVNode(fe,{"icon-name":"CloseRounded",size:"sm",color:"primary",corners:"round",class:a.normalizeClass(`ao-search-field__button ao-search-field__action ${t.modelValue?"ao-search-field__action--visible":""}`),onClick:s},null,8,["class"])]))}}),Dge="",PD={class:"ao-feed"},RD={class:"ao-feed__filters"},FD={class:"ao-feed__body"},iu=a.defineComponent({__name:"AoFeed",props:{activities:{},statuses:{},devStatuses:{default:()=>[]},project:{default:void 0},projects:{default:()=>[]},filters:{},activityTypes:{default:()=>[]},users:{},userId:{},initialActivityId:{default:void 0},initialActivitySlug:{default:void 0},searchText:{default:""},showsArchivedActivities:{type:Boolean},showsOnlyImportant:{type:Boolean},showsOnlyNonAssigned:{type:Boolean},selectedActivity:{default:void 0},isTaskCheckable:{type:Function,default:void 0},isEditable:{type:[Boolean,String]},attachmentEnabled:{type:Boolean,default:!0},timeTrackingData:{default:()=>({})},loadAttachmentPreview:{type:Function,default:void 0},feedMode:{default:"standard"},sprints:{default:()=>[]}},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","createSprint"],setup(t,{emit:e}){const{t:n}=kn(),o=t,r=e;function i(q,te){r("toast",q,te)}const s=a.toRef(o,"activities"),l=a.computed(()=>o.feedMode==="dev"?o.devStatuses:o.statuses),c=a.computed(()=>o.feedMode==="dev"?s.value.filter(q=>q.activityType==="dev"):s.value),d=async(q,te)=>{await r("selectActivity",q,te)},u=a.ref({}),p=a.ref(!1),f=a.ref(!1),m=a.computed(()=>o.project?"milestone":"project");a.watch([()=>l.value,()=>c.value,()=>o.initialActivityId,()=>o.initialActivitySlug,()=>o.feedMode],async([q,te,Le,le],[Ke,we])=>{const De=o.feedMode==="dev"?"devStatus":"status";u.value=Object.fromEntries(q.map(Re=>[Re.id,te.filter(Ee=>{const Oe=Ee[De];return(Oe==null?void 0:Oe.id)===Re.id})])),Le&&!p.value?(d(Le,null),p.value=!0):le&&!p.value&&(d(null,le),p.value=!0),f.value&&jn(te,we)},{immediate:!0});const h=a.computed(()=>{var q;return!o.selectedActivity||!o.selectedActivity.milestone?"":`${((q=o.selectedActivity.milestone.phase)==null?void 0:q.name)??""} / ${o.selectedActivity.milestone.name??""}`}),g=q=>{var Re;const te=o.feedMode==="dev"?o.activities.filter(Ee=>Ee.activityType==="dev"):o.activities,Le=te==null?void 0:te.at(-1),le=Le?rt.LexoRank.parse(Le.rank).genNext():rt.LexoRank.middle(),Ke=((Re=o.activities)==null?void 0:Re.length)??0,we=o.feedMode==="dev",De={name:n("activity.defaultName",{idx:Ke+1}),rank:le.format(),...we?{statusDevId:q.id,type:"dev"}:{statusId:q.id}};if(o.filters.assigneeId.length>0&&(De.assigneeId=o.filters.assigneeId[0]),o.filters.projectId.length>0&&(De.projectId=o.filters.projectId[0]),o.filters.sprintId&&o.filters.sprintId.length===1){const Ee=o.sprints.find(Oe=>Oe.id===o.filters.sprintId[0]);Ee&&(De.sprintId=Ee.id,De.projectId=Ee.projectId)}f.value=!0,r("addActivity",De)},v=q=>{var Re,Ee;const te=o.feedMode==="dev"?"devStatus":"status",Le=((Re=o.activities)==null?void 0:Re.filter(Oe=>{const Ge=Oe[te];return(Ge==null?void 0:Ge.id)===q.id}))??[],le=ha(Le),Ke=((Ee=o.activities)==null?void 0:Ee.length)??0,we=o.feedMode==="dev",De={name:n("activity.defaultName",{idx:Ke+1}),rank:le,...we?{statusDevId:q.id,type:"dev"}:{statusId:q.id}};if(o.filters.assigneeId.length>0&&(De.assigneeId=o.filters.assigneeId[0]),o.filters.projectId.length>0&&(De.projectId=o.filters.projectId[0]),o.filters.sprintId&&o.filters.sprintId.length===1){const Oe=o.sprints.find(Ge=>Ge.id===o.filters.sprintId[0]);Oe&&(De.sprintId=Oe.id,De.projectId=Oe.projectId)}f.value=!0,r("addActivity",De)},_=(q,te)=>{f.value=!1,r("update:filters",{...o.filters,[q]:te})},b=a.computed(()=>o.project?[o.project]:o.projects??[]),y=a.computed(()=>b.value.map(q=>({value:q.id,label:q.name}))),w=a.computed(()=>o.sprints.map(q=>({value:q.id,label:`${q.name} · ${q.startDate} – ${q.endDate}`,startDate:q.startDate,endDate:q.endDate,projectId:q.projectId})));a.computed(()=>{var q;return(q=o.activityTypes)==null?void 0:q.map(te=>({value:te.id,label:te.name}))});const k=a.computed(()=>o.users.map(q=>({value:q.id,label:`${q.firstName} ${q.lastName}`,avatar:q.avatarUrl}))),C=q=>{o.selectedActivity&&r("update:activity",q)},x=q=>{r("update:activity",q)},T=q=>{r("archiveActivity",q)},S=q=>{r("unarchiveActivity",q)},N=q=>{var te;r("startTimer",q),(te=window.parent)==null||te.postMessage({type:"startTimer",data:q},"*")},I=q=>{f.value=!1,r("update:searchText",q)},A=q=>{f.value=!1,r("clear:searchText",q)},D=q=>{o.selectedActivity&&r("addSubtask",q)},B=q=>{o.selectedActivity&&r("updateSubtask",q)},O=q=>{o.selectedActivity&&r("deleteSubtask",q)},V=q=>{r("addFiles",q)},H=q=>{r("removeFile",q)},P=q=>{o.selectedActivity&&r("addComment",{...q,activityId:o.selectedActivity.id})},U=q=>{const{id:te}=o.selectedActivity||{};te&&r("updateComment",q)},R=q=>{const{id:te}=o.selectedActivity||{};te&&r("removeComment",q)},Q=Ct.useRouter(),ee=Ct.useRoute(),be=a.ref("feed");a.watch(()=>ee.name,q=>{q===lr.feed||q==="ActivityFeed"||q==="ActivityFeedWithActivity"?be.value="feed":q===lr.dev||q==="ActivityFeedDev"||q==="ActivityFeedDevWithActivity"?be.value="dev":q===Pe.feed?be.value="feed":q===Pe.dev?be.value="dev":q===Pe.project?be.value="overview":q===Pe.mapping&&(be.value="mapping")},{immediate:!0});const ie=[{label:"Overview",value:"overview"},{label:"Feed",value:"feed"},{label:"Dev",value:"dev"},{label:"Mapping",value:"mapping"}],se=a.computed(()=>z.value?ie.filter(q=>q.value==="feed"||q.value==="dev"):ie),z=a.computed(()=>!o.project&&ee.name&&(ee.name===lr.feed||ee.name===lr.dev||ee.name==="ActivityFeed"||ee.name==="ActivityFeedDev"||ee.name==="ActivityFeedWithActivity"||ee.name==="ActivityFeedDevWithActivity")),ae=a.computed(()=>z.value?lr.feed:Pe.feed),ye=a.computed(()=>z.value?lr.dev:Pe.dev),Me=a.computed(()=>Pe.project),dt=a.computed(()=>Pe.mapping);return a.watch(be,q=>{q==="feed"?Q.push({name:ae.value}):q==="dev"?Q.push({name:ye.value}):q==="overview"?Q.push({name:Me.value}):q==="mapping"&&Q.push({name:dt.value})}),(q,te)=>{var Le;return a.openBlock(),a.createElementBlock("div",PD,[a.createVNode(ga,null,{primary:a.withCtx(()=>[a.createElementVNode("div",RD,[a.createVNode(ai,{modelValue:be.value,"onUpdate:modelValue":te[0]||(te[0]=le=>be.value=le),tabs:se.value},null,8,["modelValue","tabs"]),a.createVNode(VD,{"model-value":t.searchText,placeholder:q.$t("feed.search.placeholder"),class:"ao-feed__search","onUpdate:modelValue":I,onClear:A},null,8,["model-value","placeholder"]),o.project?a.createCommentVNode("",!0):(a.openBlock(),a.createBlock(kt,{key:0,"model-value":t.filters[a.unref(Ao).project],mode:"tags",options:y.value,"close-on-select":!1,searchable:!0,class:"ao-feed__filter ao-feed__filter__projects",placeholder:q.$t("feed.filters.project.placeholder"),"onUpdate:modelValue":te[1]||(te[1]=le=>_(a.unref(Ao).project,le))},null,8,["model-value","options","placeholder"])),w.value.length?(a.openBlock(),a.createBlock(kt,{key:1,"model-value":t.filters[a.unref(Ao).sprint],mode:"tags",options:w.value,"close-on-select":!1,searchable:!0,class:"ao-feed__filter ao-feed__filter__sprints",placeholder:q.$t("feed.filters.sprint.placeholder"),"onUpdate:modelValue":te[2]||(te[2]=le=>_(a.unref(Ao).sprint,le))},null,8,["model-value","options","placeholder"])):a.createCommentVNode("",!0),k.value.length?(a.openBlock(),a.createBlock(kt,{key:2,"model-value":t.filters[a.unref(Ao).assignee],mode:"tags",options:k.value,"close-on-select":!1,searchable:!0,class:"ao-feed__filter ao-feed__filter__assignees",placeholder:q.$t("feed.filters.assignee.placeholder"),"onUpdate:modelValue":te[3]||(te[3]=le=>_(a.unref(Ao).assignee,le))},{tag:a.withCtx(({option:le,handleTagRemove:Ke})=>[a.createVNode(Pn,{"user-name":le.label,"avatar-url":le.avatar,"is-closable":!0,onClose:we=>Ke(le,we)},null,8,["user-name","avatar-url","onClose"])]),_:1},8,["model-value","options","placeholder"])):a.createCommentVNode("",!0)]),a.createVNode(fe,{class:"ao-feed__only-non-assigned",size:"sm","icon-name":t.showsOnlyNonAssigned?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:q.$t("feed.filters.showsOnlyNonAssigned.label"),role:"checkbox","aria-checked":t.showsOnlyNonAssigned,onClick:te[4]||(te[4]=le=>q.$emit("update:showsOnlyNonAssigned",!t.showsOnlyNonAssigned))},null,8,["icon-name","label","aria-checked"]),a.createVNode(fe,{class:"ao-feed__only-important",size:"sm","icon-name":t.showsOnlyImportant?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:q.$t("feed.filters.showsOnlyImportant.label"),role:"checkbox","aria-checked":t.showsOnlyImportant,onClick:te[5]||(te[5]=le=>q.$emit("update:showsOnlyImportant",!t.showsOnlyImportant))},null,8,["icon-name","label","aria-checked"]),a.createVNode(fe,{class:"ao-feed__show-archived",size:"sm","icon-name":t.showsArchivedActivities?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:q.$t("feed.filters.showsArchivedActivities.label"),role:"checkbox","aria-checked":t.showsArchivedActivities,onClick:te[6]||(te[6]=le=>q.$emit("update:showsArchivedActivities",!t.showsArchivedActivities))},null,8,["icon-name","label","aria-checked"])]),_:1}),a.createElementVNode("div",FD,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(l.value,le=>(a.openBlock(),a.createBlock(LD,{key:le.id,status:le,list:u.value[le.id],title:le.name,"footer-label":q.$t("feed.activity.add"),users:t.users,"user-id":t.userId,"is-editable":t.isEditable,"tag-type":m.value,"show-header-add":t.isEditable,"is-dev-mode":t.feedMode==="dev",onAdd:()=>g(le),onAddAtBeginning:()=>v(le),onSelectActivity:d,onArchiveActivity:T,onUnarchiveActivity:S,onUpdateActivity:x,onStartTimer:N},null,8,["status","list","title","footer-label","users","user-id","is-editable","tag-type","show-header-add","is-dev-mode","onAdd","onAddAtBeginning"]))),128))]),(a.openBlock(),a.createBlock(a.Teleport,{to:"body"},[t.selectedActivity?(a.openBlock(),a.createBlock(Zd,{key:0,activity:t.selectedActivity,"activity-types":t.activityTypes,"dev-statuses":t.devStatuses,"milestone-id":(Le=t.selectedActivity.milestone)==null?void 0:Le.id,"template-activities":s.value,users:t.users,"user-id":t.userId,"is-task-checkable":t.isTaskCheckable,statuses:t.statuses,breadcrumbs:h.value,"is-editable":t.isEditable,"attachment-enabled":t.attachmentEnabled,projects:b.value,"time-tracking-data":t.timeTrackingData,"load-attachment-preview":o.loadAttachmentPreview,sprints:t.sprints,onClose:te[7]||(te[7]=()=>d(null,null)),"onUpdate:activity":C,onAddSubtask:D,onUpdateSubtask:B,onDeleteSubtask:O,onAddFiles:V,onRemoveFile:H,onAddComment:P,onUpdateComment:U,onRemoveComment:R,onToast:i,onCreateSprint:te[8]||(te[8]=le=>r("createSprint",le))},{default:a.withCtx(le=>[a.renderSlot(q.$slots,"activityDetailsBody",a.normalizeProps(a.guardReactiveProps(le)))]),_:3},8,["activity","activity-types","dev-statuses","milestone-id","template-activities","users","user-id","is-task-checkable","statuses","breadcrumbs","is-editable","attachment-enabled","projects","time-tracking-data","load-attachment-preview","sprints"])):a.createCommentVNode("",!0)]))])}}}),Bge="",zD={class:"ao-project-mapping"},qD={class:"ao-project-mapping-mapping__body"},jD={class:"ao-project-mapping-mapping__phases"},UD={key:0,class:"ao-project-mapping-mapping__image-wrapper"},HD=["src","alt"],WD=a.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}=kn(),o=t,r=e,i=()=>{const{name:b,rank:y}=ar(o.phases,"phase",n);r("addPhase",{name:b,rank:y,projectId:o.project.id})},s=()=>{const b=n("template.defaultName.phase",{idx:1}),y=ha(o.phases);r("addPhase",{name:b,rank:y,projectId:o.project.id})},l=b=>{r("updatePhase",b)},c=b=>{r("archivePhase",b)},d=b=>{r("unarchivePhase",b)},u=b=>{r("copyPhaseToTemplate",b)},p=a.ref(!1),f=a.ref(!1),m=(b,y)=>{r("applyTemplate",{templateId:b,projectId:y}),p.value=!1},h=(b,y)=>{var C;const w=(C=o.templates)==null?void 0:C.at(-1),k=w?rt.LexoRank.parse(w.rank).genNext():rt.LexoRank.middle();r("saveTemplate",{templateName:b,rank:k.format(),phaseIds:y}),f.value=!1},g=Ct.useRouter(),v=a.ref("mapping"),_=[{label:"Overview",value:"overview"},{label:"Feed",value:"feed"},{label:"Dev",value:"dev"},{label:"Mapping",value:"mapping"}];return a.watch(v,b=>{b==="feed"?(g.push({name:Pe.feed}),console.log("Navigating to feed...")):b==="dev"?(g.push({name:Pe.dev}),console.log("Navigating to dev...")):b==="overview"?(g.push({name:Pe.project}),console.log("Navigating to feed...")):b==="mapping"&&(g.push({name:Pe.mapping}),console.log("Navigating to feed..."))}),(b,y)=>{var w;return a.openBlock(),a.createElementBlock(a.Fragment,null,[a.createElementVNode("div",a.mergeProps({class:"ao-project-mapping-overview"},b.$attrs),[a.createElementVNode("div",zD,[a.createVNode(ga,null,{primary:a.withCtx(()=>[a.createVNode(ai,{modelValue:v.value,"onUpdate:modelValue":y[0]||(y[0]=k=>v.value=k),tabs:_},null,8,["modelValue"]),a.createVNode(fe,{class:"ao-feed__show-archived",size:"sm","icon-name":t.showsArchived?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:b.$t("feed.filters.showsArchived.label"),role:"checkbox","aria-checked":t.showsArchived,onClick:y[1]||(y[1]=k=>b.$emit("update:showsArchived",!t.showsArchived))},null,8,["icon-name","label","aria-checked"])]),secondary:a.withCtx(()=>[t.isEditable===!0?(a.openBlock(),a.createBlock(fe,{key:0,class:"ao-mapping__quick-add-phase",size:"sm","icon-name":"Add","icon-position":"start",color:"primary",variant:"ghost",label:b.$t("project.phase.add"),onClick:s},null,8,["label"])):a.createCommentVNode("",!0),t.isEditable===!0?(a.openBlock(),a.createBlock(fe,{key:1,class:"ao-project-mapping-overview__save-as-template",color:"primary",label:b.$t("project.template.save.label"),onClick:y[2]||(y[2]=k=>f.value=!0)},null,8,["label"])):a.createCommentVNode("",!0),t.isEditable===!0?(a.openBlock(),a.createBlock(fe,{key:2,class:"ao-project-mapping-overview__add-template",color:"primary",label:b.$t("project.template.apply.label"),onClick:y[3]||(y[3]=k=>p.value=!0)},null,8,["label"])):a.createCommentVNode("",!0)]),_:1}),a.createElementVNode("div",qD,[a.createElementVNode("div",jD,[a.createVNode(ou,{phases:t.phases,"closed-status":t.closedStatus,"is-editable":t.isEditable===!0,users:t.users,"estimation-unit":(w=t.project)==null?void 0:w.estimationUnit,onAddPhase:i,onUpdatePhase:l,onArchivePhase:c,onUnarchivePhase:d,onCopyPhaseToTemplate:u},null,8,["phases","closed-status","is-editable","users","estimation-unit"])]),t.project.architectureImage?(a.openBlock(),a.createElementBlock("div",UD,[a.createElementVNode("img",{class:"architecture-image",src:t.project.architectureImage.url,alt:a.unref(n)("architectureImage.alt")},null,8,HD)])):a.createCommentVNode("",!0)])])],16),(a.openBlock(),a.createBlock(a.Teleport,{to:"body"},[f.value?(a.openBlock(),a.createBlock(Ag,{key:0,phases:t.phases,onClose:y[4]||(y[4]=k=>f.value=!1),onSave:h},null,8,["phases"])):a.createCommentVNode("",!0),p.value?(a.openBlock(),a.createBlock(Tg,{key:1,"project-id":t.project.id,templates:t.templates,onClose:y[5]||(y[5]=k=>p.value=!1),onApply:m},null,8,["project-id","templates"])):a.createCommentVNode("",!0)]))],64)}}}),$ge="",sr={TEMPLATES:"templates",TEMPLATE_DETAILS:"template_details",TEMPLATES_LIST:"templates_list"},ZD=(t,e={})=>[{path:t,name:sr.TEMPLATES,redirect:{name:sr.TEMPLATES_LIST},...e,children:[{path:"",name:sr.TEMPLATES_LIST,component:Dg},{path:":templateId/:phaseId?/:milestoneId?/:activityId?",name:sr.TEMPLATE_DETAILS,component:Eg,props:!0}]}],Pe={project:"AoProject",feed:"AoProjectFeed",dev:"AoProjectDev",mapping:"AoProjectMapping",milestone:"AoMilestone",activity:"AoActivity"},lr={feed:"ActivityFeed",dev:"ActivityFeedDev"},GD=(t,e={})=>[{path:t,...e,redirect:{name:Pe.project},children:[{path:"",name:Pe.project,component:AN,props:!0,children:[{path:":phaseId/:milestoneId",name:Pe.milestone,component:Ng,props:!0},{path:":phaseId/:milestoneId/:activityId",name:Pe.activity,props:{default:!0,modal:!0},components:{default:Ng,modal:fD}}]},{path:"feed",name:Pe.feed,component:iu,props:n=>({...n.params,feedMode:"standard"})},{path:"dev",name:Pe.dev,component:iu,props:n=>({...n.params,feedMode:"dev"})},{path:"mapping",name:Pe.mapping,component:WD,props:!0}]}],KD={class:"ao-templates"},Dg=a.defineComponent({__name:"AoTemplatesList",props:{templates:{}},emits:["addTemplate","updateTemplates","updateItem","removeItem"],setup(t,{emit:e}){const{t:n}=kn(),o=t,r=e;a.watch(()=>o.templates,(d,u)=>{jn(d,u)});const i=()=>{var m,h;const d=(m=o.templates)==null?void 0:m.at(-1),u=d?rt.LexoRank.parse(d.rank).genNext():rt.LexoRank.middle(),p=((h=o.templates)==null?void 0:h.length)??0,f={name:n("template.defaultName.template",{idx:p+1}),rank:u.format()};r("addTemplate",f)},s=(d,u)=>{r("updateItem",{itemType:ze.TEMPLATES,id:d,templateId:d,data:{name:u}})},l=(d,u)=>{r("removeItem",{itemType:ze.TEMPLATES,templateId:d,data:{id:d,...u?{name:u}:{}}})},c=d=>{if(d.moved){const u=ma(d,o.templates??[]);r("updateItem",{itemType:ze.TEMPLATES,id:d.moved.element.id,templateId:d.moved.element.id,data:{rank:u}})}};return(d,u)=>(a.openBlock(),a.createElementBlock("div",KD,[a.createVNode(ga,null,{secondary:a.withCtx(()=>[a.createVNode(fe,{label:d.$t("templates.new"),color:"primary","icon-name":"Add","icon-position":"start",onClick:i},null,8,["label"])]),_:1}),a.createVNode(a.unref(no),{"model-value":t.templates,class:"ao-templates__list","item-key":"id",handle:".ao-card__drag",onChange:c},{item:a.withCtx(({element:p})=>{var f;return[a.createVNode($5,{id:p.id,title:p.name,phases:p.phases,milestones:(f=p.phases)!=null&&f.length?a.unref(n5)(p.phases):0,activities:p.phases?a.unref(o5)(p.phases):0,"updated-at":p.updatedAt,"updated-by":p.updatedBy,onUpdateTitle:m=>s(p.id,m),onClick:m=>d.$router.push({name:a.unref(sr).TEMPLATE_DETAILS,params:{templateId:p.id}}),onDeleteItem:u[0]||(u[0]=(m,h)=>l(m,h))},null,8,["id","title","phases","milestones","activities","updated-at","updated-by","onUpdateTitle","onClick"])]}),_:1},8,["model-value"])]))}}),Mge="",YD={class:"ao-field__label"},Bg=a.defineComponent({__name:"AoField",props:{label:{},isMultiselect:{type:Boolean,default:!1}},setup(t){return(e,n)=>(a.openBlock(),a.createElementBlock("label",{class:a.normalizeClass(["ao-field",{"ao-field--multiselect":t.isMultiselect}])},[a.createElementVNode("span",YD,a.toDisplayString(t.label),1),a.renderSlot(e.$slots,"default")],2))}}),JD=["type","value","disabled","readonly"],XD=a.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=a.computed(()=>n.modelModifiers.lazy?"change":"input"),i=s=>{n.modelModifiers.number&&(s=Number(s)),o("update:modelValue",s)};return(s,l)=>(a.openBlock(),a.createBlock(Bg,{label:t.label},{default:a.withCtx(()=>[a.createElementVNode("input",a.mergeProps({class:"ao-field__input",type:t.type,value:t.modelValue,disabled:t.isDisabled,readonly:t.isReadonly},{[a.toHandlerKey(r.value)]:l[0]||(l[0]=c=>i(c.target.value))}),null,16,JD)]),_:1},8,["label"]))}}),QD={class:"ao-field"},eB={class:"ao-field__label"},tB=["checked","disabled"],nB=a.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)=>(a.openBlock(),a.createElementBlock("label",QD,[a.createElementVNode("span",eB,a.toDisplayString(t.label),1),a.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,tB)]))}});he.AoAvatar=Pn,he.AoCardFeed=ru,he.AoCheckboxField=nB,he.AoColorPicker=al,he.AoFeed=iu,he.AoField=Bg,he.AoInputField=XD,he.AoMultiselect=kt,he.AoProjectPhases=ou,he.AoTabBar=ai,he.AoTemplateDetails=Eg,he.AoTemplates=Ug,he.AoTemplatesList=Dg,he.EstimationUnit=vu,he.TemplateItemTypeEnum=bu,he.activityFeedRoutes=lr,he.activityFeedStatus=g_,he.durationTypes=h_,he.feedFilterTypes=Ao,he.getProjectOverviewRoutes=GD,he.getTemplateRoutes=ZD,he.listUpdateTypes=b_,he.milestoneStatus=na,he.projectOverviewRoutes=Pe,he.ruleComparators=mu,he.ruleDurationUnits=gu,he.ruleTriggerTypes=hu,he.templateItemType=ze,he.templateRouteNames=sr,Object.defineProperty(he,Symbol.toStringTag,{value:"Module"})});
|
|
59
|
+
*/function ir(t){let e={r:0,g:0,b:0,a:1};/#/.test(t)?e=QT(t):/rgb/.test(t)?e=Sg(t):typeof t=="string"?e=Sg(`rgba(${t})`):Object.prototype.toString.call(t)==="[object Object]"&&(e=t);const{r:n,g:o,b:r,a:i}=e,{h:s,s:l,v:c}=eA(e);return{r:n,g:o,b:r,a:i===void 0?1:i,h:s,s:l,v:c}}function Gd(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 Kd(t,e,n,o,r,i){const s=t==="l",l=e.createLinearGradient(0,0,s?n:0,s?0:o);l.addColorStop(.01,r),l.addColorStop(.99,i),e.fillStyle=l,e.fillRect(0,0,n,o)}function XT({r:t,g:e,b:n},o){const r=s=>("0"+Number(s).toString(16)).slice(-2),i=`#${r(t)}${r(e)}${r(n)}`;return o?i.toUpperCase():i}function QT(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 Sg(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 eA({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),i=o-r;let s=0;o===r?s=0:o===t?e>=n?s=60*(e-n)/i:s=60*(e-n)/i+360:o===e?s=60*(n-t)/i+120:o===n&&(s=60*(t-e)/i+240),s=Math.floor(s);let l=parseFloat((o===0?0:1-r/o).toFixed(2)),c=parseFloat(o.toFixed(2));return{h:s,s:l,v:c}}var Yd=a.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),Kd("l",n,e,e,"#FFFFFF","rgba(255,255,255,0)"),Kd("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=s=>{let l=s.clientX-n,c=s.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 d=o.getImageData(Math.min(l,this.size-1),Math.min(c,this.size-1),1,1),[u,p,f]=d.data;this.$emit("selectSaturation",{r:u,g:p,b:f})};r(t);const i=()=>{document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",i)};document.addEventListener("mousemove",r),document.addEventListener("mouseup",i)}}});const tA={ref:"canvasSaturation"};function nA(t,e,n,o,r,i){return a.openBlock(),a.createBlock("div",{class:"saturation",onMousedown:e[1]||(e[1]=a.withModifiers((...s)=>t.selectSaturation&&t.selectSaturation(...s),["prevent","stop"]))},[a.createVNode("canvas",tA,null,512),a.createVNode("div",{style:t.slideSaturationStyle,class:"slide"},null,4)],32)}Yd.render=nA,Yd.__file="src/color/Saturation.vue";var Jd=a.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=i=>{let s=i.clientY-e;s<0&&(s=0),s>this.height&&(s=this.height),this.slideHueStyle={top:s-2+"px"};const l=n.getImageData(0,Math.min(s,this.height-1),1,1),[c,d,u]=l.data;this.$emit("selectHue",{r:c,g:d,b:u})};o(t);const r=()=>{document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",r)};document.addEventListener("mousemove",o),document.addEventListener("mouseup",r)}}});const oA={ref:"canvasHue"};function rA(t,e,n,o,r,i){return a.openBlock(),a.createBlock("div",{class:"hue",onMousedown:e[1]||(e[1]=a.withModifiers((...s)=>t.selectHue&&t.selectHue(...s),["prevent","stop"]))},[a.createVNode("canvas",oA,null,512),a.createVNode("div",{style:t.slideHueStyle,class:"slide"},null,4)],32)}Jd.render=rA,Jd.__file="src/color/Hue.vue";var Xd=a.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=Gd(o),i=t.getContext("2d");t.width=e,t.height=n,i.fillStyle=i.createPattern(r,"repeat"),i.fillRect(0,0,e,n),Kd("p",i,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 i=r.clientY-e;i<0&&(i=0),i>this.height&&(i=this.height);let s=parseFloat((i/this.height).toFixed(2));this.$emit("selectAlpha",s)};n(t);const o=()=>{document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",o)};document.addEventListener("mousemove",n),document.addEventListener("mouseup",o)}}});const aA={ref:"canvasAlpha"};function iA(t,e,n,o,r,i){return a.openBlock(),a.createBlock("div",{class:"color-alpha",onMousedown:e[1]||(e[1]=a.withModifiers((...s)=>t.selectAlpha&&t.selectAlpha(...s),["prevent","stop"]))},[a.createVNode("canvas",aA,null,512),a.createVNode("div",{style:t.slideAlphaStyle,class:"slide"},null,4)],32)}Xd.render=iA,Xd.__file="src/color/Alpha.vue";var Qd=a.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=Gd(o),i=t.getContext("2d");t.width=e,t.height=n,i.fillStyle=i.createPattern(r,"repeat"),i.fillRect(0,0,e,n),i.fillStyle=this.color,i.fillRect(0,0,e,n)}}});function sA(t,e,n,o,r,i){return a.openBlock(),a.createBlock("canvas")}Qd.render=sA,Qd.__file="src/color/Preview.vue";var eu=a.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:i,height:s}=this.suckerCanvas.getBoundingClientRect(),l=e-r,c=n-o,u=this.suckerCanvas.getContext("2d").getImageData(Math.min(l,i-1),Math.min(c,s-1),1,1);let[p,f,m,h]=u.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(${p}, ${f}, ${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:i,width:s,height:l}=t.getBoundingClientRect(),c=n-i,d=o-r,p=t.getContext("2d").getImageData(Math.min(c,s-1),Math.min(d,l-1),1,1);let[f,m,h,g]=p.data;g=parseFloat((g/255).toFixed(2)),this.$emit("selectSucker",{r:f,g:m,b:h,a:g})}))}}});const lA=a.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),cA={key:1,class:"sucker",viewBox:"-16 -16 68 68",xmlns:"http://www.w3.org/2000/svg",stroke:"#9099a4"},dA=a.createVNode("g",{fill:"none","fill-rule":"evenodd"},[a.createVNode("g",{transform:"translate(1 1)","stroke-width":"4"},[a.createVNode("circle",{"stroke-opacity":".5",cx:"18",cy:"18",r:"18"}),a.createVNode("path",{d:"M36 18c0-9.94-8.06-18-18-18"},[a.createVNode("animateTransform",{attributeName:"transform",type:"rotate",from:"0 18 18",to:"360 18 18",dur:"1s",repeatCount:"indefinite"})])])],-1);function uA(t,e,n,o,r,i){return a.openBlock(),a.createBlock("div",null,[t.isSucking?a.createCommentVNode("v-if",!0):(a.openBlock(),a.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]=(...s)=>t.openSucker&&t.openSucker(...s))},[lA],2)),t.isSucking?(a.openBlock(),a.createBlock("svg",cA,[dA])):a.createCommentVNode("v-if",!0)])}eu.render=uA,eu.__file="src/color/Sucker.vue";var tu=a.defineComponent({props:{name:{type:String,default:""},color:{type:String,default:""}},emits:["inputColor","inputFocus","inputBlur"],setup(t,{emit:e}){return{modelColor:a.computed({get(){return t.color||""},set(i){e("inputColor",i)}}),handleFocus:i=>{e("inputFocus",i)},handleBlur:i=>{e("inputBlur",i)}}}});const pA={class:"color-type"},fA={class:"name"};function mA(t,e,n,o,r,i){return a.openBlock(),a.createBlock("div",pA,[a.createVNode("span",fA,a.toDisplayString(t.name),1),a.withDirectives(a.createVNode("input",{"onUpdate:modelValue":e[1]||(e[1]=s=>t.modelColor=s),class:"value",onFocus:e[2]||(e[2]=(...s)=>t.handleFocus&&t.handleFocus(...s)),onBlur:e[3]||(e[3]=(...s)=>t.handleBlur&&t.handleBlur(...s))},null,544),[[a.vModelText,t.modelColor]])])}tu.render=mA,tu.__file="src/color/Box.vue";var nu=a.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=a.ref(),o=a.ref([]),r=a.ref();t.colorsHistoryKey&&localStorage&&(o.value=JSON.parse(localStorage.getItem(t.colorsHistoryKey))||[]),r.value=Gd(4).toDataURL(),a.onUnmounted(()=>{i(n.value)});function i(l){if(!l)return;const c=o.value||[],d=c.indexOf(l);d>=0&&c.splice(d,1),c.length>=8&&(c.length=7),c.unshift(l),o.value=c||[],localStorage&&t.colorsHistoryKey&&localStorage.setItem(t.colorsHistoryKey,JSON.stringify(c))}function s(l){e("selectColor",l)}return{setColorsHistory:i,colorsHistory:o,color:n,imgAlphaBase64:r,selectColor:s}}});const hA={class:"colors"},gA={key:0,class:"colors history"};function bA(t,e,n,o,r,i){return a.openBlock(),a.createBlock("div",null,[a.createVNode("ul",hA,[(a.openBlock(!0),a.createBlock(a.Fragment,null,a.renderList(t.colorsDefault,s=>(a.openBlock(),a.createBlock("li",{key:s,class:"item",onClick:l=>t.selectColor(s)},[a.createVNode("div",{style:{background:`url(${t.imgAlphaBase64})`},class:"alpha"},null,4),a.createVNode("div",{style:{background:s},class:"color"},null,4)],8,["onClick"]))),128))]),t.colorsHistory.length?(a.openBlock(),a.createBlock("ul",gA,[(a.openBlock(!0),a.createBlock(a.Fragment,null,a.renderList(t.colorsHistory,s=>(a.openBlock(),a.createBlock("li",{key:s,class:"item",onClick:l=>t.selectColor(s)},[a.createVNode("div",{style:{background:`url(${t.imgAlphaBase64})`},class:"alpha"},null,4),a.createVNode("div",{style:{background:s},class:"color"},null,4)],8,["onClick"]))),128))])):a.createCommentVNode("v-if",!0)])}nu.render=bA,nu.__file="src/color/Colors.vue";var Yr=a.defineComponent({components:{Saturation:Yd,Hue:Jd,Alpha:Xd,Preview:Qd,Sucker:eu,Box:tu,Colors:nu},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 XT(this.rgba,!0)}},created(){Object.assign(this,ir(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:i,v:s}=ir(t);Object.assign(this,{r:e,g:n,b:o,h:r,s:i,v:s}),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:i,v:s}=ir(t);Object.assign(this,{r:e,g:n,b:o,h:r,s:i,v:s}),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:i,s,v:l}=ir(t);Object.assign(this,{r:e,g:n,b:o,a:r,h:i,s,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:i,s,v:l}=ir(t);Object.assign(this,{r:e,g:n,b:o,a:r,h:i,s,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:i,s,v:l}=ir(t);Object.assign(this,{r:e,g:n,b:o,a:r,h:i,s,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:i,s,v:l}=ir(t);Object.assign(this,{r:e,g:n,b:o,a:r,h:i,s,v:l}),this.setText(),this.$nextTick(()=>{this.$refs.saturation.renderColor(),this.$refs.saturation.renderSlide(),this.$refs.hue.renderSlide()})}}});const vA={class:"color-set"};function yA(t,e,n,o,r,i){const s=a.resolveComponent("Saturation"),l=a.resolveComponent("Hue"),c=a.resolveComponent("Alpha"),d=a.resolveComponent("Preview"),u=a.resolveComponent("Sucker"),p=a.resolveComponent("Box"),f=a.resolveComponent("Colors");return a.openBlock(),a.createBlock("div",{class:["hu-color-picker",{light:t.isLightTheme}],style:{width:t.totalWidth+"px"}},[a.createVNode("div",vA,[a.createVNode(s,{ref:"saturation",color:t.rgbString,hsv:t.hsv,size:t.hueHeight,onSelectSaturation:t.selectSaturation},null,8,["color","hsv","size","onSelectSaturation"]),a.createVNode(l,{ref:"hue",hsv:t.hsv,width:t.hueWidth,height:t.hueHeight,onSelectHue:t.selectHue},null,8,["hsv","width","height","onSelectHue"]),a.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"])]),a.createVNode("div",{style:{height:t.previewHeight+"px"},class:"color-show"},[a.createVNode(d,{color:t.rgbaString,width:t.previewWidth,height:t.previewHeight},null,8,["color","width","height"]),t.suckerHide?a.createCommentVNode("v-if",!0):(a.openBlock(),a.createBlock(u,{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),a.createVNode(p,{name:"HEX",color:t.modelHex,onInputColor:t.inputHex,onInputFocus:t.handleFocus,onInputBlur:t.handleBlur},null,8,["color","onInputColor","onInputFocus","onInputBlur"]),a.createVNode(p,{name:"RGBA",color:t.modelRgba,onInputColor:t.inputRgba,onInputFocus:t.handleFocus,onInputBlur:t.handleBlur},null,8,["color","onInputColor","onInputFocus","onInputBlur"]),a.createVNode(f,{color:t.rgbaString,"colors-default":t.colorsDefault,"colors-history-key":t.colorsHistoryKey,onSelectColor:t.selectColor},null,8,["color","colors-default","colors-history-key","onSelectColor"]),a.createCommentVNode(" custom options "),a.renderSlot(t.$slots,"default")],6)}Yr.render=yA,Yr.__file="src/color/ColorPicker.vue",Yr.install=t=>{t.component(Yr.name,Yr)};const hge="",_A={class:"color-picker-wrapper"},al=a.defineComponent({__name:"AoColorPicker",props:{color:{}},emits:["update:color"],setup(t,{emit:e}){const n=t,o=e,r=a.ref(!1),i=a.ref(null),s=a.ref(null),l=a.ref(0),c=a.ref(0),d=async h=>{s.value=h,r.value=!0,await a.nextTick();const g=h.getBoundingClientRect(),v=i.value,_=(v==null?void 0:v.offsetHeight)||300,b=window.innerHeight-g.bottom,y=g.top,w=b<_&&y>_;console.log("pickerHeight = "+_),l.value=w?g.top-_-8:g.bottom+8,c.value=g.left,setTimeout(()=>{window.addEventListener("click",p)},0)},u=a.computed(()=>({position:"fixed",top:`${l.value}px`,left:`${c.value}px`,zIndex:1e3})),p=h=>{const g=h.target;i.value&&!i.value.contains(g)&&(r.value=!1,o("update:color",f.value),window.removeEventListener("click",p))};a.onBeforeUnmount(()=>{window.removeEventListener("click",p)}),a.watch(()=>n.color,h=>{r.value||(f.value=h)});const f=a.ref(n.color),m=h=>{const{r:g,g:v,b:_,a:b}=h.rgba;f.value=`rgba(${g}, ${v}, ${_}, ${b})`};return(h,g)=>(a.openBlock(),a.createElementBlock("div",_A,[a.renderSlot(h.$slots,"clickable",{openPicker:d,bgColor:t.color}),r.value?(a.openBlock(),a.createElementBlock("div",{key:0,ref_key:"pickerRef",ref:i,class:"color-picker",style:a.normalizeStyle(u.value)},[a.createVNode(a.unref(Yr),{class:"color-picker-box",theme:"light",color:t.color,onChangeColor:m},null,8,["color"])],4)):a.createCommentVNode("",!0)]))}}),gge="",CA={class:"ao-card-project-phase__header"},wA={class:"ao-card-project-item__title-line"},kA={key:0,class:"ao-card-project-item-phase__estimation"},xA={class:"ao-card-project-phase__footer"},EA={key:0,class:"ao-card-project-phase__footer-row ao-card-project-phase__footer-row--progress"},SA={class:"ao-card-project-phase__subitem"},TA={class:"ao-card-project-phase__subitem"},AA={key:0,class:"ao-card-project-phase__secondary"},NA={class:"ao-card-project-phase__deadline ao-card-project-phase__deadline--readonly"},DA=a.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)},i=a.computed(()=>{var g;return((g=n.milestones)==null?void 0:g.reduce((v,_)=>{var b;return v+((b=_.activities)==null?void 0:b.reduce((y,w)=>y+(w.estimation||0),0))},0))||0}),s=a.computed(()=>!n.milestones||!n.timeTrackingData?0:n.milestones.reduce((g,v)=>{var _;return g+(((_=v.activities)==null?void 0:_.reduce((b,y)=>{var k;const w=(k=n.timeTrackingData)==null?void 0:k[y.id];return b+((w==null?void 0:w.timeSpent)||0)},0))||0)},0)),l=a.computed(()=>n.estimationUnit==="days"?"d":"h"),c=a.computed(()=>Ai(s.value,n.estimationUnit)),d=a.computed(()=>{var g;return(g=n.milestones)==null?void 0:g.length}),u=a.computed(()=>{var g;return(g=n.milestones)==null?void 0:g.filter(v=>v.status===na.done).length}),p=a.computed(()=>(u.value||0)/(d.value||1)),f=a.computed({get:()=>n.deadline??"",set:g=>o("update:deadline",g!=null&&g.length?g:null)}),m=a.computed({get:()=>n.color,set:g=>{o("updatePhase",{id:n.id,color:g})}}),h=(g,v)=>{const _=g.target;_.closest("button")||_.closest("input")||_.closest(".ao-title")||v(_)};return(g,v)=>(a.openBlock(),a.createBlock(al,{color:m.value,"onUpdate:color":v[2]||(v[2]=_=>m.value=_)},{clickable:a.withCtx(({openPicker:_,bgColor:b})=>[a.createVNode(ol,{class:"ao-card-project-phase","is-clickable":t.isEditable,color:b,"with-left-border":!0,onClick:y=>h(y,_)},a.createSlots({default:a.withCtx(()=>[a.createElementVNode("div",wA,[a.createVNode(bt,{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"]),i.value||s.value?(a.openBlock(),a.createElementBlock("span",kA," ("+a.toDisplayString(c.value)+"/"+a.toDisplayString(i.value)+a.toDisplayString(l.value)+")",1)):a.createCommentVNode("",!0)])]),footer:a.withCtx(()=>[a.createElementVNode("div",xA,[d.value?(a.openBlock(),a.createElementBlock("div",EA,[a.createElementVNode("div",SA,[a.createVNode(Ce,{name:"MountainFlagOutlineRounded",size:"sm"}),a.createElementVNode("span",TA,a.toDisplayString(u.value)+" / "+a.toDisplayString(d.value),1)]),a.createVNode(rl,{percentages:p.value,class:"ao-card-project-phase__progress",color:t.color},null,8,["percentages","color"]),g.$slots.secondary?(a.openBlock(),a.createElementBlock("div",AA,[a.renderSlot(g.$slots,"secondary")])):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0),a.createElementVNode("div",{class:a.normalizeClass(["ao-card-project-phase__footer-row",f.value?"":"ao-card-project-phase__no_deadline"])},[t.isEditable?a.withDirectives((a.openBlock(),a.createElementBlock("input",{key:0,"onUpdate:modelValue":v[1]||(v[1]=y=>f.value=y),class:"ao-card-project-phase__deadline ao-card-project-phase__deadline--input",type:"date"},null,512)),[[a.vModelText,f.value,void 0,{lazy:!0}]]):a.createCommentVNode("",!0),a.createElementVNode("span",NA,a.toDisplayString(a.unref(Ni)(t.deadline)),1)],2)])]),_:2},[t.isEditable?{name:"header",fn:a.withCtx(()=>[a.createElementVNode("div",CA,[a.createVNode(fe,{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:v[0]||(v[0]=a.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"]))}}),bge="",BA=a.defineComponent({__name:"AoBadge",props:{color:{}},setup(t){return(e,n)=>(a.openBlock(),a.createElementBlock("span",{class:"aoBadge",style:a.normalizeStyle({backgroundColor:t.color})},null,4))}}),vge="",$A={class:"ao-card-project-milestone__default"},MA={class:"ao-title-with-badge-wrapper"},LA={class:"ao-card-project-item__title-line"},OA={key:0,class:"ao-card-project-item-milestone__estimation"},IA={key:0,class:"ao-card-project-milestone__archive"},VA={class:"ao-card-project-milestone__activities"},PA={class:"ao-card-project-milestone__activities-row"},RA={class:"ao-card-project-milestone__subitem"},FA={class:"ao-card-project-milestone__subitem"},zA={key:1,class:"ao-card-project-milestone__secondary"},qA={class:"ao-card-project-milestone__footer"},jA={key:1,class:"ao-field ao-card-project-milestone__deadline"},UA={class:"ao-field__label"},HA={key:2,class:"ao-card-project-milestone__assignee"},WA=a.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=a.computed(()=>{var f;return((f=n.activities)==null?void 0:f.reduce((m,h)=>m+(h.estimation||0),0))||0}),i=a.computed(()=>!n.activities||!n.timeTrackingData?0:n.activities.reduce((f,m)=>{var g;const h=(g=n.timeTrackingData)==null?void 0:g[m.id];return f+((h==null?void 0:h.timeSpent)||0)},0)),s=a.computed(()=>n.estimationUnit==="days"?"d":"h"),l=a.computed(()=>Ai(i.value,n.estimationUnit));a.computed(()=>{const f=i.value/60;return f%1===0?f.toString():f.toFixed(2)});const c=a.computed(()=>{var f;return(f=n.activities)==null?void 0:f.length}),d=a.computed(()=>{var f;return(f=n.activities)==null?void 0:f.filter(m=>_l(m,n.closedStatus)).length}),u=a.computed(()=>(d.value||0)/(c.value||1)),p=f=>{o("updateMilestone",{id:n.id,name:f})};return(f,m)=>(a.openBlock(),a.createBlock(ol,{class:a.normalizeClass(["ao-card-project-milestone"]),"is-clickable":!t.readonly,"tag-name":"li","is-selected":t.isSelected,color:t.phaseColor},{default:a.withCtx(()=>[a.createElementVNode("div",$A,[a.createElementVNode("div",MA,[a.createVNode(BA,{color:t.color||""},null,8,["color"]),a.createElementVNode("div",LA,[a.createVNode(bt,{id:t.id,title:t.name||"",level:5,"is-editable":!t.readonly&&t.isEditable,class:"ao-card-project-milestone__title","onUpdate:title":p},null,8,["id","title","is-editable"]),r.value||i.value?(a.openBlock(),a.createElementBlock("span",OA," ("+a.toDisplayString(l.value)+"/"+a.toDisplayString(r.value)+a.toDisplayString(s.value)+")",1)):a.createCommentVNode("",!0)])]),!t.readonly&&t.isEditable?(a.openBlock(),a.createElementBlock("div",IA,[a.createVNode(fe,{color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:t.active?f.$t("archive"):f.$t("unarchive"),onClick:m[0]||(m[0]=a.withModifiers(()=>t.active?f.$emit("archiveMilestone",{id:t.id}):f.$emit("unarchiveMilestone",{id:t.id}),["stop"]))},null,8,["label"])])):a.createCommentVNode("",!0)]),a.createElementVNode("div",VA,[a.createElementVNode("div",PA,[c.value?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createElementVNode("div",RA,[a.createVNode(Ce,{name:"SelectCheckBox",size:"sm"}),a.createElementVNode("span",FA,a.toDisplayString(d.value)+" / "+a.toDisplayString(c.value),1)]),a.createVNode(rl,{percentages:u.value,color:t.phaseColor,class:"ao-card-project-milestone__progress"},null,8,["percentages","color"])],64)):a.createCommentVNode("",!0),f.$slots.secondary?(a.openBlock(),a.createElementBlock("div",zA,[a.renderSlot(f.$slots,"secondary")])):a.createCommentVNode("",!0)])])]),footer:a.withCtx(()=>[a.createElementVNode("div",qA,[t.important?(a.openBlock(),a.createBlock(Ce,{key:0,name:"FlagRounded",class:a.normalizeClass(t.isSelected?"ao-card-project-milestone__important--selected":"ao-card-project-milestone__important"),size:"sm"},null,8,["class"])):a.createCommentVNode("",!0),t.deadline?(a.openBlock(),a.createElementBlock("label",jA,[a.createElementVNode("span",UA,a.toDisplayString(a.unref(Ni)(t.deadline)),1)])):a.createCommentVNode("",!0),t.assignee?(a.openBlock(),a.createElementBlock("div",HA,[a.createVNode(Pn,{"user-name":a.unref(zu)(t.assignee),"avatar-url":t.assignee.avatarUrl,color:t.isSelected?"black":"primary",size:"sm"},null,8,["user-name","avatar-url","color"])])):a.createCommentVNode("",!0)])]),_:3},8,["is-clickable","is-selected","color"]))}}),yge="",ZA={class:"ao-mapping-card-project-phase__header"},GA={class:"ao-card-project-item__title-line"},KA={key:0,class:"ao-card-project-item-phase__estimation"},YA={class:"ao-mapping-card-project-phase__footer"},JA={key:0,class:"ao-mapping-card-project-phase__footer-row ao-mapping-card-project-phase__footer-row--progress"},XA={class:"ao-mapping-card-project-phase__subitem"},QA={class:"ao-mapping-card-project-phase__subitem"},eN={key:0,class:"ao-mapping-card-project-phase__secondary"},tN={class:"ao-mapping-card-project-phase__deadline ao-mapping-card-project-phase__deadline--readonly"},nN=a.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)},i=a.computed(()=>{var g;return((g=n.milestones)==null?void 0:g.reduce((v,_)=>{var b;return v+((b=_.activities)==null?void 0:b.reduce((y,w)=>y+(w.estimation||0),0))},0))||0}),s=a.computed(()=>!n.milestones||!n.timeTrackingData?0:n.milestones.reduce((g,v)=>{var _;return g+(((_=v.activities)==null?void 0:_.reduce((b,y)=>{var k;const w=(k=n.timeTrackingData)==null?void 0:k[y.id];return b+((w==null?void 0:w.timeSpent)||0)},0))||0)},0)),l=a.computed(()=>n.estimationUnit==="days"?"d":"h"),c=a.computed(()=>Ai(s.value,n.estimationUnit)),d=a.computed(()=>{var g;return(g=n.milestones)==null?void 0:g.length}),u=a.computed(()=>{var g;return(g=n.milestones)==null?void 0:g.filter(v=>v.status===na.done).length}),p=a.computed(()=>(u.value||0)/(d.value||1)),f=a.computed({get:()=>n.deadline??"",set:g=>o("update:deadline",g!=null&&g.length?g:null)}),m=a.computed({get:()=>n.color,set:g=>{o("updatePhase",{id:n.id,color:g})}}),h=(g,v)=>{const _=g.target;_.closest("button")||_.closest("input")||_.closest(".ao-title")||v()};return(g,v)=>(a.openBlock(),a.createBlock(al,{color:m.value,"onUpdate:color":v[2]||(v[2]=_=>m.value=_)},{clickable:a.withCtx(({openPicker:_,bgColor:b})=>[a.createVNode(ol,{class:"ao-mapping-card-project-phase","is-clickable":t.isEditable,color:b,"with-left-border":!0,onClick:y=>h(y,_)},a.createSlots({default:a.withCtx(()=>[a.createElementVNode("div",GA,[a.createVNode(bt,{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"]),i.value||s.value?(a.openBlock(),a.createElementBlock("span",KA," ("+a.toDisplayString(c.value)+"/"+a.toDisplayString(i.value)+a.toDisplayString(l.value)+")",1)):a.createCommentVNode("",!0)])]),footer:a.withCtx(()=>[a.createElementVNode("div",YA,[d.value?(a.openBlock(),a.createElementBlock("div",JA,[a.createElementVNode("div",XA,[a.createVNode(Ce,{name:"MountainFlagOutlineRounded",size:"sm"}),a.createElementVNode("span",QA,a.toDisplayString(u.value)+" / "+a.toDisplayString(d.value),1)]),a.createVNode(rl,{percentages:p.value,class:"ao-mapping-card-project-phase__progress",color:m.value},null,8,["percentages","color"]),g.$slots.secondary?(a.openBlock(),a.createElementBlock("div",eN,[a.renderSlot(g.$slots,"secondary")])):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0),a.createElementVNode("div",{class:a.normalizeClass(["ao-mapping-card-project-phase__footer-row",f.value?"":"ao-mapping-card-project-phase__no_deadline"])},[t.isEditable?a.withDirectives((a.openBlock(),a.createElementBlock("input",{key:0,"onUpdate:modelValue":v[1]||(v[1]=y=>f.value=y),class:"ao-mapping-card-project-phase__deadline ao-mapping-card-project-phase__deadline--input",type:"date"},null,512)),[[a.vModelText,f.value,void 0,{lazy:!0}]]):a.createCommentVNode("",!0),a.createElementVNode("span",tN,a.toDisplayString(a.unref(Ni)(t.deadline)),1)],2)])]),_:2},[t.isEditable?{name:"header",fn:a.withCtx(()=>[a.createElementVNode("div",ZA,[a.createVNode(fe,{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:v[0]||(v[0]=a.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"]))}}),_ge="",oN={class:"ao-project-phase"},rN={key:0,class:"ao-project-phase__drag ao-card__drag"},aN={key:1,class:"ao-project-phase__col-phase"},iN={key:2,class:"ao-mapping-project-phase__col-phase"},sN={key:0,class:"ao-project-phase__col-milestones"},lN=["title"],cN={class:"ao-project-phase__milestones-list-footer"},dN=a.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}=kn(),o=t,r=e;a.watch(()=>o.phase.milestones,(k,C)=>{jn(k,C)});const i=k=>{r("updatePhase",{id:o.phase.id,name:k})},s=k=>{r("updatePhase",{id:o.phase.id,deadline:k})},l=k=>{r("updatePhase",k)},c=a.computed(()=>o.phase.milestones.map(k=>i5(k,o.closedStatus))),d=k=>{const{name:C,rank:x}=ar(c.value??[],"milestone",n);r("addMilestone",{name:C,rank:x,phaseId:k})},u=k=>{const C=n("template.defaultName.milestone",{idx:1}),x=ha(c.value??[]);r("addMilestone",{name:C,rank:x,phaseId:k})},p=k=>{r("updateMilestone",k)},f=k=>{r("archiveMilestone",k)},m=k=>{r("unarchiveMilestone",k)},h=k=>{r("archivePhase",k)},g=k=>{r("unarchivePhase",k)},v=k=>{"added"in k?r("updateMilestone",{id:k.added.element.id,phaseId:o.phase.id,rank:mr(c.value,k.added.newIndex)}):"removed"in k||"moved"in k&&r("updateMilestone",{id:k.moved.element.id,rank:mr(c.value,k.moved.newIndex)})},_=Ct.useRoute(),b=a.computed(()=>_.path.includes("/mapping")),y=a.computed(()=>{var k;return o.phase.id===((k=_.params)==null?void 0:k.phaseId)});a.ref(!1);const w=a.computed(()=>{var k;return o.phase.id!==((k=_.params)==null?void 0:k.phaseId)?{backgroundColor:"var(--ao-color-sheet)"}:o.phase.color?{backgroundColor:l5(o.phase.color)}:{backgroundColor:"var(--ao-color-primary-lightest)"}});return(k,C)=>(a.openBlock(),a.createElementBlock("li",oN,[a.createElementVNode("div",{class:"ao-project-phases__draggable-card",style:a.normalizeStyle(w.value)},[t.isEditable?(a.openBlock(),a.createElementBlock("div",rN,[a.createVNode(Ce,{name:"DragIndicator",class:"ao-project-phase__drag-handle"})])):a.createCommentVNode("",!0),b.value?(a.openBlock(),a.createElementBlock("div",iN,[a.createVNode(nN,{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":s,"onUpdate:title":i,onArchivePhase:h,onUnarchivePhase:g,onUpdatePhase:l},null,8,["id","milestones","name","deadline","active","is-editable","color","estimation-unit"])])):(a.openBlock(),a.createElementBlock("div",aN,[a.createVNode(DA,{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":s,"onUpdate:title":i,onArchivePhase:h,onUnarchivePhase:g,onUpdatePhase:l},null,8,["id","milestones","name","deadline","active","is-editable","color","time-tracking-data","estimation-unit"])]))],4),b.value?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("div",sN,[a.createElementVNode("div",{class:"ao-project-phase__milestones ao-project-phase__milestones--hoverable",style:a.normalizeStyle(w.value)},[t.isEditable?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(["ao-project-phase__milestone-quick-add",{"ao-project-phase__milestone-quick-add--visible":y.value}]),title:k.$t("project.milestone.add"),onClick:C[0]||(C[0]=()=>u(t.phase.id))},[a.createVNode(Ce,{name:"Add",class:"ao-project-phase__milestone-quick-add-icon"})],10,lN)):a.createCommentVNode("",!0),a.createVNode(a.unref(no),a.mergeProps({class:"ao-project-phase__milestones-list",list:c.value,disabled:t.readonly||!t.isEditable,"item-key":"id",group:"kanban"},k.$attrs,{onChange:v}),{item:a.withCtx(({element:x})=>{var T;return[a.createVNode(WA,{id:x.id,name:x.name,color:x.color,"phase-color":t.phase.color,activities:x.activities,deadline:x.deadline,active:x.active,"is-editable":!t.readonly&&t.isEditable,"is-draggable":!t.readonly&&t.isEditable,"closed-status":t.closedStatus,"is-selected":x.id===((T=k.$route.params)==null?void 0:T.milestoneId),assignee:x.assignee,important:x.important,readonly:t.readonly,"time-tracking-data":t.timeTrackingData,"estimation-unit":t.estimationUnit,class:a.normalizeClass(["ao-project-phase__milestone"]),onClick:S=>!t.readonly&&k.$router.push({name:a.unref(Pe).milestone,params:{phaseId:t.phase.id,milestoneId:x.id}}),onUpdateMilestone:p,onArchiveMilestone:f,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"]),a.createElementVNode("div",cN,[t.isEditable?(a.openBlock(),a.createBlock(ro,{key:0,label:k.$t("project.milestone.add"),class:"ao-project-phase__milestone-add","icon-name":"Add",onClick:C[1]||(C[1]=()=>d(t.phase.id))},null,8,["label"])):a.createCommentVNode("",!0)])],4)]))]))}}),Cge="",uN={class:"ao-project__phases"},pN={key:0,class:"ao-project-phase__phases-list-footer"},fN={class:"ao-project-phase__col-phase"},ou=a.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;a.watch(()=>n.phases,(m,h)=>{jn(m,h)});const r=m=>{o("addMilestone",m)},i=m=>{o("updateMilestone",m)},s=m=>{o("archiveMilestone",m)},l=m=>{o("unarchiveMilestone",m)},c=m=>{o("archivePhase",m)},d=m=>{o("unarchivePhase",m)},u=m=>{if(m.moved){const h=ma(m,n.phases??[]);o("updatePhase",{id:m.moved.element.id,rank:h})}},p=m=>{o("updatePhase",m)},f=m=>{o("addPhase",m)};return(m,h)=>(a.openBlock(),a.createElementBlock("div",uN,[a.createVNode(a.unref(no),{class:"ao-project-phase__phases-list","model-value":t.phases,"item-key":"id",handle:".ao-card__drag",onChange:u},{item:a.withCtx(({element:g})=>[a.createVNode(dN,{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:i,onArchiveMilestone:s,onUnarchiveMilestone:l,onUpdatePhase:p,onArchivePhase:c,onUnarchivePhase:d},null,8,["phase","is-editable","closed-status","users","readonly","time-tracking-data","estimation-unit"])]),_:1},8,["model-value"]),t.isEditable?(a.openBlock(),a.createElementBlock("div",pN,[h[0]||(h[0]=a.createElementVNode("div",{class:"ao-project-phase__empty_drag"},null,-1)),a.createElementVNode("div",fN,[a.createVNode(ro,{label:m.$t("project.phases.add"),"icon-name":"Add",class:"ao-project-phase__add-phase",onClick:f},null,8,["label"])]),h[1]||(h[1]=a.createElementVNode("div",{class:"ao-project-phase__col-milestones"},null,-1))])):a.createCommentVNode("",!0)]))}}),wge="",mN={class:"ao-add-template-modal__form-body"},hN={class:"field__row"},gN={class:"ao-add-template-modal__form-footer"},Tg=a.defineComponent({__name:"AoAddTemplateModal",props:{projectId:{},templates:{}},emits:["apply"],setup(t,{emit:e}){const n=t,o=e,r=a.computed(()=>n.templates.map(c=>({value:c.id,label:c.name}))),i=a.ref(null),s=c=>{i.value=c},l=()=>{i.value&&o("apply",i.value,n.projectId)};return(c,d)=>(a.openBlock(),a.createBlock(Di,{size:"sm"},{header:a.withCtx(()=>[a.createVNode(bt,{title:c.$t("project.template.apply.title"),level:3},null,8,["title"])]),default:a.withCtx(()=>[a.createElementVNode("form",{class:"ao-add-template-modal__form",onSubmit:a.withModifiers(l,["prevent"])},[a.createElementVNode("p",null,a.toDisplayString(c.$t("project.template.apply.notice")),1),a.createElementVNode("div",mN,[a.createElementVNode("div",hN,[a.createVNode(kt,{value:i.value,options:r.value,detached:!0,onChange:s},null,8,["value","options"])])]),a.createElementVNode("footer",gN,[a.createVNode(fe,{label:c.$t("project.template.apply.label"),type:"submit",color:"primary",variant:"solid",onClick:l},null,8,["label"])])],32)]),_:1}))}}),kge="",bN={class:"ao-save-template-modal__form-body"},vN={class:"field__row"},yN={class:"ao-field ao-field--inline"},_N={class:"ao-field__label"},CN={class:"ao-save-template-modal__phases"},wN={class:"ao-field__label"},kN={class:"ao-save-template-modal__phases-list"},xN=["value"],EN={class:"ao-save-template-modal__form-footer"},Ag=a.defineComponent({__name:"AoSaveTemplateModal",props:{phases:{}},emits:["save"],setup(t,{emit:e}){const n=t,o=e,r=a.ref(""),i=a.ref([]);a.onMounted(()=>{i.value=n.phases.map(l=>l.id)});const s=()=>{r.value&&o("save",r.value,i.value)};return(l,c)=>(a.openBlock(),a.createBlock(Di,{size:"sm"},{header:a.withCtx(()=>[a.createVNode(bt,{title:l.$t("project.template.save.title"),level:3},null,8,["title"])]),default:a.withCtx(()=>[a.createElementVNode("form",{class:"ao-save-template-modal__form",onSubmit:a.withModifiers(s,["prevent"])},[a.createElementVNode("div",bN,[a.createElementVNode("div",vN,[a.createElementVNode("label",yN,[a.createElementVNode("span",_N,a.toDisplayString(l.$t("project.template.name.label"))+": ",1),a.withDirectives(a.createElementVNode("input",{"onUpdate:modelValue":c[0]||(c[0]=d=>r.value=d),type:"text"},null,512),[[a.vModelText,r.value]])])]),a.createElementVNode("div",CN,[a.createElementVNode("div",wN,a.toDisplayString(l.$t("project.template.phases.label")),1),a.createElementVNode("div",kN,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.phases,d=>(a.openBlock(),a.createElementBlock("label",{key:d.id,class:"ao-field ao-field--checkbox"},[a.withDirectives(a.createElementVNode("input",{"onUpdate:modelValue":c[1]||(c[1]=u=>i.value=u),type:"checkbox",value:d.id},null,8,xN),[[a.vModelCheckbox,i.value]]),a.createElementVNode("span",null,a.toDisplayString(d.name),1)]))),128))])])]),a.createElementVNode("footer",EN,[a.createVNode(fe,{label:l.$t("project.template.save.label"),type:"submit",color:"primary",variant:"solid",onClick:s},null,8,["label"])])],32)]),_:1}))}}),xge="",SN={class:"ao-project"},TN={class:"ao-project__body"},AN=a.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}=kn(),o=t,r=e,i=a.computed(()=>o.phases.flatMap(R=>R.milestones)),s=()=>{const{name:R,rank:Q}=ar(o.phases,"phase",n);r("addPhase",{name:R,rank:Q,projectId:o.project.id})},l=()=>{const R=n("template.defaultName.phase",{idx:1}),Q=ha(o.phases);r("addPhase",{name:R,rank:Q,projectId:o.project.id})},c=R=>{r("updatePhase",R)},d=R=>{r("archivePhase",R)},u=R=>{r("unarchivePhase",R)},p=R=>{r("copyPhaseToTemplate",R)},f=R=>{r("addMilestone",R)},m=R=>{r("updateMilestone",R)},h=R=>{r("archiveMilestone",R)},g=R=>{r("unarchiveMilestone",R)},v=R=>{r("addActivity",R)},_=R=>{r("update:activity",R)},b=R=>{r("archiveActivity",R)},y=R=>{r("unarchiveActivity",R)},w=R=>{r("addSubtask",R)},k=R=>{r("updateSubtask",R)},C=R=>{r("deleteSubtask",R)},x=a.computed(()=>i.value.flatMap(R=>R.activities)),T=R=>{r("addFiles",R)},S=R=>{r("removeFile",R)},N=R=>{r("addComment",R)},I=R=>{r("updateComment",R)},A=R=>{r("removeComment",R)},D=a.ref(!1),B=a.ref(!1),O=(R,Q)=>{r("applyTemplate",{templateId:R,projectId:Q}),D.value=!1},V=(R,Q)=>{var ie;const ee=(ie=o.templates)==null?void 0:ie.at(-1),be=ee?rt.LexoRank.parse(ee.rank).genNext():rt.LexoRank.middle();r("saveTemplate",{templateName:R,rank:be.format(),phaseIds:Q}),B.value=!1},H=Ct.useRouter(),P=a.ref("overview"),U=[{label:"Overview",value:"overview"},{label:"Feed",value:"feed"},{label:"Dev",value:"dev"},{label:"Mapping",value:"mapping"}];return a.watch(P,R=>{R==="feed"?(H.push({name:Pe.feed}),console.log("Navigating to feed...")):R==="dev"?(H.push({name:Pe.dev}),console.log("Navigating to dev...")):R==="overview"?(H.push({name:Pe.project}),console.log("Navigating to feed...")):R==="mapping"&&(H.push({name:Pe.mapping}),console.log("Navigating to feed..."))}),(R,Q)=>{var be;const ee=a.resolveComponent("RouterView");return a.openBlock(),a.createElementBlock(a.Fragment,null,[a.createElementVNode("div",a.mergeProps({class:"ao-project-overview"},R.$attrs),[a.createElementVNode("div",SN,[a.createVNode(ga,null,{primary:a.withCtx(()=>[a.createVNode(ai,{modelValue:P.value,"onUpdate:modelValue":Q[0]||(Q[0]=ie=>P.value=ie),tabs:U},null,8,["modelValue"]),a.createVNode(fe,{class:"ao-feed__show-archived",size:"sm","icon-name":t.showsArchived?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:R.$t("feed.filters.showsArchived.label"),role:"checkbox","aria-checked":t.showsArchived,onClick:Q[1]||(Q[1]=ie=>R.$emit("update:showsArchived",!t.showsArchived))},null,8,["icon-name","label","aria-checked"])]),secondary:a.withCtx(()=>[t.isEditable===!0?(a.openBlock(),a.createBlock(fe,{key:0,class:"ao-project-overview__quick-add-phase",size:"sm","icon-name":"Add","icon-position":"start",color:"primary",variant:"ghost",label:R.$t("project.phase.add"),onClick:l},null,8,["label"])):a.createCommentVNode("",!0),t.isEditable===!0?(a.openBlock(),a.createBlock(fe,{key:1,class:"ao-project-overview__save-as-template",color:"primary",label:R.$t("project.template.save.label"),onClick:Q[2]||(Q[2]=ie=>B.value=!0)},null,8,["label"])):a.createCommentVNode("",!0),t.isEditable===!0?(a.openBlock(),a.createBlock(fe,{key:2,class:"ao-project-overview__add-template",color:"primary",label:R.$t("project.template.apply.label"),onClick:Q[3]||(Q[3]=ie=>D.value=!0)},null,8,["label"])):a.createCommentVNode("",!0)]),_:1}),a.createElementVNode("div",TN,[a.createVNode(ou,{phases:t.phases,"closed-status":t.closedStatus,"is-editable":t.isEditable===!0,users:t.users,"time-tracking-data":t.timeTrackingData,"estimation-unit":(be=t.project)==null?void 0:be.estimationUnit,onAddMilestone:f,onUpdateMilestone:m,onArchiveMilestone:h,onUnarchiveMilestone:g,onAddPhase:s,onUpdatePhase:c,onArchivePhase:d,onUnarchivePhase:u,onCopyPhaseToTemplate:p},null,8,["phases","closed-status","is-editable","users","time-tracking-data","estimation-unit"])])]),a.createVNode(ee,{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]=ie=>R.$router.push({name:a.unref(Pe).project})),onUpdateMilestone:m,onAddActivity:v,onUpdateActivity:_,onArchiveActivity:b,onUnarchiveActivity:y},null,8,["phases","project-id","project-name","users","is-editable","closed-status","time-tracking-data"]),(a.openBlock(),a.createBlock(a.Teleport,{to:"body"},[a.createVNode(ee,{name:"modal",activities:x.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":_,onAddSubtask:w,onUpdateSubtask:k,onDeleteSubtask:C,onAddFiles:T,onRemoveFile:S,onAddComment:N,onUpdateComment:I,onRemoveComment:A},{default:a.withCtx(({Component:ie})=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(ie),null,{default:a.withCtx(se=>[a.renderSlot(R.$slots,"activityDetailsBody",a.normalizeProps(a.guardReactiveProps(se)))]),_: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),(a.openBlock(),a.createBlock(a.Teleport,{to:"body"},[B.value?(a.openBlock(),a.createBlock(Ag,{key:0,phases:t.phases,onClose:Q[5]||(Q[5]=ie=>B.value=!1),onSave:V},null,8,["phases"])):a.createCommentVNode("",!0),D.value?(a.openBlock(),a.createBlock(Tg,{key:1,"project-id":t.project.id,templates:t.templates,onClose:Q[6]||(Q[6]=ie=>D.value=!1),onApply:O},null,8,["project-id","templates"])):a.createCommentVNode("",!0)]))],64)}}}),Ege="",NN={class:"ao-card-feed__header"},DN={key:1,class:"ao-card-feed__header-secondary ao-card-feed__header-icons"},BN={key:2,class:"ao-card-feed__header-secondary ao-card-feed__secondary"},$N={class:"ao-card-feed__body"},MN={key:0,class:"ao-card-feed__breadcrumbs"},LN={class:a.normalizeClass(["ao-card-feed__title-group"])},ON={class:"ao-card-feed__title-line"},IN={key:0,class:"ao-card-feed__slug"},VN={key:1,class:"ao-card-feed__deadline"},PN={class:"ao-card-feed__footer"},RN={class:"ao-card-feed__footer-row"},FN={class:"ao-assignees"},zN={key:0,class:"ao-assignee"},qN={key:0,class:"ao-card-feed__subitems"},jN={key:0,class:"ao-card-feed__subitem"},UN={class:"ao-card-feed__subitem"},HN={key:1,class:"ao-card-feed__subitem"},WN={class:"ao-card-feed__subitem"},ZN={class:"ao-card-feed__timer-wrapper"},GN={class:"ao-card-feed__footer-row"},KN={key:0,class:"ao-card-feed__progress-wrapper"},YN={class:"ao-card-feed__subitem"},JN={class:"ao-card-feed__subitem"},ru=a.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=a.computed(()=>n.tagType==="milestone"?n.milestoneName:n.projectName),i=a.computed(()=>n.tagType==="milestone"?n.milestoneColor:n.projectColor),s=g=>{o("updateActivity",{id:n.id,name:g})},l=a.computed(()=>n.tagType==="milestone"&&n.phaseName?`${n.phaseName}`:n.phaseName&&n.milestoneName?`${n.phaseName} / ${n.milestoneName}`:""),c=a.computed(()=>n.assignee?[n.assignee]:[]),d=a.computed(()=>Ni(n.deadline)),u=g=>{o("removeAssignee",g)},p=()=>{o("startTimer",{activityId:n.id,name:n.name,project:n.projectName,projectId:n.projectId,slug:n.slug})},f=a.computed(()=>{var g;return(g=n.tasks)==null?void 0:g.length}),m=a.computed(()=>{var g;return(g=n.tasks)==null?void 0:g.filter(v=>v.isDone).length}),h=a.computed(()=>(m.value||0)/(f.value||1));return(g,v)=>(a.openBlock(),a.createBlock(ol,{class:a.normalizeClass(["ao-card-feed",{"ao-card-feed--closed":t.isClosed}]),"is-clickable":!0},{header:a.withCtx(()=>[a.createElementVNode("div",NN,[r.value?(a.openBlock(),a.createBlock(ta,{key:0,label:r.value,class:"ao-card-feed__project",variant:"solid",color:t.projectColor?void 0:"primary","raw-color":i.value},null,8,["label","color","raw-color"])):a.createCommentVNode("",!0),t.isPrivate||t.important||t.isClosed?(a.openBlock(),a.createElementBlock("div",DN,[t.isPrivate?(a.openBlock(),a.createBlock(Ce,{key:0,name:"Lock",class:"ao-card-feed__warning",size:"sm"})):a.createCommentVNode("",!0),t.important?(a.openBlock(),a.createBlock(Ce,{key:1,name:"FlagRounded",class:"ao-card-feed__important",size:"sm"})):a.createCommentVNode("",!0),t.isClosed?(a.openBlock(),a.createBlock(Ce,{key:2,name:"CheckSmallRounded",class:"ao-card-feed__closed"})):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0),g.$slots.secondary?(a.openBlock(),a.createElementBlock("div",BN,[a.renderSlot(g.$slots,"secondary")])):a.createCommentVNode("",!0)])]),default:a.withCtx(()=>[a.createElementVNode("div",$N,[l.value?(a.openBlock(),a.createElementBlock("span",MN,a.toDisplayString(l.value),1)):a.createCommentVNode("",!0),a.createElementVNode("div",LN,[a.createElementVNode("div",ON,[t.slug?(a.openBlock(),a.createElementBlock("span",IN,a.toDisplayString(t.slug)+": ",1)):a.createCommentVNode("",!0),a.createVNode(bt,{id:t.id,title:t.name,level:5,"is-editable":t.isEditable,class:"ao-card-feed__title-inline","onUpdate:title":s},null,8,["id","title","is-editable"])])]),t.deadline?(a.openBlock(),a.createElementBlock("span",VN,a.toDisplayString(d.value),1)):a.createCommentVNode("",!0)])]),footer:a.withCtx(()=>[a.createElementVNode("div",PN,[a.createElementVNode("div",RN,[a.createElementVNode("ul",FN,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(c.value,_=>(a.openBlock(),a.createElementBlock(a.Fragment,{key:_.id},[_?(a.openBlock(),a.createElementBlock("li",zN,[a.createVNode(Pn,{"user-name":a.unref(zu)(_),"avatar-url":_.avatarUrl,"is-closable":!0,onClose:()=>u(_.id)},null,8,["user-name","avatar-url","onClose"])])):a.createCommentVNode("",!0)],64))),128))]),t.comments||t.attachments?(a.openBlock(),a.createElementBlock("ul",qN,[t.comments?(a.openBlock(),a.createElementBlock("li",jN,[a.createVNode(Ce,{name:"ChatOutline",size:"sm"}),a.createElementVNode("span",UN,a.toDisplayString(t.comments),1)])):a.createCommentVNode("",!0),t.attachments?(a.openBlock(),a.createElementBlock("li",HN,[a.createVNode(Ce,{name:"AttachFileRounded",size:"sm"}),a.createElementVNode("span",WN,a.toDisplayString(t.attachments),1)])):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0),a.createElementVNode("div",ZN,[a.createVNode(Ce,{name:"TimerOutline",class:"ao-card-feed__timer",size:"md",onClick:a.withModifiers(p,["stop"])})])]),a.createElementVNode("div",GN,[t.tasks&&t.tasks.length?(a.openBlock(),a.createElementBlock("div",KN,[a.createElementVNode("div",YN,[a.createVNode(Ce,{name:"SelectCheckBox",size:"sm"}),a.createElementVNode("span",JN,a.toDisplayString(m.value)+" / "+a.toDisplayString(f.value),1)]),a.createVNode(rl,{percentages:h.value,class:"ao-card-feed__progress"},null,8,["percentages"])])):a.createCommentVNode("",!0)])])]),_:3},8,["class"]))}}),Sge="",XN={class:"ao-project-milestone"},QN={class:"ao-project-milestone__header"},eD={class:"ao-project-milestone__header_line"},tD={class:"ao-project-milestone__header_line"},nD={class:"ao-project-milestone__title"},oD={key:0,class:"ao-fieldset ao-milestone__fieldset"},rD={class:"ao-field__row ao-milestone__field-row"},aD={class:"ao-field ao-field--inline"},iD={class:"ao-field__row ao-milestone__field-row"},sD={class:"ao-field ao-milestone__field-multiselect"},lD={class:"ao-milestone__color-actions"},cD=["onClick"],dD=["title"],uD={class:"ao-project-milestone__body"},pD={key:0,class:"ao-project-milestone__footer"},Ng=a.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}=kn(),o=t,r=e,i=C=>{var x;r("startTimer",C),(x=window.parent)==null||x.postMessage({type:"startTimer",data:C},"*")},s=a.computed(()=>{var C;return(C=o.phases)==null?void 0:C.find(x=>x.id===o.phaseId)}),l=a.computed(()=>{var C;return(C=o.phases)==null?void 0:C.flatMap(x=>x.milestones)}),c=a.computed(()=>{var C;return(C=l.value)==null?void 0:C.find(x=>x.id===o.milestoneId)}),d=a.computed(()=>{var C;return(C=c.value)==null?void 0:C.activities});a.watch(d,(C,x)=>{jn(C,x)});const u=C=>{r("close",C)},p=()=>{const{name:C,rank:x}=ar(d.value??[],"activity",n);r("addActivity",{milestoneId:o.milestoneId,name:C,rank:x,projectId:o.projectId})},f=()=>{const C=n("template.defaultName.activity",{idx:1}),x=ha(d.value??[]);r("addActivity",{milestoneId:o.milestoneId,name:C,rank:x,projectId:o.projectId})},m=C=>{r("updateActivity",C)},h=C=>{d.value&&"moved"in C&&r("updateActivity",{id:C.moved.element.id,rank:mr(d.value,C.moved.newIndex)})},g=a.computed({get:()=>{var C;return(C=c.value)==null?void 0:C.color},set:C=>{c.value&&r("updateMilestone",{id:c.value.id,color:C})}}),v=a.computed({get:()=>{var C;return((C=c==null?void 0:c.value)==null?void 0:C.deadline)??""},set:C=>{c.value&&r("updateMilestone",{id:c.value.id,deadline:C!=null&&C.length?C:null})}}),_=C=>o.closedStatus?_l(C,o.closedStatus):!1,b=a.computed(()=>{var C;return((C=o.users)==null?void 0:C.map(x=>({label:`${x.firstName} ${x.lastName}`,value:x.id,avatar:x.avatarUrl})))||[]}),y=a.computed({get(){var C,x;return(x=(C=c.value)==null?void 0:C.assignee)!=null&&x.id?[c.value.assignee.id]:[]},set(C){r("updateMilestone",{id:o.milestoneId,assigneeId:C[0]??null})}}),w=a.computed({get(){var C;return((C=c.value)==null?void 0:C.important)??!1},set(C){r("updateMilestone",{id:o.milestoneId,important:C})}}),k=(C,x)=>{const T=C.currentTarget;T instanceof HTMLElement&&x(T)};return(C,x)=>{var T;return a.openBlock(),a.createElementBlock("div",XN,[a.createElementVNode("header",QN,[a.createElementVNode("div",eD,[a.createVNode(fe,{"icon-name":"CloseRounded",variant:"ghost",size:"sm",class:"ao-milestone__close",onClick:u})]),a.createElementVNode("div",tD,[a.createElementVNode("div",nD,[a.createVNode(bt,{title:((T=c.value)==null?void 0:T.name)||t.milestoneId,level:5},null,8,["title"]),a.createVNode(xg,{modelValue:w.value,"onUpdate:modelValue":x[0]||(x[0]=S=>w.value=S),modelModifiers:{lazy:!0},disabled:!t.isEditable,class:"ao-milestone__important",color:"danger",label:C.$t("activity.important.label"),"icon-name":"FlagRounded",variant:"ghost",size:"sm"},null,8,["modelValue","disabled","label"])])]),c.value?(a.openBlock(),a.createElementBlock("div",oD,[a.createElementVNode("div",rD,[a.createElementVNode("label",aD,[a.withDirectives(a.createElementVNode("input",{"onUpdate:modelValue":x[1]||(x[1]=S=>v.value=S),class:"ao-milestone__field ao-milestone__date-field",type:"date"},null,512),[[a.vModelText,v.value,void 0,{lazy:!0}]])])]),a.createElementVNode("div",iD,[a.createElementVNode("label",sD,[a.createVNode(kt,{modelValue:y.value,"onUpdate:modelValue":x[2]||(x[2]=S=>y.value=S),options:b.value,"close-on-select":!0,searchable:!0,max:1,class:"ao-milestone__field ao-milestone__multiselect",placeholder:C.$t("activity.filters.assignee.placeholder"),mode:"tags",disabled:!t.isEditable,caret:t.isEditable},{tag:a.withCtx(({option:S,handleTagRemove:N})=>[a.createVNode(Pn,{"user-name":S.label,"avatar-url":S.avatar,"is-closable":!0,onClose:I=>N(S,I)},null,8,["user-name","avatar-url","onClose"])]),_:1},8,["modelValue","options","placeholder","disabled","caret"])])]),a.createElementVNode("div",lD,[a.createVNode(al,{color:g.value,"onUpdate:color":x[3]||(x[3]=S=>g.value=S)},{clickable:a.withCtx(({openPicker:S,bgColor:N})=>[a.createElementVNode("button",{style:a.normalizeStyle({background:N}),class:"color-button",onClick:I=>k(I,S)},null,12,cD)]),_:1},8,["color"]),t.isEditable?(a.openBlock(),a.createElementBlock("button",{key:0,type:"button",class:"ao-project-milestone__quick-add",title:C.$t("project.activity.add"),onClick:f},[a.createVNode(Ce,{name:"Add",class:"ao-project-milestone__quick-add-icon"})],8,dD)):a.createCommentVNode("",!0)])])):a.createCommentVNode("",!0)]),a.createElementVNode("div",uD,[a.createVNode(a.unref(no),a.mergeProps({class:"ao-project-milestone__activities",list:d.value,disabled:!t.isEditable,"item-key":"id",group:"kanban"},C.$attrs,{onChange:h}),{item:a.withCtx(({element:S})=>{var N,I,A,D,B;return[a.createVNode(ru,{id:S.id,name:S.name||S.id,"project-id":t.projectId,"phase-name":(N=s.value)==null?void 0:N.name,"milestone-name":(I=c.value)==null?void 0:I.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:(B=S.attachments)==null?void 0:B.length,tasks:S.tasks,"is-editable":t.isEditable,"is-private":S.private,"is-closed":_(S),onClick:O=>C.$router.push({name:a.unref(Pe).activity,params:{milestoneId:t.milestoneId,activityId:S.id}}),onUpdateActivity:m,onRemoveAssignee:()=>m({id:S.id,assigneeId:null}),onStartTimer:i},a.createSlots({_:2},[t.isEditable?{name:"secondary",fn:a.withCtx(()=>[t.isEditable&&S.active?(a.openBlock(),a.createBlock(fe,{key:0,color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:C.$t("archive"),onClick:a.withModifiers(()=>C.$emit("archiveActivity",{id:S.id}),["stop"])},null,8,["label","onClick"])):a.createCommentVNode("",!0),t.isEditable&&!S.active?(a.openBlock(),a.createBlock(fe,{key:1,color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:C.$t("feed.activity.unarchive"),onClick:a.withModifiers(()=>C.$emit("unarchiveActivity",{id:S.id}),["stop"])},null,8,["label","onClick"])):a.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?(a.openBlock(),a.createElementBlock("div",pD,[a.createVNode(ro,{"icon-name":"Add",label:C.$t("project.activity.add"),onClick:p},null,8,["label"])])):a.createCommentVNode("",!0)])])}}}),Tge="",fD=a.defineComponent({__name:"AoProjectOverviewActivityDetails",props:{phaseId:{},milestoneId:{},activityId:{},activityTypes:{},devStatuses:{},activities:{},isTaskCheckable:{type:Function},statuses:{},phases:{},users:{},project:{},userId:{},isEditable:{type:Boolean},attachmentEnabled:{type:Boolean},timeTrackingData:{},loadAttachmentPreview:{type:Function},sprints:{}},emits:["update:activity","addSubtask","updateSubtask","deleteSubtask","addFiles","removeFile","addComment","updateComment","removeComment","createSprint"],setup(t,{emit:e}){const n=t,o=e,r=a.computed(()=>{var _;return(_=n.phases)==null?void 0:_.find(b=>b.id===n.phaseId)}),i=a.computed(()=>{var _;return(_=n.phases)==null?void 0:_.flatMap(b=>b.milestones)}),s=a.computed(()=>{var _;return(_=i.value)==null?void 0:_.find(b=>b.id===n.milestoneId)}),l=a.computed(()=>{var _;return(_=n.activities)==null?void 0:_.find(b=>b.id===n.activityId)}),c=_=>{o("update:activity",_)},d=_=>{o("addSubtask",_)},u=_=>{o("updateSubtask",_)},p=_=>{o("deleteSubtask",_)},f=_=>{o("addFiles",_)},m=_=>{o("removeFile",_)},h=_=>{o("addComment",_)},g=_=>{o("updateComment",_)},v=_=>{o("removeComment",_)};return(_,b)=>{var y,w;return l.value?(a.openBlock(),a.createBlock(Zd,{key:0,activity:l.value,"activity-types":t.activityTypes,"dev-statuses":t.devStatuses,"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:`${(y=r.value)==null?void 0:y.name} / ${(w=s.value)==null?void 0:w.name}`,"is-editable":t.isEditable,"attachment-enabled":t.attachmentEnabled,projects:[t.project],"time-tracking-data":t.timeTrackingData,"load-attachment-preview":n.loadAttachmentPreview,sprints:t.sprints,onClose:_.$router.back,"onUpdate:activity":c,onAddSubtask:d,onUpdateSubtask:u,onDeleteSubtask:p,onAddFiles:f,onRemoveFile:m,onAddComment:h,onUpdateComment:g,onRemoveComment:v,onCreateSprint:b[0]||(b[0]=k=>o("createSprint",k))},{default:a.withCtx(k=>[a.renderSlot(_.$slots,"default",a.normalizeProps(a.guardReactiveProps(k)))]),_:3},8,["activity","activity-types","dev-statuses","milestone-id","template-activities","users","user-id","is-task-checkable","statuses","breadcrumbs","is-editable","attachment-enabled","projects","time-tracking-data","load-attachment-preview","sprints","onClose"])):a.createCommentVNode("",!0)}}}),mD={class:"ao-col-header"},hD=a.defineComponent({__name:"AoColHeader",props:{title:{},items:{}},setup(t){return(e,n)=>(a.openBlock(),a.createElementBlock("header",mD,[a.createVNode(bt,{title:t.title,class:"ao-col-header__title",level:4},null,8,["title"]),t.items?(a.openBlock(),a.createBlock(ta,{key:0,label:t.items,class:"ao-col-header__items",variant:"solid",color:"primary"},null,8,["label"])):a.createCommentVNode("",!0)]))}}),Age="";function gD(t){return a.getCurrentScope()?(a.onScopeDispose(t),!0):!1}function il(t){return typeof t=="function"?t():a.unref(t)}const bD=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const vD=t=>t!=null,ii=()=>{};function yD(t,e){function n(...o){return new Promise((r,i)=>{Promise.resolve(t(()=>e.apply(this,o),{fn:e,thisArg:this,args:o})).then(r).catch(i)})}return n}function _D(t,e={}){let n,o,r=ii;const i=l=>{clearTimeout(l),r(),r=ii};return l=>{const c=il(t),d=il(e.maxWait);return n&&i(n),c<=0||d!==void 0&&d<=0?(o&&(i(o),o=null),Promise.resolve(l())):new Promise((u,p)=>{r=e.rejectOnCancel?p:u,d&&!o&&(o=setTimeout(()=>{n&&i(n),o=null,u(l())},d)),n=setTimeout(()=>{o&&i(o),o=null,u(l())},c)})}}function CD(t,e=200,n={}){return yD(_D(e,n),t)}function au(t){var e;const n=il(t);return(e=n==null?void 0:n.$el)!=null?e:n}const wD=bD?window:void 0;function kD(){const t=a.ref(!1),e=a.getCurrentInstance();return e&&a.onMounted(()=>{t.value=!0},e),t}function xD(t){const e=kD();return a.computed(()=>(e.value,!!t()))}function ED(t,e,n={}){const{root:o,rootMargin:r="0px",threshold:i=.1,window:s=wD,immediate:l=!0}=n,c=xD(()=>s&&"IntersectionObserver"in s),d=a.computed(()=>{const h=il(t);return(Array.isArray(h)?h:[h]).map(au).filter(vD)});let u=ii;const p=a.ref(l),f=c.value?a.watch(()=>[d.value,au(o),p.value],([h,g])=>{if(u(),!p.value||!h.length)return;const v=new IntersectionObserver(e,{root:au(g),rootMargin:r,threshold:i});h.forEach(_=>_&&v.observe(_)),u=()=>{v.disconnect(),u=ii}},{immediate:l,flush:"post"}):ii,m=()=>{u(),f(),p.value=!1};return gD(m),{isSupported:c,isActive:p,pause(){u(),p.value=!1},resume(){p.value=!0},stop:m}}const SD={class:a.normalizeClass(["ao-list-kanban"])},TD={class:"ao-list-kanban__header"},AD=["title"],ND={key:0,class:"ao-list-kanban__end ao-list-kanban__end--loading"},DD={key:1,class:"ao-list-kanban__end"},BD={key:0,class:"ao-list-kanban__no-more"},$D={key:1,class:"ao-list-kanban__divider"},MD={key:1,class:"ao-list-kanban__footer"},LD=a.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},isDevMode:{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=a.ref(!1),i=a.ref(null);ED(i,([{isIntersecting:p}])=>{r.value=p}),a.watch(r,p=>{p&&n.hasMore&&!n.isLoading&&o("loadMore")});const s=p=>{var f;return n.isEditable===!0?!0:n.userId&&n.isEditable==="only-own"?n.userId===((f=p.assignee)==null?void 0:f.id):!1},l=p=>{o("selectActivity",p)},c=p=>{o("updateActivity",p)},d=p=>{if("added"in p){const f={id:p.added.element.id,rank:mr(n.list,p.added.newIndex)};n.isDevMode?f.statusDevId=n.status.id:f.statusId=n.status.id,o("updateActivity",f)}else"removed"in p||"moved"in p&&o("updateActivity",{id:p.moved.element.id,rank:mr(n.list,p.moved.newIndex)})},u=a.ref(!1);return(p,f)=>(a.openBlock(),a.createElementBlock("div",SD,[t.title||p.$slots.header?a.renderSlot(p.$slots,"header",{},()=>{var m;return[a.createElementVNode("div",TD,[t.title?(a.openBlock(),a.createBlock(hD,{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"])):a.createCommentVNode("",!0),t.showHeaderAdd?(a.openBlock(),a.createElementBlock("button",{key:1,class:"ao-list-kanban__header-add",title:p.$t("feed.activity.add"),onClick:f[0]||(f[0]=h=>p.$emit("addAtBeginning"))},[a.createVNode(Ce,{name:"Add"})],8,AD)):a.createCommentVNode("",!0)])]},void 0,0):a.createCommentVNode("",!0),a.createVNode(a.unref(no),a.mergeProps({class:["ao-list-kanban__list",u.value?"ao-list-kanban__transition":void 0],list:t.list,"item-key":"id",group:"kanban","ghost-class":"ao-list-kanban__ghost",animation:"200"},p.$attrs,{draggable:".ao-list-draggable",disabled:!t.isEditable,"component-data":{tag:"transition-group",name:"ao-list-kanban__transition"},onChange:d,onStart:f[2]||(f[2]=m=>u.value=!0),onEnd:f[3]||(f[3]=m=>u.value=!1)}),{item:a.withCtx(({element:m})=>{var h,g,v,_,b,y,w,k,C,x;return[a.createVNode(ru,{id:m.id,class:a.normalizeClass(s(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":(v=m.project)==null?void 0:v.color,"phase-name":(b=(_=m.milestone)==null?void 0:_.phase)==null?void 0:b.name,"milestone-name":(y=m.milestone)==null?void 0:y.name,"milestone-color":(w=m.milestone)==null?void 0:w.color,deadline:m.deadline,rules:((k=m.rules)==null?void 0:k.length)||0,tasks:m.tasks,description:m.description,important:m.important,type:m.type,comments:(C=m.comments)==null?void 0:C.length,attachments:(x=m.attachments)==null?void 0:x.length,users:t.users,assignee:m.assignee,slug:m.slug,"is-editable":s(m),"is-private":m.private,"tag-type":t.tagType,onUpdateActivity:[T=>s(m)&&c(T),()=>s(m)&&c],onClick:()=>l(m.id),onRemoveAssignee:()=>s(m)&&c({id:m.id,assigneeId:null}),onStartTimer:f[1]||(f[1]=T=>p.$emit("startTimer",T))},{secondary:a.withCtx(()=>[s(m)&&m.active?(a.openBlock(),a.createBlock(fe,{key:0,color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:p.$t("feed.activity.archive"),onClick:a.withModifiers(()=>p.$emit("archiveActivity",{id:m.id}),["stop"])},null,8,["label","onClick"])):a.createCommentVNode("",!0),s(m)&&!m.active?(a.openBlock(),a.createBlock(fe,{key:1,color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:p.$t("feed.activity.unarchive"),onClick:a.withModifiers(()=>p.$emit("unarchiveActivity",{id:m.id}),["stop"])},null,8,["label","onClick"])):a.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:a.withCtx(()=>[t.isLoading?(a.openBlock(),a.createElementBlock("div",ND,[a.createVNode(Ce,{name:"Loading"})])):t.hasMore?(a.openBlock(),a.createElementBlock("div",{key:2,ref_key:"scrollEnd",ref:i,class:"ao-list-kanban__end"},null,512)):(a.openBlock(),a.createElementBlock("div",DD,[t.noMoreLabel?(a.openBlock(),a.createElementBlock("span",BD,a.toDisplayString(t.noMoreLabel),1)):t.isEditable?(a.openBlock(),a.createElementBlock("span",$D)):a.createCommentVNode("",!0)]))]),_:1},16,["class","list","disabled"]),p.$slots.footer||t.footerLabel?(a.openBlock(),a.createElementBlock("div",MD,[a.renderSlot(p.$slots,"footer",{},()=>[t.isEditable?(a.openBlock(),a.createBlock(ro,{key:0,"icon-name":"AddBoxOutlineRounded",label:t.footerLabel,onClick:f[4]||(f[4]=m=>p.$emit("add"))},null,8,["label"])):a.createCommentVNode("",!0)])])):a.createCommentVNode("",!0)]))}}),Nge="",OD={class:"ao-field ao-search-field"},ID=["value","placeholder"],VD=a.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 d=l.target.value;o("update:modelValue",d,l)},i=CD(r,n.delay),s=l=>{o("clear",l)};return(l,c)=>(a.openBlock(),a.createElementBlock("div",OD,[a.createElementVNode("input",{value:t.modelValue,type:"text",class:"ao-field__input ao-search-field__input",placeholder:t.placeholder,onInput:c[0]||(c[0]=(...d)=>a.unref(i)&&a.unref(i)(...d)),onKeypress:a.withKeys(r,["enter"])},null,40,ID),a.createVNode(Ce,{name:"SearchRounded",class:a.normalizeClass(`ao-search-field__icon ao-search-field__action ${t.modelValue?"":"ao-search-field__action--visible"}`)},null,8,["class"]),a.createVNode(fe,{"icon-name":"CloseRounded",size:"sm",color:"primary",corners:"round",class:a.normalizeClass(`ao-search-field__button ao-search-field__action ${t.modelValue?"ao-search-field__action--visible":""}`),onClick:s},null,8,["class"])]))}}),Dge="",PD={class:"ao-feed"},RD={class:"ao-feed__filters"},FD={class:"ao-feed__body"},iu=a.defineComponent({__name:"AoFeed",props:{activities:{},statuses:{},devStatuses:{default:()=>[]},project:{default:void 0},projects:{default:()=>[]},filters:{},activityTypes:{default:()=>[]},users:{},userId:{},initialActivityId:{default:void 0},initialActivitySlug:{default:void 0},searchText:{default:""},showsArchivedActivities:{type:Boolean},showsOnlyImportant:{type:Boolean},showsOnlyNonAssigned:{type:Boolean},selectedActivity:{default:void 0},isTaskCheckable:{type:Function,default:void 0},isEditable:{type:[Boolean,String]},attachmentEnabled:{type:Boolean,default:!0},timeTrackingData:{default:()=>({})},loadAttachmentPreview:{type:Function,default:void 0},feedMode:{default:"standard"},sprints:{default:()=>[]}},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","createSprint"],setup(t,{emit:e}){const{t:n}=kn(),o=t,r=e;function i(q,te){r("toast",q,te)}const s=a.toRef(o,"activities"),l=a.computed(()=>o.feedMode==="dev"?o.devStatuses:o.statuses),c=a.computed(()=>o.feedMode==="dev"?s.value.filter(q=>q.activityType==="dev"):s.value),d=async(q,te)=>{await r("selectActivity",q,te)},u=a.ref({}),p=a.ref(!1),f=a.ref(!1),m=a.computed(()=>o.project?"milestone":"project");a.watch([()=>l.value,()=>c.value,()=>o.initialActivityId,()=>o.initialActivitySlug,()=>o.feedMode],async([q,te,Le,le],[Ke,we])=>{const De=o.feedMode==="dev"?"devStatus":"status";u.value=Object.fromEntries(q.map(Re=>[Re.id,te.filter(Ee=>{const Oe=Ee[De];return(Oe==null?void 0:Oe.id)===Re.id})])),Le&&!p.value?(d(Le,null),p.value=!0):le&&!p.value&&(d(null,le),p.value=!0),f.value&&jn(te,we)},{immediate:!0});const h=a.computed(()=>{var q;return!o.selectedActivity||!o.selectedActivity.milestone?"":`${((q=o.selectedActivity.milestone.phase)==null?void 0:q.name)??""} / ${o.selectedActivity.milestone.name??""}`}),g=q=>{var Re;const te=o.feedMode==="dev"?o.activities.filter(Ee=>Ee.activityType==="dev"):o.activities,Le=te==null?void 0:te.at(-1),le=Le?rt.LexoRank.parse(Le.rank).genNext():rt.LexoRank.middle(),Ke=((Re=o.activities)==null?void 0:Re.length)??0,we=o.feedMode==="dev",De={name:n("activity.defaultName",{idx:Ke+1}),rank:le.format(),...we?{statusDevId:q.id,type:"dev"}:{statusId:q.id}};if(o.filters.assigneeId.length>0&&(De.assigneeId=o.filters.assigneeId[0]),o.filters.projectId.length>0&&(De.projectId=o.filters.projectId[0]),o.filters.sprintId&&o.filters.sprintId.length===1){const Ee=o.sprints.find(Oe=>Oe.id===o.filters.sprintId[0]);Ee&&(De.sprintId=Ee.id,De.projectId=Ee.projectId)}f.value=!0,r("addActivity",De)},v=q=>{var Re,Ee;const te=o.feedMode==="dev"?"devStatus":"status",Le=((Re=o.activities)==null?void 0:Re.filter(Oe=>{const Ge=Oe[te];return(Ge==null?void 0:Ge.id)===q.id}))??[],le=ha(Le),Ke=((Ee=o.activities)==null?void 0:Ee.length)??0,we=o.feedMode==="dev",De={name:n("activity.defaultName",{idx:Ke+1}),rank:le,...we?{statusDevId:q.id,type:"dev"}:{statusId:q.id}};if(o.filters.assigneeId.length>0&&(De.assigneeId=o.filters.assigneeId[0]),o.filters.projectId.length>0&&(De.projectId=o.filters.projectId[0]),o.filters.sprintId&&o.filters.sprintId.length===1){const Oe=o.sprints.find(Ge=>Ge.id===o.filters.sprintId[0]);Oe&&(De.sprintId=Oe.id,De.projectId=Oe.projectId)}f.value=!0,r("addActivity",De)},_=(q,te)=>{f.value=!1,r("update:filters",{...o.filters,[q]:te})},b=a.computed(()=>o.project?[o.project]:o.projects??[]),y=a.computed(()=>b.value.map(q=>({value:q.id,label:q.name}))),w=a.computed(()=>o.sprints.map(q=>({value:q.id,label:`${q.name} · ${q.startDate} – ${q.endDate}`,startDate:q.startDate,endDate:q.endDate,projectId:q.projectId})));a.computed(()=>{var q;return(q=o.activityTypes)==null?void 0:q.map(te=>({value:te.id,label:te.name}))});const k=a.computed(()=>o.users.map(q=>({value:q.id,label:`${q.firstName} ${q.lastName}`,avatar:q.avatarUrl}))),C=q=>{o.selectedActivity&&r("update:activity",q)},x=q=>{r("update:activity",q)},T=q=>{r("archiveActivity",q)},S=q=>{r("unarchiveActivity",q)},N=q=>{var te;r("startTimer",q),(te=window.parent)==null||te.postMessage({type:"startTimer",data:q},"*")},I=q=>{f.value=!1,r("update:searchText",q)},A=q=>{f.value=!1,r("clear:searchText",q)},D=q=>{o.selectedActivity&&r("addSubtask",q)},B=q=>{o.selectedActivity&&r("updateSubtask",q)},O=q=>{o.selectedActivity&&r("deleteSubtask",q)},V=q=>{r("addFiles",q)},H=q=>{r("removeFile",q)},P=q=>{o.selectedActivity&&r("addComment",{...q,activityId:o.selectedActivity.id})},U=q=>{const{id:te}=o.selectedActivity||{};te&&r("updateComment",q)},R=q=>{const{id:te}=o.selectedActivity||{};te&&r("removeComment",q)},Q=Ct.useRouter(),ee=Ct.useRoute(),be=a.ref("feed");a.watch(()=>ee.name,q=>{q===lr.feed||q==="ActivityFeed"||q==="ActivityFeedWithActivity"?be.value="feed":q===lr.dev||q==="ActivityFeedDev"||q==="ActivityFeedDevWithActivity"?be.value="dev":q===Pe.feed?be.value="feed":q===Pe.dev?be.value="dev":q===Pe.project?be.value="overview":q===Pe.mapping&&(be.value="mapping")},{immediate:!0});const ie=[{label:"Overview",value:"overview"},{label:"Feed",value:"feed"},{label:"Dev",value:"dev"},{label:"Mapping",value:"mapping"}],se=a.computed(()=>z.value?ie.filter(q=>q.value==="feed"||q.value==="dev"):ie),z=a.computed(()=>!o.project&&ee.name&&(ee.name===lr.feed||ee.name===lr.dev||ee.name==="ActivityFeed"||ee.name==="ActivityFeedDev"||ee.name==="ActivityFeedWithActivity"||ee.name==="ActivityFeedDevWithActivity")),ae=a.computed(()=>z.value?lr.feed:Pe.feed),ye=a.computed(()=>z.value?lr.dev:Pe.dev),Me=a.computed(()=>Pe.project),dt=a.computed(()=>Pe.mapping);return a.watch(be,q=>{q==="feed"?Q.push({name:ae.value}):q==="dev"?Q.push({name:ye.value}):q==="overview"?Q.push({name:Me.value}):q==="mapping"&&Q.push({name:dt.value})}),(q,te)=>{var Le;return a.openBlock(),a.createElementBlock("div",PD,[a.createVNode(ga,null,{primary:a.withCtx(()=>[a.createElementVNode("div",RD,[a.createVNode(ai,{modelValue:be.value,"onUpdate:modelValue":te[0]||(te[0]=le=>be.value=le),tabs:se.value},null,8,["modelValue","tabs"]),a.createVNode(VD,{"model-value":t.searchText,placeholder:q.$t("feed.search.placeholder"),class:"ao-feed__search","onUpdate:modelValue":I,onClear:A},null,8,["model-value","placeholder"]),o.project?a.createCommentVNode("",!0):(a.openBlock(),a.createBlock(kt,{key:0,"model-value":t.filters[a.unref(Ao).project],mode:"tags",options:y.value,"close-on-select":!1,searchable:!0,class:"ao-feed__filter ao-feed__filter__projects",placeholder:q.$t("feed.filters.project.placeholder"),"onUpdate:modelValue":te[1]||(te[1]=le=>_(a.unref(Ao).project,le))},null,8,["model-value","options","placeholder"])),t.feedMode==="dev"?(a.openBlock(),a.createBlock(kt,{key:1,"model-value":t.filters[a.unref(Ao).sprint],mode:"tags",options:w.value,"close-on-select":!1,searchable:!0,disabled:!w.value.length,class:"ao-feed__filter ao-feed__filter__sprints",placeholder:q.$t("feed.filters.sprint.placeholder"),"onUpdate:modelValue":te[2]||(te[2]=le=>_(a.unref(Ao).sprint,le))},null,8,["model-value","options","disabled","placeholder"])):a.createCommentVNode("",!0),k.value.length?(a.openBlock(),a.createBlock(kt,{key:2,"model-value":t.filters[a.unref(Ao).assignee],mode:"tags",options:k.value,"close-on-select":!1,searchable:!0,class:"ao-feed__filter ao-feed__filter__assignees",placeholder:q.$t("feed.filters.assignee.placeholder"),"onUpdate:modelValue":te[3]||(te[3]=le=>_(a.unref(Ao).assignee,le))},{tag:a.withCtx(({option:le,handleTagRemove:Ke})=>[a.createVNode(Pn,{"user-name":le.label,"avatar-url":le.avatar,"is-closable":!0,onClose:we=>Ke(le,we)},null,8,["user-name","avatar-url","onClose"])]),_:1},8,["model-value","options","placeholder"])):a.createCommentVNode("",!0)]),a.createVNode(fe,{class:"ao-feed__only-non-assigned",size:"sm","icon-name":t.showsOnlyNonAssigned?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:q.$t("feed.filters.showsOnlyNonAssigned.label"),role:"checkbox","aria-checked":t.showsOnlyNonAssigned,onClick:te[4]||(te[4]=le=>q.$emit("update:showsOnlyNonAssigned",!t.showsOnlyNonAssigned))},null,8,["icon-name","label","aria-checked"]),a.createVNode(fe,{class:"ao-feed__only-important",size:"sm","icon-name":t.showsOnlyImportant?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:q.$t("feed.filters.showsOnlyImportant.label"),role:"checkbox","aria-checked":t.showsOnlyImportant,onClick:te[5]||(te[5]=le=>q.$emit("update:showsOnlyImportant",!t.showsOnlyImportant))},null,8,["icon-name","label","aria-checked"]),a.createVNode(fe,{class:"ao-feed__show-archived",size:"sm","icon-name":t.showsArchivedActivities?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:q.$t("feed.filters.showsArchivedActivities.label"),role:"checkbox","aria-checked":t.showsArchivedActivities,onClick:te[6]||(te[6]=le=>q.$emit("update:showsArchivedActivities",!t.showsArchivedActivities))},null,8,["icon-name","label","aria-checked"])]),_:1}),a.createElementVNode("div",FD,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(l.value,le=>(a.openBlock(),a.createBlock(LD,{key:le.id,status:le,list:u.value[le.id],title:le.name,"footer-label":q.$t("feed.activity.add"),users:t.users,"user-id":t.userId,"is-editable":t.isEditable,"tag-type":m.value,"show-header-add":t.isEditable,"is-dev-mode":t.feedMode==="dev",onAdd:()=>g(le),onAddAtBeginning:()=>v(le),onSelectActivity:d,onArchiveActivity:T,onUnarchiveActivity:S,onUpdateActivity:x,onStartTimer:N},null,8,["status","list","title","footer-label","users","user-id","is-editable","tag-type","show-header-add","is-dev-mode","onAdd","onAddAtBeginning"]))),128))]),(a.openBlock(),a.createBlock(a.Teleport,{to:"body"},[t.selectedActivity?(a.openBlock(),a.createBlock(Zd,{key:0,activity:t.selectedActivity,"activity-types":t.activityTypes,"dev-statuses":t.devStatuses,"milestone-id":(Le=t.selectedActivity.milestone)==null?void 0:Le.id,"template-activities":s.value,users:t.users,"user-id":t.userId,"is-task-checkable":t.isTaskCheckable,statuses:t.statuses,breadcrumbs:h.value,"is-editable":t.isEditable,"attachment-enabled":t.attachmentEnabled,projects:b.value,"time-tracking-data":t.timeTrackingData,"load-attachment-preview":o.loadAttachmentPreview,sprints:t.sprints,onClose:te[7]||(te[7]=()=>d(null,null)),"onUpdate:activity":C,onAddSubtask:D,onUpdateSubtask:B,onDeleteSubtask:O,onAddFiles:V,onRemoveFile:H,onAddComment:P,onUpdateComment:U,onRemoveComment:R,onToast:i,onCreateSprint:te[8]||(te[8]=le=>r("createSprint",le))},{default:a.withCtx(le=>[a.renderSlot(q.$slots,"activityDetailsBody",a.normalizeProps(a.guardReactiveProps(le)))]),_:3},8,["activity","activity-types","dev-statuses","milestone-id","template-activities","users","user-id","is-task-checkable","statuses","breadcrumbs","is-editable","attachment-enabled","projects","time-tracking-data","load-attachment-preview","sprints"])):a.createCommentVNode("",!0)]))])}}}),Bge="",zD={class:"ao-project-mapping"},qD={class:"ao-project-mapping-mapping__body"},jD={class:"ao-project-mapping-mapping__phases"},UD={key:0,class:"ao-project-mapping-mapping__image-wrapper"},HD=["src","alt"],WD=a.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}=kn(),o=t,r=e,i=()=>{const{name:b,rank:y}=ar(o.phases,"phase",n);r("addPhase",{name:b,rank:y,projectId:o.project.id})},s=()=>{const b=n("template.defaultName.phase",{idx:1}),y=ha(o.phases);r("addPhase",{name:b,rank:y,projectId:o.project.id})},l=b=>{r("updatePhase",b)},c=b=>{r("archivePhase",b)},d=b=>{r("unarchivePhase",b)},u=b=>{r("copyPhaseToTemplate",b)},p=a.ref(!1),f=a.ref(!1),m=(b,y)=>{r("applyTemplate",{templateId:b,projectId:y}),p.value=!1},h=(b,y)=>{var C;const w=(C=o.templates)==null?void 0:C.at(-1),k=w?rt.LexoRank.parse(w.rank).genNext():rt.LexoRank.middle();r("saveTemplate",{templateName:b,rank:k.format(),phaseIds:y}),f.value=!1},g=Ct.useRouter(),v=a.ref("mapping"),_=[{label:"Overview",value:"overview"},{label:"Feed",value:"feed"},{label:"Dev",value:"dev"},{label:"Mapping",value:"mapping"}];return a.watch(v,b=>{b==="feed"?(g.push({name:Pe.feed}),console.log("Navigating to feed...")):b==="dev"?(g.push({name:Pe.dev}),console.log("Navigating to dev...")):b==="overview"?(g.push({name:Pe.project}),console.log("Navigating to feed...")):b==="mapping"&&(g.push({name:Pe.mapping}),console.log("Navigating to feed..."))}),(b,y)=>{var w;return a.openBlock(),a.createElementBlock(a.Fragment,null,[a.createElementVNode("div",a.mergeProps({class:"ao-project-mapping-overview"},b.$attrs),[a.createElementVNode("div",zD,[a.createVNode(ga,null,{primary:a.withCtx(()=>[a.createVNode(ai,{modelValue:v.value,"onUpdate:modelValue":y[0]||(y[0]=k=>v.value=k),tabs:_},null,8,["modelValue"]),a.createVNode(fe,{class:"ao-feed__show-archived",size:"sm","icon-name":t.showsArchived?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:b.$t("feed.filters.showsArchived.label"),role:"checkbox","aria-checked":t.showsArchived,onClick:y[1]||(y[1]=k=>b.$emit("update:showsArchived",!t.showsArchived))},null,8,["icon-name","label","aria-checked"])]),secondary:a.withCtx(()=>[t.isEditable===!0?(a.openBlock(),a.createBlock(fe,{key:0,class:"ao-mapping__quick-add-phase",size:"sm","icon-name":"Add","icon-position":"start",color:"primary",variant:"ghost",label:b.$t("project.phase.add"),onClick:s},null,8,["label"])):a.createCommentVNode("",!0),t.isEditable===!0?(a.openBlock(),a.createBlock(fe,{key:1,class:"ao-project-mapping-overview__save-as-template",color:"primary",label:b.$t("project.template.save.label"),onClick:y[2]||(y[2]=k=>f.value=!0)},null,8,["label"])):a.createCommentVNode("",!0),t.isEditable===!0?(a.openBlock(),a.createBlock(fe,{key:2,class:"ao-project-mapping-overview__add-template",color:"primary",label:b.$t("project.template.apply.label"),onClick:y[3]||(y[3]=k=>p.value=!0)},null,8,["label"])):a.createCommentVNode("",!0)]),_:1}),a.createElementVNode("div",qD,[a.createElementVNode("div",jD,[a.createVNode(ou,{phases:t.phases,"closed-status":t.closedStatus,"is-editable":t.isEditable===!0,users:t.users,"estimation-unit":(w=t.project)==null?void 0:w.estimationUnit,onAddPhase:i,onUpdatePhase:l,onArchivePhase:c,onUnarchivePhase:d,onCopyPhaseToTemplate:u},null,8,["phases","closed-status","is-editable","users","estimation-unit"])]),t.project.architectureImage?(a.openBlock(),a.createElementBlock("div",UD,[a.createElementVNode("img",{class:"architecture-image",src:t.project.architectureImage.url,alt:a.unref(n)("architectureImage.alt")},null,8,HD)])):a.createCommentVNode("",!0)])])],16),(a.openBlock(),a.createBlock(a.Teleport,{to:"body"},[f.value?(a.openBlock(),a.createBlock(Ag,{key:0,phases:t.phases,onClose:y[4]||(y[4]=k=>f.value=!1),onSave:h},null,8,["phases"])):a.createCommentVNode("",!0),p.value?(a.openBlock(),a.createBlock(Tg,{key:1,"project-id":t.project.id,templates:t.templates,onClose:y[5]||(y[5]=k=>p.value=!1),onApply:m},null,8,["project-id","templates"])):a.createCommentVNode("",!0)]))],64)}}}),$ge="",sr={TEMPLATES:"templates",TEMPLATE_DETAILS:"template_details",TEMPLATES_LIST:"templates_list"},ZD=(t,e={})=>[{path:t,name:sr.TEMPLATES,redirect:{name:sr.TEMPLATES_LIST},...e,children:[{path:"",name:sr.TEMPLATES_LIST,component:Dg},{path:":templateId/:phaseId?/:milestoneId?/:activityId?",name:sr.TEMPLATE_DETAILS,component:Eg,props:!0}]}],Pe={project:"AoProject",feed:"AoProjectFeed",dev:"AoProjectDev",mapping:"AoProjectMapping",milestone:"AoMilestone",activity:"AoActivity"},lr={feed:"ActivityFeed",dev:"ActivityFeedDev"},GD=(t,e={})=>[{path:t,...e,redirect:{name:Pe.project},children:[{path:"",name:Pe.project,component:AN,props:!0,children:[{path:":phaseId/:milestoneId",name:Pe.milestone,component:Ng,props:!0},{path:":phaseId/:milestoneId/:activityId",name:Pe.activity,props:{default:!0,modal:!0},components:{default:Ng,modal:fD}}]},{path:"feed",name:Pe.feed,component:iu,props:n=>({...n.params,feedMode:"standard"})},{path:"dev",name:Pe.dev,component:iu,props:n=>({...n.params,feedMode:"dev"})},{path:"mapping",name:Pe.mapping,component:WD,props:!0}]}],KD={class:"ao-templates"},Dg=a.defineComponent({__name:"AoTemplatesList",props:{templates:{}},emits:["addTemplate","updateTemplates","updateItem","removeItem"],setup(t,{emit:e}){const{t:n}=kn(),o=t,r=e;a.watch(()=>o.templates,(d,u)=>{jn(d,u)});const i=()=>{var m,h;const d=(m=o.templates)==null?void 0:m.at(-1),u=d?rt.LexoRank.parse(d.rank).genNext():rt.LexoRank.middle(),p=((h=o.templates)==null?void 0:h.length)??0,f={name:n("template.defaultName.template",{idx:p+1}),rank:u.format()};r("addTemplate",f)},s=(d,u)=>{r("updateItem",{itemType:ze.TEMPLATES,id:d,templateId:d,data:{name:u}})},l=(d,u)=>{r("removeItem",{itemType:ze.TEMPLATES,templateId:d,data:{id:d,...u?{name:u}:{}}})},c=d=>{if(d.moved){const u=ma(d,o.templates??[]);r("updateItem",{itemType:ze.TEMPLATES,id:d.moved.element.id,templateId:d.moved.element.id,data:{rank:u}})}};return(d,u)=>(a.openBlock(),a.createElementBlock("div",KD,[a.createVNode(ga,null,{secondary:a.withCtx(()=>[a.createVNode(fe,{label:d.$t("templates.new"),color:"primary","icon-name":"Add","icon-position":"start",onClick:i},null,8,["label"])]),_:1}),a.createVNode(a.unref(no),{"model-value":t.templates,class:"ao-templates__list","item-key":"id",handle:".ao-card__drag",onChange:c},{item:a.withCtx(({element:p})=>{var f;return[a.createVNode($5,{id:p.id,title:p.name,phases:p.phases,milestones:(f=p.phases)!=null&&f.length?a.unref(n5)(p.phases):0,activities:p.phases?a.unref(o5)(p.phases):0,"updated-at":p.updatedAt,"updated-by":p.updatedBy,onUpdateTitle:m=>s(p.id,m),onClick:m=>d.$router.push({name:a.unref(sr).TEMPLATE_DETAILS,params:{templateId:p.id}}),onDeleteItem:u[0]||(u[0]=(m,h)=>l(m,h))},null,8,["id","title","phases","milestones","activities","updated-at","updated-by","onUpdateTitle","onClick"])]}),_:1},8,["model-value"])]))}}),Mge="",YD={class:"ao-field__label"},Bg=a.defineComponent({__name:"AoField",props:{label:{},isMultiselect:{type:Boolean,default:!1}},setup(t){return(e,n)=>(a.openBlock(),a.createElementBlock("label",{class:a.normalizeClass(["ao-field",{"ao-field--multiselect":t.isMultiselect}])},[a.createElementVNode("span",YD,a.toDisplayString(t.label),1),a.renderSlot(e.$slots,"default")],2))}}),JD=["type","value","disabled","readonly"],XD=a.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=a.computed(()=>n.modelModifiers.lazy?"change":"input"),i=s=>{n.modelModifiers.number&&(s=Number(s)),o("update:modelValue",s)};return(s,l)=>(a.openBlock(),a.createBlock(Bg,{label:t.label},{default:a.withCtx(()=>[a.createElementVNode("input",a.mergeProps({class:"ao-field__input",type:t.type,value:t.modelValue,disabled:t.isDisabled,readonly:t.isReadonly},{[a.toHandlerKey(r.value)]:l[0]||(l[0]=c=>i(c.target.value))}),null,16,JD)]),_:1},8,["label"]))}}),QD={class:"ao-field"},eB={class:"ao-field__label"},tB=["checked","disabled"],nB=a.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)=>(a.openBlock(),a.createElementBlock("label",QD,[a.createElementVNode("span",eB,a.toDisplayString(t.label),1),a.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,tB)]))}});he.AoAvatar=Pn,he.AoCardFeed=ru,he.AoCheckboxField=nB,he.AoColorPicker=al,he.AoFeed=iu,he.AoField=Bg,he.AoInputField=XD,he.AoMultiselect=kt,he.AoProjectPhases=ou,he.AoTabBar=ai,he.AoTemplateDetails=Eg,he.AoTemplates=Ug,he.AoTemplatesList=Dg,he.EstimationUnit=vu,he.TemplateItemTypeEnum=bu,he.activityFeedRoutes=lr,he.activityFeedStatus=g_,he.durationTypes=h_,he.feedFilterTypes=Ao,he.getProjectOverviewRoutes=GD,he.getTemplateRoutes=ZD,he.listUpdateTypes=b_,he.milestoneStatus=na,he.projectOverviewRoutes=Pe,he.ruleComparators=mu,he.ruleDurationUnits=gu,he.ruleTriggerTypes=hu,he.templateItemType=ze,he.templateRouteNames=sr,Object.defineProperty(he,Symbol.toStringTag,{value:"Module"})});
|