1"use strict";(self["webpackChunkclient"]=self["webpackChunkclient"]||[]).push([[4231],{38621:function(e,t,s){s.d(t,{A:function(){return L}});var i=s(20641),o=s(90033);const a={class:"item-view-page"},l={key:0,class:"item-view-page-desktop"},n={class:"header-left"},r={class:"icon is-small"},d={class:"is-hidden-touch"},c={class:"header-center"},u={key:0,class:"item-view-page-title"},h={class:"header-right"},m={class:"header-actions-group"},v={class:"item-view-page-body"},p={key:1,class:"item-view-page-mobile"},g={class:"item-view-page-mobile-body"};function k(e,t,s,k,b,f){const y=(0,i.g2)("font-awesome-icon"),C=(0,i.g2)("MobileViewHeader");return(0,i.uX)(),(0,i.CE)("div",a,[e.$isMobile()?((0,i.uX)(),(0,i.CE)("div",p,[(0,i.bF)(C,{title:s.title,"is-item-view-page":!0,"show-back-button":null!==s.showBackButton?s.showBackButton:!!s.backRoute,"back-route":s.backRoute,"emit-only":!0,onBack:f.handleBack},{actions:(0,i.k6)(()=>[(0,i.RG)(e.$slots,"actions",{},void 0,!0)]),dropdown:(0,i.k6)(()=>[(0,i.RG)(e.$slots,"dropdown",{},void 0,!0)]),_:3},8,["title","show-back-button","back-route","onBack"]),(0,i.Lk)("div",g,[(0,i.RG)(e.$slots,"default",{},void 0,!0)])])):((0,i.uX)(),(0,i.CE)("div",l,[s.showHeader?((0,i.uX)(),(0,i.CE)("div",{key:0,class:(0,o.C4)(["item-view-page-header",{"is-sticky":s.stickyHeader,"has-divider":s.dividerBelowHeader}])},[(0,i.Lk)("div",n,[s.backRoute?((0,i.uX)(),(0,i.CE)("button",{key:0,class:"button is-small is-light is-rounded",onClick:t[0]||(t[0]=(...e)=>f.handleBack&&f.handleBack(...e))},[(0,i.Lk)("span",r,[(0,i.bF)(y,{icon:"fa-light fa-arrow-left"})]),(0,i.Lk)("span",d,(0,o.v_)(e.$t("Back")),1)])):(0,i.Q3)("",!0)]),(0,i.Lk)("div",c,[s.title?((0,i.uX)(),(0,i.CE)("h2",u,[(0,i.RG)(e.$slots,"title",{},()=>[(0,i.eW)((0,o.v_)(s.title),1)],!0)])):(0,i.Q3)("",!0)]),(0,i.Lk)("div",h,[(0,i.Lk)("div",m,[(0,i.RG)(e.$slots,"actions",{},void 0,!0)])])],2)):(0,i.Q3)("",!0),(0,i.Lk)("div",v,[(0,i.RG)(e.$slots,"default",{},void 0,!0)])]))])}s(44114);var b=s(81084),f={name:"ItemViewPage",components:{MobileViewHeader:b.A},props:{title:{type:String,default:""},backRoute:{type:[String,Object],default:null},showHeader:{type:Boolean,default:!1},showBackButton:{type:Boolean,default:null},stickyHeader:{type:Boolean,default:!1},dividerBelowHeader:{type:Boolean,default:!1}},emits:["back"],methods:{handleBack(){window.history.length>1?this.$router.go(-1):this.backRoute&&this.$router.push(this.backRoute),this.$emit("back")}}},y=s(66262);const C=(0,y.A)(f,[["render",k],["__scopeId","data-v-590cea4e"]]);var L=C},54231:function(e,t,s){s.r(t),s.d(t,{default:function(){return ai}});s(44114);var i=s(20641),o=s(90033),a=s(53751);const l={class:"icon is-small"},n={class:"is-hidden-mobile"},r=["disabled","aria-label","title"],d={class:"icon is-small"},c={class:"icon is-small"},u={class:"is-hidden-mobile"},h=["aria-label","title"],m={class:"icon is-small"},v=["aria-label","title"],p={class:"icon is-small"},g={class:"icon-text"},k={class:"icon is-small"},b={class:"icon-text"},f={class:"icon is-small"},y={class:"icon-text"},C={class:"icon is-small"},L={class:"icon-text"},V={class:"icon is-small"},E={class:"icon-text"},$={class:"icon is-small"},_={class:"icon-text"},S={class:"icon is-small"},w={class:"icon-text"},T={class:"icon is-small"},F=["disabled"],x={class:"icon is-small"},X=["disabled"],A=["disabled"],M={class:"icon is-small"},I={key:0,class:"vote-fullscreen-overlay"},Q={class:"vote-fullscreen-header"},O={class:"vote-fullscreen-logo"},z=["src","alt"],P=["aria-label","title"],U={class:"icon"},R={class:"vote-fullscreen-content"},W={class:"vote-fullscreen-footer is-size-6-half"};function D(e,t,s,D,B,K){const q=(0,i.g2)("font-awesome-icon"),N=(0,i.g2)("b-dropdown-item"),G=(0,i.g2)("b-dropdown"),Y=(0,i.g2)("ShowContent"),H=(0,i.g2)("ItemViewPage"),j=(0,i.g2)("VoteShareModal"),J=(0,i.g2)("UpdateContent"),Z=(0,i.g2)("ItemViewModal");return(0,i.uX)(),(0,i.CE)(i.FK,null,[(0,i.bF)(H,{title:B.item?e.$t("Vote"):"","back-route":K.backRoute,"show-header":!0,"sticky-header":!0,"divider-below-header":!0},{actions:(0,i.k6)(()=>[B.item&&!B.item.dateEnd&&"live"===B.item.status&&K.canEditVote?((0,i.uX)(),(0,i.CE)("button",{key:0,class:"button is-small is-light is-rounded is-hidden-mobile",onClick:t[0]||(t[0]=(...e)=>K.triggerCloseVoting&&K.triggerCloseVoting(...e))},[(0,i.Lk)("span",l,[(0,i.bF)(q,{icon:"fa-light fa-lock"})]),(0,i.Lk)("span",n,(0,o.v_)(e.$t("Close voting")),1)])):(0,i.Q3)("",!0),"live"===B.item?.status?((0,i.uX)(),(0,i.CE)("button",{key:1,class:(0,o.C4)(["button is-small is-light is-rounded",{"is-loading":B.isRefreshing}]),disabled:B.isRefreshing,"aria-label":e.$t("Refresh"),title:e.$t("Refresh"),onClick:t[1]||(t[1]=(...e)=>K.triggerRefresh&&K.triggerRefresh(...e))},[(0,i.Lk)("span",d,[(0,i.bF)(q,{icon:"fa-light fa-refresh"})])],10,r)):(0,i.Q3)("",!0),!B.item||"live"!==B.item.status&&"closed"!==B.item.status?(0,i.Q3)("",!0):((0,i.uX)(),(0,i.CE)("button",{key:2,class:"button is-small is-light is-rounded is-hidden-mobile",onClick:t[2]||(t[2]=(...e)=>K.enterFullscreen&&K.enterFullscreen(...e))},[(0,i.Lk)("span",c,[(0,i.bF)(q,{icon:"fa-light fa-expand"})]),(0,i.Lk)("span",u,(0,o.v_)(e.$t("Fullscreen")),1)])),B.item&&B.item.isEditable&&K.canEditVote?((0,i.uX)(),(0,i.CE)("button",{key:3,class:"button is-small is-primary is-light is-rounded","aria-label":e.$t("Edit"),title:e.$t("Edit"),onClick:t[3]||(t[3]=(...e)=>K.openEditModal&&K.openEditModal(...e))},[(0,i.Lk)("span",m,[(0,i.bF)(q,{icon:"fa-light fa-pencil"})])],8,h)):(0,i.Q3)("",!0),B.item&&K.hasSecondaryActions?((0,i.uX)(),(0,i.Wv)(G,{key:4,position:"is-bottom-left","aria-role":"list","append-to-body":!0},{trigger:(0,i.k6)(()=>[(0,i.Lk)("button",{class:"button is-small is-light is-rounded vote-actions-trigger","aria-label":e.$t("Actions"),title:e.$t("Actions")},[(0,i.Lk)("span",p,[(0,i.bF)(q,{icon:"fa-light fa-ellipsis-vertical"})])],8,v)]),default:(0,i.k6)(()=>[!B.item.dateEnd&&"live"===B.item.status&&K.canEditVote?((0,i.uX)(),(0,i.Wv)(N,{key:0,"aria-role":"listitem",class:"is-hidden-tablet",onClick:K.triggerCloseVoting},{default:(0,i.k6)(()=>[(0,i.Lk)("span",g,[(0,i.Lk)("span",k,[(0,i.bF)(q,{icon:"fa-light fa-lock"})]),(0,i.Lk)("span",null,(0,o.v_)(e.$t("Close voting")),1)])]),_:1},8,["onClick"])):(0,i.Q3)("",!0),K.canShare?((0,i.uX)(),(0,i.Wv)(N,{key:1,"aria-role":"listitem",onClick:t[4]||(t[4]=e=>B.isShareModalOpen=!0)},{default:(0,i.k6)(()=>[(0,i.Lk)("span",b,[(0,i.Lk)("span",f,[(0,i.bF)(q,{icon:"fa-light fa-share-nodes"})]),(0,i.Lk)("span",null,(0,o.v_)(e.$t("Share")),1)])]),_:1})):(0,i.Q3)("",!0),"closed"===B.item.status&&!B.item.isArchived&&K.canManageVote?((0,i.uX)(),(0,i.Wv)(N,{key:2,"aria-role":"listitem",onClick:K.triggerArchive},{default:(0,i.k6)(()=>[(0,i.Lk)("span",y,[(0,i.Lk)("span",C,[(0,i.bF)(q,{icon:"fa-light fa-box-archive"})]),(0,i.Lk)("span",null,(0,o.v_)(e.$t("Archive")),1)])]),_:1},8,["onClick"])):(0,i.Q3)("",!0),K.canManageVote?((0,i.uX)(),(0,i.Wv)(N,{key:3,"aria-role":"listitem",onClick:K.triggerClone},{default:(0,i.k6)(()=>[(0,i.Lk)("span",L,[(0,i.Lk)("span",V,[(0,i.bF)(q,{icon:"fa-light fa-clone"})]),(0,i.Lk)("span",null,(0,o.v_)(e.$t("Duplicate")),1)])]),_:1},8,["onClick"])):(0,i.Q3)("",!0),B.item.hasAvailableResults&&!B.item.isEditable?((0,i.uX)(),(0,i.Wv)(N,{key:4,"aria-role":"listitem",onClick:t[5]||(t[5]=t=>e.$router.push({name:"VoteIntegrity",params:{item:B.item.id}}))},{default:(0,i.k6)(()=>[(0,i.Lk)("span",E,[(0,i.Lk)("span",$,[(0,i.bF)(q,{icon:"fa-light fa-shield-alt"})]),(0,i.Lk)("span",null,(0,o.v_)(e.$t("Integrity verification")),1)])]),_:1})):(0,i.Q3)("",!0),"closed"!==B.item.status||!1===B.item.isAnonymous&&!K.canManageVote?(0,i.Q3)("",!0):((0,i.uX)(),(0,i.Wv)(N,{key:5,"aria-role":"listitem",class:(0,o.C4)(["is-hidden-mobile",{"is-loading":B.isExporting}]),onClick:K.exportResults},{default:(0,i.k6)(()=>[(0,i.Lk)("span",_,[(0,i.Lk)("span",S,[(0,i.bF)(q,{icon:"fa-light fa-file-csv"})]),(0,i.Lk)("span",null,(0,o.v_)(e.$t("Export results")),1)])]),_:1},8,["class","onClick"])),"closed"===B.item.status&&!1!==B.item.isAnonymous?((0,i.uX)(),(0,i.Wv)(N,{key:6,"aria-role":"listitem",class:(0,o.C4)(["is-hidden-mobile",{"is-loading":B.isExportingVoters}]),onClick:K.exportVoters},{default:(0,i.k6)(()=>[(0,i.Lk)("span",w,[(0,i.Lk)("span",T,[(0,i.bF)(q,{icon:"fa-light fa-users"})]),(0,i.Lk)("span",null,(0,o.v_)(e.$t("Export voter list")),1)])]),_:1},8,["class","onClick"])):(0,i.Q3)("",!0)]),_:1})):(0,i.Q3)("",!0),B.item&&B.item.isDraft&&K.canManageVote?((0,i.uX)(),(0,i.CE)("button",{key:5,class:"button is-small is-primary is-rounded ml-1",disabled:B.isLoading,onClick:t[6]||(t[6]=(...e)=>K.triggerPublish&&K.triggerPublish(...e))},[(0,i.Lk)("span",x,[(0,i.bF)(q,{icon:"fa-light fa-signal-stream"})]),(0,i.Lk)("span",null,(0,o.v_)(e.$t("Publish")),1)],8,F)):(0,i.Q3)("",!0)]),default:(0,i.k6)(()=>[B.itemId?((0,i.uX)(),(0,i.Wv)(Y,{key:0,ref:"showContent","vote-id":B.itemId,"seal-code":e.$route.query.seal,onLoaded:K.handleLoaded,onRefresh:K.handleRefresh,onClone:K.handleClone,onPublish:K.handlePublish,onArchived:K.handleArchived,onEdit:K.openEditModal},null,8,["vote-id","seal-code","onLoaded","onRefresh","onClone","onPublish","onArchived","onEdit"])):(0,i.Q3)("",!0)]),_:1},8,["title","back-route"]),(0,i.bF)(j,{modelValue:B.isShareModalOpen,"onUpdate:modelValue":t[7]||(t[7]=e=>B.isShareModalOpen=e),"vote-id":B.itemId,"vote-name":B.item?.name},null,8,["modelValue","vote-id","vote-name"]),(0,i.bF)(Z,{modelValue:B.isEditModalVisible,"onUpdate:modelValue":t[11]||(t[11]=e=>B.isEditModalVisible=e),title:B.item?B.item.name:e.$t("settings"),"modal-width":800,"scroll-container-id":"voteShowEditModalBody","hide-header-close":!0,onClose:K.closeEditModal},{actions:(0,i.k6)(()=>[(0,i.Lk)("button",{type:"button",class:(0,o.C4)(["button is-small is-rounded",{"is-loading":B.editFormState.isPublishing||B.editFormState.isBootstrapping}]),disabled:B.editFormState.isPublishing||B.editFormState.isBootstrapping,onClick:t[8]||(t[8]=(...e)=>K.triggerVoteSaveDraft&&K.triggerVoteSaveDraft(...e))},(0,o.v_)(e.$t("Save")),11,X),(0,i.Lk)("button",{type:"button",class:(0,o.C4)(["button is-small is-primary is-rounded ml-1",{"is-loading":B.editFormState.isPublishing||B.editFormState.isBootstrapping}]),disabled:!B.editFormState.canSubmit||B.editFormState.isPublishing||B.editFormState.isBootstrapping||!1===B.editFormState.isEditable,onClick:t[9]||(t[9]=(...e)=>K.triggerVotePublish&&K.triggerVotePublish(...e))},[(0,i.Lk)("span",M,[(0,i.bF)(q,{icon:"fa-light fa-square-check"})]),(0,i.Lk)("span",null,(0,o.v_)(e.$t("Publish")),1)],10,A)]),default:(0,i.k6)(()=>[B.isEditModalVisible&&B.itemId?((0,i.uX)(),(0,i.Wv)(J,{key:0,ref:"voteEditContent","vote-id":B.itemId,onUpdated:K.handleEditSaved,onPublished:K.handleEditPublished,onDeleted:K.handleEditDeleted,onArchived:K.handleEditArchived,onStateChange:t[10]||(t[10]=e=>B.editFormState=e),onClose:K.closeEditModal,onCancel:K.closeEditModal},null,8,["vote-id","onUpdated","onPublished","onDeleted","onArchived","onClose","onCancel"])):(0,i.Q3)("",!0)]),_:1},8,["modelValue","title","onClose"]),(0,i.bF)(a.eB,{name:"fullscreen-fade"},{default:(0,i.k6)(()=>[B.isFullscreen?((0,i.uX)(),(0,i.CE)("div",I,[(0,i.Lk)("div",Q,[(0,i.Lk)("div",O,[(0,i.Lk)("img",{src:e.tenantLogo,alt:e.tenant?.name},null,8,z)]),(0,i.Lk)("button",{class:"button is-light is-rounded","aria-label":e.$t("Exit fullscreen"),title:e.$t("Exit fullscreen"),onClick:t[12]||(t[12]=(...e)=>K.exitFullscreen&&K.exitFullscreen(...e))},[(0,i.Lk)("span",U,[(0,i.bF)(q,{icon:"fa-light fa-compress"})])],8,P)]),(0,i.Lk)("div",R,[B.itemId?((0,i.uX)(),(0,i.Wv)(Y,{key:0,ref:"showContentFullscreen","vote-id":B.itemId,fullscreen:!0,onLoaded:K.handleFullscreenLoaded},null,8,["vote-id","onLoaded"])):(0,i.Q3)("",!0)]),(0,i.Lk)("p",W,[t[13]||(t[13]=(0,i.Lk)("span",{class:"vote-fullscreen-footer-dot"}
1,null,-1)),(0,i.eW)(" "+(0,o.v_)(e.$t("Powered by Orgo")),1)])])):(0,i.Q3)("",!0)]),_:1})],64)}s(14603),s(47566),s(98721);var B=s(40834),K=s(38621),q=s(80762);const N={key:0},G={class:"vote-show-header mx-2 mb-4"},Y={class:"is-flex is-align-items-center is-flex-wrap-wrap mb-3"},H={key:0,class:"title has-text-dark is-size-4 mb-1 mr-3 mt-2"},j={class:"vote-status-row is-flex is-align-items-center is-flex-wrap-wrap mb-3"},J={key:0,class:"tag is-rounded is-warning"},Z={key:1,class:"tag is-rounded is-warning"},ee={key:2,class:"tag is-rounded is-info"},te={key:3,class:"tag is-danger is-rounded is-small live-badge"},se={class:"icon is-small mr-1"},ie={key:4,class:"tag is-rounded is-success"},oe={key:5,class:"tag is-rounded is-dark ml-1"},ae={key:6,class:"tag is-success is-rounded is-small ml-2 vote-voted-tag"},le={class:"icon is-small mr-1"},ne={key:7,class:"vote-status-dates is-size-7 ml-3"},re={key:0,class:"has-text-weight-semibold"},de={key:1,class:"has-text-grey-light"},ce={key:2,class:"has-text-weight-semibold"},ue={key:3,class:"has-text-grey-light"},he={key:8,class:"vote-status-dates vote-status-open-msg is-size-7 ml-3 has-text-grey"},me={class:"vote-status-tz is-size-7 ml-2"},ve={class:"timezone-dropdown-content"},pe={class:"timezone-list"},ge={class:"timezone-list-header"},ke={class:"timezone-option"},be={class:"has-text-grey"},fe={class:"timezone-list-header mt-3"},ye={class:"timezone-option"},Ce={class:"has-text-grey"},Le={key:0,class:"mt-4"},Ve={class:"icon-text"},Ee={class:"icon is-small"},$e={class:"columns"},_e={key:0,class:"column"},Se={key:0,class:"card is-flat vote-results-card mb-5"},we={class:"vote-results-header is-flex is-justify-content-space-between is-align-items-flex-start"},Te={key:0,class:"vote-q-number"},Fe={class:"vote-type-pill"},xe={class:"vote-results-options"},Xe={class:"vote-result-info"},Ae={class:"vote-result-label"},Me={class:"vote-result-count"},Ie={class:"vote-result-bar-container"},Qe={key:0,class:"vote-result-percentage"},Oe={key:0,class:"vote-result-percentage-outside"},ze={key:1,class:"column"},Pe={key:0,class:"vote-q-number"},Ue={class:"vote-type-pill"},Re={key:0,class:"is-size-7 has-text-grey mb-3 ml-2"},We=["name","value","checked","disabled","onChange"],De=["onUpdate:modelValue","name","value"],Be={class:"privacy-icon"},Ke={class:"privacy-content"},qe={class:"privacy-text"},Ne={key:0,class:"privacy-subtext"},Ge={key:2,class:"has-text-centered mt-4"},Ye=["disabled"],He={class:"icon"},je={key:2,class:"column"},Je={class:"vote-preview-header is-flex is-justify-content-space-between is-align-items-flex-start"},Ze={key:0,class:"vote-q-number"},et={class:"vote-type-pill"},tt={class:"vote-preview-options"},st={class:"vote-checkbox-placeholder"},it={class:"vote-option-label"},ot={key:0,class:"is-size-7 has-text-grey my-3 ml-2"},at={class:"column is-one-third-desktop ml-3 vote-stats-column"},lt={class:"vote-stats-header"},nt={class:"icon is-small mr-2 vote-stats-icon"},rt={class:"has-text-weight-semibold"},dt={key:0,class:"tag is-rounded is-light is-small ml-auto has-text-link"},ct={class:"icon is-small mr-1"},ut={key:1,class:"tag is-rounded is-light is-small ml-auto"},ht={key:2,class:"tag is-rounded is-light is-small ml-auto"},mt={class:"icon is-small mr-1"},vt={class:"vote-stats-body"},pt={class:"vote-stats-percentage"},gt={viewBox:"0 0 36 36"},kt=["stroke-dasharray"],bt={class:"percentage-text"},ft={key:1,class:"vote-stats-empty"},yt={class:"icon is-small vote-stats-empty-icon"},Ct={class:"vote-stats-empty-label"},Lt={class:"vote-stats-numbers"},Vt={class:"stat-item"},Et={class:"stat-value stat-voted"},$t={class:"stat-label"},_t={class:"stat-item"},St={class:"stat-value stat-pending"},wt={class:"stat-label"},Tt={class:"stat-item"},Ft={class:"stat-value stat-total"},xt={class:"stat-label"},Xt={key:0,class:"card is-flat vote-attributed-card mt-2 mb-5"},At={class:"vote-attributed-header"},Mt={class:"icon is-small mr-2"},It={class:"has-text-weight-semibold"},Qt={class:"tag is-rounded is-warning is-light is-small ml-2"},Ot={class:"vote-attributed-body"},zt={key:0,class:"has-text-centered p-4"},Pt={class:"is-size-7 has-text-grey mb-3"},Ut=["disabled"],Rt={class:"icon"},Wt={key:0,class:"is-size-7 has-text-grey p-4 has-text-centered"},Dt={class:"vote-attributed-voter-head"},Bt={class:"vote-attributed-voter-name"},Kt={key:0,class:"vote-attributed-voter-email"},qt={class:"vote-attributed-answers"},Nt={class:"vote-attributed-question"},Gt={class:"vote-attributed-option"},Yt={key:1,class:"is-size-7 has-text-grey p-4 has-text-centered"},Ht={class:"vote-modal-content"},jt={class:"vote-modal-card-header"},Jt={key:0,class:"is-size-7 has-text-grey mb-2 ml-2"},Zt={class:"vote-modal-card-options"},es=["name","value","checked","disabled","onChange"],ts=["onUpdate:modelValue","name","value"],ss={class:"vote-radio-custom"},is={class:"vote-option-text"},os={class:"has-text-centered mt-5"},as=["disabled"],ls={class:"icon"},ns={key:1,class:"vote-success-container"},rs={class:"vote-success-icon"},ds={class:"title is-3 has-text-success mb-2"},cs={class:"has-text-grey is-size-5 mb-5"},us={key:0,class:"vote-seal-section mt-5"},hs={class:"icon is-small has-text-grey-light mr-2"},ms={class:"is-size-7 has-text-grey"},vs={class:"icon is-small has-text-grey-light ml-1"}
1,ps={key:0,class:"vote-seal-content"},gs={class:"is-size-7 has-text-grey mb-3"},ks={class:"seal-code-display"},bs={class:"is-size-7"},fs={class:"has-text-centered mt-3"},ys={class:"icon is-small"};function Cs(e,t,s,l,n,r){const d=(0,i.g2)("b-loading"),c=(0,i.g2)("font-awesome-icon"),u=(0,i.g2)("b-input"),h=(0,i.g2)("b-dropdown-item"),m=(0,i.g2)("b-dropdown"),v=(0,i.g2)("VoteUsers"),p=(0,i.g2)("router-link"),g=(0,i.g2)("ItemViewModal");return(0,i.uX)(),(0,i.CE)("section",{class:(0,o.C4)(["o-maxwidth",{"is-fullscreen-mode":s.fullscreen}])},[(0,i.bF)(d,{modelValue:n.isLoading,"onUpdate:modelValue":t[0]||(t[0]=e=>n.isLoading=e),"is-full-page":!1},null,8,["modelValue"]),n.item?((0,i.uX)(),(0,i.CE)("div",N,[(0,i.Lk)("div",G,[(0,i.Lk)("div",Y,[r.nameMatchesSingleQuestion?(0,i.Q3)("",!0):((0,i.uX)(),(0,i.CE)("span",H,(0,o.v_)(n.item.name),1))]),(0,i.Lk)("div",j,["draft"===n.item.status?((0,i.uX)(),(0,i.CE)("span",J,(0,o.v_)(e.$t("Draft")),1)):(0,i.Q3)("",!0),"empty"===n.item.status?((0,i.uX)(),(0,i.CE)("span",Z,(0,o.v_)(e.$t("No votes")),1)):(0,i.Q3)("",!0),"upcoming"===n.item.status?((0,i.uX)(),(0,i.CE)("span",ee,(0,o.v_)(e.$t("upcoming")),1)):(0,i.Q3)("",!0),"live"===n.item.status?((0,i.uX)(),(0,i.CE)("span",te,[(0,i.Lk)("span",se,[(0,i.bF)(c,{icon:"fa-light fa-circle-dot"})]),(0,i.Lk)("span",null,(0,o.v_)(e.$t("Live")),1)])):(0,i.Q3)("",!0),"closed"===n.item.status?((0,i.uX)(),(0,i.CE)("span",ie,(0,o.v_)(e.$t("Finished")),1)):(0,i.Q3)("",!0),n.item.isArchived?((0,i.uX)(),(0,i.CE)("span",oe,(0,o.v_)(e.$t("Archived")),1)):(0,i.Q3)("",!0),!n.item.hasVoted&&!n.hasJustVoted||s.fullscreen?(0,i.Q3)("",!0):((0,i.uX)(),(0,i.CE)("span",ae,[(0,i.Lk)("span",le,[(0,i.bF)(c,{icon:"fa-light fa-check-to-slot"})]),(0,i.Lk)("span",null,(0,o.v_)(e.$t("You voted"))+"!",1)])),s.fullscreen||!n.dateTimeStart&&!n.dateTimeEnd?s.fullscreen?(0,i.Q3)("",!0):((0,i.uX)(),(0,i.CE)("span",he,(0,o.v_)(e.$t("Voting is open until all voters vote or administrator closes it manually")),1)):((0,i.uX)(),(0,i.CE)("span",ne,[n.dateTimeStart?((0,i.uX)(),(0,i.CE)("span",re,(0,o.v_)(e.$filters.format(n.dateTimeStart,"dateTime")),1)):((0,i.uX)(),(0,i.CE)("span",de,(0,o.v_)(e.$t("Immediately")),1)),t[14]||(t[14]=(0,i.Lk)("span",{class:"has-text-grey mx-1"},"â",-1)),n.dateTimeEnd?((0,i.uX)(),(0,i.CE)("span",ce,(0,o.v_)(e.$filters.format(n.dateTimeEnd,"dateTime")),1)):((0,i.uX)(),(0,i.CE)("span",ue,(0,o.v_)(e.$t("Until closed")),1))])),s.fullscreen||!n.dateTimeStart&&!n.dateTimeEnd?(0,i.Q3)("",!0):((0,i.uX)(),(0,i.Wv)(m,{key:9,ref:"timezoneDropdown",position:"is-bottom-left",class:"timezone-dropdown is-hidden-mobile",onActiveChange:r.onTimezoneDropdownChange},{trigger:(0,i.k6)(()=>[(0,i.Lk)("span",me,(0,o.v_)(r.formattedTimezoneOffset)+" "+(0,o.v_)(r.formattedTimezoneCity),1)]),default:(0,i.k6)(()=>[(0,i.Lk)("div",ve,[(0,i.bF)(u,{ref:"timezoneSearchInput",modelValue:n.timezoneSearch,"onUpdate:modelValue":t[1]||(t[1]=e=>n.timezoneSearch=e),placeholder:e.$t("Search for a timezone"),icon:"magnifying-glass",class:"timezone-search-input"},null,8,["modelValue","placeholder"]),(0,i.Lk)("div",pe,[(0,i.Lk)("p",ge,(0,o.v_)(e.$t("Popular Time Zones")),1),((0,i.uX)(!0),(0,i.CE)(i.FK,null,(0,i.pI)(r.filteredPopularTimezones,e=>((0,i.uX)(),(0,i.Wv)(h,{key:e.value,onClick:t=>r.selectTimezone(e.value)},{default:(0,i.k6)(()=>[(0,i.Lk)("div",ke,[(0,i.Lk)("span",null,(0,o.v_)(e.label),1),(0,i.Lk)("span",be,(0,o.v_)(e.offset),1)])]),_:2},1032,["onClick"]))),128)),(0,i.Lk)("p",fe,(0,o.v_)(e.$t("All Time Zones")),1),((0,i.uX)(!0),(0,i.CE)(i.FK,null,(0,i.pI)(r.filteredAllTimezones,e=>((0,i.uX)(),(0,i.Wv)(h,{key:e.value,onClick:t=>r.selectTimezone(e.value)},{default:(0,i.k6)(()=>[(0,i.Lk)("div",ye,[(0,i.Lk)("span",null,(0,o.v_)(e.label),1),(0,i.Lk)("span",Ce,(0,o.v_)(e.offset),1)])]),_:2},1032,["onClick"]))),128))])])]),_:1},8,["onActiveChange"]))]),s.fullscreen?(0,i.Q3)("",!0):((0,i.uX)(),(0,i.CE)("div",Le,[s.sealCode?((0,i.uX)(),(0,i.CE)("a",{key:0,class:"button is-primary is-small is-rounded is-outlined",onClick:t[2]||(t[2]=e=>r.copySeal(s.sealCode))},[(0,i.Lk)("span",Ve,[(0,i.Lk)("span",Ee,[(0,i.bF)(c,{icon:"fa-light fa-clone"})]),(0,i.Lk)("span",null,(0,o.v_)(e.$t("Integrity vote code"))+" ("+(0,o.v_)(e.$t("copy"))+")",1)])])):(0,i.Q3)("",!0)]))]),(0,i.Lk)("div",$e,[n.item.hasAvailableResults&&(n.item.hasVoted||n.hasJustVoted||!n.item.isVoteEligible||"closed"===n.item.status)?((0,i.uX)(),(0,i.CE)("div",_e,[((0,i.uX)(!0),(0,i.CE)(i.FK,null,(0,i.pI)(n.item.votes,(t,s)=>((0,i.uX)(),(0,i.CE)(i.FK,{key:t.id},[t.results?((0,i.uX)(),(0,i.CE)("div",Se,[(0,i.Lk)("div",we,[(0,i.Lk)("p",{class:(0,o.C4)(["title is-5 mb-0",{"has-text-grey-light is-italic":!r.hasQuestionTitle(t)}])},[n.item.votes.length>1?((0,i.uX)(),(0,i.CE)("span",Te,(0,o.v_)(s+1)+" · ",1)):(0,i.Q3)("",!0),r.hasQuestionTitle(t)?((0,i.uX)(),(0,i.CE)(i.FK,{key:1}
1,[(0,i.eW)((0,o.v_)(t.title),1)],64)):((0,i.uX)(),(0,i.CE)(i.FK,{key:2},[(0,i.eW)((0,o.v_)(e.$t("Untitled question")),1)],64))],2),(0,i.Lk)("span",Fe,(0,o.v_)(r.isMultiChoice(t)?e.$t("Multiple answers"):e.$t("Single answer")),1)]),(0,i.Lk)("div",xe,[((0,i.uX)(!0),(0,i.CE)(i.FK,null,(0,i.pI)(t.results,a=>((0,i.uX)(),(0,i.CE)("div",{key:a.option,class:(0,o.C4)(["vote-result-option",{"is-my-vote":r.isMyResultOption(t.id,a.option),"is-winner":r.isWinnerOption(t,a)}])},[(0,i.Lk)("div",Xe,[(0,i.Lk)("span",Ae,[(0,i.eW)((0,o.v_)(r.voteOptionName(a.option,s))+" ",1),r.isMyResultOption(t.id,a.option)?((0,i.uX)(),(0,i.Wv)(c,{key:0,icon:"fa-light fa-check",class:"has-text-success ml-2"})):(0,i.Q3)("",!0)]),(0,i.Lk)("span",Me,(0,o.v_)(a.total)+" "+(0,o.v_)(e.$t("Votes")),1)]),(0,i.Lk)("div",Ie,[(0,i.Lk)("div",{class:(0,o.C4)(["vote-result-bar",{"is-my-vote":r.isMyResultOption(t.id,a.option),"is-winner":r.isWinnerOption(t,a)}]),style:(0,o.Tr)({width:a.percentage+"%"})},[a.percentage>10?((0,i.uX)(),(0,i.CE)("span",Qe,(0,o.v_)(a.percentage)+"% ",1)):(0,i.Q3)("",!0)],6),a.percentage<=10?((0,i.uX)(),(0,i.CE)("span",Oe,(0,o.v_)(a.percentage)+"% ",1)):(0,i.Q3)("",!0)])],2))),128))])])):(0,i.Q3)("",!0)],64))),128))])):r.showVotingSection?((0,i.uX)(),(0,i.CE)("div",ze,[r.canVote?((0,i.uX)(),(0,i.Wv)(d,{key:0,modelValue:n.isVoting,"onUpdate:modelValue":t[3]||(t[3]=e=>n.isVoting=e),"is-full-page":!1},null,8,["modelValue"])):(0,i.Q3)("",!0),((0,i.uX)(!0),(0,i.CE)(i.FK,null,(0,i.pI)(n.item.votes,(t,s)=>((0,i.uX)(),(0,i.CE)("div",{key:t.id,class:(0,o.C4)(["card is-flat mb-4",r.hasVotedState?"vote-my-selection-card":"vote-modal-card"])},[(0,i.Lk)("div",{class:(0,o.C4)(["is-flex is-justify-content-space-between is-align-items-flex-start",r.hasVotedState?"vote-my-selection-header":"vote-modal-card-header"])},[(0,i.Lk)("p",{class:(0,o.C4)(["title is-5 mb-0",{"has-text-grey-light is-italic":!r.hasQuestionTitle(t)}])},[n.item.votes.length>1?((0,i.uX)(),(0,i.CE)("span",Pe,(0,o.v_)(s+1)+" · ",1)):(0,i.Q3)("",!0),r.hasQuestionTitle(t)?((0,i.uX)(),(0,i.CE)(i.FK,{key:1},[(0,i.eW)((0,o.v_)(t.title),1)],64)):((0,i.uX)(),(0,i.CE)(i.FK,{key:2},[(0,i.eW)((0,o.v_)(e.$t("Untitled question")),1)],64))],2),(0,i.Lk)("span",Ue,(0,o.v_)(r.isMultiChoice(t)?e.$t("Multiple answers"):e.$t("Single answer")),1)],2),r.canVote&&r.isMultiChoice(t)?((0,i.uX)(),(0,i.CE)("p",Re,(0,o.v_)(r.multiChoiceHelp(t)),1)):(0,i.Q3)("",!0),(0,i.Lk)("div",{class:(0,o.C4)(r.hasVotedState?"vote-my-selection-body":"vote-modal-card-options")},[((0,i.uX)(!0),(0,i.CE)(i.FK,null,(0,i.pI)(t.voteOptions,e=>((0,i.uX)(),(0,i.Wv)((0,i.$y)(r.canVote?"label":"div"),{key:e.id,class:(0,o.C4)(r.getOptionClasses(t.id,e.id))},{default:(0,i.k6)(()=>[r.canVote&&r.isMultiChoice(t)?((0,i.uX)(),(0,i.CE)("input",{key:0,type:"checkbox",name:"vote_inline_"+t.id,value:e.id,checked:r.isOptionSelected(t.id,e.id),disabled:r.isOptionDisabled(t,e.id),class:"vote-radio-input",onChange:s=>r.toggleMultiSelect(t.id,e.id,s.target.checked)},null,40,We)):r.canVote?(0,i.bo)(((0,i.uX)(),(0,i.CE)("input",{key:1,"onUpdate:modelValue":e=>n.voteSelections[t.id]=e,type:"radio",name:"vote_inline_"+t.id,value:e.id,class:"vote-radio-input"},null,8,De)),[[a.XL,n.voteSelections[t.id]]]):(0,i.Q3)("",!0),(0,i.Lk)("span",{class:(0,o.C4)(r.hasVotedState?"vote-selection-icon":"vote-radio-custom")},[r.isOptionSelected(t.id,e.id)?((0,i.uX)(),(0,i.Wv)(c,{key:0,icon:r.multiChoiceIcon(t,!0),class:(0,o.C4)(r.hasVotedState?"has-text-success":"has-text-primary")},null,8,["icon","class"])):((0,i.uX)(),(0,i.Wv)(c,{key:1,icon:r.multiChoiceIcon(t,!1),class:"has-text-grey-light"},null,8,["icon"]))],2),(0,i.Lk)("span",{class:(0,o.C4)(["vote-option-text",{"has-text-weight-bold":r.hasVotedState&&r.isOptionSelected(t.id,e.id)}])},(0,o.v_)(e.title),3)]),_:2},1032,["class"]))),128))],2)],2))),128)),r.canVote?((0,i.uX)(),(0,i.CE)("div",{key:1,class:(0,o.C4)(["vote-privacy-notice",{"vote-privacy-notice--warning":!1===n.item.isAnonymous}])},[(0,i.Lk)("span",Be,[(0,i.bF)(c,{icon:!1===n.item.isAnonymous?"fa-light fa-user-secret":"fa-light fa-shield-check"},null,8,["icon"])]),(0,i.Lk)("div",Ke,[(0,i.Lk)("span",qe,[!1===n.item.isAnonymous?((0,i.uX)(),(0,i.CE)(i.FK,{key:0},[(0,i.eW)((0,o.v_)(e.$t("This vote is not anonymous. Your name will be visible next to your answers.")),1)],64)):((0,i.uX)(),(0,i.CE)(i.FK,{key:1},[(0,i.eW)((0,o.v_)(e.$t("All votes cast by voters are encrypted and anonymous "))+".",1)],64))]),n.item.hasAvailableResults?(0,i.Q3)("",!0):((0,i.uX)(),(0,i.CE)("span",Ne,(0,o.v_)(e.$t("Result will be available at the end of the voting period"))+". ",1))])],2)):(0,i.Q3)("",!0),r.canVote?((0,i.uX)(),(0,i.CE)("div",Ge,[(0,i.Lk)("button",{class:"button is-primary is-rounded is-medium vote-cast-button",disabled:n.isVoting,onClick:t[4]||(t[4]=(...e)=>r.submitVote&&r.submitVote(...e))},[(0,i.Lk)("span",He,[(0,i.bF)(c,{icon:"fa-light fa-check-to-slot"})]),(0,i.Lk)("span",null,(0,o.v_)(e.$t("Vote now")),1)],8,Ye)])):(0,i.Q3)("",!0)])):((0,i.uX)(),(0,i.CE)("div",je,[((0,i.uX)(!0),(0,i.CE)(i.FK,null,(0,i.pI)(n.item.votes,(t,s)=>((0,i.uX)(),(0,i.CE)("div",{key:t.id,class:"card is-flat vote-preview-card mb-5"},[(0,i.Lk)("div",Je,[(0,i.Lk)("p",{class:(0,o.C4)(["title is-5 mb-0",{"has-text-grey-light is-italic":!r.hasQuestionTitle(t)}])},[n.item.votes.length>1?((0,i.uX)(),(0,i.CE)("span",Ze,(0,o.v_)(s+1)+" · ",1)):(0,i.Q3)("",!0),r.hasQuestionTitle(t)?((0,i.uX)(),(0,i.CE)(i.FK,{key:1}
1,[(0,i.eW)((0,o.v_)(t.title),1)],64)):((0,i.uX)(),(0,i.CE)(i.FK,{key:2},[(0,i.eW)((0,o.v_)(e.$t("Untitled question")),1)],64))],2),(0,i.Lk)("span",et,(0,o.v_)(r.isMultiChoice(t)?e.$t("Multiple answers"):e.$t("Single answer")),1)]),(0,i.Lk)("div",tt,[((0,i.uX)(!0),(0,i.CE)(i.FK,null,(0,i.pI)(t.voteOptions,e=>((0,i.uX)(),(0,i.CE)("div",{key:e.id,class:"vote-preview-option"},[(0,i.Lk)("span",st,[(0,i.bF)(c,{icon:r.isMultiChoice(t)?"fa-light fa-square":"fa-light fa-circle",class:"has-text-grey-light"},null,8,["icon"])]),(0,i.Lk)("span",it,(0,o.v_)(e.title),1)]))),128))])]))),128)),n.item.hasAvailableResults?(0,i.Q3)("",!0):((0,i.uX)(),(0,i.CE)("p",ot,(0,o.v_)(e.$t("Result will be available at the end of the voting period"))+". ",1))])),(0,i.Lk)("div",at,[n.item&&r.canSeeVotersList?((0,i.uX)(),(0,i.Wv)(v,{key:0,ref:"voteUsers",item:n.item,"is-pulsing":n.isPulsing,onAdd:t[5]||(t[5]=e=>n.item.totalEligible++),onRemove:t[6]||(t[6]=e=>n.item.totalEligible--),onReload:r.retrieve},null,8,["item","is-pulsing","onReload"])):((0,i.uX)(),(0,i.CE)("div",{key:1,class:(0,o.C4)(["card is-flat vote-stats-card",{"is-pulsing":n.isPulsing}])},[(0,i.Lk)("div",lt,[(0,i.Lk)("span",nt,[(0,i.bF)(c,{icon:"fa-light fa-chart-pie"})]),(0,i.Lk)("span",rt,(0,o.v_)(e.$t("Participation")),1),n.item.event?((0,i.uX)(),(0,i.CE)("span",dt,[(0,i.Lk)("span",ct,[(0,i.bF)(c,{icon:"fa-light fa-calendar"})]),(0,i.eW)(" "+(0,o.v_)(n.item.event.name),1)])):n.item.isGeneral?((0,i.uX)(),(0,i.CE)("span",ut,[(0,i.bF)(p,{to:{name:"UserList",query:{unit:n.item.unit?.id,generalUnit:!!n.item.unit}}},{default:(0,i.k6)(()=>[(0,i.eW)(" # "+(0,o.v_)(n.item.unit?n.item.unit.name:e.tenant.shortName),1)]),_:1},8,["to"])])):((0,i.uX)(),(0,i.CE)("span",ht,[(0,i.Lk)("span",mt,[(0,i.bF)(c,{icon:"fa-light fa-lock"})]),(0,i.eW)(" "+(0,o.v_)(e.$t("Private")),1)]))]),(0,i.Lk)("div",vt,[(0,i.Lk)("div",pt,[parseInt(n.item.participationPercentage)>0?((0,i.uX)(),(0,i.CE)("div",{key:0,class:(0,o.C4)(["percentage-circle",{"is-pulsing":n.isPulsing}])},[((0,i.uX)(),(0,i.CE)("svg",gt,[t[15]||(t[15]=(0,i.Lk)("path",{class:"percentage-bg",d:"M18 2.0845\n a 15.9155 15.9155 0 0 1 0 31.831\n a 15.9155 15.9155 0 0 1 0 -31.831"},null,-1)),(0,i.Lk)("path",{class:"percentage-fill","stroke-dasharray":`${n.item.participationPercentage}, 100`,d:"M18 2.0845\n a 15.9155 15.9155 0 0 1 0 31.831\n a 15.9155 15.9155 0 0 1 0 -31.831"},null,8,kt)])),(0,i.Lk)("span",bt,(0,o.v_)(parseInt(n.item.participationPercentage))+"%",1)],2)):((0,i.uX)(),(0,i.CE)("div",ft,[(0,i.Lk)("span",yt,[(0,i.bF)(c,{icon:"fa-light fa-inbox"})]),(0,i.Lk)("span",Ct,(0,o.v_)(e.$t("No votes yet")),1)]))]),(0,i.Lk)("div",Lt,[(0,i.Lk)("div",Vt,[(0,i.Lk)("span",Et,(0,o.v_)(n.item.totalVoted),1),(0,i.Lk)("span",$t,(0,o.v_)(e.$t("Voted")),1)]),t[16]||(t[16]=(0,i.Lk)("div",{class:"stat-divider"},null,-1)),(0,i.Lk)("div",_t,[(0,i.Lk)("span",St,(0,o.v_)(n.item.totalEligible-n.item.totalVoted),1),(0,i.Lk)("span",wt,(0,o.v_)(e.$t("Pending")),1)]),t[17]||(t[17]=(0,i.Lk)("div",{class:"stat-divider"},null,-1)),(0,i.Lk)("div",Tt,[(0,i.Lk)("span",Ft,(0,o.v_)(n.item.totalEligible),1),(0,i.Lk)("span",xt,(0,o.v_)(e.$t("Total")),1)])])])],2))])]),r.canSeeAttributedResults?((0,i.uX)(),(0,i.CE)("div",Xt,[(0,i.Lk)("div",At,[(0,i.Lk)("span",Mt,[(0,i.bF)(c,{icon:"fa-light fa-user-check"})]),(0,i.Lk)("span",It,(0,o.v_)(e.$t("Individual results")),1),(0,i.Lk)("span",Qt,(0,o.v_)(e.$t("Not anonymous")),1)]),(0,i.Lk)("div",Ot,[n.attributedLoaded?((0,i.uX)(),(0,i.CE)(i.FK,{key:1},[0===n.attributedResults.length?((0,i.uX)(),(0,i.CE)("p",Wt,(0,o.v_)(e.$t("No votes yet")),1)):(0,i.Q3)("",!0),((0,i.uX)(!0),(0,i.CE)(i.FK,null,(0,i.pI)(n.attributedResults,e=>((0,i.uX)(),(0,i.CE)("div",{key:e.voterType+"_"+e.voterId,class:"vote-attributed-voter"},[(0,i.Lk)("div",Dt,[(0,i.Lk)("span",Bt,(0,o.v_)(e.name),1),e.email?((0,i.uX)(),(0,i.CE)("span",Kt,(0,o.v_)(e.email),1)):(0,i.Q3)("",!0)]),(0,i.Lk)("div",qt,[((0,i.uX)(!0),(0,i.CE)(i.FK,null,(0,i.pI)(e.answers,(e,t)=>((0,i.uX)(),(0,i.CE)("div",{key:t,class:"vote-attributed-answer"},[(0,i.Lk)("span",Nt,(0,o.v_)(e.question),1),(0,i.Lk)("span",Gt,(0,o.v_)((e.options||[]).join(", ")),1)]))),128))])]))),128)),n.attributedTruncated?((0,i.uX)(),(0,i.CE)("p",Yt,(0,o.v_)(e.$t("Showing the first {shown} of {total} voters. Download the CSV export for the full list.",{shown:n.attributedResults.length,total:n.attributedTotal})),1)):(0,i.Q3)("",!0)],64)):((0,i.uX)(),(0,i.CE)("div",zt,[(0,i.Lk)("p",Pt,(0,o.v_)(e.$t("This vote is not anonymous. You can see how each person voted.")),1),(0,i.Lk)("button",{class:(0,o.C4)(["button is-primary is-rounded is-small",{"is-loading":n.attributedLoading}]),disabled:n.attributedLoading,onClick:t[7]||(t[7]=(...e)=>r.loadAttributedResults&&r.loadAttributedResults(...e))},[(0,i.Lk)("span",Rt,[(0,i.bF)(c,{icon:"fa-light fa-eye"})]),(0,i.Lk)("span",null,(0,o.v_)(e.$t("Show individual results")),1)],10,Ut)]))])])):(0,i.Q3)("",!0)])):(0,i.Q3)("",!0),(0,i.bF)(g,{modelValue:n.showVoteModal,"onUpdate:modelValue":t[13]||(t[13]=e=>
1n.showVoteModal=e),title:n.item?n.item.name:"","modal-width":600,"scroll-container-id":"voteSubmitModalBody",onClose:r.closeVoteModal},{default:(0,i.k6)(()=>[(0,i.Lk)("div",Ht,[(0,i.bF)(d,{modelValue:n.isVoting,"onUpdate:modelValue":t[8]||(t[8]=e=>n.isVoting=e),"is-full-page":!1},null,8,["modelValue"]),n.voteSuccess?((0,i.uX)(),(0,i.CE)("div",ns,[(0,i.Lk)("div",rs,[(0,i.bF)(c,{icon:"fa-light fa-circle-check"})]),(0,i.Lk)("h3",ds,(0,o.v_)(e.$t("You voted"))+"!",1),(0,i.Lk)("p",cs,(0,o.v_)(e.$t("Your vote has been recorded securely"))+".",1),(0,i.Lk)("button",{class:"button is-primary is-rounded is-medium",onClick:t[10]||(t[10]=(...e)=>r.closeVoteModal&&r.closeVoteModal(...e))},(0,o.v_)(e.$t("Close")),1),n.voteSealCode?((0,i.uX)(),(0,i.CE)("div",us,[(0,i.Lk)("div",{class:"vote-seal-toggle",onClick:t[11]||(t[11]=e=>n.showSealCode=!n.showSealCode)},[(0,i.Lk)("span",hs,[(0,i.bF)(c,{icon:"fa-light fa-shield-check"})]),(0,i.Lk)("span",ms,(0,o.v_)(e.$t("Integrity verification")),1),(0,i.Lk)("span",vs,[(0,i.bF)(c,{icon:n.showSealCode?"fa-light fa-chevron-up":"fa-light fa-chevron-down"},null,8,["icon"])])]),(0,i.bF)(a.eB,{name:"slide-fade"},{default:(0,i.k6)(()=>[n.showSealCode?((0,i.uX)(),(0,i.CE)("div",ps,[(0,i.Lk)("p",gs,(0,o.v_)(e.$t("This unique code allows you to verify your vote was counted correctly. Save it only if you want to verify later.")),1),(0,i.Lk)("div",ks,[(0,i.Lk)("code",bs,(0,o.v_)(n.voteSealCode),1)]),(0,i.Lk)("div",fs,[(0,i.Lk)("button",{class:"button is-light is-rounded is-small",onClick:t[12]||(t[12]=(0,a.D$)((...e)=>r.copyVoteSeal&&r.copyVoteSeal(...e),["stop"]))},[(0,i.Lk)("span",ys,[(0,i.bF)(c,{icon:"fa-light fa-clone"})]),(0,i.Lk)("span",null,(0,o.v_)(e.$t("copy")),1)])])])):(0,i.Q3)("",!0)]),_:1})])):(0,i.Q3)("",!0)])):((0,i.uX)(),(0,i.CE)(i.FK,{key:0},[((0,i.uX)(!0),(0,i.CE)(i.FK,null,(0,i.pI)(n.item.votes,t=>((0,i.uX)(),(0,i.CE)("div",{key:t.id,class:"card is-flat vote-modal-card mb-4"},[(0,i.Lk)("div",jt,[(0,i.Lk)("p",{class:(0,o.C4)(["title is-5 mb-0",{"has-text-grey-light is-italic":!r.hasQuestionTitle(t)}])},[r.hasQuestionTitle(t)?((0,i.uX)(),(0,i.CE)(i.FK,{key:0},[(0,i.eW)((0,o.v_)(t.title),1)],64)):((0,i.uX)(),(0,i.CE)(i.FK,{key:1},[(0,i.eW)((0,o.v_)(e.$t("Untitled question")),1)],64))],2)]),r.isMultiChoice(t)?((0,i.uX)(),(0,i.CE)("p",Jt,(0,o.v_)(r.multiChoiceHelp(t)),1)):(0,i.Q3)("",!0),(0,i.Lk)("div",Zt,[((0,i.uX)(!0),(0,i.CE)(i.FK,null,(0,i.pI)(t.voteOptions,e=>((0,i.uX)(),(0,i.CE)("label",{key:e.id,class:(0,o.C4)(["vote-modal-option",{"is-selected":r.isOptionSelected(t.id,e.id)}])},[r.isMultiChoice(t)?((0,i.uX)(),(0,i.CE)("input",{key:0,type:"checkbox",name:"vote_"+t.id,value:e.id,checked:r.isOptionSelected(t.id,e.id),disabled:r.isOptionDisabled(t,e.id),class:"vote-radio-input",onChange:s=>r.toggleMultiSelect(t.id,e.id,s.target.checked)},null,40,es)):(0,i.bo)(((0,i.uX)(),(0,i.CE)("input",{key:1,"onUpdate:modelValue":e=>n.voteSelections[t.id]=e,type:"radio",name:"vote_"+t.id,value:e.id,class:"vote-radio-input"},null,8,ts)),[[a.XL,n.voteSelections[t.id]]]),(0,i.Lk)("span",ss,[r.isOptionSelected(t.id,e.id)?((0,i.uX)(),(0,i.Wv)(c,{key:0,icon:r.multiChoiceIcon(t,!0),class:"has-text-primary"},null,8,["icon"])):((0,i.uX)(),(0,i.Wv)(c,{key:1,icon:r.multiChoiceIcon(t,!1),class:"has-text-grey-light"},null,8,["icon"]))]),(0,i.Lk)("span",is,(0,o.v_)(e.title),1)],2))),128))])]))),128)),(0,i.Lk)("div",os,[(0,i.Lk)("button",{class:"button is-primary is-rounded is-medium vote-cast-button",disabled:n.isVoting,onClick:t[9]||(t[9]=(...e)=>r.submitVote&&r.submitVote(...e))},[(0,i.Lk)("span",ls,[(0,i.bF)(c,{icon:"fa-light fa-check-to-slot"})]),(0,i.Lk)("span",null,(0,o.v_)(e.$t("Submit vote")),1)],8,as)])],64))])]),_:1},8,["modelValue","title","onClose"])],2)}s(18111),s(81148),s(22489),s(20116),s(7588),s(61701),s(18237);var Ls=s(95256),Vs=s(28782),Es=s(84743),$s=s.n(Es),_s=s(81986);const Ss="multiple";var ws={name:"VoteShowContent",components:{VoteUsers:_s.A,ItemViewModal:q.A},props:{voteId:{type:[Number,String],required:!0},sealCode:{type:String,default:null},fullscreen:{type:Boolean,default:!1}},emits:["refresh","deleted","loaded","clone","publish","navigate-settings","navigate-integrity","archived","edit"],data(){return{item:null,results:null,isLoading:!1,voters:null,dateTimeStart:null,dateTimeEnd:null,selectedTimezone:null,timezoneSearch:"",editVoteOption:[],editVoteQuestion:[],originalTitles:{},debounceTimers:{}
1,createVoteOption:null,newVoteOptionTitle:null,isPulsing:!1,showVoteModal:!1,voteSelections:{},isVoting:!1,voteSuccess:!1,voteSealCode:null,isClosingVote:!1,isArchiving:!1,hasJustVoted:!1,myVoteSelections:{},voteEditInFlight:{},showSealCode:!1,attributedResults:[],attributedLoaded:!1,attributedLoading:!1,attributedTotal:0,attributedTruncated:!1,popularTimezones:[{value:"America/Los_Angeles",label:"Pacific Time - Los Angeles"},{value:"America/Chicago",label:"Central Time - Chicago"},{value:"America/Toronto",label:"Eastern Time - Toronto"},{value:"America/New_York",label:"Eastern Time - New York"},{value:"America/Sao_Paulo",label:"Brasilia Standard Time - São Paulo"},{value:"Europe/London",label:"United Kingdom Time - London"},{value:"Europe/Madrid",label:"Central European Time - Madrid"},{value:"Europe/Paris",label:"Central European Time - Paris"},{value:"Europe/Bucharest",label:"Eastern European Time - Bucharest"},{value:"Asia/Dubai",label:"Gulf Standard Time - Dubai"},{value:"Asia/Kolkata",label:"India Standard Time - Kolkata"},{value:"Asia/Singapore",label:"Singapore Standard Time - Singapore"},{value:"Asia/Tokyo",label:"Japan Standard Time - Tokyo"}]}},computed:{...(0,B.L8)(["isGranted","user","tenant"]),cover(){return null},nameMatchesSingleQuestion(){if(!this.item||!this.item.votes||1!==this.item.votes.length)return!1;const e=(this.item.name||"").trim(),t=(this.item.votes[0].title||"").trim();return!!e&&e===t},isGrantedEditVoting(){return!!this.item&&(!!this.isGranted("ADMIN_TENANT")||(this.item.owner?.id===this.user.id||this.item?.unit&&this.isGranted("HR_LOCAL",this.item?.unit)))},canSeeAttributedResults(){return!!this.item&&!1===this.item.isAnonymous&&"closed"===this.item.status&&this.isGrantedEditVoting},formattedTimezoneOffset(){if(!this.selectedTimezone)return"";const e=$s().tz(this.selectedTimezone).format("Z");return`GMT${e}`},formattedTimezoneCity(){if(!this.selectedTimezone)return"";const e=this.selectedTimezone.split("/");return e[e.length-1].replace(/_/g," ")},filteredPopularTimezones(){const e=this.timezoneSearch.toLowerCase();return this.popularTimezones.map(e=>({...e,offset:`GMT${$s().tz(e.value).format("Z")}`})).filter(t=>!e||t.label.toLowerCase().includes(e)||t.value.toLowerCase().includes(e))},allTimezones(){return $s().tz.names().map(e=>{const t=e.split("/"),s=t[t.length-1].replace(/_/g," "),i=t.length>1?t[0].replace(/_/g," "):"";return{value:e,label:`${i?i+" - ":""}${s}`,offset:`GMT${$s().tz(e).format("Z")}`}})},filteredAllTimezones(){const e=this.timezoneSearch.toLowerCase();return e?this.allTimezones.filter(t=>t.label.toLowerCase().includes(e)||t.value.toLowerCase().includes(e)).slice(0,30):this.allTimezones.slice(0,20)},canSeeVotersList(){return!!this.item&&(!this.item.hideVotersList||this.isGranted("HR_LOCAL",this.item?.unit))},canVote(){return!this.fullscreen&&("live"===this.item?.status&&!this.item?.hasVoted&&!this.hasJustVoted&&this.item?.isVoteEligible)},hasVotedState(){return(this.item?.hasVoted||this.hasJustVoted)&&!this.item?.hasAvailableResults&&Object.keys(this.myVoteSelections).length>0},showVotingSection(){return this.canVote||this.hasVotedState}},watch:{voteId:{immediate:!0,handler(e){e&&this.retrieve()}}},created(){this.selectedTimezone=this.user.timezone?this.user.timezone:this.tenant.timezone},beforeUnmount(){this.$store.commit("resetEventSource"),Object.values(this.debounceTimers).forEach(e=>clearTimeout(e))},methods:{copyToClipboard:Ls.lW,mediaSrc:Ls.F9,openCreateVoteOption(e){this.closeAllEdits(),this.newVoteOptionTitle=null,this.createVoteOption=e,this.$nextTick(()=>{const t="new_vo_"+e,s=this.$refs[t],i=Array.isArray(s)?s[0]:s;if(i){const e=i.$el?.querySelector("input")||i.$el;e&&e.focus()}})},closeAllEdits(){this.editVoteQuestion=[],this.editVoteOption=[]},startEditVoteQuestion(e){this.closeAllEdits();const t=this.item.votes.find(t=>t.id===e);t&&(this.originalTitles["vq_"+e]=t.title),this.editVoteQuestion[e]=!0,this.$nextTick(()=>{const t="edit_vq_"+e,s=this.$refs[t],i=Array.isArray(s)?s[0]:s;if(i){const e=i.$el?.querySelector("input")||i.$el;e&&e.focus()}})},startEditVoteOption(e){this.closeAllEdits();const t=this.findOption(e);t&&(this.originalTitles["vo_"+e]=t.title),this.editVoteOption[e]=!0,this.$nextTick(()=>{const t="edit_vo_"+e,s=this.$refs[t],i=Array.isArray(s)?s[0]:s;if(i){const e=i.$el?.querySelector("input")||i.$el;e&&e.focus()}})},findOption(e){for(const t of this.item.votes){const s=t.voteOptions.find(t=>
1t.id===e);if(s)return s}return null},clone(){this.$buefy.dialog.confirm({title:this.$t("Clone this voting?")+" "+this.item.name+".",message:this.$t("This will clone the vote setup without any result and it will add also the eligible voters automatically."),confirmText:this.$t("Clone it"),type:"is-primary",onConfirm:()=>{this.isLoading=!0,this.$http.plain.patch("/vote_collections/"+this.item.id+"/clone",{}).then(e=>{this.$buefy.snackbar.open({message:this.$t("createdSuccessfully")}),this.$emit("clone",e.data.id)}).catch(e=>console.error(e)).finally(()=>{this.isLoading=!1})}})},copySeal(e){this.copyToClipboard(e),this.$buefy.snackbar.open({message:this.$t("copied"),type:"is-danger",duration:500,actionText:null})},publish(){this.isLoading=!0,this.$http.plain.patch("/vote_collections/"+this.voteId+"/publish",{}).then(()=>{this.retrieve(),this.$emit("publish")}).catch(e=>console.error(e)).finally(()=>{this.isLoading=!1})},closeVoting(){this.$buefy.dialog.confirm({title:this.$t("Close voting"),message:this.$t("Are you sure you want to close this voting? This action cannot be undone."),confirmText:this.$t("Close voting"),type:"is-primary",onConfirm:()=>{this.isClosingVote=!0,this.$http.plain.patch("/vote_collections/"+this.voteId+"/close",{}).then(()=>{this.$buefy.toast.open({message:this.$t("Voting has been closed"),type:"is-success"}),this.retrieve()}).catch(e=>console.error(e)).finally(()=>{this.isClosingVote=!1})}})},confirmArchive(){this.$buefy.dialog.confirm({title:this.$t("Archive"),message:this.$t("Are you sure you want to archive this voting? It will be hidden from the list."),confirmText:this.$t("Archive"),type:"is-primary",onConfirm:()=>{this.archive()}})},archive(){this.isArchiving=!0,this.$http.plain.patch("/vote_collections/"+this.voteId+"/archive",{}).then(()=>{this.$buefy.toast.open({message:this.$t("Voting archived"),type:"is-success"}),this.$emit("archived",this.item)}).catch(e=>console.error(e)).finally(()=>{this.isArchiving=!1})},retrieve(e=!1){return e||(this.isLoading=!0),this.$http.plain.get("/vote_collections/"+this.voteId).then(e=>this.entityLoaded(e)).catch(e=>console.error(e)).finally(()=>{e||(this.isLoading=!1)})},entityLoaded(e){const t=this.voteSuccess;this.item?Object.keys(e.data).forEach(t=>{this.item[t]=e.data[t]}):this.item=e.data,t&&(this.item.hasVoted=!0),this.item.dateStart&&(this.item.dateStart=$s()(this.item.dateStart).utc().format("YYYY-MM-DDTHH:mm")),this.item.dateEnd&&(this.item.dateEnd=$s()(this.item.dateEnd).utc().format("YYYY-MM-DDTHH:mm")),this.convertTimezones(),this.mercureSubscribe(),this.$emit("loaded",this.item),this.item.hasVoted&&0===Object.keys(this.myVoteSelections).length?this.loadMyVoteFromStorage():this.item.hasVoted||this.initVoteSelections(),t&&this.$forceUpdate()},voteOptionName(e,t){let s=this.item.votes[t].voteOptions.find(t=>t.id===parseInt(e));return s?s.title:""},isMultiChoice(e){return e?.type===Ss},isAnsweredVote(e){const t=this.voteSelections[e.id];return this.isMultiChoice(e)?Array.isArray(t)&&t.length>0:null!==t&&void 0!==t},effectiveMax(e){return e.voteOptions.length},isOptionDisabled(e,t){if(!this.isMultiChoice(e))return!1;const s=this.voteSelections[e.id]||[];return!s.includes(t)&&s.length>=this.effectiveMax(e)},toggleMultiSelect(e,t,s){const i=this.voteSelections[e]||[];s?i.includes(t)||(this.voteSelections[e]=[...i,t]):this.voteSelections[e]=i.filter(e=>e!==t)},multiChoiceHelp(){return this.$t("Choose one or more")},multiChoiceIcon(e,t){return this.isMultiChoice(e)?t?"fa-light fa-square-check":"fa-light fa-square":t?this.hasVotedState?"fa-light fa-circle-check":"fa-light fa-circle-dot":"fa-light fa-circle"},isMyResultOption(e,t){const s=this.myVoteSelections[e],i=parseInt(t);return Array.isArray(s)?s.includes(i):s===i},isWinnerOption(e,t){if("closed"!==this.item?.status)return!1;if(!e?.results?.length)return!1;const s=e.results.reduce((e,t)=>Math.max(e,t.percentage||0),0);return s>0&&(t.percentage||0)===s},hasQuestionTitle(e){return!!(e?.title&&String(e.title).trim().length>0)},initVoteSelections(){const e={};(this.item?.votes||[]).forEach(t=>{e[t.id]=this.isMultiChoice(t)?[]:null}),this.voteSelections=e},triggerPulse(){this.isPulsing=!0,setTimeout(()=>{this.isPulsing=!1},600)},mercureSubscribe(){if(this.$store.commit("resetEventSource"),!1===Vs.uW||!1===this.tenant?.settingFeatures?.realtime?.isActive||"live"!==this.item.status&&"upcoming"!==this.item.status)return;const e="vote_"+this.voteId;this.$http.plain.get("/mercure-token/"+e).then(t=>{this.$store.commit("initEventSource",{token:t.data.token,hubUrl:t.data.hubUrl,topic:e}),this.$store.state.currentMercureEvent.onmessage=e=>{this.handleMercureMessage(e)}}).catch(e=>{console.error("Failed to get Mercure token for vote:",e)})},handleMercureMessage(e){let t=JSON.parse(e.data);if("vote_settings"!==t.action){if(this.item.isEditable=!1,this.item.participationPercentage=t.percentage,this.item.totalEligible=t.totalEligible,this.item.totalVoted=t.totalVoted,this.triggerPulse(),"vote_user"===t.action){let e=JSON.parse(t.voteUser),s=this.voters?this.voters.findIndex(t=>t.id===e.id):-1;-1!==s?"remove"===t.actionType?this.voters.splice(s,1):this.voters[s]["hasVoted"]=e.hasVoted:this.voters&&this.voters.push(e),this.$refs.voteUsers&&this.$refs.voteUsers.handleMercureUpdate(e,t.actionType)}100===parseInt(t.percentage)&&this.retrieve()}else this.retrieve()},convertTimezones(){this.item.dateStart&&(this.dateTimeStart=$s()(this.item.dateStart).tz(this.selectedTimezone).format("YYYY-MM-DDTHH:mm")),this.item.dateEnd&&(this.dateTimeEnd=$s()(this.item.dateEnd).tz(this.selectedTimezone).format("YYYY-MM-DDTHH:mm"))},selectTimezone(e){this.selectedTimezone=e,this.timezoneSearch="",this.convertTimezones(),this.$refs.timezoneDropdown&&(this.$refs.timezoneDropdown.isActive=!1),this.$refs.timezoneDropdownMobile&&(this.$refs.timezoneDropdownMobile.isActive=!1)},onTimezoneDropdownChange(e){e&&this.$nextTick(()=>{this.$refs.timezoneSearchInput&&this.$refs.timezoneSearchInput.focus()})},onTimezoneDropdownMobileChange(e){e&&this.$nextTick(()=>{this.$refs.timezoneSearchInputMobile&&this.$refs.timezoneSearchInputMobile.focus()})},addVoteQuestion(){this.isLoading=!0,this.$http.plain.post("/votes",{voteCollection:"/api/v1/vote_collections/"+this.item.id}).then(e=>
1{this.item.votes.push(e.data),this.$buefy.toast.open({type:"is-success",message:this.$t("updatedSuccessfully"),duration:3e3})}).catch(e=>{console.log(e)}).finally(()=>{this.isLoading=!1})},saveNewVoteOption(e){const t=this.newVoteOptionTitle?.trim();if(!t)return;const s=this.createVoteOption,i="temp_"+Date.now(),o={id:i,title:t,_saving:!0};this.item.votes[e].voteOptions.push(o),this.createVoteOption=null,this.newVoteOptionTitle=null,this.$http.plain.post("/vote_options",{title:t,vote:"/api/v1/votes/"+s}).then(t=>{const s=this.item.votes[e].voteOptions.findIndex(e=>e.id===i);-1!==s&&this.item.votes[e].voteOptions.splice(s,1,t.data)}).catch(t=>{console.log(t);const s=this.item.votes[e].voteOptions.findIndex(e=>e.id===i);-1!==s&&this.item.votes[e].voteOptions.splice(s,1),this.$buefy.toast.open({type:"is-danger",message:this.$t("Error saving"),duration:3e3})})},modifyVoteQuestion(e,t){const s=this.item.votes[t].title,i=this.originalTitles["vq_"+e];s!==i&&(this.originalTitles["vq_"+e]=s,this.$http.plain.patch("/votes/"+e,{title:s}).catch(e=>{console.log(e)}))},updateVoteType(e,t){if(e.type===t)return;if(this.voteEditInFlight[e.id])return;this.voteEditInFlight[e.id]=!0;const s=e.type;e.type=t,this.$http.plain.patch("/votes/"+e.id,{type:t}).catch(t=>{console.log(t),e.type=s,this.$buefy.toast.open({type:"is-danger",message:this.$t("Error saving"),duration:3e3})}).finally(()=>{this.voteEditInFlight[e.id]=!1})},debouncedModifyVoteQuestion(e,t){const s="vq_"+e;clearTimeout(this.debounceTimers[s]),this.debounceTimers[s]=setTimeout(()=>{this.modifyVoteQuestion(e,t)},1e3)},saveAndExitVoteQuestion(e,t){const s="vq_"+e;clearTimeout(this.debounceTimers[s]),this.modifyVoteQuestion(e,t),this.editVoteQuestion[e]=!1},cancelEditVoteQuestion(e,t){const s="vq_"+e;clearTimeout(this.debounceTimers[s]);const i=this.originalTitles["vq_"+e];void 0!==i&&(this.item.votes[t].title=i),this.editVoteQuestion[e]=!1},deleteVoteQuestion(e,t){this.isLoading=!0,this.$http.plain.delete("/votes/"+e).then(()=>{this.item.votes.splice(t,1),this.$buefy.toast.open({message:this.$t("deleted"),duration:3e3})}).catch(e=>{console.log(e)}).finally(()=>{this.isLoading=!1})},modifyVoteOption(e,t,s){const i=this.item.votes[s].voteOptions[t].title,o=this.originalTitles["vo_"+e];i!==o&&(this.originalTitles["vo_"+e]=i,this.$http.plain.patch("/vote_options/"+e,{title:i}).catch(e=>{console.log(e)}))},debouncedModifyVoteOption(e,t,s){const i="vo_"+e;clearTimeout(this.debounceTimers[i]),this.debounceTimers[i]=setTimeout(()=>{this.modifyVoteOption(e,t,s)},1e3)},saveAndExitVoteOption(e,t,s){const i="vo_"+e;clearTimeout(this.debounceTimers[i]),this.modifyVoteOption(e,t,s),this.editVoteOption[e]=!1},cancelEditVoteOption(e,t,s){const i="vo_"+e;clearTimeout(this.debounceTimers[i]);const o=this.originalTitles["vo_"+e];void 0!==o&&(this.item.votes[s].voteOptions[t].title=o),this.editVoteOption[e]=!1},removeVoteOption(e,t,s){this.isLoading=!0,this.$http.plain.delete("/vote_options/"+e).then(()=>{this.item.votes[s].voteOptions.splice(t,1),this.$buefy.toast.open({message:this.$t("deleted"),duration:3e3})}).catch(e=>{console.log(e)}).finally(()=>{this.isLoading=!1})},openVoteModal(){this.initVoteSelections(),this.voteSuccess=!1,this.voteSealCode=null,this.showSealCode=!1,this.showVoteModal=!0},closeVoteModal(){this.showVoteModal=!1,this.voteSuccess&&this.retrieve()},loadAttributedResults(){this.item?.id&&(this.attributedLoading=!0,this.$http.plain.get("/vote_collections/"+this.item.id+"/attributed-results").then(e=>{this.attributedResults=e.data.voters||[],this.attributedTotal=e.data.totalVoters||this.attributedResults.length,this.attributedTruncated=!!e.data.truncated,this.attributedLoaded=!0}).catch(e=>{console.log(e),this.$buefy.toast.open({message:e.response?.data?.detail||this.$t("Error loading individual results"),type:"is-danger",duration:4e3})}).finally(()=>{this.attributedLoading=!1}))},submitVote(){const e=this.item.votes.every(e=>this.isAnsweredVote(e));e?(this.isVoting=!0,this.$http.plain.post("/vote_boxes",{voteOptions:this.voteSelections,voteCollection:this.item.id}).then(e=>{this.voteSuccess=!0,this.hasJustVoted=!0,this.item.hasVoted=!0,this.item.totalVoted++,this.voteSealCode=e.data.seal,this.myVoteSelections={...this.voteSelections},this.saveMyVoteToStorage(),this.showVoteModal=!0,this.$refs.voteUsers&&this.$refs.voteUsers.loadItemsPage(),this.retrieve()}).catch(e=>{console.error(e)}).finally(()=>{this.isVoting=!1}
1)):this.$buefy.toast.open({message:this.$t("You must answer each question"),type:"is-danger",duration:4e3})},copyVoteSeal(){this.voteSealCode&&(this.copyToClipboard(this.voteSealCode),this.$buefy.snackbar.open({message:this.$t("copied"),type:"is-success",duration:2e3}))},saveMyVoteToStorage(){try{const e=`vote_selections_${this.voteId}_${this.user.id}`,t={selections:this.myVoteSelections,sealCode:this.voteSealCode,timestamp:Date.now()};localStorage.setItem(e,JSON.stringify(t))}catch(e){console.error(e)}},loadMyVoteFromStorage(){try{const e=`vote_selections_${this.voteId}_${this.user.id}`,t=localStorage.getItem(e);if(t){const e=JSON.parse(t);this.myVoteSelections=e.selections||{},e.sealCode&&!this.sealCode&&(this.voteSealCode=e.sealCode)}}catch(e){console.error(e)}},getOptionClasses(e,t){const s=this.isOptionSelected(e,t);return this.hasVotedState?{"vote-my-selection-option":!0,"is-selected":s}:{"vote-modal-option":!0,"is-selected":s}},isOptionSelected(e,t){const s=this.hasVotedState?this.myVoteSelections[e]:this.voteSelections[e];return Array.isArray(s)?s.includes(t):s===t}}},Ts=s(66262);const Fs=(0,Ts.A)(ws,[["render",Cs],["__scopeId","data-v-7c493d10"]]);var xs=Fs,Xs=s(82920);const As=["aria-label"],Ms=["aria-label","title"],Is={class:"icon is-small"},Qs={class:"modal-card-body vsm-body"},Os={key:0,class:"vsm-state"},zs={key:1,class:"vsm-state"},Ps={class:"has-text-danger"},Us={class:"vsm-eyebrow"},Rs={class:"vsm-title"},Ws={class:"vsm-qr-frame"},Ds={key:0,class:"field has-addons vsm-link"},Bs={class:"control is-expanded"},Ks=["value"],qs={class:"control"},Ns={class:"icon is-small"},Gs={class:"control"},Ys=["aria-label","title"],Hs={class:"icon is-small"},js={class:"vsm-footer is-size-6-half"};function Js(e,t,s,a,l,n){const r=(0,i.g2)("font-awesome-icon"),d=(0,i.g2)("b-loading"),c=(0,i.g2)("qrcode-vue"),u=(0,i.g2)("b-modal");return(0,i.uX)(),(0,i.Wv)(u,{"model-value":s.modelValue,"has-modal-card":"","trap-focus":"","aria-role":"dialog","aria-modal":"","onUpdate:modelValue":t[5]||(t[5]=t=>e.$emit("update:modelValue",t))},{default:(0,i.k6)(()=>[(0,i.Lk)("div",{class:(0,o.C4)(["modal-card","vsm-card",{"is-fullscreen":l.isFullscreen}])},[(0,i.Lk)("button",{type:"button",class:"delete vsm-close","aria-label":e.$t("Close"),onClick:t[0]||(t[0]=t=>e.$emit("update:modelValue",!1))},null,8,As),l.isFullscreen&&l.shareUrl?((0,i.uX)(),(0,i.CE)("button",{key:0,type:"button",class:"button is-light is-rounded vsm-exit-fs","aria-label":e.$t("Exit fullscreen"),title:e.$t("Exit fullscreen"),onClick:t[1]||(t[1]=(...e)=>n.exitFullscreen&&n.exitFullscreen(...e))},[(0,i.Lk)("span",Is,[(0,i.bF)(r,{icon:"fa-light fa-compress"})])],8,Ms)):(0,i.Q3)("",!0),(0,i.Lk)("section",Qs,[l.isLoading?((0,i.uX)(),(0,i.CE)("div",Os,[(0,i.bF)(d,{"model-value":!0,"is-full-page":!1})])):l.error?((0,i.uX)(),(0,i.CE)("div",zs,[(0,i.Lk)("p",Ps,(0,o.v_)(e.$t("Could not generate the share link. Please try again.")),1)])):l.shareUrl?((0,i.uX)(),(0,i.CE)(i.FK,{key:2},[(0,i.Lk)("span",Us,[(0,i.bF)(r,{icon:"fa-light fa-qrcode",class:"mr-2"}),(0,i.eW)(" "+(0,o.v_)(e.$t("Scan to vote")),1)]),(0,i.Lk)("h2",Rs,(0,o.v_)(s.voteName||e.$t("Share vote")),1),(0,i.Lk)("div",Ws,[(0,i.bF)(c,{value:l.shareUrl,size:600,level:"H","render-as":"svg"},null,8,["value"])]),l.isFullscreen?(0,i.Q3)("",!0):((0,i.uX)(),(0,i.CE)("div",Ds,[(0,i.Lk)("div",Bs,[(0,i.Lk)("input",{class:"input is-rounded",type:"text",readonly:"",value:l.shareUrl,onFocus:t[2]||(t[2]=e=>e.target.select())},null,40,Ks)]),(0,i.Lk)("div",qs,[(0,i.Lk)("button",{class:(0,o.C4)(["button is-rounded",l.copied?"is-success":"is-primary"]),onClick:t[3]||(t[3]=(...e)=>n.copyLink&&n.copyLink(...e))},[(0,i.Lk)("span",Ns,[(0,i.bF)(r,{icon:l.copied?"fa-light fa-check":"fa-light fa-copy"},null,8,["icon"])]),(0,i.Lk)("span",null,(0,o.v_)(l.copied?e.$t("Copied!"):e.$t("Copy")),1)],2)]),(0,i.Lk)("div",Gs,[(0,i.Lk)("button",{type:"button",class:"button is-rounded is-light vsm-fs-btn","aria-label":e.$t("Fullscreen"),title:e.$t("Fullscreen"),onClick:t[4]||(t[4]=(...e)=>n.enterFullscreen&&n.enterFullscreen(...e))},[(0,i.Lk)("span",Hs,[(0,i.bF)(r,{icon:"fa-light fa-expand"})])],8,Ys)])])),(0,i.Lk)("p",js,[t[6]||(t[6]=(0,i.Lk)("span",{class:"vsm-footer-dot"}
1,null,-1)),(0,i.eW)(" "+(0,o.v_)(e.$t("Powered by Orgo")),1)])],64)):(0,i.Q3)("",!0)])],2)]),_:1},8,["model-value"])}var Zs=s(67944),ei={name:"VoteShareModal",components:{QrcodeVue:Zs.Ay},props:{modelValue:{type:Boolean,default:!1},voteId:{type:[Number,String],default:null},voteName:{type:String,default:""}},emits:["update:modelValue"],data(){return{shareUrl:null,isLoading:!1,error:!1,copied:!1,isFullscreen:!1}},watch:{modelValue(e){!e||this.shareUrl||this.isLoading||this.generateShareUrl(),e||this.exitFullscreen()}},beforeUnmount(){document.removeEventListener("keydown",this.handleFullscreenEsc)},methods:{enterFullscreen(){this.isFullscreen=!0,document.addEventListener("keydown",this.handleFullscreenEsc)},exitFullscreen(){this.isFullscreen&&(this.isFullscreen=!1,document.removeEventListener("keydown",this.handleFullscreenEsc))},handleFullscreenEsc(e){"Escape"===e.key&&(e.stopPropagation(),e.preventDefault(),this.exitFullscreen())},generateShareUrl(){this.voteId&&(this.isLoading=!0,this.error=!1,this.$http.plain.patch("/vote_collections/"+this.voteId+"/share-token",{}).then(e=>{this.shareUrl=e.data.shareUrl}).catch(e=>{console.log(e),this.error=!0}).finally(()=>{this.isLoading=!1}))},copyLink(){(0,Ls.lW)(this.shareUrl),this.copied=!0,setTimeout(()=>{this.copied=!1},2e3)}}};const ti=(0,Ts.A)(ei,[["render",Js],["__scopeId","data-v-2eb4bb62"]]);var si=ti,ii={components:{ItemViewPage:K.A,ItemViewModal:q.A,ShowContent:xs,UpdateContent:Xs.A,VoteShareModal:si},data(){return{itemId:this.$route.params.item,item:null,isLoading:!1,isExporting:!1,isExportingVoters:!1,isRefreshing:!1,isArchiving:!1,isFullscreen:!1,isShareModalOpen:!1,isEditModalVisible:!1,editFormState:{canSubmit:!0,isPublishing:!1,isBootstrapping:!1,isEditable:!0}}},computed:{...(0,B.L8)(["user","isGranted","tenant","tenantLogo"]),backRoute(){return this.$route.query.eventUuid?{name:"EventShow",params:{item:this.$route.query.eventUuid}}:{name:"VoteList"}},isTenantAdmin(){return this.isGranted("ADMIN_TENANT")},canManageVote(){if(!this.item)return!1;if(this.isTenantAdmin)return!0;const e=this.item.owner?.id===this.user.id;return e||!!this.item.unit&&this.isGranted("HR_LOCAL",this.item.unit)},canShare(){return!(!this.item||"live"!==this.item.status)&&this.canManageVote},canEditVote(){return this.canManageVote},hasSecondaryActions(){return!!this.item&&(this.canShare||"closed"===this.item.status&&!this.item.isArchived&&this.canManageVote||this.canManageVote||this.item.hasAvailableResults&&!this.item.isEditable||"closed"===this.item.status||!this.item.dateEnd&&"live"===this.item.status&&this.canEditVote)}},watch:{"$route.params.item":{immediate:!0,handler(e){this.itemId=e}}},beforeUnmount(){this.isFullscreen&&(document.body.style.overflow="",document.removeEventListener("keydown",this.handleEscKey))},methods:{handleLoaded(e){this.item=e},handleRefresh(){},handleClone(e){const t={name:"VoteShow",params:{item:e}};this.$route.query.eventUuid&&(t.query={eventUuid:this.$route.query.eventUuid}),this.$router.push(t)},handlePublish(){},triggerRefresh(){const e=this.$refs.showContent?.retrieve(!0);e&&(this.isRefreshing=!0,e.finally(()=>{this.isRefreshing=!1}))},triggerCloseVoting(){this.$refs.showContent?.closeVoting()},triggerClone(){this.$refs.showContent?.clone()},triggerPublish(){this.$refs.showContent?.publish()},triggerArchive(){this.$refs.showContent?.confirmArchive()},handleArchived(){this.$router.push(this.backRoute)},exportResults(){this.isExporting=!0;const e=!1===this.item.isAnonymous,t=e?"attributed-export":"export",s=e?"vote_individual_results.csv":"vote_results.csv";this.$http.plain.get("/vote_collections/"+this.item.id+"/"+t,{responseType:"blob"}).then(e=>{this.triggerCsvDownload(e,s)}).catch(e=>{console.error(e),this.$buefy.snackbar.open({message:this.$t("Error exporting results"),type:"is-danger"})}).finally(()=>{this.isExporting=!1})},exportVoters(){this.isExportingVoters=!0,this.$http.plain.get("/vote_collections/"+this.item.id+"/voters-export",{responseType:"blob"}).then(e=>{this.triggerCsvDownload(e,"vote_voters.csv")}).catch(e=>{console.error(e),this.$buefy.snackbar.open({message:this.$t("Error exporting voter list"),type:"is-danger"})}).finally(()=>{this.isExportingVoters=!1})},triggerCsvDownload(e,t){const s=e.headers["content-disposition"];let i=t;if(s){const e=s.match(/filename="?([^";\n]+)"?/);e&&(i=e[1])}const o=window.URL.createObjectURL(new Blob([e.data])),a=document.createElement("a");a.href=o,a.setAttribute("download",i),document.body.appendChild(a),a.click(),a.remove(),window.URL.revokeObjectURL(o)},enterFullscreen(){this.isFullscreen=!0,document.body.style.overflow="hidden",document.addEventListener("keydown",this.handleEscKey)},exitFullscreen(){this.isFullscreen=!1,document.body.style.overflow="",document.removeEventListener("keydown",this.handleEscKey)},handleEscKey(e){"Escape"===e.key&&this.exitFullscreen()},handleFullscreenLoaded(){},openEditModal(){this.isEditModalVisible=!0},closeEditModal(){this.isEditModalVisible=!1,this.$refs.showContent?.retrieve()},handleEditSaved(){},handleEditPublished(){this.closeEditModal()},handleEditDeleted(){this.isEditModalVisible=!1,this.$router.push(this.backRoute)},handleEditArchived(){this.isEditModalVisible=!1,this.$router.push(this.backRoute)},triggerVoteSaveDraft(){this.$refs.voteEditContent?.saveDraftAndClose()},triggerVotePublish(){this.$refs.voteEditContent?.publishAndClose()}}};const oi=(0,Ts.A)(ii,[["render",D],["__scopeId","data-v-5e9daa0b"]]);var ai=oi},81986:function(e,t,s){s.d(t,{A:function(){return W}});var i=s(20641),o=s(90033);const a={key:0,class:"vote-users-section"},l={class:"vote-users-header"},n={class:"has-text-weight-semibold"},r={class:"vote-audience-pill"},d={class:"icon is-small mr-1"},c={class:"vote-turnout-number"},u={class:"vote-turnout-current"},h={class:"vote-turnout-rest"},m={class:"vote-turnout-tiles"},v={class:"vote-turnout-tile-value has-text-success"},p={class:"vote-turnout-tile-label"},g={class:"vote-turnout-tile-value vote-turnout-tile-pending"},k={class:"vote-turnout-tile-label"},b={class:"vote-turnout-tile-value"},f={class:"vote-turnout-tile-label"},y={key:0,class:"vote-users-toolbar"},C={key:0,class:"vote-users-actions mb-3"},L={key:1,class:"vote-users-search mb-3"},V={key:2,id:"importExists"},E={key:3,id:"importMissing"},$={key:4,class:"vote-users-list"},_={class:"vote-user-avatar"},S={class:"vote-user-info"},w={key:0,class:"vote-user-actions"},T=["onClick"],F={class:"icon is-small has-text-grey"},x={key:5,class:"vote-users-empty"},X={class:"icon has-text-grey-light mb-2"},A={class:"has-text-grey"};function M(e,t,s,M,I,Q){const O=(0,i.g2)("b-loading"),z=(0,i.g2)("font-awesome-icon"),P=(0,i.g2)("b-tooltip"),U=(0,i.g2)("UserSearchAutocomplete"),R=(0,i.g2)("b-input"),W=((0,i.g2)("b-upload"),(0,i.g2)("b-pagination"));return s.item?((0,i.uX)(),(0,i.CE)("section",a,[(0,i.bF)(O,{modelValue:I.isLoading,"onUpdate:modelValue":t[0]||(t[0]=e=>I.isLoading=e),"is-full-page":!1},null,8,["modelValue"]),(0,i.Lk)("div",{class:(0,o.C4)(["card is-flat vote-users-card",{"is-pulsing":s.isPulsing}])},[(0,i.Lk)("div",l,[(0,i.Lk)("a",{class:"vote-users-title",onClick:t[1]||(t[1]=e=>Q.setVotedFilter(null))},[(0,i.Lk)("span",n,(0,o.v_)(e.$t("Participation")),1)]),(0,i.bF)(P,{label:Q.audience.label,active:Q.audience.label.length>16,position:"is-bottom",type:"is-dark",class:"ml-auto"},{default:(0,i.k6)(()=>[(0,i.Lk)("span",r,[(0,i.Lk)("span",d,[(0,i.bF)(z,{icon:Q.audience.icon},null,8,["icon"])]),(0,i.eW)(" "+(0,o.v_)(Q.truncateAudienceLabel(Q.audience.label)),1
1)])]),_:1},8,["label","active"])]),(0,i.Lk)("div",{class:(0,o.C4)(["vote-turnout",{"is-pulsing":s.isPulsing}])},[(0,i.Lk)("div",c,[(0,i.Lk)("span",u,(0,o.v_)(parseInt(s.item.participationPercentage||0))+"%",1),(0,i.Lk)("span",h,(0,o.v_)(e.$t("Turnout")),1)]),(0,i.Lk)("div",m,[(0,i.Lk)("button",{type:"button",class:(0,o.C4)(["vote-turnout-tile",{"is-active":!1===I.filters.notVoted}]),onClick:t[2]||(t[2]=e=>Q.setVotedFilter(!1===I.filters.notVoted&&null))},[(0,i.Lk)("span",v,(0,o.v_)(s.item.totalVoted),1),(0,i.Lk)("span",p,(0,o.v_)(e.$t("Voted")),1)],2),(0,i.Lk)("button",{type:"button",class:(0,o.C4)(["vote-turnout-tile",{"is-active":!0===I.filters.notVoted}]),onClick:t[3]||(t[3]=e=>Q.setVotedFilter(!0!==I.filters.notVoted||null))},[(0,i.Lk)("span",g,(0,o.v_)(Math.max(s.item.totalEligible-s.item.totalVoted,0)),1),(0,i.Lk)("span",k,(0,o.v_)(e.$t("Pending")),1)],2),(0,i.Lk)("button",{type:"button",class:(0,o.C4)(["vote-turnout-tile",{"is-active":null===I.filters.notVoted}]),onClick:t[4]||(t[4]=e=>Q.setVotedFilter(null))},[(0,i.Lk)("span",b,(0,o.v_)(s.item.totalEligible),1),(0,i.Lk)("span",f,(0,o.v_)(e.$t("Eligible")),1)],2)])],2),Q.canAddVoters||Q.hasSearchableList?((0,i.uX)(),(0,i.CE)("div",y,[Q.canAddVoters?((0,i.uX)(),(0,i.CE)("div",C,[(0,i.bF)(U,{"is-append-to-body":!0,"is-rounded":!1,class:"vote-users-add-input","onUpdate:modelValue":t[5]||(t[5]=e=>Q.addMember(e))}),(0,i.Q3)("",!0)])):(0,i.Q3)("",!0),Q.hasSearchableList?((0,i.uX)(),(0,i.CE)("div",L,[(0,i.bF)(R,{modelValue:I.filters.name,"onUpdate:modelValue":t[7]||(t[7]=e=>I.filters.name=e),rounded:"",size:"is-small",icon:"fa-magnifying-glass",placeholder:e.$t("Search by name"),onKeyup:Q.filterItemsByWord},null,8,["modelValue","placeholder","onKeyup"])])):(0,i.Q3)("",!0)])):(0,i.Q3)("",!0),(0,i.Q3)("",!0),I.importExists?((0,i.uX)(),(0,i.CE)("div",V,[t[13]||(t[13]=(0,i.Lk)("strong",null,"Already in the voting list:",-1)),((0,i.uX)(!0),(0,i.CE)(i.FK,null,(0,i.pI)(I.importExists,e=>((0,i.uX)(),(0,i.CE)("span",{key:e},(0,o.v_)(e),1))),128)),t[14]||(t[14]=(0,i.eW)(" Â ",-1))])):(0,i.Q3)("",!0),I.importMissing?((0,i.uX)(),(0,i.CE)("div",E,[t[15]||(t[15]=(0,i.Lk)("strong",null,"Not found or not allowed to vote:",-1)),((0,i.uX)(!0),(0,i.CE)(i.FK,null,(0,i.pI)(I.importMissing,e=>((0,i.uX)(),(0,i.CE)("span",{key:e},(0,o.v_)(e),1))),128)),t[16]||(t[16]=(0,i.eW)(" Â ",-1))])):(0,i.Q3)("",!0),I.items&&I.items.length>0?((0,i.uX)(),(0,i.CE)("div",$,[((0,i.uX)(!0),(0,i.CE)(i.FK,null,(0,i.pI)(I.items,t=>((0,i.uX)(),(0,i.CE)("div",{key:t.id,class:(0,o.C4)(["vote-user-item",{"has-voted":t.hasVoted}])},[(0,i.Lk)("span",_,(0,o.v_)(Q.voterInitials(t)),1),(0,i.Lk)("div",S,[(0,i.Lk)("span",{class:(0,o.C4)(["vote-user-name",{"is-muted":!t.hasVoted}])},(0,o.v_)(Q.voterDisplayName(t)),3),!s.item.isGeneral&&t.user&&t.user.alias?((0,i.uX)(),(0,i.CE)("span",{key:0,class:(0,o.C4)(["vote-user-alias",{"is-muted":!t.hasVoted}])},(0,o.v_)(t.user.alias),3)):(0,i.Q3)("",!0)]),(0,i.Lk)("span",{class:(0,o.C4)(["vote-user-badge",t.hasVoted?"is-voted":"is-pending"])},(0,o.v_)(t.hasVoted?e.$t("Voted"):e.$t("Pending")),3),Q.canAddVoters?((0,i.uX)(),(0,i.CE)("div",w,[(0,i.Lk)("button",{class:"button is-small is-white is-rounded",onClick:e=>Q.removeVoteUser(t.id)},[(0,i.Lk)("span",F,[(0,i.bF)(z,{icon:"fa-light fa-xmark"})])],8,T)])):(0,i.Q3)("",!0)],2))),128))])):I.listLoaded&&0===I.items.length?((0,i.uX)(),(0,i.CE)("div",x,[(0,i.Lk)("span",X,[(0,i.bF)(z,{icon:"fa-light fa-box-ballot",size:"2x"})]),(0,i.Lk)("p",A,(0,o.v_)(e.$t("Nobody voted"))+".",1)])):(0,i.Q3)("",!0),I.isMoreThanOnePage?((0,i.uX)(),(0,i.Wv)(W,{key:6,class:"mt-4",paginated:"","pagination-rounded":"","backend-pagination":"",total:I.itemsTotal,"per-page":I.itemsPerPage,onPageChange:Q.changeListPage},null,8,["total","per-page","onPageChange"])):(0,i.Q3)("",!0)],2)])):(0,i.Q3)("",!0)}s(44114),s(18111),s(22489);var I=s(40834),Q=s(38221),O=s.n(Q),z=s(95439),P={props:["item","isPulsing"],data(){return{importWrapper:!1,items:[],listLoaded:null,filters:{name:null,notVoted:null},itemsTotal:null,importExists:null,importMissing:null,itemsPageCurrent:1,itemsPerPage:100,isMoreThanOnePage:!1,isLoading:!1,sortField:"id",sortOrder:"desc",defaultSortOrder:"desc",fileUsers:null}},created(){this.loadItemsPage()},computed:{...(0,I.L8)(["isGranted","tenant","user"]),queryLink(){return this.isLocal?{isLocalSettings:1}:{isTenantSettings:1}},canAddVoters(){return!(!this.item?.isEditable||this.item?.isGeneral)&&(!!this.isGranted("ADMIN_TENANT")||this.item?.owner?.id===this.user.id)}
1,hasSearchableList(){return this.items&&this.items.length>7},audience(){return this.item.event?{icon:"fa-light fa-users",label:this.item.event.name||""}:this.item.isGeneral?{icon:"fa-light fa-users",label:(this.item.unit?this.item.unit.name:this.tenant.shortName)||""}:{icon:"fa-light fa-lock",label:this.$t("Private")}}},methods:{truncateAudienceLabel(e){return e&&e.length>16?e.slice(0,16)+"...":e},addMember(e){e&&(this.isLoading=!0,this.$http.plain.post("/vote_users",{user:"/api/v1/users/"+e.id,voteCollection:"/api/v1/vote_collections/"+this.item.id}).then(e=>(this.itemsTotal++,this.items.push(e.data),this.$emit("add"),this.$buefy.snackbar.open({message:this.$t("memberAdded")}))).catch(e=>console.error(e)).finally(()=>{this.isLoading=!1}))},importCsv(){this.isLoading=!0,this.importExists=null,this.importMissing=null;let e=new FormData;e.append("file",this.fileUsers),e.append("type","import_voting_users"),e.append("entity_id",this.$route.params.item),this.$http.plain.post("/media_objects",e,{headers:{"Content-Type":"multipart/form-data"}}).then(e=>{this.importExists=e.data.exists,this.importMissing=e.data.missing,this.$buefy.toast.open({message:this.$t("saved"),type:"is-success"}),this.fileUsers=null,this.$emit("reload")}).catch(e=>console.error(e)).finally(()=>{this.isLoading=!1})},filterItemsByWord:O()(function(e){if(["ArrowRight","ArrowLeft","ArrowUp","ArrowDown","Enter"].includes(e.key))return!1;this.filterItems()},400),filterItems(){this.loadItemsPage()},setVotedFilter(e){this.filters.notVoted!==e&&(this.filters.notVoted=e,this.itemsPageCurrent=1,this.filterItems())},getFiltersQueryString(){let e="&voteCollection="+this.item.id;return this.filters.name&&(e+="&user.fullName="+this.filters.name),!0===this.filters.notVoted?e+="&hasVoted=0":!1===this.filters.notVoted&&(e+="&hasVoted=1"),e},getOrderQueryString(){return"&order["+this.sortField+"]="+this.sortOrder},changeListPage(e){const t=document.getElementById("oMain");t&&t.scrollTo({top:0,behavior:"smooth"}),this.itemsPageCurrent=e,this.loadItemsPage()},removeVoteUser(e){this.isLoading=!0,this.$http.plain.delete("/vote_users/"+e).then(e=>{this.loadItemsPage(),this.$emit("remove")}).catch(e=>console.error(e))},loadItemsPage(){this.isLoading=!0;let e=this.getOrderQueryString(),t=this.getFiltersQueryString();this.$http.plain.get("/vote_users?page="+this.itemsPageCurrent+e+t).then(e=>{this.items=e.data["hydra:member"],this.listLoaded=!0,1===this.itemsPageCurrent&&(this.itemsTotal=e.data["hydra:totalItems"]),this.isMoreThanOnePage=void 0!==e.data["hydra:view"]["hydra:first"]}).catch(e=>console.error(e)).finally(()=>{this.isLoading=!1})},onSort(e,t){this.sortField=e,this.sortOrder=t,this.itemsPageCurrent=1,this.loadItemsPage()},voterDisplayName(e){return e.user?e.user.fullName:e.external?e.external.name||e.external.fullName:e.alias||this.$t("External contact")},voterInitials(e){const t=this.voterDisplayName(e)||"",s=t.trim().split(/\s+/).filter(Boolean);return 0===s.length?"?":1===s.length?s[0].slice(0,2).toUpperCase():(s[0][0]+s[s.length-1][0]).toUpperCase()},handleMercureUpdate(e,t){let s=this.items.findIndex(t=>t.id===e.id);"remove"===t?-1!==s&&(this.items.splice(s,1),this.itemsTotal--):"update"===t?-1!==s&&(this.items[s].hasVoted=e.hasVoted):"create"===t&&-1===s&&(this.items.unshift(e),this.itemsTotal++)}},components:{UserSearchAutocomplete:z.A}},U=s(66262);const R=(0,U.A)(P,[["render",M],["__scopeId","data-v-555eb155"]]);var W=R}}]);
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.