PageSourceSearch

https://app.weezly.com/assets/MeetingPollView-GrCyqwwG.js

js weezly.com collected 2026-09-24 11:54:18 UTC 31,279 bytes, 1 lines download raw bytes

1import{d as ue,a7 as ce,aI as w,r as y,c as K,aC as Ae,_ as me,a as c,g as d,b as o,q as oe,F as O,p as I,n as B,t as l,G as Re,e as b,f as he,o as s,h as xe,N as We,a8 as Me,y as _e,L as De,s as re,u as qe,w as Be,A as je,ak as Ze,af as Je,a0 as Ge,aO as ke,aF as Xe,aB as Ye,aP as Qe,W as Ke,au as $e,X as et,av as tt,aN as ot,E as te,I as ge,J as Ce,aQ as at}from"./index-DKueJ56C.js";import{U as lt}from"./UiCheckbox-DuCOVXTG.js";import{U as nt}from"./UiDropdown-BTMuH8wV.js";import{U as st}from"./UiTextField-ROeT5wsN.js";import{U as rt}from"./UiToggle-C2y38EVh.js";import{L as it}from"./LocationPicker-PFcQ51UV.js";import{T as dt}from"./TimezonePicker-Ct6pZPP9.js";import{T as ct}from"./thumbs-up-NcHpJWND.js";import{C as ut}from"./chevron-up-DfsKOsOM.js";import{C as mt}from"./chevron-down-Cv72UE4P.js";import"./UiButton-D4rLGMnN.js";import"./LocationIcon-D-X4-yp-.js";import"./grip-vertical-DSEHQCUx.js";import"./pencil-BubuoIeh.js";import"./datetime-D2JIYqdq.js";const le=50,Se=15,yt=ue({__name:"PollSingleDay",props:{weekDay:{type:Object,required:!0},callendoEvents:{type:Array,required:!0},calendarEvents:{type:Array,required:!0},duration:{type:Number,required:!0},timezone:{type:String,required:!0},slots:{type:Array,required:!0},passedHeight:{type:String,required:!0}},emits:["addSlot","clearSlot"],setup(V,{expose:n,emit:D}){n();const e=V,M=D,i=y(null),t=y("0px"),a=y({top:0,range_start:"",range_end:"",status:"hide"});function C(){a.value.status="hide"}const z=K(()=>e.duration*le/60);ce(()=>e.weekDay,()=>{const R=w.now().toFormat("yyyy/MM/dd").localeCompare(e.weekDay.date);R<0?t.value="0px":R>0&&(t.value="100%")},{immediate:!0,deep:!0}),ce(()=>e.passedHeight,p=>{w.now().toFormat("yyyy/MM/dd")===e.weekDay.date&&(t.value=p)});const P=K(()=>t.value==="0px"&&e.passedHeight&&w.now().toFormat("yyyy/MM/dd")===e.weekDay.date?e.passedHeight:t.value),U=K(()=>e.callendoEvents.filter(p=>p.date===e.weekDay.date)),J=K(()=>e.calendarEvents.filter(p=>p.date===e.weekDay.date)),A=K(()=>e.slots.filter(p=>p.date===e.weekDay.date));function F(p){return p.to<w.now()}function j(p){if(!i.value)return;const R=i.value.getBoundingClientRect(),ae=p.clientY-R.top-10,Z=Se*le/60;let T=Math.round(ae/Z)*Z;T<0&&(T=0),T+z.value>24*le&&(T=24*le-le);const X=T+z.value;let W=w.now().set({hour:0,minute:0,second:0,millisecond:0});W=W.plus({minutes:T*60/le});const Y=W.toFormat("HH:mm");W=W.plus({minutes:e.duration});const r=W.toFormat("HH:mm");let f="";const h=w.now();let u=w.fromFormat(e.weekDay.date+" "+Y,"yyyy/MM/dd HH:mm",{zone:e.timezone});if(u=u.minus({minutes:15}),u.toMillis()-h.toMillis()<0&&(f="unavailable"),f===""){for(const m of U.value)if(m.top<X&&m.bottom>T){f="unavailable";break}}if(f===""){for(const m of A.value)if(m.bottom=m.top+z.value,m.top<X&&m.bottom>T){f="hide";break}}a.value.status=f,a.value.range_start=Y,a.value.range_end=r,a.value.top=T}function G(){a.value.status===""&&(M("addSlot",{date:e.weekDay.date,top:a.value.top,range_start:a.value.range_start,range_end:a.value.range_end,status:a.value.status}),a.value.status="hide")}const E={props:e,emit:M,HLEN:le,STEP:Se,wrapper:i,passed:t,slot:a,mouseLeave:C,hdu:z,passedStyle:P,dayCallendo:U,dayCalendar:J,daySlots:A,isPast:F,mouseMove:j,addSlot:G,get Trash2(){return Ae},get ThumbsUp(){return ct}};return Object.defineProperty(E,"__isScriptSetup",{enumerable:!1,value:!0}),E}}),ft={class:"font-semibold truncate mb-0"},vt={class:"mb-0"},gt={class:"font-semibold truncate mb-0"},ht={class:"mb-0"},_t=["onClick"],xt={class:"mb-0"},pt={key:0,class:"inline-flex items-center gap-0.5"};function bt(V,n,D,e,M,i){return s(),c("div",{ref:"wrapper",class:"relative flex-1 border-r border-gray-100 cursor-pointer select-none",onMousemove:e.mouseMove,onMouseleave:e.mouseLeave,onClick:e.addSlot},[d(" Passed time "),o("div",{class:"absolute left-0 right-0 top-0 bg-gray-50/80 pointer-events-none z-0",style:oe({height:e.passedStyle})},null,4),d(" Existing Weezly events "),(s(!0),c(O,null,I(e.dayCallendo,(t,a)=>(s(),c("div",{key:"c"+a,class:B(["absolute left-0.5 right-0.5 rounded bg-blue-100 border border-blue-200 text-blue-800 text-[10px] px-1 overflow-hidden z-[1]",{"opacity-50":e.isPast(t)}]),style:oe({top:t.top+"px",height:t.height+"px"})},[o("p",ft,l(t.guest_name)+": "+l(t.event_name),1),o("p",vt,l(t.fr.toFormat("HH:mm"))+" - "+l(t.to.toFormat("HH:mm")),1)],6))),128)),d(" Existing calendar (integration) events "),(s(!0),c(O,null,I(e.dayCalendar,(t,a)=>(s(),c("div",{key:"i"+a,class:B(["absolute left-0.5 right-0.5 rounded bg-gray-100 border border-gray-200 text-gray-700 text-[10px] px-1 overflow-hidden z-[1]",[t.type,{"opacity-50":e.isPast(t)}]]),style:oe({top:t.top+"px",height:t.height+"px"})},[o("p",gt,l(t.name),1),o("p",ht,l(t.fr.toFormat("HH:mm"))+" - "+l(t.to.toFormat("HH:mm")),1)],6))),128)),d(" Picked slots "),(s(!0),c(O,null,I(e.daySlots,(t,a)=>(s(),c("div",{key:"s"+a,class:"group absolute left-0.5 right-0.5 rounded bg-blue-600 text-white text-[11px] flex flex-col items-center justify-center overflow-hidden z-[2] hover:bg-red-500",style:oe({top:t.top+"px",height:e.hdu+"px"}),onClick:Re(C=>e.emit("clearSlot",t),["stop"])},[b(e.Trash2,{size:14,class:"opacity-0 group-hover:opacity-100 absolute top-0.5 right-0.5"}),o("p",xt,l(t.range_start)+" - "+l(t.range_end),1),t.votes?(s(),c("span",pt,[b(e.ThumbsUp,{size:11}),he(" "+l(t.votes),1)])):d("v-if",!0)],12,_t))),128)),d(" Hover preview "),o("div",{class:B(["absolute left-0.5 right-0.5 rounded text-[11px] flex items-center justify-center z-[3] pointer-events-none",e.slot.status==="unavailable"?"bg-gray-300/70 text-gray-600":e.slot.status==="hide"?"opacity-0":"bg-blue-500/30 border border-blue-500 text-blue-700"]),style:oe({top:e.slot.top+"px",height:e.hdu+"px"})},l(e.slot.status==="unavailable"?"Unavailable":e.slot.range_start+" - "+e.slot.range_end),7)],544)}const wt=me(yt,[["render",bt],["__file","/home/gitlab-runner/weezly-v3/callendo-frontend-v3/src/components/builder/poll/PollSingleDay.vue"]]),ze=50,kt=ue({__name:"PollNowLabel",props:{timezone:{type:String,required:!0}},emits:["now-update"],setup(V,{expose:n,emit:D}){n();const e=V,M=D,i=y(-10),t=y("");let a;function C(){const P=w.now().setZone(e.timezone),U=(P.hour*60+P.minute)*ze/60;i.value=U-10,t.value=P.toFormat("H:mm"),M("now-update",{height:U,date:P.toFormat("yyyy/MM/dd")})}xe(()=>{C(),a=setInterval(C,1e3)}),We(()=>{a&&clearInterval(a)});const z={props:e,emit:M,HOUR_HEIGHT:ze,nowTop:i,nowLabel:t,get timer(){return a},set timer(P){a=P},labelNow:C};return Object.defineProperty(z,"__isScriptSetup",{enumerable:!1,value:!0}),z}}),Ct={class:"absolute -left-12 -top-2 text-[10px] font-medium text-red-500 bg-white px-1"};function St(V,n,D,e,M,i){return e.nowTop>0?(s(),c("div",{key:0,class:"absolute left-0 right-0 h-px bg-red-500 z-10 pointer-events-none",style:oe({top:e.nowTop+"px"})},[o("span",Ct,l(e.nowLabel),1)],4)):d("v-if",!0)}const zt=me(kt,[["render",St],["__file","/home/gitlab-runner/weezly-v3/callendo-frontend-v3/src/components/builder/poll/PollNowLabel.vue"]]),ne=50,Mt=ue({__name:"PollCalendar",props:{timezone:{type:String,required:!0},duration:{type:Number,required:!0},slots:{type:Array,required:!0},thePoll:{type:null,required:!1}}
1,emits:["addSlot","clearSlot","clearDaySlots","reset","loadWeek"],setup(V,{expose:n,emit:D}){const e=V,M=D,i=y([]),t=y(""),a=y([]),C=y([]),z=y([]),P=y(1),U=y(!1),J=y({}),A=y(null);function F(){if(e.timezone){const r=w.now().setZone(e.timezone);if(r.isValid)return r}return w.now()}const j=K(()=>["TZ"+F().toFormat("ZZ").substring(0,3),"1 am","2 am","3 am","4 am","5 am","6 am","7 am","8 am","9 am","10 am","11 am","12 pm","1 pm","2 pm","3 pm","4 pm","5 pm","6 pm","7 pm","8 pm","9 pm","10 pm","11 pm"]);xe(async()=>{E();const r=F(),f=(r.hour*60+r.minute)*ne/60-200;await Me();try{A.value&&(A.value.scrollTop=f)}catch{}if(e.thePoll){let h=[];try{h=JSON.parse(e.thePoll.slots)||[]}catch{h=[]}const u=w.now().plus({minutes:15}),m=[];e.thePoll.votes&&e.thePoll.votes.forEach(x=>{let _=[];try{_=JSON.parse(x.slots)||[]}catch{_=[]}_.forEach(k=>{m.push({id:k+x.name,name:x.name,X:k})})}),h.forEach(x=>{const _=w.fromSeconds(Number(x),{zone:e.timezone});if(_>u){const k=(_.hour*60+_.minute)*50/60;M("addSlot",{top:k,range_start:_.toFormat("HH:mm"),range_end:_.plus({minutes:e.duration}).toFormat("HH:mm"),status:"",date:_.toFormat("yyyy/MM/dd"),votes:m.filter(S=>S.X==x).length})}})}}),ce(()=>e.timezone,()=>{const r=i.value.length&&i.value[0].dt.isValid?i.value[0].dt.toJSDate():!1;E(r),M("reset")}),ce(()=>e.duration,()=>{M("reset")});function G(r){return["mon","tue","wed","thu","fri","sat","sun","mon"][r]}function E(r=!1){if(U.value)return;let f;r==="current"?f=i.value.length&&i.value[0].dt.isValid?i.value[0].dt:F():r?f=e.timezone?w.fromJSDate(r).setZone(e.timezone):w.fromJSDate(r):f=F(),f.isValid||(f=w.now());let h=f.startOf("week");const u=[];for(let k=1;k<=7;k++)u.push({id:k,ddd:h.toFormat("ccc"),D:h.toFormat("d"),date:h.toFormat("yyyy/MM/dd"),dt:h}),h=h.plus({days:1});t.value=F().toFormat("yyyy/MM/dd"),i.value=u,Z();const m=u[0].dt,x=u[u.length-1].dt;let _;m.toFormat("MM/yyyy")!==x.toFormat("MM/yyyy")?_=m.toFormat("LLL d")+" - "+x.toFormat("LLL d, yyyy"):_=m.toFormat("LLL d")+" - "+x.toFormat("d, yyyy"),M("loadWeek",{date:u[0].dt.toJSDate(),range:_})}function p(){E()}function R(r=!0){if(i.value.length>0){const f=r?i.value[i.value.length-1].dt.plus({days:2}):i.value[0].dt.plus({days:-2});E(f.toJSDate())}else E()}function ae(r){E(r)}async function Z(){U.value=!0;try{const r=await _e("POST","scheduling/events/getAllEvents",{from:i.value[0].date,to:i.value[i.value.length-1].date,timezone:e.timezone});if(r){const h=[];for(const u of r.data.callendo_events){let m=w.fromFormat(u.booking_date+" "+u.booking_time,"yyyy/MM/dd HH:mm",{zone:u.booking_timezone}).setZone(e.timezone);const[x,_]=u.event_duration.split("_");let k=m.plus({[_==="m"?"minutes":"hours"]:Number(x)});if(u.time_before!=null){const[S,N]=u.time_before.split("_");m=m.minus({[N==="m"?"minutes":"hours"]:Number(S)})}if(u.time_after!=null){const[S,N]=u.time_after.split("_");k=k.plus({[N==="m"?"minutes":"hours"]:Number(S)})}T(h,u,m,k)}a.value=h}const f=await _e("POST","scheduling/getDaily",{startDate:i.value[0].dt.toFormat("yyyy-MM-dd"),endDate:i.value[i.value.length-1].dt.toFormat("yyyy-MM-dd"),timezone_text:e.timezone,timezone_plus:F().toFormat("ZZ")});if(f){const h=[];if(f.data.single)for(const m of f.data.single){const x=w.fromISO(m.times.startTime).setZone(e.timezone),_=w.fromISO(m.times.endTime).setZone(e.timezone);T(h,m,x,_)}C.value=h;const u=[];if(f.data.allday){f.data.allday.sort((k,S)=>k.times.startTime.localeCompare(S.times.startTime));let m=0,x=0,_=0;for(const k of f.data.allday){const S=w.fromFormat(k.times.startTime,"yyyy-MM-dd"),N=w.fromFormat(k.times.endTime,"yyyy-MM-dd"),ye=w.fromFormat(i.value[0].date,"yyyy/MM/dd"),$=Math.floor(S.diff(ye,"days").days),se=Math.floor(N.diff(S,"days").days);$<_&&m++,$>x&&(x=$),$+se>_&&(_=$+se),u.push({...k,left:$,width:se,level:m})}P.value=m+1}z.value=u}}finally{U.value=!1}}function T(r,f,h,u){const m=h.hour,x=h.minute,_=u.hour,k=u.minute;if(h.toFormat("yyyy/MM/dd")===u.toFormat("yyyy/MM/dd")){const S=(m*60+x)*ne/60,N=(_*60+k)*ne/60;r.push({...f,top:S,bottom:N,height:N-S,fr:h,to:u,date:h.toFormat("yyyy/MM/dd")})}else{let S=(m*60+x)*ne/60,N=24*ne;r.push({...f,top:S,bottom:N,height:N-S,fr:h,to:u,date:h.toFormat("yyyy/MM/dd")}),S=0,N=(_*60+k)*ne/60,r.push({...f,top:S,bottom:N,height:N-S,fr:h,to:u,date:u.toFormat("yyyy/MM/dd")})}}function X(r){J.value={...J.value,[r.date]:r.height+"px"}}const W=K(()=>i.value.some(r=>r.date===t.value));n({loadToday:p,loadOtherWeek:R,gotoDate:ae});
1const Y={props:e,emit:M,HLEN:ne,weekDays:i,todayDate:t,callendoEvents:a,calendarEvents:C,calendarAllday:z,alldayLevel:P,loading:U,passedHeights:J,viewport:A,nowZoned:F,timesInDay:j,getddd:G,loadWeek:E,loadToday:p,loadOtherWeek:R,gotoDate:ae,loadData:Z,pushSpan:T,onNowUpdate:X,showNow:W,get Loader2(){return De},PollSingleDay:wt,PollNowLabel:zt};return Object.defineProperty(Y,"__isScriptSetup",{enumerable:!1,value:!0}),Y}}),Dt={class:"relative h-full flex flex-col select-none"},Lt={ref:"viewport",class:"absolute inset-0 overflow-y-auto"},Tt={class:"sticky top-0 z-20 bg-white"},Nt={class:"flex"},Pt={class:"flex-1"},Et={key:0,class:"flex"},Ft=["onClick"],Ut={class:"flex border-b border-gray-200"},Ht={class:"text-xs uppercase"},Ot={class:"text-base font-medium mb-0"},It={class:"flex relative"},Vt={class:"w-12 shrink-0"},At={class:"absolute -top-2 right-1 text-[10px] text-gray-400"},Rt={class:"flex-1 flex relative",style:{height:"1200px"}},Wt={key:0,class:"absolute inset-0 flex items-center justify-center bg-white/60 z-30"};function qt(V,n,D,e,M,i){return s(),c("div",Dt,[o("div",Lt,[d(" Sticky header: week days + clear-times + all-day band "),o("div",Tt,[o("div",Nt,[n[2]||(n[2]=o("div",{class:"w-12 shrink-0"},null,-1)),o("div",Pt,[d(" clear-times row "),D.slots.length>0?(s(),c("div",Et,[(s(!0),c(O,null,I(e.weekDays,t=>(s(),c("div",{key:"cl"+t.id,class:"flex-1 text-center py-1"},[D.slots.filter(a=>a.date===t.date).length>0?(s(),c("span",{key:0,class:"text-xs text-red-500 cursor-pointer hover:underline",onClick:a=>e.emit("clearDaySlots",t.date)},l(V.$t("text.clear_times")),9,Ft)):d("v-if",!0)]))),128))])):d("v-if",!0),d(" day headers "),o("div",Ut,[(s(!0),c(O,null,I(e.weekDays,t=>(s(),c("div",{key:t.id,class:B(["flex-1 text-center py-2",t.date===e.todayDate?"text-blue-600 font-semibold":"text-gray-600"])},[o("span",Ht,l(t.ddd),1),o("p",Ot,l(t.D),1)],2))),128))]),d(" all-day band "),o("div",{class:"relative border-b border-gray-200",style:oe({height:e.alldayLevel*20+1+"px"})},[(s(!0),c(O,null,I(e.calendarAllday,t=>(s(),c("div",{key:t.id,class:"absolute px-1",style:oe({left:"calc(100% / 7 * "+t.left+")",width:"calc(100% / 7 * "+t.width+")",top:t.level*20+"px"})},[o("div",{class:B(["text-[10px] font-semibold truncate rounded bg-gray-100 px-1",t.type])},l(t.name),3)],4))),128))],4)])])]),d(" Grid "),o("div",It,[d(" Left timeline "),o("div",Vt,[(s(!0),c(O,null,I(e.timesInDay,(t,a)=>(s(),c("div",{key:a,class:"relative",style:{height:"50px"}},[o("span",At,l(t),1)]))),128))]),d(" Day columns "),o("div",Rt,[(s(!0),c(O,null,I(e.weekDays,t=>(s(),re(e.PollSingleDay,{key:t.id,"week-day":t,"callendo-events":e.callend
1oEvents,"calendar-events":e.calendarEvents,duration:D.duration,timezone:D.timezone,slots:D.slots,"passed-height":e.passedHeights[t.date]||"0px",onAddSlot:n[0]||(n[0]=a=>e.emit("addSlot",a)),onClearSlot:n[1]||(n[1]=a=>e.emit("clearSlot",a))},null,8,["week-day","callendo-events","calendar-events","duration","timezone","slots","passed-height"]))),128)),e.showNow?(s(),re(e.PollNowLabel,{key:0,timezone:D.timezone,onNowUpdate:e.onNowUpdate},null,8,["timezone"])):d("v-if",!0)])])],512),e.loading?(s(),c("div",Wt,[b(e.Loader2,{size:28,class:"animate-spin text-blue-600"})])):d("v-if",!0)])}const Bt=me(Mt,[["render",qt],["__file","/home/gitlab-runner/weezly-v3/callendo-frontend-v3/src/components/builder/poll/PollCalendar.vue"]]),jt=ue({__name:"MeetingPollView",props:{asModal:{type:Boolean,required:!1,default:!1},modalEventId:{type:[String,Number,null],required:!1,default:null}},emits:["close"],setup(V,{expose:n,emit:D}){n();const e=qe(),M=Be(),i=je(),{settings:t,polls:a}=Ze(i),C=Je(),{t:z}=Ge(),P=V,U=D;function J(){P.asModal?U("close"):M.push("/")}const A=y(!1),F=y(""),j=y("30"),G=y("m"),E=y(!1),p=y([]),R=y(1),ae=y(!0),Z=y(!1),T=y(""),X=y(""),W=y(""),Y=y(""),r=y([{id:Math.random(),location_type:"",location_value:"",location_custom:""}]),f=y("en"),h=y(!1),u=y(!1),m=y(!1),x=y(null),_=y(""),k=K(()=>G.value==="m"?Number(j.value):Number(j.value)*60),S=K(()=>{const v=[],g=[...p.value].sort((L,H)=>L.date.localeCompare(H.date));for(const L of g)if(!v.find(H=>H.date===L.date)){const H=w.fromFormat(L.date,"yyyy/MM/dd");v.push({date:L.date,date_display:H.toFormat("cccc, LLLL d, yyyy"),slots:g.filter(q=>q.date===L.date).sort((q,ie)=>q.top-ie.top)})}return v});function N(v){return ke.find(g=>g.key===v)||{key:"",name:"",flag:""}}xe(async()=>{(!t.value||t.value.timezone==null)&&await i.fetchSettings(),await i.fetchIntegrations(),F.value=t.value.timezone,X.value=z("text.meeting_poll");const v=P.modalEventId??e.params.ID;if(v){a.value.length||await i.fetchPolls();const g=a.value.find(L=>L.id==v);if(g){A.value=g,F.value=g.timezone,f.value=g.language;const L=String(g.duration).split("_");j.value=L[0],G.value=L[1],["15_m","30_m","45_m","60_m"].includes(g.duration)||(E.value=!0),X.value=g.name,Y.value=g.description_html,r.value=[{id:Math.random(),location_type:g.location_type,location_value:g.location_value,location_custom:""}],R.value=g.visibility,u.value=g.only_business_email}else{C.error("Something went wrong"),setTimeout(J,1e3);return}}else f.value=t.value.language||"en";await Me()});function ye(v,g){v==="custom"?E.value=!0:(j.value=v,G.value="m",E.value=!1),g()}function $(v){x.value&&(v==="today"?x.value.loadToday():v==="previousWeek"?x.value.loadOtherWeek(!1):v==="nextWeek"&&x.value.loadOtherWeek(!0))}function se(v){p.value.push(v)}function Le(v){v==="all"?p.value=[]:p.value=p.value.filter(g=>g.date+g.range_start!==v.date+v.range_start)}function Te(v){p.value=p.value.filter(g=>g.date!==v)}function Ne(v,g){const L=r.value.find(H=>H.id===v);if(L)for(const H in g)L[H]=g[H]}function Pe(){r.value[0].location_type="",r.value[0].location_value=""}function Ee(v){T.value=v.range}function Fe(v){!_.value||!x.value||(x.value.gotoDate(new Date(_.value)),v())}async function Ue(){if(p.value.length===0){C.error(z("alert.pick_one_time_to_continue"));return}const v=X.value.trim();if(W.value="",v===""){W.value=z("alert.cant_be_blank");return}Z.value=!0;try{const g={name:v,description:Y.value,location_type:r.value[0].location_type,location_value:r.value[0].location_value,duration:j.value+"_"+G.value,timezone:F.value,visibility:R.value,slots:p.value,language:f.value,only_business_email:u.value};let L="scheduling/poll/create";A.value&&(L="scheduling/poll/update",g.id=A.value.id,g.notify=ae.value);const H=await _e("POST",L,g);if(H){const q=H.data;A.value?(C.success(z("alert.your_event_has_been_updated")),i.updateEventLocal(q.id,q,"poll")):(C.success(z("text.your_event_has_been_created")),i.addEventLocal({...q,type:"poll"}));const ie=String(q.duration).split("_");let be=ie[0]+" ";be+=ie[1]==="m"?"mins":"hours";const Ie=Xe()+"/p/"+q.url;let de=[];try{de=JSON.parse(q.slots)||[]}catch{de=[]}de.sort((ee,Q)=>String(ee).localeCompare(String(Q)));const we=de.map(ee=>{const Q=w.fromSeconds(Number(ee));return{date:Q.toFormat("yyyy/MM/dd"),time:Q.toFormat("HH:mm"),dt:Q}}),fe=[];for(const ee of we)if(!fe.find(Q=>Q.date===ee.date)){const Q=w.fromFormat(ee.date,"yyyy/MM/dd");fe.push({date:ee.date,date_display:Q.toFormat("cccc, LLLL d, yyyy"),slots:we.filter(ve=>ve.date===ee.date).sort((ve,Ve)=>ve.dt.toMillis()-Ve.dt.toMillis())})}m.value={name:q.name,duration:be,timezone:q.timezone,url:Ie,slots:fe,show:!1}}else C.error(z("alert.something_wrong"))}finally{Z.value=!1}}function He(){Ye(m.value.url),C.success(z("alert.copied_link"))}function Oe(){Z.value||J()}const pe={route:e,router:M,scheduling:i,settings:t,polls:a,toast:C,$t:z,props:P,emit:U,goBack:J,thePoll:A,timezone:F,durationNumber:j,durationType:G,durationCustom:E,slots:p,visibility:R,isNotify:ae,loading:Z,dateRange:T,name:X,errorName:W,description:Y,locations:r,language:f,openOptions:h,onlyBusinessEmail
1:u,readyData:m,calendar:x,datePicker:_,durationM:k,dateSlots:S,getLanguage:N,selectDuration:ye,loadCalendar:$,addSlot:se,clearSlot:Le,clearDaySlots:Te,updateLocation:Ne,removeLocation:Pe,loadWeek:Ee,onDatePick:Fe,create:Ue,copyLink:He,close:Oe,get ChevronLeft(){return ot},get ChevronRight(){return tt},get ChevronDown(){return mt},get ChevronUp(){return ut},get X(){return et},get Loader2(){return De},get ExternalLink(){return $e},get CalendarDays(){return Ke},get languages(){return ke},get flagEmoji(){return Qe},get UiDropdown(){return nt},get UiTextField(){return st},get UiCheckbox(){return lt},get UiToggle(){return rt},LocationPicker:it,TimezonePicker:dt,PollCalendar:Bt};return Object.defineProperty(pe,"__isScriptSetup",{enumerable:!1,value:!0}),pe}}),Zt={class:"flex h-full relative"},Jt={class:"flex-1 flex flex-col border-r border-gray-200 overflow-hidden relative"},Gt={class:"flex items-center gap-3 px-4 pt-4"},Xt={class:"inline-flex items-center rounded-lg border border-gray-300 overflow-hidden"},Yt={class:"inline-flex items-center gap-2 border border-gray-300 rounded-lg px-3 py-1.5 text-sm hover:border-gray-400"},Qt={class:"p-2"},Kt=["onClick"],$t={class:"flex-1 mt-4 overflow-hidden"},eo={class:"w-[400px] shrink-0 flex flex-col bg-white relative"},to={class:"px-4 pt-4"},oo={class:"text-lg font-bold text-gray-900"},ao={class:"flex-1 overflow-hidden flex flex-col"},lo={class:"flex-1 overflow-y-auto px-4 pt-4"},no={class:"mb-5"},so={class:"mb-5"},ro={class:"w-full flex items-center gap-2 border border-gray-300 rounded-lg px-3 py-2 text-sm has-placeholder"},io={class:"placeholder"},co={key:0,class:"flex-1 text-left"},uo={key:1,class:"flex-1 text-left"},mo=["onClick"],yo=["onClick"],fo={key:0,class:"flex items-center gap-3 mt-3"},vo={class:"flex-1"},go={class:"flex-1"},ho={class:"w-full flex items-center gap-2 border border-gray-300 rounded-lg px-3 py-2 text-sm"},_o={class:"flex-1 text-left"},xo=["onClick"],po=["onClick"],bo={key:1,class:"text-xs text-red-600 mt-2 italic"},wo=["placeholder"],ko={class:"flex-1 text-sm font-semibold text-gray-700 mb-0"},Co={class:"mb-5"},So={class:"w-full flex items-center gap-2 border border-gray-300 rounded-lg px-3 py-2 text-sm has-placeholder"},zo={class:"placeholder"},Mo={class:"flex-1 text-left"},Do=["onClick"],Lo={class:"flex items-center gap-2 mb-5"},To={class:"flex items-center mb-5"},No={class:"flex-1 text-sm text-gray-700 mb-0"},Po={key:0,class:"flex items-center gap-2 mb-5"},Eo={class:"flex-1 text-sm font-medium text-gray-700 mb-0"},Fo={class:"px-4 py-3"},Uo={class:"flex flex-col border-t border-gray-200",style:{"max-height":"50%"}},Ho={class:"flex items-center px-4 py-3"},Oo={class:"flex-1 text-sm font-semibold text-gray-700 mb-0"},Io={class:"flex-1 overflow-y-auto px-4 pb-3"},Vo={class:"text-sm text-gray-600 mb-1 capitalize"},Ao={class:"flex flex-wrap gap-1.5"},Ro=["onClick"],Wo={key:0,class:"absolute inset-0 flex items-center justify-center bg-white/60 z-40"},qo={key:1,class:"absolute inset-0 z-50 bg-white overflow-y-auto"},Bo={class:"max-w-2xl mx-auto py-10 px-6"},jo={class:"bg-blue-600 rounded-2xl p-8 relative text-white"},Zo={class:"text-2xl font-bold mb-1"},Jo={class:"text-blue-100 mb-6"},Go={class:"flex items-center gap-3 bg-white rounded-xl px-4 py-3"},Xo={class:"flex-1 truncate text-gray-900 font-medium"},Yo={class:"mt-4"},Qo=["href"];function Ko(V,n,D,e,M,i){return s(),c("div",Zt,[d(" Left calendar "),o("div",Jt,[o("div",Gt,[o("button",{class:"text-sm text-gray-500 hover:text-blue-600",onClick:e.close},"← Events"),o("div",Xt,[o("button",{class:"px-2 py-1.5 hover:bg-gray-50",title:"Previous week",onClick:n[0]||(n[0]=t=>e.loadCalendar("previousWeek"))},[b(e.ChevronLeft,{size:16})]),o("button",{class:"px-3 py-1.5 text-sm font-medium border-x border-gray-300 hover:bg-gray-50",onClick:n[1]||(n[1]=t=>e.loadCalendar("today"))}," Today "),o("button",{class:"px-2 py-1.5 hover:bg-gray-50",title:"Next week",onClick:n[2]||(n[2]=t=>e.loadCalendar("nextWeek"))},[b(e.ChevronRight,{size:16})])]),b(e.UiDropdown,{position:"bottom-left",width:"240px"},{toggle:te(()=>[o("button",Yt,[b(e.CalendarDays,{size:16,class:"text-gray-400"}),o("span",null,l(e.dateRange),1),b(e.ChevronDown,{size:14,class:"text-gray-400"})])]),default:te(({close:t})=>[o("div",Qt,[ge(o("input",{"onUpdate:modelValue":n[3]||(n[3]=a=>e.datePicker=a),type:"date",class:"w-full border border-gray-200 rounded-md px-2 py-1.5 text-sm"},null,512),[[Ce,e.datePicker]]),o("button",{class:"w-full mt-2 bg-blue-600 text-white rounded-md py-1.5 text-sm hover:bg-blue-700",onClick:a=>e.onDatePick(t)}," Go ",8,Kt)])]),_:1})]),o("div",$t,[b(e.PollCalendar,{ref:"calendar",timezone:e.timezone,duration:e.durationM,slots:e.slots,"the-poll":e.thePoll||void 0,onAddSlot:e.addSlot,onClearSlot:e.clearSlot,onClearDaySlots:e.clearDaySlots,onReset:n[4]||(n[4]=t=>
1e.slots=[]),onLoadWeek:e.loadWeek},null,8,["timezone","duration","slots","the-poll"])])]),d(" Right panel "),o("div",eo,[o("div",to,[o("h2",oo,l(e.thePoll?e.$t("button.edit")+" ":"")+l(e.$t("text.meeting_poll")),1)]),o("div",ao,[o("div",lo,[d(" TITLE "),o("div",no,[b(e.UiTextField,{modelValue:e.name,"onUpdate:modelValue":[n[5]||(n[5]=t=>e.name=t),n[6]||(n[6]=t=>e.errorName="")],placeholder:e.$t("text.event_name"),error:e.errorName},null,8,["modelValue","placeholder","error"])]),d(" DURATION "),o("div",so,[b(e.UiDropdown,{class:"block",position:"bottom-left",width:"100%"},{toggle:te(()=>[o("button",ro,[o("span",io,l(e.$t("text.duration")),1),e.durationCustom?(s(),c("span",co,l(e.$t("text.custom")),1)):(s(),c("span",uo,l(e.durationNumber)+" "+l(e.$t("text.min")),1)),b(e.ChevronDown,{size:16,class:"text-gray-400"})])]),default:te(({close:t})=>[(s(),c(O,null,I(["15","30","45","60"],a=>o("button",{key:a,class:B(["w-full text-left px-3 py-2 rounded text-sm hover:bg-gray-50",!e.durationCustom&&e.durationNumber===a?"text-blue-600 font-medium":"text-gray-700"]),onClick:C=>e.selectDuration(a,t)},l(a)+" "+l(e.$t("text.min")),11,mo)),64)),o("button",{class:B(["w-full text-left px-3 py-2 rounded text-sm hover:bg-gray-50",e.durationCustom?"text-blue-600 font-medium":"text-gray-700"]),onClick:a=>e.selectDuration("custom",t)},l(e.$t("text.custom")),11,yo)]),_:1}),e.durationCustom?(s(),c("div",fo,[o("div",vo,[b(e.UiTextField,{modelValue:e.durationNumber,"onUpdate:modelValue":n[7]||(n[7]=t=>e.durationNumber=t),placeholder:"0"},null,8,["modelValue"])]),o("div",go,[b(e.UiDropdown,{class:"block",position:"bottom-left",width:"100%"},{toggle:te(()=>[o("button",ho,[o("span",_o,l(e.durationType==="m"?"min":"hour"),1),b(e.ChevronDown,{size:16,class:"text-gray-400"})])]),default:te(({close:t})=>[o("button",{class:B(["w-full text-left px-3 py-2 rounded text-sm hover:bg-gray-50",e.durationType==="m"?"text-blue-600 font-medium":"text-gray-700"]),onClick:a=>{e.durationType="m",t()}},l(e.$t("text.min")),11,xo),o("button",{class:B(["w-full text-left px-3 py-2 rounded text-sm hover:bg-gray-50",e.durationType==="h"?"text-blue-600 font-medium":"text-gray-700"]),onClick:a=>{e.durationType="h",t()}},l(e.$t("text.hour")),11,po)]),_:1})])])):d("v-if",!0),e.thePoll&&e.durationNumber+"_"+e.durationType!==e.thePoll.duration?(s(),c("p",bo," * "+l(e.$t("text.extending_the_meeting_duration_remove")),1)):d("v-if",!0)]),d(" LOCATION "),(s(!0),c(O,null,I(e.locations,t=>(s(),re(e.LocationPicker,{key:t.id,class:"mb-5","is-edit":!!e.thePoll,"has-icon":!1,data:t,locations:e.locations,event:e.thePoll,onUpdate:a=>e.updateLocation(t.id,a),onRemove:e.removeLocation},null,8,["is-edit","data","locations","event","onUpdate"]))),128)),d(" DESCRIPTION "),ge(o("textarea",{"onUpdate:modelValue":n[8]||(n[8]=t=>e.description=t),rows:"3",class:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm mb-5 focus:outline-none focus:ring-2 focus:ring-blue-500/30",placeholder:e.$t("text.write_a_summary_invitee_should")}
1,null,8,wo),[[Ce,e.description]]),d(" Additional options "),o("div",{class:"flex items-center mb-5 cursor-pointer",onClick:n[9]||(n[9]=t=>e.openOptions=!e.openOptions)},[o("h3",ko,l(e.$t("text.additional_options")),1),e.openOptions?(s(),re(e.ChevronUp,{key:1,size:18,class:"text-gray-400"})):(s(),re(e.ChevronDown,{key:0,size:18,class:"text-gray-400"}))]),ge(o("div",null,[d(" TIMEZONE "),o("div",Co,[b(e.TimezonePicker,{zone:e.timezone,onSelect:n[10]||(n[10]=t=>e.timezone=t)},null,8,["zone"])]),d(" LANGUAGE "),b(e.UiDropdown,{class:"block mb-5",position:"bottom-left",width:"100%","max-height":"40vh"},{toggle:te(()=>[o("button",So,[o("span",zo,l(e.$t("text.language")),1),o("span",null,l(e.flagEmoji(e.getLanguage(e.language).flag)),1),o("span",Mo,l(e.getLanguage(e.language).name),1),b(e.ChevronDown,{size:16,class:"text-gray-400"})])]),default:te(({close:t})=>[(s(!0),c(O,null,I(e.languages,a=>(s(),c("button",{key:a.key,class:B(["w-full flex items-center gap-2 text-left px-3 py-2 rounded text-sm hover:bg-gray-50",a.key===e.language?"text-blue-600 font-medium":"text-gray-700"]),onClick:C=>{e.language=a.key,t()}},[o("span",null,l(e.flagEmoji(a.flag)),1),he(" "+l(a.name),1)],10,Do))),128))]),_:1}),d(" ONLY BUSINESS EMAIL "),o("div",Lo,[b(e.UiCheckbox,{"is-checked":e.onlyBusinessEmail,onCheckboxChange:n[11]||(n[11]=t=>e.onlyBusinessEmail=!e.onlyBusinessEmail)},null,8,["is-checked"]),n[15]||(n[15]=o("span",{class:"text-sm text-gray-700"},"Only business emails can book",-1))]),d(" SEE EACH OTHER "),o("div",To,[o("p",No,l(e.$t("text.allow_to_see_others_names_votes")),1),b(e.UiToggle,{"model-value":e.visibility===1,"onUpdate:modelValue":n[12]||(n[12]=t=>e.visibility=t?1:0)},null,8,["model-value"])]),d(" NOTIFICATION "),e.thePoll?(s(),c("div",Po,[o("h3",Eo,l(e.$t("text.notify_participants_update_votes")),1),b(e.UiCheckbox,{"is-checked":e.isNotify,onCheckboxChange:n[13]||(n[13]=t=>e.isNotify=!e.isNotify)},null,8,["is-checked"])])):d("v-if",!0)],512),[[at,e.openOptions]])]),d(" CREATE/EDIT "),o("div",Fo,[o("button",{class:B(["w-full h-12 rounded-xl text-white text-sm font-medium uppercase transition-colors",e.slots.length>0&&e.name.trim()!==""?"bg-blue-600 hover:bg-blue-700":"bg-gray-300 cursor-not-allowed"]),onClick:e.create},l(e.thePoll?e.$t("button.edit_meeting"):e.$t("button.public_meeting")),3)])]),d(" SELECTED TIMES "),o("div",Uo,[o("div",Ho,[o("h3",Oo,l(e.$t("text.selected_times"))+" ("+l(e.slots.length)+")",1),o("span",{class:"text-sm text-red-500 cursor-pointer hover:underline",onClick:n[14]||(n[14]=t=>e.clearSlot("all"))},l(e.$t("text.clear_all")),1)]),o("div",Io,[(s(!0),c(O,null,I(e.dateSlots,t=>(s(),c("div",{key:t.date,class:"mb-3"},[o("p",Vo,l(t.date_display),1),o("div",Ao,[(s(!0),c(O,null,I(t.slots,(a,C)=>(s(),c("button",{key:C,class:"inline-flex items-center gap-1 bg-gray-100 hover:bg-red-50 text-gray-700 rounded-md px-2 py-1 text-xs",onClick:z=>e.clearSlot(a)},[o("span",null,l(a.range_start),1),b(e.X,{size:12,class:"text-gray-400"})],8,Ro))),128))])]))),128))])])]),d(" Loading overlay "),e.loading?(s(),c("div",Wo,[b(e.Loader2,{size:32,class:"animate-spin text-blue-600"})])):d("v-if",!0),d(" Ready poll "),e.readyData?(s(),c("div",qo,[o("div",Bo,[o("div",jo,[o("button",{class:"absolute top-4 right-4 w-8 h-8 rounded-full bg-white/20 flex items-center justify-center hover:bg-white/30",onClick:e.close},[b(e.X,{size:18})]),o("h2",Zo,l(e.$t("text.your_meeting_ready_to_share"))+" 👍",1),o("p",Jo,l(e.$t("text.past_in_link_vote_times")),1),o("div",Go,[o("span",Xo,l(e.readyData.url),1),o("button",{class:"bg-blue-600 text-white rounded-lg px-4 py-2 text-sm font-medium hover:bg-blue-700",onClick:e.copyLink},l(e.$t("button.copy_link")),1)]),o("div",Yo,[o("a",{href:e.readyData.url,target:"_blank",class:"inline-flex items-center gap-2 text-white hover:underline"},[b(e.ExternalLink,{size:16}),he(" "+l(e.$t("text.view_live_page")),1)],8,Qo)])])])])):d("v-if",!0)])}const fa=me(jt,[["render",Ko],["__scopeId","data-v-2e376cce"],["__file","/home/gitlab-runner/weezly-v3/callendo-frontend-v3/src/views/builder/MeetingPollView.vue"]]);export{fa as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.