(\s+)<\/span>/g,(e,t)=>1==t.length?" ":t).replace(//g,"")}(s.getData("text/html")):s.getData("text/plain")&&(o=function(e){return((e=e.replace(//g,">").replace(/\r?\n\r?\n/g,"").replace(/\r?\n/g," ").replace(/^\s/," ").replace(/\s$/," ").replace(/\s\s/g," ")).includes("
")||e.includes(" "))&&(e=`
${e}
`),e}(s.getData("text/plain"))),o=this.editor.data.htmlProcessor.toView(o));const r=new i(this,"inputTransformation");this.fire(r,{content:o,dataTransfer:s,targetRanges:t.targetRanges,method:t.method}),r.stop.called&&e.stop(),n.scrollToTheSelection()},{priority:"low"}),this.listenTo(this,"inputTransformation",(e,n)=>{if(n.content.isEmpty)return;const i=this.editor.data.toModel(n.content,"$clipboardHolder");0!=i.childCount&&(e.stop(),t.change(()=>{this.fire("contentInsertion",{content:i,method:n.method,dataTransfer:n.dataTransfer,targetRanges:n.targetRanges})}))},{priority:"low"}),this.listenTo(this,"contentInsertion",(e,n)=>{n.resultRange=t.insertContent(n.content)},{priority:"low"})}_setupCopyCut(){const e=this.editor,t=e.model.document,n=e.editing.view.document;function i(i,s){const o=s.dataTransfer;s.preventDefault();const r=e.data.toView(e.model.getSelectedContent(t.selection));n.fire("clipboardOutput",{dataTransfer:o,content:r,method:i.name})}this.listenTo(n,"copy",i,{priority:"low"}),this.listenTo(n,"cut",(t,n)=>{e.isReadOnly?n.preventDefault():i(t,n)},{priority:"low"}),this.listenTo(n,"clipboardOutput",(n,i)=>{i.content.isEmpty||(i.dataTransfer.setData("text/html",this.editor.data.htmlProcessor.toData(i.content)),i.dataTransfer.setData("text/plain",vm(i.content))),"cut"==i.method&&e.model.deleteContent(t.selection)},{priority:"low"})}}class jm{constructor(){this._stack=[]}add(e,t){const n=this._stack,i=n[0];this._insertDescriptor(e);const s=n[0];i===s||Cm(i,s)||this.fire("change:top",{oldDescriptor:i,newDescriptor:s,writer:t})}remove(e,t){const n=this._stack,i=n[0];this._removeDescriptor(e);const s=n[0];i===s||Cm(i,s)||this.fire("change:top",{oldDescriptor:i,newDescriptor:s,writer:t})}_insertDescriptor(e){const t=this._stack,n=t.findIndex(t=>t.id===e.id);if(Cm(e,t[n]))return;n>-1&&t.splice(n,1);let i=0;for(;t[i]&&ym(t[i],e);)i++;t.splice(i,0,e)}_removeDescriptor(e){const t=this._stack,n=t.findIndex(t=>t.id===e);n>-1&&t.splice(n,1)}}function Cm(e,t){return e&&t&&e.priority==t.priority&&km(e.classes)==km(t.classes)}function ym(e,t){return e.priority>t.priority||!(e.prioritykm(t.classes)}function km(e){return Array.isArray(e)?e.sort().join(","):e}ot(jm,x);const Am="ck-widget_selected";function wm(e){return!!e.is("element")&&!!e.getCustomProperty("widget")}function Sm(e,t,n={}){if(!e.is("containerElement"))throw new u("widget-to-widget-wrong-element-type",null,{element:e});return t.setAttribute("contenteditable","false",e),t.addClass("ck-widget",e),t.setCustomProperty("widget",!0,e),e.getFillerOffset=Om,n.label&&function(e,t,n){n.setCustomProperty("widgetLabel",t,e)}(e,n.label,t),n.hasSelectionHandle&&function(e,t){const n=t.createUIElement("div",{class:"ck ck-widget__selection-handle"},function(e){const t=this.toDomElement(e),n=new hc;return n.set("content",' '),n.render(),t.appendChild(n.element),t});t.insert(t.createPositionAt(e,0),n),t.addClass(["ck-widget_with-selection-handle"],e)}(e,t),function(e,t,n=Em,i=Tm){const s=new jm;s.on("change:top",(t,s)=>{s.oldDescriptor&&i(e,s.oldDescriptor,s.writer),s.newDescriptor&&n(e,s.newDescriptor,s.writer)}),t.setCustomProperty("addHighlight",(e,t,n)=>s.add(t,n),e),t.setCustomProperty("removeHighlight",(e,t,n)=>s.remove(t,n),e)}(e,t),e}function Em(e,t,n){if(t.classes&&n.addClass(Gn(t.classes),e),t.attributes)for(const i in t.attributes)n.setAttribute(i,t.attributes[i],e)}function Tm(e,t,n){if(t.classes&&n.removeClass(Gn(t.classes),e),t.attributes)for(const i in t.attributes)n.removeAttribute(i,e)}function zm(e){const t=e.getCustomProperty("widgetLabel");return t?"function"==typeof t?t():t:""}function Om(){return null}const Rm="widget-type-around";function $m(e,t,n){return e&&wm(e)&&!n.isInline(t)}function Dm(e){return e.getAttribute(Rm)}var Pm=o(137);oo()(Pm.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Pm.Z.locals;const Fm=["before","after"],Mm=(new DOMParser).parseFromString(' ',"image/svg+xml").firstChild,Nm="ck-widget__type-around_disabled";class Lm extends rt{static get pluginName(){return"WidgetTypeAround"}static get requires(){return[Eh,qh]}constructor(e){super(e),this._currentFakeCaretModelElement=null}init(){const e=this.editor,t=e.editing.view;this.on("change:isEnabled",(n,i,s)=>{t.change(e=>{for(const n of t.document.roots)s?e.removeClass(Nm,n):e.addClass(Nm,n)}),s||e.model.change(e=>{e.removeSelectionAttribute(Rm)})}),this._enableTypeAroundUIInjection(),this._enableInsertingParagraphsOnButtonClick(),this._enableInsertingParagraphsOnEnterKeypress(),this._enableInsertingParagraphsOnTypingKeystroke(),this._enableTypeAroundFakeCaretActivationUsingKeyboardArrows(),this._enableDeleteIntegration(),this._enableInsertContentIntegration(),this._enableInsertObjectIntegration(),this._enableDeleteContentIntegration()}destroy(){this._currentFakeCaretModelElement=null}_insertParagraph(e,t){const n=this.editor,i=n.editing.view,s=n.model.schema.getAttributesWithProperty(e,"copyOnReplace",!0);n.execute("insertParagraph",{position:n.model.createPositionAt(e,t),attributes:s}),i.focus(),i.scrollToTheSelection()}_listenToIfEnabled(e,t,n,i){this.listenTo(e,t,(...e)=>{this.isEnabled&&n(...e)},i)}_insertParagraphAccordingToFakeCaretPosition(){const e=this.editor.model.document.selection,t=Dm(e);if(!t)return!1;const n=e.getSelectedElement();return this._insertParagraph(n,t),!0}_enableTypeAroundUIInjection(){const e=this.editor,t=e.model.schema,n=e.locale.t,i={before:n("Insert paragraph before block"),after:n("Insert paragraph after block")};e.editing.downcastDispatcher.on("insert",(e,n,s)=>{const o=s.mapper.toViewElement(n.item);$m(o,n.item,t)&&function(e,t,n){const i=e.createUIElement("div",{class:"ck ck-reset_all ck-widget__type-around"},function(e){const n=this.toDomElement(e);return function(e,t){for(const n of Fm){const i=new Vd({tag:"div",attributes:{class:["ck","ck-widget__type-around__button",`ck-widget__type-around__button_${n}`],title:t[n]},children:[e.ownerDocument.importNode(Mm,!0)]});e.appendChild(i.render())}}(n,t),function(e){const t=new Vd({tag:"div",attributes:{class:["ck","ck-widget__type-around__fake-caret"]}});e.appendChild(t.render())}(n),n});e.insert(e.createPositionAt(n,"end"),i)}(s.writer,i,o)},{priority:"low"})}_enableTypeAroundFakeCaretActivationUsingKeyboardArrows(){const e=this.editor,t=e.model,n=t.document.selection,i=t.schema,s=e.editing.view;function o(e){return`ck-widget_type-around_show-fake-caret_${e}`}this._listenToIfEnabled(s.document,"arrowKey",(e,t)=>{this._handleArrowKeyPress(e,t)},{context:[wm,"$text"],priority:"high"}),this._listenToIfEnabled(n,"change:range",(t,n)=>{n.directChange&&e.model.change(e=>{e.removeSelectionAttribute(Rm)})}),this._listenToIfEnabled(t.document,"change:data",()=>{const t=n.getSelectedElement();t&&$m(e.editing.mapper.toViewElement(t),t,i)||e.model.change(e=>{e.removeSelectionAttribute(Rm)})}),this._listenToIfEnabled(e.editing.downcastDispatcher,"selection",(e,t,n)=>{const s=n.writer;if(this._currentFakeCaretModelElement){const e=n.mapper.toViewElement(this._currentFakeCaretModelElement);e&&(s.removeClass(Fm.map(o),e),this._currentFakeCaretModelElement=null)}const r=t.selection.getSelectedElement();if(!r)return;const a=n.mapper.toViewElement(r);if(!$m(a,r,i))return;const l=Dm(t.selection);l&&(s.addClass(o(l),a),this._currentFakeCaretModelElement=r)}),this._listenToIfEnabled(e.ui.focusTracker,"change:isFocused",(t,n,i)=>{i||e.model.change(e=>{e.removeSelectionAttribute(Rm)})})}_handleArrowKeyPress(e,t){const n=this.editor,i=n.model,s=i.document.selection,o=i.schema,r=n.editing.view,a=function(e,t){const n=ys(e,t);return"down"===n||"right"===n}(t.keyCode,n.locale.contentLanguageDirection),l=r.document.selection.getSelectedElement();let d;$m(l,n.editing.mapper.toModelElement(l),o)?d=this._handleArrowKeyPressOnSelectedWidget(a):s.isCollapsed?d=this._handleArrowKeyPressWhenSelectionNextToAWidget(a):t.shiftKey||(d=this._handleArrowKeyPressWhenNonCollapsedSelection(a)),d&&(t.preventDefault(),e.stop())}_handleArrowKeyPressOnSelectedWidget(e){const t=this.editor.model,n=Dm(t.document.selection);return t.change(t=>n?n!==(e?"after":"before")&&(t.removeSelectionAttribute(Rm),!0):(t.setSelectionAttribute(Rm,e?"after":"before"),!0))}_handleArrowKeyPressWhenSelectionNextToAWidget(e){const t=this.editor,n=t.model,i=n.schema,s=t.plugins.get("Widget"),o=s._getObjectElementNextToSelection(e);return!!$m(t.editing.mapper.toViewElement(o),o,i)&&(n.change(t=>{s._setSelectionOverElement(o),t.setSelectionAttribute(Rm,e?"before":"after")}),!0)}_handleArrowKeyPressWhenNonCollapsedSelection(e){const t=this.editor,n=t.model,i=n.schema,s=t.editing.mapper,o=n.document.selection,r=e?o.getLastPosition().nodeBefore:o.getFirstPosition().nodeAfter;return!!$m(s.toViewElement(r),r,i)&&(n.change(t=>{t.setSelection(r,"on"),t.setSelectionAttribute(Rm,e?"after":"before")}),!0)}_enableInsertingParagraphsOnButtonClick(){const e=this.editor,t=e.editing.view;this._listenToIfEnabled(t.document,"mousedown",(n,i)=>{const s=function(e){return e.closest(".ck-widget__type-around__button")}(i.domTarget);if(!s)return;const o=function(e){return e.classList.contains("ck-widget__type-around__button_before")?"before":"after"}(s),r=function(e,t){const n=e.closest(".ck-widget");return t.mapDomToView(n)}(s,t.domConverter),a=e.editing.mapper.toModelElement(r);this._insertParagraph(a,o),i.preventDefault(),n.stop()})}_enableInsertingParagraphsOnEnterKeypress(){const e=this.editor,t=e.model.document.selection,n=e.editing.view;this._listenToIfEnabled(n.document,"enter",(n,i)=>{if("atTarget"!=n.eventPhase)return;const s=t.getSelectedElement(),o=e.editing.mapper.toViewElement(s),r=e.model.schema;let a;this._insertParagraphAccordingToFakeCaretPosition()?a=!0:$m(o,s,r)&&(this._insertParagraph(s,i.isSoft?"before":"after"),a=!0),a&&(i.preventDefault(),n.stop())},{context:wm})}_enableInsertingParagraphsOnTypingKeystroke(){const e=this.editor.editing.view,t=[Is.enter,Is.delete,Is.backspace];this._listenToIfEnabled(e.document,"keydown",(e,n)=>{t.includes(n.keyCode)||Lh(n)||this._insertParagraphAccordingToFakeCaretPosition()},{priority:"high"})}_enableDeleteIntegration(){const e=this.editor,t=e.editing.view,n=e.model,i=n.schema;this._listenToIfEnabled(t.document,"delete",(t,s)=>{if("atTarget"!=t.eventPhase)return;const o=Dm(n.document.selection);if(!o)return;const r=s.direction,a=n.document.selection.getSelectedElement(),l="forward"==r;if("before"===o===l)e.execute("delete",{selection:n.createSelection(a,"on")});else{const t=i.getNearestSelectionRange(n.createPositionAt(a,o),r);if(t)if(t.isCollapsed){const s=n.createSelection(t.start);if(n.modifySelection(s,{direction:r}),s.focus.isEqual(t.start)){const e=function(e,t){let n=t;for(const i of t.getAncestors({parentFirst:!0})){if(i.childCount>1||e.isLimit(i))break;n=i}return n}(i,t.start.parent);n.deleteContent(n.createSelection(e,"on"),{doNotAutoparagraph:!0})}else n.change(n=>{n.setSelection(t),e.execute(l?"deleteForward":"delete")})}else n.change(n=>{n.setSelection(t),e.execute(l?"deleteForward":"delete")})}s.preventDefault(),t.stop()},{context:wm})}_enableInsertContentIntegration(){const e=this.editor,t=this.editor.model,n=t.document.selection;this._listenToIfEnabled(e.model,"insertContent",(e,[i,s])=>{if(s&&!s.is("documentSelection"))return;const o=Dm(n);return o?(e.stop(),t.change(e=>{const s=n.getSelectedElement(),r=t.createPositionAt(s,o),a=e.createSelection(r),l=t.insertContent(i,a);return e.setSelection(a),l})):void 0},{priority:"high"})}_enableInsertObjectIntegration(){const e=this.editor,t=this.editor.model.document.selection;this._listenToIfEnabled(e.model,"insertObject",(e,n)=>{const[,i,,s={}]=n;if(i&&!i.is("documentSelection"))return;const o=Dm(t);o&&(s.findOptimalPosition=o,n[3]=s)},{priority:"high"})}_enableDeleteContentIntegration(){const e=this.editor,t=this.editor.model.document.selection;this._listenToIfEnabled(e.model,"deleteContent",(e,[n])=>{n&&!n.is("documentSelection")||Dm(t)&&e.stop()},{priority:"high"})}}function Bm(e,t,n){const i=e.schema,s=e.createRangeIn(t.root),o="forward"==n?"elementStart":"elementEnd";for(const{previousPosition:e,item:r,type:a}of s.getWalker({startPosition:t,direction:n})){if(i.isLimit(r)&&!i.isInline(r))return e;if(a==o&&i.isBlock(r))return null}return null}function Vm(e,t,n){const i="backward"==n?t.end:t.start;if(e.checkChild(i,"$text"))return i;for(const{nextPosition:i}of t.getWalker({direction:n}))if(e.checkChild(i,"$text"))return i;return null}var Um=o(507);oo()(Um.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Um.Z.locals;class Wm extends rt{static get pluginName(){return"Widget"}static get requires(){return[Lm,qh]}init(){const e=this.editor,t=e.editing.view,n=t.document;this._previouslySelected=new Set,this.editor.editing.downcastDispatcher.on("selection",(t,n,i)=>{const s=i.writer,o=n.selection;if(o.isCollapsed)return;const r=o.getSelectedElement();if(!r)return;const a=e.editing.mapper.toViewElement(r);wm(a)&&i.consumable.consume(o,"selection")&&s.setSelection(s.createRangeOn(a),{fake:!0,label:zm(a)})}),this.editor.editing.downcastDispatcher.on("selection",(e,t,n)=>{this._clearPreviouslySelectedWidgets(n.writer);const i=n.writer,s=i.document.selection;let o=null;for(const e of s.getRanges())for(const t of e){const e=t.item;wm(e)&&!Gm(e,o)&&(i.addClass(Am,e),this._previouslySelected.add(e),o=e)}},{priority:"low"}),t.addObserver(qu),this.listenTo(n,"mousedown",(...e)=>this._onMousedown(...e)),this.listenTo(n,"arrowKey",(...e)=>{this._handleSelectionChangeOnArrowKeyPress(...e)},{context:[wm,"$text"]}),this.listenTo(n,"arrowKey",(...e)=>{this._preventDefaultOnArrowKeyPress(...e)},{context:"$root"}),this.listenTo(n,"arrowKey",function(e){const t=e.model;return(n,i)=>{const s=i.keyCode==Is.arrowup,o=i.keyCode==Is.arrowdown,r=i.shiftKey,a=t.document.selection;if(!s&&!o)return;const l=o;if(r&&function(e,t){return!e.isCollapsed&&e.isBackward==t}(a,l))return;const d=function(e,t,n){const i=e.model;if(n){const e=t.isCollapsed?t.focus:t.getLastPosition(),n=Bm(i,e,"forward");if(!n)return null;const s=i.createRange(e,n),o=Vm(i.schema,s,"backward");return o?i.createRange(e,o):null}{const e=t.isCollapsed?t.focus:t.getFirstPosition(),n=Bm(i,e,"backward");if(!n)return null;const s=i.createRange(n,e),o=Vm(i.schema,s,"forward");return o?i.createRange(o,e):null}}(e,a,l);if(d){if(d.isCollapsed){if(a.isCollapsed)return;if(r)return}(d.isCollapsed||function(e,t,n){const i=e.model,s=e.view.domConverter;if(n){const e=i.createSelection(t.start);i.modifySelection(e),e.focus.isAtEnd||t.start.isEqual(e.focus)||(t=i.createRange(e.focus,t.end))}const o=e.mapper.toViewRange(t),r=s.viewRangeToDom(o),a=Ir.getDomRangeRects(r);let l;for(const e of a)if(void 0!==l){if(Math.round(e.top)>=l)return!1;l=Math.max(l,Math.round(e.bottom))}else l=Math.round(e.bottom);return!0}(e,d,l))&&(t.change(e=>{const n=l?d.end:d.start;if(r){const i=t.createSelection(a.anchor);i.setFocus(n),e.setSelection(i)}else e.setSelection(n)}),n.stop(),i.preventDefault(),i.stopPropagation())}}}(this.editor.editing),{context:"$text"}),this.listenTo(n,"delete",(e,t)=>{this._handleDelete("forward"==t.direction)&&(t.preventDefault(),e.stop())},{context:"$root"})}_onMousedown(e,t){const n=this.editor,i=n.editing.view,s=i.document;let o=t.target;if(function(e){for(;e;){if(e.is("editableElement")&&!e.is("rootElement"))return!0;if(wm(e))return!1;e=e.parent}return!1}(o)){if((ps.isSafari||ps.isGecko)&&t.domEvent.detail>=3){const e=n.editing.mapper,i=o.is("attributeElement")?o.findAncestor(e=>!e.is("attributeElement")):o,s=e.toModelElement(i);t.preventDefault(),this.editor.model.change(e=>{e.setSelection(s,"in")})}return}if(!wm(o)&&(o=o.findAncestor(wm),!o))return;ps.isAndroid&&t.preventDefault(),s.isFocused||i.focus();const r=n.editing.mapper.toModelElement(o);this._setSelectionOverElement(r)}_handleSelectionChangeOnArrowKeyPress(e,t){const n=t.keyCode,i=this.editor.model,s=i.schema,o=i.document.selection,r=o.getSelectedElement(),a=ys(n,this.editor.locale.contentLanguageDirection),l="down"==a||"right"==a,d="up"==a||"down"==a;if(r&&s.isObject(r)){const n=l?o.getLastPosition():o.getFirstPosition(),r=s.getNearestSelectionRange(n,l?"forward":"backward");return void(r&&(i.change(e=>{e.setSelection(r)}),t.preventDefault(),e.stop()))}if(!o.isCollapsed&&!t.shiftKey){const n=o.getFirstPosition(),r=o.getLastPosition(),a=n.nodeAfter,d=r.nodeBefore;return void((a&&s.isObject(a)||d&&s.isObject(d))&&(i.change(e=>{e.setSelection(l?r:n)}),t.preventDefault(),e.stop()))}if(!o.isCollapsed)return;const c=this._getObjectElementNextToSelection(l);if(c&&s.isObject(c)){if(s.isInline(c)&&d)return;this._setSelectionOverElement(c),t.preventDefault(),e.stop()}}_preventDefaultOnArrowKeyPress(e,t){const n=this.editor.model,i=n.schema,s=n.document.selection.getSelectedElement();s&&i.isObject(s)&&(t.preventDefault(),e.stop())}_handleDelete(e){if(this.editor.isReadOnly)return;const t=this.editor.model.document.selection;if(!t.isCollapsed)return;const n=this._getObjectElementNextToSelection(e);return n?(this.editor.model.change(e=>{let i=t.anchor.parent;for(;i.isEmpty;){const t=i;i=t.parent,e.remove(t)}this._setSelectionOverElement(n)}),!0):void 0}_setSelectionOverElement(e){this.editor.model.change(t=>{t.setSelection(t.createRangeOn(e))})}_getObjectElementNextToSelection(e){const t=this.editor.model,n=t.schema,i=t.document.selection,s=t.createSelection(i);if(t.modifySelection(s,{direction:e?"forward":"backward"}),s.isEqual(i))return null;const o=e?s.focus.nodeBefore:s.focus.nodeAfter;return o&&n.isObject(o)?o:null}_clearPreviouslySelectedWidgets(e){for(const t of this._previouslySelected)e.removeClass(Am,t);this._previouslySelected.clear()}}function Gm(e,t){return!!t&&Array.from(e.getAncestors()).includes(t)}const Hm=function(e,t,n){var i=!0,s=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return w(n)&&(i="leading"in n?!!n.leading:i,s="trailing"in n?!!n.trailing:s),dr(e,t,{leading:i,maxWait:t,trailing:s})};var qm=o(390);oo()(qm.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),qm.Z.locals;class Km extends rt{static get pluginName(){return"DragDrop"}static get requires(){return[bm,Wm]}init(){const e=this.editor,t=e.editing.view;this._draggedRange=null,this._draggingUid="",this._draggableElement=null,this._updateDropMarkerThrottled=Hm(e=>this._updateDropMarker(e),40),this._removeDropMarkerDelayed=Xm(()=>this._removeDropMarker(),40),this._clearDraggableAttributesDelayed=Xm(()=>this._clearDraggableAttributes(),40),t.addObserver(xm),t.addObserver(qu),this._setupDragging(),this._setupContentInsertionIntegration(),this._setupClipboardInputIntegration(),this._setupDropMarker(),this._setupDraggableAttributeHandling(),this.listenTo(e,"change:isReadOnly",(e,t,n)=>{n?this.forceDisabled("readOnlyMode"):this.clearForceDisabled("readOnlyMode")}),this.on("change:isEnabled",(e,t,n)=>{n||this._finalizeDragging(!1)}),ps.isAndroid&&this.forceDisabled("noAndroidSupport")}destroy(){return this._draggedRange&&(this._draggedRange.detach(),this._draggedRange=null),this._updateDropMarkerThrottled.cancel(),this._removeDropMarkerDelayed.cancel(),this._clearDraggableAttributesDelayed.cancel(),super.destroy()}_setupDragging(){const e=this.editor,t=e.model,n=t.document,i=e.editing.view,s=i.document;this.listenTo(s,"dragstart",(i,o)=>{const r=n.selection;if(o.target&&o.target.is("editableElement"))return void o.preventDefault();const l=o.target?Jm(o.target):null;if(l){const n=e.editing.mapper.toModelElement(l);this._draggedRange=da.fromRange(t.createRangeOn(n)),e.plugins.has("WidgetToolbarRepository")&&e.plugins.get("WidgetToolbarRepository").forceDisabled("dragDrop")}else if(!s.selection.isCollapsed){const e=s.selection.getSelectedElement();e&&wm(e)||(this._draggedRange=da.fromRange(r.getFirstRange()))}if(!this._draggedRange)return void o.preventDefault();this._draggingUid=a(),o.dataTransfer.effectAllowed=this.isEnabled?"copyMove":"copy",o.dataTransfer.setData("application/ckeditor5-dragging-uid",this._draggingUid);const d=t.createSelection(this._draggedRange.toRange()),c=e.data.toView(t.getSelectedContent(d));s.fire("clipboardOutput",{dataTransfer:o.dataTransfer,content:c,method:i.name}),this.isEnabled||(this._draggedRange.detach(),this._draggedRange=null,this._draggingUid="")},{priority:"low"}),this.listenTo(s,"dragend",(e,t)=>{this._finalizeDragging(!t.dataTransfer.isCanceled&&"move"==t.dataTransfer.dropEffect)},{priority:"low"}),this.listenTo(s,"dragenter",()=>{this.isEnabled&&i.focus()}),this.listenTo(s,"dragleave",()=>{this._removeDropMarkerDelayed()}),this.listenTo(s,"dragging",(t,n)=>{if(!this.isEnabled)return void(n.dataTransfer.dropEffect="none");this._removeDropMarkerDelayed.cancel();const i=Ym(e,n.targetRanges,n.target);this._draggedRange||(n.dataTransfer.dropEffect="copy"),ps.isGecko||("copy"==n.dataTransfer.effectAllowed?n.dataTransfer.dropEffect="copy":["all","copyMove"].includes(n.dataTransfer.effectAllowed)&&(n.dataTransfer.dropEffect="move")),i&&this._updateDropMarkerThrottled(i)},{priority:"low"})}_setupClipboardInputIntegration(){const e=this.editor,t=e.editing.view.document;this.listenTo(t,"clipboardInput",(t,n)=>{if("drop"!=n.method)return;const i=Ym(e,n.targetRanges,n.target);return this._removeDropMarker(),i?(this._draggedRange&&this._draggingUid!=n.dataTransfer.getData("application/ckeditor5-dragging-uid")&&(this._draggedRange.detach(),this._draggedRange=null,this._draggingUid=""),"move"==Zm(n.dataTransfer)&&this._draggedRange&&this._draggedRange.containsRange(i,!0)?(this._finalizeDragging(!1),void t.stop()):void(n.targetRanges=[e.editing.mapper.toViewRange(i)])):(this._finalizeDragging(!1),void t.stop())},{priority:"high"})}_setupContentInsertionIntegration(){const e=this.editor.plugins.get(bm);e.on("contentInsertion",(e,t)=>{if(!this.isEnabled||"drop"!==t.method)return;const n=t.targetRanges.map(e=>this.editor.editing.mapper.toModelRange(e));this.editor.model.change(e=>e.setSelection(n))},{priority:"high"}),e.on("contentInsertion",(e,t)=>{if(!this.isEnabled||"drop"!==t.method)return;const n="move"==Zm(t.dataTransfer),i=!t.resultRange||!t.resultRange.isCollapsed;this._finalizeDragging(i&&n)},{priority:"lowest"})}_setupDraggableAttributeHandling(){const e=this.editor,t=e.editing.view,n=t.document;this.listenTo(n,"mousedown",(i,s)=>{if(ps.isAndroid||!s)return;this._clearDraggableAttributesDelayed.cancel();let o=Jm(s.target);if(ps.isBlink&&!e.isReadOnly&&!o&&!n.selection.isCollapsed){const e=n.selection.getSelectedElement();e&&wm(e)||(o=n.selection.editableElement)}o&&(t.change(e=>{e.setAttribute("draggable","true",o)}),this._draggableElement=e.editing.mapper.toModelElement(o))}),this.listenTo(n,"mouseup",()=>{ps.isAndroid||this._clearDraggableAttributesDelayed()})}_clearDraggableAttributes(){const e=this.editor.editing;e.view.change(t=>{this._draggableElement&&"$graveyard"!=this._draggableElement.root.rootName&&t.removeAttribute("draggable",e.mapper.toViewElement(this._draggableElement)),this._draggableElement=null})}_setupDropMarker(){const e=this.editor;e.conversion.for("editingDowncast").markerToHighlight({model:"drop-target",view:{classes:["ck-clipboard-drop-target-range"]}}),e.conversion.for("editingDowncast").markerToElement({model:"drop-target",view:(t,{writer:n})=>{if(e.model.schema.checkChild(t.markerRange.start,"$text"))return n.createUIElement("span",{class:"ck ck-clipboard-drop-target-position"},function(e){const t=this.toDomElement(e);return t.innerHTML="⁠ ⁠",t})}})}_updateDropMarker(e){const t=this.editor,n=t.model.markers;t.model.change(t=>{n.has("drop-target")?n.get("drop-target").getRange().isEqual(e)||t.updateMarker("drop-target",{range:e}):t.addMarker("drop-target",{range:e,usingOperation:!1,affectsData:!1})})}_removeDropMarker(){const e=this.editor.model;this._removeDropMarkerDelayed.cancel(),this._updateDropMarkerThrottled.cancel(),e.markers.has("drop-target")&&e.change(e=>{e.removeMarker("drop-target")})}_finalizeDragging(e){const t=this.editor,n=t.model;this._removeDropMarker(),this._clearDraggableAttributes(),t.plugins.has("WidgetToolbarRepository")&&t.plugins.get("WidgetToolbarRepository").clearForceDisabled("dragDrop"),this._draggingUid="",this._draggedRange&&(e&&this.isEnabled&&n.deleteContent(n.createSelection(this._draggedRange),{doNotAutoparagraph:!0}),this._draggedRange.detach(),this._draggedRange=null)}}function Ym(e,t,n){const i=e.model,s=e.editing.mapper;let o=null;const r=t?t[0].start:null;if(n.is("uiElement")&&(n=n.parent),o=function(e,t){const n=e.model,i=e.editing.mapper;if(wm(t))return n.createRangeOn(i.toModelElement(t));if(!t.is("editableElement")){const e=t.findAncestor(e=>wm(e)||e.is("editableElement"));if(wm(e))return n.createRangeOn(i.toModelElement(e))}return null}(e,n),o)return o;const a=function(e,t){const n=e.editing.mapper,i=e.editing.view,s=n.toModelElement(t);if(s)return s;const o=i.createPositionBefore(t),r=n.findMappedViewAncestor(o);return n.toModelElement(r)}(e,n),l=r?s.toModelPosition(r):null;return l?(o=function(e,t,n){const i=e.model;if(!i.schema.checkChild(n,"$block"))return null;const s=i.createPositionAt(n,0),o=t.path.slice(0,s.path.length),r=i.createPositionFromPath(t.root,o).nodeAfter;return r&&i.schema.isObject(r)?i.createRangeOn(r):null}(e,l,a),o||(o=i.schema.getNearestSelectionRange(l,ps.isGecko?"forward":"backward"),o||function(e,t){const n=e.model;for(;t;){if(n.schema.isObject(t))return n.createRangeOn(t);t=t.parent}}(e,l.parent))):function(e,t){const n=e.model,i=n.schema,s=n.createPositionAt(t,0);return i.getNearestSelectionRange(s,"forward")}(e,a)}function Zm(e){return ps.isGecko?e.dropEffect:["all","copyMove"].includes(e.effectAllowed)?"move":"copy"}function Xm(e,t){let n;function i(...s){i.cancel(),n=setTimeout(()=>e(...s),t)}return i.cancel=()=>{clearTimeout(n)},i}function Jm(e){if(e.is("editableElement"))return null;if(e.hasClass("ck-widget__selection-handle"))return e.findAncestor(wm);if(wm(e))return e;const t=e.findAncestor(e=>wm(e)||e.is("editableElement"));return wm(t)?t:null}class Qm extends rt{static get pluginName(){return"PastePlainText"}static get requires(){return[bm]}init(){const e=this.editor,t=e.model,n=e.editing.view,i=n.document,s=t.document.selection;let o=!1;n.addObserver(xm),this.listenTo(i,"keydown",(e,t)=>{o=t.shiftKey}),e.plugins.get(bm).on("contentInsertion",(e,n)=>{(o||function(e,t){if(e.childCount>1)return!1;const n=e.getChild(0);return!t.isObject(n)&&0==[...n.getAttributeKeys()].length}(n.content,t.schema))&&t.change(e=>{const i=Array.from(s.getAttributes()).filter(([e])=>t.schema.getAttributeProperties(e).isFormatting);s.isCollapsed||t.deleteContent(s,{doNotAutoparagraph:!0}),i.push(...s.getAttributes());const o=e.createRangeIn(n.content);for(const t of o.getItems())t.is("$textProxy")&&e.setAttributes(i,t)})})}}class eg extends rt{static get pluginName(){return"Clipboard"}static get requires(){return[bm,Km,Qm]}}class tg extends lt{constructor(e){super(e),this.affectsData=!1}execute(){const e=this.editor.model,t=e.document.selection;let n=e.schema.getLimitElement(t);if(t.containsEntireContent(n)||!ng(e.schema,n))do{if(n=n.parent,!n)return}while(!ng(e.schema,n));e.change(e=>{e.setSelection(n,"in")})}}function ng(e,t){return e.isLimit(t)&&(e.checkChild(t,"$text")||e.checkChild(t,"paragraph"))}const ig=js("Ctrl+A");class sg extends rt{static get pluginName(){return"SelectAllEditing"}init(){const e=this.editor,t=e.editing.view.document;e.commands.add("selectAll",new tg(e)),this.listenTo(t,"keydown",(t,n)=>{bs(n)===ig&&(e.execute("selectAll"),n.preventDefault())})}}class og extends rt{static get pluginName(){return"SelectAllUI"}init(){const e=this.editor;e.ui.componentFactory.add("selectAll",t=>{const n=e.commands.get("selectAll"),i=new fc(t),s=t.t;return i.set({label:s("Select all"),icon:' ',keystroke:"Ctrl+A",tooltip:!0}),i.bind("isOn","isEnabled").to(n,"value","isEnabled"),this.listenTo(i,"execute",()=>{e.execute("selectAll"),e.editing.view.focus()}),i})}}class rg extends rt{static get requires(){return[sg,og]}static get pluginName(){return"SelectAll"}}class ag extends lt{constructor(e){super(e),this._stack=[],this._createdBatches=new WeakSet,this.refresh(),this.listenTo(e.data,"set",(e,t)=>{t[1]={...t[1]};const n=t[1];n.batchType||(n.batchType={isUndoable:!1})},{priority:"high"}),this.listenTo(e.data,"set",(e,t)=>{t[1].batchType.isUndoable||this.clearStack()})}refresh(){this.isEnabled=this._stack.length>0}addBatch(e){const t=this.editor.model.document.selection,n={ranges:t.hasOwnRange?Array.from(t.getRanges()):[],isBackward:t.isBackward};this._stack.push({batch:e,selection:n}),this.refresh()}clearStack(){this._stack=[],this.refresh()}_restoreSelection(e,t,n){const i=this.editor.model,s=i.document,o=[],r=e.map(e=>e.getTransformedByOperations(n)),a=r.flat();for(const e of r){const t=e.filter(e=>e.root!=s.graveyard).filter(e=>!dg(e,a));t.length&&(lg(t),o.push(t[0]))}o.length&&i.change(e=>{e.setSelection(o,{backward:t})})}_undo(e,t){const n=this.editor.model,i=n.document;this._createdBatches.add(t);const s=e.operations.slice().filter(e=>e.isDocumentOperation);s.reverse();for(const e of s){const s=e.baseVersion+1,o=Array.from(i.history.getOperations(s)),r=Nu([e.getReversed()],o,{useRelations:!0,document:this.editor.model.document,padWithNoOps:!1,forceWeakRemove:!0}).operationsA;for(const s of r)t.addOperation(s),n.applyOperation(s),i.history.setOperationAsUndone(e,s)}}}function lg(e){e.sort((e,t)=>e.start.isBefore(t.start)?-1:1);for(let t=1;tt!==e&&t.containsRange(e,!0))}class cg extends ag{execute(e=null){const t=e?this._stack.findIndex(t=>t.batch==e):this._stack.length-1,n=this._stack.splice(t,1)[0],i=this.editor.model.createBatch({isUndo:!0});this.editor.model.enqueueChange(i,()=>{this._undo(n.batch,i);const e=this.editor.model.document.history.getOperations(n.batch.baseVersion);this._restoreSelection(n.selection.ranges,n.selection.isBackward,e),this.fire("revert",n.batch,i)}),this.refresh()}}class ug extends ag{execute(){const e=this._stack.pop(),t=this.editor.model.createBatch({isUndo:!0});this.editor.model.enqueueChange(t,()=>{const n=e.batch.operations[e.batch.operations.length-1].baseVersion+1,i=this.editor.model.document.history.getOperations(n);this._restoreSelection(e.selection.ranges,e.selection.isBackward,i),this._undo(e.batch,t)}),this.refresh()}}class hg extends rt{static get pluginName(){return"UndoEditing"}constructor(e){super(e),this._batchRegistry=new WeakSet}init(){const e=this.editor;this._undoCommand=new cg(e),this._redoCommand=new ug(e),e.commands.add("undo",this._undoCommand),e.commands.add("redo",this._redoCommand),this.listenTo(e.model,"applyOperation",(e,t)=>{const n=t[0];if(!n.isDocumentOperation)return;const i=n.batch,s=this._redoCommand._createdBatches.has(i),o=this._undoCommand._createdBatches.has(i);this._batchRegistry.has(i)||(this._batchRegistry.add(i),i.isUndoable&&(s?this._undoCommand.addBatch(i):o||(this._undoCommand.addBatch(i),this._redoCommand.clearStack())))},{priority:"highest"}),this.listenTo(this._undoCommand,"revert",(e,t,n)=>{this._redoCommand.addBatch(n)}),e.keystrokes.set("CTRL+Z","undo"),e.keystrokes.set("CTRL+Y","redo"),e.keystrokes.set("CTRL+SHIFT+Z","redo")}}const mg=' ',gg=' ';class pg extends rt{static get pluginName(){return"UndoUI"}init(){const e=this.editor,t=e.locale,n=e.t,i="ltr"==t.uiLanguageDirection?mg:gg,s="ltr"==t.uiLanguageDirection?gg:mg;this._addButton("undo",n("Undo"),"CTRL+Z",i),this._addButton("redo",n("Redo"),"CTRL+Y",s)}_addButton(e,t,n,i){const s=this.editor;s.ui.componentFactory.add(e,o=>{const r=s.commands.get(e),a=new fc(o);return a.set({label:t,icon:i,keystroke:n,tooltip:!0}),a.bind("isEnabled").to(r,"isEnabled"),this.listenTo(a,"execute",()=>{s.execute(e),s.editing.view.focus()}),a})}}class fg extends rt{static get requires(){return[hg,pg]}static get pluginName(){return"Undo"}}class _g extends lt{constructor(e,t){super(e),this.attributeKey=t}refresh(){const e=this.editor.model,t=e.document;this.value=t.selection.getAttribute(this.attributeKey),this.isEnabled=e.schema.checkAttributeInSelection(t.selection,this.attributeKey)}execute(e={}){const t=this.editor.model,n=t.document.selection,i=e.value;t.change(e=>{if(n.isCollapsed)i?e.setSelectionAttribute(this.attributeKey,i):e.removeSelectionAttribute(this.attributeKey);else{const s=t.schema.getValidRanges(n.getRanges(),this.attributeKey);for(const t of s)i?e.setAttribute(this.attributeKey,i,t):e.removeAttribute(this.attributeKey,t)}})}}class xg extends Un{constructor(e){super(e),this.set("isEmpty",!0),this.on("change",()=>{this.set("isEmpty",0===this.length)})}add(e,t){this.find(t=>t.color===e.color)||super.add(e,t)}hasColor(e){return!!this.find(t=>t.color===e)}}ot(xg,Qe);var Ig=o(585);oo()(Ig.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Ig.Z.locals;class vg extends Bd{constructor(e,{colors:t,columns:n,removeButtonLabel:i,documentColorsLabel:s,documentColorsCount:o}){super(e),this.items=this.createCollection(),this.colorDefinitions=t,this.focusTracker=new Dr,this.keystrokes=new Pr,this.set("selectedColor"),this.removeButtonLabel=i,this.columns=n,this.documentColors=new xg,this.documentColorsCount=o,this._focusCycler=new jc({focusables:this.items,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"arrowup",focusNext:"arrowdown"}}),this._documentColorsLabel=s,this.setTemplate({tag:"div",attributes:{class:["ck","ck-color-table"]},children:this.items}),this.items.add(this._removeColorButton())}updateDocumentColors(e,t){const n=e.document,i=this.documentColorsCount;this.documentColors.clear();for(const s of n.getRootNames()){const o=n.getRoot(s),r=e.createRangeIn(o);for(const e of r.getItems())if(e.is("$textProxy")&&e.hasAttribute(t)&&(this._addColorToDocumentColors(e.getAttribute(t)),this.documentColors.length>=i))return}}updateSelectedColors(){const e=this.documentColorsGrid,t=this.staticColorsGrid,n=this.selectedColor;t.selectedColor=n,e&&(e.selectedColor=n)}render(){super.render();for(const e of this.items)this.focusTracker.add(e.element);this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}appendGrids(){if(!this.staticColorsGrid&&(this.staticColorsGrid=this._createStaticColorsGrid(),this.items.add(this.staticColorsGrid),this.documentColorsCount)){const e=Vd.bind(this.documentColors,this.documentColors),t=new tu(this.locale);t.text=this._documentColorsLabel,t.extendTemplate({attributes:{class:["ck","ck-color-grid__label",e.if("isEmpty","ck-hidden")]}}),this.items.add(t),this.documentColorsGrid=this._createDocumentColorsGrid(),this.items.add(this.documentColorsGrid)}}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}_removeColorButton(){const e=new fc;return e.set({withText:!0,icon:' ',tooltip:!0,label:this.removeButtonLabel}),e.class="ck-color-table__remove-color",e.on("execute",()=>{this.fire("execute",{value:null})}),e}_createStaticColorsGrid(){const e=new kc(this.locale,{colorDefinitions:this.colorDefinitions,columns:this.columns});return e.delegate("execute").to(this),e}_createDocumentColorsGrid(){const e=Vd.bind(this.documentColors,this.documentColors),t=new kc(this.locale,{columns:this.columns});return t.delegate("execute").to(this),t.extendTemplate({attributes:{class:e.if("isEmpty","ck-hidden")}}),t.items.bindTo(this.documentColors).using(e=>{const t=new vc;return t.set({color:e.color,hasBorder:e.options&&e.options.hasBorder}),e.label&&t.set({label:e.label,tooltip:!0}),t.on("execute",()=>{this.fire("execute",{value:e.color})}),t}),this.documentColors.on("change:isEmpty",(e,n,i)=>{i&&(t.selectedColor=null)}),t}_addColorToDocumentColors(e){const t=this.colorDefinitions.find(t=>t.color===e);t?this.documentColors.add(Object.assign({},t)):this.documentColors.add({color:e,label:e,options:{hasBorder:!1}})}}const bg="fontColor",jg="fontBackgroundColor";function Cg(e){return t=>function(e){return e.replace(/\s/g,"")}(t.getStyle(e))}function yg(e){return(t,{writer:n})=>n.createAttributeElement("span",{style:`${e}:${t}`},{priority:7})}class kg extends _g{constructor(e){super(e,jg)}}class Ag extends rt{static get pluginName(){return"FontBackgroundColorEditing"}constructor(e){super(e),e.config.define(jg,{colors:[{color:"hsl(0, 0%, 0%)",label:"Black"},{color:"hsl(0, 0%, 30%)",label:"Dim grey"},{color:"hsl(0, 0%, 60%)",label:"Grey"},{color:"hsl(0, 0%, 90%)",label:"Light grey"},{color:"hsl(0, 0%, 100%)",label:"White",hasBorder:!0},{color:"hsl(0, 75%, 60%)",label:"Red"},{color:"hsl(30, 75%, 60%)",label:"Orange"},{color:"hsl(60, 75%, 60%)",label:"Yellow"},{color:"hsl(90, 75%, 60%)",label:"Light green"},{color:"hsl(120, 75%, 60%)",label:"Green"},{color:"hsl(150, 75%, 60%)",label:"Aquamarine"},{color:"hsl(180, 75%, 60%)",label:"Turquoise"},{color:"hsl(210, 75%, 60%)",label:"Light blue"},{color:"hsl(240, 75%, 60%)",label:"Blue"},{color:"hsl(270, 75%, 60%)",label:"Purple"}],columns:5}),e.data.addStyleProcessorRules(ch),e.conversion.for("upcast").elementToAttribute({view:{name:"span",styles:{"background-color":/[\s\S]+/}},model:{key:jg,value:Cg("background-color")}}),e.conversion.for("downcast").attributeToElement({model:jg,view:yg("background-color")}),e.commands.add(jg,new kg(e)),e.model.schema.extend("$text",{allowAttributes:jg}),e.model.schema.setAttributeProperties(jg,{isFormatting:!0,copyOnEnter:!0})}}class wg extends rt{constructor(e,{commandName:t,icon:n,componentName:i,dropdownLabel:s}){super(e),this.commandName=t,this.componentName=i,this.icon=n,this.dropdownLabel=s,this.columns=e.config.get(`${this.componentName}.columns`),this.colorTableView=void 0}init(){const e=this.editor,t=e.locale,n=t.t,i=e.commands.get(this.commandName),s=function(e,t){const n=e.t,i={Black:n("Black"),"Dim grey":n("Dim grey"),Grey:n("Grey"),"Light grey":n("Light grey"),White:n("White"),Red:n("Red"),Orange:n("Orange"),Yellow:n("Yellow"),"Light green":n("Light green"),Green:n("Green"),Aquamarine:n("Aquamarine"),Turquoise:n("Turquoise"),"Light blue":n("Light blue"),Blue:n("Blue"),Purple:n("Purple")};return t.map(e=>{const t=i[e.label];return t&&t!=e.label&&(e.label=t),e})}(t,function(e){return e.map(Ic).filter(e=>!!e)}(e.config.get(this.componentName).colors)),o=e.config.get(`${this.componentName}.documentColors`);e.ui.componentFactory.add(this.componentName,t=>{const r=Yc(t);return this.colorTableView=function({dropdownView:e,colors:t,columns:n,removeButtonLabel:i,documentColorsLabel:s,documentColorsCount:o}){const r=e.locale,a=new vg(r,{colors:t,columns:n,removeButtonLabel:i,documentColorsLabel:s,documentColorsCount:o});return e.colorTableView=a,e.panelView.children.add(a),a.delegate("execute").to(e,"execute"),a}({dropdownView:r,colors:s.map(e=>({label:e.label,color:e.model,options:{hasBorder:e.hasBorder}})),columns:this.columns,removeButtonLabel:n("Remove color"),documentColorsLabel:0!==o?n("Document colors"):void 0,documentColorsCount:void 0===o?this.columns:o}),this.colorTableView.bind("selectedColor").to(i,"value"),r.buttonView.set({label:this.dropdownLabel,icon:this.icon,tooltip:!0}),r.extendTemplate({attributes:{class:"ck-color-ui-dropdown"}}),r.bind("isEnabled").to(i),r.on("execute",(t,n)=>{e.execute(this.commandName,n),e.editing.view.focus()}),r.on("change:isOpen",(t,n,i)=>{r.colorTableView.appendGrids(),i&&(0!==o&&this.colorTableView.updateDocumentColors(e.model,this.componentName),this.colorTableView.updateSelectedColors())}),r})}}class Sg extends wg{constructor(e){const t=e.locale.t;super(e,{commandName:jg,componentName:jg,icon:' ',dropdownLabel:t("Font Background Color")})}static get pluginName(){return"FontBackgroundColorUI"}}class Eg extends _g{constructor(e){super(e,bg)}}class Tg extends rt{static get pluginName(){return"FontColorEditing"}constructor(e){super(e),e.config.define(bg,{colors:[{color:"hsl(0, 0%, 0%)",label:"Black"},{color:"hsl(0, 0%, 30%)",label:"Dim grey"},{color:"hsl(0, 0%, 60%)",label:"Grey"},{color:"hsl(0, 0%, 90%)",label:"Light grey"},{color:"hsl(0, 0%, 100%)",label:"White",hasBorder:!0},{color:"hsl(0, 75%, 60%)",label:"Red"},{color:"hsl(30, 75%, 60%)",label:"Orange"},{color:"hsl(60, 75%, 60%)",label:"Yellow"},{color:"hsl(90, 75%, 60%)",label:"Light green"},{color:"hsl(120, 75%, 60%)",label:"Green"},{color:"hsl(150, 75%, 60%)",label:"Aquamarine"},{color:"hsl(180, 75%, 60%)",label:"Turquoise"},{color:"hsl(210, 75%, 60%)",label:"Light blue"},{color:"hsl(240, 75%, 60%)",label:"Blue"},{color:"hsl(270, 75%, 60%)",label:"Purple"}],columns:5}),e.conversion.for("upcast").elementToAttribute({view:{name:"span",styles:{color:/[\s\S]+/}},model:{key:bg,value:Cg("color")}}),e.conversion.for("upcast").elementToAttribute({view:{name:"font",attributes:{color:/^#?\w+$/}},model:{key:bg,value:e=>e.getAttribute("color")}}),e.conversion.for("downcast").attributeToElement({model:bg,view:yg("color")}),e.commands.add(bg,new Eg(e)),e.model.schema.extend("$text",{allowAttributes:bg}),e.model.schema.setAttributeProperties(bg,{isFormatting:!0,copyOnEnter:!0})}}class zg extends wg{constructor(e){const t=e.locale.t;super(e,{commandName:bg,componentName:bg,icon:' ',dropdownLabel:t("Font Color")})}static get pluginName(){return"FontColorUI"}}class Og extends lt{refresh(){const e=this.editor.model,t=$r(e.document.selection.getSelectedBlocks());this.value=!!t&&t.is("element","paragraph"),this.isEnabled=!!t&&Rg(t,e.schema)}execute(e={}){const t=this.editor.model,n=t.document;t.change(i=>{const s=(e.selection||n.selection).getSelectedBlocks();for(const e of s)!e.is("element","paragraph")&&Rg(e,t.schema)&&i.rename(e,"paragraph")})}}function Rg(e,t){return t.checkChild(e.parent,"paragraph")&&!t.isObject(e)}class $g extends lt{execute(e){const t=this.editor.model,n=e.attributes;let i=e.position;t.change(e=>{const s=e.createElement("paragraph");if(n&&t.schema.setAllowedAttributes(s,n,e),!t.schema.checkChild(i.parent,s)){const n=t.schema.findAllowedParent(i,s);if(!n)return;i=e.split(i,n).position}t.insertContent(s,i),e.setSelection(s,"in")})}}class Dg extends rt{static get pluginName(){return"Paragraph"}init(){const e=this.editor,t=e.model;e.commands.add("paragraph",new Og(e)),e.commands.add("insertParagraph",new $g(e)),t.schema.register("paragraph",{inheritAllFrom:"$block"}),e.conversion.elementToElement({model:"paragraph",view:"p"}),e.conversion.for("upcast").elementToElement({model:(e,{writer:t})=>Dg.paragraphLikeElements.has(e.name)?e.isEmpty?null:t.createElement("paragraph"):null,view:/.+/,converterPriority:"low"})}}Dg.paragraphLikeElements=new Set(["blockquote","dd","div","dt","h1","h2","h3","h4","h5","h6","li","p","td","th"]);class Pg extends lt{constructor(e,t){super(e),this.modelElements=t}refresh(){const e=$r(this.editor.model.document.selection.getSelectedBlocks());this.value=!!e&&this.modelElements.includes(e.name)&&e.name,this.isEnabled=!!e&&this.modelElements.some(t=>Fg(e,t,this.editor.model.schema))}execute(e){const t=this.editor.model,n=t.document,i=e.value;t.change(e=>{const s=Array.from(n.selection.getSelectedBlocks()).filter(e=>Fg(e,i,t.schema));for(const t of s)t.is("element",i)||e.rename(t,i)})}}function Fg(e,t,n){return n.checkChild(e.parent,t)&&!n.isObject(e)}const Mg="paragraph";class Ng extends rt{static get pluginName(){return"HeadingEditing"}constructor(e){super(e),e.config.define("heading",{options:[{model:"paragraph",title:"Paragraph",class:"ck-heading_paragraph"},{model:"heading1",view:"h2",title:"Heading 1",class:"ck-heading_heading1"},{model:"heading2",view:"h3",title:"Heading 2",class:"ck-heading_heading2"},{model:"heading3",view:"h4",title:"Heading 3",class:"ck-heading_heading3"}]})}static get requires(){return[Dg]}init(){const e=this.editor,t=e.config.get("heading.options"),n=[];for(const i of t)i.model!==Mg&&(e.model.schema.register(i.model,{inheritAllFrom:"$block"}),e.conversion.elementToElement(i),n.push(i.model));this._addDefaultH1Conversion(e),e.commands.add("heading",new Pg(e,n))}afterInit(){const e=this.editor,t=e.commands.get("enter"),n=e.config.get("heading.options");t&&this.listenTo(t,"afterExecute",(t,i)=>{const s=e.model.document.selection.getFirstPosition().parent,o=n.some(e=>s.is("element",e.model));o&&!s.is("element",Mg)&&0===s.childCount&&i.writer.rename(s,Mg)})}_addDefaultH1Conversion(e){e.conversion.for("upcast").elementToElement({model:"heading1",view:"h1",converterPriority:d.get("low")+1})}}var Lg=o(230);oo()(Lg.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Lg.Z.locals;class Bg extends rt{static get pluginName(){return"HeadingUI"}init(){const e=this.editor,t=e.t,n=function(e){const t=e.t,n={Paragraph:t("Paragraph"),"Heading 1":t("Heading 1"),"Heading 2":t("Heading 2"),"Heading 3":t("Heading 3"),"Heading 4":t("Heading 4"),"Heading 5":t("Heading 5"),"Heading 6":t("Heading 6")};return e.config.get("heading.options").map(e=>{const t=n[e.title];return t&&t!=e.title&&(e.title=t),e})}(e),i=t("Choose heading"),s=t("Heading");e.ui.componentFactory.add("heading",t=>{const o={},r=new Un,a=e.commands.get("heading"),l=e.commands.get("paragraph"),d=[a];for(const e of n){const t={type:"button",model:new mu({label:e.title,class:e.class,withText:!0})};"paragraph"===e.model?(t.model.bind("isOn").to(l,"value"),t.model.set("commandName","paragraph"),d.push(l)):(t.model.bind("isOn").to(a,"value",t=>t===e.model),t.model.set({commandName:"heading",commandValue:e.model})),r.add(t),o[e.model]=e.title}const c=Yc(t);return Xc(c,r),c.buttonView.set({isOn:!1,withText:!0,tooltip:s}),c.extendTemplate({attributes:{class:["ck-heading-dropdown"]}}),c.bind("isEnabled").toMany(d,"isEnabled",(...e)=>e.some(e=>e)),c.buttonView.bind("label").to(a,"value",l,"value",(e,t)=>{const n=e||t&&"paragraph";return o[n]?o[n]:i}),this.listenTo(c,"execute",t=>{e.execute(t.source.commandName,t.source.commandValue?{value:t.source.commandValue}:void 0),e.editing.view.focus()}),c})}}class Vg{constructor(e){this.set("activeHandlePosition",null),this.set("proposedWidthPercents",null),this.set("proposedWidth",null),this.set("proposedHeight",null),this.set("proposedHandleHostWidth",null),this.set("proposedHandleHostHeight",null),this._options=e,this._referenceCoordinates=null}begin(e,t,n){const i=new Ir(t);this.activeHandlePosition=function(e){const t=["top-left","top-right","bottom-right","bottom-left"];for(const n of t)if(e.classList.contains(Ug(n)))return n}(e),this._referenceCoordinates=function(e,t){const n=new Ir(e),i=t.split("-"),s={x:"right"==i[1]?n.right:n.left,y:"bottom"==i[0]?n.bottom:n.top};return s.x+=e.ownerDocument.defaultView.scrollX,s.y+=e.ownerDocument.defaultView.scrollY,s}(t,function(e){const t=e.split("-"),n={top:"bottom",bottom:"top",left:"right",right:"left"};return`${n[t[0]]}-${n[t[1]]}`}(this.activeHandlePosition)),this.originalWidth=i.width,this.originalHeight=i.height,this.aspectRatio=i.width/i.height;const s=n.style.width;s&&s.match(/^\d+(\.\d*)?%$/)?this.originalWidthPercents=parseFloat(s):this.originalWidthPercents=function(e,t){const n=e.parentElement,i=parseFloat(n.ownerDocument.defaultView.getComputedStyle(n).width);return t.width/i*100}(n,i)}update(e){this.proposedWidth=e.width,this.proposedHeight=e.height,this.proposedWidthPercents=e.widthPercents,this.proposedHandleHostWidth=e.handleHostWidth,this.proposedHandleHostHeight=e.handleHostHeight}}function Ug(e){return`ck-widget__resizer__handle-${e}`}ot(Vg,Qe);class Wg extends Bd{constructor(){super();const e=this.bindTemplate;this.setTemplate({tag:"div",attributes:{class:["ck","ck-size-view",e.to("_viewPosition",e=>e?`ck-orientation-${e}`:"")],style:{display:e.if("_isVisible","none",e=>!e)}},children:[{text:e.to("_label")}]})}_bindToState(e,t){this.bind("_isVisible").to(t,"proposedWidth",t,"proposedHeight",(e,t)=>null!==e&&null!==t),this.bind("_label").to(t,"proposedHandleHostWidth",t,"proposedHandleHostHeight",t,"proposedWidthPercents",(t,n,i)=>"px"===e.unit?`${t}×${n}`:`${i}%`),this.bind("_viewPosition").to(t,"activeHandlePosition",t,"proposedHandleHostWidth",t,"proposedHandleHostHeight",(e,t,n)=>t<50||n<50?"above-center":e)}_dismiss(){this.unbind(),this._isVisible=!1}}class Gg{constructor(e){this._options=e,this._viewResizerWrapper=null,this.set("isEnabled",!0),this.decorate("begin"),this.decorate("cancel"),this.decorate("commit"),this.decorate("updateSize"),this.on("commit",e=>{this.state.proposedWidth||this.state.proposedWidthPercents||(this._cleanup(),e.stop())},{priority:"high"}),this.on("change:isEnabled",()=>{this.isEnabled&&this.redraw()})}attach(){const e=this,t=this._options.viewElement;this._options.editor.editing.view.change(n=>{const i=n.createUIElement("div",{class:"ck ck-reset_all ck-widget__resizer"},function(t){const n=this.toDomElement(t);return e._appendHandles(n),e._appendSizeUI(n),e.on("change:isEnabled",(e,t,i)=>{n.style.display=i?"":"none"}),n.style.display=e.isEnabled?"":"none",n});n.insert(n.createPositionAt(t,"end"),i),n.addClass("ck-widget_with-resizer",t),this._viewResizerWrapper=i})}begin(e){this.state=new Vg(this._options),this._sizeView._bindToState(this._options,this.state),this._initialViewWidth=this._options.viewElement.getStyle("width"),this.state.begin(e,this._getHandleHost(),this._getResizeHost())}updateSize(e){const t=this._proposeNewSize(e);this._options.editor.editing.view.change(e=>{const n=this._options.unit||"%",i=("%"===n?t.widthPercents:t.width)+n;e.setStyle("width",i,this._options.viewElement)});const n=this._getHandleHost(),i=new Ir(n);t.handleHostWidth=Math.round(i.width),t.handleHostHeight=Math.round(i.height);const s=new Ir(n);t.width=Math.round(s.width),t.height=Math.round(s.height),this.redraw(i),this.state.update(t)}commit(){const e=this._options.unit||"%",t=("%"===e?this.state.proposedWidthPercents:this.state.proposedWidth)+e;this._options.editor.editing.view.change(()=>{this._cleanup(),this._options.onCommit(t)})}cancel(){this._cleanup()}destroy(){this.cancel()}redraw(e){const t=this._domResizerWrapper;if(!function(e){return e&&e.ownerDocument&&e.ownerDocument.contains(e)}(t))return;const n=t.parentElement,i=this._getHandleHost(),s=this._viewResizerWrapper,o=[s.getStyle("width"),s.getStyle("height"),s.getStyle("left"),s.getStyle("top")];let r;if(n.isSameNode(i)){const t=e||new Ir(i);r=[t.width+"px",t.height+"px",void 0,void 0]}else r=[i.offsetWidth+"px",i.offsetHeight+"px",i.offsetLeft+"px",i.offsetTop+"px"];"same"!==Xn(o,r)&&this._options.editor.editing.view.change(e=>{e.setStyle({width:r[0],height:r[1],left:r[2],top:r[3]},s)})}containsHandle(e){return this._domResizerWrapper.contains(e)}static isResizeHandle(e){return e.classList.contains("ck-widget__resizer__handle")}_cleanup(){this._sizeView._dismiss(),this._options.editor.editing.view.change(e=>{e.setStyle("width",this._initialViewWidth,this._options.viewElement)})}_proposeNewSize(e){const t=this.state,n=function(e){return{x:e.pageX,y:e.pageY}}(e),i=!this._options.isCentered||this._options.isCentered(this),s={x:t._referenceCoordinates.x-(n.x+t.originalWidth),y:n.y-t.originalHeight-t._referenceCoordinates.y};i&&t.activeHandlePosition.endsWith("-right")&&(s.x=n.x-(t._referenceCoordinates.x+t.originalWidth)),i&&(s.x*=2);const o={width:Math.abs(t.originalWidth+s.x),height:Math.abs(t.originalHeight+s.y)};o.dominant=o.width/t.aspectRatio>o.height?"width":"height",o.max=o[o.dominant];const r={width:o.width,height:o.height};return"width"==o.dominant?r.height=r.width/t.aspectRatio:r.width=r.height*t.aspectRatio,{width:Math.round(r.width),height:Math.round(r.height),widthPercents:Math.min(Math.round(t.originalWidthPercents/t.originalWidth*r.width*100)/100,100)}}_getResizeHost(){const e=this._domResizerWrapper.parentElement;return this._options.getResizeHost(e)}_getHandleHost(){const e=this._domResizerWrapper.parentElement;return this._options.getHandleHost(e)}get _domResizerWrapper(){return this._options.editor.editing.view.domConverter.mapViewToDom(this._viewResizerWrapper)}_appendHandles(e){const t=["top-left","top-right","bottom-right","bottom-left"];for(const n of t)e.appendChild(new Vd({tag:"div",attributes:{class:`ck-widget__resizer__handle ${Hg(n)}`}}).render())}_appendSizeUI(e){this._sizeView=new Wg,this._sizeView.render(),e.appendChild(this._sizeView.element)}}function Hg(e){return`ck-widget__resizer__handle-${e}`}ot(Gg,Qe);var qg=o(263);oo()(qg.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),qg.Z.locals;class Kg extends rt{static get pluginName(){return"WidgetResize"}init(){const e=this.editor.editing,t=ho.window.document;this.set("visibleResizer",null),this.set("_activeResizer",null),this._resizers=new Map,e.view.addObserver(qu),this._observer=Object.create(wo),this.listenTo(e.view.document,"mousedown",this._mouseDownListener.bind(this),{priority:"high"}),this._observer.listenTo(t,"mousemove",this._mouseMoveListener.bind(this)),this._observer.listenTo(t,"mouseup",this._mouseUpListener.bind(this));const n=()=>{this.visibleResizer&&this.visibleResizer.redraw()};this._redrawFocusedResizerThrottled=Hm(n,200),this.on("change:visibleResizer",n),this.editor.ui.on("update",this._redrawFocusedResizerThrottled),this.editor.model.document.on("change",()=>{for(const[e,t]of this._resizers)e.isAttached()||(this._resizers.delete(e),t.destroy())},{priority:"lowest"}),this._observer.listenTo(ho.window,"resize",this._redrawFocusedResizerThrottled);const i=this.editor.editing.view.document.selection;i.on("change",()=>{const e=i.getSelectedElement();this.visibleResizer=this.getResizerByViewElement(e)||null})}destroy(){this._observer.stopListening();for(const e of this._resizers.values())e.destroy();this._redrawFocusedResizerThrottled.cancel()}attachTo(e){const t=new Gg(e),n=this.editor.plugins;if(t.attach(),n.has("WidgetToolbarRepository")){const e=n.get("WidgetToolbarRepository");t.on("begin",()=>{e.forceDisabled("resize")},{priority:"lowest"}),t.on("cancel",()=>{e.clearForceDisabled("resize")},{priority:"highest"}),t.on("commit",()=>{e.clearForceDisabled("resize")},{priority:"highest"})}this._resizers.set(e.viewElement,t);const i=this.editor.editing.view.document.selection.getSelectedElement();return this.getResizerByViewElement(i)==t&&(this.visibleResizer=t),t}getResizerByViewElement(e){return this._resizers.get(e)}_getResizerByHandle(e){for(const t of this._resizers.values())if(t.containsHandle(e))return t}_mouseDownListener(e,t){const n=t.domTarget;Gg.isResizeHandle(n)&&(this._activeResizer=this._getResizerByHandle(n),this._activeResizer&&(this._activeResizer.begin(n),e.stop(),t.preventDefault()))}_mouseMoveListener(e,t){this._activeResizer&&this._activeResizer.updateSize(t)}_mouseUpListener(){this._activeResizer&&(this._activeResizer.commit(),this._activeResizer=null)}}ot(Kg,Qe);class Yg extends lt{refresh(){const e=this.editor.plugins.get("ImageUtils").getClosestSelectedImageElement(this.editor.model.document.selection);this.isEnabled=!!e,this.isEnabled&&e.hasAttribute("alt")?this.value=e.getAttribute("alt"):this.value=!1}execute(e){const t=this.editor,n=t.plugins.get("ImageUtils"),i=t.model,s=n.getClosestSelectedImageElement(i.document.selection);i.change(t=>{t.setAttribute("alt",e.newValue,s)})}}function Zg(e){return e.createContainerElement("figure",{class:"image"},[e.createEmptyElement("img"),e.createSlot()])}function Xg(e,t){const n=e.plugins.get("ImageUtils"),i=e.plugins.has("ImageInlineEditing")&&e.plugins.has("ImageBlockEditing");return e=>n.isInlineImageView(e)?i&&(e.findAncestor(n.isBlockImageView)?"imageBlock":"imageInline")!==t?null:function(e){const t={name:!0};return e.hasAttribute("src")&&(t.attributes=["src"]),t}(e):null}function Jg(e,t){const n=$r(t.getSelectedBlocks());return!n||e.isObject(n)||n.isEmpty&&"listItem"!=n.name?"imageBlock":"imageInline"}class Qg extends rt{static get pluginName(){return"ImageUtils"}isImage(e){return this.isInlineImage(e)||this.isBlockImage(e)}isInlineImageView(e){return!!e&&e.is("element","img")}isBlockImageView(e){return!!e&&e.is("element","figure")&&e.hasClass("image")}insertImage(e={},t=null,n=null){const i=this.editor,s=i.model,o=s.document.selection;n=ep(i,t||o,n),e={...Object.fromEntries(o.getAttributes()),...e};for(const t in e)s.schema.checkAttribute(n,t)||delete e[t];return s.change(i=>{const o=i.createElement(n,e);return s.insertObject(o,t,null,{setSelection:"on",findOptimalPosition:!t&&"imageInline"!=n}),o.parent?o:null})}getClosestSelectedImageWidget(e){const t=e.getSelectedElement();if(t&&this.isImageWidget(t))return t;let n=e.getFirstPosition().parent;for(;n;){if(n.is("element")&&this.isImageWidget(n))return n;n=n.parent}return null}getClosestSelectedImageElement(e){const t=e.getSelectedElement();return this.isImage(t)?t:e.getFirstPosition().findAncestor("imageBlock")}isImageAllowed(){const e=this.editor.model.document.selection;return function(e,t){if("imageBlock"==ep(e,t)){const n=function(e,t){const n=function(e,t){const n=e.getSelectedElement();if(n){const i=Dm(e);if(i)return t.createRange(t.createPositionAt(n,i))}return ad(e,t)}(e,t),i=n.start.parent;return i.isEmpty&&!i.is("element","$root")?i.parent:i}(t,e.model);if(e.model.schema.checkChild(n,"imageBlock"))return!0}else if(e.model.schema.checkChild(t.focus,"imageInline"))return!0;return!1}(this.editor,e)&&function(e){return[...e.focus.getAncestors()].every(e=>!e.is("element","imageBlock"))}(e)}toImageWidget(e,t,n){return t.setCustomProperty("image",!0,e),Sm(e,t,{label:()=>{const t=this.findViewImgElement(e).getAttribute("alt");return t?`${t} ${n}`:n}})}isImageWidget(e){return!!e.getCustomProperty("image")&&wm(e)}isBlockImage(e){return!!e&&e.is("element","imageBlock")}isInlineImage(e){return!!e&&e.is("element","imageInline")}findViewImgElement(e){if(this.isInlineImageView(e))return e;const t=this.editor.editing.view;for(const{item:n}of t.createRangeIn(e))if(this.isInlineImageView(n))return n}}function ep(e,t,n){const i=e.model.schema,s=e.config.get("image.insert.type");return e.plugins.has("ImageBlockEditing")?e.plugins.has("ImageInlineEditing")?n||("inline"===s?"imageInline":"block"===s?"imageBlock":t.is("selection")?Jg(i,t):i.checkChild(t,"imageInline")?"imageInline":"imageBlock"):"imageBlock":"imageInline"}class tp extends rt{static get requires(){return[Qg]}static get pluginName(){return"ImageTextAlternativeEditing"}init(){this.editor.commands.add("imageTextAlternative",new Yg(this.editor))}}var np=o(831);oo()(np.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),np.Z.locals;var ip=o(590);oo()(ip.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),ip.Z.locals;class sp extends Bd{constructor(e){super(e);const t=this.locale.t;this.focusTracker=new Dr,this.keystrokes=new Pr,this.labeledInput=this._createLabeledInputView(),this.saveButtonView=this._createButton(t("Save"),Dd,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(t("Cancel"),$d,"ck-button-cancel","cancel"),this._focusables=new Nd,this._focusCycler=new jc({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"form",attributes:{class:["ck","ck-text-alternative-form","ck-responsive-form"],tabindex:"-1"},children:[this.labeledInput,this.saveButtonView,this.cancelButtonView]}),Fd(this)}render(){super.render(),this.keystrokes.listenTo(this.element),Md({view:this}),[this.labeledInput,this.saveButtonView,this.cancelButtonView].forEach(e=>{this._focusables.add(e),this.focusTracker.add(e.element)})}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}_createButton(e,t,n,i){const s=new fc(this.locale);return s.set({label:e,icon:t,tooltip:!0}),s.extendTemplate({attributes:{class:n}}),i&&s.delegate("execute").to(this,i),s}_createLabeledInputView(){const e=this.locale.t,t=new cu(this.locale,uu);return t.label=e("Text alternative"),t}}function op(e){const t=e.editing.view,n=xu.defaultPositions,i=e.plugins.get("ImageUtils");return{target:t.domConverter.viewToDom(i.getClosestSelectedImageWidget(t.document.selection)),positions:[n.northArrowSouth,n.northArrowSouthWest,n.northArrowSouthEast,n.southArrowNorth,n.southArrowNorthWest,n.southArrowNorthEast,n.viewportStickyNorth]}}class rp extends rt{static get requires(){return[Cu]}static get pluginName(){return"ImageTextAlternativeUI"}init(){this._createButton(),this._createForm()}destroy(){super.destroy(),this._form.destroy()}_createButton(){const e=this.editor,t=e.t;e.ui.componentFactory.add("imageTextAlternative",n=>{const i=e.commands.get("imageTextAlternative"),s=new fc(n);return s.set({label:t("Change image text alternative"),icon:' ',tooltip:!0}),s.bind("isEnabled").to(i,"isEnabled"),this.listenTo(s,"execute",()=>{this._showForm()}),s})}_createForm(){const e=this.editor,t=e.editing.view.document,n=e.plugins.get("ImageUtils");this._balloon=this.editor.plugins.get("ContextualBalloon"),this._form=new sp(e.locale),this._form.render(),this.listenTo(this._form,"submit",()=>{e.execute("imageTextAlternative",{newValue:this._form.labeledInput.fieldView.element.value}),this._hideForm(!0)}),this.listenTo(this._form,"cancel",()=>{this._hideForm(!0)}),this._form.keystrokes.set("Esc",(e,t)=>{this._hideForm(!0),t()}),this.listenTo(e.ui,"update",()=>{n.getClosestSelectedImageWidget(t.selection)?this._isVisible&&function(e){const t=e.plugins.get("ContextualBalloon");if(e.plugins.get("ImageUtils").getClosestSelectedImageWidget(e.editing.view.document.selection)){const n=op(e);t.updatePosition(n)}}(e):this._hideForm(!0)}),Pd({emitter:this._form,activator:()=>this._isVisible,contextElements:[this._balloon.view.element],callback:()=>this._hideForm()})}_showForm(){if(this._isVisible)return;const e=this.editor,t=e.commands.get("imageTextAlternative"),n=this._form.labeledInput;this._form.disableCssTransitions(),this._isInBalloon||this._balloon.add({view:this._form,position:op(e)}),n.fieldView.value=n.fieldView.element.value=t.value||"",this._form.labeledInput.fieldView.select(),this._form.enableCssTransitions()}_hideForm(e){this._isInBalloon&&(this._form.focusTracker.isFocused&&this._form.saveButtonView.focus(),this._balloon.remove(this._form),e&&this.editor.editing.view.focus())}get _isVisible(){return this._balloon.visibleView===this._form}get _isInBalloon(){return this._balloon.hasView(this._form)}}class ap extends rt{static get requires(){return[tp,rp]}static get pluginName(){return"ImageTextAlternative"}}function lp(e,t){return e=>{e.on(`attribute:srcset:${t}`,n)};function n(t,n,i){if(!i.consumable.consume(n.item,t.name))return;const s=i.writer,o=i.mapper.toViewElement(n.item),r=e.findViewImgElement(o);if(null===n.attributeNewValue){const e=n.attributeOldValue;e.data&&(s.removeAttribute("srcset",r),s.removeAttribute("sizes",r),e.width&&s.removeAttribute("width",r))}else{const e=n.attributeNewValue;e.data&&(s.setAttribute("srcset",e.data,r),s.setAttribute("sizes","100vw",r),e.width&&s.setAttribute("width",e.width,r))}}}function dp(e,t,n){return e=>{e.on(`attribute:${n}:${t}`,i)};function i(t,n,i){if(!i.consumable.consume(n.item,t.name))return;const s=i.writer,o=i.mapper.toViewElement(n.item),r=e.findViewImgElement(o);s.setAttribute(n.attributeKey,n.attributeNewValue||"",r)}}class cp extends To{observe(e){this.listenTo(e,"load",(e,t)=>{const n=t.target;this.checkShouldIgnoreEventFromTarget(n)||"IMG"==n.tagName&&this._fireEvents(t)},{useCapture:!0})}_fireEvents(e){this.isEnabled&&(this.document.fire("layoutChanged"),this.document.fire("imageLoaded",e))}}class up extends lt{constructor(e){super(e);const t=e.config.get("image.insert.type");e.plugins.has("ImageBlockEditing")||"block"===t&&h("image-block-plugin-required"),e.plugins.has("ImageInlineEditing")||"inline"===t&&h("image-inline-plugin-required")}refresh(){this.isEnabled=this.editor.plugins.get("ImageUtils").isImageAllowed()}execute(e){const t=Gn(e.source),n=this.editor.model.document.selection,i=this.editor.plugins.get("ImageUtils"),s=Object.fromEntries(n.getAttributes());t.forEach((e,t)=>{const o=n.getSelectedElement();if("string"==typeof e&&(e={src:e}),t&&o&&i.isImage(o)){const t=this.editor.model.createPositionAfter(o);i.insertImage({...e,...s},t)}else i.insertImage({...e,...s})})}}class hp extends rt{static get requires(){return[Qg]}static get pluginName(){return"ImageEditing"}init(){const e=this.editor,t=e.conversion;e.editing.view.addObserver(cp),t.for("upcast").attributeToAttribute({view:{name:"img",key:"alt"},model:"alt"}).attributeToAttribute({view:{name:"img",key:"srcset"},model:{key:"srcset",value:e=>{const t={data:e.getAttribute("srcset")};return e.hasAttribute("width")&&(t.width=e.getAttribute("width")),t}}});const n=new up(e);e.commands.add("insertImage",n),e.commands.add("imageInsert",n)}}class mp extends lt{constructor(e,t){super(e),this._modelElementName=t}refresh(){const e=this.editor.plugins.get("ImageUtils"),t=e.getClosestSelectedImageElement(this.editor.model.document.selection);"imageBlock"===this._modelElementName?this.isEnabled=e.isInlineImage(t):this.isEnabled=e.isBlockImage(t)}execute(){const e=this.editor,t=this.editor.model,n=e.plugins.get("ImageUtils"),i=n.getClosestSelectedImageElement(t.document.selection),s=Object.fromEntries(i.getAttributes());return s.src||s.uploadId?t.change(e=>{const o=Array.from(t.markers).filter(e=>e.getRange().containsItem(i)),r=n.insertImage(s,t.createSelection(i,"on"),this._modelElementName);if(!r)return null;const a=e.createRangeOn(r);for(const t of o){const n=t.getRange(),i="$graveyard"!=n.root.rootName?n.getJoined(a,!0):a;e.updateMarker(t,{range:i})}return{oldElement:i,newElement:r}}):null}}class gp extends rt{static get requires(){return[hp,Qg,bm]}static get pluginName(){return"ImageBlockEditing"}init(){const e=this.editor;e.model.schema.register("imageBlock",{inheritAllFrom:"$blockObject",allowAttributes:["alt","src","srcset"]}),this._setupConversion(),e.plugins.has("ImageInlineEditing")&&(e.commands.add("imageTypeBlock",new mp(this.editor,"imageBlock")),this._setupClipboardIntegration())}_setupConversion(){const e=this.editor,t=e.t,n=e.conversion,i=e.plugins.get("ImageUtils");n.for("dataDowncast").elementToStructure({model:"imageBlock",view:(e,{writer:t})=>Zg(t)}),n.for("editingDowncast").elementToStructure({model:"imageBlock",view:(e,{writer:n})=>i.toImageWidget(Zg(n),n,t("image widget"))}),n.for("downcast").add(dp(i,"imageBlock","src")).add(dp(i,"imageBlock","alt")).add(lp(i,"imageBlock")),n.for("upcast").elementToElement({view:Xg(e,"imageBlock"),model:(e,{writer:t})=>t.createElement("imageBlock",e.hasAttribute("src")?{src:e.getAttribute("src")}:null)}).add(function(e){return e=>{e.on("element:figure",t)};function t(t,n,i){if(!i.consumable.test(n.viewItem,{name:!0,classes:"image"}))return;const s=e.findViewImgElement(n.viewItem);if(!s||!i.consumable.test(s,{name:!0}))return;i.consumable.consume(n.viewItem,{name:!0,classes:"image"});const o=$r(i.convertItem(s,n.modelCursor).modelRange.getItems());o?(i.convertChildren(n.viewItem,o),i.updateConversionResult(o,n)):i.consumable.revert(n.viewItem,{name:!0,classes:"image"})}}(i))}_setupClipboardIntegration(){const e=this.editor,t=e.model,n=e.editing.view,i=e.plugins.get("ImageUtils");this.listenTo(e.plugins.get("ClipboardPipeline"),"inputTransformation",(s,o)=>{const r=Array.from(o.content.getChildren());let a;if(!r.every(i.isInlineImageView))return;a=o.targetRanges?e.editing.mapper.toModelRange(o.targetRanges[0]):t.document.selection.getFirstRange();const l=t.createSelection(a);if("imageBlock"===Jg(t.schema,l)){const e=new Ku(n.document),t=r.map(t=>e.createElement("figure",{class:"image"},t));o.content=e.createDocumentFragment(t)}})}}var pp=o(48);oo()(pp.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),pp.Z.locals;class fp extends rt{static get requires(){return[gp,Wm,ap]}static get pluginName(){return"ImageBlock"}}class _p extends rt{static get requires(){return[hp,Qg,bm]}static get pluginName(){return"ImageInlineEditing"}init(){const e=this.editor,t=e.model.schema;t.register("imageInline",{inheritAllFrom:"$inlineObject",allowAttributes:["alt","src","srcset"]}),t.addChildCheck((e,t)=>{if(e.endsWith("caption")&&"imageInline"===t.name)return!1}),this._setupConversion(),e.plugins.has("ImageBlockEditing")&&(e.commands.add("imageTypeInline",new mp(this.editor,"imageInline")),this._setupClipboardIntegration())}_setupConversion(){const e=this.editor,t=e.t,n=e.conversion,i=e.plugins.get("ImageUtils");n.for("dataDowncast").elementToElement({model:"imageInline",view:(e,{writer:t})=>t.createEmptyElement("img")}),n.for("editingDowncast").elementToStructure({model:"imageInline",view:(e,{writer:n})=>i.toImageWidget(function(e){return e.createContainerElement("span",{class:"image-inline"},e.createEmptyElement("img"))}(n),n,t("image widget"))}),n.for("downcast").add(dp(i,"imageInline","src")).add(dp(i,"imageInline","alt")).add(lp(i,"imageInline")),n.for("upcast").elementToElement({view:Xg(e,"imageInline"),model:(e,{writer:t})=>t.createElement("imageInline",e.hasAttribute("src")?{src:e.getAttribute("src")}:null)})}_setupClipboardIntegration(){const e=this.editor,t=e.model,n=e.editing.view,i=e.plugins.get("ImageUtils");this.listenTo(e.plugins.get("ClipboardPipeline"),"inputTransformation",(s,o)=>{const r=Array.from(o.content.getChildren());let a;if(!r.every(i.isBlockImageView))return;a=o.targetRanges?e.editing.mapper.toModelRange(o.targetRanges[0]):t.document.selection.getFirstRange();const l=t.createSelection(a);if("imageInline"===Jg(t.schema,l)){const e=new Ku(n.document),t=r.map(t=>1===t.childCount?(Array.from(t.getAttributes()).forEach(n=>e.setAttribute(...n,i.findViewImgElement(t))),t.getChild(0)):t);o.content=e.createDocumentFragment(t)}})}}class xp extends rt{static get requires(){return[_p,Wm,ap]}static get pluginName(){return"ImageInline"}}class Ip extends lt{refresh(){const e=this.editor,t=e.plugins.get("ImageUtils").getClosestSelectedImageElement(e.model.document.selection);this.isEnabled=!!t,t&&t.hasAttribute("width")?this.value={width:t.getAttribute("width"),height:null}:this.value=null}execute(e){const t=this.editor,n=t.model,i=t.plugins.get("ImageUtils").getClosestSelectedImageElement(n.document.selection);this.value={width:e.width,height:null},i&&n.change(t=>{t.setAttribute("width",e.width,i)})}}class vp extends rt{static get requires(){return[Qg]}static get pluginName(){return"ImageResizeEditing"}constructor(e){super(e),e.config.define("image",{resizeUnit:"%",resizeOptions:[{name:"resizeImage:original",value:null,icon:"original"},{name:"resizeImage:25",value:"25",icon:"small"},{name:"resizeImage:50",value:"50",icon:"medium"},{name:"resizeImage:75",value:"75",icon:"large"}]})}init(){const e=this.editor,t=new Ip(e);this._registerSchema(),this._registerConverters("imageBlock"),this._registerConverters("imageInline"),e.commands.add("resizeImage",t),e.commands.add("imageResize",t)}_registerSchema(){this.editor.plugins.has("ImageBlockEditing")&&this.editor.model.schema.extend("imageBlock",{allowAttributes:"width"}),this.editor.plugins.has("ImageInlineEditing")&&this.editor.model.schema.extend("imageInline",{allowAttributes:"width"})}_registerConverters(e){const t=this.editor;t.conversion.for("downcast").add(t=>t.on(`attribute:width:${e}`,(e,t,n)=>{if(!n.consumable.consume(t.item,e.name))return;const i=n.writer,s=n.mapper.toViewElement(t.item);null!==t.attributeNewValue?(i.setStyle("width",t.attributeNewValue,s),i.addClass("image_resized",s)):(i.removeStyle("width",s),i.removeClass("image_resized",s))})),t.conversion.for("upcast").attributeToAttribute({view:{name:"imageBlock"===e?"figure":"img",styles:{width:/.+/}},model:{key:"width",value:e=>e.getStyle("width")}})}}const bp={small:' ',medium:' ',large:' ',original:' '};class jp extends rt{static get requires(){return[vp]}static get pluginName(){return"ImageResizeButtons"}constructor(e){super(e),this._resizeUnit=e.config.get("image.resizeUnit")}init(){const e=this.editor,t=e.config.get("image.resizeOptions"),n=e.commands.get("resizeImage");this.bind("isEnabled").to(n);for(const e of t)this._registerImageResizeButton(e);this._registerImageResizeDropdown(t)}_registerImageResizeButton(e){const t=this.editor,{name:n,value:i,icon:s}=e,o=i?i+this._resizeUnit:null;t.ui.componentFactory.add(n,n=>{const i=new fc(n),r=t.commands.get("resizeImage"),a=this._getOptionLabelValue(e,!0);if(!bp[s])throw new u("imageresizebuttons-missing-icon",t,e);return i.set({label:a,icon:bp[s],tooltip:a,isToggleable:!0}),i.bind("isEnabled").to(this),i.bind("isOn").to(r,"value",Cp(o)),this.listenTo(i,"execute",()=>{t.execute("resizeImage",{width:o})}),i})}_registerImageResizeDropdown(e){const t=this.editor,n=t.t,i=e.find(e=>!e.value),s=s=>{const o=t.commands.get("resizeImage"),r=Yc(s,Ac),a=r.buttonView;return a.set({tooltip:n("Resize image"),commandValue:i.value,icon:bp.medium,isToggleable:!0,label:this._getOptionLabelValue(i),withText:!0,class:"ck-resize-image-button"}),a.bind("label").to(o,"value",e=>e&&e.width?e.width:this._getOptionLabelValue(i)),r.bind("isOn").to(o),r.bind("isEnabled").to(this),Xc(r,this._getResizeDropdownListItemDefinitions(e,o)),r.listView.ariaLabel=n("Image resize list"),this.listenTo(r,"execute",e=>{t.execute(e.source.commandName,{width:e.source.commandValue}),t.editing.view.focus()}),r};t.ui.componentFactory.add("resizeImage",s),t.ui.componentFactory.add("imageResize",s)}_getOptionLabelValue(e,t){const n=this.editor.t;return e.label?e.label:t?e.value?n("Resize image to %0",e.value+this._resizeUnit):n("Resize image to the original size"):e.value?e.value+this._resizeUnit:n("Original")}_getResizeDropdownListItemDefinitions(e,t){const n=new Un;return e.map(e=>{const i=e.value?e.value+this._resizeUnit:null,s={type:"button",model:new mu({commandName:"resizeImage",commandValue:i,label:this._getOptionLabelValue(e),withText:!0,icon:null})};s.model.bind("isOn").to(t,"value",Cp(i)),n.add(s)}),n}}function Cp(e){return t=>null===e&&t===e||t&&t.width===e}const yp=/(image|image-inline)/,kp="image_resized";class Ap extends rt{static get requires(){return[Kg]}static get pluginName(){return"ImageResizeHandles"}init(){const e=this.editor.commands.get("resizeImage");this.bind("isEnabled").to(e),this._setupResizerCreator()}_setupResizerCreator(){const e=this.editor,t=e.editing.view;t.addObserver(cp),this.listenTo(t.document,"imageLoaded",(n,i)=>{if(!i.target.matches("figure.image.ck-widget > img,figure.image.ck-widget > picture > img,figure.image.ck-widget > a > img,figure.image.ck-widget > a > picture > img,span.image-inline.ck-widget > img,span.image-inline.ck-widget > picture > img"))return;const s=e.editing.view.domConverter,o=s.domToView(i.target).findAncestor({classes:yp});let r=this.editor.plugins.get(Kg).getResizerByViewElement(o);if(r)return void r.redraw();const a=e.editing.mapper,l=a.toModelElement(o);r=e.plugins.get(Kg).attachTo({unit:e.config.get("image.resizeUnit"),modelElement:l,viewElement:o,editor:e,getHandleHost:e=>e.querySelector("img"),getResizeHost:()=>s.viewToDom(a.toViewElement(l.parent)),isCentered(){const e=l.getAttribute("imageStyle");return!e||"block"==e||"alignCenter"==e},onCommit(n){t.change(e=>{e.removeClass(kp,o)}),e.execute("resizeImage",{width:n})}}),r.on("updateSize",()=>{o.hasClass(kp)||t.change(e=>{e.addClass(kp,o)})}),r.bind("isEnabled").to(this)})}}var wp=o(43);oo()(wp.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),wp.Z.locals;class Sp{constructor(){const e=new window.FileReader;this._reader=e,this._data=void 0,this.set("loaded",0),e.onprogress=e=>{this.loaded=e.loaded}}get error(){return this._reader.error}get data(){return this._data}read(e){const t=this._reader;return this.total=e.size,new Promise((n,i)=>{t.onload=()=>{const e=t.result;this._data=e,n(e)},t.onerror=()=>{i("error")},t.onabort=()=>{i("aborted")},this._reader.readAsDataURL(e)})}abort(){this._reader.abort()}}ot(Sp,Qe);class Ep extends rt{static get pluginName(){return"FileRepository"}static get requires(){return[Rd]}init(){this.loaders=new Un,this.loaders.on("add",()=>this._updatePendingAction()),this.loaders.on("remove",()=>this._updatePendingAction()),this._loadersMap=new Map,this._pendingAction=null,this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",(e,t)=>t?e/t*100:0)}getLoader(e){return this._loadersMap.get(e)||null}createLoader(e){if(!this.createUploadAdapter)return h("filerepository-no-upload-adapter"),null;const t=new Tp(Promise.resolve(e),this.createUploadAdapter);return this.loaders.add(t),this._loadersMap.set(e,t),e instanceof Promise&&t.file.then(e=>{this._loadersMap.set(e,t)}).catch(()=>{}),t.on("change:uploaded",()=>{let e=0;for(const t of this.loaders)e+=t.uploaded;this.uploaded=e}),t.on("change:uploadTotal",()=>{let e=0;for(const t of this.loaders)t.uploadTotal&&(e+=t.uploadTotal);this.uploadTotal=e}),t}destroyLoader(e){const t=e instanceof Tp?e:this.getLoader(e);t._destroy(),this.loaders.remove(t),this._loadersMap.forEach((e,n)=>{e===t&&this._loadersMap.delete(n)})}_updatePendingAction(){const e=this.editor.plugins.get(Rd);if(this.loaders.length){if(!this._pendingAction){const t=this.editor.t,n=e=>`${t("Upload in progress")} ${parseInt(e)}%.`;this._pendingAction=e.add(n(this.uploadedPercent)),this._pendingAction.bind("message").to(this,"uploadedPercent",n)}}else e.remove(this._pendingAction),this._pendingAction=null}}ot(Ep,Qe);class Tp{constructor(e,t){this.id=a(),this._filePromiseWrapper=this._createFilePromiseWrapper(e),this._adapter=t(this),this._reader=new Sp,this.set("status","idle"),this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",(e,t)=>t?e/t*100:0),this.set("uploadResponse",null)}get file(){return this._filePromiseWrapper?this._filePromiseWrapper.promise.then(e=>this._filePromiseWrapper?e:null):Promise.resolve(null)}get data(){return this._reader.data}read(){if("idle"!=this.status)throw new u("filerepository-read-wrong-status",this);return this.status="reading",this.file.then(e=>this._reader.read(e)).then(e=>{if("reading"!==this.status)throw this.status;return this.status="idle",e}).catch(e=>{if("aborted"===e)throw this.status="aborted","aborted";throw this.status="error",this._reader.error?this._reader.error:e})}upload(){if("idle"!=this.status)throw new u("filerepository-upload-wrong-status",this);return this.status="uploading",this.file.then(()=>this._adapter.upload()).then(e=>(this.uploadResponse=e,this.status="idle",e)).catch(e=>{if("aborted"===this.status)throw"aborted";throw this.status="error",e})}abort(){const e=this.status;this.status="aborted",this._filePromiseWrapper.isFulfilled?"reading"==e?this._reader.abort():"uploading"==e&&this._adapter.abort&&this._adapter.abort():(this._filePromiseWrapper.promise.catch(()=>{}),this._filePromiseWrapper.rejecter("aborted")),this._destroy()}_destroy(){this._filePromiseWrapper=void 0,this._reader=void 0,this._adapter=void 0,this.uploadResponse=void 0}_createFilePromiseWrapper(e){const t={};return t.promise=new Promise((n,i)=>{t.rejecter=i,t.isFulfilled=!1,e.then(e=>{t.isFulfilled=!0,n(e)}).catch(e=>{t.isFulfilled=!0,i(e)})}),t}}ot(Tp,Qe);class zp extends Bd{constructor(e){super(e),this.buttonView=new fc(e),this._fileInputView=new Op(e),this._fileInputView.bind("acceptedType").to(this),this._fileInputView.bind("allowMultipleFiles").to(this),this._fileInputView.delegate("done").to(this),this.setTemplate({tag:"span",attributes:{class:"ck-file-dialog-button"},children:[this.buttonView,this._fileInputView]}),this.buttonView.on("execute",()=>{this._fileInputView.open()})}focus(){this.buttonView.focus()}}class Op extends Bd{constructor(e){super(e),this.set("acceptedType"),this.set("allowMultipleFiles",!1);const t=this.bindTemplate;this.setTemplate({tag:"input",attributes:{class:["ck-hidden"],type:"file",tabindex:"-1",accept:t.to("acceptedType"),multiple:t.to("allowMultipleFiles")},on:{change:t.to(()=>{this.element&&this.element.files&&this.element.files.length&&this.fire("done",this.element.files),this.element.value=""})}})}open(){this.element.click()}}class Rp{constructor(e,t){this.loader=e,this.options=t}upload(){return this.loader.file.then(e=>new Promise((t,n)=>{this._initRequest(),this._initListeners(t,n,e),this._sendRequest(e)}))}abort(){this.xhr&&this.xhr.abort()}_initRequest(){const e=this.xhr=new XMLHttpRequest;e.open("POST",this.options.uploadUrl,!0),e.responseType="json"}_initListeners(e,t,n){const i=this.xhr,s=this.loader,o=`Couldn't upload file: ${n.name}.`;i.addEventListener("error",()=>t(o)),i.addEventListener("abort",()=>t()),i.addEventListener("load",()=>{const n=i.response;if(!n||n.error)return t(n&&n.error&&n.error.message?n.error.message:o);const s=n.url?{default:n.url}:n.urls;e({...n,urls:s})}),i.upload&&i.upload.addEventListener("progress",e=>{e.lengthComputable&&(s.uploadTotal=e.total,s.uploaded=e.loaded)})}_sendRequest(e){const t=this.options.headers||{},n=this.options.withCredentials||!1;for(const e of Object.keys(t))this.xhr.setRequestHeader(e,t[e]);this.xhr.withCredentials=n;const i=new FormData;i.append("upload",e),this.xhr.send(i)}}function $p(e){const t=e.map(e=>e.replace("+","\\+"));return new RegExp(`^image\\/(${t.join("|")})$`)}function Dp(e){return new Promise((t,n)=>{const i=e.getAttribute("src");fetch(i).then(e=>e.blob()).then(e=>{const n=Pp(e,i),s=n.replace("image/",""),o=new File([e],`image.${s}`,{type:n});t(o)}).catch(e=>e&&"TypeError"===e.name?function(e){return function(e){return new Promise((t,n)=>{const i=ho.document.createElement("img");i.addEventListener("load",()=>{const e=ho.document.createElement("canvas");e.width=i.width,e.height=i.height,e.getContext("2d").drawImage(i,0,0),e.toBlob(e=>e?t(e):n())}),i.addEventListener("error",()=>n()),i.src=e})}(e).then(t=>{const n=Pp(t,e),i=n.replace("image/","");return new File([t],`image.${i}`,{type:n})})}(i).then(t).catch(n):n(e))})}function Pp(e,t){return e.type?e.type:t.match(/data:(image\/\w+);base64/)?t.match(/data:(image\/\w+);base64/)[1].toLowerCase():"image/jpeg"}class Fp extends rt{static get pluginName(){return"ImageUploadUI"}init(){const e=this.editor,t=e.t,n=n=>{const i=new zp(n),s=e.commands.get("uploadImage"),o=e.config.get("image.upload.types"),r=$p(o);return i.set({acceptedType:o.map(e=>`image/${e}`).join(","),allowMultipleFiles:!0}),i.buttonView.set({label:t("Insert image"),icon:' ',tooltip:!0}),i.buttonView.bind("isEnabled").to(s),i.on("done",(t,n)=>{const i=Array.from(n).filter(e=>r.test(e.type));i.length&&e.execute("uploadImage",{file:i})}),i};e.ui.componentFactory.add("uploadImage",n),e.ui.componentFactory.add("imageUpload",n)}}var Mp=o(870);oo()(Mp.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Mp.Z.locals;var Np=o(899);oo()(Np.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Np.Z.locals;var Lp=o(825);oo()(Lp.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Lp.Z.locals;class Bp extends rt{static get pluginName(){return"ImageUploadProgress"}constructor(e){super(e),this.placeholder="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="}init(){const e=this.editor;e.plugins.has("ImageBlockEditing")&&e.editing.downcastDispatcher.on("attribute:uploadStatus:imageBlock",(...e)=>this.uploadStatusChange(...e)),e.plugins.has("ImageInlineEditing")&&e.editing.downcastDispatcher.on("attribute:uploadStatus:imageInline",(...e)=>this.uploadStatusChange(...e))}uploadStatusChange(e,t,n){const i=this.editor,s=t.item,o=s.getAttribute("uploadId");if(!n.consumable.consume(t.item,e.name))return;const r=i.plugins.get("ImageUtils"),a=i.plugins.get(Ep),l=o?t.attributeNewValue:null,d=this.placeholder,c=i.editing.mapper.toViewElement(s),u=n.writer;if("reading"==l)return Vp(c,u),void Up(r,d,c,u);if("uploading"==l){const e=a.loaders.get(o);return Vp(c,u),void(e?(Wp(c,u),function(e,t,n,i){const s=function(e){const t=e.createUIElement("div",{class:"ck-progress-bar"});return e.setCustomProperty("progressBar",!0,t),t}(t);t.insert(t.createPositionAt(e,"end"),s),n.on("change:uploadedPercent",(e,t,n)=>{i.change(e=>{e.setStyle("width",n+"%",s)})})}(c,u,e,i.editing.view),function(e,t,n,i){if(i.data){const s=e.findViewImgElement(t);n.setAttribute("src",i.data,s)}}(r,c,u,e)):Up(r,d,c,u))}"complete"==l&&a.loaders.get(o)&&function(e,t,n){const i=t.createUIElement("div",{class:"ck-image-upload-complete-icon"});t.insert(t.createPositionAt(e,"end"),i),setTimeout(()=>{n.change(e=>e.remove(e.createRangeOn(i)))},3e3)}(c,u,i.editing.view),function(e,t){Hp(e,t,"progressBar")}(c,u),Wp(c,u),function(e,t){t.removeClass("ck-appear",e)}(c,u)}}function Vp(e,t){e.hasClass("ck-appear")||t.addClass("ck-appear",e)}function Up(e,t,n,i){n.hasClass("ck-image-upload-placeholder")||i.addClass("ck-image-upload-placeholder",n);const s=e.findViewImgElement(n);s.getAttribute("src")!==t&&i.setAttribute("src",t,s),Gp(n,"placeholder")||i.insert(i.createPositionAfter(s),function(e){const t=e.createUIElement("div",{class:"ck-upload-placeholder-loader"});return e.setCustomProperty("placeholder",!0,t),t}(i))}function Wp(e,t){e.hasClass("ck-image-upload-placeholder")&&t.removeClass("ck-image-upload-placeholder",e),Hp(e,t,"placeholder")}function Gp(e,t){for(const n of e.getChildren())if(n.getCustomProperty(t))return n}function Hp(e,t,n){const i=Gp(e,n);i&&t.remove(t.createRangeOn(i))}class qp extends lt{refresh(){const e=this.editor,t=e.plugins.get("ImageUtils"),n=e.model.document.selection.getSelectedElement();this.isEnabled=t.isImageAllowed()||t.isImage(n)}execute(e){const t=Gn(e.file),n=this.editor.model.document.selection,i=this.editor.plugins.get("ImageUtils"),s=Object.fromEntries(n.getAttributes());t.forEach((e,t)=>{const o=n.getSelectedElement();if(t&&o&&i.isImage(o)){const t=this.editor.model.createPositionAfter(o);this._uploadImage(e,s,t)}else this._uploadImage(e,s)})}_uploadImage(e,t,n){const i=this.editor,s=i.plugins.get(Ep).createLoader(e),o=i.plugins.get("ImageUtils");s&&o.insertImage({...t,uploadId:s.id},n)}}class Kp extends rt{static get requires(){return[Ep,hu,bm,Qg]}static get pluginName(){return"ImageUploadEditing"}constructor(e){super(e),e.config.define("image",{upload:{types:["jpeg","png","gif","bmp","webp","tiff"]}}),this._uploadImageElements=new Map}init(){const e=this.editor,t=e.model.document,n=e.conversion,i=e.plugins.get(Ep),s=e.plugins.get("ImageUtils"),o=$p(e.config.get("image.upload.types")),r=new qp(e);e.commands.add("uploadImage",r),e.commands.add("imageUpload",r),n.for("upcast").attributeToAttribute({view:{name:"img",key:"uploadId"},model:"uploadId"}),this.listenTo(e.editing.view.document,"clipboardInput",(t,n)=>{if(function(e){return Array.from(e.types).includes("text/html")&&""!==e.getData("text/html")}(n.dataTransfer))return;const i=Array.from(n.dataTransfer.files).filter(e=>!!e&&o.test(e.type));i.length&&(t.stop(),e.model.change(t=>{n.targetRanges&&t.setSelection(n.targetRanges.map(t=>e.editing.mapper.toModelRange(t))),e.model.enqueueChange(()=>{e.execute("uploadImage",{file:i})})}))}),this.listenTo(e.plugins.get("ClipboardPipeline"),"inputTransformation",(t,n)=>{const o=Array.from(e.editing.view.createRangeIn(n.content)).filter(e=>function(e,t){return!(!e.isInlineImageView(t)||!t.getAttribute("src"))&&(t.getAttribute("src").match(/^data:image\/\w+;base64,/g)||t.getAttribute("src").match(/^blob:/g))}(s,e.item)&&!e.item.getAttribute("uploadProcessed")).map(e=>({promise:Dp(e.item),imageElement:e.item}));if(!o.length)return;const r=new Ku(e.editing.view.document);for(const e of o){r.setAttribute("uploadProcessed",!0,e.imageElement);const t=i.createLoader(e.promise);t&&(r.setAttribute("src","",e.imageElement),r.setAttribute("uploadId",t.id,e.imageElement))}}),e.editing.view.document.on("dragover",(e,t)=>{t.preventDefault()}),t.on("change",()=>{const n=t.differ.getChanges({includeChangesInGraveyard:!0}).reverse(),s=new Set;for(const t of n)if("insert"==t.type&&"$text"!=t.name){const n=t.position.nodeAfter,o="$graveyard"==t.position.root.rootName;for(const t of Yp(e,n)){const e=t.getAttribute("uploadId");if(!e)continue;const n=i.loaders.get(e);n&&(o?s.has(e)||n.abort():(s.add(e),this._uploadImageElements.set(e,t),"idle"==n.status&&this._readAndUpload(n)))}}}),this.on("uploadComplete",(e,{imageElement:t,data:n})=>{const i=n.urls?n.urls:n;this.editor.model.change(e=>{e.setAttribute("src",i.default,t),this._parseAndSetSrcsetAttributeOnImage(i,t,e)})},{priority:"low"})}afterInit(){const e=this.editor.model.schema;this.editor.plugins.has("ImageBlockEditing")&&e.extend("imageBlock",{allowAttributes:["uploadId","uploadStatus"]}),this.editor.plugins.has("ImageInlineEditing")&&e.extend("imageInline",{allowAttributes:["uploadId","uploadStatus"]})}_readAndUpload(e){const t=this.editor,n=t.model,i=t.locale.t,s=t.plugins.get(Ep),o=t.plugins.get(hu),r=t.plugins.get("ImageUtils"),a=this._uploadImageElements;return n.enqueueChange({isUndoable:!1},t=>{t.setAttribute("uploadStatus","reading",a.get(e.id))}),e.read().then(()=>{const i=e.upload(),s=a.get(e.id);if(ps.isSafari){const e=t.editing.mapper.toViewElement(s),n=r.findViewImgElement(e);t.editing.view.once("render",()=>{if(!n.parent)return;const e=t.editing.view.domConverter.mapViewToDom(n.parent);if(!e)return;const i=e.style.display;e.style.display="none",e._ckHack=e.offsetHeight,e.style.display=i})}return n.enqueueChange({isUndoable:!1},e=>{e.setAttribute("uploadStatus","uploading",s)}),i}).then(t=>{n.enqueueChange({isUndoable:!1},n=>{const i=a.get(e.id);n.setAttribute("uploadStatus","complete",i),this.fire("uploadComplete",{data:t,imageElement:i})}),l()}).catch(t=>{if("error"!==e.status&&"aborted"!==e.status)throw t;"error"==e.status&&t&&o.showWarning(t,{title:i("Upload failed"),namespace:"upload"}),n.enqueueChange({isUndoable:!1},t=>{t.remove(a.get(e.id))}),l()});function l(){n.enqueueChange({isUndoable:!1},t=>{const n=a.get(e.id);t.removeAttribute("uploadId",n),t.removeAttribute("uploadStatus",n),a.delete(e.id)}),s.destroyLoader(e)}}_parseAndSetSrcsetAttributeOnImage(e,t,n){let i=0;const s=Object.keys(e).filter(e=>{const t=parseInt(e,10);if(!isNaN(t))return i=Math.max(i,t),!0}).map(t=>`${e[t]} ${t}w`).join(", ");""!=s&&n.setAttribute("srcset",{data:s,width:i},t)}}function Yp(e,t){const n=e.plugins.get("ImageUtils");return Array.from(e.model.createRangeOn(t)).filter(e=>n.isImage(e.item)).map(e=>e.item)}const Zp="italic";class Xp extends rt{static get pluginName(){return"ItalicEditing"}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:Zp}),e.model.schema.setAttributeProperties(Zp,{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:Zp,view:"i",upcastAlso:["em",{styles:{"font-style":"italic"}}]}),e.commands.add(Zp,new hm(e,Zp)),e.keystrokes.set("CTRL+I",Zp)}}const Jp="italic";class Qp extends rt{static get pluginName(){return"ItalicUI"}init(){const e=this.editor,t=e.t;e.ui.componentFactory.add(Jp,n=>{const i=e.commands.get(Jp),s=new fc(n);return s.set({label:t("Italic"),icon:' ',keystroke:"CTRL+I",tooltip:!0,isToggleable:!0}),s.bind("isOn","isEnabled").to(i,"value","isEnabled"),this.listenTo(s,"execute",()=>{e.execute(Jp),e.editing.view.focus()}),s})}}class ef{constructor(){this._definitions=new Set}get length(){return this._definitions.size}add(e){Array.isArray(e)?e.forEach(e=>this._definitions.add(e)):this._definitions.add(e)}getDispatcher(){return e=>{e.on("attribute:linkHref",(e,t,n)=>{if(!n.consumable.test(t.item,"attribute:linkHref"))return;if(!t.item.is("selection")&&!n.schema.isInline(t.item))return;const i=n.writer,s=i.document.selection;for(const e of this._definitions){const o=i.createAttributeElement("a",e.attributes,{priority:5});e.classes&&i.addClass(e.classes,o);for(const t in e.styles)i.setStyle(t,e.styles[t],o);i.setCustomProperty("link",!0,o),e.callback(t.attributeNewValue)?t.item.is("selection")?i.wrap(s.getFirstRange(),o):i.wrap(n.mapper.toViewRange(t.range),o):i.unwrap(n.mapper.toViewRange(t.range),o)}},{priority:"high"})}}getDispatcherForLinkedImage(){return e=>{e.on("attribute:linkHref:imageBlock",(e,t,{writer:n,mapper:i})=>{const s=i.toViewElement(t.item),o=Array.from(s.getChildren()).find(e=>"a"===e.name);for(const e of this._definitions){const i=ni(e.attributes);if(e.callback(t.attributeNewValue)){for(const[e,t]of i)"class"===e?n.addClass(t,o):n.setAttribute(e,t,o);e.classes&&n.addClass(e.classes,o);for(const t in e.styles)n.setStyle(t,e.styles[t],o)}else{for(const[e,t]of i)"class"===e?n.removeClass(t,o):n.removeAttribute(e,o);e.classes&&n.removeClass(e.classes,o);for(const t in e.styles)n.removeStyle(t,o)}}})}}}var tf=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");const nf=function(e){return tf.test(e)};var sf="\\ud800-\\udfff",of="["+sf+"]",rf="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",af="\\ud83c[\\udffb-\\udfff]",lf="[^"+sf+"]",df="(?:\\ud83c[\\udde6-\\uddff]){2}",cf="[\\ud800-\\udbff][\\udc00-\\udfff]",uf="(?:"+rf+"|"+af+")?",hf="[\\ufe0e\\ufe0f]?",mf=hf+uf+"(?:\\u200d(?:"+[lf,df,cf].join("|")+")"+hf+uf+")*",gf="(?:"+[lf+rf+"?",rf,df,cf,of].join("|")+")",pf=RegExp(af+"(?="+af+")|"+gf+mf,"g");const ff=function(e){return nf(e)?function(e){return e.match(pf)||[]}(e):function(e){return e.split("")}(e)},_f=function(e){return function(t){t=Ii(t);var n=nf(t)?ff(t):void 0,i=n?n[0]:t.charAt(0),s=n?function(e,t,n){var i=e.length;return n=void 0===n?i:n,!t&&n>=i?e:yi(e,t,n)}(n,1).join(""):t.slice(1);return i[e]()+s}}("toUpperCase"),xf=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,If=/^(?:(?:https?|ftps?|mailto):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))/i,vf=/^[\S]+@((?![-_])(?:[-\w\u00a1-\uffff]{0,63}[^-_]\.))+(?:[a-z\u00a1-\uffff]{2,})$/i,bf=/^((\w+:(\/{2,})?)|(\W))/i,jf="Ctrl+K";function Cf(e,{writer:t}){const n=t.createAttributeElement("a",{href:e},{priority:5});return t.setCustomProperty("link",!0,n),n}function yf(e){return function(e){return e.replace(xf,"").match(If)}(e=String(e))?e:"#"}function kf(e,t){return!!e&&t.checkAttribute(e.name,"linkHref")}function Af(e,t){const n=function(e){return vf.test(e)}(e)?"mailto:":t,i=!!n&&!bf.test(e);return e&&i?n+e:e}function wf(e){window.open(e,"_blank","noopener")}class Sf extends lt{constructor(e){super(e),this.manualDecorators=new Un,this.automaticDecorators=new ef}restoreManualDecoratorStates(){for(const e of this.manualDecorators)e.value=this._getDecoratorStateFromModel(e.id)}refresh(){const e=this.editor.model,t=e.document.selection,n=t.getSelectedElement()||$r(t.getSelectedBlocks());kf(n,e.schema)?(this.value=n.getAttribute("linkHref"),this.isEnabled=e.schema.checkAttribute(n,"linkHref")):(this.value=t.getAttribute("linkHref"),this.isEnabled=e.schema.checkAttributeInSelection(t,"linkHref"));for(const e of this.manualDecorators)e.value=this._getDecoratorStateFromModel(e.id)}execute(e,t={}){const n=this.editor.model,i=n.document.selection,s=[],o=[];for(const e in t)t[e]?s.push(e):o.push(e);n.change(t=>{if(i.isCollapsed){const r=i.getFirstPosition();if(i.hasAttribute("linkHref")){const a=im(r,"linkHref",i.getAttribute("linkHref"),n);t.setAttribute("linkHref",e,a),s.forEach(e=>{t.setAttribute(e,!0,a)}),o.forEach(e=>{t.removeAttribute(e,a)}),t.setSelection(t.createPositionAfter(a.end.nodeBefore))}else if(""!==e){const o=ni(i.getAttributes());o.set("linkHref",e),s.forEach(e=>{o.set(e,!0)});const{end:a}=n.insertContent(t.createText(e,o),r);t.setSelection(a)}["linkHref",...s,...o].forEach(e=>{t.removeSelectionAttribute(e)})}else{const r=n.schema.getValidRanges(i.getRanges(),"linkHref"),a=[];for(const e of i.getSelectedBlocks())n.schema.checkAttribute(e,"linkHref")&&a.push(t.createRangeOn(e));const l=a.slice();for(const e of r)this._isRangeToUpdate(e,a)&&l.push(e);for(const n of l)t.setAttribute("linkHref",e,n),s.forEach(e=>{t.setAttribute(e,!0,n)}),o.forEach(e=>{t.removeAttribute(e,n)})}})}_getDecoratorStateFromModel(e){const t=this.editor.model,n=t.document.selection,i=n.getSelectedElement();return kf(i,t.schema)?i.getAttribute(e):n.getAttribute(e)}_isRangeToUpdate(e,t){for(const n of t)if(n.containsRange(e))return!1;return!0}}class Ef extends lt{refresh(){const e=this.editor.model,t=e.document.selection,n=t.getSelectedElement();kf(n,e.schema)?this.isEnabled=e.schema.checkAttribute(n,"linkHref"):this.isEnabled=e.schema.checkAttributeInSelection(t,"linkHref")}execute(){const e=this.editor,t=this.editor.model,n=t.document.selection,i=e.commands.get("link");t.change(e=>{const s=n.isCollapsed?[im(n.getFirstPosition(),"linkHref",n.getAttribute("linkHref"),t)]:t.schema.getValidRanges(n.getRanges(),"linkHref");for(const t of s)if(e.removeAttribute("linkHref",t),i)for(const n of i.manualDecorators)e.removeAttribute(n.id,t)})}}class Tf{constructor({id:e,label:t,attributes:n,classes:i,styles:s,defaultValue:o}){this.id=e,this.set("value"),this.defaultValue=o,this.label=t,this.attributes=n,this.classes=i,this.styles=s}_createPattern(){return{attributes:this.attributes,classes:this.classes,styles:this.styles}}}ot(Tf,Qe);var zf=o(399);oo()(zf.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),zf.Z.locals;const Of="automatic",Rf=/^(https?:)?\/\//;class $f extends rt{static get pluginName(){return"LinkEditing"}static get requires(){return[Xh,Wh,bm]}constructor(e){super(e),e.config.define("link",{addTargetToExternalLinks:!1})}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:"linkHref"}),e.conversion.for("dataDowncast").attributeToElement({model:"linkHref",view:Cf}),e.conversion.for("editingDowncast").attributeToElement({model:"linkHref",view:(e,t)=>Cf(yf(e),t)}),e.conversion.for("upcast").elementToAttribute({view:{name:"a",attributes:{href:!0}},model:{key:"linkHref",value:e=>e.getAttribute("href")}}),e.commands.add("link",new Sf(e)),e.commands.add("unlink",new Ef(e));const t=function(e,t){const n={"Open in a new tab":e("Open in a new tab"),Downloadable:e("Downloadable")};return t.forEach(e=>(e.label&&n[e.label]&&(e.label=n[e.label]),e)),t}(e.t,function(e){const t=[];if(e)for(const[n,i]of Object.entries(e)){const e=Object.assign({},i,{id:`link${_f(n)}`});t.push(e)}return t}(e.config.get("link.decorators")));this._enableAutomaticDecorators(t.filter(e=>e.mode===Of)),this._enableManualDecorators(t.filter(e=>"manual"===e.mode)),e.plugins.get(Xh).registerAttribute("linkHref"),function(e,t,n,i){const s=e.editing.view,o=new Set;s.document.registerPostFixer(n=>{const s=e.model.document.selection;let r=!1;if(s.hasAttribute(t)){const a=im(s.getFirstPosition(),t,s.getAttribute(t),e.model),l=e.editing.mapper.toViewRange(a);for(const e of l.getItems())e.is("element","a")&&!e.hasClass(i)&&(n.addClass(i,e),o.add(e),r=!0)}return r}),e.conversion.for("editingDowncast").add(e=>{function t(){s.change(e=>{for(const t of o.values())e.removeClass(i,t),o.delete(t)})}e.on("insert",t,{priority:"highest"}),e.on("remove",t,{priority:"highest"}),e.on("attribute",t,{priority:"highest"}),e.on("selection",t,{priority:"highest"})})}(e,"linkHref",0,"ck-link_selected"),this._enableLinkOpen(),this._enableInsertContentSelectionAttributesFixer(),this._enableClickingAfterLink(),this._enableTypingOverLink(),this._handleDeleteContentAfterLink()}_enableAutomaticDecorators(e){const t=this.editor,n=t.commands.get("link").automaticDecorators;t.config.get("link.addTargetToExternalLinks")&&n.add({id:"linkIsExternal",mode:Of,callback:e=>Rf.test(e),attributes:{target:"_blank",rel:"noopener noreferrer"}}),n.add(e),n.length&&t.conversion.for("downcast").add(n.getDispatcher())}_enableManualDecorators(e){if(!e.length)return;const t=this.editor,n=t.commands.get("link").manualDecorators;e.forEach(e=>{t.model.schema.extend("$text",{allowAttributes:e.id}),e=new Tf(e),n.add(e),t.conversion.for("downcast").attributeToElement({model:e.id,view:(t,{writer:n,schema:i},{item:s})=>{if(i.isInline(s)&&t){const t=n.createAttributeElement("a",e.attributes,{priority:5});e.classes&&n.addClass(e.classes,t);for(const i in e.styles)n.setStyle(i,e.styles[i],t);return n.setCustomProperty("link",!0,t),t}}}),t.conversion.for("upcast").elementToAttribute({view:{name:"a",...e._createPattern()},model:{key:e.id}})})}_enableLinkOpen(){const e=this.editor,t=e.editing.view.document,n=e.model.document;this.listenTo(t,"click",(e,t)=>{if(!(ps.isMac?t.domEvent.metaKey:t.domEvent.ctrlKey))return;let n=t.domTarget;if("a"!=n.tagName.toLowerCase()&&(n=n.closest("a")),!n)return;const i=n.getAttribute("href");i&&(e.stop(),t.preventDefault(),wf(i))},{context:"$capture"}),this.listenTo(t,"enter",(e,t)=>{const i=n.selection,s=i.getSelectedElement(),o=s?s.getAttribute("linkHref"):i.getAttribute("linkHref");o&&t.domEvent.altKey&&(e.stop(),wf(o))},{context:"a"})}_enableInsertContentSelectionAttributesFixer(){const e=this.editor.model,t=e.document.selection;this.listenTo(e,"insertContent",()=>{const n=t.anchor.nodeBefore,i=t.anchor.nodeAfter;t.hasAttribute("linkHref")&&n&&n.hasAttribute("linkHref")&&(i&&i.hasAttribute("linkHref")||e.change(t=>{Df(t,Ff(e.schema))}))},{priority:"low"})}_enableClickingAfterLink(){const e=this.editor,t=e.model;e.editing.view.addObserver(qu);let n=!1;this.listenTo(e.editing.view.document,"mousedown",()=>{n=!0}),this.listenTo(e.editing.view.document,"selectionChange",()=>{if(!n)return;n=!1;const e=t.document.selection;if(!e.isCollapsed)return;if(!e.hasAttribute("linkHref"))return;const i=e.getFirstPosition(),s=im(i,"linkHref",e.getAttribute("linkHref"),t);(i.isTouching(s.start)||i.isTouching(s.end))&&t.change(e=>{Df(e,Ff(t.schema))})})}_enableTypingOverLink(){const e=this.editor,t=e.editing.view;let n,i;this.listenTo(t.document,"delete",()=>{i=!0},{priority:"high"}),this.listenTo(e.model,"deleteContent",()=>{const t=e.model.document.selection;t.isCollapsed||(i?i=!1:Pf(e)&&function(e){const t=e.document.selection,n=t.getFirstPosition(),i=t.getLastPosition(),s=n.nodeAfter;if(!s)return!1;if(!s.is("$text"))return!1;if(!s.hasAttribute("linkHref"))return!1;if(s===(i.textNode||i.nodeBefore))return!0;return im(n,"linkHref",s.getAttribute("linkHref"),e).containsRange(e.createRange(n,i),!0)}(e.model)&&(n=t.getAttributes()))},{priority:"high"}),this.listenTo(e.model,"insertContent",(t,[s])=>{i=!1,Pf(e)&&n&&(e.model.change(e=>{for(const[t,i]of n)e.setAttribute(t,i,s)}),n=null)},{priority:"high"})}_handleDeleteContentAfterLink(){const e=this.editor,t=e.model,n=t.document.selection,i=e.editing.view;let s=!1,o=!1;this.listenTo(i.document,"delete",(e,t)=>{o=t.domEvent.keyCode===Is.backspace},{priority:"high"}),this.listenTo(t,"deleteContent",()=>{s=!1;const e=n.getFirstPosition(),i=n.getAttribute("linkHref");if(!i)return;const o=im(e,"linkHref",i,t);s=o.containsPosition(e)||o.end.isEqual(e)},{priority:"high"}),this.listenTo(t,"deleteContent",()=>{o&&(o=!1,s||e.model.enqueueChange(e=>{Df(e,Ff(t.schema))}))},{priority:"low"})}}function Df(e,t){e.removeSelectionAttribute("linkHref");for(const n of t)e.removeSelectionAttribute(n)}function Pf(e){return e.model.change(e=>e.batch).isTyping}function Ff(e){return e.getDefinition("$text").allowAttributes.filter(e=>e.startsWith("link"))}var Mf=o(827);oo()(Mf.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Mf.Z.locals;class Nf extends Bd{constructor(e,t){super(e);const n=e.t;this.focusTracker=new Dr,this.keystrokes=new Pr,this.urlInputView=this._createUrlInput(),this.saveButtonView=this._createButton(n("Save"),Dd,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(n("Cancel"),$d,"ck-button-cancel","cancel"),this._manualDecoratorSwitches=this._createManualDecoratorSwitches(t),this.children=this._createFormChildren(t.manualDecorators),this._focusables=new Nd,this._focusCycler=new jc({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});const i=["ck","ck-link-form","ck-responsive-form"];t.manualDecorators.length&&i.push("ck-link-form_layout-vertical","ck-vertical-form"),this.setTemplate({tag:"form",attributes:{class:i,tabindex:"-1"},children:this.children}),Fd(this)}getDecoratorSwitchesState(){return Array.from(this._manualDecoratorSwitches).reduce((e,t)=>(e[t.name]=t.isOn,e),{})}render(){super.render(),Md({view:this}),[this.urlInputView,...this._manualDecoratorSwitches,this.saveButtonView,this.cancelButtonView].forEach(e=>{this._focusables.add(e),this.focusTracker.add(e.element)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}_createUrlInput(){const e=this.locale.t,t=new cu(this.locale,uu);return t.label=e("Link URL"),t}_createButton(e,t,n,i){const s=new fc(this.locale);return s.set({label:e,icon:t,tooltip:!0}),s.extendTemplate({attributes:{class:n}}),i&&s.delegate("execute").to(this,i),s}_createManualDecoratorSwitches(e){const t=this.createCollection();for(const n of e.manualDecorators){const i=new xc(this.locale);i.set({name:n.id,label:n.label,withText:!0}),i.bind("isOn").toMany([n,e],"value",(e,t)=>void 0===t&&void 0===e?n.defaultValue:e),i.on("execute",()=>{n.set("value",!i.isOn)}),t.add(i)}return t}_createFormChildren(e){const t=this.createCollection();if(t.add(this.urlInputView),e.length){const e=new Bd;e.setTemplate({tag:"ul",children:this._manualDecoratorSwitches.map(e=>({tag:"li",children:[e],attributes:{class:["ck","ck-list__item"]}})),attributes:{class:["ck","ck-reset","ck-list"]}}),t.add(e)}return t.add(this.saveButtonView),t.add(this.cancelButtonView),t}}var Lf=o(465);oo()(Lf.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Lf.Z.locals;class Bf extends Bd{constructor(e){super(e);const t=e.t;this.focusTracker=new Dr,this.keystrokes=new Pr,this.previewButtonView=this._createPreviewButton(),this.unlinkButtonView=this._createButton(t("Unlink"),' ',"unlink"),this.editButtonView=this._createButton(t("Edit link"),' ',"edit"),this.set("href"),this._focusables=new Nd,this._focusCycler=new jc({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-link-actions","ck-responsive-form"],tabindex:"-1"},children:[this.previewButtonView,this.editButtonView,this.unlinkButtonView]})}render(){super.render(),[this.previewButtonView,this.editButtonView,this.unlinkButtonView].forEach(e=>{this._focusables.add(e),this.focusTracker.add(e.element)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}_createButton(e,t,n){const i=new fc(this.locale);return i.set({label:e,icon:t,tooltip:!0}),i.delegate("execute").to(this,n),i}_createPreviewButton(){const e=new fc(this.locale),t=this.bindTemplate,n=this.t;return e.set({withText:!0,tooltip:n("Open link in new tab")}),e.extendTemplate({attributes:{class:["ck","ck-link-actions__preview"],href:t.to("href",e=>e&&yf(e)),target:"_blank",rel:"noopener noreferrer"}}),e.bind("label").to(this,"href",e=>e||n("This link has no URL")),e.bind("isEnabled").to(this,"href",e=>!!e),e.template.tag="a",e.template.eventListeners={},e}}const Vf="link-ui";class Uf extends rt{static get requires(){return[Cu]}static get pluginName(){return"LinkUI"}init(){const e=this.editor;e.editing.view.addObserver(Hu),this.actionsView=this._createActionsView(),this.formView=this._createFormView(),this._balloon=e.plugins.get(Cu),this._createToolbarLinkButton(),this._enableUserBalloonInteractions(),e.conversion.for("editingDowncast").markerToHighlight({model:Vf,view:{classes:["ck-fake-link-selection"]}}),e.conversion.for("editingDowncast").markerToElement({model:Vf,view:{name:"span",classes:["ck-fake-link-selection","ck-fake-link-selection_collapsed"]}})}destroy(){super.destroy(),this.formView.destroy()}_createActionsView(){const e=this.editor,t=new Bf(e.locale),n=e.commands.get("link"),i=e.commands.get("unlink");return t.bind("href").to(n,"value"),t.editButtonView.bind("isEnabled").to(n),t.unlinkButtonView.bind("isEnabled").to(i),this.listenTo(t,"edit",()=>{this._addFormView()}),this.listenTo(t,"unlink",()=>{e.execute("unlink"),this._hideUI()}),t.keystrokes.set("Esc",(e,t)=>{this._hideUI(),t()}),t.keystrokes.set(jf,(e,t)=>{this._addFormView(),t()}),t}_createFormView(){const e=this.editor,t=e.commands.get("link"),n=e.config.get("link.defaultProtocol"),i=new Nf(e.locale,t);return i.urlInputView.fieldView.bind("value").to(t,"value"),i.urlInputView.bind("isReadOnly").to(t,"isEnabled",e=>!e),i.saveButtonView.bind("isEnabled").to(t),this.listenTo(i,"submit",()=>{const{value:t}=i.urlInputView.fieldView.element,s=Af(t,n);e.execute("link",s,i.getDecoratorSwitchesState()),this._closeFormView()}),this.listenTo(i,"cancel",()=>{this._closeFormView()}),i.keystrokes.set("Esc",(e,t)=>{this._closeFormView(),t()}),i}_createToolbarLinkButton(){const e=this.editor,t=e.commands.get("link"),n=e.t;e.keystrokes.set(jf,(e,n)=>{n(),t.isEnabled&&this._showUI(!0)}),e.ui.componentFactory.add("link",e=>{const i=new fc(e);return i.isEnabled=!0,i.label=n("Link"),i.icon=' ',i.keystroke=jf,i.tooltip=!0,i.isToggleable=!0,i.bind("isEnabled").to(t,"isEnabled"),i.bind("isOn").to(t,"value",e=>!!e),this.listenTo(i,"execute",()=>this._showUI(!0)),i})}_enableUserBalloonInteractions(){const e=this.editor.editing.view.document;this.listenTo(e,"click",()=>{this._getSelectedLinkElement()&&this._showUI()}),this.editor.keystrokes.set("Tab",(e,t)=>{this._areActionsVisible&&!this.actionsView.focusTracker.isFocused&&(this.actionsView.focus(),t())},{priority:"high"}),this.editor.keystrokes.set("Esc",(e,t)=>{this._isUIVisible&&(this._hideUI(),t())}),Pd({emitter:this.formView,activator:()=>this._isUIInPanel,contextElements:[this._balloon.view.element],callback:()=>this._hideUI()})}_addActionsView(){this._areActionsInPanel||this._balloon.add({view:this.actionsView,position:this._getBalloonPositionData()})}_addFormView(){if(this._isFormInPanel)return;const e=this.editor.commands.get("link");this.formView.disableCssTransitions(),this._balloon.add({view:this.formView,position:this._getBalloonPositionData()}),this._balloon.visibleView===this.formView&&this.formView.urlInputView.fieldView.select(),this.formView.enableCssTransitions(),this.formView.urlInputView.fieldView.element.value=e.value||""}_closeFormView(){const e=this.editor.commands.get("link");e.restoreManualDecoratorStates(),void 0!==e.value?this._removeFormView():this._hideUI()}_removeFormView(){this._isFormInPanel&&(this.formView.saveButtonView.focus(),this._balloon.remove(this.formView),this.editor.editing.view.focus(),this._hideFakeVisualSelection())}_showUI(e=!1){this._getSelectedLinkElement()?(this._areActionsVisible?this._addFormView():this._addActionsView(),e&&this._balloon.showStack("main")):(this._showFakeVisualSelection(),this._addActionsView(),e&&this._balloon.showStack("main"),this._addFormView()),this._startUpdatingUI()}_hideUI(){if(!this._isUIInPanel)return;const e=this.editor;this.stopListening(e.ui,"update"),this.stopListening(this._balloon,"change:visibleView"),e.editing.view.focus(),this._removeFormView(),this._balloon.remove(this.actionsView),this._hideFakeVisualSelection()}_startUpdatingUI(){const e=this.editor,t=e.editing.view.document;let n=this._getSelectedLinkElement(),i=o();const s=()=>{const e=this._getSelectedLinkElement(),t=o();n&&!e||!n&&t!==i?this._hideUI():this._isUIVisible&&this._balloon.updatePosition(this._getBalloonPositionData()),n=e,i=t};function o(){return t.selection.focus.getAncestors().reverse().find(e=>e.is("element"))}this.listenTo(e.ui,"update",s),this.listenTo(this._balloon,"change:visibleView",s)}get _isFormInPanel(){return this._balloon.hasView(this.formView)}get _areActionsInPanel(){return this._balloon.hasView(this.actionsView)}get _areActionsVisible(){return this._balloon.visibleView===this.actionsView}get _isUIInPanel(){return this._isFormInPanel||this._areActionsInPanel}get _isUIVisible(){return this._balloon.visibleView==this.formView||this._areActionsVisible}_getBalloonPositionData(){const e=this.editor.editing.view,t=this.editor.model,n=e.document;let i=null;if(t.markers.has(Vf)){const t=Array.from(this.editor.editing.mapper.markerNameToElements(Vf)),n=e.createRange(e.createPositionBefore(t[0]),e.createPositionAfter(t[t.length-1]));i=e.domConverter.viewRangeToDom(n)}else i=()=>{const t=this._getSelectedLinkElement();return t?e.domConverter.mapViewToDom(t):e.domConverter.viewRangeToDom(n.selection.getFirstRange())};return{target:i}}_getSelectedLinkElement(){const e=this.editor.editing.view,t=e.document.selection,n=t.getSelectedElement();if(t.isCollapsed||n&&wm(n))return Wf(t.getFirstPosition());{const n=t.getFirstRange().getTrimmed(),i=Wf(n.start),s=Wf(n.end);return i&&i==s&&e.createRangeIn(i).getTrimmed().isEqual(n)?i:null}}_showFakeVisualSelection(){const e=this.editor.model;e.change(t=>{const n=e.document.selection.getFirstRange();if(e.markers.has(Vf))t.updateMarker(Vf,{range:n});else if(n.start.isAtEnd){const i=n.start.getLastMatchingPosition(({item:t})=>!e.schema.isContent(t),{boundaries:n});t.addMarker(Vf,{usingOperation:!1,affectsData:!1,range:t.createRange(i,n.end)})}else t.addMarker(Vf,{usingOperation:!1,affectsData:!1,range:n})})}_hideFakeVisualSelection(){const e=this.editor.model;e.markers.has(Vf)&&e.change(e=>{e.removeMarker(Vf)})}}function Wf(e){return e.getAncestors().find(e=>function(e){return e.is("attributeElement")&&!!e.getCustomProperty("link")}(e))}const Gf=new RegExp("(^|\\s)(((?:(?:(?:https?|ftp):)?\\/\\/)(?:\\S+(?::\\S*)?@)?(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(((?!www\\.)|(www\\.))(?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.)+(?:[a-z\\u00a1-\\uffff]{2,63})))(?::\\d{2,5})?(?:[/?#]\\S*)?)|((www.|(\\S+@))((?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.))+(?:[a-z\\u00a1-\\uffff]{2,63})))$","i");class Hf extends rt{static get requires(){return[qh]}static get pluginName(){return"AutoLink"}init(){const e=this.editor.model.document.selection;e.on("change:range",()=>{this.isEnabled=!e.anchor.parent.is("element","codeBlock")}),this._enableTypingHandling()}afterInit(){this._enableEnterHandling(),this._enableShiftEnterHandling()}_enableTypingHandling(){const e=this.editor,t=new Zh(e.model,e=>{if(!function(e){return e.length>4&&" "===e[e.length-1]&&" "!==e[e.length-2]}(e))return;const t=qf(e.substr(0,e.length-1));return t?{url:t}:void 0});t.on("matched:data",(t,n)=>{const{batch:i,range:s,url:o}=n;if(!i.isTyping)return;const r=s.end.getShiftedBy(-1),a=r.getShiftedBy(-o.length),l=e.model.createRange(a,r);this._applyAutoLink(o,l)}),t.bind("isEnabled").to(this)}_enableEnterHandling(){const e=this.editor,t=e.model,n=e.commands.get("enter");n&&n.on("execute",()=>{const e=t.document.selection.getFirstPosition();if(!e.parent.previousSibling)return;const n=t.createRangeIn(e.parent.previousSibling);this._checkAndApplyAutoLinkOnRange(n)})}_enableShiftEnterHandling(){const e=this.editor,t=e.model,n=e.commands.get("shiftEnter");n&&n.on("execute",()=>{const e=t.document.selection.getFirstPosition(),n=t.createRange(t.createPositionAt(e.parent,0),e.getShiftedBy(-1));this._checkAndApplyAutoLinkOnRange(n)})}_checkAndApplyAutoLinkOnRange(e){const t=this.editor.model,{text:n,range:i}=Yh(e,t),s=qf(n);if(s){const e=t.createRange(i.end.getShiftedBy(-s.length),i.end);this._applyAutoLink(s,e)}}_applyAutoLink(e,t){const n=this.editor.model,i=this.editor.plugins.get("Delete");this.isEnabled&&function(e,t){return t.schema.checkAttributeInSelection(t.createSelection(e),"linkHref")}(t,n)&&n.enqueueChange(s=>{const o=this.editor.config.get("link.defaultProtocol"),r=Af(e,o);s.setAttribute("linkHref",r,t),n.enqueueChange(()=>{i.requestUndoOnBackspace()})})}}function qf(e){const t=Gf.exec(e);return t?t[2]:null}class Kf extends lt{constructor(e,t){super(e),this.type=t}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(e={}){const t=this.editor.model,n=t.document,i=Array.from(n.selection.getSelectedBlocks()).filter(e=>Zf(e,t.schema)),s=void 0!==e.forceValue?!e.forceValue:this.value;t.change(e=>{if(s){let t=i[i.length-1].nextSibling,n=Number.POSITIVE_INFINITY,s=[];for(;t&&"listItem"==t.name&&0!==t.getAttribute("listIndent");){const e=t.getAttribute("listIndent");e=n;)o>s.getAttribute("listIndent")&&(o=s.getAttribute("listIndent")),s.getAttribute("listIndent")==o&&e[t?"unshift":"push"](s),s=s[t?"previousSibling":"nextSibling"]}}function Zf(e,t){return t.checkChild(e.parent,"listItem")&&!t.isObject(e)}class Xf extends lt{constructor(e,t){super(e),this._indentBy="forward"==t?1:-1}refresh(){this.isEnabled=this._checkEnabled()}execute(){const e=this.editor.model,t=e.document;let n=Array.from(t.selection.getSelectedBlocks());e.change(e=>{const t=n[n.length-1];let i=t.nextSibling;for(;i&&"listItem"==i.name&&i.getAttribute("listIndent")>t.getAttribute("listIndent");)n.push(i),i=i.nextSibling;this._indentBy<0&&(n=n.reverse());for(const t of n){const n=t.getAttribute("listIndent")+this._indentBy;n<0?e.rename(t,"paragraph"):e.setAttribute("listIndent",n,t)}this.fire("_executeCleanup",n)})}_checkEnabled(){const e=$r(this.editor.model.document.selection.getSelectedBlocks());if(!e||!e.is("element","listItem"))return!1;if(this._indentBy>0){const t=e.getAttribute("listIndent"),n=e.getAttribute("listType");let i=e.previousSibling;for(;i&&i.is("element","listItem")&&i.getAttribute("listIndent")>=t;){if(i.getAttribute("listIndent")==t)return i.getAttribute("listType")==n;i=i.previousSibling}return!1}return!0}}function Jf(e,t,n,i){const s=t.parent,o=n.mapper,r=n.writer;let a=o.toViewPosition(i.createPositionBefore(e));const l=t_(e.previousSibling,{sameIndent:!0,smallerIndent:!0,listIndent:e.getAttribute("listIndent")}),d=e.previousSibling;if(l&&l.getAttribute("listIndent")==e.getAttribute("listIndent")){const e=o.toViewElement(l);a=r.breakContainer(r.createPositionAfter(e))}else if(d&&"listItem"==d.name){a=o.toViewPosition(i.createPositionAt(d,"end"));const e=o.findMappedViewAncestor(a),t=function(e){for(const t of e.getChildren())if("ul"==t.name||"ol"==t.name)return t;return null}(e);a=t?r.createPositionBefore(t):r.createPositionAt(e,"end")}else a=o.toViewPosition(i.createPositionBefore(e));if(a=e_(a),r.insert(a,s),d&&"listItem"==d.name){const e=o.toViewElement(d),n=r.createRange(r.createPositionAt(e,0),a).getWalker({ignoreElementEnd:!0});for(const e of n)if(e.item.is("element","li")){const i=r.breakContainer(r.createPositionBefore(e.item)),s=e.item.parent,o=r.createPositionAt(t,"end");Qf(r,o.nodeBefore,o.nodeAfter),r.move(r.createRangeOn(s),o),n.position=i}}else{const n=s.nextSibling;if(n&&(n.is("element","ul")||n.is("element","ol"))){let i=null;for(const t of n.getChildren()){const n=o.toModelElement(t);if(!(n&&n.getAttribute("listIndent")>e.getAttribute("listIndent")))break;i=t}i&&(r.breakContainer(r.createPositionAfter(i)),r.move(r.createRangeOn(i.parent),r.createPositionAt(t,"end")))}}Qf(r,s,s.nextSibling),Qf(r,s.previousSibling,s)}function Qf(e,t,n){return!t||!n||"ul"!=t.name&&"ol"!=t.name||t.name!=n.name||t.getAttribute("class")!==n.getAttribute("class")?null:e.mergeContainers(e.createPositionAfter(t))}function e_(e){return e.getLastMatchingPosition(e=>e.item.is("uiElement"))}function t_(e,t){const n=!!t.sameIndent,i=!!t.smallerIndent,s=t.listIndent;let o=e;for(;o&&"listItem"==o.name;){const e=o.getAttribute("listIndent");if(n&&s==e||i&&s>e)return o;o="forward"===t.direction?o.nextSibling:o.previousSibling}return null}function n_(e,t,n,i){e.ui.componentFactory.add(t,s=>{const o=e.commands.get(t),r=new fc(s);return r.set({label:n,icon:i,tooltip:!0,isToggleable:!0}),r.bind("isOn","isEnabled").to(o,"value","isEnabled"),r.on("execute",()=>{e.execute(t),e.editing.view.focus()}),r})}function i_(){const e=!this.isEmpty&&("ul"==this.getChild(0).name||"ol"==this.getChild(0).name);return this.isEmpty||e?0:Vi.call(this)}function s_(e){return(t,n,i)=>{const s=i.consumable;if(!s.test(n.item,"insert")||!s.test(n.item,"attribute:listType")||!s.test(n.item,"attribute:listIndent"))return;s.consume(n.item,"insert"),s.consume(n.item,"attribute:listType"),s.consume(n.item,"attribute:listIndent");const o=n.item;Jf(o,function(e,t){const n=t.mapper,i=t.writer,s="numbered"==e.getAttribute("listType")?"ol":"ul",o=function(e){const t=e.createContainerElement("li");return t.getFillerOffset=i_,t}(i),r=i.createContainerElement(s,null);return i.insert(i.createPositionAt(r,0),o),n.bindElements(e,o),o}(o,i),i,e)}}function o_(e,t,n){if(!n.consumable.test(t.item,e.name))return;const i=n.mapper.toViewElement(t.item),s=n.writer;s.breakContainer(s.createPositionBefore(i)),s.breakContainer(s.createPositionAfter(i));const o=i.parent,r="numbered"==t.attributeNewValue?"ol":"ul";s.rename(r,o)}function r_(e,t,n){n.consumable.consume(t.item,e.name);const i=n.mapper.toViewElement(t.item).parent,s=n.writer;Qf(s,i,i.nextSibling),Qf(s,i.previousSibling,i)}function a_(e,t,n){if(n.consumable.test(t.item,e.name)&&"listItem"!=t.item.name){let e=n.mapper.toViewPosition(t.range.start);const i=n.writer,s=[];for(;("ul"==e.parent.name||"ol"==e.parent.name)&&(e=i.breakContainer(e),"li"==e.parent.name);){const t=e,n=i.createPositionAt(e.parent,"end");if(!t.isEqual(n)){const e=i.remove(i.createRange(t,n));s.push(e)}e=i.createPositionAfter(e.parent)}if(s.length>0){for(let t=0;t0){const t=Qf(i,n,n.nextSibling);t&&t.parent==n&&e.offset--}}Qf(i,e.nodeBefore,e.nodeAfter)}}}function l_(e,t,n){const i=n.mapper.toViewPosition(t.position),s=i.nodeBefore,o=i.nodeAfter;Qf(n.writer,s,o)}function d_(e,t,n){if(n.consumable.consume(t.viewItem,{name:!0})){const e=n.writer,i=e.createElement("listItem"),s=function(e){let t=0,n=e.parent;for(;n;){if(n.is("element","li"))t++;else{const e=n.previousSibling;e&&e.is("element","li")&&t++}n=n.parent}return t}(t.viewItem);e.setAttribute("listIndent",s,i);const o=t.viewItem.parent&&"ol"==t.viewItem.parent.name?"numbered":"bulleted";if(e.setAttribute("listType",o,i),!n.safeInsert(i,t.modelCursor))return;const r=function(e,t,n){const{writer:i,schema:s}=n;let o=i.createPositionAfter(e);for(const r of t)if("ul"==r.name||"ol"==r.name)o=n.convertItem(r,o).modelCursor;else{const t=n.convertItem(r,i.createPositionAt(e,"end")),a=t.modelRange.start.nodeAfter;a&&a.is("element")&&!s.checkChild(e,a.name)&&(e=t.modelCursor.parent.is("element","listItem")?t.modelCursor.parent:g_(t.modelCursor),o=i.createPositionAfter(e))}return o}(i,t.viewItem.getChildren(),n);t.modelRange=e.createRange(t.modelCursor,r),n.updateConversionResult(i,t)}}function c_(e,t,n){if(n.consumable.test(t.viewItem,{name:!0})){const e=Array.from(t.viewItem.getChildren());for(const t of e)!t.is("element","li")&&!f_(t)&&t._remove()}}function u_(e,t,n){if(n.consumable.test(t.viewItem,{name:!0})){if(0===t.viewItem.childCount)return;const e=[...t.viewItem.getChildren()];let n=!1;for(const t of e)n&&!f_(t)&&t._remove(),f_(t)&&(n=!0)}}function h_(e){return(t,n)=>{if(n.isPhantom)return;const i=n.modelPosition.nodeBefore;if(i&&i.is("element","listItem")){const t=n.mapper.toViewElement(i),s=t.getAncestors().find(f_),o=e.createPositionAt(t,0).getWalker();for(const e of o){if("elementStart"==e.type&&e.item.is("element","li")){n.viewPosition=e.previousPosition;break}if("elementEnd"==e.type&&e.item==s){n.viewPosition=e.nextPosition;break}}}}}function m_(e,[t,n]){let i,s=t.is("documentFragment")?t.getChild(0):t;if(i=n?this.createSelection(n):this.document.selection,s&&s.is("element","listItem")){const e=i.getFirstPosition();let t=null;if(e.parent.is("element","listItem")?t=e.parent:e.nodeBefore&&e.nodeBefore.is("element","listItem")&&(t=e.nodeBefore),t){const e=t.getAttribute("listIndent");if(e>0)for(;s&&s.is("element","listItem");)s._setAttribute("listIndent",s.getAttribute("listIndent")+e),s=s.nextSibling}}}function g_(e){const t=new Gr({startPosition:e});let n;do{n=t.next()}while(!n.value.item.is("element","listItem"));return n.value.item}function p_(e,t,n,i,s,o){const r=t_(t.nodeBefore,{sameIndent:!0,smallerIndent:!0,listIndent:e,foo:"b"}),a=s.mapper,l=s.writer,d=r?r.getAttribute("listIndent"):null;let c;if(r)if(d==e){const e=a.toViewElement(r).parent;c=l.createPositionAfter(e)}else{const e=o.createPositionAt(r,"end");c=a.toViewPosition(e)}else c=n;c=e_(c);for(const e of[...i.getChildren()])f_(e)&&(c=l.move(l.createRangeOn(e),c).end,Qf(l,e,e.nextSibling),Qf(l,e.previousSibling,e))}function f_(e){return e.is("element","ol")||e.is("element","ul")}class __ extends rt{static get pluginName(){return"ListEditing"}static get requires(){return[Eh,qh]}init(){const e=this.editor;e.model.schema.register("listItem",{inheritAllFrom:"$block",allowAttributes:["listType","listIndent"]});const t=e.data,n=e.editing;e.model.document.registerPostFixer(t=>function(e,t){const n=e.document.differ.getChanges(),i=new Map;let s=!1;for(const i of n)if("insert"==i.type&&"listItem"==i.name)o(i.position);else if("insert"==i.type&&"listItem"!=i.name){if("$text"!=i.name){const n=i.position.nodeAfter;n.hasAttribute("listIndent")&&(t.removeAttribute("listIndent",n),s=!0),n.hasAttribute("listType")&&(t.removeAttribute("listType",n),s=!0),n.hasAttribute("listStyle")&&(t.removeAttribute("listStyle",n),s=!0),n.hasAttribute("listReversed")&&(t.removeAttribute("listReversed",n),s=!0),n.hasAttribute("listStart")&&(t.removeAttribute("listStart",n),s=!0);for(const t of Array.from(e.createRangeIn(n)).filter(e=>e.item.is("element","listItem")))o(t.previousPosition)}o(i.position.getShiftedBy(i.length))}else"remove"==i.type&&"listItem"==i.name?o(i.position):("attribute"==i.type&&"listIndent"==i.attributeKey||"attribute"==i.type&&"listType"==i.attributeKey)&&o(i.range.start);for(const e of i.values())r(e),a(e);return s;function o(e){const t=e.nodeBefore;if(t&&t.is("element","listItem")){let e=t;if(i.has(e))return;for(let t=e.previousSibling;t&&t.is("element","listItem");t=e.previousSibling)if(e=t,i.has(e))return;i.set(t,e)}else{const t=e.nodeAfter;t&&t.is("element","listItem")&&i.set(t,t)}}function r(e){let n=0,i=null;for(;e&&e.is("element","listItem");){const o=e.getAttribute("listIndent");if(o>n){let r;null===i?(i=o-n,r=n):(i>o&&(i=o),r=o-i),t.setAttribute("listIndent",r,e),s=!0}else i=null,n=e.getAttribute("listIndent")+1;e=e.nextSibling}}function a(e){let n=[],i=null;for(;e&&e.is("element","listItem");){const o=e.getAttribute("listIndent");if(i&&i.getAttribute("listIndent")>o&&(n=n.slice(0,o+1)),0!=o)if(n[o]){const i=n[o];e.getAttribute("listType")!=i&&(t.setAttribute("listType",i,e),s=!0)}else n[o]=e.getAttribute("listType");i=e,e=e.nextSibling}}}(e.model,t)),n.mapper.registerViewToModelLength("li",x_),t.mapper.registerViewToModelLength("li",x_),n.mapper.on("modelToViewPosition",h_(n.view)),n.mapper.on("viewToModelPosition",function(e){return(t,n)=>{const i=n.viewPosition,s=i.parent,o=n.mapper;if("ul"==s.name||"ol"==s.name){if(i.isAtEnd){const t=o.toModelElement(i.nodeBefore),s=o.getModelLength(i.nodeBefore);n.modelPosition=e.createPositionBefore(t).getShiftedBy(s)}else{const t=o.toModelElement(i.nodeAfter);n.modelPosition=e.createPositionBefore(t)}t.stop()}else if("li"==s.name&&i.nodeBefore&&("ul"==i.nodeBefore.name||"ol"==i.nodeBefore.name)){const r=o.toModelElement(s);let a=1,l=i.nodeBefore;for(;l&&f_(l);)a+=o.getModelLength(l),l=l.previousSibling;n.modelPosition=e.createPositionBefore(r).getShiftedBy(a),t.stop()}}}(e.model)),t.mapper.on("modelToViewPosition",h_(n.view)),e.conversion.for("editingDowncast").add(t=>{t.on("insert",a_,{priority:"high"}),t.on("insert:listItem",s_(e.model)),t.on("attribute:listType:listItem",o_,{priority:"high"}),t.on("attribute:listType:listItem",r_,{priority:"low"}),t.on("attribute:listIndent:listItem",function(e){return(t,n,i)=>{if(!i.consumable.consume(n.item,"attribute:listIndent"))return;const s=i.mapper.toViewElement(n.item),o=i.writer;o.breakContainer(o.createPositionBefore(s)),o.breakContainer(o.createPositionAfter(s));const r=s.parent,a=r.previousSibling,l=o.createRangeOn(r);o.remove(l),a&&a.nextSibling&&Qf(o,a,a.nextSibling),p_(n.attributeOldValue+1,n.range.start,l.start,s,i,e),Jf(n.item,s,i,e);for(const e of n.item.getChildren())i.consumable.consume(e,"insert")}}(e.model)),t.on("remove:listItem",function(e){return(t,n,i)=>{const s=i.mapper.toViewPosition(n.position).getLastMatchingPosition(e=>!e.item.is("element","li")),o=s.nodeAfter,r=i.writer;r.breakContainer(r.createPositionBefore(o)),r.breakContainer(r.createPositionAfter(o));const a=o.parent,l=a.previousSibling,d=r.createRangeOn(a),c=r.remove(d);l&&l.nextSibling&&Qf(r,l,l.nextSibling),p_(i.mapper.toModelElement(o).getAttribute("listIndent")+1,n.position,d.start,o,i,e);for(const e of r.createRangeIn(c).getItems())i.mapper.unbindViewElement(e);t.stop()}}(e.model)),t.on("remove",l_,{priority:"low"})}),e.conversion.for("dataDowncast").add(t=>{t.on("insert",a_,{priority:"high"}),t.on("insert:listItem",s_(e.model))}),e.conversion.for("upcast").add(e=>{e.on("element:ul",c_,{priority:"high"}),e.on("element:ol",c_,{priority:"high"}),e.on("element:li",u_,{priority:"high"}),e.on("element:li",d_)}),e.model.on("insertContent",m_,{priority:"high"}),e.commands.add("numberedList",new Kf(e,"numbered")),e.commands.add("bulletedList",new Kf(e,"bulleted")),e.commands.add("indentList",new Xf(e,"forward")),e.commands.add("outdentList",new Xf(e,"backward"));const i=n.view.document;this.listenTo(i,"enter",(e,t)=>{const n=this.editor.model.document,i=n.selection.getLastPosition().parent;n.selection.isCollapsed&&"listItem"==i.name&&i.isEmpty&&(this.editor.execute("outdentList"),t.preventDefault(),e.stop())},{context:"li"}),this.listenTo(i,"delete",(e,t)=>{if("backward"!==t.direction)return;const n=this.editor.model.document.selection;if(!n.isCollapsed)return;const i=n.getFirstPosition();if(!i.isAtStart)return;const s=i.parent;"listItem"===s.name&&(s.previousSibling&&"listItem"===s.previousSibling.name||(this.editor.execute("outdentList"),t.preventDefault(),e.stop()))},{context:"li"}),this.listenTo(e.editing.view.document,"tab",(t,n)=>{const i=n.shiftKey?"outdentList":"indentList";this.editor.commands.get(i).isEnabled&&(e.execute(i),n.stopPropagation(),n.preventDefault(),t.stop())},{context:"li"})}afterInit(){const e=this.editor.commands,t=e.get("indent"),n=e.get("outdent");t&&t.registerChildCommand(e.get("indentList")),n&&n.registerChildCommand(e.get("outdentList"))}}function x_(e){let t=1;for(const n of e.getChildren())if("ul"==n.name||"ol"==n.name)for(const e of n.getChildren())t+=x_(e);return t}class I_ extends rt{static get pluginName(){return"ListUI"}init(){const e=this.editor.t;n_(this.editor,"numberedList",e("Numbered List"),' '),n_(this.editor,"bulletedList",e("Bulleted List"),' ')}}const v_="underline";class b_ extends rt{static get pluginName(){return"UnderlineEditing"}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:v_}),e.model.schema.setAttributeProperties(v_,{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:v_,view:"u",upcastAlso:{styles:{"text-decoration":"underline"}}}),e.commands.add(v_,new hm(e,v_)),e.keystrokes.set("CTRL+U","underline")}}const j_="underline";class C_ extends rt{static get pluginName(){return"UnderlineUI"}init(){const e=this.editor,t=e.t;e.ui.componentFactory.add(j_,n=>{const i=e.commands.get(j_),s=new fc(n);return s.set({label:t("Underline"),icon:' ',keystroke:"CTRL+U",tooltip:!0,isToggleable:!0}),s.bind("isOn","isEnabled").to(i,"value","isEnabled"),this.listenTo(s,"execute",()=>{e.execute(j_),e.editing.view.focus()}),s})}}class y_ extends ph{}y_.builtinPlugins=[class extends rt{static get requires(){return[jh,yh]}static get pluginName(){return"Alignment"}},class extends rt{static get requires(){return[dm,um]}static get pluginName(){return"BlockQuote"}},class extends rt{static get requires(){return[gm,fm]}static get pluginName(){return"Bold"}},class extends rt{static get requires(){return[eg,Eh,rg,Rh,Kh,fg]}static get pluginName(){return"Essentials"}},class extends rt{static get requires(){return[Ag,Sg]}static get pluginName(){return"FontBackgroundColor"}},class extends rt{static get requires(){return[Tg,zg]}static get pluginName(){return"FontColor"}},class extends rt{static get requires(){return[Ng,Bg]}static get pluginName(){return"Heading"}},class extends rt{static get requires(){return[fp,xp]}static get pluginName(){return"Image"}},class extends rt{static get requires(){return[vp,Ap,jp]}static get pluginName(){return"ImageResize"}},class extends rt{static get pluginName(){return"ImageUpload"}static get requires(){return[Kp,Fp,Bp]}},class extends rt{static get requires(){return[Xp,Qp]}static get pluginName(){return"Italic"}},class extends rt{static get requires(){return[$f,Uf,Hf]}static get pluginName(){return"Link"}},class extends rt{static get requires(){return[__,I_]}static get pluginName(){return"List"}},Dg,class extends rt{static get requires(){return[Ep]}static get pluginName(){return"SimpleUploadAdapter"}init(){const e=this.editor.config.get("simpleUpload");e&&(e.uploadUrl?this.editor.plugins.get(Ep).createUploadAdapter=t=>new Rp(t,e):h("simple-upload-adapter-missing-uploadurl"))}},class extends rt{static get requires(){return[b_,C_]}static get pluginName(){return"Underline"}}],y_.defaultConfig={toolbar:{items:["bold","italic","underline","|","heading","fontColor","fontBackgroundColor","alignment","|","blockQuote","bulletedList","numberedList","|","link","imageUpload","|","undo","redo"]},language:"fr"};const k_=y_})(),r.default})(),e.exports=i()},5594:(e,t,n)=>{"use strict";e.exports=n.p+"img/member-7b0dc9a7cc229b5ba65b.png"},5682:()=>{},5833:()=>{!function(e){const t=e.en=e.en||{};t.dictionary=Object.assign(t.dictionary||{},{"%0 of %1":"%0 of %1","Align center":"Align center","Align left":"Align left","Align right":"Align right",Aquamarine:"Aquamarine",Black:"Black","Block quote":"Block quote",Blue:"Blue",Bold:"Bold","Break text":"Break text","Bulleted List":"Bulleted List",Cancel:"Cancel","Centered image":"Centered image","Change image text alternative":"Change image text alternative","Choose heading":"Choose heading","Dim grey":"Dim grey","Document colors":"Document colors",Downloadable:"Downloadable","Dropdown toolbar":"Dropdown toolbar","Edit block":"Edit block","Edit link":"Edit link","Editor toolbar":"Editor toolbar","Font Background Color":"Font Background Color","Font Color":"Font Color","Full size image":"Full size image",Green:"Green",Grey:"Grey",Heading:"Heading","Heading 1":"Heading 1","Heading 2":"Heading 2","Heading 3":"Heading 3","Heading 4":"Heading 4","Heading 5":"Heading 5","Heading 6":"Heading 6","Image resize list":"Image resize list","Image toolbar":"Image toolbar","image widget":"image widget","In line":"In line","Insert image":"Insert image","Insert paragraph after block":"Insert paragraph after block","Insert paragraph before block":"Insert paragraph before block",Italic:"Italic",Justify:"Justify","Left aligned image":"Left aligned image","Light blue":"Light blue","Light green":"Light green","Light grey":"Light grey",Link:"Link","Link URL":"Link URL",Next:"Next","Numbered List":"Numbered List","Open in a new tab":"Open in a new tab","Open link in new tab":"Open link in new tab",Orange:"Orange",Original:"Original",Paragraph:"Paragraph",Previous:"Previous",Purple:"Purple",Red:"Red",Redo:"Redo","Remove color":"Remove color","Resize image":"Resize image","Resize image to %0":"Resize image to %0","Resize image to the original size":"Resize image to the original size","Rich Text Editor":"Rich Text Editor","Rich Text Editor, %0":"Rich Text Editor, %0","Right aligned image":"Right aligned image",Save:"Save","Select all":"Select all","Show more items":"Show more items","Side image":"Side image","Text alignment":"Text alignment","Text alignment toolbar":"Text alignment toolbar","Text alternative":"Text alternative","This link has no URL":"This link has no URL",Turquoise:"Turquoise",Underline:"Underline",Undo:"Undo",Unlink:"Unlink","Upload failed":"Upload failed","Upload in progress":"Upload in progress",White:"White","Widget toolbar":"Widget toolbar","Wrap text":"Wrap text",Yellow:"Yellow"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}))},6041:(e,t,n)=>{"use strict";e.exports=n.p+"img/logoWeezeventSquare-9184b02c60dbc8695435.png"},6400:(e,t,n)=>{"use strict";e.exports=n.p+"img/weezConstruction-fb73dc7a26ba038c44b3.png"},6498:(e,t,n)=>{"use strict";var i=n(4848),s=(n(8630),n(9191));function o(e){try{return Buffer.from(e).toString("base64")}catch{try{return btoa(e)}catch{return""}}}function r(e){try{return Buffer.from(e,"base64").toString()}catch{try{return atob(e)}catch{return""}}}var a,l,d=n(2664);function c(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}function u(e){return(e||"").trim().toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"")}function h(e,t={}){const n=t.replacer??l.Dash,i=c(e).trim().toLowerCase().replace(/['"]+/gi,"");let s;return s=n===l.Dash?i.replace(/[^a-z0-9\\-]+/gu,"-").replace(/-+$/,"").replace(/^-+/,""):n===l.Underscore?i.replace(/[^a-z0-9_]+/gu,"_").replace(/_+$/,"").replace(/^_+/,""):i.replace(/[^a-z0-9]+/gu,"").trim(),t?.replaceStartingNumber?s.replace(/^(\d)/,"_$1"):s}function m(e){return Array.isArray(e)&&"production"!==a.Production&&console.warn("Array passed to `isNonEmptyString()`, did you mean to use `isNonEmptyArray()` instead?"),"string"==typeof e&&e.trim().length>0}function g(e){return!m(e)}!function(e){e.Development="development",e.Production="production",e.Test="test"}(a||(a={})),function(e){e[e.Dash=0]="Dash",e[e.Empty=1]="Empty",e[e.Underscore=2]="Underscore"}(l||(l={}));const p=["hm","hrh","him","hih","hh","hsh","hgdh","kg","lg","kt","lt","sm","sar","sai","sas","sagd"],f=e=>m(e)?e[0].toUpperCase()+e.slice(1):"";function _(e){return(e??"").trim().toLowerCase().replace(/\s+/g," ").split(" ").map(e=>p.includes(e.toLowerCase())?e.toUpperCase():f(e.trim())).join(" ").split("-").map(e=>p.includes(e.toLowerCase())?e.toUpperCase():f(e.trim())).join("-")}function x(e,t){const n=(e,t,n,i,s)=>en?n+1:e+1:i===s?t:t+1;if(e===t)return 0;if(e.length>t.length){const n=e;e=t,t=n}let i=e.length,s=t.length;for(;i>0&&e.charCodeAt(i-1)===t.charCodeAt(s-1);)i--,s--;let o=0;for(;o{if("object"==typeof window&&void 0!==window[e])return window[e];if(void 0!==b?.[e])return b[e];throw new Error(`Missing env. var. ${e}`)},C=e=>"object"==typeof window&&void 0!==window[e]?window[e]:void 0!==b?.[e]?b[e]:void 0,y=e=>{const t=j(e);return"boolean"==typeof t?t:"true"===t},k=j("HEAVENT_APPLICATION_DOMAIN"),A=C("HEAVENT_RESOURCES_DOMAIN")??k,w=C("HEAVENT_ASSETS_DOMAIN")??A,S=C("HEAVENT_APP_SUBDOMAIN")??"app",E=C("HEAVENT_API_SUBDOMAIN")??"api",T=C("HEAVENT_PUBLIC_SUBDOMAIN")??"event",z=C("HEAVENT_INVOICES_SUBDOMAIN")??"invoices",O=C("HEAVENT_ASSETS_SUBDOMAIN")??"assets",R=C("HEAVENT_UPLOADS_SUBDOMAIN")??"uploads",$=C("HEAVENT_APPLICATION_BASENAME")??"",D=C("HEAVENT_RESOURCES_BASENAME")??"",P={ADMINS:j("HEAVENT_ADMINS"),EMAIL_FROM:j("HEAVENT_EMAIL_FROM"),EMAIL_FROM_NAME:j("HEAVENT_EMAIL_FROM_NAME"),HEAVENT_APPLICATION_DOMAIN:k,HEAVENT_RESOURCES_DOMAIN:A,HEAVENT_ASSETS_DOMAIN:w,HEAVENT_APPLICATION_BASENAME:$,HEAVENT_APP_URL:new I(C("HEAVENT_APP_DOMAIN")??k,void 0,S,C("HEAVENT_APP_BASENAME")??$),HEAVENT_API_URL:new I(C("HEAVENT_API_DOMAIN")??k,void 0,E,C("HEAVENT_API_BASENAME")??$),HEAVENT_PUBLIC_URL:new I(C("HEAVENT_PUBLIC_DOMAIN")??k,void 0,T,C("HEAVENT_PUBLIC_BASENAME")??$),HEAVENT_ASSETS_URL:new I(w,void 0,O,C("HEAVENT_ASSETS_BASENAME")??D),HEAVENT_INVOICES_URL:new I(C("HEAVENT_INVOICES_DOMAIN")??A,void 0,z,C("HEAVENT_INVOICES_BASENAME")??D),HEAVENT_UPLOADS_URL:new I(C("HEAVENT_UPLOADS_DOMAIN")??A,void 0,R,C("HEAVENT_UPLOADS_BASENAME")??D),USE_HUBSPOT:j("HEAVENT_USE_HUBSPOT"),COGNITO_USER_POOL_ID:j("HEAVENT_COGNITO_USER_POOL_ID"),COGNITO_USER_POOL_CLIENT_ID:j("HEAVENT_COGNITO_USER_POOL_CLIENT_ID"),COGNITO_DOMAIN_URL:j("HEAVENT_COGNITO_DOMAIN_URL"),COGNITO_CLIENT_CALLBACK_URL:j("HEAVENT_COGNITO_CLIENT_CALLBACK_URL")[0],USE_MIXPANEL:y("HEAVENT_USE_MIXPANEL"),MIXPANEL_TOKEN:y("HEAVENT_MIXPANEL_TOKEN"),HEAVENT_AWS_UPLOADS_BUCKET:j("HEAVENT_AWS_UPLOADS_BUCKET"),LOG_TOKEN:j("HEAVENT_LOG_TOKEN"),WEEZEVENT_DOMAIN:j("HEAVENT_WEEZEVENT_DOMAIN")},F="x-heavent-commit-sha",M="x-heavent-request-uuid",N="x-user-token";var L=n(6540),B=n(5002);function V(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}const U="heavent-user-session-key",W="heavent-user-email",G="UserNotFoundException";let H=null;const q=()=>(null===H&&(H=new B.NE({UserPoolId:P.COGNITO_USER_POOL_ID,ClientId:P.COGNITO_USER_POOL_CLIENT_ID})),H);function K(){return new Promise((e,t)=>{const n=q().getCurrentUser();null!==n?n.getSession((i,s)=>{i||!1===s?.isValid()?t(new Error("Could not get current user")):e({user:n,token:s.getIdToken().getJwtToken()})}):t(new Error("Could not get current user"))})}async function Y(){try{const e=localStorage.getItem("heavent-test-token");return m(e)?e:(await K()).token}catch{return}}function Z(e,t){const n=e.trim().toLowerCase();return new Promise((e,i)=>{const s=[new B.HB({Name:"email",Value:n})];q().signUp(n,t,s,[],(t,n)=>{t?i(t):e(n.user)})})}function X(){K().then(({user:e})=>{e.signOut(),location.reload()}).catch(()=>{alert("Something wrong happened ")})}function J(e,t,n){return new Promise((i,s)=>{const o=new B.TU({Username:e,Pool:q()}),r=new B.By({Username:e}),a={onSuccess(e){t(e.getIdToken().getJwtToken())},onFailure(e){e.code===G?s(G):n(e)},customChallenge(){localStorage.setItem(W,e),localStorage.setItem(U,o.Session),i({user:o,callbacks:a})}};o.setAuthenticationFlowType("CUSTOM_AUTH"),o.initiateAuth(r,a)})}function Q(e,t){return new Promise((n,i)=>{new B.TU({Username:e,Pool:q()}).authenticateUser(new B.By({Username:e,Password:t}),{onSuccess(e){n(e.getIdToken().getJwtToken())},onFailure(e){i(e)}})})}function ee(e){return new Promise((t,n)=>{new B.TU({Username:e,Pool:q()}).forgotPassword({onSuccess(){t(!0)},async onFailure(i){if(i.code===G)try{await Z(e,V()),await ee(e),t(!0)}catch(e){n(e)}else n(i)}})})}function te(e,t,n){return new Promise((i,s)=>{new B.TU({Username:e,Pool:q()}).confirmPassword(t,n,{async onSuccess(){i(await Q(e,n))},onFailure(e){s(e)}})})}var ne,ie,se,oe,re,ae,le,de,ce,ue,he,me,ge,pe,fe,_e,xe,Ie,ve,be,je,Ce,ye,ke,Ae,we,Se,Ee,Te,ze,Oe,Re,$e,De,Pe,Fe,Me,Ne,Le,Be,Ve,Ue,We,Ge,He,qe,Ke,Ye,Ze,Xe,Je,Qe,et,tt,nt,it,st,ot,rt,at,lt,dt,ct,ut,ht,mt,gt,pt,ft,_t,xt,It,vt,bt,jt,Ct,yt,kt,At,wt,St,Et,Tt,zt,Ot,Rt,$t,Dt,Pt,Ft,Mt,Nt,Lt,Bt,Vt,Ut,Wt,Gt,Ht,qt,Kt=n(961),Yt=n(1519);!function(e){e.Delegation="Delegation",e.DelegationCategory="DelegationCategory",e.Event="Event",e.Organization="Organization",e.Position="Position",e.PositionCategory="PositionCategory"}(ne||(ne={})),function(e){e.Calendar="Calendar",e.List="List",e.Radio="Radio"}(ie||(ie={})),function(e){e.Acronym="Acronym",e.Address="Address",e.AutoAccredit="AutoAccredit",e.Category="Category",e.Color="Color",e.Description="Description",e.Icon="Icon",e.Index="Index",e.Latitude="Latitude",e.Longitude="Longitude",e.Name="Name",e.Tag="Tag",e.WeezeventIsSynchronized="WeezeventIsSynchronized"}(se||(se={})),function(e){e.Accredited="Accredited",e.Everyone="Everyone",e.Members="Members",e.Refused="Refused",e.Segments="Segments"}(oe||(oe={})),function(e){e.Accreditation="Accreditation",e.Acronym="Acronym",e.Category="Category",e.CreatedAt="CreatedAt",e.Date="Date",e.Id="Id",e.Name="Name"}(re||(re={})),function(e){e.Acronym="Acronym",e.Category="Category",e.CreatedAt="CreatedAt",e.Id="Id",e.Index="Index",e.Name="Name"}(ae||(ae={})),function(e){e.Accredited="Accredited",e.AutoAccredited="AutoAccredited",e.NotApplicable="NotApplicable",e.Refused="Refused",e.WaitingAccreditation="WaitingAccreditation"}(le||(le={})),function(e){e.Jaune="Jaune",e.Vert="Vert",e.BleuRose="BleuRose",e.Bleu="Bleu",e.Orange="Orange",e.Rose="Rose"}(de||(de={})),function(e){e.Assigned="Assigned",e.Everyone="Everyone",e.Members="Members",e.Refused="Refused",e.Segments="Segments"}(ce||(ce={})),function(e){e.InsertedAt="InsertedAt",e.Name="Name",e.State="State",e.Type="Type"}(ue||(ue={})),function(e){e.Done="Done",e.Draft="Draft",e.InProgress="InProgress",e.Scheduled="Scheduled",e.Template="Template"}(he||(he={})),function(e){e.Email="Email",e.Sms="Sms"}(me||(me={})),function(e){e.C10012713_1K="C10012713_1K",e.C10012713_2K="C10012713_2K",e.C10012713_3K="C10012713_3K",e.C10012713_4K="C10012713_4K",e.C10012713_5K="C10012713_5K",e.C10012713_6K="C10012713_6K",e.C10012713_7K="C10012713_7K",e.C10012713_1="C10012713_1",e.C10012713_2="C10012713_2",e.C10012713_3="C10012713_3",e.C10012713_4="C10012713_4",e.C10012713_5="C10012713_5",e.C10012713_6="C10012713_6",e.C10012713_7="C10012713_7",e.C10012717_1K="C10012717_1K",e.C10012717_2K="C10012717_2K",e.C10012717_3K="C10012717_3K",e.C10012717_4K="C10012717_4K",e.C10012717_5K="C10012717_5K",e.C10012717_6K="C10012717_6K",e.C10012717_7K="C10012717_7K",e.C10012717_1="C10012717_1",e.C10012717_2="C10012717_2",e.C10012717_3="C10012717_3",e.C10012717_4="C10012717_4",e.C10012717_5="C10012717_5",e.C10012717_6="C10012717_6",e.C10012717_7="C10012717_7",e.C10006995K="C10006995K",e.C10006995_1K="C10006995_1K",e.C10006995_2K="C10006995_2K",e.C10006995_3K="C10006995_3K",e.C10006995_4K="C10006995_4K",e.C10006995_5K="C10006995_5K",e.C10006995_6K="C10006995_6K",e.C10006995_7K="C10006995_7K",e.C10006995="C10006995",e.C10006995_1="C10006995_1",e.C10006995_2="C10006995_2",e.C10006995_3="C10006995_3",e.C10006995_4="C10006995_4",e.C10006995_5="C10006995_5",e.C10006995_6="C10006995_6",e.C10006995_7="C10006995_7",e.C10010951K="C10010951K",e.C10010951_1K="C10010951_1K",e.C10010951_2K="C10010951_2K",e.C10010951_3K="C10010951_3K",e.C10010951_4K="C10010951_4K",e.C10010951_5K="C10010951_5K",e.C10010951_6K="C10010951_6K",e.C10010951_7K="C10010951_7K",e.C10010951="C10010951",e.C10010951_1="C10010951_1",e.C10010951_2="C10010951_2",e.C10010951_3="C10010951_3",e.C10010951_4="C10010951_4",e.C10010951_5="C10010951_5",e.C10010951_6="C10010951_6",e.C10010951_7="C10010951_7",e.C10006999="C10006999",e.C10006999_1="C10006999_1",e.C10006999_2="C10006999_2",e.C10006999_3="C10006999_3",e.C10006999_4="C10006999_4",e.C10006999_5="C10006999_5",e.C10006999_6="C10006999_6",e.C10006999_7="C10006999_7",e.C10006999K="C10006999K",e.C10006999_1K="C10006999_1K",e.C10006999_2K="C10006999_2K",e.C10006999_3K="C10006999_3K",e.C10006999_4K="C10006999_4K",e.C10006999_5K="C10006999_5K",e.C10006999_6K="C10006999_6K",e.C10006999_7K="C10006999_7K",e.C10015355K="C10015355K",e.C10015355_1K="C10015355_1K",e.C10015355_2K="C10015355_2K",e.C10015355_3K="C10015355_3K",e.C10015355_4K="C10015355_4K",e.C10015355_5K="C10015355_5K",e.C10015355_6K="C10015355_6K",e.C10015355_7K="C10015355_7K",e.C10015355="C10015355",e.C10015355_1="C10015355_1",e.C10015355_2="C10015355_2",e.C10015355_3="C10015355_3",e.C10015355_4="C10015355_4",e.C10015355_5="C10015355_5",e.C10015355_6="C10015355_6",e.C10015355_7="C10015355_7"}(ge||(ge={})),function(e){e.Waiting="Waiting",e.CheckedIn="CheckedIn",e.CheckedOut="CheckedOut"}(pe||(pe={})),function(e){e.CheckIn="CheckIn",e.CheckInOut="CheckInOut",e.CheckOut="CheckOut",e.Reset="Reset"}(fe||(fe={})),function(e){e.And="And",e.Or="Or"}(_e||(_e={})),function(e){e.Animajeconvention="Animajeconvention",e.Asoassignment="Asoassignment",e.Cerclelivraison="Cerclelivraison",e.Cercleopcom="Cercleopcom",e.Cerclepressandpartenaire="Cerclepressandpartenaire",e.Cerclestaff="Cerclestaff",e.Delta="Delta",e.Dfcoa4="Dfcoa4",e.Dfcosmall="Dfcosmall",e.Eurockeennes="Eurockeennes",e.Fcg="Fcg",e.Garorockplanning="Garorockplanning",e.Goldencoast="Goldencoast",e.Hbcldc="Hbcldc",e.Hbclnh="Hbclnh",e.Lnh="Lnh",e.Moorea="Moorea",e.Nuitssecretes="Nuitssecretes",e.Openbrest="Openbrest",e.P2nassignment="P2nassignment",e.P2nassignmentmontagedemontage="P2nassignmentmontagedemontage",e.P2nbadge="P2nbadge",e.Paris20km="Paris20km",e.Paris20kmassignment="Paris20kmassignment",e.Paris20kmcontremarque="Paris20kmcontremarque",e.Pastourelle="Pastourelle",e.Pastourelleexposant="Pastourelleexposant",e.Pec="Pec",e.Playground="Playground",e.Roiarthur="Roiarthur",e.Rose="Rose",e.Roseparking="Roseparking",e.Salamandre="Salamandre",e.T24assignment="T24assignment",e.Triathlonlarochellebadge="Triathlonlarochellebadge",e.Utopialesa4="Utopialesa4",e.Utopialesimprimeur="Utopialesimprimeur",e.Vandbcontremarque="Vandbcontremarque",e.Vannes="Vannes",e.Vannesassignment="Vannesassignment",e.Vendanges="Vendanges",e.Vendeeglobebadge="Vendeeglobebadge",e.Vendeeglobecontremarque="Vendeeglobecontremarque"}(xe||(xe={})),function(e){e.All="All",e.Public="Public",e.Private="Private"}(Ie||(Ie={})),function(e){e.Category="Category",e.Label="Label",e.Name="Name",e.Privacy="Privacy"}(ve||(ve={})),function(e){e.Category="Category",e.CreatedAt="CreatedAt",e.Id="Id",e.Label="Label",e.Name="Name",e.Status="Status",e.Type="Type"}(be||(be={})),function(e){e.Accreditation="Accreditation",e.Delegation="Delegation",e.Event="Event",e.Position="Position",e.UserInfo="UserInfo"}(je||(je={})),function(e){e.Campaigns="Campaigns",e.CanLeadersAddMembers="CanLeadersAddMembers",e.CanLeadersDeleteMembers="CanLeadersDeleteMembers",e.CanLeadersEditColumns="CanLeadersEditColumns",e.CanLeadersEditCustomFields="CanLeadersEditCustomFields",e.CanLeadersEditMembers="CanLeadersEditMembers",e.CanLeadersImportMembers="CanLeadersImportMembers",e.CanLeadersSeeHiddenAccreditationsSlots="CanLeadersSeeHiddenAccreditationsSlots",e.Category="Category",e.Columns="Columns",e.DeadlineDate="DeadlineDate",e.Description="Description",e.Documents="Documents",e.Form="Form",e.IsLocked="IsLocked",e.MaxResources="MaxResources",e.Name="Name",e.ShowFormLinkInDelegationSpace="ShowFormLinkInDelegationSpace",e.ShowInDelegationSpace="ShowInDelegationSpace",e.Tag="Tag"}(Ce||(Ce={})),function(e){e.CreatedAt="CreatedAt",e.Id="Id",e.Name="Name"}(ye||(ye={})),function(e){e.Done="Done",e.Waiting="Waiting"}(ke||(ke={})),function(e){e.Category="Category",e.CreatedAt="CreatedAt",e.Id="Id",e.Name="Name"}(Ae||(Ae={})),function(e){e.Expired="Expired",e.Full="Full",e.Locked="Locked",e.Ongoing="Ongoing"}(we||(we={})),function(e){e.Failed="FAILED",e.Pending="PENDING",e.Success="SUCCESS"}(Se||(Se={})),function(e){e.OnePerPage="OnePerPage",e.GroupedA4="GroupedA4"}(Ee||(Ee={})),function(e){e.Name="Name"}(Te||(Te={})),function(e){e.Assignments="Assignments",e.Badge="Badge",e.Certificate="Certificate",e.CustomBadge="CustomBadge",e.Planning="Planning",e.Position="Position",e.PositionPlanning="PositionPlanning",e.PositionsVolunteersPlanning="PositionsVolunteersPlanning",e.UserCustomDocument="UserCustomDocument",e.UserHours="UserHours",e.UserPlanning="UserPlanning",e.UserPlanningDays="UserPlanningDays",e.UserPlanningList="UserPlanningList",e.UsersPictures="UsersPictures",e.VolunteersListing="VolunteersListing"}(ze||(ze={})),function(e){e.Bounced="Bounced",e.Delivered="Delivered",e.Opened="Opened",e.Queued="Queued",e.Sent="Sent",e.Waiting="Waiting"}(Oe||(Oe={})),function(e){e.DoesNotExist="DoesNotExist",e.NotVerified="NotVerified",e.Verified="Verified"}(Re||(Re={})),function(e){e.Accreditations="Accreditations",e.AccreditationsRefused="AccreditationsRefused",e.Assignments="Assignments",e.Campaign="Campaign",e.Code="Code",e.DelegationCategoryLeaderAssign="DelegationCategoryLeaderAssign",e.DelegationFormInvite="DelegationFormInvite",e.DelegationLeaderAssign="DelegationLeaderAssign",e.DelegationsImport="DelegationsImport",e.Documents="Documents",e.EventInvite="EventInvite",e.EventsImport="EventsImport",e.Export="Export",e.FilesImport="FilesImport",e.FormInvite="FormInvite",e.FormSubmit="FormSubmit",e.MembersImport="MembersImport",e.NewMember="NewMember",e.NotifyLeaders="NotifyLeaders",e.OrganizationInvite="OrganizationInvite",e.PositionCategoryLeaderAssign="PositionCategoryLeaderAssign",e.PositionLeaderAssign="PositionLeaderAssign",e.PositionsImport="PositionsImport",e.Refused="Refused",e.VolunteerRegistration="VolunteerRegistration"}($e||($e={})),function(e){e.EndAt="EndAt",e.Name="Name",e.StartAt="StartAt",e.Tag="Tag"}(De||(De={})),function(e){e.Done="Done",e.Waiting="Waiting"}(Pe||(Pe={})),function(e){e.CreatedAt="CreatedAt",e.EndAt="EndAt",e.Id="Id",e.Name="Name",e.StartAt="StartAt"}(Fe||(Fe={})),(qt=Me||(Me={})).Archived="Archived",qt.Done="Done",qt.Ongoing="Ongoing",qt.Upcoming="Upcoming",function(e){e.Excel="Excel",e.Csv="CSV"}(Ne||(Ne={})),function(e){e.Done="Done",e.Waiting="Waiting"}(Le||(Le={})),function(e){e.Accreditation="Accreditation",e.Api="Api",e.Beta="Beta",e.Community="Community",e.CustomDocument="CustomDocument",e.Delegation="Delegation",e.Documents="Documents",e.Eid="Eid",e.KmlImport="KmlImport",e.Languages="Languages",e.Multiform="Multiform",e.Skidata="Skidata",e.Sms="Sms",e.Weezevent="Weezevent",e.Zapier="Zapier"}(Be||(Be={})),function(e){e.City="city",e.Country="country",e.Custom="custom",e.DateOfBirth="dateOfBirth",e.Eid="eid",e.FirstName="firstName",e.Language="language",e.LastName="lastName",e.Nationality="nationality",e.Phone="phone",e.Picture="picture",e.Population="population",e.PostalCode="postalCode",e.Sex="sex",e.Street="street"}(Ve||(Ve={})),function(e){e.Freeform="Freeform",e.Iban="Iban",e.Avs="Avs",e.Eid="Eid"}(Ue||(Ue={})),(Ht=We||(We={})).Address="Address",Ht.Checkbox="Checkbox",Ht.Country="Country",Ht.Date="Date",Ht.Datetime="Datetime",Ht.File="File",Ht.Language="Language",Ht.Nationality="Nationality",Ht.Number="Number",Ht.Phone="Phone",Ht.Select="Select",Ht.Sex="Sex",Ht.Text="Text",Ht.Textarea="Textarea",Ht.Time="Time",Ht.Validation="Validation",function(e){e.Done="Done",e.Waiting="Waiting"}(Ge||(Ge={})),function(e){e.Address="Address",e.Campaign="Campaign",e.Checkbox="Checkbox",e.Country="Country",e.Date="Date",e.DateTimeRange="DateTimeRange",e.Datetime="Datetime",e.File="File",e.Language="Language",e.Nationality="Nationality",e.Number="Number",e.Phone="Phone",e.Select="Select",e.Sex="Sex",e.Text="Text",e.Textarea="Textarea",e.Time="Time",e.Validation="Validation"}(He||(He={})),function(e){e.Field="Field",e.Section="Section",e.Text="Text"}(qe||(qe={})),function(e){e.Ranked="Ranked",e.Unranked="Unranked"}(Ke||(Ke={})),function(e){e.Admin="Admin",e.DelegationsSpace="DelegationsSpace",e.Form="Form"}(Ye||(Ye={})),function(e){e.CloseWhenEventDone="CloseWhenEventDone",e.Closed="Closed",e.ClosedAt="ClosedAt",e.Open="Open"}(Ze||(Ze={})),function(e){e.Backpack="Backpack",e.BadgeCheck="BadgeCheck",e.BagShopping="BagShopping",e.Bed="Bed",e.BriefcaseMedical="BriefcaseMedical",e.BurgerSoda="BurgerSoda",e.CakeCandles="CakeCandles",e.Camera="Camera",e.Car="Car",e.CircleParking="CircleParking",e.CircleQuestion="CircleQuestion",e.Droplet="Droplet",e.ForkKnife="ForkKnife",e.HatCowboy="HatCowboy",e.House="House",e.LocationDot="LocationDot",e.MartiniGlass="MartiniGlass",e.Megaphone="Megaphone",e.PersonBiking="PersonBiking",e.PersonHiking="PersonHiking",e.ScrewdriverWrench="ScrewdriverWrench",e.Shirt="Shirt",e.SignsPost="SignsPost",e.Star="Star",e.Ticket="Ticket",e.UserPolice="UserPolice"}(Xe||(Xe={})),function(e){e.Create="Create",e.Upsert="Upsert",e.Update="Update"}(Je||(Je={})),function(e){e.Overdue="Overdue",e.Paid="Paid",e.Refunded="Refunded",e.Waiting="Waiting"}(Qe||(Qe={})),function(e){e.Mandarin="Mandarin",e.Spanish="Spanish",e.English="English",e.Hindi="Hindi",e.Bengali="Bengali",e.Portuguese="Portuguese",e.Russian="Russian",e.Japanese="Japanese",e.Punjabi="Punjabi",e.Turkish="Turkish",e.Korean="Korean",e.French="French",e.German="German",e.Vietnamese="Vietnamese",e.Tamil="Tamil",e.Urdu="Urdu",e.Javanese="Javanese",e.Italian="Italian",e.Persian="Persian",e.Polish="Polish",e.Ukrainian="Ukrainian",e.Romanian="Romanian",e.Dutch="Dutch"}(et||(et={})),function(e){e.App="App",e.DelegationsSpace="DelegationsSpace",e.MembersSpace="MembersSpace",e.VolunteerAssignments="VolunteerAssignments",e.VolunteerRegister="VolunteerRegister"}(tt||(tt={})),function(e){e.Google="Google",e.GoogleSatellite="GoogleSatellite",e.IgnPlan="IgnPlan"}(nt||(nt={})),function(e){e.Add="Add",e.Delete="Delete",e.Replace="Replace"}(it||(it={})),function(e){e.Categories="Categories",e.Positions="Positions"}(st||(st={})),function(e){e.Both="Both",e.Event="Event",e.Organization="Organization"}(ot||(ot={})),function(e){e.Id="Id",e.InsertedAt="InsertedAt",e.PeriodEndAt="PeriodEndAt",e.WeezeventOrganizationId="WeezeventOrganizationId"}(rt||(rt={})),function(e){e.A4Portrait="A4Portrait",e.A4Landscape="A4Landscape",e.A5Portrait="A5Portrait",e.A6Portrait="A6Portrait"}(at||(at={})),function(e){e.Acronym="Acronym",e.Address="Address",e.Category="Category",e.Color="Color",e.Description="Description",e.Icon="Icon",e.Latitude="Latitude",e.Longitude="Longitude",e.Name="Name",e.Tag="Tag",e.Traces="Traces"}(lt||(lt={})),function(e){e.CreatedAt="CreatedAt",e.Id="Id",e.Name="Name"}(dt||(dt={})),function(e){e.Done="Done",e.Waiting="Waiting"}(ct||(ct={})),function(e){e.Acronym="Acronym",e.Category="Category",e.CreatedAt="CreatedAt",e.Id="Id",e.Name="Name",e.Position="Position",e.Range="Range"}(ut||(ut={})),function(e){e.Acronym="Acronym",e.Category="Category",e.CreatedAt="CreatedAt",e.Id="Id",e.Name="Name",e.Slot="Slot"}(ht||(ht={})),function(e){e.Empty="Empty",e.Partial="Partial",e.Full="Full"}(mt||(mt={})),function(e){e.Between="between",e.Contains="contains",e.EndsWith="endsWith",e.EngulfedBy="engulfedBy",e.Engulfs="engulfs",e.GreaterThan="greaterThan",e.GreaterThanEqual="greaterThanEqual",e.Is="is",e.IsAfter="isAfter",e.IsBefore="isBefore",e.IsEmpty="isEmpty",e.IsNot="isNot",e.IsNotEmpty="isNotEmpty",e.IsNotValid="isNotValid",e.IsValid="isValid",e.LessThan="lessThan",e.LessThanEqual="lessThanEqual",e.NotContains="notContains",e.NotEngulfedBy="notEngulfedBy",e.NotEngulfs="notEngulfs",e.NotOverlaps="notOverlaps",e.Overlaps="overlaps",e.StartsWith="startsWith",e.ThisDayMonth="thisDayMonth",e.Today="today"}(gt||(gt={})),function(e){e.Accreditation="Accreditation",e.None="None"}(pt||(pt={})),function(e){e.AllDays="AllDays",e.DaysWithSlots="DaysWithSlots"}(ft||(ft={})),function(e){e.Category="Category",e.Position="Position",e.Slot="Slot",e.None="None"}(_t||(_t={})),function(e){e.FilterWithSlots="FilterWithSlots",e.None="None"}(xt||(xt={})),(Gt=It||(It={})).Calendar="Calendar",Gt.Custom="Custom",Gt.Display="Display",Gt.DisplayDays="DisplayDays",Gt.Hide="Hide",function(e){e.DelegationCategory="DelegationCategory",e.Event="Event",e.Organization="Organization",e.Position="Position"}(vt||(vt={})),function(e){e.Custom="Custom",e.DelegationCategoryLeader="DelegationCategoryLeader",e.EventAdmin="EventAdmin",e.EventReader="EventReader",e.OrganizationAdmin="OrganizationAdmin",e.OrganizationReader="OrganizationReader",e.PositionEditor="PositionEditor",e.PositionReader="PositionReader"}(bt||(bt={})),function(e){e.Accreditations="Accreditations",e.Campaigns="Campaigns",e.CustomFields="CustomFields",e.Delegations="Delegations",e.Events="Events",e.Positions="Positions",e.Volunteers="Volunteers"}(jt||(jt={})),function(e){e.Female="Female",e.Male="Male",e.Nonbinary="Nonbinary",e.Notsay="Notsay",e.Other="Other"}(Ct||(Ct={})),function(e){e.Asc="Asc",e.Desc="Desc"}(yt||(yt={})),function(e){e.DelegationSpace="DelegationSpace",e.EventsShowcase="EventsShowcase",e.MembersSpace="MembersSpace"}(kt||(kt={})),function(e){e.De="De",e.En="En",e.Es="Es",e.Fr="Fr",e.Keys="Keys",e.Nl="Nl"}(At||(At={})),function(e){e.Accreditations="Accreditations",e.Delegations="Delegations",e.Events="Events",e.Positions="Positions",e.UsersInfos="UsersInfos"}(wt||(wt={})),function(e){e.WithReplies="WithReplies",e.WithUnreadReplies="WithUnreadReplies",e.WithoutReplies="WithoutReplies"}(St||(St={})),function(e){e.Delivered="Delivered",e.InvalidNumber="InvalidNumber",e.Other="Other",e.Refused="Refused",e.Sent="Sent",e.Undelivered="Undelivered",e.Waiting="Waiting"}(Et||(Et={})),function(e){e.None="None",e.Backward="Backward",e.Forward="Forward"}(Tt||(Tt={})),function(e){e.Accreditation="Accreditation",e.CustomField="CustomField",e.CustomSlot="CustomSlot",e.Delegation="Delegation",e.Document="Document",e.Email="Email",e.Event="Event",e.Form="Form",e.Other="Other",e.Position="Position"}(zt||(zt={})),function(e){e.NotTranslated="NotTranslated",e.Translated="Translated",e.TranslatedAndNotTranslated="TranslatedAndNotTranslated"}(Ot||(Ot={})),function(e){e.String="String",e.StringArray="StringArray",e.RichText="RichText"}(Rt||(Rt={})),function(e){e.Admin="Admin",e.Leader="Leader"}($t||($t={})),function(e){e.Email="Email",e.FirstName="FirstName",e.Id="Id",e.InsertedAt="InsertedAt",e.LastName="LastName",e.Name="Name",e.UpdatedAt="UpdatedAt"}(Dt||(Dt={})),function(e){e.Assigned="Assigned",e.NotApplicable="NotApplicable",e.PreAssigned="PreAssigned",e.Refused="Refused",e.WaitingAssignment="WaitingAssignment"}(Pt||(Pt={})),function(e){e.Done="Done",e.Waiting="Waiting"}(Ft||(Ft={})),function(e){e.AccreditationState="AccreditationState",e.Delegation="Delegation",e.Email="Email",e.FirstName="FirstName",e.Id="Id",e.InsertedAt="InsertedAt",e.LastName="LastName",e.LocalId="LocalId",e.Name="Name",e.State="State",e.TeamCode="TeamCode",e.UpdatedAt="UpdatedAt"}(Mt||(Mt={})),function(e){e.AddAccreditations="AddAccreditations",e.AddEvent="AddEvent",e.CreateDelegation="CreateDelegation",e.DeleteAccreditations="DeleteAccreditations",e.SendCampaign="SendCampaign",e.SetCustomField="SetCustomField",e.DuplicateMember="DuplicateMember"}(Nt||(Nt={})),function(e){e.EveryMinute="EveryMinute",e.Every2Minutes="Every2Minutes",e.Every5Minutes="Every5Minutes",e.Every10Minutes="Every10Minutes"}(Lt||(Lt={})),function(e){e.DelegationsLeaders="DelegationsLeaders",e.PositionsLeaders="PositionsLeaders",e.UsersInfosIds="UsersInfosIds",e.View="View"}(Bt||(Bt={})),function(e){e.CreatedAt="CreatedAt",e.ExecutedAt="ExecutedAt",e.Id="Id",e.Name="Name",e.VolunteersSegment="VolunteersSegment"}(Vt||(Vt={})),function(e){e.Active="Active",e.Error="Error",e.Paused="Paused"}(Ut||(Ut={})),function(e){e.Assigned="Assigned",e.FormSubmit="FormSubmit",e.VolunteersSegment="VolunteersSegment"}(Wt||(Wt={})),Object.keys(ne);const Zt=Object.keys(ie),Xt=Object.keys(se),Jt=(Object.keys(oe),Object.keys(re),Object.keys(ae),Object.keys(le)),Qt=Object.keys(de),en=(Object.keys(ce),Object.keys(ue),Object.keys(he)),tn=Object.keys(me),nn=(Object.keys(ge),Object.keys(pe)),sn=(Object.keys(fe),Object.keys(_e),Object.keys(xe)),on=(Object.keys(Ie),Object.keys(ve)),rn=(Object.keys(be),Object.keys(je)),an=Object.keys(Ce),ln=(Object.keys(ye),Object.keys(ke),Object.keys(Ae),Object.keys(we)),dn=(Object.keys(Se),Object.keys(Ee)),cn=(Object.keys(Te),Object.keys(ze),Object.keys(Oe)),un=(Object.keys(Re),Object.keys($e)),hn=(Object.keys(De),Object.keys(Pe),Object.keys(Fe),Object.keys(Me)),mn=(Object.keys(Ne),Object.keys(Le),Object.keys(Be)),gn=(Object.keys(Ve),Object.keys(Ue)),pn=Object.keys(We),fn=(Object.keys(Ge),Object.keys(He),Object.keys(qe),Object.keys(Ke)),_n=(Object.keys(Ye),Object.keys(Ze)),xn=Object.keys(Xe),In=Object.keys(Je),vn=Object.keys(Qe),bn=Object.keys(et),jn=(Object.keys(tt),Object.keys(nt)),Cn=Object.keys(it),yn=Object.keys(st),kn=(Object.keys(ot),Object.keys(rt),Object.keys(at),Object.keys(lt)),An=(Object.keys(dt),Object.keys(ct),Object.keys(ut),Object.keys(ht),Object.keys(mt)),wn=(Object.keys(gt),Object.keys(pt)),Sn=Object.keys(ft),En=Object.keys(_t),Tn=Object.keys(xt),zn=Object.keys(It),On=Object.keys(vt),Rn=(Object.keys(bt),Object.keys(jt),Object.keys(Ct)),$n=(Object.keys(yt),Object.keys(kt),Object.keys(At),Object.keys(wt),Object.keys(St)),Dn=Object.keys(Et),Pn=(Object.keys(Tt),Object.keys(zt)),Fn=Object.keys(Ot),Mn=(Object.keys(Rt),Object.keys($t),Object.keys(Dt),Object.keys(Pt)),Nn=(Object.keys(Ft),Object.keys(Mt),Object.keys(Nt)),Ln=(Object.keys(Lt),Object.keys(Bt)),Bn=(Object.keys(Vt),Object.keys(Ut)),Vn=Object.keys(Wt),Un=["insertedAt","updatedAt","checkInAt","date","sentAt","scheduledAt","deletedAt","lockedAt","bouncedAt","complaintAt","deliveredAt","rejectedAt","openedAt","clickedAt","queuedAt","closedAt","periodEndAt","checkOutAt","validatedAt","receptionDate","termsAcceptedAt","lastSeenAt","registrationDate","weezeventPairedAt","executedAt"],Wn=["date","calendarInviteStartDate","calendarInviteEndDate","startDate","endDate","deadlineDate","minAccreditationSlotDate","startAt","endAt","paidAt"],Gn=["range","ranges"],Hn=["assignedDuration","duration"];let qn=class{language;translations;constructor(e,t){this.language=e,this.translations=t}translate(e,...t){if("production"!==a.Test||process.env.JEST_WORKER_ID){let n=this.translations[e]||e;const i=this.translations[`${e}_plural`];return i&&"number"==typeof t[0]&&t[0]>1&&(n=i),Array.isArray(t)&&t.length>0&&(n=t.reduce((e,t,n)=>e.replaceAll(`{${n+1}}`,t),n)),n}return`${e} - ${JSON.stringify(t)}`}*interpolateWithComponents(e,...t){let n=0;for(const[s,o]of e.split(/{\d+}/).entries())n>0&&(yield(0,i.jsx)(L.Fragment,{children:t[s-1]},n)),n++,yield o}formatListValues(e,t="disjunction"){return new Intl.ListFormat(this.language.toLowerCase(),{style:"long",type:t}).format(e)}};qn=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[String,Object])],qn);const Kn=(0,L.createContext)({}),Yn=Kn.Consumer;function Zn(e){return(0,L.useContext)(Kn).container.get(e)}function Xn(){const e=(0,L.useContext)(Kn).container.get(qn);return e.translate.bind(e)}function Jn(){const e=(0,L.useContext)(Kn).container.get(qn);return e.interpolateWithComponents.bind(e)}function Qn(e,t,n=[]){const i="production"!==a.Test?e:e.loc.source.body;return(0,L.useContext)(Kn).useQuery(i,t,n)}function ei(e,t={}){return(0,L.useContext)(Kn).useMutation(e,t)}function ti(){return(0,L.useContext)(Kn).useParams()}function ni(){return(0,L.useContext)(Kn).useHistory()}function ii(){return(0,L.useContext)(Kn).useLocation()}function si(){return(0,L.useContext)(Kn).useLocalStorage()}const oi=e=>{const t=ti(),n=ni();return(0,L.useEffect)(()=>{m(e.path)&&(e.replace?n.replace(e.path,e.state):n.push(e.path,e.state)),e.push&&n.push(e.push(t),e.state),e.onLoad&&e.onLoad()},[]),(0,i.jsx)("div",{})},ri=(0,L.createContext)({user:null});function ai(){return(0,L.useContext)(ri)}const li=e=>{const t=ti(),{user:n}=ai();return n&&e.shouldHaveUser||!n&&!e.shouldHaveUser?(0,i.jsx)(i.Fragment,{children:e.children}):(0,i.jsx)(oi,{path:e.getRedirectPath(t),replace:!0})};function di(...e){console.log(...e)}const ci=e=>e.join("/"),ui=P.HEAVENT_APPLICATION_BASENAME,hi={FIELDS:{PLURAL:"fields",SINGLE:"field"}},mi={AUTH:"auth",EDIT:"edit",CREATE:"create",EXPORT:"export",EXPORT_BASIC:"export/basic",EXPORT_API:"export/api",IMPORT:"import",INVITE:"invite"},gi={INFORMATION:"information",DASHBOARD:"dashboard",REGISTRATION:"registration",DOCUMENTS:"documents",PROFILE:"profile",REPORTING:"reporting",FORMS:"forms",FORM:"form",MEMBER:"member",MEMBERS:"members",PREVIEW:"preview"},pi=e=>ci([e,mi.AUTH]),fi=e=>ci([e,mi.CREATE]),_i=e=>ci([e,mi.EDIT]),xi={PLURAL:"/organizations",SINGLE:"/organization"},Ii="delegations",vi={_BASE:"parameters",COMMON:{DESIGN:"design",INTEGRATION:"integration",EMAIL_TEMPLATES:"emails",SETTINGS:"settings"},EVENTS_SHOWCASE:{_BASE:"events-showcase"},MEMBERS_SPACE:{_BASE:"members-space"},DELEGATION_SPACE:{_BASE:"delegation-space"}},bi="blocked",ji="expired",Ci={ORGANIZATIONS:xi.PLURAL,ORGANIZATION:e=>ci([xi.SINGLE,e])},yi={ORGANIZATIONS:Ci.ORGANIZATIONS,ORGANIZATION:({organizationId:e})=>Ci.ORGANIZATION(e),ORGANIZATION_SETTINGS:e=>ci([yi.ORGANIZATION(e),vi._BASE]),ORGANIZATION_SETTINGS_EVENTS_SHOWCASE:e=>ci([yi.ORGANIZATION_SETTINGS(e),vi.EVENTS_SHOWCASE._BASE]),ORGANIZATION_SETTINGS_EVENTS_SHOWCASE_DESIGN:e=>ci([yi.ORGANIZATION_SETTINGS_EVENTS_SHOWCASE(e),vi.COMMON.DESIGN]),ORGANIZATION_SETTINGS_EVENTS_SHOWCASE_INTEGRATION:e=>ci([yi.ORGANIZATION_SETTINGS_EVENTS_SHOWCASE(e),vi.COMMON.INTEGRATION]),ORGANIZATION_SETTINGS_EVENTS_SHOWCASE_SETTINGS:e=>ci([yi.ORGANIZATION_SETTINGS_EVENTS_SHOWCASE(e),vi.COMMON.SETTINGS]),ORGANIZATION_SETTINGS_MEMBERS_SPACE:e=>ci([yi.ORGANIZATION_SETTINGS(e),vi.MEMBERS_SPACE._BASE]),ORGANIZATION_SETTINGS_MEMBERS_SPACE_DESIGN:e=>ci([yi.ORGANIZATION_SETTINGS_MEMBERS_SPACE(e),vi.COMMON.DESIGN]),ORGANIZATION_SETTINGS_MEMBERS_SPACE_INTEGRATION:e=>ci([yi.ORGANIZATION_SETTINGS_MEMBERS_SPACE(e),vi.COMMON.INTEGRATION]),ORGANIZATION_SETTINGS_MEMBERS_SPACE_EMAIL_TEMPLATES:e=>ci([yi.ORGANIZATION_SETTINGS_MEMBERS_SPACE(e),vi.COMMON.EMAIL_TEMPLATES]),ORGANIZATION_SETTINGS_MEMBERS_SPACE_SETTINGS:e=>ci([yi.ORGANIZATION_SETTINGS_MEMBERS_SPACE(e),vi.COMMON.SETTINGS]),ORGANIZATION_SETTINGS_DELEGATION_SPACE:e=>ci([yi.ORGANIZATION_SETTINGS(e),vi.DELEGATION_SPACE._BASE]),ORGANIZATION_SETTINGS_DELEGATION_SPACE_DESIGN:e=>ci([yi.ORGANIZATION_SETTINGS_DELEGATION_SPACE(e),vi.COMMON.DESIGN]),ORGANIZATION_SETTINGS_DELEGATION_SPACE_INTEGRATION:e=>ci([yi.ORGANIZATION_SETTINGS_DELEGATION_SPACE(e),vi.COMMON.INTEGRATION]),ORGANIZATION_SETTINGS_DELEGATION_SPACE_EMAIL_TEMPLATES:e=>ci([yi.ORGANIZATION_SETTINGS_DELEGATION_SPACE(e),vi.COMMON.EMAIL_TEMPLATES]),ORGANIZATION_SETTINGS_DELEGATION_SPACE_SETTINGS:e=>ci([yi.ORGANIZATION_SETTINGS_DELEGATION_SPACE(e),vi.COMMON.SETTINGS]),ORGANIZATION_DELEGATIONS:e=>ci([yi.ORGANIZATION(e),Ii]),IS_BLOCKED:e=>ci([e,bi]),IS_EXPIRED:e=>ci([e,ji]),ORGANIZATION_FORM:e=>Vi.FORM(e)},ki="dashboard",Ai="users",wi={COMMUNITY:e=>ci([yi.ORGANIZATION(e),"community"]),COMMUNITY_DASHBOARD:e=>ci([wi.COMMUNITY(e),ki]),COMMUNITY_USERS:e=>ci([wi.COMMUNITY(e),Ai])},Si={PLURAL:"forms",SINGLE:"form"},Ei="elements",Ti="emails",zi="integration",Oi="parameters",Ri="preview",$i="general",Di="design",Pi="availabilities",Fi="missions",Mi="accreditations",Ni="broadcast",Li="state",Bi={FORMS:Si.PLURAL,FORM:e=>ci([Si.SINGLE,e])},Vi={FORMS:({eventId:e,...t})=>ci([e?Hi.EVENT({...t,eventId:e}):wi.COMMUNITY(t),Bi.FORMS]),FORM:({formId:e,...t})=>ci(["eventId"in t&&t.eventId?Hi.EVENT(t):wi.COMMUNITY(t),Bi.FORM(e)]),CREATE:e=>fi(Vi.FORMS(e)),FORM_ELEMENTS:e=>ci([Vi.FORM(e),Ei]),FORM_INTEGRATION:e=>ci([Vi.FORM(e),zi]),FORM_EMAILS:e=>ci([Vi.FORM(e),Ti]),FORM_PREVIEW:e=>ci([Vi.FORM(e),Ri]),FORM_PARAMETERS:e=>ci([Vi.FORM(e),Oi]),FORM_PARAMETERS_GENERAL:e=>ci([Vi.FORM_PARAMETERS(e),$i]),FORM_PARAMETERS_DESIGN:e=>ci([Vi.FORM_PARAMETERS(e),Di]),FORM_PARAMETERS_AVAILABILITIES:e=>ci([Vi.FORM_PARAMETERS(e),Pi]),FORM_PARAMETERS_MISSIONS:e=>ci([Vi.FORM_PARAMETERS(e),Fi]),FORM_PARAMETERS_ACCREDITATIONS:e=>ci([Vi.FORM_PARAMETERS(e),Mi]),FORM_PARAMETERS_BROADCAST:e=>ci([Vi.FORM_PARAMETERS(e),Ni]),FORM_PARAMETERS_STATE:e=>ci([Vi.FORM_PARAMETERS(e),Li])},Ui={PLURAL:"events",SINGLE:"event"},Wi={PLURAL:"teams",SINGLE:"team"},Gi={EVENTS:Ui.PLURAL,EVENT:e=>ci([Ui.SINGLE,e]),TEAM:e=>ci([Wi.SINGLE,e])},Hi={EVENTS_IMPORT:e=>ci([yi.ORGANIZATION(e),Gi.EVENTS,mi.IMPORT]),EVENTS:e=>ci([yi.ORGANIZATION(e),Gi.EVENTS]),EVENT:({eventId:e,...t})=>ci([yi.ORGANIZATION(t),Gi.EVENT(e)]),EVENT_FORM:e=>ci([Vi.FORM(e)]),EVENT_TEAM_FORM:({teamCode:e,...t})=>ci([Hi.EVENT_FORM(t),Gi.TEAM(e)])},qi={PLURAL:"accreditation-categories",SINGLE:"accreditation-category"},Ki={PLURAL:"accreditations",SINGLE:"accreditation"},Yi={PLURAL:"slots",SINGLE:"slot"},Zi="dashboard",Xi="member",Ji="members",Qi={ACCREDITATION_CATEGORIES:qi.PLURAL,ACCREDITATION_CATEGORY:e=>ci([qi.SINGLE,e]),ACCREDITATIONS:Ki.PLURAL,ACCREDITATION:e=>ci([Ki.SINGLE,e]),ACCREDITATION_SLOTS:Yi.PLURAL,ACCREDITATION_SLOT:e=>ci([Yi.SINGLE,e])},es={ACCREDITATION_CATEGORY:({accreditationCategoryId:e,...t})=>ci([Hi.EVENT(t),Qi.ACCREDITATION_CATEGORY(e)]),ACCREDITATION_CATEGORY_DASHBOARD:e=>ci([es.ACCREDITATION_CATEGORY(e),Zi]),ACCREDITATION_CATEGORY_MEMBERS:e=>ci([es.ACCREDITATION_CATEGORY(e),Ji])},ts={ACCREDITATIONS:e=>ci([Hi.EVENT(e),Qi.ACCREDITATIONS]),ACCREDITATION:({accreditationId:e,...t})=>ci([Hi.EVENT(t),Qi.ACCREDITATION(e)]),ACCREDITATION_DASHBOARD:e=>ci([ts.ACCREDITATION(e),Zi]),ACCREDITATION_MEMBERS:e=>ci([ts.ACCREDITATION(e),Ji]),ACCREDITATION_MEMBER:({userInfoId:e,...t})=>ci([ts.ACCREDITATION_MEMBERS(t),Xi,e]),ACCREDITATION_MEMBER_INFORMATION:e=>ci([ts.ACCREDITATION_MEMBER(e),gi.INFORMATION])},ns={ACCREDITATION_SLOT:({accreditationSlotId:e,...t})=>ci([is.ACCREDITATION(t),Qi.ACCREDITATION_SLOT(e)]),ACCREDITATION_SLOT_DASHBOARD:e=>ci([ns.ACCREDITATION_SLOT(e),Zi]),ACCREDITATION_SLOT_MEMBERS:e=>ci([ns.ACCREDITATION_SLOT(e),Ji])},is={...es,...ts,...ns},ss={PLURAL:"delegations-categories",SINGLE:"delegation-category"},os={PLURAL:"delegations",SINGLE:"delegation"},rs="accreditations",as="availabilities",ls="positions",ds={DELEGATIONS_CATEGORIES:ss.PLURAL,DELEGATION_CATEGORY:e=>ci([ss.SINGLE,e]),DELEGATIONS:os.PLURAL,DELEGATION:e=>ci([os.SINGLE,e])},cs={DELEGATION_CATEGORY:({delegationCategoryId:e,...t})=>ci(["eventId"in t&&t.eventId?Hi.EVENT(t):wi.COMMUNITY(t),ds.DELEGATION_CATEGORY(e)]),DELEGATION_CATEGORY_DASHBOARD:e=>ci([cs.DELEGATION_CATEGORY(e),gi.DASHBOARD]),DELEGATION_CATEGORY_MEMBERS:e=>ci([cs.DELEGATION_CATEGORY(e),gi.MEMBERS]),DELEGATION_CATEGORY_UPDATE:e=>_i(cs.DELEGATION_CATEGORY(e))},us={DELEGATIONS:e=>ci(["eventId"in e&&e.eventId?Hi.EVENT(e):wi.COMMUNITY(e),ds.DELEGATIONS]),DELEGATION:({delegationId:e,...t})=>ci(["eventId"in t&&t.eventId?Hi.EVENT(t):wi.COMMUNITY(t),ds.DELEGATION(e)]),DELEGATION_DASHBOARD:e=>ci([us.DELEGATION(e),gi.DASHBOARD]),DELEGATION_MEMBERS:e=>ci([us.DELEGATION(e),gi.MEMBERS]),DELEGATION_ACCREDITATIONS:e=>ci([us.DELEGATION(e),rs]),DELEGATION_REPORTING:e=>ci([us.DELEGATION(e),gi.REPORTING]),DELEGATION_DOCUMENTS:e=>ci([us.DELEGATION(e),gi.DOCUMENTS]),DELEGATION_MEMBERS_IMPORT:e=>ci([us.DELEGATION(e),mi.IMPORT]),DELEGATION_MEMBER:({userInfoId:e,...t})=>ci([us.DELEGATION_MEMBERS(t),gi.MEMBER,e]),DELEGATION_MEMBER_INFORMATION:e=>ci([us.DELEGATION_MEMBER(e),gi.INFORMATION]),DELEGATION_MEMBER_ACCREDITATIONS:e=>ci([us.DELEGATION_MEMBER(e),rs]),DELEGATION_MEMBER_AVAILABILITIES:e=>ci([us.DELEGATION_MEMBER(e),as]),DELEGATION_MEMBER_POSITIONS:e=>ci([us.DELEGATION_MEMBER(e),ls]),MEMBERS_INVITE:e=>ci([us.DELEGATION(e),gi.MEMBERS,mi.INVITE]),MEMBER_CREATE:({formId:e,...t})=>fi(ci([us.DELEGATION(t),gi.MEMBER,gi.FORM,e])),MEMBER_EDIT:({formId:e,...t})=>_i(ci([us.DELEGATION_MEMBER(t),gi.FORM,e])),DELEGATION_PROFILE:e=>ci([us.DELEGATION(e),gi.PROFILE]),FIELDS_EDIT:e=>_i(ci([us.DELEGATION(e),hi.FIELDS.PLURAL])),DELEGATION_FORM:({delegationId:e,...t})=>ci([Vi.FORM(t),ds.DELEGATION(e)])},hs={...cs,...us},ms={ITEMS:{POSITIONS_CATEGORIES:{PLURAL:"position-categories",SINGLE:"position-category"},POSITIONS:{PLURAL:"positions",SINGLE:"position"},POSITION_SLOTS:{PLURAL:"slots",SINGLE:"slot"}},ACTIONS:{IMPORT:{CSV:`${mi.IMPORT}/csv`}},SECTIONS:{PREASSIGNED_MEMBERS:"preassigned-members"}},gs={POSITION_CATEGORIES:ms.ITEMS.POSITIONS_CATEGORIES.PLURAL,POSITION_CATEGORY:e=>ci([ms.ITEMS.POSITIONS_CATEGORIES.SINGLE,e]),POSITIONS:ms.ITEMS.POSITIONS.PLURAL,POSITION:e=>ci([ms.ITEMS.POSITIONS.SINGLE,e]),POSITION_SLOTS:ms.ITEMS.POSITION_SLOTS.PLURAL,POSITION_SLOT:e=>ci([ms.ITEMS.POSITION_SLOTS.SINGLE,e])},ps={POSITION_CATEGORY:({positionCategoryId:e,...t})=>ci([Hi.EVENT(t),gs.POSITION_CATEGORY(e)]),POSITION_CATEGORY_DASHBOARD:e=>ci([ps.POSITION_CATEGORY(e),gi.DASHBOARD]),POSITION_CATEGORY_MEMBERS:e=>ci([ps.POSITION_CATEGORY(e),gi.MEMBERS]),POSITION_CATEGORY_PREASSIGNED_MEMBERS:e=>ci([ps.POSITION_CATEGORY(e),ms.SECTIONS.PREASSIGNED_MEMBERS])},fs={POSITIONS:e=>ci([Hi.EVENT(e),gs.POSITIONS]),POSITION:({positionId:e,positionCategoryId:t,...n})=>ci(t?[ps.POSITION_CATEGORY({positionCategoryId:t,...n}),gs.POSITION(e)]:[Hi.EVENT(n),gs.POSITION(e)]),POSITION_DASHBOARD:e=>ci([fs.POSITION(e),gi.DASHBOARD]),POSITION_MEMBERS:e=>ci([fs.POSITION(e),gi.MEMBERS]),POSITION_PREASSIGNED_MEMBERS:e=>ci([fs.POSITION(e),ms.SECTIONS.PREASSIGNED_MEMBERS]),POSITION_MEMBER:({userInfoId:e,...t})=>ci([fs.POSITION_MEMBERS(t),gi.MEMBER,e]),POSITION_MEMBER_INFORMATION:e=>ci([fs.POSITION_MEMBER(e),gi.INFORMATION]),POSITION_IMPORT_CSV:e=>ci([Hi.EVENT(e),ms.ACTIONS.IMPORT.CSV])},_s={POSITION_SLOTS:e=>ci([fs.POSITION(e),gs.POSITION_SLOTS]),POSITION_SLOT:({positionSlotId:e,...t})=>ci([fs.POSITION(t),gs.POSITION_SLOT(e)])},xs={...ps,...fs,..._s},Is="/auth",vs=`${Is}/sign-in`,bs=`${Is}/sign-up`,js="/backoffice",Cs=e=>`${yi.ORGANIZATION({organizationId:e})}/parameters`,ys=(e,t,n,i)=>`${xs.POSITION_SLOT({organizationId:e,eventId:t,positionId:n,positionSlotId:i})}/check-members`,ks=(e,t,n,i)=>`${xs.POSITION_SLOT({organizationId:e,eventId:t,positionId:n,positionSlotId:i})}/members`,As=(e,t)=>`${Hi.EVENT({organizationId:e,eventId:t})}/volunteers`,ws=(e,t)=>`${As(e,t)}/search`,Ss=(e,t,n)=>`${ws(e,t)}/volunteer/${n}`,Es=(e,t,n)=>`${As(e,t)}/${n}`,Ts=(e,t,n,i)=>`${Es(e,t,n)}/volunteer/${i}`,zs=(e,t,n,i)=>`${Es(e,t,n)}/volunteer-panel/${i}`,Os=(e,t)=>`${Hi.EVENT({organizationId:e,eventId:t})}/emails`,Rs=(e,t)=>`${Hi.EVENT({organizationId:e,eventId:t})}/documents`,$s=(e,t)=>`${Hi.EVENT({organizationId:e,eventId:t})}/options`,Ds=(e,t)=>`${Hi.EVENT({organizationId:e,eventId:t})}/dashboard`,Ps={HOME:`/${ui}`,UNSUBSCRIBE_EMAIL:"/unsubscribe-email",USER_UPDATE_BY_TICKET_ID:(e,t)=>`/organization/${e}/update-by-ticket-id/field/${t}`,USER_FIELD_UPDATE:(e,t,n,i)=>`/organization/${e}/user/${t}/field/${n}/update/${i}`,USER_CHECK_IN:(e,t)=>`/organization/${e}/user/${t}/check-in`,USER_CHECK_OUT:(e,t)=>`/organization/${e}/user/${t}/check-out`,AUTH:Is,AUTH_FORGOT_PASSWORD:`${Is}/forgot-password`,AUTH_SIGN_IN:vs,AUTH_SIGN_UP:bs,AUTH_SIGN_IN_EMAIL:`${vs}/email`,AUTH_SIGN_IN_CODE:`${vs}/code`,AUTH_SIGN_UP_CREDENTIALS:`${bs}/credentials`,AUTH_SIGN_UP_CODE:`${bs}/code`,COGNITO_CALLBACK:"/cognito-callback",MAGIC_LINK:(e,t)=>`/magic-link/${e}/${t}`,ACCEPT_TERMS_AND_CONDITIONS:e=>`${yi.ORGANIZATION({organizationId:e})}/accept-terms-and-conditions`,BACKOFFICE:js,BACKOFFICE_ORGANIZATIONS:`${js}/organizations`,EDIT_BACKOFFICE_ORGANIZATION:e=>`${js}/organization/${e}/edit`,BACKOFFICE_INVOICES:`${js}/invoices`,ORGANIZATION_PARAMETERS:Cs,ORGANIZATION_PARAMETERS_PROFILE:e=>`${Cs(e)}/profile`,ORGANIZATION_PARAMETERS_INFOS:e=>`${Cs(e)}/general`,ORGANIZATION_PARAMETERS_TEAM:e=>`${Cs(e)}/team`,ORGANIZATION_PARAMETERS_ROLES:e=>`${Cs(e)}/roles`,CREATE_ORGANIZATION_PARAMETERS_ROLE:e=>`${Cs(e)}/roles/create`,EDIT_ORGANIZATION_PARAMETERS_ROLE:(e,t)=>`${Cs(e)}/roles/role/${t}/edit`,ORGANIZATION_PARAMETERS_EMAILS:e=>`${Cs(e)}/emails`,CREATE_ORGANIZATION_PARAMETERS_EMAILS_SENDERS:e=>`${Cs(e)}/emails/senders/create`,EDIT_ORGANIZATION_PARAMETERS_EMAILS_SENDERS:(e,t)=>`${Cs(e)}/emails/senders/${t}/edit`,ORGANIZATION_PARAMETERS_EMAILS_SENDERS:e=>`${Cs(e)}/emails/senders`,ORGANIZATION_PARAMETERS_EMAILS_SENDERS_PREVIEW:(e,t)=>`${Cs(e)}/emails/senders/${t}/preview`,ORGANIZATION_PARAMETERS_EMAILS_DNS:e=>`${Cs(e)}/emails/dns`,ORGANIZATION_PARAMETERS_DELEGATIONS_SPACE:e=>`${Cs(e)}/delegations-space`,ORGANIZATION_PARAMETERS_DELEGATIONS_SPACE_DESIGN:e=>`${Cs(e)}/delegations-space/design`,ORGANIZATION_PARAMETERS_DELEGATIONS_SPACE_INTEGRATION:e=>`${Cs(e)}/delegations-space/integration`,ORGANIZATION_PARAMETERS_DELEGATIONS_SPACE_EMAILS:e=>`${Cs(e)}/delegations-space/emails`,ORGANIZATION_PARAMETERS_CATEGORIES:e=>`${Cs(e)}/categories`,ORGANIZATION_PARAMETERS_CATEGORIES_CUSTOM_FIELDS:e=>`${Cs(e)}/categories/custom-fields`,ORGANIZATION_PARAMETERS_CATEGORIES_POSITIONS:e=>`${Cs(e)}/categories/positions`,ORGANIZATION_PARAMETERS_CATEGORIES_ACCREDITATIONS:e=>`${Cs(e)}/categories/accreditations`,ORGANIZATION_PARAMETERS_CATEGORIES_DELEGATIONS:e=>`${Cs(e)}/categories/delegations`,ORGANIZATION_PARAMETERS_TAGS:e=>`${Cs(e)}/tags`,ORGANIZATION_PARAMETERS_TRANSLATIONS:e=>`${Cs(e)}/translations`,ORGANIZATION_PARAMETERS_INVOICES:e=>`${Cs(e)}/invoices`,ORGANIZATION_PARAMETERS_ACTIVITY:e=>`${Cs(e)}/activity`,ORGANIZATION_PARAMETERS_SKIDATA:e=>`${Cs(e)}/skidata`,ORGANIZATION_PARAMETERS_ORGANIZATION_SWITCH:e=>`${Cs(e)}/organization-switch`,ORGANIZATION_PARAMETERS_DELETE_ACCOUNT:e=>`${Cs(e)}/delete-account`,CUSTOM_FIELDS:e=>`${yi.ORGANIZATION({organizationId:e})}/custom-fields`,CUSTOM_FIELDS_SEGMENT:(e,t)=>`${yi.ORGANIZATION({organizationId:e})}/custom-fields/${t}`,CUSTOM_FIELD_USAGE:(e,t,n)=>`${yi.ORGANIZATION({organizationId:e})}/custom-fields/${t}/usage/${n}`,CREATE_CUSTOM_FIELD:(e,t)=>`${yi.ORGANIZATION({organizationId:e})}/custom-fields/${t}/create`,EDIT_CUSTOM_FIELD:(e,t,n)=>`${yi.ORGANIZATION({organizationId:e})}/custom-fields/${t}/edit/${n}`,COMMUNITY_USERS_SEGMENT:(e,t)=>`${yi.ORGANIZATION({organizationId:e})}/community/users/${t}`,COMMUNITY_USERS_USER:(e,t,n)=>`${yi.ORGANIZATION({organizationId:e})}/community/users/${t}/user/${n}`,COMMUNITY_USERS_USER_INFORMATIONS:(e,t,n)=>`${yi.ORGANIZATION({organizationId:e})}/community/users/${t}/user/${n}/${gi.INFORMATION}`,COMMUNITY_USERS_DUPLICATES:e=>`${yi.ORGANIZATION({organizationId:e})}/community/users-duplicates`,COMMUNITY_EDIT_USER:(e,t)=>`${yi.ORGANIZATION({organizationId:e})}/community/user/${t}/edit`,COMMUNITY_EDIT_USER_FORM:(e,t,n)=>`${yi.ORGANIZATION({organizationId:e})}/community/user/${t}/edit/form/${n}`,COMMUNITY_VOLUNTEERS_IMPORT:e=>`${yi.ORGANIZATION({organizationId:e})}/community/import`,COMMUNITY_FILES_IMPORT:e=>`${yi.ORGANIZATION({organizationId:e})}/community/documents-import`,COMMUNITY_DELEGATIONS:e=>`${yi.ORGANIZATION({organizationId:e})}/community/delegations`,COMMUNITY_DELEGATIONS_SEGMENT:(e,t)=>`${yi.ORGANIZATION({organizationId:e})}/community/delegations/${t}`,COMMUNITY_DELEGATION:(e,t)=>`${yi.ORGANIZATION({organizationId:e})}/community/delegation/${t}`,COMMUNITY_CREATE_DELEGATION(e,t){let n=`${yi.ORGANIZATION({organizationId:e})}/community/create-delegation`;return t&&(n=`${n}/${t}`),n},COMMUNITY_EDIT_DELEGATION:(e,t)=>`${yi.ORGANIZATION({organizationId:e})}/community/delegation/${t}/edit`,COMMUNITY_EDIT_USER_DELEGATION:(e,t,n)=>`${yi.ORGANIZATION({organizationId:e})}/community/delegation/${t}user/${n}/edit`,COMMUNITY_EDIT_USER_DELEGATION_FORM:(e,t,n,i)=>`${yi.ORGANIZATION({organizationId:e})}/community/delegation/${t}/user/${n}/edit/form/${i}`,CREATE_EVENT_WITH_ORGANIZATION(e){let t="/create-event";return e&&(t=`${t}/${e}`),t},CREATE_EVENT:e=>`${yi.ORGANIZATION({organizationId:e})}/create-event`,EVENTS_SEGMENT:(e,t)=>`${yi.ORGANIZATION({organizationId:e})}/events/${t}`,EVENT_DELEGATIONS_IMPORT:(e,t)=>`${Hi.EVENT({organizationId:e,eventId:t})}/delegations-import`,EVENT_VOLUNTEERS_IMPORT:(e,t)=>`${Hi.EVENT({organizationId:e,eventId:t})}/members-import`,EVENT_FILES_IMPORT:(e,t)=>`${Hi.EVENT({organizationId:e,eventId:t})}/documents-import`,EDIT_EVENT:(e,t)=>`${Hi.EVENT({organizationId:e,eventId:t})}/edit`,DASHBOARD:Ds,DASHBOARD_EVENT_SWITCH:(e,t)=>`${Ds(e,t)}/event-switch`,POSITION_MEMBERS_USER:(e,t,n,i,s)=>`${xs.POSITION_MEMBERS({organizationId:e,eventId:t,positionCategoryId:n,positionId:i})}/${s}`,POSITION_MEMBERS_USER_INFORMATIONS:(e,t,n,i,s)=>`${xs.POSITION_MEMBERS({organizationId:e,eventId:t,positionCategoryId:n,positionId:i})}/${s}/${gi.INFORMATION}`,EXPORT_POSITIONS_MAP:(e,t)=>`/export/event/${e}/positions/${t}/map`,POSITIONS_SEARCH:(e,t)=>`${xs.POSITIONS({organizationId:e,eventId:t})}/search`,POSITIONS_SEGMENT:(e,t,n)=>`${xs.POSITIONS({organizationId:e,eventId:t})}/${n}`,CREATE_POSITION(e,t,n){let i=`${Hi.EVENT({organizationId:e,eventId:t})}/create-position`;return n&&(i=`${i}/${n}`),i},POSITION_MAP:(e,t)=>`/position/${e}-${t}/map`,POSITION_SETTINGS:(e,t,n)=>`${xs.POSITION({organizationId:e,eventId:t,positionId:n})}/settings`,EDIT_POSITION:(e,t,n)=>`${xs.POSITION({organizationId:e,eventId:t,positionId:n})}/edit`,POSITION_SLOT_ASSIGN_VOLUNTEERS:(e,t,n,i)=>`${xs.POSITION_SLOT({organizationId:e,eventId:t,positionId:n,positionSlotId:i})}/assign-volunteers`,POSITION_SLOT_MEMBERS:ks,POSITION_SLOT_MEMBERS_USER:(e,t,n,i,s)=>`${ks(e,t,n,i)}/${s}`,POSITION_SLOT_MEMBERS_USER_INFORMATIONS:(e,t,n,i,s)=>`${ks(e,t,n,i)}/${s}/${gi.INFORMATION}`,POSITION_SLOT_MEMBERS_CHECK_OPTIONS:(e,t,n,i)=>`${ks(e,t,n,i)}/check-options`,POSITION_SLOT_CHECK_MEMBERS_CHECK_IN:(e,t,n,i)=>`${ys(e,t,n,i)}/check-in`,POSITION_SLOT_CHECK_MEMBERS_CHECK_OUT:(e,t,n,i)=>`${ys(e,t,n,i)}/check-out`,POSITION_SLOT_CHECK_MEMBERS_RESET:(e,t,n,i)=>`${ys(e,t,n,i)}/reset`,VOLUNTEERS:As,VOLUNTEERS_SEARCH:ws,VOLUNTEERS_SEARCH_USER:Ss,VOLUNTEERS_SEARCH_USER_INFORMATIONS:(e,t,n)=>`${Ss(e,t,n)}/${gi.INFORMATION}`,VOLUNTEERS_SEGMENT:(e,t,n)=>`${As(e,t)}/${n}`,VOLUNTEERS_LIST_USER:Ts,VOLUNTEERS_LIST_USER_INFORMATIONS:(e,t,n,i)=>`${Ts(e,t,n,i)}/${gi.INFORMATION}`,VOLUNTEERS_LIST_USER_PANEL:zs,VOLUNTEERS_LIST_USER_PANEL_ACCREDITATIONS:(e,t,n,i)=>`${zs(e,t,n,i)}/accreditations`,VOLUNTEERS_LIST_USER_PANEL_AVAILABILITIES:(e,t,n,i)=>`${zs(e,t,n,i)}/availabilities`,VOLUNTEERS_LIST_USER_PANEL_POSITIONS:(e,t,n,i)=>`${zs(e,t,n,i)}/positions`,VOLUNTEERS_LIST_USER_PANEL_TEAM:(e,t,n,i,s)=>`${zs(e,t,n,i)}/team/${s}`,EDIT_USER:(e,t,n)=>`${Hi.EVENT({organizationId:e,eventId:t})}/user/${n}/edit`,EDIT_USER_FORM:(e,t,n,i)=>`${Hi.EVENT({organizationId:e,eventId:t})}/user/${n}/edit/form/${i}`,EDIT_USER_MISSIONS:(e,t,n)=>`${Hi.EVENT({organizationId:e,eventId:t})}/user/${n}/edit-missions`,EDIT_USER_MISSIONS_FORM:(e,t,n,i)=>`${Hi.EVENT({organizationId:e,eventId:t})}/user/${n}/edit-missions/form/${i}`,EDIT_USER_SLOTS:(e,t,n)=>`${Hi.EVENT({organizationId:e,eventId:t})}/user/${n}/edit-slots`,EDIT_USER_SLOTS_FORM:(e,t,n,i)=>`${Hi.EVENT({organizationId:e,eventId:t})}/user/${n}/edit-slots/form/${i}`,EDIT_USER_ACCREDITATIONS:(e,t,n)=>`${Hi.EVENT({organizationId:e,eventId:t})}/user/${n}/edit-accreditations`,EDIT_USER_ACCREDITATIONS_FORM:(e,t,n,i)=>`${Hi.EVENT({organizationId:e,eventId:t})}/user/${n}/edit-accreditations/form/${i}`,ASSIGNMENTS:(e,t)=>`${Hi.EVENT({organizationId:e,eventId:t})}/assignments`,ASSIGNMENT:(e,t,n)=>`${Hi.EVENT({organizationId:e,eventId:t})}/assignment/${n}`,EDIT_ASSIGNMENT:(e,t,n)=>`${Hi.EVENT({organizationId:e,eventId:t})}/edit-assignment/${n}`,TEAM_ASSIGNMENT:(e,t,n)=>`${Hi.EVENT({organizationId:e,eventId:t})}/team-assignment/${n}`,PRE_ASSIGNMENT:(e,t,n)=>`${Hi.EVENT({organizationId:e,eventId:t})}/pre-assignment/${n}`,ACCREDITATIONS_ASSIGNMENTS:(e,t)=>`${Hi.EVENT({organizationId:e,eventId:t})}/accreditations-assignments`,ACCREDIT:(e,t,n)=>`${Hi.EVENT({organizationId:e,eventId:t})}/accredit/${n}`,EDIT_ACCREDIT:(e,t,n)=>`${Hi.EVENT({organizationId:e,eventId:t})}/edit-accredit/${n}`,EVENT_EMAILS:Os,EVENT_EMAILS_PARAMETERS:(e,t)=>`${Os(e,t)}/parameters`,EDIT_CUSTOM_DOCUMENT:(e,t,n)=>`${Hi.EVENT({organizationId:e,eventId:t})}/custom-document/${n}/edit`,DOCUMENTS:Rs,DOCUMENTS_USER_PLANNING:(e,t,n)=>`${Rs(e,t)}/user-planning/${n}`,DOCUMENTS_USER_PLANNING_LIST:(e,t,n)=>`${Rs(e,t)}/user-planning-list/${n}`,DOCUMENTS_USER_PLANNING_DAYS:(e,t,n)=>`${Rs(e,t)}/user-planning-days/${n}`,DOCUMENTS_ASSIGNMENTS:(e,t,n)=>`${Rs(e,t)}/assignments/${n}`,DOCUMENTS_VOLUNTEERS_LISTING:(e,t,n)=>`${Rs(e,t)}/volunteers-listing/${n}`,DOCUMENTS_BADGE:(e,t,n,i)=>`${Rs(e,t)}/user/${n}/badge/${i}`,DOCUMENTS_CERTIFICATE:(e,t,n)=>`${Rs(e,t)}/user/${n}/certificate`,DOCUMENTS_HOURS:(e,t,n)=>`${Rs(e,t)}/user/${n}/hours`,DOCUMENTS_POSITION_PLANNING:(e,t,n)=>`${Rs(e,t)}/position-planning/${n}`,DOCUMENTS_POSITIONS_VOLUNTEERS_PLANNING:(e,t,n)=>`${Rs(e,t)}/positions-volunteers-planning/${n}`,DOCUMENTS_POSITION:(e,t,n)=>`${Rs(e,t)}/position/${n}`,DOCUMENTS_PLANNING:(e,t,n)=>`${Rs(e,t)}/planning/${n}`,DOCUMENTS_USER_CUSTOM_DOCUMENT:(e,t,n,i)=>`${Rs(e,t)}/user/${n}/custom-document/${i}`,DOCUMENTS_USERS_PICTURES:(e,t,n)=>`${Rs(e,t)}/users-pictures/${n}`,OPTIONS:$s,OPTIONS_API:(e,t)=>`${$s(e,t)}/api`,OPTIONS_WEEZEVENT_V2:(e,t)=>`${$s(e,t)}/weezevent-v2`,ACCREDITATIONS_SEGMENT:(e,t,n)=>`${is.ACCREDITATIONS({organizationId:e,eventId:t})}/${n}`,CREATE_ACCREDITATION(e,t,n){let i=`${Hi.EVENT({organizationId:e,eventId:t})}/create-accreditation`;return n&&(i=`${i}/${n}`),i},EDIT_ACCREDITATION:(e,t,n)=>`${is.ACCREDITATION({organizationId:e,eventId:t,accreditationId:n})}/edit`,ACCREDITATION_MAP:(e,t)=>`/accreditation/${e}-${t}/map`,DELEGATIONS_SEGMENT:(e,t,n)=>`${hs.DELEGATIONS({organizationId:e,eventId:t})}/${n}`,CREATE_DELEGATION(e,t,n){let i=`${Hi.EVENT({organizationId:e,eventId:t})}/create-delegation`;return n&&(i=`${i}/${n}`),i},EDIT_DELEGATION:(e,t,n)=>`${hs.DELEGATION({organizationId:e,eventId:t,delegationId:n})}/edit`,EDIT_USER_DELEGATION:(e,t,n,i)=>`${hs.DELEGATION({organizationId:e,eventId:t,delegationId:n})}/user/${i}/edit`,EDIT_USER_DELEGATION_FORM:(e,t,n,i,s)=>`${hs.DELEGATION({organizationId:e,eventId:t,delegationId:n})}/user/${i}/edit/form/${s}`},Fs=(e,t)=>`/volunteers/${e}-${t}`,Ms=(e,t)=>`${Fs(e,t)}/assignments`,Ns=(e,t)=>`${Fs(e,t)}/register`,Ls=Ms;var Bs=n(1343);const Vs={AccreditationChartFragment:{code:"fragment AccreditationChart on Accreditation {\n id\n name\n hasSlots\n willAutoAccredit\n\n slots(includeHidden: true) {\n date\n name\n assignedResources\n delegationsTotalResources\n maxResources\n scannedResources\n wishedResources\n }\n}\n",fragments:[]},AccreditationEmailFragment:{code:"fragment AccreditationEmail on AccreditationsUsersInfo {\n accreditationCategory {\n name\n }\n\n accreditation {\n id\n eventId\n name\n description\n address\n latitude\n longitude\n }\n\n accreditationSlot {\n name\n date\n }\n}\n",fragments:[]},AccreditationImportFragment:{code:"fragment AccreditationImport on Accreditation {\n id\n name\n\n slots(includeHidden: true) {\n id\n name\n date\n }\n}\n",fragments:[]},AccreditationSlotMatrixFragment:{code:"fragment AccreditationSlotMatrix on AccreditationsSlot {\n id\n name\n date\n\n accreditation {\n id\n acronym\n color\n name\n index\n }\n\n accreditationCategory {\n name\n }\n}\n",fragments:[]},AccreditationSlotVolunteerRegistrationFragment:{code:"fragment AccreditationSlotVolunteerRegistration on AccreditationsSlot {\n id\n accreditationId\n name\n date\n isBlocked\n\n accreditation {\n id\n accreditationCategoryId\n acronym\n name\n color\n icon\n hiddenSlotId\n hasSlots\n index\n }\n\n accreditationCategory {\n id\n name\n }\n}\n",fragments:[]},AccreditationsAccreditationFragment:{code:"fragment AccreditationsAccreditation on Accreditation {\n id\n name\n address\n latitude\n longitude\n acronym\n icon\n color\n fillingRate\n maxResources\n assignedResources\n willAutoAccredit\n weezeventIsSynchronized\n fields\n index\n insertedAt\n\n accreditationCategory {\n id\n name\n }\n\n accreditationsCustomFields @include(if: $includeConditions) {\n ...AccreditationsAccreditationCustomField\n }\n\n createdBy @include(if: $includeCreatedBy) {\n email\n name\n }\n\n tags @include(if: $includeTags) {\n id\n name\n }\n}\n",fragments:["AccreditationsAccreditationCustomFieldFragment"]},AccreditationsAccreditationCustomFieldFragment:{code:"fragment AccreditationsAccreditationCustomField on AccreditationsCustomField {\n conditionValue\n\n customField {\n name\n fieldType\n\n values {\n id\n value\n }\n }\n}\n",fragments:[]},AccreditationsAccreditationSlotFragment:{code:"fragment AccreditationsAccreditationSlot on AccreditationsSlot {\n id\n name\n date\n maxResources\n assignedResources\n fillingRate\n isHidden\n insertedAt\n weezeventChecklistId\n\n accreditation {\n id\n name\n address\n latitude\n longitude\n acronym\n icon\n color\n fields\n\n accreditationsCustomFields @include(if: $includeConditions) {\n ...AccreditationsAccreditationCustomField\n }\n\n createdBy @include(if: $includeCreatedBy) {\n email\n name\n }\n\n tags @include(if: $includeTags) {\n id\n name\n }\n }\n\n accreditationCategory {\n id\n name\n }\n}\n",fragments:["AccreditationsAccreditationCustomFieldFragment"]},AccreditationsSlotFragment:{code:"fragment AccreditationsSlot on AccreditationsSlot {\n id\n accreditationCategoryId\n accreditationId\n eventId\n name\n date\n assignedResources\n wishedResources\n maxResources\n isBlocked\n\n accreditation {\n id\n accreditationCategoryId\n eventId\n acronym\n name\n color\n icon\n hasSlots\n accreditationDisplay\n hiddenSlotId\n index\n }\n\n accreditationCategory {\n id\n name\n }\n}\n",fragments:[]},AssigmentEmailFragment:{code:"fragment AssigmentEmail on PositionsSlotsUsersInfo {\n id\n\n position {\n id\n eventId\n name\n description\n acronym\n color\n address\n latitude\n longitude\n zoom\n range\n layer\n fields\n\n leaders {\n ...LeaderAssignment\n }\n\n category {\n id\n name\n\n leaders {\n ...LeaderAssignment\n }\n }\n\n tags {\n name\n }\n }\n\n positionSlot {\n id\n name\n range\n }\n}\n",fragments:["LeaderAssignmentFragment"]},AttachCustomFieldFragment:{code:"fragment AttachCustomField on CustomField {\n ...CustomFieldWithCondition\n\n category {\n id\n name\n }\n}\n",fragments:["CustomFieldWithConditionFragment"]},CampaignEditFragment:{code:"fragment CampaignEdit on Campaign {\n name\n state\n campaignType\n sender\n text\n subject\n html\n replyTo\n sendToEveryone\n states\n positionsCategoriesIds\n positionsIds\n positionsSlotsIds\n tagsIds\n accreditationsCategoriesIds\n accreditationsIds\n accreditationsSlotsIds\n usersInfosIds\n segmentsIds\n scheduledAt\n emailSenderId\n attachments\n hasCalendarInvite\n calendarInviteName\n calendarInviteStartDate\n calendarInviteStartTime\n calendarInviteEndDate\n calendarInviteEndTime\n\n documents {\n acl\n key\n name\n size\n }\n}\n",fragments:[]},CampaignEmailRendererFragment:{code:"fragment CampaignEmailRenderer on Campaign {\n subject\n text\n html\n replyTo\n attachments\n hasCalendarInvite\n calendarInviteName\n calendarInviteStartDate\n calendarInviteStartTime\n calendarInviteEndDate\n calendarInviteEndTime\n\n documents {\n name\n key\n }\n}\n",fragments:[]},CampaignListFragment:{code:"fragment CampaignList on Campaign {\n id\n name\n campaignType\n state\n numberOfRecipients\n cost\n sentAt\n scheduledAt\n\n createdBy {\n nameOrEmail\n }\n}\n",fragments:[]},CampaignUserInfoFragment:{code:'fragment CampaignUserInfo on UsersInfo {\n id\n name\n email\n picture {\n url\n }\n phone: fieldValue(slug: "phone")\n}\n',fragments:[]},CommentFragment:{code:"fragment Comment on Comment {\n id\n content\n insertedAt\n\n event {\n name\n }\n\n writtenBy {\n id\n email\n\n userInfo(organizationId: $organizationId) {\n ...UserInfoNameAndPicture\n nameOrEmail\n }\n }\n}\n",fragments:["UserInfoNameAndPictureFragment"]},ConditionCustomFieldFragment:{code:"fragment ConditionCustomField on CustomField {\n id\n name\n slug\n fieldType\n\n values {\n id\n value\n }\n}\n",fragments:[]},ConditionsCustomFieldsFragment:{code:"fragment ConditionsCustomFields on Organization {\n conditionsCustomFields: customFields(\n variety: UserInfo\n privacy: All\n fieldTypes: [Checkbox, Select]\n sort: { attribute: Name, direction: Asc }\n ) {\n nodes {\n ...ConditionCustomField\n }\n }\n}\n",fragments:["ConditionCustomFieldFragment"]},CreateAccreditationEventFragment:{code:"fragment CreateAccreditationEvent on Event {\n startAt\n endAt\n layer\n isWeezeventConnected\n\n accreditationsCategories {\n id\n name\n }\n}\n",fragments:[]},CreateCampaignEmailSenderFragment:{code:"fragment CreateCampaignEmailSender on EmailsSender {\n id\n name\n isValidToSendEmail\n}\n",fragments:[]},CreateCustomFieldInfosFragment:{code:"fragment CreateCustomFieldInfos on Organization {\n customFields(\n variety: UserInfo\n privacy: All\n fieldTypes: [Checkbox, Country, Language, Nationality, Select]\n ) {\n nodes {\n id\n name\n label\n fieldProperty\n fieldType\n\n values {\n id\n value\n }\n }\n }\n\n customFieldsCategories {\n nodes {\n id\n name\n }\n }\n}\n",fragments:[]},CreateDelegationEventFragment:{code:"fragment CreateDelegationEvent on Event {\n startAt\n endAt\n\n campaigns(states: [Template]) {\n nodes {\n id\n name\n }\n }\n\n customDocuments {\n slug\n name\n }\n\n forms {\n nodes {\n ...CreateDelegationForm\n }\n }\n\n ...EventAccreditations\n}\n",fragments:["CreateDelegationFormFragment","EventAccreditationsFragment"]},CreateDelegationFormFragment:{code:"fragment CreateDelegationForm on Form {\n id\n name\n}\n",fragments:[]},CreatePositionEventFragment:{code:"fragment CreatePositionEvent on Event {\n startAt\n endAt\n layer\n latitude\n longitude\n\n positionsCategories(scoped: true) {\n id\n name\n }\n\n traces {\n ...Trace\n }\n}\n",fragments:["TraceFragment"]},CreatePositionTagsFragment:{code:"fragment CreatePositionTags on Organization {\n tags {\n nodes {\n id\n name\n }\n }\n}\n",fragments:[]},CreateUpdateEventInfosFragment:{code:"fragment CreateUpdateEventInfos on Organization {\n name\n weezeventOrganizationId\n\n eventCustomFields: customFields(variety: Event) {\n nodes {\n ...AttachCustomField\n }\n }\n\n emailsSenders(isValidToSendEmail: true) {\n id\n name\n }\n\n tags {\n nodes {\n id\n name\n }\n }\n}\n",fragments:["AttachCustomFieldFragment"]},CreateUpdateMemberFormFragment:{code:"fragment CreateUpdateMemberForm on Form {\n id\n name\n isEditableInMemberSpace\n description\n daysDisplay\n positionTitle\n positionSubtitle\n slotTitle\n slotSubtitle\n accreditationTitle\n accreditationSubtitle\n informationTitle\n registerButtonText\n\n ...FormMissionsOptions\n ...FormAccreditationsOptions\n\n elements {\n ...FormElementDisplay\n }\n\n customSlotsPeriods {\n ...FormRegisterCustomSlotPeriod\n }\n}\n",fragments:["FormMissionsOptionsFragment","FormAccreditationsOptionsFragment","FormElementDisplayFragment","FormRegisterCustomSlotPeriodFragment"]},CreatedByFragment:{code:"fragment CreatedBy on UsersInfo {\n ...UserInfoContactInformation\n}\n",fragments:["UserInfoContactInformationFragment"]},CustomBadgeVolunteerRegistrationFragment:{code:'fragment CustomBadgeVolunteerRegistration on VolunteersRegistration {\n localId\n state\n isLeader\n utid\n ticketId\n weezevent\n\n userInfo {\n id\n email\n name\n fields(expand: true)\n registrationDate(eventId: $eventId)\n\n links(eventId: $eventId) {\n ...UserInfoLinks\n }\n\n formsUsersInfos(eventId: $eventId, level: Event) {\n formId\n\n slots {\n range\n }\n }\n }\n\n delegation {\n name\n\n leaders {\n name\n firstName: fieldValue(slug: "firstName")\n lastName: fieldValue(slug: "lastName")\n phone: fieldValue(slug: "phone")\n }\n }\n\n accreditationsUsersInfos {\n accreditation {\n id\n name\n acronym\n color\n icon\n }\n\n accreditationSlot {\n id\n name\n date\n }\n\n accreditationCategory {\n id\n name\n }\n }\n\n positionsSlotsUsersInfos {\n ...AssigmentEmail\n }\n}\n',fragments:["UserInfoLinksFragment","AssigmentEmailFragment"]},CustomDocumentPopulationFragment:{code:"fragment CustomDocumentPopulation on CustomDocument {\n slug\n name\n populationsIds\n}\n",fragments:[]},CustomFieldFragment:{code:"fragment CustomField on CustomField {\n id\n slug\n name\n label\n variety\n fieldProperty\n fieldType\n isPrivate\n isEncrypted\n hasCondition\n conditionCustomFieldId\n dependencies\n numberOfTimesUsed\n canDelete\n isSelectV2\n insertedAt\n\n category {\n id\n name\n }\n\n conditionCustomField {\n name\n }\n\n createdBy {\n id\n ...CreatedBy\n }\n\n values {\n value\n }\n}\n",fragments:["CreatedByFragment"]},CustomFieldImportFragment:{code:"fragment CustomFieldImport on CustomField {\n id\n name\n slug\n customFieldCategoryId\n customFieldCategoryName\n fieldType\n fieldProperty\n canSelectMultiple\n\n values {\n id\n value\n }\n}\n",fragments:[]},CustomFieldWithConditionFragment:{code:"fragment CustomFieldWithCondition on CustomField {\n id\n name\n label\n description\n fieldType\n fieldSubtype\n fieldProperty\n isPrivate\n isEncrypted\n hasCondition\n conditionValue\n canSelectMultiple\n slug\n isSelectV2\n\n conditionCustomField {\n id\n name\n fieldType\n fieldProperty\n canSelectMultiple\n slug\n }\n\n document {\n url\n name\n }\n\n values {\n id\n value\n }\n}\n",fragments:[]},DelegationAccreditationSlotFragment:{code:"fragment DelegationAccreditationSlot on DelegationAccreditationSlot {\n accreditationCategoryId\n accreditationId\n accreditationSlotId\n isDefault\n isFull\n isVisible\n\n accreditationSlot {\n date\n isBlocked\n isFull\n }\n}\n",fragments:[]},DelegationAccreditationSlotStatsFragment:{code:"fragment DelegationAccreditationSlotStats on DelegationAccreditationSlot {\n accreditationSlotId\n accreditationId\n assignedResources\n maxResources\n scannedResources\n wishedResources\n}\n",fragments:[]},DelegationAccreditationsSlotsFragment:{code:"fragment DelegationAccreditationsSlots on Delegation {\n accreditationsSlots {\n accreditationId\n accreditationSlotId\n maxResources\n assignedResources\n isDefault\n isVisible\n\n accreditationSlot {\n id\n name\n date\n isHidden\n accreditation {\n id\n name\n }\n accreditationCategoryId\n }\n }\n}\n",fragments:[]},DelegationUserProfileFragment:{code:"fragment DelegationUserProfile on Delegation {\n id\n name\n event {\n id\n name\n }\n}\n",fragments:[]},DelegationsDelegationFragment:{code:"fragment DelegationsDelegation on Delegation {\n id\n organizationId\n eventId\n name\n state\n deadlineDate\n numberOfResources @include(if: $includeResources)\n maxResources\n fillingRate @include(if: $includeResources)\n showInDelegationSpace\n fields\n canLeadersAddMembers\n canLeadersEditMembers\n canLeadersDeleteMembers\n canLeadersEditColumns\n canLeadersEditCustomFields\n canLeadersImportMembers\n canLeadersSeeHiddenAccreditationsSlots\n showFormLinkInDelegationSpace\n lockedAt\n usedCustomFieldsFilled @include(if: $includeUsedCustomFieldsFilled)\n insertedAt\n\n campaigns @include(if: $includeCampaigns) {\n id\n name\n }\n\n children @include(if: $includeChildren) {\n event {\n id\n name\n }\n }\n\n customDocuments @include(if: $includeDocuments) {\n slug\n name\n }\n\n delegationCategory {\n id\n name\n\n leaders @include(if: $includeLeaders) {\n userInfo {\n id\n email\n name\n nameOrEmail\n }\n }\n }\n\n createdBy @include(if: $includeCreatedBy) {\n email\n name\n }\n\n form {\n id\n name\n }\n\n tags @include(if: $includeTags) {\n id\n name\n }\n\n leaders @include(if: $includeLeaders) {\n id\n email\n name\n nameOrEmail\n }\n\n accreditationsSlots @include(if: $includeAccreditationsSlots) {\n ...DelegationAccreditationSlotStats\n }\n}\n",fragments:["DelegationAccreditationSlotStatsFragment"]},DocumentEmailPreviewFragment:{code:"fragment DocumentEmailPreview on Document {\n id\n acl\n key\n name\n size\n url\n}\n",fragments:[]},DocumentPositionPlanningFragment:{code:'fragment DocumentPositionPlanning on Event {\n position(id: $positionId) {\n name\n range\n\n slots {\n id\n range\n }\n }\n\n volunteersRegistrations(positionId: $positionId, sort: { attribute: "Name", direction: Asc }) {\n nodes {\n id\n\n userInfo {\n ...UserInfoContactInformation\n }\n\n slots {\n range\n }\n\n positionsSlotsUsersInfos {\n positionSlotId\n positionSlot {\n range\n }\n }\n }\n }\n}\n',fragments:["UserInfoContactInformationFragment"]},DocumentPositionSheetFragment:{code:"fragment DocumentPositionSheet on Query {\n organization(id: $organizationId) {\n customFields(variety: UserInfo) {\n nodes {\n ...CustomFieldWithCondition\n }\n }\n }\n\n event(id: $eventId) {\n document(documentType: Position) {\n id\n options\n }\n\n position(id: $positionId) {\n ...PositionPdfInfos\n\n slots {\n id\n name\n range\n }\n }\n\n volunteersRegistrations(states: [Assigned], positionId: $positionId) {\n nodes {\n ...VolunteerPdf\n\n positionsSlotsUsersInfos {\n positionSlotId\n }\n }\n }\n }\n}\n",fragments:["CustomFieldWithConditionFragment","PositionPdfInfosFragment","VolunteerPdfFragment"]},DocumentPositionsPlanningFragment:{code:"fragment DocumentPositionsPlanning on Event {\n name\n\n positionsSlots(segmentId: $segmentId, date: $date) {\n nodes {\n id\n positionId\n name\n range\n\n position {\n id\n name\n color\n }\n }\n }\n\n segment(id: $segmentId) {\n name\n }\n}\n",fragments:[]},DocumentPositionsVolunteersPlanningFragment:{code:"fragment DocumentPositionsVolunteersPlanning on Event {\n name\n\n positionsSlots(segmentId: $segmentId) {\n nodes {\n id\n range\n\n position {\n id\n name\n acronym\n }\n }\n }\n\n segment(id: $segmentId) {\n name\n }\n\n volunteersRegistrations(states: [Assigned]) {\n nodes {\n id\n\n userInfo {\n ...UserInfoContactInformation\n }\n\n positionsSlotsUsersInfos {\n positionSlotId\n }\n }\n }\n}\n",fragments:["UserInfoContactInformationFragment"]},DocumentUserAssignmentsFragment:{code:"fragment DocumentUserAssignments on Query {\n organization(id: $organizationId) {\n id\n\n customFields(variety: Position, privacy: Public) {\n nodes {\n ...CustomFieldWithCondition\n }\n }\n\n userInfo(id: $userInfoId) {\n ...UserInfoDocument\n }\n }\n\n event(id: $eventId) {\n id\n name\n\n document(documentType: Assignments) {\n id\n options\n title\n informationsTitle\n informationsContent\n informations2Title\n informations2Content\n signature\n }\n\n volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n id\n localId\n ticketId\n weezevent\n\n preassignPositions {\n name\n }\n\n preassignPositionsCategories {\n name\n }\n\n positionsSlotsUsersInfos {\n ...AssigmentEmail\n }\n }\n }\n}\n",fragments:["CustomFieldWithConditionFragment","UserInfoDocumentFragment","AssigmentEmailFragment"]},DocumentUserBadgeFragment:{code:'fragment DocumentUserBadge on Event {\n document(documentType: Badge) {\n id\n options\n }\n\n volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n userInfo {\n ...UserInfoContactInformation\n nameOrEmail\n language: fieldValue(slug: "language")\n\n links(eventId: $eventId) {\n userBadgeLink\n }\n }\n\n positionsSlotsUsersInfos {\n position {\n name\n }\n\n positionSlot {\n range\n }\n }\n }\n}\n',fragments:["UserInfoContactInformationFragment"]},DocumentUserCertificateFragment:{code:'fragment DocumentUserCertificate on Event {\n document(documentType: Certificate) {\n id\n options\n }\n\n volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n userInfo {\n nameOrEmail\n name\n dateOfBirth: fieldValue(slug: "dateOfBirth")\n street: fieldValue(slug: "street")\n city: fieldValue(slug: "city")\n postalCode: fieldValue(slug: "postalCode")\n language: fieldValue(slug: "language")\n\n links(eventId: $eventId) {\n userCertificateLink\n }\n }\n\n positionsSlotsUsersInfos {\n position {\n name\n }\n\n positionSlot {\n range\n }\n }\n }\n}\n',fragments:[]},DocumentUserCustomBadgeFragment:{code:"fragment DocumentUserCustomBadge on Event {\n id\n name\n startAt\n weezevent\n\n tags {\n name\n }\n\n document(documentType: CustomBadge, customBadge: $customBadge) {\n id\n options\n }\n\n volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n ...CustomBadgeVolunteerRegistration\n }\n}\n",fragments:["CustomBadgeVolunteerRegistrationFragment"]},DocumentUserCustomBadgesFragment:{code:"fragment DocumentUserCustomBadges on Event {\n id\n name\n startAt\n weezevent\n fields\n\n tags {\n name\n }\n\n document(documentType: CustomBadge, customBadge: $customBadge) {\n id\n options\n }\n\n volunteersRegistrations(segmentId: $segmentId) {\n nodes {\n ...CustomBadgeVolunteerRegistration\n }\n }\n}\n",fragments:["CustomBadgeVolunteerRegistrationFragment"]},DocumentUserPlanningFragment:{code:"fragment DocumentUserPlanning on Event {\n startAt\n endAt\n dayStartTime\n\n document(documentType: UserPlanning) {\n id\n options\n title\n informationsTitle\n informationsContent\n informations2Title\n informations2Content\n signature\n }\n\n volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n id\n localId\n ticketId\n weezevent\n\n userInfo {\n ...UserInfoDocument\n }\n\n positionsSlotsUsersInfos {\n ...PsuiUserPlanning\n }\n }\n}\n",fragments:["UserInfoDocumentFragment","PsuiUserPlanningFragment"]},DocumentUserPlanningDaysFragment:{code:'fragment DocumentUserPlanningDays on Event {\n document(documentType: UserPlanningDays) {\n id\n options\n }\n\n volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n userInfo {\n nameOrEmail\n language: fieldValue(slug: "language")\n\n links(eventId: $eventId) {\n userPlanningDaysLink\n }\n }\n\n positionsSlotsUsersInfos {\n positionSlot {\n range\n }\n\n position {\n id\n organizationId\n name\n address\n }\n }\n }\n}\n',fragments:[]},DocumentUserPlanningListFragment:{code:'fragment DocumentUserPlanningList on Event {\n document(documentType: UserPlanningList) {\n id\n options\n }\n\n volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n userInfo {\n nameOrEmail\n language: fieldValue(slug: "language")\n\n links(eventId: $eventId) {\n userPlanningListLink\n }\n }\n\n positionsSlotsUsersInfos {\n positionSlot {\n name\n range\n }\n\n position {\n name\n }\n }\n }\n}\n',fragments:[]},DocumentUsersHoursFragment:{code:"fragment DocumentUsersHours on Event {\n timeZone\n\n document(documentType: UserHours) {\n id\n options\n title\n informationsTitle\n informationsContent\n informations2Title\n informations2Content\n signature\n }\n\n volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n positionsSlotsUsersInfos {\n ...PsuiUserHours\n }\n\n userInfo {\n ...UserInfoDocument\n }\n }\n}\n",fragments:["PsuiUserHoursFragment","UserInfoDocumentFragment"]},DocumentUsersListingFragment:{code:"fragment DocumentUsersListing on Query {\n organization(id: $organizationId) {\n customFields(variety: UserInfo) {\n nodes {\n ...CustomFieldWithCondition\n }\n }\n }\n\n event(id: $eventId) {\n document(documentType: VolunteersListing) {\n id\n options\n title\n informationsTitle\n informationsContent\n informations2Title\n informations2Content\n signature\n }\n\n segment(id: $segmentId) {\n name\n\n links {\n usersListingLink\n }\n }\n\n volunteersRegistrations(segmentId: $segmentId) {\n nodes {\n ...VolunteerPdf\n }\n }\n }\n}\n",fragments:["CustomFieldWithConditionFragment","VolunteerPdfFragment"]},DocumentUsersPicturesFragment:{code:'fragment DocumentUsersPictures on Query {\n organization(id: $organizationId) {\n customFields(variety: UserInfo) {\n nodes {\n ...CustomFieldWithCondition\n }\n }\n }\n\n event(id: $eventId) {\n document(documentType: UsersPictures) {\n id\n options\n title\n informationsTitle\n informationsContent\n informations2Title\n informations2Content\n signature\n }\n\n segment(id: $segmentId) {\n name\n\n links {\n usersPicturesLink\n }\n }\n\n volunteersRegistrations(\n segmentId: $segmentId\n sort: { attribute: "Name", direction: Asc }\n ) {\n nodes {\n userInfo {\n id\n ...UserInfoContactInformation\n firstName: fieldValue(slug: "firstName")\n lastName: fieldValue(slug: "lastName")\n fields\n }\n }\n }\n }\n}\n',fragments:["CustomFieldWithConditionFragment","UserInfoContactInformationFragment"]},DocumentUsersPlanningFragment:{code:"fragment DocumentUsersPlanning on VolunteersRegistration {\n id\n state\n\n userInfo {\n id\n ...UserInfoContactInformation\n }\n\n positionsSlotsUsersInfos {\n positionCategory {\n name\n }\n\n positionSlot {\n id\n name\n range\n }\n\n position {\n id\n name\n color\n icon\n }\n }\n\n slots {\n range\n }\n}\n",fragments:["UserInfoContactInformationFragment"]},EditVolunteerRegistrationSlotFragment:{code:"fragment EditVolunteerRegistrationSlot on ISlot {\n startDate\n startTime\n endDate\n endTime\n}\n",fragments:[]},EmailRecipientFragment:{code:"fragment EmailRecipient on Email {\n id\n state\n sentAt\n infos\n\n userInfo {\n ...CampaignUserInfo\n }\n}\n",fragments:["CampaignUserInfoFragment"]},EmailSenderEmailRendererFragment:{code:"fragment EmailSenderEmailRenderer on EmailsSender {\n fromName\n fromEmail\n replyTo\n signature\n\n header {\n key\n }\n\n picture {\n key\n }\n\n footer {\n key\n }\n}\n",fragments:[]},EmailTemplateEmailRendererFragment:{code:"fragment EmailTemplateEmailRenderer on EmailsTemplate {\n useDefault\n subject\n content\n attachments\n hasCalendarInvite\n calendarInviteName\n calendarInviteStartDate\n calendarInviteStartTime\n calendarInviteEndDate\n calendarInviteEndTime\n}\n",fragments:[]},EventAccreditationsFragment:{code:"fragment EventAccreditations on Event {\n accreditationsCategories {\n id\n name\n\n accreditations {\n id\n accreditationCategoryId\n name\n color\n icon\n accreditationCategoryName\n accreditationDisplay\n hasSlots\n hiddenSlotId\n index\n\n slots(includeHidden: true) {\n id\n accreditationId\n name\n date\n }\n }\n }\n}\n",fragments:[]},EventEmailRendererFragment:{code:"fragment EventEmailRenderer on Event {\n id\n organizationId\n name\n languages\n timeZone\n startAt\n endAt\n fields\n\n customDocuments {\n slug\n }\n}\n",fragments:[]},EventPositionsExportFragment:{code:"fragment EventPositionsExport on Event {\n languages\n\n segmentsFolders(segmentType: Positions) {\n id\n name\n\n segments {\n id\n name\n }\n }\n}\n",fragments:[]},EventVolunteersExportFragment:{code:"fragment EventVolunteersExport on Event {\n languages\n\n segmentsFolders(segmentType: Volunteers) {\n id\n name\n\n segments {\n id\n name\n }\n }\n}\n",fragments:[]},EventsEventFragment:{code:"fragment EventsEvent on Event {\n id\n name\n state\n startAt\n endAt\n fields\n insertedAt\n numberOfMembers @include(if: $includeNumberOfMembers)\n numberOfMembersAccredited @include(if: $includeNumberOfMembers)\n numberOfMembersAssigned @include(if: $includeNumberOfMembers)\n\n createdBy @include(if: $includeCreatedBy) {\n email\n name\n }\n\n tags {\n id\n name\n }\n}\n",fragments:[]},ExistingVolunteerFragment:{code:"fragment ExistingVolunteer on UsersInfo {\n id\n ...UserInfoContactInformation\n nameOrEmail\n}\n",fragments:["UserInfoContactInformationFragment"]},FormAccreditationsOptionsFragment:{code:"fragment FormAccreditationsOptions on Form {\n accreditationDisplay\n accreditationFilter\n showFullAccreditation\n hiddenAccreditationsCategoriesIds\n hiddenAccreditationsIds\n hiddenAccreditationsSlotsIds\n displayedAccreditationsCategoriesIds\n displayedAccreditationsIds\n displayedAccreditationsSlotsIds\n showAccreditationDescription\n slotDisplay\n\n accreditationsFormCustomFields {\n accreditationsSlotsIds\n isMandatory\n\n customField {\n ...CustomFieldWithCondition\n }\n }\n}\n",fragments:["CustomFieldWithConditionFragment"]},FormCustomFieldFragment:{code:"fragment FormCustomField on CustomField {\n id\n name\n label\n fieldType\n fieldProperty\n\n category {\n id\n name\n }\n\n conditionCustomField {\n id\n name\n }\n\n values {\n id\n value\n }\n}\n",fragments:[]},FormCustomFieldsFragment:{code:"fragment FormCustomFields on Organization {\n formCustomFields: customFields(\n variety: UserInfo\n privacy: Public\n sort: { attribute: Name, direction: Asc }\n ) {\n nodes {\n ...FormCustomField\n }\n }\n}\n",fragments:["FormCustomFieldFragment"]},FormElementDisplayFragment:{code:"fragment FormElementDisplay on FormsElement {\n id\n elementType\n isMandatory\n section\n text\n hasCondition\n conditionValue\n\n conditionCustomField {\n ...CustomFieldWithCondition\n }\n\n customField {\n ...CustomFieldWithCondition\n }\n}\n",fragments:["CustomFieldWithConditionFragment"]},FormElementsElementFragment:{code:"fragment FormElementsElement on FormsElement {\n id\n elementType\n customFieldId\n section\n text\n isMandatory\n hasCondition\n conditionCustomFieldId\n conditionValue\n}\n",fragments:[]},FormEmailFragment:{code:"fragment FormEmail on FormsUsersInfo {\n teamCode\n\n form {\n id\n areTeamsAllowed\n }\n\n ...WishesEmail\n}\n",fragments:["WishesEmailFragment"]},FormListFragment:{code:"fragment FormList on Form {\n id\n name\n numberOfCustomFields\n}\n",fragments:[]},FormMemberRegistrationFragment:{code:"fragment FormMemberRegistration on Form {\n id\n name\n isEditableInMemberSpace\n\n elements {\n id\n ...FormElementDisplay\n }\n\n ...FormSlotsOptions\n ...FormMissionsOptions\n ...FormAccreditationsOptions\n\n customSlotsPeriods {\n ...FormRegisterCustomSlotPeriod\n }\n}\n",fragments:["FormElementDisplayFragment","FormSlotsOptionsFragment","FormMissionsOptionsFragment","FormAccreditationsOptionsFragment","FormRegisterCustomSlotPeriodFragment"]},FormMissionsOptionsFragment:{code:"fragment FormMissionsOptions on Form {\n positionDisplay\n positionFilter\n positionRanking\n positionLimit\n showFullPosition\n hiddenPositionsCategoriesIds\n hiddenPositionsIds\n hiddenPositionsSlotsIds\n hiddenPositionsTagsIds\n displayedPositionsCategoriesIds\n displayedPositionsIds\n displayedPositionsSlotsIds\n displayedPositionsTagsIds\n showPositionCategoryDescription\n showPositionDescription\n slotDisplay\n willAutoAssign\n}\n",fragments:[]},FormRegisterAccreditationFragment:{code:"fragment FormRegisterAccreditation on IAccreditation {\n id\n name\n description\n color\n icon\n hiddenSlotId\n hasSlots\n accreditationDisplay\n conditionsOperator\n index\n\n slots {\n ...FormRegisterAccreditationSlot\n }\n\n conditionsCustomFields: accreditationsCustomFields {\n conditionValue\n\n customField {\n slug\n fieldType\n canSelectMultiple\n }\n }\n\n formCustomFields {\n isMandatory\n\n customField {\n ...CustomFieldWithCondition\n }\n }\n}\n",fragments:["FormRegisterAccreditationSlotFragment","CustomFieldWithConditionFragment"]},FormRegisterAccreditationCategoryFragment:{code:"fragment FormRegisterAccreditationCategory on IAccreditationsCategory {\n id\n name\n\n accreditations {\n ...FormRegisterAccreditation\n }\n}\n",fragments:["FormRegisterAccreditationFragment"]},FormRegisterAccreditationSlotFragment:{code:"fragment FormRegisterAccreditationSlot on IAccreditationsSlot {\n id\n name\n date\n isBlocked\n isFull\n}\n",fragments:[]},FormRegisterCategoryFragment:{code:"fragment FormRegisterCategory on IPositionsCategory {\n id\n name\n description\n\n positions {\n ...FormRegisterPosition\n }\n}\n",fragments:["FormRegisterPositionFragment"]},FormRegisterCustomSlotFragment:{code:"fragment FormRegisterCustomSlot on CustomSlot {\n name\n startTime\n endTime\n}\n",fragments:[]},FormRegisterCustomSlotPeriodFragment:{code:"fragment FormRegisterCustomSlotPeriod on CustomSlotsPeriod {\n id\n name\n startDate\n endDate\n hideNameDates\n displayAsCalendar\n hasCondition\n conditionCustomFieldId\n conditionValue\n\n conditionCustomField {\n ...CustomFieldWithCondition\n }\n\n customSlots {\n ...FormRegisterCustomSlot\n }\n}\n",fragments:["CustomFieldWithConditionFragment","FormRegisterCustomSlotFragment"]},FormRegisterPositionFragment:{code:"fragment FormRegisterPosition on IPosition {\n id\n name\n description\n isVisible\n conditionsOperator\n tagsIds\n\n slots {\n ...FormRegisterSlot\n }\n\n conditionsCustomFields: positionsCustomFields {\n conditionValue\n\n customField {\n slug\n fieldType\n canSelectMultiple\n }\n }\n}\n",fragments:["FormRegisterSlotFragment"]},FormRegisterSlotFragment:{code:"fragment FormRegisterSlot on IPositionsSlot {\n id\n name\n range\n nameOrRange\n isFull\n}\n",fragments:[]},FormSlotsOptionsFragment:{code:"fragment FormSlotsOptions on Form {\n slotDisplay\n daysDisplay\n slotTitle\n slotSubtitle\n}\n",fragments:[]},FormUserInfoUserProfileFragment:{code:"fragment FormUserInfoUserProfile on FormsUsersInfo {\n organizationId\n eventId\n formId\n insertedAt\n teamCode\n\n teamMembers {\n ...UserInfoTeamMember\n }\n}\n",fragments:["UserInfoTeamMemberFragment"]},FormUserInfoWishedFragment:{code:"fragment FormUserInfoWished on UsersInfo {\n formUserInfo(formId: $formId) {\n insertedAt\n formId\n positionsCategoriesIds\n positionsIds\n positionsSlotsIds\n accreditationsSlotsIds\n\n form {\n ...FormMemberRegistration\n }\n\n accreditationsSlots {\n name\n date\n\n accreditation {\n id\n name\n }\n }\n\n positionsSlots {\n nameOrRange\n\n position {\n id\n name\n }\n }\n\n positions {\n id\n name\n range\n }\n\n positionsCategories {\n id\n name\n range\n }\n\n slots {\n startDate\n startTime\n endDate\n endTime\n }\n }\n}\n",fragments:["FormMemberRegistrationFragment"]},FormUserOverlayFragment:{code:"fragment FormUserOverlay on Form {\n id\n name\n\n elements {\n ...FormElementDisplay\n }\n}\n",fragments:["FormElementDisplayFragment"]},FormsUsersInfosWishedFragment:{code:"fragment FormsUsersInfosWished on UsersInfo {\n formsUsersInfos(eventId: $eventId, level: Both) {\n insertedAt\n formId\n eventId\n positionsCategoriesIds\n positionsIds\n positionsSlotsIds\n accreditationsSlotsIds\n\n form {\n ...FormMemberRegistration\n }\n\n accreditationsSlots {\n name\n date\n\n accreditation {\n id\n name\n index\n }\n\n accreditationCategory {\n name\n }\n }\n\n positionsSlots {\n nameOrRange\n\n position {\n id\n name\n }\n }\n\n positions {\n id\n name\n range\n }\n\n positionsCategories {\n id\n name\n range\n }\n\n slots {\n startDate\n startTime\n endDate\n endTime\n range\n }\n }\n}\n",fragments:["FormMemberRegistrationFragment"]},FullPageInfoFragment:{code:"fragment FullPageInfo on PageInfo {\n hasNextPage\n hasPreviousPage\n}\n",fragments:[]},LeaderAssignmentFragment:{code:'fragment LeaderAssignment on Leader {\n userInfo {\n id\n name\n email\n firstName: fieldValue(slug: "firstName")\n lastName: fieldValue(slug: "lastName")\n phone: fieldValue(slug: "phone")\n }\n}\n',fragments:[]},LeaderInfosFragment:{code:"fragment LeaderInfos on Leader {\n role {\n id\n name\n }\n\n userInfo {\n ...LeaderUserInfo\n }\n}\n",fragments:["LeaderUserInfoFragment"]},LeaderUserInfoFragment:{code:"fragment LeaderUserInfo on UsersInfo {\n id\n userId\n ...UserInfoContactInformation\n nameOrEmail\n}\n",fragments:["UserInfoContactInformationFragment"]},MassEditCustomFieldFragment:{code:"fragment MassEditCustomField on CustomField {\n id\n name\n label\n slug\n fieldType\n fieldProperty\n canSelectMultiple\n\n values {\n id\n value\n }\n}\n",fragments:[]},MemberAccreditationFragment:{code:"fragment MemberAccreditation on AccreditationsUsersInfo {\n accreditationSlot {\n name\n date\n }\n\n accreditation {\n name\n description\n acronym\n hasSlots\n }\n\n accreditationCategory {\n name\n }\n}\n",fragments:[]},MemberAssignmentFragment:{code:"fragment MemberAssignment on PositionsSlotsUsersInfo {\n position {\n name\n description\n address\n latitude\n longitude\n zoom\n layer\n\n leaders {\n ...LeaderAssignment\n }\n\n category {\n name\n\n leaders {\n ...LeaderAssignment\n }\n }\n\n traces {\n ...Trace\n }\n }\n\n positionSlot {\n range\n }\n}\n",fragments:["LeaderAssignmentFragment","TraceFragment"]},MemberRegistrationUserInfoFragment:{code:"fragment MemberRegistrationUserInfo on UsersInfo {\n id\n userId\n ...UserInfoContactInformation\n nameOrEmail\n fields\n}\n",fragments:["UserInfoContactInformationFragment"]},OrganizationAdminInfosFragment:{code:"fragment OrganizationAdminInfos on Organization {\n name\n adminName\n adminEmail\n street\n postalCode\n city\n country\n timeZone\n emailSenderId\n dateFormat\n datetimeFormat\n timeFormat\n\n emailsSenders(isValidToSendEmail: true) {\n id\n name\n }\n}\n",fragments:[]},OrganizationBackofficeFragment:{code:"fragment OrganizationBackoffice on Organization {\n customBadges\n features\n id\n insertedAt\n isBlocked\n name\n numberOfEvents\n periodEndAt\n weezeventOrganizationId\n useOldBilling\n membersLimit\n pricePerMember\n billingComment\n\n membersStats {\n numberOfMembers\n }\n\n membersStats2024: membersStats(year: 2024) {\n numberOfMembers\n }\n\n users {\n id\n email\n }\n}\n",fragments:[]},OrganizationCertificateDefaultFragment:{code:"fragment OrganizationCertificateDefault on Organization {\n name\n adminName\n street\n city\n postalCode\n country\n}\n",fragments:[]},OrganizationCustomFieldsFragment:{code:"fragment OrganizationCustomFields on Organization {\n customFields(variety: UserInfo, privacy: All) {\n nodes {\n ...SegmentCustomField\n }\n }\n}\n",fragments:["SegmentCustomFieldFragment"]},OrganizationDelegationsSpaceFragment:{code:"fragment OrganizationDelegationsSpace on IOrganization {\n name\n allowDelegationSpaceDownload\n delegationsSpaceCustomBadges\n\n delegationsSpaceDesign: spaceDesign(spaceType: DelegationSpace) {\n colors\n logo {\n url\n }\n\n banner {\n url\n }\n }\n}\n",fragments:[]},OrganizationEmailRendererFragment:{code:"fragment OrganizationEmailRenderer on Organization {\n id\n name\n datetimeFormat\n timeZone\n}\n",fragments:[]},OrganizationEventsShowcaseFragment:{code:"fragment OrganizationEventsShowcase on OrganizationPublic {\n eventsShowcaseDesign: spaceDesign(spaceType: EventsShowcase) {\n colors\n logo {\n url\n }\n\n banner {\n url\n }\n }\n}\n",fragments:[]},OrganizationMembersSpaceFragment:{code:"fragment OrganizationMembersSpace on Organization {\n name\n\n membersSpaceDesign: spaceDesign(spaceType: MembersSpace) {\n colors\n logo {\n url\n }\n\n banner {\n url\n }\n }\n\n hideAssignmentsUntilConfirmationEmailSent\n hideAccreditationsUntilConfirmationEmailSent\n membersSpaceExcludeAccreditations\n}\n",fragments:[]},PositionCategoryPositionFragment:{code:"fragment PositionCategoryPosition on Position {\n id\n assignedResources\n name\n range\n resources\n numberOfSlots\n}\n",fragments:[]},PositionPdfInfosFragment:{code:"fragment PositionPdfInfos on Position {\n id\n eventId\n name\n description\n range\n address\n latitude\n longitude\n zoom\n layer\n numberOfSlots\n assignedResources\n acronym\n\n leaders {\n ...LeaderAssignment\n }\n\n category {\n name\n\n leaders {\n ...LeaderAssignment\n }\n }\n}\n",fragments:["LeaderAssignmentFragment"]},PositionPlanningFragment:{code:"fragment PositionPlanning on Position {\n id\n name\n color\n icon\n\n category {\n name\n }\n\n slots {\n id\n name\n range\n fillingRate\n assignedResources\n resources\n }\n}\n",fragments:[]},PositionPositionSlotFragment:{code:"fragment PositionPositionSlot on PositionsSlot {\n id\n positionCategoryId\n positionId\n assignedResources\n name\n range\n nameOrRange\n resources\n startDate\n startTime\n endDate\n endTime\n}\n",fragments:[]},PositionPositionsCustomFieldsFragment:{code:"fragment PositionPositionsCustomFields on Position {\n conditionsOperator\n\n conditionsCustomFields: positionsCustomFields {\n conditionValue\n\n customField {\n slug\n fieldType\n canSelectMultiple\n }\n }\n}\n",fragments:[]},PositionPositionsMapFragment:{code:"fragment PositionPositionsMap on Position {\n acronym\n color\n icon\n latitude\n longitude\n}\n",fragments:[]},PositionsPositionFragment:{code:"fragment PositionsPosition on Position {\n id\n name\n range\n resources\n assignedResources\n address\n latitude\n longitude\n acronym\n color\n icon\n isVisible\n state\n fillingRate\n numberOfSlots\n fields\n insertedAt\n\n checkedInRate @include(if: $includeCheckedInRate)\n\n category {\n id\n name\n\n leaders @include(if: $includeLeaders) {\n userInfo {\n id\n nameOrEmail\n }\n }\n }\n\n createdBy @include(if: $includeCreatedBy) {\n email\n name\n }\n\n leaders @include(if: $includeLeaders) {\n userInfo {\n id\n nameOrEmail\n }\n }\n\n positionsCustomFields @include(if: $includeConditions) {\n ...PositionsPositionCustomField\n }\n\n tags @include(if: $includeTags) {\n id\n name\n }\n}\n",fragments:["PositionsPositionCustomFieldFragment"]},PositionsPositionCustomFieldFragment:{code:"fragment PositionsPositionCustomField on PositionsCustomField {\n conditionValue\n\n customField {\n name\n fieldType\n\n values {\n id\n value\n }\n }\n}\n",fragments:[]},PositionsPositionSlotFragment:{code:"fragment PositionsPositionSlot on PositionsSlot {\n id\n name\n startDate\n startTime\n endDate\n endTime\n range\n assignedResources\n resources\n fillingRate\n state\n insertedAt\n\n checkedInRate @include(if: $includeCheckedInRate)\n\n position {\n id\n name\n fields\n acronym\n color\n icon\n address\n latitude\n longitude\n\n createdBy @include(if: $includeCreatedBy) {\n email\n name\n }\n\n positionsCustomFields @include(if: $includeConditions) {\n ...PositionsPositionCustomField\n }\n\n tags @include(if: $includeTags) {\n id\n name\n }\n }\n\n positionCategory {\n id\n name\n }\n}\n",fragments:["PositionsPositionCustomFieldFragment"]},PsuiUserHoursFragment:{code:"fragment PsuiUserHours on PositionsSlotsUsersInfo {\n breakTime\n checkInAt\n checkOutAt\n timeDifferenceMinutes\n\n positionSlot {\n range\n }\n\n position {\n name\n }\n}\n",fragments:[]},PsuiUserPlanningFragment:{code:"fragment PsuiUserPlanning on PositionsSlotsUsersInfo {\n id\n\n positionSlot {\n name\n range\n }\n\n position {\n name\n color\n }\n}\n",fragments:[]},SegmentCampaignFragment:{code:"fragment SegmentCampaign on Campaign {\n id\n name\n campaignType\n}\n",fragments:[]},SegmentCustomFieldFragment:{code:"fragment SegmentCustomField on CustomField {\n id\n slug\n name\n label\n fieldType\n fieldProperty\n canSelectMultiple\n customFieldCategoryId\n customFieldCategoryName\n isSelectV2\n isEncrypted\n\n values {\n id\n value\n }\n}\n",fragments:[]},SegmentEventFragment:{code:"fragment SegmentEvent on Event {\n id\n name\n}\n",fragments:[]},SegmentFormFragment:{code:"fragment SegmentForm on Form {\n id\n name\n}\n",fragments:[]},SegmentsFoldersSegmentsFragment:{code:"fragment SegmentsFoldersSegments on SegmentsFolder {\n id\n name\n\n segments {\n id\n segmentFolderId\n name\n predicates\n columns\n columnsExport\n columnsSearch\n sort\n count\n rendering\n description\n isUsedInWorkflow\n infos\n }\n}\n",fragments:[]},SpaceDesignFragment:{code:"fragment SpaceDesign on Design {\n banner {\n acl\n name\n key\n }\n\n logo {\n acl\n name\n key\n }\n\n colors\n}\n",fragments:[]},TraceFragment:{code:"fragment Trace on Trace {\n id\n name\n color\n points\n direction\n}\n",fragments:[]},TranslationFragment:{code:"fragment Translation on Translation {\n id\n translationType\n module\n fr\n en\n es\n de\n nl\n isFrTranslated\n isEnTranslated\n isEsTranslated\n isDeTranslated\n isNlTranslated\n frString\n enString\n esString\n deString\n nlString\n}\n",fragments:[]},UpdateUserFormFragment:{code:"fragment UpdateUserForm on Form {\n id\n name\n areTeamsAllowed\n delegationsIds\n\n elements {\n ...FormElementDisplay\n }\n}\n",fragments:["FormElementDisplayFragment"]},UserAllPermissionsFragment:{code:"fragment UserAllPermissions on UsersInfo {\n usersOrganizations {\n id\n sendNotifications\n\n role {\n id\n name\n type\n }\n }\n\n usersEvents(eventId: $eventId) {\n id\n\n event {\n id\n name\n }\n\n role {\n id\n name\n type\n }\n }\n\n usersDelegations(eventId: $eventId) {\n id\n eventId\n userInfoId\n\n delegation {\n name\n }\n }\n\n usersDelegationsCategories(eventId: $eventId) {\n id\n eventId\n\n delegationCategory {\n name\n }\n\n role {\n id\n name\n }\n }\n\n usersPositionsCategories(eventId: $eventId) {\n id\n eventId\n\n positionCategory {\n name\n }\n\n role {\n id\n name\n }\n }\n\n usersPositions(eventId: $eventId) {\n id\n eventId\n\n position {\n name\n }\n\n role {\n id\n name\n }\n }\n}\n",fragments:[]},UserInfoCommunityFragment:{code:'fragment UserInfoCommunity on UsersInfo {\n id\n name\n email\n nameOrEmail\n fields\n insertedAt\n phone: fieldValue(slug: "phone")\n\n ...UserAllPermissions @include(if: $includeRoles)\n\n picture {\n url\n }\n\n events @include(if: $includeEvents) {\n id\n name\n }\n\n delegations(level: Organization) @include(if: $includeDelegations) {\n id\n name\n\n delegationCategory {\n id\n name\n }\n }\n\n formsUsersInfos(level: Organization) @include(if: $includeForms) {\n id\n insertedAt\n\n form {\n id\n name\n }\n }\n\n tags @include(if: $includeTags) {\n id\n name\n }\n}\n',fragments:["UserAllPermissionsFragment"]},UserInfoContactInformationFragment:{code:"fragment UserInfoContactInformation on UsersInfo {\n ...UserInfoNameAndPicture\n email\n phone {\n internationalFormat\n }\n}\n",fragments:["UserInfoNameAndPictureFragment"]},UserInfoDocumentFragment:{code:'fragment UserInfoDocument on UsersInfo {\n id\n ...UserInfoContactInformation\n nameOrEmail\n language: fieldValue(slug: "language")\n fields(expand: true)\n registrationDate(eventId: $eventId)\n\n links(eventId: $eventId) {\n ...UserInfoLinks\n }\n}\n',fragments:["UserInfoContactInformationFragment","UserInfoLinksFragment"]},UserInfoEmailRendererFragment:{code:"fragment UserInfoEmailRenderer on UsersInfo {\n id\n email\n fields\n registrationDate(eventId: $eventId)\n\n links(eventId: $eventId) {\n ...UserInfoLinks\n }\n\n user {\n id\n language\n }\n}\n",fragments:["UserInfoLinksFragment"]},UserInfoFormFragment:{code:"fragment UserInfoForm on UsersInfo {\n id\n email\n nameOrEmail\n fields\n registrationDate(eventId: $eventId)\n canAccess(formId: $formId)\n\n links(eventId: $eventId) {\n ...UserInfoLinks\n }\n}\n",fragments:["UserInfoLinksFragment"]},UserInfoLinksFragment:{code:"fragment UserInfoLinks on UserInfoDocumentLink {\n userAssignmentsLink\n userBadgeLink\n userCertificateLink\n userCustomBadgeLinks\n userCustomDocumentLinks\n userHoursLink\n userPlanningLink\n userPlanningDaysLink\n userPlanningListLink\n}\n",fragments:[]},UserInfoNameAndPictureFragment:{code:"fragment UserInfoNameAndPicture on UsersInfo {\n name\n picture {\n url\n }\n}\n",fragments:[]},UserInfoOrganizationFragment:{code:"fragment UserInfoOrganization on UsersInfo {\n id\n userId\n name\n email\n nameOrEmail\n\n ...UserAllPermissions\n\n picture {\n url\n }\n}\n",fragments:["UserAllPermissionsFragment"]},UserInfoOverlayFragment:{code:'fragment UserInfoOverlay on UsersInfo {\n id\n name\n email\n nameOrEmail\n fields\n phone: fieldValue(slug: "phone")\n population: fieldValue(slug: "population")\n language: fieldValue(slug: "language")\n\n picture {\n url\n }\n}\n',fragments:[]},UserInfoTeamMemberFragment:{code:"fragment UserInfoTeamMember on UsersInfo {\n id\n ...UserInfoContactInformation\n}\n",fragments:["UserInfoContactInformationFragment"]},UserInfoTeamRightPanelFragment:{code:"fragment UserInfoTeamRightPanel on VolunteersRegistration {\n positionsCategories {\n positions {\n id\n name\n icon\n color\n\n slots {\n id\n name\n range\n }\n }\n }\n\n positions {\n id\n name\n icon\n color\n\n slots {\n id\n name\n range\n }\n }\n\n positionsSlots {\n id\n name\n range\n\n position {\n id\n name\n icon\n color\n }\n }\n\n positionsSlotsUsersInfos {\n positionSlot {\n id\n name\n range\n }\n\n position {\n id\n name\n icon\n color\n }\n }\n\n userInfo {\n id\n ...UserInfoContactInformation\n }\n}\n",fragments:["UserInfoContactInformationFragment"]},UserPanelAccreditationSlotUserInfoFragment:{code:"fragment UserPanelAccreditationSlotUserInfo on AccreditationsUsersInfo {\n id\n eventId\n isAutoAccredit\n isWorkflow\n checkInAt\n insertedAt\n checkInAt\n state\n\n accreditationCategory {\n name\n }\n\n accreditation {\n id\n name\n color\n icon\n index\n }\n\n accreditationSlot {\n id\n name\n date\n }\n\n createdBy {\n email\n name\n }\n}\n",fragments:[]},UserPermissionsFragment:{code:"fragment UserPermissions on User {\n roles(organizationId: $organizationId, eventId: $eventId) {\n id\n accessLevel\n type\n permissions\n }\n\n usersDelegationsCategories(eventId: $eventId) {\n delegationCategoryId\n roleId\n }\n\n usersEvents(eventId: $eventId) {\n eventId\n roleId\n }\n\n usersPositionsCategories(eventId: $eventId) {\n positionCategoryId\n roleId\n }\n\n usersPositions(eventId: $eventId) {\n positionId\n roleId\n }\n}\n",fragments:[]},UserPositionSlotUserInfoFragment:{code:"fragment UserPositionSlotUserInfo on PositionsSlotsUsersInfo {\n breakTime\n checkInAt\n checkOutAt\n eventId\n id\n insertedAt\n isAutoAssign\n organizationId\n positionCategoryId\n state\n timeDifferenceMinutes\n userInfoId\n\n createdBy {\n email\n name\n }\n\n position {\n id\n acronym\n color\n icon\n name\n }\n\n positionSlot {\n id\n name\n range\n }\n\n positionCategory {\n id\n name\n }\n}\n",fragments:[]},VolunteerInfosFragment:{code:'fragment VolunteerInfos on VolunteersRegistration {\n delegation {\n id\n name\n }\n\n userInfo {\n id\n name\n email\n phone: fieldValue(slug: "phone")\n picture {\n url\n }\n }\n}\n',fragments:[]},VolunteerPdfFragment:{code:"fragment VolunteerPdf on VolunteersRegistration {\n teams {\n teamCode\n }\n\n userInfo {\n id\n ...UserInfoContactInformation\n fields\n }\n}\n",fragments:["UserInfoContactInformationFragment"]},VolunteerRegistrationFragment:{code:"fragment VolunteerRegistration on VolunteersRegistration {\n id\n localId\n ticketId\n state\n accreditationState\n insertedAt\n canDelete\n canRegistrationStateUpdate @include(if: $includeCanRegistrationStateUpdate)\n numberOfAccreditations @include(if: $includeNumberOfAccreditations)\n numberOfAssignments @include(if: $includeNumberOfAssignments)\n numberOfAssignmentsDays @include(if: $includeNumberOfAssignmentsDays)\n numberOfAvailableDays @include(if: $includeNumberOfAvailableDays)\n shortTag\n volunteerMinutes @include(if: $includeVolunteerMinutes)\n weezeventPairedAt @include(if: $includeWeezevent)\n weezeventPayUrl @include(if: $includeWeezeventUrls)\n weezeventTicketUrl @include(if: $includeWeezeventUrls)\n delegationBannerNumber @include(if: $includeDelegation)\n\n delegation @include(if: $includeDelegation) {\n id\n name\n\n delegationCategory {\n id\n name\n }\n }\n\n userInfo {\n id\n userId\n organizationId\n email\n name\n nameOrEmail\n fields\n isEditable @include(if: $includeIsEditable)\n insertedAt\n\n picture @include(if: $includePicture) {\n url\n }\n\n ...UserAllPermissions @include(if: $includeRoles)\n\n links(eventId: $eventId) {\n ...UserInfoLinks\n }\n\n comments @include(if: $includeComments) {\n content\n }\n\n emails(emailTypes: [Campaign], delegationId: $delegationId) @include(if: $includeEmails) {\n id\n state\n\n campaign {\n name\n }\n }\n\n formsUsersInfos(level: Event, eventId: $eventId) @include(if: $includeFormsUsersInfos) {\n id\n insertedAt\n\n form @include(if: $includeForms) {\n id\n name\n slotDisplay\n }\n\n slots @include(if: $includeAvailability) {\n id\n range\n }\n\n teamMembers @include(if: $includeTeam) {\n ...UserInfoTeamMember\n }\n }\n\n tags @include(if: $includeTags) {\n id\n name\n }\n }\n\n accreditationsUsersInfos(\n delegationId: $delegationId\n onlyVisible: $onlyVisibleAccreditationsSlots\n ) @include(if: $includeAccreditations) {\n checkInAt\n\n accreditationSlot {\n ...AccreditationSlotVolunteerRegistration\n }\n }\n\n matrixAuis: accreditationsUsersInfos(\n delegationId: $delegationId\n onlyVisible: $onlyVisibleAccreditationsSlots\n ) @include(if: $includeAccreditationsMatrix) {\n accreditationSlotId\n isAutoAccredit\n }\n\n accreditationsSlots(delegationId: $delegationId, onlyVisible: $onlyVisibleAccreditationsSlots)\n @include(if: $includeAccreditations) {\n ...AccreditationSlotVolunteerRegistration\n }\n\n matrixWishedSlots: accreditationsSlots @include(if: $includeAccreditationsMatrix) {\n id\n }\n\n duplicatedFrom @include(if: $includeDuplicatedFrom) {\n userInfo {\n id\n email\n name\n\n picture {\n url\n }\n }\n }\n\n positionsSlotsUsersInfos @include(if: $includePositions) {\n ...UserPositionSlotUserInfo\n }\n\n positionsCategories @include(if: $includeWishedPositions) {\n id\n name\n }\n\n positions @include(if: $includeWishedPositions) {\n id\n acronym\n color\n icon\n name\n }\n\n positionsSlots @include(if: $includeWishedPositions) {\n id\n name\n range\n\n position {\n acronym\n color\n icon\n name\n }\n }\n\n preassignPositionsCategories @include(if: $includePreassignedPositions) {\n id\n name\n }\n\n preassignPositions @include(if: $includePreassignedPositions) {\n id\n name\n }\n\n teams @include(if: $includeTeam) {\n teamCode\n }\n\n weezaccessChecklists @include(if: $includeWeezeventChecklists) {\n id\n name\n }\n}\n",fragments:["UserAllPermissionsFragment","UserInfoLinksFragment","UserInfoTeamMemberFragment","AccreditationSlotVolunteerRegistrationFragment","UserPositionSlotUserInfoFragment"]},VolunteerRegistrationDelegationAccreditationSlotFragment:{code:"fragment VolunteerRegistrationDelegationAccreditationSlot on VolunteersRegistration {\n id\n\n accreditationsSlots {\n id\n }\n\n accreditationsUsersInfos {\n accreditationSlotId\n }\n\n userInfo {\n id\n ...UserInfoContactInformation\n }\n}\n",fragments:["UserInfoContactInformationFragment"]},VolunteerRegistrationEmailRendererFragment:{code:'fragment VolunteerRegistrationEmailRenderer on VolunteersRegistration {\n localId\n ticketId\n weezevent\n\n delegation {\n name\n\n leaders {\n firstName: fieldValue(slug: "firstName")\n lastName: fieldValue(slug: "lastName")\n phone: fieldValue(slug: "phone")\n }\n }\n}\n',fragments:[]},VolunteerRegistrationWaitingAssignmentFragment:{code:"fragment VolunteerRegistrationWaitingAssignment on VolunteersRegistration {\n insertedAt\n\n userInfo {\n id\n ...UserInfoContactInformation\n }\n}\n",fragments:["UserInfoContactInformationFragment"]},VolunteerRegistrationWeezeventFragment:{code:"fragment VolunteerRegistrationWeezevent on VolunteersRegistration {\n id\n state\n accreditationState\n ticketId\n weezevent\n\n accreditationsUsersInfos {\n accreditationSlotId\n accreditationCategoryId\n\n accreditation {\n id\n name\n fields\n }\n }\n\n positionsSlotsUsersInfos {\n positionCategory {\n id\n name\n }\n\n position {\n id\n name\n }\n }\n\n delegation {\n name\n\n delegationCategory {\n name\n }\n }\n\n userInfo {\n id\n ...UserInfoContactInformation\n fieldsExpanded: fields(expand: true)\n }\n}\n",fragments:["UserInfoContactInformationFragment"]},VolunteerRegistrationZplRendererFragment:{code:'fragment VolunteerRegistrationZplRenderer on VolunteersRegistration {\n localId\n ticketId\n weezevent\n\n accreditationsUsersInfos {\n accreditation {\n id\n }\n accreditationSlot {\n id\n }\n }\n\n delegation {\n name\n\n leaders {\n firstName: fieldValue(slug: "firstName")\n lastName: fieldValue(slug: "lastName")\n phone: fieldValue(slug: "phone")\n }\n }\n\n userInfo {\n id\n email\n fields\n registrationDate\n }\n}\n',fragments:[]},WishesEmailFragment:{code:"fragment WishesEmail on FormsUsersInfo {\n positionsCategories {\n name\n }\n\n positions {\n name\n }\n\n slots {\n range\n }\n\n accreditationsSlots {\n name\n date\n\n accreditation {\n name\n }\n }\n}\n",fragments:[]},WorkflowsWorkflowFragment:{code:"fragment WorkflowsWorkflow on Workflow {\n id\n name\n state\n trigger\n action\n executedAt\n insertedAt\n\n createdBy {\n email\n name\n }\n\n data {\n errorMessage\n }\n\n accreditationsSlots @include(if: $includeAccreditations) {\n ...AccreditationSlotVolunteerRegistration\n }\n\n campaign @include(if: $includeCampaign) {\n id\n name\n }\n\n customField @include(if: $includeCustomField) {\n id\n name\n }\n\n volunteersSegment {\n id\n name\n }\n}\n",fragments:["AccreditationSlotVolunteerRegistrationFragment"]},ZapierMemberFragment:{code:"fragment ZapierMember on UsersInfo {\n id\n fields(expand: true)\n email\n insertedAt\n updatedAt\n deletedAt\n}\n",fragments:[]}};function Us(e){return e.flatMap(e=>[e.code].concat(Us(e.fragments.map(e=>Vs[e]))))}function Ws(e){return(0,Bs.A)(Us(e)).join(" ")}var Gs=n(8097);const Hs="yyyy-MM-dd",qs="yyyy-MM-dd'T'HH:mm",Ks="yyyy-MM-dd'T'HH:mm:ss";function Ys(e){const[t,n]=JSON.parse(e);return Gs.IX.fromDateTimes(Gs.c9.fromISO(t,{zone:"UTC"}),Gs.c9.fromISO(n,{zone:"UTC"}))}function Zs({startDate:e,startTime:t,endDate:n,endTime:i}){try{const[s,o]=t.split(":"),[r,a]=i.split(":");return Gs.IX.fromDateTimes(e.set({hour:parseInt(s,10),minute:parseInt(o,10)}),n.set({hour:parseInt(r,10),minute:parseInt(a,10)}))}catch{return Gs.IX.invalid("Invalid")}}function Xs(e){return Gs.IX.isInterval(e)?e:Zs(e)}function Js(e){return{startDate:e.start.set({hour:0,minute:0,second:0}),startTime:e.start.toFormat("HH:mm:ss"),endDate:e.end.set({hour:0,minute:0,second:0}),endTime:e.end.toFormat("HH:mm:ss")}}const Qs=(e,t)=>e.contains(t)||e.start.startOf("day").toMillis()===t.startOf("day").toMillis()||e.end.minus({minute:1}).startOf("day").toMillis()===t.startOf("day").toMillis(),eo={DateOnly:{Numeric:{year:"numeric",month:"2-digit",day:"2-digit"},MonthLong:{year:"numeric",month:"long",day:"numeric"},MonthShort:{year:"numeric",month:"short",day:"numeric"},WeekdayLongMonthLong:{year:"numeric",month:"long",day:"numeric",weekday:"long"},WeekdayShortMonthLong:{year:"numeric",month:"long",day:"numeric",weekday:"short"},WeekdayShortMonthShort:{year:"numeric",month:"short",day:"numeric",weekday:"short"},MonthLongYear:{year:"numeric",month:"long"}},TimeOnly:{hour:"2-digit",minute:"2-digit"},DateTime:{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"},FullDateTime:{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"},ShortDateTime:{year:"numeric",month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"}};function to(){return Gs.c9.utc().toLocal().zoneName}function no(e){if(!0===Array.isArray(e))return e.map(e=>null!=e&&"object"==typeof e?no(e):e);if("boolean"==typeof e||"number"==typeof e||"string"==typeof e||null===e)return e;{const t={};return Object.keys(e).forEach(n=>{const i=e[n];Wn.includes(n)||Un.includes(n)?t[n]=i&&Gs.c9.fromISO(i,{zone:"UTC"}):Gn.includes(n)?Array.isArray(i)?t[n]=i.map(Ys):t[n]=i&&Ys(i):Hn.includes(n)?t[n]=i&&Gs.dw.fromISO(i):t[n]=null!=i&&"object"==typeof i?no(i):i}),t}}function io(e){return null==e?[]:Array.isArray(e)?e:[e]}function so(e){return Array.isArray(e)&&e.length>0}function oo(e){return!so(e)}function ro(e,t,n){const i=new Set(e);return n?i.add(t):i.delete(t),Array.from(i)}function ao(e,t){const n=new Set(e);return n.has(t)?n.delete(t):n.add(t),Array.from(n)}function lo(e,t,n){const i=[...e],[s]=i.splice(t,1);return i.splice(n,0,s),i}function co(e,t){return e.filter((e,n)=>n!==t)}const uo="31f667ffb8566a2ec7fb8d372e440aac2c309938\n".trim();var ho=n(7405);const mo="h-new-version";async function go(e,t={}){let n=P.HEAVENT_API_URL.href;const i=new URL(location.href).searchParams,s=`${e} ${so(t.fragments)?Ws(t.fragments):""}`,o={"Content-Type":"application/json",[F]:uo,[M]:V()};i.has("lang")&&(n=`${n}?lang=${i.get("lang")}`),t.token&&(o[N]=t.token);const r=await fetch(n,{method:"post",headers:o,body:JSON.stringify({query:s,variables:t.variables||{}})});if(r.ok){t.reloadOnNewVersion&&"true"===r.headers.get("x-heavent-new-version")&&document.body.dispatchEvent(new CustomEvent(mo,{bubbles:!0}));const e=await r.json();if(e.errors){const t=e.errors[0]?.message??"";if("You need to be logged-in"===t)return localStorage.clear(),location.href="/crew",{};if(t.startsWith("You do not have access to this"))return location.href="/crew",{};throw e.errors}{const t=(0,ho.A)(e.data),n={};return t.forEach(t=>{n[t]=no(e.data[t])}),n}}throw new Error(r.statusText)}function po(e,t,n){const i=Object.keys(t).sort().map(e=>{const n=t[e];return`"${e}":${JSON.stringify(n)}`}).join(",");return(0,L.useMemo)(()=>Y().then(i=>go(e,{variables:t,token:i||void 0,fragments:n})),[e,i])}const fo="query CustomFieldsMassEditInfos($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n customFieldsCategories {\n nodes {\n id\n name\n }\n }\n }\n}\n",_o="query DelegationsMassEditInfos(\n $organizationId: OrganizationId!\n $eventId: EventId\n $level: OrganizationEventLevel!\n) {\n organization(id: $organizationId) {\n campaigns(level: $level, eventId: $eventId, states: [Template]) {\n nodes {\n id\n name\n }\n }\n\n customFields(variety: Delegation, sort: { attribute: Name, direction: Asc }) {\n nodes {\n ...MassEditCustomField\n }\n }\n\n delegationsCategories(level: $level, eventId: $eventId) {\n nodes {\n id\n name\n }\n }\n\n forms(level: $level, eventId: $eventId) {\n nodes {\n id\n name\n }\n }\n\n tags {\n nodes {\n id\n name\n }\n }\n\n event: eventMaybe(id: $eventId) {\n customDocuments {\n slug\n name\n }\n }\n }\n}\n",xo='query PositionsSearch(\n $organizationId: OrganizationId!\n $eventId: EventId\n $hasSelected: Boolean!\n $ids: [PositionId!]!\n $name: String\n) {\n organization(id: $organizationId) {\n list: positions(\n eventId: $eventId\n name: $name\n limit: 50\n sort: { attribute: "Name", direction: Asc }\n ) {\n nodes {\n id\n name\n\n event {\n id\n name\n }\n }\n }\n\n selected: positions(ids: $ids) @include(if: $hasSelected) {\n nodes {\n id\n name\n\n event {\n id\n name\n }\n }\n }\n }\n}\n',Io="query Tags($organizationId: OrganizationId!, $eventId: EventId, $context: TagContext) {\n organization(id: $organizationId) {\n tags(eventId: $eventId, context: $context) {\n nodes {\n id\n name\n }\n }\n }\n}\n",vo="query Users(\n $organizationId: OrganizationId!\n $eventId: EventId\n $predicates: [Predicate!]!\n $name: String\n $columnsSearch: [String!]\n $limit: Int\n $offset: Int\n $sort: UsersInfosSort\n $delegationCategoryId: DelegationsCategoryId\n $delegationId: DelegationId\n $includeDelegations: Boolean!\n $includeEvents: Boolean!\n $includeForms: Boolean!\n $includeTags: Boolean!\n $includeRoles: Boolean!\n) {\n data: organization(id: $organizationId) {\n rows: usersInfos(\n predicates: $predicates\n name: $name\n columnsSearch: $columnsSearch\n delegationCategoryId: $delegationCategoryId\n delegationId: $delegationId\n limit: $limit\n offset: $offset\n sort: $sort\n ) {\n nodes {\n ...UserInfoCommunity\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",bo="query Volunteers(\n $eventId: EventId!\n $predicates: [Predicate!]!\n $limit: Int\n $offset: Int\n $sort: VolunteersRegistrationsSort\n $name: String\n $columnsSearch: [String!]\n $positionCategoryId: PositionsCategoryId\n $positionId: PositionId\n $preassignedPositionCategoryId: PositionsCategoryId\n $preassignedPositionId: PositionId\n $accreditationCategoryId: AccreditationsCategoryId\n $accreditationId: AccreditationId\n $accreditationSlotId: AccreditationsSlotId\n $delegationCategoryId: DelegationsCategoryId\n $delegationId: DelegationId\n $hasCoordinates: Boolean\n $onlyVisibleAccreditationsSlots: Boolean\n $includeAccreditations: Boolean!\n $includeAccreditationsMatrix: Boolean!\n $includeAvailability: Boolean!\n $includeCanRegistrationStateUpdate: Boolean!\n $includeComments: Boolean!\n $includeDelegation: Boolean!\n $includeDuplicatedFrom: Boolean!\n $includeEmails: Boolean!\n $includeFormsUsersInfos: Boolean!\n $includeForms: Boolean!\n $includeIsEditable: Boolean!\n $includeNumberOfAccreditations: Boolean!\n $includeNumberOfAssignments: Boolean!\n $includeNumberOfAssignmentsDays: Boolean!\n $includeNumberOfAvailableDays: Boolean!\n $includePicture: Boolean!\n $includePositions: Boolean!\n $includeRoles: Boolean!\n $includeTags: Boolean!\n $includeTeam: Boolean!\n $includeTraces: Boolean!\n $includeVolunteerMinutes: Boolean!\n $includeWishedPositions: Boolean!\n $includePreassignedPositions: Boolean!\n $includeWeezeventChecklists: Boolean!\n $includeWeezevent: Boolean!\n $includeWeezeventUrls: Boolean!\n) {\n data: event(id: $eventId) {\n layer\n latitude\n longitude\n\n rows: volunteersRegistrations(\n predicates: $predicates\n name: $name\n columnsSearch: $columnsSearch\n positionCategoryId: $positionCategoryId\n positionId: $positionId\n preassignedPositionCategoryId: $preassignedPositionCategoryId\n preassignedPositionId: $preassignedPositionId\n accreditationCategoryId: $accreditationCategoryId\n accreditationId: $accreditationId\n accreditationSlotId: $accreditationSlotId\n delegationCategoryId: $delegationCategoryId\n delegationId: $delegationId\n hasCoordinates: $hasCoordinates\n limit: $limit\n offset: $offset\n sort: $sort\n ) {\n nodes {\n ...VolunteerRegistration\n }\n\n numberOfPages\n totalCount\n }\n\n traces @include(if: $includeTraces) {\n ...Trace\n }\n }\n}\n",jo="mutation UserCreate {\n userCreate {\n id\n email\n }\n}\n";function Co(e){return Qn('query AccreditAssignWaitingMembers(\n $eventId: EventId!\n $states: [VolunteerRegistrationState!]\n $accreditationStates: [AccreditationState!]\n $name: String\n $segmentId: SegmentId\n $delegationId: DelegationId\n $direction: SortDirection!\n $loadDelegations: Boolean!\n) {\n event(id: $eventId) {\n delegations @include(if: $loadDelegations) {\n nodes {\n id\n name\n }\n }\n\n segmentsFolders(segmentType: Volunteers) {\n id\n name\n\n segments {\n id\n name\n }\n }\n\n volunteersRegistrations(\n states: $states\n accreditationStates: $accreditationStates\n name: $name\n segmentId: $segmentId\n delegationId: $delegationId\n sort: { attribute: "InsertedAt", direction: $direction }\n ) {\n nodes {\n ...VolunteerRegistrationWaitingAssignment\n }\n\n totalCount\n }\n }\n}\n',e,[Vs.VolunteerRegistrationWaitingAssignmentFragment])}function yo(e={}){return ei("mutation VolunteersRegistrationsMassAccredit(\n $eventId: EventId!\n $massAccredit: MassAccreditInput!\n) {\n numberOfMembers: volunteersRegistrationsMassAccredit(\n eventId: $eventId\n massAccredit: $massAccredit\n )\n}\n",e)}function ko(e={}){return ei("mutation CampaignCreate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $campaign: CampaignInput!\n) {\n campaignCreate(organizationId: $organizationId, eventId: $eventId, campaign: $campaign) {\n id\n }\n}\n",e)}function Ao(e={}){return ei("mutation CampaignUpdate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $campaignId: CampaignId!\n $campaign: CampaignInput!\n) {\n campaignUpdate(\n organizationId: $organizationId\n eventId: $eventId\n campaignId: $campaignId\n campaign: $campaign\n ) {\n id\n }\n}\n",e)}function wo(e){return Qn("query CreateCampaignInfos(\n $organizationId: OrganizationId!\n $eventId: EventId\n $userInfoId: UsersInfoId\n) {\n organization(id: $organizationId) {\n adminEmail\n emailSenderId\n timeZone\n\n emailsSenders(isValidToSendEmail: true) {\n ...CreateCampaignEmailSender\n }\n\n event: eventMaybe(id: $eventId) {\n timeZone\n\n customDocuments {\n slug\n name\n }\n\n emailSender {\n ... on EmailsSender {\n id\n }\n }\n }\n\n userInfo: userInfoMaybe(id: $userInfoId) {\n name\n }\n }\n}\n",e,[Vs.CreateCampaignEmailSenderFragment])}function So(e={}){return ei("mutation EventLayerUpdate($eventId: EventId!, $layer: MapLayer!) {\n eventLayerUpdate(eventId: $eventId, layer: $layer) {\n id\n }\n}\n",e)}function Eo(e={}){return ei("mutation AccreditationsMassEdit($eventId: EventId!, $massEdit: MassEditInput!) {\n numberOfEdited: accreditationsMassEdit(eventId: $eventId, massEdit: $massEdit)\n}\n",e)}function To(e={}){return ei("mutation CustomFieldsMassEdit($organizationId: OrganizationId!, $massEdit: MassEditInput!) {\n numberOfEdited: customFieldsMassEdit(organizationId: $organizationId, massEdit: $massEdit)\n}\n",e)}function zo(e,t){return go(fo,{variables:e,token:t||void 0,fragments:[]})}function Oo(e={}){return ei("mutation DelegationsMassEdit(\n $organizationId: OrganizationId!\n $eventId: EventId\n $massEdit: MassEditInput!\n) {\n numberOfEdited: delegationsMassEdit(\n organizationId: $organizationId\n eventId: $eventId\n massEdit: $massEdit\n )\n}\n",e)}function Ro(e,t){return go(_o,{variables:e,token:t||void 0,fragments:[Vs.MassEditCustomFieldFragment]})}function $o(e={}){return ei("mutation EventsMassEdit($organizationId: OrganizationId!, $massEdit: MassEditInput!) {\n eventsMassEdit(organizationId: $organizationId, massEdit: $massEdit)\n}\n",e)}function Do(e={}){return ei("mutation PositionsMassEdit($eventId: EventId!, $massEdit: MassEditInput!) {\n numberOfEdited: positionsMassEdit(eventId: $eventId, massEdit: $massEdit)\n}\n",e)}function Po(e={}){return ei("mutation UsersInfosMassEdit(\n $organizationId: OrganizationId!\n $eventId: EventId\n $delegationId: DelegationId\n $massEdit: MassEditInput!\n) {\n numberOfEdited: usersInfosMassEdit(\n organizationId: $organizationId\n eventId: $eventId\n delegationId: $delegationId\n massEdit: $massEdit\n )\n}\n",e)}function Fo(e,t){return go("query DelegationAccreditationSlotStats(\n $eventId: EventId!\n $delegationId: DelegationId!\n $accreditationSlotId: AccreditationsSlotId!\n) {\n event(id: $eventId) {\n delegation(id: $delegationId) {\n accreditationSlot(id: $accreditationSlotId) {\n ...DelegationAccreditationSlotStats\n }\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[Vs.DelegationAccreditationSlotStatsFragment]})}function Mo(e={}){return ei("mutation EventDocumentsExport(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $delegationId: DelegationId\n $documentsExport: DocumentsExportInput!\n) {\n eventDocumentsExport(\n organizationId: $organizationId\n eventId: $eventId\n delegationId: $delegationId\n documentsExport: $documentsExport\n )\n}\n",e)}function No(e={}){return ei("mutation UsersInfosMassDelegationDelete(\n $organizationId: OrganizationId!\n $eventId: EventId\n $delegationId: DelegationId!\n $selecteds: MassActionSelectedsInput!\n $deleteFromEvent: Boolean\n) {\n usersInfosMassDelegationDelete(\n organizationId: $organizationId\n eventId: $eventId\n delegationId: $delegationId\n selecteds: $selecteds\n deleteFromEvent: $deleteFromEvent\n )\n}\n",e)}function Lo(e){return Qn("query OrganizationParametersInfos($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n ...OrganizationAdminInfos\n }\n}\n",e,[Vs.OrganizationAdminInfosFragment])}function Bo(e={}){return ei("mutation PositionsSlotsUsersInfosCheckIn($eventId: EventId!, $checkIn: PositionSlotCheckInInput!) {\n numberOfMembers: positionsSlotsUsersInfosCheckIn(eventId: $eventId, checkIn: $checkIn)\n}\n",e)}function Vo(e){return Qn("query UserPositions(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $userInfoId: UsersInfoId!\n) {\n organization(id: $organizationId) {\n hideAssignmentsUntilConfirmationEmailSent\n\n userInfo(id: $userInfoId) {\n ...FormsUsersInfosWished\n }\n }\n\n event(id: $eventId) {\n name\n startAt\n endAt\n dayStartTime\n hasFormWithPositionDisplay\n hasFormWithSlotDisplay\n\n volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n id\n volunteerMinutes\n isAssignmentsEmailSent\n\n positionsSlotsUsersInfos {\n ...UserPositionSlotUserInfo\n }\n\n preassignPositions {\n id\n name\n range\n }\n\n preassignPositionsCategories {\n id\n name\n range\n }\n }\n }\n}\n",e,[Vs.FormsUsersInfosWishedFragment,Vs.UserPositionSlotUserInfoFragment])}function Uo(e,t){return go(Io,{variables:e,token:t||void 0,fragments:[]})}function Wo(e={}){return ei("mutation VolunteersRegistrationsMassDelete(\n $eventId: EventId!\n $selecteds: MassActionSelectedsInput!\n) {\n numberOfMembers: volunteersRegistrationsMassDelete(eventId: $eventId, selecteds: $selecteds)\n}\n",e)}function Go(e,t){return go("query User(\n $organizationId: OrganizationId!\n $eventId: EventId\n $id: UsersInfoId!\n $includeDelegations: Boolean!\n $includeEvents: Boolean!\n $includeForms: Boolean!\n $includeTags: Boolean!\n $includeRoles: Boolean!\n) {\n data: organization(id: $organizationId) {\n row: userInfo(id: $id) {\n ...UserInfoCommunity\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[Vs.UserInfoCommunityFragment]})}function Ho(e,t){return go(vo,{variables:e,token:t||void 0,fragments:[Vs.UserInfoCommunityFragment]})}function qo(e){return Qn("query Profile($organizationId: OrganizationId!) {\n user {\n email\n language\n\n userInfo(organizationId: $organizationId) {\n id\n fields\n }\n }\n}\n",e,[])}function Ko(e={}){return ei("mutation UserProfileUpdate(\n $userId: UserId!\n $userInfoId: UsersInfoId!\n $userInfo: UsersInfoEmailInput!\n) {\n userProfileUpdate(userId: $userId, userInfoId: $userInfoId, userInfo: $userInfo) {\n email\n language\n }\n}\n",e)}function Yo(e={}){return ei("mutation EmailResend(\n $organizationId: OrganizationId!\n $eventId: EventId\n $userInfoId: UsersInfoId!\n $emailType: EmailType!\n) {\n emailResend(\n organizationId: $organizationId\n eventId: $eventId\n userInfoId: $userInfoId\n emailType: $emailType\n ) {\n id\n }\n}\n",e)}function Zo(e){return Qn("query UserOverlaySlots(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $userInfoId: UsersInfoId!\n) {\n organization(id: $organizationId) {\n userInfo(id: $userInfoId) {\n ...FormsUsersInfosWished\n }\n }\n\n event(id: $eventId) {\n hasFormWithSlotDisplay\n }\n}\n",e,[Vs.FormsUsersInfosWishedFragment])}function Xo(e={}){return ei("mutation VolunteersRegistrationsAccreditationsValidate(\n $eventId: EventId!\n $delegationId: DelegationId!\n $usersInfosIds: [UsersInfoId!]\n) {\n volunteersRegistrationsAccreditationsValidate(\n eventId: $eventId\n delegationId: $delegationId\n usersInfosIds: $usersInfosIds\n )\n}\n",e)}function Jo(e={}){return ei("mutation VolunteersRegistrationsMassAccreditationStateUpdate(\n $eventId: EventId!\n $massStateUpdate: MassAccreditationStateUpdateInput!\n) {\n numberOfMembers: volunteersRegistrationsMassAccreditationStateUpdate(\n eventId: $eventId\n massStateUpdate: $massStateUpdate\n )\n}\n",e)}function Qo(e={}){return ei("mutation VolunteersRegistrationsMassAssign($eventId: EventId!, $massAssign: MassAssignInput!) {\n numberOfMembers: volunteersRegistrationsMassAssign(eventId: $eventId, massAssign: $massAssign)\n}\n",e)}function er(e={}){return ei("mutation VolunteersRegistrationsMassDelegationAdd(\n $eventId: EventId!\n $delegationId: DelegationId!\n $selecteds: MassActionSelectedsInput!\n) {\n numberOfMembers: volunteersRegistrationsMassDelegationAdd(\n eventId: $eventId\n delegationId: $delegationId\n selecteds: $selecteds\n )\n}\n",e)}function tr(e={}){return ei("mutation VolunteersRegistrationsMassStateUpdate(\n $eventId: EventId!\n $massStateUpdate: MassStateUpdateInput!\n) {\n numberOfMembers: volunteersRegistrationsMassStateUpdate(\n eventId: $eventId\n massStateUpdate: $massStateUpdate\n )\n}\n",e)}function nr(e){return Qn("query VolunteersSegments(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $privacy: CustomFieldPrivacy!\n $loadForms: Boolean!\n $loadSegments: Boolean!\n) {\n organization(id: $organizationId) {\n customFields(variety: UserInfo, privacy: $privacy) {\n nodes {\n ...SegmentCustomField\n }\n }\n }\n\n event(id: $eventId) {\n startAt\n endAt\n dayStartTime\n isWeezeventConnected\n\n forms @include(if: $loadForms) {\n nodes {\n id\n name\n }\n }\n\n segmentsFolders(segmentType: Volunteers) @include(if: $loadSegments) {\n ...SegmentsFoldersSegments\n }\n }\n}\n",e,[Vs.SegmentCustomFieldFragment,Vs.SegmentsFoldersSegmentsFragment])}function ir(e,t){return go("query UpdateCellDelegations($eventId: EventId!) {\n event(id: $eventId) {\n delegations {\n nodes {\n id\n name\n }\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}function sr(e={}){return ei("mutation VolunteerRegistrationUpdateField(\n $eventId: EventId!\n $volunteerRegistrationId: VolunteersRegistrationId!\n $slug: String!\n $value: JSON!\n) {\n volunteerRegistrationUpdateField(\n eventId: $eventId\n volunteerRegistrationId: $volunteerRegistrationId\n slug: $slug\n value: $value\n ) {\n id\n }\n}\n",e)}function or(e,t){return go("query Volunteer(\n $eventId: EventId!\n $id: VolunteersRegistrationId!\n $delegationId: DelegationId\n $onlyVisibleAccreditationsSlots: Boolean\n $includeAccreditations: Boolean!\n $includeAccreditationsMatrix: Boolean!\n $includeAvailability: Boolean!\n $includeCanRegistrationStateUpdate: Boolean!\n $includeComments: Boolean!\n $includeDelegation: Boolean!\n $includeDuplicatedFrom: Boolean!\n $includeEmails: Boolean!\n $includeFormsUsersInfos: Boolean!\n $includeForms: Boolean!\n $includeIsEditable: Boolean!\n $includeNumberOfAccreditations: Boolean!\n $includeNumberOfAssignments: Boolean!\n $includeNumberOfAssignmentsDays: Boolean!\n $includeNumberOfAvailableDays: Boolean!\n $includePicture: Boolean!\n $includePositions: Boolean!\n $includeRoles: Boolean!\n $includeTags: Boolean!\n $includeTeam: Boolean!\n $includeVolunteerMinutes: Boolean!\n $includeWishedPositions: Boolean!\n $includePreassignedPositions: Boolean!\n $includeWeezeventChecklists: Boolean!\n $includeWeezevent: Boolean!\n $includeWeezeventUrls: Boolean!\n) {\n data: event(id: $eventId) {\n row: volunteerRegistration(id: $id) {\n ...VolunteerRegistration\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[Vs.VolunteerRegistrationFragment]})}function rr(e){return Qn(bo,e,[Vs.VolunteerRegistrationFragment,Vs.TraceFragment])}function ar(e,t){return go(bo,{variables:e,token:t||void 0,fragments:[Vs.VolunteerRegistrationFragment,Vs.TraceFragment]})}function lr(e={}){return ei("mutation UsersInfosMassCampaignSend(\n $organizationId: OrganizationId!\n $eventId: EventId\n $delegationId: DelegationId\n $campaignId: CampaignId!\n $selecteds: MassActionSelectedsInput!\n) {\n numberOfMembers: usersInfosMassCampaignSend(\n organizationId: $organizationId\n eventId: $eventId\n delegationId: $delegationId\n campaignId: $campaignId\n selecteds: $selecteds\n )\n}\n",e)}function dr(e={}){return ei("mutation VolunteersRegistrationsMassWishedAccreditationsUpdate(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $delegationId: DelegationId!\n $massAccredit: MassAccreditInput!\n) {\n volunteersRegistrationsMassWishedAccreditationsUpdate(\n organizationId: $organizationId\n eventId: $eventId\n delegationId: $delegationId\n massAccredit: $massAccredit\n )\n}\n",e)}const cr=()=>{const{code:e,source:t,organizationId:n,eventId:i}=ti();return(0,L.useEffect)(()=>{const s=localStorage.getItem(W),o=localStorage.getItem(U);if(m(s)&&m(o)&&m(e)&&m(t)){localStorage.removeItem(W),localStorage.removeItem(U);const r=new B.TU({Username:s,Pool:q()});r.Session=o,r.setAuthenticationFlowType("CUSTOM_AUTH"),r.sendCustomChallengeAnswer(e,{async onSuccess(e){const s=e.getIdToken().getJwtToken();await go(jo,{token:s}),n&&i&&t===tt.VolunteerRegister?location.href=Ns(n,i):n&&i&&t===tt.VolunteerAssignments?location.href=Ls(n,i):t===tt.App?location.href=Ps.HOME:location.href="/"},onFailure(e){di("Could not sendCustomChallengeAnswer",e),location.href="/"}})}else location.href="/"},[]),null};var ur=n(5126);function hr(e){if(e){const[t,n,i]=e.split(" ");return{color:t,fontSize:n,fontWeight:i}}return{}}function mr(e){return"string"==typeof e?e:"number"==typeof e?e<=1?100*e+"%":`${e}px`:void 0}var gr=n(3345);const pr={mobile:"screen and (max-width: 743px)",tablet:"screen and (min-width: 744px)",desktop:"screen and (min-width: 1280px)"},fr="-apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'",{styled:_r,theme:xr,config:Ir,getCssText:vr,createTheme:br,keyframes:jr,reset:Cr}=(0,gr.GC)({theme:{colors:{gray25:"#fcfcfd",gray50:"#f9fafb",gray100:"#f2f4f7",gray200:"#e4e7ec",gray300:"#d0d5dd",gray400:"#98a2b3",gray500:"#667085",gray600:"#475467",gray700:"#344054",gray800:"#1d2939",gray900:"#101828",grayDark50:"#f0f3f4",grayDark100:"#dfe4e7",grayDark500:"#667c8a",grayDark700:"#3d4a52",primary50:"#F0EBF9",primary100:"#E0D8F3",primary200:"#C4B4E9",primary300:"#A58DDD",primary400:"#8666D1",primary500:"#6941C6",primary600:"#5230A1",primary700:"#3E257A",primary800:"#2A1952",primary900:"#140C27",primary950:"#0A0614",error25:"#fffbfa",error50:"#fef3f2",error100:"#fee4e2",error200:"#fecdca",error300:"#fda29b",error400:"#f97066",error500:"#f04438",error600:"#d92d20",error700:"#b42318",error800:"#912018",error900:"#7a271a",warning25:"#fffcf5",warning50:"#fffaeb",warning100:"#fef0c7",warning200:"#fedf89",warning300:"#fec84b",warning400:"#fdb022",warning500:"#f79009",warning600:"#dc6803",warning700:"#b54708",warning800:"#93370d",warning900:"#7a2e0e",success25:"#f6fef9",success50:"#ecfdf3",success100:"#d1fadf",success200:"#a6f4c5",success300:"#6ce9a6",success400:"#32d583",success500:"#12b76a",success600:"#039855",success700:"#027a48",success800:"#05603a",success900:"#054f31",blue25:"#f5faff",blue50:"#edf4fd",blue100:"#dae9fb",blue200:"#b2ddff",blue300:"#84caff",blue400:"#53b1fd",blue500:"#4995ec",blue600:"#1570ef",blue700:"#1157a6",blue800:"#1849a9",blue900:"#194185",blueGray50:"#edeef8",blueGray100:"#daddf1",blueGray500:"#4352af",blueGray600:"#3e4784",blueGray700:"#29326b",blueGray900:"#272e3c",blueLight50:"#eff9fb",blueLight100:"#dff2f6",blueLight500:"#54bad1",blueLight600:"#0086C9",blueLight700:"#267a8d",purple25:"#fafaff",purple50:"#f4e7f8",purple100:"#ecd4f2",purple200:"#d9d6fe",purple300:"#bdb4fe",purple400:"#9b8afb",purple500:"#9033aa",purple600:"#6938ef",purple700:"#571f66",purple800:"#4a1fb8",purple900:"#3e1c96",purpleLight50:"#f9e7f8",purpleLight100:"#f2cef1",purpleLight500:"#9d2999",purpleLight700:"#5d185b",purpleDark50:"#f0ecf8",purpleDark100:"#ded5f0",purpleDark500:"#613eb1",purpleDark700:"#3a256a",pink25:"#fef6fb",pink50:"#fdf2fa",pink100:"#fce7f6",pink200:"#fcceee",pink300:"#faa7e0",pink400:"#f670c7",pink500:"#ee46bc",pink600:"#dd2590",pink700:"#c01574",pink800:"#9e165f",pink900:"#851651",orange50:"#fcefed",orange100:"#f9dbd7",orange500:"#e15241",orange700:"#962418",redLight50:"#fff1f3",redLight100:"#ffe4e8",redLight500:"#f63d68",redLight700:"#c01048",redDark50:"#fbeaef",redDark100:"#f7d9e2",redDark500:"#d63865",redDark700:"#871c3a",green50:"#eff6ee",green100:"#dfeedd",green500:"#67ad5c",green700:"#3c6935",greenDark50:"#eaf6f4",greenDark100:"#d5ece9",greenDark500:"#429488",greenDark700:"#275851",brown50:"#f3eeec",brown100:"#e5dbd7",brown500:"#74574a",brown700:"#44342c",white:"white"},space:{1:"4px",2:"8px",3:"12px",4:"16px",5:"20px",6:"24px",7:"32px",8:"40px",9:"48px",10:"64px",11:"80px",12:"96px",13:"128px"},fonts:{default:`'Open Sans', ${fr}`,grafik:`Graphik, ${fr}`,montserrat:`Montserrat, ${fr}`,madurai:`'Hind Madurai', ${fr}`,gravur:`'Gravur Condensed', ${fr}`,anton:`Anton, ${fr}`,brito:`'Brito Tri', ${fr}`,orbitron:`Orbitron, ${fr}`,dharma:`'Dharma Punk', ${fr}`,roboto:`Roboto, ${fr}`,poppins:`Poppins, ${fr}`,inter:`Inter, ${fr}`,paytone:`'Paytone One', ${fr}`,gothamBlack:`'Gotham Black', ${fr}`,gothamBold:`'Gotham Bold', ${fr}`,gothamBook:`'Gotham Book', ${fr}`,gothamMedium:`'Gotham Medium', ${fr}`,now:`'Now Medium', ${fr}`,franklinGothic:`'Franklin Gothic', ${fr}`,kobe:`Kobe, ${fr}`,nowMedium:`"Now Medium", ${fr}`,nowSemiBold:`"Now SemiBold", ${fr}`,badTyp:`BadTyp, ${fr}`,lemonMilk:`LemonMilk, ${fr}`,futura:`Futura, ${fr}`,urbanist:`Urbanist, ${fr}`,unbounded:`Unbounded, ${fr}`,magallanes:`Magallanes, ${fr}`,parisine:`ParisineBold, ${fr}`,bricolage:`Bricolage, ${fr}`,paris2024:`Paris2024, ${fr}`,dinCondensed:`DinCondensed, ${fr}`,gothamRoundedBook:`"Gotham Rounded Book", ${fr}`,gothamRoundedBold:`"Gotham Rounded Bold", ${fr}`,gothamRoundedMedium:`"Gotham Rounded Medium", ${fr}`,albert:`"Albert Sans", ${fr}`,bebasNeue:`BebasNeue, ${fr}`,encode:`"Encode Sans", ${fr}`,gilroy:`Gilroy, ${fr}`,tuskerGrotesk:`TuskerGrotesk, ${fr}`,rubik:`Rubik, ${fr}`,bnCartaNoirBold:`"BN Carta Noir Bold", ${fr}`,firaSans:`"Fira Sans", ${fr}`,arimo:`Arimo, ${fr}`,neueMontreal:`NeueMontreal, ${fr}`,helveticaBlackCondensed:`HelveticaBlackCondensed, ${fr}`,zuumeMedium:`"Zuume Medium", ${fr}`,zuumeBold:`"Zuume Bold", ${fr}`,formulaCondensedBold:`FormulaCondensedBold, ${fr}`,raleway:`Raleway, ${fr}`,avenir:`Avenir, ${fr}`,work:`"Work Sans", ${fr}`,movement:`Movement, ${fr}`,atrament:`Atrament, ${fr}`,sharpGrotesk:`SharpGrotesk, ${fr}`,utopiales:`Utopiales, ${fr}`,lato:`Lato, ${fr}`,helveticaNeue97BlackCondensed:`HelveticaNeue97BlackCondensed, ${fr}`,graphie:`Graphie, ${fr}`,archerBoldPro:`ArcherBoldPro, ${fr}`,acumin:`Acumin, ${fr}`,kabel:`Kabel, ${fr}`,moonstruck:`Moonstruck, ${fr}`,chillax:`Chillax, ${fr}`,neufileGrotesk:`NeufileGrotesk, ${fr}`,tungsten:`Tungsten, ${fr}`,FKRomanStandard:`FKRomanStandard, ${fr}`},fontSizes:{textXs:"12px",textSm:"14px",textMd:"16px",textLg:"18px",textXl:"20px",displayXs:"24px",displaySm:"30px",displayMd:"36px",displayLg:"48px",displayXl:"60px",display2Xl:"72px"},fontWeights:{regular:400,medium:500,semiBold:600,bold:700},radii:{1:"4px",2:"8px",3:"12px"},shadows:{xs:"0px 1px 2px rgba(16, 24, 40, 0.05)",sm:"0px 1px 3px rgba(16, 24, 40, 0.1), 0px 1px 2px rgba(16, 24, 40, 0.06)",md:"0px 4px 8px -2px rgba(16, 24, 40, 0.1), 0px 2px 4px -2px rgba(16, 24, 40, 0.06)",mdReverse:"0px -4px 8px -2px rgba(16, 24, 40, 0.1), 0px -2px 4px -2px rgba(16, 24, 40, 0.06)",lg:"0px 12px 16px -4px rgba(16, 24, 40, 0.1), 0px 4px 6px -2px rgba(16, 24, 40, 0.05)",xl:"0px 20px 24px -4px rgba(16, 24, 40, 0.1), 0px 8px 8px -4px rgba(16, 24, 40, 0.04)","2xl":"0px 24px 48px -12px rgba(16, 24, 40, 0.25)","3xl":"0px 32px 64px -12px rgba(16, 24, 40, 0.2)"},sizes:{container:"1170px",containerTablet:"704px",modalSm:"480px",modalMd:"640px",modalLg:"720px",cellHeightSm:"48px",cellHeightMd:"64px",cellHeightXl:"120px",cellWidth:"120px"}},media:pr,utils:{bd:e=>{let t="$gray200",n="$2",i="$xs";if(m(e)){const s=function(e){if(e){const[t,n,i]=e.split(" ");return{borderColor:t,borderRadius:n,boxShadow:i}}return{}}(e);s.borderColor&&(t=`$${s.borderColor}`),s.borderRadius&&(n=`$${s.borderRadius}`),i=s.boxShadow?`$${s.boxShadow}`:void 0}return{borderColor:t,borderRadius:n,borderStyle:"solid",borderWidth:"1px",boxShadow:i}},clamp:e=>({display:"-webkit-box",overflow:"hidden","-webkit-line-clamp":e,"-webkit-box-orient":"vertical"}),ellipsis:()=>({overflow:"hidden","text-overflow":"ellipsis","white-space":"nowrap"}),px:e=>({paddingLeft:e,paddingRight:e}),py:e=>({paddingBottom:e,paddingTop:e})}}),yr=br("weezcrew-theme",{}),kr=_r("div",{variants:{color:{inherit:{color:"inherit"},cyan:{color:"$cyan"},gray25:{color:"$gray25"},gray50:{color:"$gray50"},gray100:{color:"$gray100"},gray200:{color:"$gray200"},gray300:{color:"$gray300"},gray400:{color:"$gray400"},gray500:{color:"$gray500"},gray600:{color:"$gray600"},gray700:{color:"$gray700"},gray800:{color:"$gray800"},gray900:{color:"$gray900"},primary25:{color:"$primary25"},primary50:{color:"$primary50"},primary100:{color:"$primary100"},primary200:{color:"$primary200"},primary300:{color:"$primary300"},primary400:{color:"$primary400"},primary500:{color:"$primary500"},primary600:{color:"$primary600"},primary700:{color:"$primary700"},primary800:{color:"$primary800"},primary900:{color:"$primary900"},error25:{color:"$error25"},error50:{color:"$error50"},error100:{color:"$error100"},error200:{color:"$error200"},error300:{color:"$error300"},error400:{color:"$error400"},error500:{color:"$error500"},error600:{color:"$error600"},error700:{color:"$error700"},error800:{color:"$error800"},error900:{color:"$error900"},warning25:{color:"$warning25"},warning50:{color:"$warning50"},warning100:{color:"$warning100"},warning200:{color:"$warning200"},warning300:{color:"$warning300"},warning400:{color:"$warning400"},warning500:{color:"$warning500"},warning600:{color:"$warning600"},warning700:{color:"$warning700"},warning800:{color:"$warning800"},warning900:{color:"$warning900"},success25:{color:"$success25"},success50:{color:"$success50"},success100:{color:"$success100"},success200:{color:"$success200"},success300:{color:"$success300"},success400:{color:"$success400"},success500:{color:"$success500"},success600:{color:"$success600"},success700:{color:"$success700"},success800:{color:"$success800"},success900:{color:"$success900"},blue25:{color:"$blue25"},blue50:{color:"$blue50"},blue100:{color:"$blue100"},blue200:{color:"$blue200"},blue300:{color:"$blue300"},blue400:{color:"$blue400"},blue500:{color:"$blue500"},blue600:{color:"$blue600"},blue700:{color:"$blue700"},blue800:{color:"$blue800"},blue900:{color:"$blue900"},blueGray25:{color:"$blueGray25"},blueGray50:{color:"$blueGray50"},blueGray100:{color:"$blueGray100"},blueGray200:{color:"$blueGray200"},blueGray300:{color:"$blueGray300"},blueGray400:{color:"$blueGray400"},blueGray500:{color:"$blueGray500"},blueGray600:{color:"$blueGray600"},blueGray700:{color:"$blueGray700"},blueGray800:{color:"$blueGray800"},blueGray900:{color:"$blueGray900"},blueLight100:{color:"$blueLight100"},blueLight400:{color:"$blueLight400"},blueLight600:{color:"$blueLight600"},blueLight900:{color:"$blueLight900"},purple25:{color:"$purple25"},purple50:{color:"$purple50"},purple100:{color:"$purple100"},purple200:{color:"$purple200"},purple300:{color:"$purple300"},purple400:{color:"$purple400"},purple500:{color:"$purple500"},purple600:{color:"$purple600"},purple700:{color:"$purple700"},purple800:{color:"$purple800"},purple900:{color:"$purple900"},pink25:{color:"$pink25"},pink50:{color:"$pink50"},pink100:{color:"$pink100"},pink200:{color:"$pink200"},pink300:{color:"$pink300"},pink400:{color:"$pink400"},pink500:{color:"$pink500"},pink600:{color:"$pink600"},pink700:{color:"$pink700"},pink800:{color:"$pink800"},pink900:{color:"$pink900"},orange100:{color:"$orange100"},orange400:{color:"$orange400"},orange600:{color:"$orange600"},orange700:{color:"$orange700"},indigo100:{color:"$indigo100"},indigo600:{color:"$indigo600"},white:{color:"white"}},fontSize:{inherit:{fontSize:"inherit"},textXs:{fontSize:"$textXs"},textSm:{fontSize:"$textSm"},textMd:{fontSize:"$textMd"},textLg:{fontSize:"$textLg"},textXl:{fontSize:"$textXl"},displayXs:{fontSize:"$displayXs"},displaySm:{fontSize:"$displaySm"},displayMd:{fontSize:"$displayMd"},displayLg:{fontSize:"$displayLg"},displayXl:{fontSize:"$displayXl"},display2Xl:{fontSize:"$display2Xl"}},fontWeight:{inherit:{fontWeight:"inherit"},regular:{fontWeight:"$regular"},medium:{fontWeight:"$medium"},semiBold:{fontWeight:"$semiBold"},bold:{fontWeight:"$bold"}},textAlign:{start:{textAlign:"start"},end:{textAlign:"end"},center:{textAlign:"center"},justify:{textAlign:"justify"}},ellipsis:{true:{ellipsis:""}}},defaultVariants:{color:"inherit",fontSize:"inherit",fontWeight:"inherit",textAlign:"start"}}),Ar=L.forwardRef((e,t)=>{const n={};return e.height&&(n.height=mr(e.height)),e.width&&(n.width=mr(e.width)),(0,i.jsx)(kr,{...(0,ur.A)(e,"font"),...hr(e.font),ref:t,css:{...n,...e.css}})});Ar.displayName="Box";var wr=n(4625),Sr=n(6347),Er=n(8542);function Tr(e){return"number"==typeof e&&!isNaN(e)}function zr(e,t=96){return Math.round(25.4*e/t)}function Or(e){return e?{lat:e.latitude,lng:e.longitude}:null}const Rr=Or({latitude:43.6087733,longitude:3.87963579999996}),$r=13;function Dr(e,t,n){return{center:e??Rr,zoom:t??$r,fullscreenControl:!1,mapTypeControl:!1,streetViewControl:!1,mapTypeId:Fr(n),styles:[{featureType:"poi",stylers:[{visibility:"off"}]},{featureType:"poi.government",stylers:[{visibility:"on"}]},{featureType:"poi.park",stylers:[{visibility:"on"}]}]}}function Pr(e){return Tr(e.latitude)&&Tr(e.longitude)?(0,Er.A)(e,["latitude","longitude"]):void 0}function Fr(e){return e===nt.GoogleSatellite?"satellite":e===nt.Google?"roadmap":e??nt.Google}var Mr=n(6996),Nr=n(2096);function Lr(){return new google.maps.ImageMapType({getTileUrl:(e,t)=>((e,t)=>`https://data.geopf.fr/wmts?${["REQUEST=GetTile","SERVICE=WMTS","VERSION=1.0.0","STYLE=normal","TILEMATRIXSET=PM",`FORMAT=${encodeURIComponent("image/png")}`,"LAYER=GEOGRAPHICALGRIDSYSTEMS.PLANIGNV2",`TILEMATRIX=${t}`,`TILEROW=${e.y}`,`TILECOL=${e.x}`].join("&")}`)(e,t),tileSize:new google.maps.Size(256,256),name:nt.IgnPlan,maxZoom:18})}const Br=(0,L.memo)(e=>{const t=(0,L.useCallback)(t=>{t&&(n.current&&(s.current?.setMap(null),n.current=null),n.current=new google.maps.Map(t,{zoom:e.coordinatesFieldsProps?.zoomProps.input.value??e.initialZoom??$r,center:Or(e.center)||Rr,gestureHandling:"cooperative",mapTypeControl:!1,streetViewControl:!1,mapTypeId:Fr(e.layer),...e.mapOptions||{}}),n.current.mapTypes.set(nt.IgnPlan,Lr()),n.current.addListener("zoom_changed",()=>{e.coordinatesFieldsProps&&e.coordinatesFieldsProps.zoomProps.input.onChange(n.current.getZoom())}),n.current.addListener("tilesloaded",()=>{e.onTilesloaded?.()}),r())},[]),n=(0,L.useRef)(null),s=(0,L.useRef)(null),o=(0,L.useRef)([]),r=()=>{o.current.forEach(e=>e.setMap(null)),so(e.traces)?o.current=e.traces.map(e=>{const t=e.points.map(([e,t])=>({lat:e,lng:t})),i=e.direction===Tt.None?[]:[{icon:{path:e.direction===Tt.Backward?google.maps.SymbolPath.BACKWARD_OPEN_ARROW:google.maps.SymbolPath.FORWARD_OPEN_ARROW,scale:4,strokeColor:e.color},offset:"0%",repeat:"200px"}],s=new google.maps.Polyline({path:t,geodesic:!0,strokeColor:e.color,strokeOpacity:1,strokeWeight:4,icons:i});return s.setMap(n.current),s}):o.current=[]};return(0,L.useEffect)(()=>{(()=>{if(s.current&&s.current.setMap(null),e.point&&n.current){const t=Or(e.point);n.current.setCenter(t),s.current=new google.maps.Marker({position:t,map:n.current,draggable:"object"==typeof e.coordinatesFieldsProps&&null!==e.coordinatesFieldsProps}),e.coordinatesFieldsProps&&s.current.addListener("dragend",t=>{e.coordinatesFieldsProps?.latitudeProps.input.onChange(t.latLng.lat()),e.coordinatesFieldsProps?.longitudeProps.input.onChange(t.latLng.lng())})}})()},[JSON.stringify(e.point)]),(0,L.useEffect)(()=>{n.current?.setMapTypeId(Fr(e.layer))},[e.layer]),(0,L.useEffect)(()=>{r()},[JSON.stringify(e.traces||[])]),(0,i.jsx)(Ar,{ref:t,height:1,width:1,children:e.coordinatesFieldsProps?.zoomProps&&(0,i.jsx)(Nr.Yr,{name:e.coordinatesFieldsProps.zoomProps.input.name,children:e=>{n.current?.setZoom(e)}})})},Mr.A);Br.displayName="Map";const Vr=()=>(0,Kt.createPortal)((0,i.jsx)(Ar,{className:"h-map-loaded",css:{background:"transparent",height:"1px",left:"-100px",position:"absolute",top:"-100px",width:"1px"}}),document.body),Ur="query BackofficeOrganization($organizationId: OrganizationId!) {\n data: backoffice {\n row: organization(id: $organizationId) {\n ...OrganizationBackoffice\n }\n }\n}\n";function Wr(e,t){return go("query AccreditationsCategories($eventId: EventId!) {\n event(id: $eventId) {\n accreditationsCategories {\n id\n name\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}function Gr(e={}){return ei("mutation AccreditationsMassDelete($eventId: EventId!, $selecteds: MassActionSelectedsInput!) {\n numberOfAccreditations: accreditationsMassDelete(eventId: $eventId, selecteds: $selecteds)\n}\n",e)}function Hr(e={}){return ei("mutation AccreditationSlotUpdate(\n $eventId: EventId!\n $accreditationSlotId: AccreditationsSlotId!\n $accreditationSlot: AccreditationsSlotInput!\n) {\n accreditationSlotUpdate(\n eventId: $eventId\n accreditationSlotId: $accreditationSlotId\n accrediationSlot: $accreditationSlot\n ) {\n id\n }\n}\n",e)}function qr(e){return Qn('query SendEmailInfos($eventId: EventId!, $usersInfosIds: [UsersInfoId!]!, $name: String) {\n event(id: $eventId) {\n segments(segmentType: Volunteers) {\n id\n name\n }\n\n volunteersRegistrations(\n name: $name\n limit: 50\n sort: { attribute: "Name", direction: Asc }\n ) {\n nodes {\n id\n\n userInfo {\n id\n nameOrEmail\n }\n }\n }\n\n selectedVolunteersRegistrations: volunteersRegistrations(\n userInfoIds: $usersInfosIds\n sort: { attribute: "Name", direction: Asc }\n ) {\n nodes {\n id\n\n userInfo {\n id\n nameOrEmail\n }\n }\n }\n }\n}\n',e,[])}function Kr(e,t){return go(Ur,{variables:e,token:t||void 0,fragments:[Vs.OrganizationBackofficeFragment]})}function Yr(e,t){return go("query BackofficeOrganizations(\n $name: String\n $predicates: [Predicate!]\n $limit: Int\n $offset: Int\n $sort: OrganizationSort\n) {\n data: backoffice {\n rows: organizations(\n name: $name\n predicates: $predicates\n limit: $limit\n offset: $offset\n sort: $sort\n ) {\n nodes {\n ...OrganizationBackoffice\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[Vs.OrganizationBackofficeFragment]})}function Zr(e){return Qn("query CampaignPreview(\n $organizationId: OrganizationId!\n $campaignId: CampaignId!\n $userInfoId: UsersInfoId!\n) {\n organization(id: $organizationId) {\n campaign(id: $campaignId) {\n sendToEveryone\n preview(userInfoId: $userInfoId)\n subject: subjectPreview(userInfoId: $userInfoId)\n attachments\n sentAt\n states\n\n createdBy {\n name\n email\n picture {\n url\n }\n }\n\n documents {\n ...DocumentEmailPreview\n }\n\n emailSender {\n fromEmail\n fromName\n }\n\n usersInfos {\n id\n nameOrEmail\n }\n\n segments {\n id\n name\n }\n\n positionsCategories {\n id\n name\n }\n\n positions {\n id\n name\n }\n\n positionsSlots {\n id\n nameOrRange\n\n position {\n id\n name\n }\n }\n\n tags {\n id\n name\n }\n\n accreditationsCategories {\n id\n name\n }\n\n accreditations {\n id\n name\n }\n\n accreditationsSlots {\n id\n name\n\n accreditation {\n id\n name\n }\n }\n }\n }\n}\n",e,[Vs.DocumentEmailPreviewFragment])}function Xr(e){return Qn("query OrganizationImportInfos($organizationId: OrganizationId!, $variety: CustomFieldVariety) {\n organization(id: $organizationId) {\n customFields(\n variety: $variety\n fieldTypes: [\n Address\n Checkbox\n Country\n Date\n Datetime\n Language\n Nationality\n Number\n Phone\n Select\n Sex\n Text\n Textarea\n Time\n Validation\n ]\n ) {\n nodes {\n ...CustomFieldImport\n }\n }\n }\n}\n",e,[Vs.CustomFieldImportFragment])}function Jr(e={}){return ei("mutation UsersInfosMerge(\n $organizationId: OrganizationId!\n $mainUserInfoId: UsersInfoId!\n $toMergeUsersInfosIds: [UsersInfoId!]!\n) {\n usersInfosMerge(\n organizationId: $organizationId\n mainUserInfoId: $mainUserInfoId\n toMergeUsersInfosIds: $toMergeUsersInfosIds\n ) {\n id\n }\n}\n",e)}function Qr(e={}){return ei("mutation CustomFieldsMassDelete(\n $organizationId: OrganizationId!\n $selecteds: MassActionSelectedsInput!\n) {\n numberOfCustomFields: customFieldsMassDelete(\n organizationId: $organizationId\n selecteds: $selecteds\n )\n}\n",e)}function ea(e={}){return ei("mutation DelegationCreate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $delegation: DelegationInput!\n) {\n delegationCreate(organizationId: $organizationId, eventId: $eventId, delegation: $delegation) {\n id\n }\n}\n",e)}function ta(e={}){return ei("mutation DelegationUpdate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $delegationId: DelegationId!\n $delegation: DelegationInput!\n) {\n delegationUpdate(\n organizationId: $organizationId\n eventId: $eventId\n delegationId: $delegationId\n delegation: $delegation\n ) {\n id\n }\n}\n",e)}function na(e={}){return ei("mutation DelegationDuplicate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $delegationId: DelegationId!\n) {\n delegationDuplicate(\n organizationId: $organizationId\n eventId: $eventId\n delegationId: $delegationId\n ) {\n id\n }\n}\n",e)}function ia(e){return Qn("query Delegations(\n $organizationId: OrganizationId!\n $eventId: EventId\n $level: OrganizationEventLevel!\n $name: String\n $predicates: [Predicate!]\n $columnsSearch: [String!]\n $limit: Int\n $offset: Int\n $sort: DelegationsSort\n $includeAccreditationsSlots: Boolean!\n $includeCampaigns: Boolean!\n $includeChildren: Boolean!\n $includeCreatedBy: Boolean!\n $includeDocuments: Boolean!\n $includeLeaders: Boolean!\n $includeResources: Boolean!\n $includeTags: Boolean!\n $includeUsedCustomFieldsFilled: Boolean!\n) {\n data: organization(id: $organizationId) {\n rows: delegations(\n level: $level\n eventId: $eventId\n name: $name\n predicates: $predicates\n columnsSearch: $columnsSearch\n limit: $limit\n offset: $offset\n sort: $sort\n ) {\n nodes {\n ...DelegationsDelegation\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",e,[Vs.DelegationsDelegationFragment])}function sa(e={}){return ei("mutation DelegationsMassDelete(\n $organizationId: OrganizationId!\n $eventId: EventId\n $selecteds: MassActionSelectedsInput!\n) {\n numberOfDelegations: delegationsMassDelete(\n organizationId: $organizationId\n eventId: $eventId\n selecteds: $selecteds\n )\n}\n",e)}function oa(e){return Qn("query AllEvents($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n events {\n nodes {\n id\n name\n }\n }\n }\n}\n",e,[])}function ra(e){return Qn("query Events(\n $organizationId: OrganizationId!\n $name: String\n $predicates: [Predicate!]\n $limit: Int\n $offset: Int\n $sort: EventsSort\n $includeCreatedBy: Boolean!\n $includeNumberOfMembers: Boolean!\n) {\n data: organization(id: $organizationId) {\n rows: events(\n name: $name\n whereUserIsLeader: true\n predicates: $predicates\n offset: $offset\n limit: $limit\n sort: $sort\n ) {\n nodes {\n ...EventsEvent\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",e,[Vs.EventsEventFragment])}function aa(e={}){return ei("mutation FormDuplicate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $formId: FormId!\n $newEventId: EventId\n) {\n formDuplicate(\n organizationId: $organizationId\n eventId: $eventId\n formId: $formId\n newEventId: $newEventId\n ) {\n id\n }\n}\n",e)}function la(e){return Qn("query Forms($organizationId: OrganizationId!, $level: OrganizationEventLevel!, $eventId: EventId) {\n organization(id: $organizationId) {\n forms(level: $level, eventId: $eventId) {\n nodes {\n ...FormList\n }\n }\n }\n}\n",e,[Vs.FormListFragment])}function da(e){return Qn("query Form($organizationId: OrganizationId!, $formId: FormId!) {\n organization(id: $organizationId) {\n form(id: $formId) {\n name\n }\n }\n}\n",e,[])}function ca(e={}){return ei("mutation PositionsMassLeadersEdit($eventId: EventId!, $massLeaders: MassLeadersInput!) {\n numberOfPositions: positionsMassLeadersEdit(eventId: $eventId, massLeaders: $massLeaders)\n}\n",e)}function ua(e){return Qn("query Organizations {\n organizations {\n id\n name\n }\n\n user {\n roles {\n organizationId\n type\n }\n }\n}\n",e,[])}function ha(e){return Qn("query OrganizationSpaceDesign(\n $organizationId: OrganizationId!\n $includeIntro: Boolean!\n $spaceType: SpaceType!\n) {\n organization(id: $organizationId) {\n spaceDesign(spaceType: $spaceType) {\n ...SpaceDesign\n }\n\n eventsShowcaseSettings @include(if: $includeIntro) {\n title\n description\n }\n }\n}\n",e,[Vs.SpaceDesignFragment])}function ma(e={}){return ei("mutation OrganizationSpaceDesignUpdate(\n $organizationId: OrganizationId!\n $spaceDesign: DesignInput!\n $settings: EventsShowcaseSettingsDesignInput\n $spaceType: SpaceType!\n) {\n organizationSpaceDesignUpdate(\n organizationId: $organizationId\n spaceDesign: $spaceDesign\n settings: $settings\n spaceType: $spaceType\n ) {\n id\n }\n}\n",e)}function ga(e={}){return ei("mutation UserDelete {\n userDelete {\n id\n }\n}\n",e)}function pa(e={}){return ei("mutation UserAccessDelete($organizationId: OrganizationId!, $scope: AccessScope!, $id: Int!) {\n userAccessDelete(organizationId: $organizationId, scope: $scope, id: $id)\n}\n",e)}function fa(e={}){return ei("mutation UserAccessUpdate(\n $organizationId: OrganizationId!\n $scope: AccessScope!\n $id: Int!\n $roleId: RoleId!\n $sendNotifications: Boolean\n) {\n userAccessUpdate(\n organizationId: $organizationId\n scope: $scope\n id: $id\n roleId: $roleId\n sendNotifications: $sendNotifications\n )\n}\n",e)}function _a(e,t){return go("query PositionsCategories($eventId: EventId!) {\n event(id: $eventId) {\n positionsCategories {\n id\n name\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}function xa(e={}){return ei("mutation PositionsMassDelete($eventId: EventId!, $selecteds: MassActionSelectedsInput!) {\n numberOfPositions: positionsMassDelete(eventId: $eventId, selecteds: $selecteds)\n}\n",e)}function Ia(e){return Qn("query Positions(\n $eventId: EventId!\n $name: String\n $predicates: [Predicate!]\n $hasCoordinates: Boolean\n $limit: Int\n $offset: Int\n $sort: PositionsSort\n $columnsSearch: [String!]\n $includeCheckedInRate: Boolean!\n $includeConditions: Boolean!\n $includeCreatedBy: Boolean!\n $includeLeaders: Boolean!\n $includeTags: Boolean!\n $includeTraces: Boolean!\n) {\n data: event(id: $eventId) {\n layer\n latitude\n longitude\n\n rows: positions(\n name: $name\n predicates: $predicates\n hasCoordinates: $hasCoordinates\n columnsSearch: $columnsSearch\n limit: $limit\n offset: $offset\n sort: $sort\n ) {\n nodes {\n ...PositionsPosition\n }\n\n numberOfPages\n totalCount\n }\n\n traces @include(if: $includeTraces) {\n ...Trace\n }\n }\n}\n",e,[Vs.PositionsPositionFragment,Vs.TraceFragment])}function va(e,t){return go('query PositionsMobile(\n $eventId: EventId!\n $predicates: [Predicate!]\n $limit: Int\n $offset: Int\n $name: String\n) {\n event(id: $eventId) {\n positions(\n predicates: $predicates\n limit: $limit\n offset: $offset\n sort: { attribute: "Category", direction: Asc }\n name: $name\n ) {\n nodes {\n id\n name\n range\n resources\n assignedResources\n isVisible\n\n category {\n id\n name\n\n leaders {\n ...LeaderInfos\n }\n }\n\n slots {\n id\n }\n }\n\n pageInfo {\n ...FullPageInfo\n }\n\n totalCount\n }\n }\n}\n',{variables:e,token:t||void 0,fragments:[Vs.LeaderInfosFragment,Vs.FullPageInfoFragment]})}function ba(e,t){return go('query PositionSlotMembersMobile(\n $eventId: EventId!\n $positionSlotId: PositionsSlotId!\n $predicates: [Predicate!]!\n $limit: Int\n $offset: Int\n) {\n event(id: $eventId) {\n positionSlot(id: $positionSlotId) {\n name\n positionCategoryId\n range\n }\n\n volunteersRegistrations(\n positionSlotId: $positionSlotId\n predicates: $predicates\n limit: $limit\n offset: $offset\n sort: { attribute: "Name", direction: Asc }\n ) {\n nodes {\n id\n\n positionSlotUserInfo(positionSlotId: $positionSlotId) {\n id\n state\n }\n\n userInfo {\n id\n name\n email\n picture {\n url\n }\n }\n }\n\n pageInfo {\n ...FullPageInfo\n }\n\n totalCount\n }\n }\n}\n',{variables:e,token:t||void 0,fragments:[Vs.FullPageInfoFragment]})}function ja(e,t){return go("query PositionSlotsMobile($eventId: EventId!, $positionId: PositionId!, $limit: Int, $offset: Int) {\n event(id: $eventId) {\n positionsSlots(positionsIds: [$positionId], limit: $limit, offset: $offset) {\n nodes {\n ...PositionPositionSlot\n }\n\n pageInfo {\n ...FullPageInfo\n }\n\n totalCount\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[Vs.PositionPositionSlotFragment,Vs.FullPageInfoFragment]})}function Ca(e){return Qn("query PositionDashboard(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $positionId: PositionId!\n) {\n organization(id: $organizationId) {\n customFields(variety: Position) {\n nodes {\n ...CustomFieldWithCondition\n }\n }\n }\n\n event(id: $eventId) {\n position(id: $positionId) {\n id\n positionCategoryId\n positionCategoryName\n name\n description\n privateNote\n color\n icon\n resources\n assignedResources\n preassignedResources\n address\n latitude\n longitude\n zoom\n layer\n isVisible\n range\n fields\n\n links {\n positionPlanningLink\n positionSheetLink\n }\n\n traces {\n ...Trace\n }\n\n customFields: positionsCustomFields {\n customField {\n name\n fieldType\n\n values {\n id\n value\n }\n }\n\n conditionValue\n }\n\n leaders {\n ...LeaderInfos\n }\n\n tags {\n id\n name\n }\n }\n }\n}\n",e,[Vs.CustomFieldWithConditionFragment,Vs.TraceFragment,Vs.LeaderInfosFragment])}function ya(e={}){return ei("mutation PositionSlotUpdate(\n $eventId: EventId!\n $positionId: PositionId!\n $positionSlotId: PositionsSlotId!\n $positionSlot: PositionsSlotInput!\n) {\n positionSlotUpdate(\n eventId: $eventId\n positionId: $positionId\n positionSlotId: $positionSlotId\n positionSlot: $positionSlot\n ) {\n id\n }\n}\n",e)}function ka(e){return Qn("query UserFieldUpdate($organizationId: OrganizationId!, $slug: CustomFieldSlug!) {\n organization: organizationPublic(id: $organizationId) {\n customField: customFieldBySlug(slug: $slug) {\n name\n description\n }\n }\n}\n",e,[])}function Aa(e,t){return go("query CreateUserDelegationForm(\n $organizationId: OrganizationId!\n $delegationId: DelegationId\n $eventId: EventId\n $formId: FormId!\n) {\n organization(id: $organizationId) {\n country\n\n delegation: delegationMaybe(id: $delegationId) {\n id\n\n accreditationsSlots(onlyVisible: true) {\n ...DelegationAccreditationSlot\n }\n }\n\n event: eventMaybe(id: $eventId) {\n startAt\n endAt\n dayStartTime\n ranges(formId: $formId, delegationId: $delegationId)\n country\n\n accreditationsCategories {\n ...FormRegisterAccreditationCategory\n }\n\n positionsCategories {\n ...FormRegisterCategory\n }\n }\n\n form(id: $formId) {\n ...CreateUpdateMemberForm\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[Vs.DelegationAccreditationSlotFragment,Vs.FormRegisterAccreditationCategoryFragment,Vs.FormRegisterCategoryFragment,Vs.CreateUpdateMemberFormFragment]})}function wa(e={}){return ei("mutation CommentCreate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $userInfoId: UsersInfoId!\n $comment: CommentInput!\n) {\n commentCreate(\n organizationId: $organizationId\n eventId: $eventId\n userInfoId: $userInfoId\n comment: $comment\n ) {\n id\n }\n}\n",e)}function Sa(e){return Qn("query Comments($organizationId: OrganizationId!, $userInfoId: UsersInfoId!) {\n organization(id: $organizationId) {\n userInfo(id: $userInfoId) {\n comments {\n ...Comment\n }\n }\n }\n}\n",e,[Vs.CommentFragment])}function Ea(e){return Qn("query OrganizationUsersInfos(\n $organizationId: OrganizationId!\n $excludedEventId: EventId\n $excludedDelegationId: DelegationId\n $name: String\n) {\n organization(id: $organizationId) {\n usersInfos(\n excludedEventId: $excludedEventId\n excludedDelegationId: $excludedDelegationId\n name: $name\n limit: 25\n ) {\n nodes {\n ...ExistingVolunteer\n }\n }\n }\n}\n",e,[Vs.ExistingVolunteerFragment])}function Ta(e={}){return ei("mutation VolunteersRegistrationsAdminAdd(\n $eventId: EventId!\n $usersInfosIds: [UsersInfoId!]!\n $sendVolunteerRegistrationEmail: Boolean!\n) {\n volunteersRegistrationsAdminAdd(\n eventId: $eventId\n usersInfosIds: $usersInfosIds\n sendVolunteerRegistrationEmail: $sendVolunteerRegistrationEmail\n ) {\n id\n }\n}\n",e)}function za(e={}){return ei("mutation VolunteersRegistrationsMassPreAssign(\n $eventId: EventId!\n $massPreAssign: MassPreAssignInput!\n) {\n numberOfMembers: volunteersRegistrationsMassPreAssign(\n eventId: $eventId\n massPreAssign: $massPreAssign\n )\n}\n",e)}function Oa(e={}){return ei("mutation UsersInfosMassDelegationAdd(\n $organizationId: OrganizationId!\n $delegationId: DelegationId!\n $selecteds: MassActionSelectedsInput!\n) {\n numberOfMembers: usersInfosMassDelegationAdd(\n organizationId: $organizationId\n delegationId: $delegationId\n selecteds: $selecteds\n )\n}\n",e)}function Ra(e,t){return go("query VolunteersMobile(\n $eventId: EventId!\n $predicates: [Predicate!]!\n $limit: Int\n $offset: Int\n $name: String\n) {\n event(id: $eventId) {\n volunteersRegistrations(\n predicates: $predicates\n limit: $limit\n offset: $offset\n name: $name\n ) {\n nodes {\n id\n state\n\n userInfo {\n id\n name\n email\n picture {\n url\n }\n }\n }\n\n pageInfo {\n ...FullPageInfo\n }\n\n totalCount\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[Vs.FullPageInfoFragment]})}function $a(e){return Qn("query WorkflowCustomFields($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n customFields(variety: UserInfo, privacy: All) {\n nodes {\n ...MassEditCustomField\n }\n }\n }\n}\n",e,[Vs.MassEditCustomFieldFragment])}function Da(e,t){return go("query Workflows(\n $organizationId: OrganizationId!\n $eventId: EventId\n $level: OrganizationEventLevel!\n $name: String\n $predicates: [Predicate!]\n $limit: Int\n $offset: Int\n $sort: WorkflowsSort\n $includeAccreditations: Boolean!\n $includeCampaign: Boolean!\n $includeCustomField: Boolean!\n) {\n data: organization(id: $organizationId) {\n rows: workflows(\n level: $level\n eventId: $eventId\n name: $name\n predicates: $predicates\n limit: $limit\n offset: $offset\n sort: $sort\n ) {\n nodes {\n ...WorkflowsWorkflow\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[Vs.WorkflowsWorkflowFragment]})}function Pa(e,t){return go("query WorkflowsWorkflow(\n $organizationId: OrganizationId!\n $id: WorkflowId!\n $includeAccreditations: Boolean!\n $includeCampaign: Boolean!\n $includeCustomField: Boolean!\n) {\n data: organization(id: $organizationId) {\n row: workflow(id: $id) {\n ...WorkflowsWorkflow\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[Vs.WorkflowsWorkflowFragment]})}const Fa=()=>{const{eventId:e,accreditationId:t}=ti(),{data:n,loader:s}=Qn("query AccreditationMap($eventId: EventId!, $accreditationId: AccreditationId!) {\n eventPublic(id: $eventId) {\n accreditation(id: $accreditationId) {\n layer\n latitude\n longitude\n zoom\n }\n }\n}\n",{eventId:e,accreditationId:t},[]),[o,r]=(0,L.useState)(!1);if(s)return s;{const e=n.eventPublic.accreditation;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ar,{css:{"& .gm-style-cc":{display:"none"}},height:1,width:1,children:(0,i.jsx)(Br,{initialZoom:e.zoom,layer:e.layer,mapOptions:{disableDefaultUI:!0,keyboardShortcuts:!1},point:Pr(e),onTilesloaded:()=>{r(!0)}})}),o&&(0,i.jsx)(Vr,{})]})}};var Ma;function Na(e){return(0,Er.A)(e,["direction","align","justify","wrap","gap","css","height","width"])}!function(e){e.Nav="nav",e.Header="header",e.Footer="footer",e.Main="main",e.Section="section"}(Ma||(Ma={}));const La=_r("div",{display:"flex",variants:{direction:{row:{flexDirection:"row"},column:{flexDirection:"column"},rowReverse:{flexDirection:"row-reverse"},columnReverse:{flexDirection:"column-reverse"}},align:{start:{alignItems:"flex-start"},center:{alignItems:"center"},end:{alignItems:"flex-end"},stretch:{alignItems:"stretch"},baseline:{alignItems:"baseline"}},justify:{start:{justifyContent:"flex-start"},center:{justifyContent:"center"},end:{justifyContent:"flex-end"},between:{justifyContent:"space-between"},evenly:{justifyContent:"space-evenly"}},wrap:{noWrap:{flexWrap:"nowrap"},wrap:{flexWrap:"wrap"},wrapReverse:{flexWrap:"wrap-reverse"}},gap:{1:{gap:"$1"},2:{gap:"$2"},3:{gap:"$3"},4:{gap:"$4"},5:{gap:"$5"},6:{gap:"$6"},7:{gap:"$7"},8:{gap:"$8"},9:{gap:"$9"},10:{gap:"$10"},11:{gap:"$11"},12:{gap:"$12"},13:{gap:"$13"}}},defaultVariants:{direction:"row",align:"stretch",justify:"start",wrap:"noWrap"}}),Ba=L.forwardRef(({onClick:e,...t},n)=>{const s={};return t.height&&(s.height=mr(t.height)),t.width&&(s.width=mr(t.width)),(0,i.jsx)(La,{...t,ref:n,css:{...s,...t.css},onClick:e})});Ba.displayName="Flex";var Va=n(7356);let Ua=class{validate(e){return async t=>{try{return await e.validate(t,{abortEarly:!1,strict:!0}),{}}catch(e){return this.errorToObject(e)}}}validateSync(e,t){try{return e.validateSync(t,{abortEarly:!1,strict:!0}),{}}catch(e){return this.errorToObject(e)}}isValidSync(e,t){return 0===Object.keys(this.validateSync(e,t)).length}validateForForm(e){return async t=>{try{return await e.validate(t,{abortEarly:!1,strict:!0}),{}}catch(e){return e.inner.reduce((e,t)=>(0,Va.Oe)(e,t.path,t.message),{})}}}errorToObject(e){return e.inner.reduce((e,t)=>({...e,[t.path]:t.message}),{})}};Ua=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)()],Ua);var Wa=n(924),Ga=n(952),Ha=n(5664);function qa(){const[e]=(0,L.useState)(()=>(0,Ha.A)("forminput-")),[t]=(0,L.useState)(()=>(0,Ha.A)("forminputlabel-")),[n]=(0,L.useState)(()=>(0,Ha.A)("forminputdesc-")),[i]=(0,L.useState)(()=>(0,Ha.A)("forminputerror-"));return{inputId:e,labelId:t,descId:n,errorId:i}}const Ka=(0,L.createContext)({}),Ya=_r("div",{variants:{height:{default:{height:"100%"},1:{minHeight:"$space$1"},2:{minHeight:"$space$2"},3:{minHeight:"$space$3"},4:{minHeight:"$space$4"},5:{minHeight:"$space$5"},6:{minHeight:"$space$6"},7:{minHeight:"$space$7"},8:{minHeight:"$space$8"},9:{minHeight:"$space$9"},10:{minHeight:"$space$10"},11:{minHeight:"$space$11"},12:{minHeight:"$space$12"},13:{minHeight:"$space$13"}},width:{default:{width:"100%"},1:{minWidth:"$space$1"},2:{minWidth:"$space$2"},3:{minWidth:"$space$3"},4:{minWidth:"$space$4"},5:{minWidth:"$space$5"},6:{minWidth:"$space$6"},7:{minWidth:"$space$7"},8:{minWidth:"$space$8"},9:{minWidth:"$space$9"},10:{minWidth:"$space$10"},11:{minWidth:"$space$11"},12:{minWidth:"$space$12"},13:{minWidth:"$space$13"}}},defaultVariants:{height:"default",width:"default"}});var Za=n(9241),Xa=n(2695),Ja=n(6735);const Qa=["access","ticket","pay"],el=({children:e,height:t,replace:n,style:s,to:o,width:r,...a})=>{const l=new URL(o.toString(),location.origin),d={};t&&(d.height=mr(t)),r&&(d.width=mr(r));const c={alignItems:"inherit",color:"inherit",cursor:"pointer",display:"inherit",flexDirection:"inherit",flexWrap:"inherit",gap:"inherit",justifyContent:"inherit",textDecoration:"none",...d,...s};return l.origin!==location.origin||Qa.includes(l.pathname.split("/")[1])?(0,i.jsx)("a",{href:l.href,rel:"noreferrer",style:c,target:"_blank",...a,children:e}):(0,i.jsx)(wr.N_,{replace:n,style:c,to:{pathname:m(P.HEAVENT_APPLICATION_BASENAME)?l.pathname.replace(new RegExp(`^/${P.HEAVENT_APPLICATION_BASENAME}`,"gm"),""):l.pathname,hash:l.hash,search:l.search},...a,children:e})};function tl(e){return(0,Ja.A)(e)}el.displayName="LinkWrapper";const nl=e=>{const t=e.iconStyle??"regular",n={};e.primaryColor&&(n["--fa-primary-color"]=e.primaryColor),e.secondaryColor&&(n["--fa-secondary-color"]=e.secondaryColor,n["--fa-secondary-opacity"]="1");const s=()=>(0,i.jsx)("i",{"aria-hidden":e["aria-hidden"]??!0,className:`fa-${t} fa-${e.icon} ${e.className||""}`,role:e.role,style:{...n,cursor:e.title?"help":"inherit"},title:e.title,onClick:e.to?void 0:e.onClick});return e.to?(0,i.jsx)(el,{target:e.target,to:e.to,onClick:e.onClick,children:s()}):s()};function il(e,t){"production"!==a.Production&&console.warn(`Component ${e} is deprecated, use ${t} instead.`)}const sl=_r("div",{alignItems:"center",display:"grid",gap:"6px 8px",gridTemplateColumns:"min-content auto"}),ol=_r(Ba,{alignItems:"center",borderRadius:"$2",fontWeight:"$medium",gap:"$3",padding:"$3 $4","& i":{fontSize:"$textMd"},variants:{color:{primary:{background:"$primary50",border:"1px solid $primary400",color:"$primary500",[`${sl}`]:{color:"$primary500"}},gray:{background:"$gray50",border:"1px solid $gray400",color:"$gray700",[`${sl}`]:{color:"$gray500"}},error:{background:"$error50",border:"1px solid $error400",color:"$error700",[`${sl}`]:{color:"$error500"}},warning:{background:"$warning50",border:"1px solid $warning400",color:"$warning700",[`${sl}`]:{color:"$warning500"}},success:{background:"$success50",border:"1px solid $success400",color:"$success700",[`${sl}`]:{color:"$success500"}}}},defaultVariants:{color:"primary"}}),rl=e=>(il("common-front/src/designSystem/components/alerts/__deprecated/alert.tsx","common-front/src/designSystem/components/alerts/alert.tsx"),(0,i.jsxs)(ol,{"aria-live":e["aria-live"]??"polite",color:e.color,role:"alert",width:e.width,children:[e.leftIcon&&(0,i.jsx)(Ba,{align:"center",children:(0,i.jsx)(nl,{icon:e.leftIcon})}),(0,i.jsx)(Ar,{css:{flex:"1"},children:e.children}),e.rightIcon&&(0,i.jsx)(Ba,{align:"center",css:{cursor:e.rightIconClick?"pointer":"default"},onClick:()=>{e.rightIconClick?.()},children:(0,i.jsx)(nl,{icon:e.rightIcon})})]})),al={Root:rl,Titled:sl,Title:({children:e,icon:t})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(nl,{icon:t,iconStyle:"solid"}),(0,i.jsx)(Ar,{color:"gray800",children:e})]}),Text:({children:e})=>(0,i.jsx)(Ar,{color:"gray800",css:{gridColumn:"2 / 3"},fontWeight:"regular",children:e})};function ll(e){throw new Error("Didn't expect to get here")}const dl=e=>{const t={iconStyle:"solid"};switch(e.iconStyle){case"error":return(0,i.jsx)(nl,{icon:"circle-exclamation",...t});case"warning":return(0,i.jsx)(nl,{icon:"triangle-exclamation",...t});default:ll(e.iconStyle)}},cl=_r(Ba,{borderRadius:"$1",alignItems:"flex-start",gap:"$2",flex:"1 0 0",padding:"$4","& i":{fontSize:"$textMd"},variants:{alertStyle:{error:{background:"$error50",border:"1px solid $error500",color:"$gray800","& i":{color:"$error500"}},warning:{background:"$warning50",border:"1px solid $warning500",color:"$gray800","& i":{color:"$warning500"}}}},defaultVariants:{alertStyle:"error"}}),ul=_r("p",{fontStyle:"normal",padding:"unset",margin:"unset",lineHeight:"1.42857143","& > *:not(ul)":{display:"inline"},variants:{textStyle:{inherit:{color:"inherit",fontSize:"inherit",fontWeight:"inherit",lineHeight:"inherit"},heading:{color:"$gray900",fontSize:"$textMd",fontWeight:"$medium",lineHeight:"1.55556"},smallcapsheading:{color:"$gray500",fontSize:"10px",lineHeigh:"24px",textTransform:"uppercase"},subheading:{color:"$gray900",fontSize:"$textMd",fontWeight:"$medium",lineHeight:"1.5"},subtitle:{color:"$gray500",fontSize:"$textSm",fontWeight:"$regular",lineHeight:"1.42857"},bodyText:{color:"$gray800",fontSize:"$textSm"},abbreviation:{color:"$gray500",fontVariant:"small-caps",fontSize:"$textSm"}}},defaultVariants:{textStyle:"bodyText"}}),hl=L.forwardRef(({children:e,...t},n)=>(0,i.jsx)(ul,{ref:n,...t,children:e}));hl.displayName="Text";const ml=({min:e=2,max:t=6,textStyle:n="heading",children:s,...o})=>{t{const i=e?.parentElement;if(!i||n===t)return n;for(const e of Array(i.children))if(e[0]instanceof HTMLHeadingElement)return d(i,++n);return d(i,n)},[t]);return L.useEffect(()=>l(`h${d(r.current?.parentElement,e)}`),[e,t]),(0,i.jsx)(hl,{ref:r,as:a,...o,textStyle:n,children:s})},gl=e=>(0,i.jsxs)(cl,{alertStyle:e.alertStyle,"aria-live":e["aria-live"]??"polite",role:"alert",width:e.width,children:[(0,i.jsx)(Ba,{align:"start",children:(0,i.jsx)(Ar,{height:"20px",width:"20px",children:(0,i.jsx)(dl,{iconStyle:e.alertStyle})})}),(0,i.jsx)(Ba,{align:"start",css:{gap:"2px"},direction:"column",children:e.children})]}),pl=({children:e})=>(0,i.jsx)(ml,{css:{color:"$gray900",fontWeight:"$medium",fontSize:"$textSm",lineHeight:"1.42857"},children:e}),fl=({children:e})=>(0,i.jsx)(i.Fragment,{children:e}),_l=e=>(0,i.jsxs)(gl,{alertStyle:"error","aria-live":"assertive",id:e.id,children:[(0,i.jsx)(pl,{children:e.title}),(0,i.jsx)(fl,{children:e.children})]}),xl=(0,L.createContext)({});function Il(){return(0,L.useContext)(xl)}function vl(){return{history:ni(),params:ti(),translate:Xn()}}function bl(e){return e?(0,Bs.A)(Object.values(e).map(e=>"string"==typeof e?e:Array.isArray(e)?(0,Za.A)(e).map(e=>bl(e)).flat():bl(e)).flat()):[]}const jl=e=>{const{translate:t}=vl(),n=qa(),{formRenderProps:{errors:s,submitErrors:o},showErrors:r}=(0,L.useContext)(Ka),{designSystem:a}=Il(),l=bl((0,Xa.A)({},s,o));return r&&so(l)?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(({children:s})=>"new2025"===a?(0,i.jsx)(_l,{id:e.errorId??n.errorId,title:t("form_has_errors_14074"),children:(0,i.jsx)("ul",{style:{margin:"0",paddingInlineStart:"var(--space-4)"},children:s})}):(0,i.jsx)(rl,{"aria-live":"assertive",color:"error",id:e.errorId,leftIcon:"circle-exclamation",children:(0,i.jsx)(Ar,{width:1,children:(0,i.jsx)("ul",{style:{margin:"0",paddingInlineStart:"var(--space-6)"},children:s})})}),{children:l.map((e,t)=>(0,i.jsx)("li",{children:e},t))}),!0!==e.hideSpacer&&(0,i.jsx)(Ya,{height:"6"})]}):null};function Cl(e,t){Object.values(t.fields).forEach(e=>{e.data={...e.data,forceDisplayError:!0}})}const yl=e=>{const t=L.useRef(null),n=qa(),{setShowErrors:s}=L.useContext(Ka),o=n=>(n?.preventDefault?.(),e.formRenderProps.invalid?(s(!0),e.formRenderProps.form.mutators.forceErrors(),setTimeout(()=>{e.customErrorRef&&e.customErrorRef.current?(e.customErrorRef.current.scrollIntoView(),e.customErrorRef.current.scrollTop=0):!e.hideDefaultErrors&&t.current&&(t.current.scrollIntoView(),t.current.scrollTop=0)},100),!e.formRenderProps.hasValidationErrors&&e.formRenderProps.hasSubmitErrors?e.formRenderProps.handleSubmit():void 0):e.formRenderProps.handleSubmit());return(0,i.jsxs)(Ba,{ref:t,as:"form",onSubmit:o,...Na(e),children:[!e.hideDefaultErrors&&!e.customErrorRef&&(0,i.jsx)(jl,{errorId:n.errorId}),(0,i.jsx)("input",{style:{display:"none"},type:"submit",value:"Submit"}),e.render({...e.formRenderProps,handleSubmit:o})]})},kl=e=>{const t=Zn(Ua),[n,s]=L.useState(!1);return(0,i.jsx)(Ga.lV,{initialValues:e.initialValues,initialValuesEqual:e.initialValuesEqual??Mr.A,mutators:{...e.mutators,...Wa.A,forceErrors:Cl},render:t=>(0,i.jsx)(Ka.Provider,{value:{formRenderProps:t,showErrors:n,setShowErrors:s},children:(0,i.jsx)(yl,{...(0,Er.A)(e,["direction","align","justify","wrap","gap","css","height","width"]),customErrorRef:e.customErrorRef,formRenderProps:t,hideDefaultErrors:e.hideDefaultErrors,render:e.render})}),validate:n=>e.schema?t.validateForForm(e.schema)(n):"function"==typeof e.validate?e.validate(n):{},onSubmit:async(t,n,i)=>{const o=await e.onSubmit(t,n,i);return Object.keys(o||{}).length>0&&s(!0),o}})},Al=e=>(0,L.createElement)("svg",{width:e.width,height:e.height,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 100 100",preserveAspectRatio:"xMidYMid",className:"lds-rolling","data-testid":"loader",style:{background:"none"}},(0,L.createElement)("circle",{cx:"50",cy:"50",fill:"none",stroke:e.color,strokeWidth:e.strokeWidth,r:"16",strokeDasharray:"75.39822368615503 27.132741228718345",transform:"rotate(120 50 50)"},(0,L.createElement)("animateTransform",{attributeName:"transform",type:"rotate",calcMode:"linear",values:"0 50 50;360 50 50",keyTimes:"0;1",dur:"1s",begin:"0s",repeatCount:"indefinite"}))),wl=(0,L.memo)(function(){return(0,i.jsx)(Ba,{align:"center",height:1,justify:"center",width:1,children:(0,i.jsx)(Al,{color:"#162131",height:"200px",strokeWidth:"2",width:"200px"})})}),Sl={alignItems:"center",borderRadius:"$1",cursor:"pointer",display:"flex",fontWeight:"$semiBold",gap:"$2",padding:"$1 $4",userSelect:"none","& .loader":{borderRadius:"$1"},variants:{color:{primary:{background:"$primary500",border:"1px solid $primary500",color:"white","&:hover":{background:"$primary600",border:"1px solid $primary600"},"& .loader":{background:"$primary500",border:"1px solid $primary500"},"& .loader:hover":{background:"$primary600",border:"1px solid $primary600"}},gray:{background:"$gray100",border:"1px solid $gray100",color:"$gray800","&:hover":{background:"$gray100",border:"1px solid $gray100"},"& .loader":{background:"$gray100",border:"1px solid $gray100"},"& .loader:hover":{background:"$gray100",border:"1px solid $gray100"}},white:{background:"white",border:"1px solid $gray300",color:"$gray700","&:hover":{background:"$gray50",color:"$gray800"},"& .loader":{background:"white",border:"1px solid $gray300"},"& .loader:hover":{background:"$gray50",color:"$gray800"}},error:{background:"$error600",border:"1px solid $error600",color:"white","&:hover":{background:"$error700",border:"1px solid $error600"},"& .loader":{background:"$error600",border:"1px solid $error600"},"& .loader:hover":{background:"$error700",border:"1px solid $error600"}},invisible:{background:"none",border:"none",color:"$primary500",fontSize:"$textSm",fontWeight:"$medium",padding:"$1 $2","&:hover":{color:"$primary600"},"& .h-button-content:has( + .loader)":{color:"transparent"}},"invisible-gray":{background:"none",border:"none",color:"$gray700",fontSize:"$textSm",fontWeight:"$medium",padding:"$1 $2","&:hover":{color:"$gray900"},"& .h-button-content:has( + .loader)":{color:"transparent"}}},disabled:{true:{cursor:"not-allowed"}},size:{sm:{height:"32px",fontSize:"$textSm"},md:{height:"40px",fontSize:"$textSm"},lg:{height:"44px",fontSize:"$textMd"},xl:{height:"48px",fontSize:"$textMd"},"2xl":{height:"60px",fontSize:"$textLg"}},iconOnly:{true:{justifyContent:"center",px:"0"}}},compoundVariants:[{color:"primary",disabled:!0,css:{color:"$gray400",background:"$gray100",border:"1px solid $gray100","&:hover":{background:"$gray100",border:"1px solid $gray100"},"& .loader":{background:"$gray100",border:"1px solid $gray100"},"& .loader:hover":{background:"$gray100",border:"1px solid $gray100"}}},{color:"gray",disabled:!0,css:{background:"$gray50",border:"1px solid $gray50",color:"$gray400","&:hover":{background:"$gray50",border:"1px solid $gray50"},"& .loader":{background:"$gray50",border:"1px solid $gray50"},"& .loader:hover":{background:"$gray50",border:"1px solid $gray50"}}},{color:"transparent",disabled:!0,css:{color:"$gray400",background:"$primary100",border:"1px solid $primary100","&:hover":{color:"$gray400",background:"$primary100",border:"1px solid $primary100"},"& .loader":{background:"$primary100",border:"1px solid $primary100"},"& .loader:hover":{background:"$primary100",border:"1px solid $primary100"}}},{color:"invisible",disabled:!0,css:{color:"$gray400","&:hover":{color:"$gray400"}}},{color:"invisible-gray",disabled:!0,css:{color:"$gray400","&:hover":{color:"$gray400"}}},{color:"error",disabled:!0,css:{background:"$error200",border:"1px solid $error200","&:hover":{background:"$error200",border:"1px solid $error200"},"& .loader":{background:"$error200",border:"1px solid $error200"},"& .loader:hover":{background:"$error200",border:"1px solid $error200"}}},{size:"sm",iconOnly:!0,css:{width:"32px"}},{size:"md",iconOnly:!0,css:{width:"40px"}},{size:"lg",iconOnly:!0,css:{width:"44px"}},{size:"xl",iconOnly:!0,css:{width:"48px"}},{size:"2xl",iconOnly:!0,css:{width:"56px"}}],defaultVariants:{color:"primary",size:"md"}},El=_r("button",Sl),Tl=_r("div",Sl),zl=L.forwardRef(({children:e,className:t,color:n,css:s,disabled:o,featureFlags:r,isLoading:a,leftIcon:l,onClick:d,to:c,rightIcon:u,size:h,textAlign:m=(r?.isV4?"center":void 0),title:g,...p},f)=>{const _=!!l&&!e&&!u||!l&&!e&&!!u,x={className:`button ${t||""}`,color:n,css:{width:r?.isV4?"100%":void 0,...s,position:"relative"},disabled:o,iconOnly:_,size:h,title:g},I={children:e,color:n,leftIcon:l,isLoading:a,rightIcon:u,textAlign:m};return c&&!o?(0,i.jsx)(el,{style:r?.isV4?{flex:"1"}:void 0,title:g,to:c,onClick:e=>{o||a||d&&d(e)},...p,children:(0,i.jsx)(Tl,{...x,ref:f,children:(0,i.jsx)(Ol,{...I})})}):(0,i.jsx)(El,{...x,ref:f,type:"button",onClick:e=>{o||a||d&&d(e)},...p,children:(0,i.jsx)(Ol,{...I})})});zl.displayName="Button",zl.toString=()=>".button";const Ol=({children:e,color:t,isLoading:n,leftIcon:s,rightIcon:o,textAlign:r})=>(0,i.jsxs)(i.Fragment,{children:[s&&(0,i.jsx)(Ba,{children:(0,i.jsx)(nl,{icon:s})}),e&&(0,i.jsx)(Ar,{className:"h-button-content",css:{flex:"1"},textAlign:r,children:e}),o&&(0,i.jsx)(Ba,{children:(0,i.jsx)(nl,{icon:o})}),n&&(0,i.jsx)(Ba,{align:"center",className:"loader",css:{height:"calc(100% + 2px)",left:"-1px",position:"absolute",top:"-1px",width:"calc(100% + 2px)",zIndex:10},justify:"center",children:(0,i.jsx)(Al,{color:t&&"primary"!==t&&"error"!==t?xr.colors.gray800.value:"white",height:"40px",strokeWidth:"3",width:"40px"})})]});var Rl=n(9008);function $l(e){return e.data?.forceDisplayError&&e.invalid||e.touched&&!e.pristine&&e.invalid||!1}const Dl=(e,t=!0)=>{t&&e?.preventDefault(),e?.nativeEvent?.stopImmediatePropagation(),e?.stopPropagation()},Pl=({children:e,id:t})=>e?(0,i.jsx)(Ar,{color:"gray500",fontSize:"textXs",id:t,children:e}):null,Fl=e=>e.children?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ar,{color:"error"===e.state?"error500":"gray500",fontSize:"textXs",id:e.id,role:"error"===e.state?"alert":void 0,children:e.children})]}):null,Ml=({id:e,children:t,htmlFor:n,isClickable:s=!0})=>t?(0,i.jsx)("label",{htmlFor:n,id:e,style:{display:"block",cursor:"inherit",fontWeight:"$medium",marginBlockEnd:0},onClick:e=>{s||e.preventDefault()},children:(0,i.jsx)(Ar,{color:"gray700",fontWeight:"medium",children:t})}):null,Nl=_r("div",{alignItems:"center",borderRadius:"$1",display:"flex",gap:"$space$2",padding:"0 $space$3",position:"relative",width:"100%","& input::placeholder":{color:"$gray500"},"&:focus-within":{border:"2px solid $primary500"},variants:{state:{active:{backgroundColor:"white",border:"1px solid $gray300",color:"$gray900"},disabled:{background:"$gray50",border:"1px solid $gray300",color:"$gray500"},error:{backgroundColor:"white",border:"1px solid $error500"},search:{backgroundColor:"$gray100",border:"1px solid $gray300",color:"$gray500"}},cursor:{default:{cursor:"default"},text:{cursor:"text"},pointer:{cursor:"pointer"}},height:{fixed:{height:"40px"},fluid:{minHeight:"40px"}}},defaultVariants:{state:"active",height:"fixed"}}),Ll=L.forwardRef(({height:e,cursor:t,css:n,icon:s,children:o,state:r,onClick:a,rightIcon:l,rightText:d,onRightIconClick:c,...u},h)=>(0,i.jsxs)(Nl,{ref:h,className:"h-styled-input-container",css:n,cursor:t,height:e,role:"listbox",state:r,onClick:e=>{a?.(e)},...u,children:[s&&(0,i.jsx)(Ba,{css:{color:"$gray500"},role:"presentation",children:(0,i.jsx)(nl,{icon:s})}),o,"error"===r&&(0,i.jsx)(Ba,{className:"styled-input-container-circle-exclamation",css:{color:"$error500"},children:(0,i.jsx)(nl,{icon:"circle-exclamation"})}),l&&(0,i.jsx)(Ba,{css:{color:"$gray500",cursor:"function"==typeof c?"pointer":"inherit"},role:"presentation",onClick:e=>{c?.(e)},children:(0,i.jsx)(nl,{icon:l})}),m(d)&&(0,i.jsx)(Ar,{css:{userSelect:"none"},font:"gray500 textSm regular",children:d})]}));Ll.displayName="StyledInputContainer";const Bl=L.forwardRef(({autoComplete:e,isEmail:t,shouldParseAsInt:n,css:s,label:o,description:r,hint:a,onRightIconClick:l,state:d,type:c,onChange:u,rightIcon:h,rightText:g,icon:p,treatIntNaNAsNull:f,..._},x)=>{const I=L.useRef(),v=L.useRef(),b=x??v,{inputId:j,descId:C,errorId:y}=qa();return(0,i.jsxs)(Ba,{ref:I,css:s,direction:"column",width:1,children:[(0,i.jsx)(Ml,{htmlFor:j,children:o}),(0,i.jsx)(Pl,{id:C,children:r}),(o||r)&&(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ll,{cursor:"text",icon:p,rightIcon:h,rightText:g,state:d,onClick:()=>b.current?.focus(),onRightIconClick:e=>{Dl(e),l?.(e)},children:(0,i.jsx)(Ar,{color:"inherit",css:{flex:"1",height:"100%","& input":{background:"transparent",border:"none",color:"$gray800",height:"100%",outline:"none",width:"100%"},"& input::placeholder":{color:"search"===d?"$gray400":"$gray500",opacity:1},"& input::-ms-input-placeholder ":{color:"search"===d?"$gray400":"$gray500",opacity:1}},children:(0,i.jsx)("input",{ref:b,"aria-describedby":r?C:void 0,"aria-errormessage":"error"===d?y:void 0,"aria-invalid":"error"===d,autoComplete:e??"off",disabled:"disabled"===d,id:j,type:c??(t?"email":n?"number":"text"),onChange:e=>{if(t&&m(e.target.value))u(e.target.value.toLowerCase());else if(!0===n){const t=parseInt(e.target.value,10);isNaN(t)?u(f?null:0):u(t)}else u(e.target.value)},..._})})}),(0,i.jsx)(Fl,{id:y,state:d,children:a})]})});Bl.displayName="TextInput";const Vl=({autoComplete:e,hint:t,shouldParseAsInt:n,name:s,state:o,...r})=>{const a=(0,L.useCallback)(e=>{switch(e){case Ve.City:return"address-level1";case Ve.DateOfBirth:return"bday";case Ve.FirstName:return"given-name";case Ve.LastName:return"family-name";case Ve.PostalCode:return"postal-code";case Ve.Street:return"street-address";case Ve.Country:case Ve.Language:case Ve.Nationality:case Ve.Phone:case Ve.Picture:case Ve.Sex:default:return}},[]),l=(0,L.useMemo)(()=>s.startsWith("formRegister.userInfo.fields.")?a(s.split(".").pop())??e:e,[s,e,a]),d=(0,L.useCallback)(e=>{const s=$l(e.meta);return(0,i.jsx)(Bl,{autoComplete:l,hint:s?e.meta.error||e.meta.submitError:t,shouldParseAsInt:n||!1,state:s?"error":o,value:e.input.value,onBlur:e.input.onBlur,onChange:t=>{e.input.onChange(t)},onFocus:e.input.onFocus,...r})},[t,n,o,l,r]);return(0,i.jsx)(Ga.D0,{name:s,parse:Rl.A,render:d})},Ul={AUTH_EMAIL:"heavent-auth-email",BACKOFFICE_INVOICES_COLUMNS:"heavent-backoffice-invoices-columns",BACKOFFICE_COLUMNS:"heavent-backoffice-columns",BACKOFFICE_LIMIT:"heavent-backoffice-limit",BACKOFFICE_PREDICATES:"heavent-backoffice-predicates",BACKOFFICE_SEARCH:"heavent-backoffice-search",BACKOFFICE_SORT:"heavent-backoffice-sort",CURRENT_EVENT_ID:"heavent-current-event-id",CURRENT_EVENT_NAME:"heavent-current-event-name",CURRENT_ORGANIZATION_ID:"heavent-current-organization-id",DELEGATIONS_SPACE_TAB:"heavent-delegations-space-tab",EVENT_ID:"heavent-event-id",HIDE_HUBSPOT:"hide-hubspot",ORGANIZATION_ID:"heavent-organization-id",EVENTS_IMPORT_FORMATS:"heavent-events-import-formats",EVENTS_IMPORT_MAPPINGS:"heavent-events-import-mappings",EVENTS_IMPORT_MODE:"heavent-events-import-mode",EVENTS_IMPORT_PRESETS:e=>`heavent-events-import-presets-${e}`,POSITIONS_IMPORT_FORMATS:"heavent-positions-import-formats",POSITIONS_IMPORT_MAPPINGS:"heavent-positions-import-mappings",POSITIONS_IMPORT_MODE:"heavent-positions-import-mode",POSITIONS_IMPORT_PRESETS:e=>`heavent-positions-import-presets-${e}`,VOLUNTEERS_IMPORT_FORMATS:"heavent-volunteers-import-formats",VOLUNTEERS_IMPORT_MAPPINGS:"heavent-volunteers-import-mappings",VOLUNTEERS_IMPORT_MODE:"heavent-volunteers-import-mode",VOLUNTEERS_IMPORT_PRESETS:e=>`heavent-volunteers-import-presets-${e}`,DELEGATIONS_IMPORT_FORMATS:"heavent-delegations-import-formats",DELEGATIONS_IMPORT_MAPPINGS:"heavent-delegations-import-mappings",DELEGATIONS_IMPORT_PRESETS:e=>`heavent-delegations-import-presets-${e}`,DELEGATIONS_IMPORT_MODE:"heavent-delegations-import-mode",DELEGATION_MEMBERS_IMPORT_FORMATS:"heavent-delegation-members-import-formats",DELEGATION_MEMBERS_IMPORT_MAPPINGS:"heavent-delegation-members-import-mappings",DELEGATION_MEMBERS_IMPORT_PRESETS:e=>`heavent-delegation-members-import-presets-${e}`,DELEGATION_MEMBERS_IMPORT_MODE:"heavent-delegation-members-import-mode"};let Wl=class{translationService;constructor(e){this.translationService=e}t(e,...t){return this.translationService.translate(e,...t)}};Wl=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[qn])],Wl);let Gl=class extends Wl{translationService;constructor(e){super(e),this.translationService=e}oneOfMessage(e,t){return this.t("_1_doit_tre_70659",e,this.translationService.formatListValues(t.map(e=>this.t(e))))}};Gl=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[qn])],Gl);function Hl(e){return"string"==typeof e&&e.length>=16}function ql(e){return"string"==typeof e&&null!==e.match(/\d/)}function Kl(e){return"string"==typeof e&&null!==e.match(/[A-Z]/)&&null!==e.match(/[a-z]/)}function Yl(e){return"string"==typeof e&&null!==e.match(/[^A-Za-z0-9]/)}let Zl=class extends Gl{constructor(e){super(e)}signInSchema(){return d.Ik().shape({email:this.email()})}signInPasswordSchema(){return d.Ik().shape({email:this.email(),password:this.password()})}codeSchema(){return d.Ik().shape({code:this.code()})}emailSchema(){return d.Ik().shape({email:this.email()})}emailConfirmSchema(){return d.Ik().shape({email:this.email(),emailConfirm:this.emailConfirm()})}emailCodeSchema(){return d.Ik().shape({email:this.email(),code:this.code()})}email(){return d.Yj().required(this.t("l_e_mail_est_re_04856")).email(this.t("l_e_mail_est_re_04856"))}emailConfirm(){return d.Yj().required(this.t("la_confirmation_53449")).email(this.t("la_confirmation_53449")).test("same-as-email",this.t("l_e_mail_et_la_57164"),function(){return this.parent.email===this.parent.emailConfirm})}code(){return d.Yj().required(this.t("le_code_est_req_77618")).length(6,this.t("le_code_doit_co_37160"))}password(){return d.Yj().required(this.t("le_mot_de_passe_14773"))}passwordRules(){return d.Yj().required(this.t("le_mot_de_passe_24842")).test("valid-password",this.t("le_mot_de_passe_24842"),function(){return Hl(this.parent.password)&&ql(this.parent.password)&&Kl(this.parent.password)&&Yl(this.parent.password)})}};Zl=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[qn])],Zl);let Xl=class extends Zl{constructor(e){super(e)}step1Schema(){return d.Ik().shape({email:this.email()})}step2Schema(){return d.Ik().shape({email:this.email(),code:this.code()})}};Xl=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[qn])],Xl);var Jl,Ql,ed,td=n(2302);function nd(){return nd=Object.assign?Object.assign.bind():function(e){for(var t=1;t(0,i.jsxs)(Ba,{align:"center",css:{background:"#232935",overflowX:"hidden",overflowY:"auto"},direction:"column",height:1,width:1,children:[(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(Ar,{css:{marginBottom:"40px","@desktop":{marginBottom:"80px"},"& svg":{height:"100%"}},height:32,children:(0,i.jsx)(id,{})}),(0,i.jsxs)(Ba,{css:{width:"100%","@mobile":{px:"$4"},"@desktop":{width:"540px"}},direction:"column",children:[(0,i.jsx)(Ba,{css:{background:"white",borderTopLeftRadius:"$2",borderTopRightRadius:"$2",padding:"$7"},width:1,children:e.children}),(0,i.jsx)(Ba,{css:{background:"$gray100",borderBottomLeftRadius:"$2",borderBottomRightRadius:"$2",padding:"$7"},direction:"column",gap:"2",width:1,children:e.link})]}),(0,i.jsx)(Ya,{height:"7"})]}),rd=e=>(0,i.jsx)(Ba,{align:"center",direction:{"@initial":"column","@desktop":"row"},gap:"1",justify:"center",width:1,children:e.children}),ad=e=>{const t=Xn(),n=ni(),s=si(),o=Zn(Ua),r=Zn(Xl),{mutate:a}=function(e={}){return ei("mutation LoginCodeEmailCreate($loginCodeEmail: LoginCodesEmailInput!) {\n loginCodeEmailCreate(loginCodeEmail: $loginCodeEmail) {\n insertedAt\n }\n}\n",e)}(),[l,d]=(0,L.useState)(null),[c,u]=(0,L.useState)(0),[h,m]=(0,L.useState)(0),[g,p]=(0,L.useState)(!1),[f,_]=(0,L.useState)(Date.now());return(0,i.jsx)(od,{link:(0,i.jsxs)(rd,{children:[(0,i.jsx)(Ar,{color:"gray500",children:t("vous_n_avez_pas_69078")}),(0,i.jsx)(Ar,{color:"primary500",css:{cursor:"pointer"},onClick:()=>{n.push(Ps.AUTH_SIGN_IN_EMAIL)},children:t("r_essayer_21582")})]}),children:(0,i.jsx)(kl,{direction:"column",initialValues:{email:s.getItem(Ul.AUTH_EMAIL)||"",code:""},render:({handleSubmit:n,submitting:s})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ar,{color:"gray900",fontSize:"textXl",fontWeight:"medium",textAlign:"center",children:t("se_connecter_av_59438")}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ar,{color:"gray500",textAlign:"center",children:t("saisissez_votre_01613")}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(Vl,{autoComplete:"email",isEmail:!0,label:t("adresse_e_mail_60930"),name:"email",placeholder:t("entrez_votre_ad_42451"),state:c>0||g?"disabled":"active"}),c>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(Vl,{autoComplete:"one-time-code",inputMode:"numeric",label:t("code_20843"),name:"code",pattern:"\\d*",placeholder:t("code_20843"),state:g?"disabled":void 0})]}),(0,i.jsx)(Ya,{height:"6"}),g?(0,i.jsx)(zl,{textAlign:"center",onClick:e.onFailure,children:t("recommencer_14712")}):(0,i.jsx)(zl,{isLoading:s,textAlign:"center",onClick:n,children:t(0===c?"recevoir_le_cod_88633":"se_connecter_63820")})]}),validate:e=>0===c?o.validateForForm(r.step1Schema())(e):o.validateForForm(r.step2Schema())(e),width:1,onSubmit:async n=>{if(0!==c){const{user:i,callbacks:s}=l;return function({code:e,user:t,callbacks:n}){return new Promise((i,s)=>{t.sendCustomChallengeAnswer(e,{...n,onSuccess:(...e)=>{n.onSuccess(...e),i(e)},onFailure:e=>{n.onFailure(e),s({type:"FAILED",error:e})},customChallenge:(...e)=>{n.customChallenge&&n.customChallenge(...e),s({type:"RETRY"})}})}).then(([e])=>e.getIdToken().getJwtToken())}({code:n.code,user:i,callbacks:s}).then(e.onSuccess,e=>{if("RETRY"===e.type)return m(h+1),{code:t("le_code_n_est_p_95065",3-(h+1))};{let i;return function(e,t,n){!async function(e){await fetch(`${P.HEAVENT_API_URL}/log/report`,{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}({message:"Could not auth",errorMessage:e,email:t,location:location.href,diff:Math.round((Date.now()-n)/1e3),userAgent:navigator.userAgent})}(e.message,n.email,f),p(!0),i=Gs.dw.fromMillis(Date.now()-f).as("minutes")>3?t("le_code_a_expir_45975"):t("le_code_n_est_p_12317"),{FORM_ERROR:i}}})}{await a({loginCodeEmail:{email:n.email,source:tt.App}}),_(Date.now());const e=await async function(e,t,n){try{return await J(e,t,n)}catch(i){if(i!==G)throw i;try{return await Z(e,V()),await J(e,t,n)}catch{throw new Error("Auth failure")}}}(n.email,td.A,td.A);d(e),u(1)}}})})},ld=L.forwardRef(({css:e,hint:t,description:n,icon:s,state:o,onChange:r,label:a,onForgotPasswordClick:l,...d},c)=>{const u=Xn(),h=L.useRef(),[m,g]=L.useState("password"),{inputId:p,descId:f,errorId:_}=qa();return(0,i.jsxs)(Ba,{ref:h,css:e,direction:"column",width:1,onClick:e=>{e.preventDefault(),h.current?.querySelector("input")?.focus()},children:[(0,i.jsxs)(Ba,{gap:"3",width:1,children:[(0,i.jsx)(Ar,{css:{flex:"1"},children:(0,i.jsx)(Ml,{htmlFor:p,children:a})}),"function"==typeof l&&(0,i.jsx)(Ar,{color:"primary500",css:{cursor:"pointer"},fontWeight:"medium",onClick:()=>{l?.()},children:u("mot_de_passe_ou_17690")})]}),(0,i.jsx)(Pl,{id:f,children:n}),(a||n)&&(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ll,{cursor:"text",icon:s,rightIcon:"password"===m?"eye":"eye-slash",state:o,onRightIconClick:e=>{Dl(e),g("password"===m?"text":"password")},children:(0,i.jsx)(Ar,{color:"inherit",css:{flex:"1",height:"100%","& input":{background:"transparent",border:"none",color:"$gray800",height:"100%",outline:"none",width:"100%"},"& input::placeholder":{color:"$gray500",opacity:1},"& input::-ms-input-placeholder ":{color:"$gray500",opacity:1}},children:(0,i.jsx)("input",{ref:c,"aria-describedby":n?f:void 0,"aria-errormessage":"error"===o?_:void 0,"aria-invalid":"error"===o,disabled:"disabled"===o,id:p,type:m,onChange:e=>{r(e.target.value)},...d})})}),(0,i.jsx)(Fl,{id:_,state:o,children:t})]})});ld.displayName="PasswordInput";const dd=({name:e,autoComplete:t,hint:n,state:s,...o})=>(0,i.jsx)(Ga.D0,{name:e,render:r=>{const a=$l(r.meta);return(0,i.jsx)(ld,{autoComplete:t??"current-password",hint:a?r.meta.error:n,name:e,state:a?"error":s,value:r.input.value,onBlur:r.input.onBlur,onChange:e=>{r.input.onChange(e)},onFocus:r.input.onFocus,...o})}});let cd=class extends Zl{constructor(e){super(e)}step1Schema(){return d.Ik().shape({email:this.email()})}step2Schema(){return d.Ik().shape({email:this.email(),code:this.code(),password:this.passwordRules()})}};cd=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[qn])],cd);const ud=_r("div",{display:"grid",variants:{align:{start:{alignItems:"start"},center:{alignItems:"center"},end:{alignItems:"end"}},gap:{1:{gap:"$1"},2:{gap:"$2"},3:{gap:"$3"},4:{gap:"$4"},5:{gap:"$5"},6:{gap:"$6"},7:{gap:"$7"},8:{gap:"$8"},9:{gap:"$9"},10:{gap:"$10"},11:{gap:"$11"},12:{gap:"$12"},13:{gap:"$13"}},columnGap:{1:{columnGap:"$1"},2:{columnGap:"$2"},3:{columnGap:"$3"},4:{columnGap:"$4"},5:{columnGap:"$5"},6:{columnGap:"$6"},7:{columnGap:"$7"},8:{columnGap:"$8"},9:{columnGap:"$9"},10:{columnGap:"$10"},11:{columnGap:"$11"},12:{columnGap:"$12"},13:{columnGap:"$13"}},rowGap:{1:{rowGap:"$1"},2:{rowGap:"$2"},3:{rowGap:"$3"},4:{rowGap:"$4"},5:{rowGap:"$5"},6:{rowGap:"$6"},7:{rowGap:"$7"},8:{rowGap:"$8"},9:{rowGap:"$9"},10:{rowGap:"$10"},11:{rowGap:"$11"},12:{rowGap:"$12"},13:{rowGap:"$13"}}}}),hd=L.forwardRef((e,t)=>{const n={gridTemplate:e.gridtemplate,gridTemplateColumns:e.gridtemplatecolumns,gridTemplateRows:e.gridtemplaterows};return e.height&&(n.height=mr(e.height)),e.width&&(n.width=mr(e.width)),(0,i.jsx)(ud,{role:"grid",...e,ref:t,css:{...n,...e.css}})});hd.displayName="Grid";const md=e=>(0,i.jsxs)(Ba,{align:"center",gap:{"@initial":"2","@desktop":"1"},children:[(0,i.jsx)(Ba,{align:"center",css:{background:e.isValid?"$success100":"white",border:e.isValid?"none":"1px solid $gray300",borderRadius:"16px",color:"$success500",fontSize:"11px",height:"16px",width:"16px"},justify:"center",children:e.isValid&&(0,i.jsx)(nl,{icon:"check"})}),(0,i.jsx)(Ar,{color:"gray800",fontWeight:"medium",children:e.children})]}),gd=e=>{const t=Xn();return(0,i.jsxs)(hd,{css:{border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$md",gap:"$3 $1",gridTemplateColumns:"1fr",gridTemplateRows:"1fr 1fr 1fr 1fr",padding:"$4","@desktop":{gridTemplateColumns:"1fr 1fr",gridTemplateRows:"1fr 1fr"}},children:[(0,i.jsx)(md,{isValid:Hl(e.password),children:t("16_caract_res_m_52434")}),(0,i.jsx)(md,{isValid:ql(e.password),children:t("au_moins_un_chi_73862")}),(0,i.jsx)(md,{isValid:Kl(e.password),children:t("au_moins_une_ma_58302")}),(0,i.jsx)(md,{isValid:Yl(e.password),children:t("au_moins_un_car_54396")})]})},pd=e=>{const t=Xn(),n=ni(),s=si(),o=Zn(Ua),r=Zn(cd),[a,l]=(0,L.useState)(0);return(0,i.jsx)(od,{link:(0,i.jsxs)(rd,{children:[(0,i.jsx)(Ar,{color:"gray500",children:t("vous_n_avez_pas_69078")}),(0,i.jsx)(Ar,{color:"primary500",css:{cursor:"pointer"},onClick:()=>{n.push(Ps.AUTH_SIGN_IN_EMAIL)},children:t("r_essayer_21582")})]}),children:(0,i.jsx)(kl,{direction:"column",initialValues:{email:s.getItem(Ul.AUTH_EMAIL)||"",code:"",password:""},render:({handleSubmit:e,submitting:n,values:s})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ar,{color:"gray900",fontSize:"textXl",fontWeight:"medium",textAlign:"center",children:t("mot_de_passe_ou_17690")}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ar,{color:"gray500",textAlign:"center",children:t("saisissez_votre_47959")}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(Vl,{autoComplete:"email",isEmail:!0,label:t("adresse_e_mail_60930"),name:"email",placeholder:t("entrez_votre_ad_42451"),state:a>0?"disabled":"active"}),a>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(Vl,{autoComplete:"one-time-code",inputMode:"numeric",label:t("code_re_u_par_e_75150"),name:"code",pattern:"\\d*",placeholder:t("code_20843")}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(dd,{autoComplete:"new-password",label:t("nouveau_mot_de_46347"),name:"password",placeholder:t("entrez_votre_mo_51874")}),(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(gd,{password:s.password})]}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(zl,{isLoading:n,textAlign:"center",onClick:e,children:t(0===a?"recevoir_le_cod_88633":"r_initialiser_l_12900")})]}),validate:e=>0===a?o.validateForForm(r.step1Schema())(e):o.validateForForm(r.step2Schema())(e),width:1,onSubmit:async t=>{0===a?(await ee(t.email),l(1)):e.onSuccess(await te(t.email,t.code,t.password))}})})},fd={Aso:{Aso:n(8301),HomeBackground:n(8144),Logo:n(0)},Blanks:{Accreditation:n(7008),Member:n(5594)},Maps:{GooglePlan:n(1416),GoogleSatellite:n(6954),IgnPlan:n(4025)},AvatarGroup:n(384),Background404:n(4236),FormPositionRanked:n(4628),FormPositionUnranked:n(1205),Google:n(1931),GoogleMaps:n(1446),Ign:n(9882),Login:n(2647),Login2x:n(2281),LogoWeezeventSquare:n(6041),NetflixWood:n(5095),UserProfile:n(8264),WeezConstruction:n(6400)},_d={Alert:n(2630),Check:n(3780),DnsBlank:n(1037),DnsWrongDomain:n(8184),Done:n(8652),Done2:n(3574),FileBlank:n(7619),FileCSV:n(9625),FileJPG:n(6751),FilePDF:n(9848),FilePNG:n(6959),FileZIP:n(539),RecrewteerMarker:n(8798),Sad:n(5376),WeezeventBlankHandGlobe:n(2599),WeezeventBlankMessages:n(6687),WeezeventBlankPerson:n(7648),WeezeventBlankSwissArmyKnife:n(4362)};var xd=n(7480);const Id=[At.De,At.En,At.Es,At.Fr,At.Nl];function vd(e){return e===At.En?"en-gb":e.toString().toLowerCase()}function bd(e){if(m(e)){const t=(0,xd.A)(e.trim().substring(0,2));return Id.includes(t)?t:null}return null}function jd(e,t){return t.has("lang")?bd(t.get("lang"))||At.En:e||bd(navigator.language)||At.En}const Cd=P.EMAIL_FROM_NAME,yd=P.EMAIL_FROM;function kd(e){return e===At.Fr?"https://weezevent.com/fr/cgus/":e===At.Nl?"https://weezevent.com/nl/gebruiksvoorwaarden-diensten/":e===At.Es?"https://weezevent.com/es/cgus/":"https://weezevent.com/en-gb/terms-of-use/"}const Ad=e=>{const{translate:t,history:n}=vl(),s=Zn(Zl),o=Zn(Ua),r=si(),a=kd(jd(null,new URL(location.href).searchParams));return(0,i.jsx)(od,{link:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(rd,{children:[(0,i.jsx)(Ar,{color:"gray500",children:t("pas_encore_sur_13386")}),(0,i.jsx)(Ar,{color:"primary500",css:{cursor:"pointer"},onClick:()=>{n.push(Ps.AUTH_SIGN_UP_CREDENTIALS)},children:t("ouvrez_un_compt_91337")})]}),(0,i.jsx)(rd,{children:(0,i.jsx)(Ar,{color:"primary500",css:{cursor:"pointer"},onClick:()=>{window.open(a,"_blank")},children:t("conditions_g_n_34786")})})]}),children:(0,i.jsx)(kl,{direction:"column",initialValues:{email:"",password:""},render:({handleSubmit:e,submitting:s,values:o})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ar,{color:"gray900",fontSize:"textXl",fontWeight:"medium",textAlign:"center",children:t("ravi_de_vous_re_24368")}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ar,{color:"gray500",textAlign:"center",children:t("identifiez_vous_57743")}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(Vl,{autoComplete:"email",isEmail:!0,label:t("adresse_e_mail_60930"),name:"email",placeholder:t("entrez_votre_ad_42451")}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(dd,{label:t("mot_de_passe_41738"),name:"password",placeholder:t("entrez_votre_mo_51874"),onForgotPasswordClick:()=>{r.setItem(Ul.AUTH_EMAIL,o.email),n.push(Ps.AUTH_FORGOT_PASSWORD)}}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(zl,{isLoading:s,textAlign:"center",onClick:e,children:t("se_connecter_63820")}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsxs)(Ba,{align:"center",gap:"4",children:[(0,i.jsx)(Ar,{css:{borderTop:"1px solid $gray200",flex:"1",height:"1"}}),(0,i.jsx)(Ar,{color:"gray500",fontSize:"textXs",children:t("ou_67404")}),(0,i.jsx)(Ar,{css:{borderTop:"1px solid $gray200",flex:"1",height:"1"}})]}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsxs)(Ba,{align:"center",css:{border:"1px solid $gray300",borderRadius:"$2",cursor:"pointer",height:"40px"},gap:"3",justify:"center",onClick:()=>{r.setItem(Ul.AUTH_EMAIL,o.email),n.push(Ps.AUTH_SIGN_IN_CODE)},children:[(0,i.jsx)(Ar,{color:"gray500",fontSize:"textMd",children:(0,i.jsx)(nl,{icon:"envelope"})}),(0,i.jsx)(Ar,{color:"gray700",children:t("se_connecter_av_59438")})]}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsxs)(Ba,{align:"center",css:{border:"1px solid $gray300",borderRadius:"$2",cursor:"pointer",height:"40px"},gap:"3",justify:"center",onClick:()=>{window.location.href=sd("Google")},children:[(0,i.jsx)(Ar,{children:(0,i.jsx)("img",{alt:"Google logo",height:"24px",src:fd.Google})}),(0,i.jsx)(Ar,{color:"gray700",children:t("se_connecter_av_86208")})]})]}),validate:e=>o.validateForForm(s.signInPasswordSchema())(e),width:1,onSubmit:async n=>{try{return e.onSuccess(await Q(n.email,n.password)),{}}catch(e){if("NotAuthorizedException"===e.code&&"Incorrect username or password."===e.message||"UserNotFoundException"===e.code&&"User does not exist."===e.message)return{email:t("adresse_e_mail_73393")};throw e}}})})};let wd=class extends Zl{constructor(e){super(e)}step1Schema(){return d.Ik().shape({email:this.email(),password:this.passwordRules()})}step2Schema(){return d.Ik().shape({email:this.email(),code:this.code(),password:this.passwordRules()})}};wd=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[qn])],wd);const Sd=e=>{const{history:t,translate:n}=vl(),s=Zn(Ua),o=Zn(wd),[r,a]=(0,L.useState)(0),l=kd(jd(null,new URL(location.href).searchParams));return(0,i.jsx)(od,{link:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(rd,{children:[(0,i.jsx)(Ar,{color:"gray500",children:n("vous_avez_d_j_26391")}),(0,i.jsx)(Ar,{color:"primary500",css:{cursor:"pointer"},onClick:()=>{t.push(Ps.AUTH_SIGN_IN_EMAIL)},children:n("connectez_vous_14760")})]}),(0,i.jsx)(rd,{children:(0,i.jsx)(Ar,{color:"primary500",css:{cursor:"pointer"},onClick:()=>{window.open(l,"_blank")},children:n("conditions_g_n_34786")})})]}),children:(0,i.jsx)(Ga.lV,{initialValues:{email:"",code:"",password:""},render:({handleSubmit:e,submitting:t,values:s})=>(0,i.jsxs)("form",{style:{width:"100%"},onSubmit:e,children:[(0,i.jsx)(Ar,{color:"gray900",fontSize:"textXl",fontWeight:"medium",textAlign:"center",children:n("cr_er_un_compte_71423")}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ar,{color:"gray500",textAlign:"center",children:n("utilisez_recrew_64841")}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(Vl,{autoComplete:"email",isEmail:!0,label:n("adresse_e_mail_60930"),name:"email",placeholder:n("entrez_votre_ad_42451"),state:r>0?"disabled":"active"}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(dd,{label:n("nouveau_mot_de_46347"),name:"password",placeholder:n("entrez_votre_mo_51874"),state:r>0?"disabled":"active"}),(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(gd,{password:s.password}),r>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(Vl,{autoComplete:"one-time-code",inputMode:"numeric",label:n("code_re_u_par_e_75150"),name:"code",pattern:"\\d*",placeholder:n("code_20843")})]}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(zl,{isLoading:t,textAlign:"center",onClick:e,children:n(0===r?"recevoir_le_cod_04513":"cr_er_mon_compt_84515")}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsxs)(Ba,{align:"center",gap:"4",children:[(0,i.jsx)(Ar,{css:{borderTop:"1px solid $gray200",flex:"1",height:"1"}}),(0,i.jsx)(Ar,{color:"gray500",fontSize:"textXs",children:n("ou_67404")}),(0,i.jsx)(Ar,{css:{borderTop:"1px solid $gray200",flex:"1",height:"1"}})]}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsxs)(Ba,{align:"center",css:{border:"1px solid $gray300",borderRadius:"$2",cursor:"pointer",height:"40px"},gap:"3",justify:"center",onClick:()=>{window.location.href=sd("Google")},children:[(0,i.jsx)(Ar,{children:(0,i.jsx)("img",{alt:"Google logo",height:"24px",src:fd.Google})}),(0,i.jsx)(Ar,{color:"gray700",children:n("s_inscrire_avec_54027")})]})]}),validate:e=>0===r?s.validateForForm(o.step1Schema())(e):s.validateForForm(o.step2Schema())(e),onSubmit:async t=>{0===r?(await ee(t.email),a(1)):e.onSuccess(await te(t.email,t.code,t.password))}})})},Ed=async e=>{await go(jo,{token:e}),window.location.href=Ps.HOME},Td=e=>{e&&di("Auth failure",e),window.location.href=Ps.AUTH_SIGN_IN},zd=()=>(0,i.jsxs)(Sr.dO,{children:[(0,i.jsx)(Sr.qh,{exact:!0,path:Ps.AUTH_FORGOT_PASSWORD,children:(0,i.jsx)(pd,{onSuccess:Ed})}),(0,i.jsx)(Sr.qh,{exact:!0,path:Ps.AUTH_SIGN_IN_EMAIL,children:(0,i.jsx)(Ad,{onSuccess:Ed})}),(0,i.jsx)(Sr.qh,{exact:!0,path:Ps.AUTH_SIGN_IN_CODE,children:(0,i.jsx)(ad,{onFailure:Td,onSuccess:Ed})}),(0,i.jsx)(Sr.qh,{exact:!0,path:Ps.AUTH_SIGN_UP_CREDENTIALS,children:(0,i.jsx)(Sd,{onSuccess:Ed})}),(0,i.jsx)(Sr.qh,{exact:!0,path:Ps.AUTH_SIGN_UP_CODE,children:(0,i.jsx)(oi,{path:Ps.AUTH_SIGN_IN_EMAIL})}),(0,i.jsx)(Sr.qh,{children:(0,i.jsx)(oi,{path:Ps.AUTH_SIGN_IN_EMAIL})})]}),Od=e=>(L.useEffect(()=>{!e.loader&&e.onLoad&&e.onLoad()},[e.loader]),e.loader?e.loader:(0,i.jsx)(i.Fragment,{children:e.children||(0,i.jsx)("div",{})})),Rd=()=>{const[,e]=location.search.substr(1).split("="),{data:t,loader:n}=Qn("query Tokens($code: String!) {\n userTokens(code: $code) {\n accessToken\n idToken\n refreshToken\n email\n }\n}\n",{code:e},[]);return(0,i.jsx)(Od,{loader:n,onLoad:()=>{!function(e){const t=new B.p4({IdToken:new B.Yw({IdToken:e.idToken}),RefreshToken:new B.c9({RefreshToken:e.refreshToken}),AccessToken:new B.pD({AccessToken:e.accessToken})}),n=e.email.trim().toLowerCase();new B.TU({Username:n,Pool:q()}).setSignInUserSession(t)}(t.userTokens),window.location.href=Ps.HOME}})},$d="www.partagetapassion.com",Dd="registering.aso.fr",Pd="billets.onepiecemarket.fr",Fd=new Map([[1792,"evenements.handicap-international.fr"],[858,$d],[1773,"communaute.rncb.fr"],[3306,"mariage.ravey.fr"],[3136,Dd],[3469,Pd]]);function Md(e){(0,L.useEffect)(()=>{const t=document.title;return document.title=(n=location.host,`${m(i=e)?`${i} | `:""}${function(e){return e===$d?"Partage Ta Passion":e===Pd?"One Piece":e===Dd?"A.S.O.":Cd}(n)}`),()=>{document.title=t};var n,i},[e])}function Nd(e,t){const n=L.useCallback(e,t||[]);L.useEffect(()=>(document.addEventListener("click",n,!1),()=>{document.removeEventListener("click",n,!1)}),t||[])}function Ld(e){const t=(0,L.useCallback)(t=>{"Esc"!==t.key&&"Escape"!==t.key||e()},[]);(0,L.useEffect)(()=>(document.addEventListener("keydown",t,!1),()=>{document.removeEventListener("keydown",t,!1)}),[])}const Bd="h-dropdown-open";function Vd(e,t){e.dispatchEvent(new CustomEvent(Bd,{bubbles:!0,detail:{uuid:t??""}}))}const Ud=L.createContext({}),Wd=e=>{const t=L.useRef(V()),[n,s]=L.useState(e.isOpen??!1),[o,r]=L.useState(null),[a,l]=L.useState(null),d=L.useCallback(n=>{e.disabled||(s(n),e.onStateChange&&e.onStateChange(n),!0===n&&o&&Vd(o,t.current))},[e.disabled,o,s,e.onStateChange]),c=L.useCallback(n=>{n.detail.uuid!==t.current&&!0!==e.doNotCloseOnOtherOpen&&d(!1)},[d]);return L.useEffect(()=>{e.isOpen!==n&&s(e.isOpen??!1)},[e.isOpen]),L.useEffect(()=>(document.addEventListener(Bd,c),()=>{document.removeEventListener(Bd,c)}),[c]),Ld(()=>{d(!1)}),Nd(()=>{d(!1)}),(0,i.jsx)(Ud.Provider,{value:{isOpen:n,referenceElement:o,popperElement:a,setIsOpen:d,setReferenceElement:r,setPopperElement:l},children:e.children})};function Gd(){return L.useContext(Ud)}const Hd=_r("div",{alignItems:"center",display:"flex",fontSize:"$textSm",fontWeight:"$regular",minHeight:"40px",px:"$4",py:"$2",userSelect:"none",width:"100%",ellipsis:"",variants:{color:{default:{cursor:"pointer",color:"$gray700","&:hover":{background:"$primary50",color:"$primary500"}},disabled:{color:"$gray400",cursor:"not-allowed"},heading:{color:"$gray500",fontSize:"$textXs",fontWeight:"$semiBold",cursor:"default"},red:{cursor:"pointer",color:"$error700","&:hover":{background:"$error50"}}}},defaultVariants:{color:"default"}}),qd=({children:e,color:t,css:n,download:s,to:o,onClick:r,target:a,role:l})=>"disabled"!==t&&o?(0,i.jsx)(el,{download:s,target:a,to:o,onClick:e=>r?.(e),children:(0,i.jsx)(Hd,{color:t||"default",css:n,children:e})}):(0,i.jsx)(Hd,{color:t||"default",css:n,role:l??"menuitem",tabIndex:o?void 0:"presentation"!==l?0:void 0,onClick:e=>r?.(e),children:e}),Kd=({css:e,children:t,color:n,download:s,icon:o,isDisabled:r=!1,onClick:a,to:l,target:d})=>(0,i.jsx)(qd,{color:n,css:{cursor:r?"not-allowed":"pointer",opacity:r?"0.6":"inherit",...e},download:s,target:d,to:l,onClick:e=>{r||(Vd(e.target),a?.(e))},children:(0,i.jsxs)(Ba,{align:"center",gap:"3",height:1,width:1,children:[(0,i.jsx)(Ba,{align:"center",height:1,justify:"start",width:16,children:(0,i.jsx)(nl,{icon:o})}),(0,i.jsx)(Ar,{css:{flex:"1",ellipsis:""},children:t})]})});var Yd=n(832);const Zd=e=>{const{isOpen:t,referenceElement:n,popperElement:s,setPopperElement:o}=Gd(),{styles:r,attributes:a,update:l}=(0,Yd.E)(n,s,{placement:e.placement,modifiers:[{name:"offset",options:{offset:[0,e.offset??8]}}]}),d="match"===e.width?`${n?.getBoundingClientRect().width??240}px`:"number"==typeof e.width?`${e.width}px`:"fit-content";L.useEffect(()=>{l?.()},[l,t,n]),L.useEffect(()=>{if(n){const e=new ResizeObserver(()=>{l?.()});return e.observe(n),()=>{e.disconnect()}}return td.A},[l,n]);const c=(0,i.jsx)(Ba,{ref:o,"aria-hidden":!t,"aria-orientation":e["aria-orientation"],css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$lg",display:t?"flex":"none",maxHeight:e.maxHeight?`${e.maxHeight}px`:void 0,overflowX:"hidden",overflowY:"auto",py:"$2",width:d,zIndex:"400",...e.css,...r.popper,"&:empty":{opacity:0}},direction:"column",id:e.id,role:"menu",onClick:e=>Dl(e,!1),...a.popper,tabIndex:-1,children:e.children});return t?e.renderOnPortal?(0,Kt.createPortal)(c,document.body):c:null},Xd=e=>{const{isOpen:t,setIsOpen:n,setReferenceElement:s}=Gd(),o=e.children,r=e=>{Dl(e),n(!t),o.props.onClick?.(e)},a=L.cloneElement(L.Children.only(o),{ref(e){s(e)},onClick(e){e.preventDefault(),r(e)},onKeyPress(e){r(e)},tabIndex:0});return(0,i.jsx)(i.Fragment,{children:a})};var Jd=n(5315);function Qd(e){try{if("#"!==e[0]||7!==e.length)return"black";{const t=parseInt(e.substring(1,3),16);return.299*t+.587*parseInt(e.substring(3,5),16)+.114*parseInt(e.substring(5),16)>150?"black":"white"}}catch{return"black"}}function ec(e,t){const n="#"===e[0]?1:0;return`rgba(${parseInt(e.substring(0+n,2+n),16)}, ${parseInt(e.substring(2+n,4+n),16)}, ${parseInt(e.substring(4+n),16)}, ${t>1?t/100:t})`}const tc=[0,50,100,200,300,400,500,600,700,800,900,950,1e3],nc=Object.fromEntries(Object.keys(xr.colors).filter(e=>e.includes("700")).flatMap(e=>{const t=e.substring(0,e.length-3),n={50:xr.colors[`${t}50`].value,100:xr.colors[`${t}100`].value,500:xr.colors[`${t}500`].value,700:xr.colors[`${t}700`].value};return[[t,n],[n[700],n]]}));function ic(e,t=700){const n=nc[e.toLowerCase()];if(n)return n;{const n=(0,Jd.KI)(e),i=((e,t=700)=>tc.map(n=>{if(0===n)return{stop:n,tweak:100};if(1e3===n)return{stop:n,tweak:0};if(n===t)return{stop:n,tweak:e};{const i=Math.abs((n-t)/100),s=n[e,n.copy({l:t/100}).formatHex()]))}}function sc(e){return m(e)&&e.startsWith("#")&&7===e.length}const oc=_r("div",{alignItems:"center",borderRadius:"$1",display:"flex",fontWeight:"$medium",gap:"$1",px:"$2",userSelect:"none",height:"fit-content","&:has(.h-badge-count)":{paddingRight:"$1"},"& > .h-badge-count":{borderRadius:"3px",height:"calc(100% - 8px)",marginLeft:"$1",px:"6px"},variants:{size:{sm:{height:"22px",fontSize:"12px","& > .h-badge-count":{fontSize:"10px"}},md:{height:"24px",fontSize:"12px","& > .h-badge-count":{fontSize:"10px"}},lg:{height:"28px",fontSize:"14px","& > .h-badge-count":{fontSize:"12px"}}},cursor:{default:{cursor:"default"},pointer:{cursor:"pointer"},text:{cursor:"text"}},ellipsis:{true:{maxWidth:"80%","& .h-badge-content":{ellipsis:!0,flex:"1"}}}},defaultVariants:{size:"sm",cursor:"default"}}),rc=L.forwardRef((e,t)=>{const n=L.useMemo(()=>{const t=e.color||"gray",n=ic(t);return"gray"===t?{background:"$gray100",color:"$gray700","& > .h-badge-left-icon":{color:"$gray500"},"& > .h-badge-count":{background:"$gray200"}}:"white"===t?{background:"white",border:"1px solid $gray300","& > .h-badge-count":{background:"$gray100"}}:"white-with-green-icon"===t?{background:"white",border:"1px solid $gray300","& > .h-badge-left-icon":{color:"$success500"}}:{background:n[50],color:n[700],"& > .h-badge-left-icon":{color:n[500]},"& > .h-badge-count":{background:n[100]}}},[e.color]);return(0,i.jsxs)(oc,{ref:t,color:e.color,css:{maxWidth:"100%",...n,...e.css},cursor:e.cursor,ellipsis:e.ellipsis,size:e.size,onClick:e.onClick,children:[e.leftIcon&&(0,i.jsx)(Ba,{className:"h-badge-left-icon",css:{cursor:e.onLeftIconClick?"pointer":"inherit"},onClick:t=>{e.onLeftIconClick?.(t)},children:(0,i.jsx)(nl,{icon:e.leftIcon,iconStyle:e.leftIconStyle})}),e.children&&(0,i.jsx)(Ar,{className:"h-badge-content",css:{flex:"1",overflow:"hidden"},title:e.title,onClick:t=>{e.onContentClick?.(t)},children:(0,i.jsx)(Ar,{css:{ellipsis:!0},title:"string"==typeof e.children?e.children:"",children:e.children})}),e.rightIcon&&(0,i.jsx)(Ba,{css:{cursor:e.onRightIconClick?"pointer":"inherit"},onClick:t=>{e.onRightIconClick?.(t)},children:(0,i.jsx)(nl,{icon:e.rightIcon})}),("number"==typeof e.count||m(e.count))&&(0,i.jsx)(Ba,{align:"center",className:"h-badge-count",children:e.count})]})});rc.displayName="Badge";const ac=jr({"0%":{opacity:1},"50%":{opacity:.4},"100%":{opacity:1}}),lc=L.memo(function(e){const t="circular"===e.variant?e.size:e.height,n="circular"===e.variant?e.size:e.width;return(0,i.jsx)(Ar,{css:{animation:`${ac} 1.5s ease-in-out 0.5s infinite`,background:"$gray200",borderRadius:"circular"===e.variant?"50%":e.borderRadius,color:"transparent",...e.css},height:t,width:n,children:e.children})});var dc=n(9116),cc=n(6618),uc=n(2499),hc=n(7456),mc=n(4757);const gc=({children:e,index:t,...n})=>(0,i.jsxs)(i.Fragment,{children:[0!==t&&(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(Ar,{"aria-label":e?.toString(),font:"gray600 textXs semiBold",role:"group",width:1,...n,children:e}),(0,i.jsx)(Ya,{height:"2"})]}),pc=_r("div",{alignItems:"center",border:"1px solid $gray300",cursor:"pointer",display:"flex",fontSize:"10px",fontWeight:"$semiBold",justifyContent:"center","& > i":{fontSize:"10px",fontWeight:"$semiBold"},variants:{size:{sm:{borderRadius:"4px",height:"16px",width:"16px"},md:{borderRadius:"6px",height:"20px",width:"20px"}},state:{unchecked:{background:"white","&:hover":{border:"1px solid $primary600"}},checked:{background:"$primary600",border:"none",color:"white"},indeterminate:{background:"$primary600",border:"none",color:"white",padding:"$1","& > div":{borderTop:"2px solid white",width:"100%"}}},disabled:{true:{}}},compoundVariants:[{state:"unchecked",disabled:!0,css:{background:"$gray100",borderColor:"$gray200","&:hover":{borderColor:"$gray200"}}},{state:"checked",disabled:!0,css:{background:"$gray100",borderColor:"$gray200",color:"$gray300"}},{state:"indeterminate",disabled:!0,css:{background:"$gray100",borderColor:"$gray200",color:"$gray300","& > div":{borderTopColor:"$gray300"}}}],defaultVariants:{size:"sm",state:"unchecked"}}),fc=({shouldPreventDefault:e=!0,...t})=>{il("common-front/src/designSystem/components/checkbox.tsx","a new component following the pattern of common-front/src/designSystem/components/radioCard.tsx");const n=n=>{e&&Dl(n),!0!==t.disabled&&("unchecked"!==t.state&&t.state?t.onClick("unchecked",n):t.onClick("checked",n))};return(0,i.jsxs)(pc,{"aria-describedby":t.descId,"aria-labelledby":t.labelId,disabled:t.disabled,id:t.inputId,role:"checkbox",size:t.size,state:t.state,tabIndex:t.tabIndex??0,onClick:e=>n(e),onKeyDown:e=>{"Space"===e.code&&n(e)},children:["checked"===t.state&&(0,i.jsx)("i",{className:"far fa-check"}),"indeterminate"===t.state&&(0,i.jsx)("div",{})]})},_c=({shouldPreventDefault:e=!0,...t})=>{il("common-front/src/designSystem/components/checkbox.tsx","a new component following the pattern of common-front/src/designSystem/components/radioCard.tsx");const{descId:n,inputId:s,labelId:o}=qa(),r=void 0!==t.subtext&&null!==t.subtext,a=n=>{e&&n.preventDefault(),!0!==t.disabled&&("unchecked"!==t.state&&t.state?t.onClick("unchecked",n):t.onClick("checked",n))};return(0,i.jsxs)(Ba,{css:{cursor:t.disabled?"not-allowed":"pointer",userSelect:"none",...t.css},tabIndex:0,onClick:a,onKeyDown:e=>{"Space"===e.code&&a(e)},children:[(0,i.jsx)(Ba,{css:{alignItems:"center",height:"md"===t.size?"23px":"20px"},children:(0,i.jsx)(fc,{descId:n,disabled:t.disabled,inputId:s,labelId:o,shouldPreventDefault:!1,size:t.size,state:t.state,tabIndex:-1,onClick:td.A})}),(0,i.jsx)(Ya,{width:"2"}),(0,i.jsxs)(Ba,{css:{flexDirection:"column",fontSize:"md"===t.size?"$3":"$2"},children:[(0,i.jsx)(Ml,{htmlFor:s,id:o,children:(0,i.jsx)(Ar,{css:{color:t.disabled&&!r?"$gray300":"$gray800"},fontWeight:"medium",children:t.children})}),r&&(0,i.jsx)(Ar,{color:"gray500",id:n,children:t.subtext})]})]})},xc=_r("div",{background:"white",alignItems:"center",cursor:"pointer",display:"flex",justifyContent:"center",variants:{size:{sm:{borderRadius:"16px",height:"16px",width:"16px"},md:{borderRadius:"20px",height:"20px",width:"20px"}},state:{unchecked:{border:"1px solid $gray300","&:hover":{border:"1px solid $primary600"}},checked:{border:"1px solid $primary600"}},disabled:{true:{cursor:"not-allowed"}}},compoundVariants:[{size:"sm",state:"checked",css:{"& > div":{background:"$primary600",borderRadius:"6px",height:"6px",width:"6px"}}},{size:"md",state:"checked",css:{"& > div":{background:"$primary600",borderRadius:"8px",height:"8px",width:"8px"}}},{state:"unchecked",disabled:!0,css:{background:"$gray100",borderColor:"$gray200","&:hover":{borderColor:"$gray200"}}},{state:"checked",disabled:!0,css:{background:"$gray100",borderColor:"$gray200","& > div":{background:"$gray300 !important"}}}],defaultVariants:{size:"sm",state:"unchecked"}}),Ic=({shouldPreventDefault:e=!0,...t})=>{il("common-front/src/designSystem/components/radio.tsx","common-front/src/designSystem/components/radioCard.tsx for card-style radio buttons, or create a new component following that pattern for other styles of radio button");const n=n=>{e&&Dl(n),!0!==t.disabled&&("unchecked"!==t.state&&t.state?t.onClick("unchecked"):t.onClick("checked"))};return(0,i.jsx)(xc,{"aria-describedby":t.descId,"aria-labelledby":t.labelId,disabled:t.disabled,id:t.inputId,role:"radio",size:t.size,state:t.state,tabIndex:t.tabIndex??0,onClick:n,onKeyDown:e=>{"Space"===e.key&&n(e)},children:"checked"===t.state&&(0,i.jsx)("div",{})})},vc=({shouldPreventDefault:e=!0,...t})=>{il("common-front/src/designSystem/components/radio.tsx","common-front/src/designSystem/components/radioCard.tsx for card-style radio buttons, or create a new component following that pattern for other styles of radio button");const{inputId:n,descId:s,labelId:o}=qa(),r="string"==typeof t.subtext&&t.subtext.length>0,a=n=>{e&&Dl(n),!0!==t.disabled&&("unchecked"!==t.state&&t.state?t.onClick("unchecked"):t.onClick("checked"))};return(0,i.jsxs)(Ba,{css:{...t.css,cursor:t.disabled?"not-allowed":"pointer",userSelect:"none"},tabIndex:0,onClick:e=>{a(e)},onKeyDown:e=>{"Space"===e.key&&a(e)},children:[(0,i.jsx)(Ba,{css:{alignItems:"center",height:"md"===t.size?"23px":"20px"},children:(0,i.jsx)(Ic,{descId:s,disabled:t.disabled,inputId:n,labelId:o,shouldPreventDefault:!1,size:t.size,state:t.state,tabIndex:-1,onClick:td.A})}),(0,i.jsx)(Ya,{width:"2"}),(0,i.jsxs)(Ba,{css:{flexDirection:"column",fontSize:"md"===t.size?"$3":"$2","& div":{cursor:"pointer !important"}},children:[(0,i.jsx)(Ml,{htmlFor:n,id:o,children:(0,i.jsx)(Ar,{css:{color:t.disabled&&!r?"$gray300":"$gray800"},fontWeight:"medium",children:t.children})}),t.subtext&&(0,i.jsx)(Ar,{color:"gray500",id:s,children:t.subtext})]})]})},bc=({children:e,css:t,disabled:n,isCheckbox:s,isRadio:o,isSelected:r,onClick:a,subtext:l,value:d,...c})=>{const u=L.useCallback(()=>{n||a?.()},[n,a]),h=L.useCallback(e=>{"Enter"===e.key&&u?.()},[u]);return(0,i.jsxs)(Ba,{align:"center","aria-checked":s?r:void 0,"aria-label":e,"aria-selected":r,css:{cursor:n?"default":"pointer",minHeight:"40px",padding:"$2 $3",userSelect:"none","&:hover":{background:"$gray100",borderRadius:"$1"},...t},gap:"3",role:"option",tabIndex:0,width:1,onClick:u,onKeyDown:h,...c,children:[s&&(0,i.jsx)(fc,{disabled:n,shouldPreventDefault:!1,state:r?"checked":"unchecked",onClick:td.A}),o&&(0,i.jsx)(Ic,{shouldPreventDefault:!1,state:r?"checked":"unchecked",onClick:td.A}),(0,i.jsxs)(Ba,{css:{flex:"1",overflow:"hidden"},direction:"column",gap:"1",children:[(0,i.jsx)(Ar,{color:"gray800",css:{ellipsis:!0},title:e,width:1,children:e}),m(l)&&(0,i.jsx)(Ar,{color:"gray500",css:{ellipsis:!0},title:l,width:1,children:l})]}),!s&&!o&&r&&(0,i.jsx)(Ar,{color:"primary500",children:(0,i.jsx)(nl,{icon:"check"})})]})};function jc(e){return L.Children.toArray(e).map(t=>{if("optgroup"===t.type)return[{id:(0,Ha.A)(),type:"group",text:t.props.label}].concat(jc(t.props.children));if("option"===t.type)return{id:(0,Ha.A)(),type:"option",text:t.props.children,value:t.props.value,disabled:t.props.disabled,selected:t.props.selected,radio:t.props["data-radio"],style:t.props.style,subtext:t.props["data-subtext"]};if(t.type===Symbol.for("react.fragment"))return jc(t.props.children);throw di("Unexpected child type",t,e),new Error("Unexpected child type")}).flat()}function Cc(e){return Object.fromEntries(e.filter(e=>"option"===e.type).map(e=>[e.value,e.text]))}const yc=({children:e,createText:t,css:n,description:s,hint:o,icon:r,isCreateVisible:a,isSearchLoading:l,isSearchVisible:d,isSelectAllVisible:c,label:u,menuWidth:h,multiple:p,onChange:f,onClick:_,onCreateClick:x,placeholder:I,renderOnPortal:v,renderValue:b,searchElement:j,searchPlaceholder:C,state:y,triggerElem:k,values:A})=>{const w=Xn(),S=L.useCallback(e=>e?.focus({preventScroll:!0}),[]),[E,T]=L.useState(!1),[z,O]=L.useState(""),{inputId:R,descId:$}=qa(),D=L.useMemo(()=>jc(e),[e]),P=L.useMemo(()=>D.flatMap(e=>"option"===e.type?[e.value]:[]),[D]),F=L.useMemo(()=>{const e=(z||"").trim().toLowerCase();return D.filter(t=>""===e||"group"===t.type||t.text.toLowerCase().includes(e)).filter((e,t,n)=>{const i=n[t+1];return"option"===e.type||"option"===i?.type})},[D,z]),M=L.useMemo(()=>(0,dc.A)((0,cc.A)(F.filter(e=>"option"===e.type&&m(e.radio)),e=>e.radio),e=>e.map(e=>e.value)),[F]),N=L.useMemo(()=>Cc(D),[D]),B=L.useMemo(()=>(0,Mr.A)((0,uc.A)(A),(0,uc.A)(P)),[A,P]),V=L.useCallback(()=>{f(B?[]:P)},[f,P,B]),U=L.useMemo(()=>b?b(A[0],N[A[0]]):N[A[0]],[b,A,N]);return L.useEffect(()=>{E||O("")},[E]),(0,i.jsxs)(Ba,{css:n,direction:"column",width:1,children:[u&&(0,i.jsx)(Ml,{htmlFor:R,children:u}),s&&(0,i.jsx)(Pl,{id:$,children:s}),(u||s)&&(0,i.jsx)(Ya,{height:"1"}),(0,i.jsxs)(Wd,{disabled:"disabled"===y,isOpen:E,onStateChange:e=>T(e),children:[(0,i.jsx)(Xd,{children:k||(0,i.jsx)(Ll,{"aria-describedby":$,"aria-label":(u??I)+(N[A[0]]?` (currently: ${N[A[0]]})`:""),"aria-multiselectable":p,"aria-owns":F.map(e=>e.id).join(" "),"aria-placeholder":I,css:{maxHeight:"200px",overflowY:"auto",padding:"$2 $3",userSelect:"none",cursor:"disabled"===y?"not-allowed":void 0},cursor:"disabled"===y?"default":"pointer",height:"fluid",icon:r,id:R,rightIcon:E?"chevron-up":"chevron-down",state:y,children:so(A)?p?(0,i.jsx)(Ba,{css:{flex:"1",overflowY:"auto"},gap:"2",height:1,role:"presentation",wrap:"wrap",children:A.map((e,t)=>(0,i.jsx)(rc,{ellipsis:!0,rightIcon:"xmark",onRightIconClick:t=>{Dl(t),f((0,hc.A)(A,e))},children:N[e]},t))}):(0,i.jsx)(Ar,{color:"gray800",css:{flex:"1",overflow:"hidden"},role:"presentation",children:(0,i.jsx)(Ar,{css:{ellipsis:!0},title:U,children:U})}):(0,i.jsx)(Ar,{color:"gray500",css:{flex:"1"},role:"presentation",children:I})})}),(0,i.jsx)(Zd,{css:{padding:"0"},placement:"bottom-start",renderOnPortal:v,width:h??"match",children:(0,i.jsxs)(Ba,{direction:"column",width:1,children:[(0,i.jsxs)(Ba,{css:{padding:"$3"},direction:"column",width:1,children:[d&&(0,i.jsxs)(i.Fragment,{children:[j||(0,i.jsx)(Bl,{ref:S,icon:"magnifying-glass",placeholder:C||w("rechercher_50038"),state:"search",value:z,onChange:O}),(0,i.jsx)(Ya,{height:"3"})]}),(0,i.jsx)(Ar,{css:{maxHeight:"250px",overflowY:"auto"},children:l?(0,i.jsxs)(Ba,{direction:"column",gap:"1",children:[(0,i.jsx)(lc,{borderRadius:"$1",height:40}),(0,i.jsx)(lc,{borderRadius:"$1",height:40}),(0,i.jsx)(lc,{borderRadius:"$1",height:40})]}):F.map((e,t)=>{if("group"===e.type)return(0,i.jsx)(gc,{id:e.id,index:t,children:e.text},e.id);{const n=e.value,s=e.selected??A.includes(n),o=e.radio,r=!0===p&&g(o),a=!0===p&&m(o);return(0,i.jsx)(bc,{css:e.style,disabled:e.disabled,id:e.id,isCheckbox:r,isRadio:a,isSelected:s,subtext:e.subtext,value:e.value,onClick:()=>{if(_)_(n,s);else if(p&&r)f(s?(0,hc.A)(A,n):A.concat(n));else if(p&&a){const e=(0,mc.A)(A,M[o]).concat(s?[]:[n]);f(e)}else f(s?[]:[n]),T(!1)},children:e.text},t)}})})]}),a&&(0,i.jsxs)(Ba,{css:{background:"$gray50",boxShadow:"0px -1px 3px rgba(16, 24, 40, 0.1), 0px -1px 2px rgba(16, 24, 40, 0.06)",color:"$primary500",cursor:"pointer",padding:"$3 $4",userSelect:"none"},width:1,onClick:()=>{x?.(),T(!1)},children:["+ ",t||w("cr_er_82895")]}),c&&(0,i.jsx)(Ba,{css:{background:"$gray50",boxShadow:"0px -1px 3px rgba(16, 24, 40, 0.1), 0px -1px 2px rgba(16, 24, 40, 0.06)",color:"$primary500",cursor:"pointer",padding:"$3 $4",userSelect:"none"},width:1,onClick:V,children:w(B?"tout_d_s_lectio_37372":"tout_s_lectionn_48027")})]})})]}),(0,i.jsx)(Fl,{state:y,children:o})]})},kc=e=>(0,i.jsx)(Ba,{align:"center",className:"table-header-row",css:{background:"$gray50",border:"1px solid $gray200",fontSize:"$textXs",fontWeight:"$medium",height:"44px",width:"100%",...e.css},role:"row",children:e.children}),Ac=L.createContext({}),wc=e=>{const[t,n]=L.useState(null);return(0,i.jsx)(Ac.Provider,{value:{clickedRowIndex:t,setClickedRowIndex:n},children:e.children})},Sc=({children:e,css:t,hideBorder:n,...s})=>(0,i.jsx)(wc,{children:(0,i.jsx)(Ba,{className:!0===n?"table-no-border":"table",css:{width:"100%","&.table > div:first-child":{borderTopLeftRadius:"$1",borderTopRightRadius:"$1"},"&.table > div:last-child":{borderBottomLeftRadius:"$1",borderBottomRightRadius:"$1"},"&.table-no-border .table-header-row":{borderLeft:"none",borderRight:"none",borderTop:"none"},"&.table-no-border .table-row":{borderLeft:"none",borderRight:"none"},"&.table-no-border .table-row:last-child":{borderBottom:"none"},...t},direction:"column",...s,children:e})});function Ec(e){const t=window.matchMedia(e),[n,i]=(0,L.useState)(t.matches);return(0,L.useEffect)(()=>{const e=()=>i(t.matches);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)},[n,e]),n}function Tc(){return Ec(pr.mobile)}function zc(e,t){return{flex:t?"1 1 0":e?"0 0 0":"1",minWidth:t?`${t}px`:e?`${e}px`:void 0}}const Oc=L.forwardRef((e,t)=>(0,i.jsx)(Ba,{ref:t,align:"center",className:"table-cell",css:{...zc(e.width,e.minWidth),color:"$gray800",overflow:"hidden",px:"$3",...e.css},height:1,role:"gridcell",onClick:t=>{e.onClick&&e.onClick(t)},...(0,Er.A)(e,["direction","align","justify","wrap","gap"]),children:e.children}));Oc.displayName="Cell";const Rc=25,$c=[25,50,100];var Dc=n(7773);const Pc=e=>(0,i.jsx)(zl,{color:"white",css:{background:e.active?"$gray100":"white",border:0,borderInlineStart:"1px solid $gray300",color:e.disabled?"$gray400":"$gray700",cursor:e.cursor,fontWeight:"$medium",inlineSize:"40px",blockSize:"32px",alignItems:"center",justifyContent:"center",borderRadius:"unset"},disabled:e.disabled,textAlign:"center",onClick:()=>{e.onClick()},children:e.children}),Fc=e=>{const t=Xn(),n=Tc(),s=e.limit??Rc,o=Jn(),r=e.offset/s,a=(0,Dc.A)(Math.max(0,r-2),Math.min(e.numberOfPages,r+3)),l=0===r,d=r===e.numberOfPages-1,c=Math.min(e.totalCount,(r+1)*s);return(0,i.jsxs)(Oc,{css:{gap:"$6","@tablet":{justifyContent:"space-between"}},children:[(0,i.jsx)(Ar,{css:{order:1,display:n?"none":void 0},width:150,children:!n&&e.showLimits&&(0,i.jsx)(Ba,{css:{border:"1px solid $gray300",borderRadius:"$1",overflow:"hidden",width:"fit-content","& > button:first-child":{borderLeft:"none"}},children:$c.map((t,n)=>(0,i.jsx)(Pc,{active:s===t,cursor:"pointer",disabled:!1,onClick:()=>{e.setLimit?.(t)},children:t},n))})}),!n&&(e.totalCount>s?(0,i.jsxs)(Ba,{css:{border:"1px solid $gray300",borderRadius:"$1",overflow:"hidden",order:3,"& > button:first-child":{borderLeft:"none"}},children:[(0,i.jsx)(Pc,{active:!1,cursor:l?"default":"pointer",disabled:l,onClick:()=>e.setOffset(e.offset-s),children:(0,i.jsx)(nl,{icon:"arrow-left"})}),e.numberOfPages<=7?(0,Dc.A)(0,e.numberOfPages).map(t=>(0,i.jsx)(Pc,{active:r===t,cursor:"pointer",disabled:!1,onClick:()=>e.setOffset(t*s),children:t+1},t)):(0,i.jsxs)(i.Fragment,{children:[!a.includes(0)&&(0,i.jsx)(Pc,{active:!1,cursor:"pointer",disabled:!1,onClick:()=>e.setOffset(0),children:"1"}),!a.includes(1)&&(0,i.jsx)(Pc,{active:!1,cursor:"default",disabled:!1,onClick:td.A,children:(0,i.jsx)(nl,{icon:"ellipsis"})}),a.map(t=>(0,i.jsx)(Pc,{active:r===t,cursor:"pointer",disabled:!1,onClick:()=>e.setOffset(t*s),children:t+1},t)),!a.includes(e.numberOfPages-2)&&(0,i.jsx)(Pc,{active:!1,cursor:"default",disabled:!1,onClick:td.A,children:(0,i.jsx)(nl,{icon:"ellipsis"})}),!a.includes(e.numberOfPages-1)&&(0,i.jsx)(Pc,{active:!1,cursor:"pointer",disabled:!1,onClick:()=>e.setOffset((e.numberOfPages-1)*s),children:e.numberOfPages})]}),(0,i.jsx)(Pc,{active:!1,cursor:d?"default":"pointer",disabled:d,onClick:()=>e.setOffset(e.offset+s),children:(0,i.jsx)(nl,{icon:"arrow-right"})})]}):(0,i.jsx)(Ar,{css:{order:3}})),n&&(0,i.jsx)(Ba,{css:{border:"1px solid $gray300",borderRadius:"$1",overflow:"hidden",order:1,width:"fit-content","& > button:first-child":{borderLeft:"none"}},children:(0,i.jsx)(Pc,{active:!1,cursor:l?"default":"pointer",disabled:l,onClick:()=>e.setOffset(e.offset-s),children:(0,i.jsx)(nl,{icon:"arrow-left"})})}),(0,i.jsx)(Ar,{css:{order:2,flex:"1","@tablet":{order:3,flex:"unset"}},textAlign:n?"center":"end",width:150,children:n?[...o(t("page_1_of_2_92409"),(0,i.jsx)("b",{children:r+1}),(0,i.jsx)("b",{children:e.numberOfPages}))]:t("_1_2_sur_3_79592",r*s+1,c,e.totalCount)}),n&&(0,i.jsx)(Ba,{css:{border:"1px solid $gray300",order:3,borderRadius:"$1",overflow:"hidden",width:"fit-content","& > button:first-child":{borderLeft:"none"}},children:(0,i.jsx)(Pc,{active:!1,cursor:d?"default":"pointer",disabled:d,onClick:()=>e.setOffset(e.offset+s),children:(0,i.jsx)(nl,{icon:"arrow-right"})})})]})},Mc=e=>{const{setClickedRowIndex:t}=L.useContext(Ac);return(0,i.jsx)(Ba,{align:"center",className:"table-row",css:{background:"white",borderBottom:"1px solid $gray200",borderLeft:"1px solid $gray200",borderRight:"1px solid $gray200",height:"64px",width:"100%",...e.css,"&:hover .dot-dot-dot":{display:"block"},"&:hover .h-controls":{display:"flex"}},role:"row",onClick:()=>{e.onClick?.()},onMouseLeave:n=>{t?.(null),e.onMouseLeave?.(n)},children:e.children})},Nc=e=>(0,i.jsx)(Mc,{css:{borderBottomLeftRadius:"$2",borderBottomRightRadius:"$2",height:"56px",...e.css},children:e.children}),Lc=({css:e,filters:t,headerCells:n,limit:s,numberOfPages:o,offset:r,rows:a,setLimit:l,setOffset:d,showLimits:c=!1,showPagination:u=!0,title:h,totalCount:m})=>{const g=(c||u)&&"number"==typeof o&&"number"==typeof r&&"function"==typeof d&&(m??0)>0;return(0,i.jsxs)(Ar,{css:{...e},children:[(0,i.jsxs)(Ba,{align:"center",css:{background:"white",border:"1px solid $gray200",borderBottom:"none",borderTopLeftRadius:"$2",borderTopRightRadius:"$2",padding:"$3 $6"},gap:"3",children:[h&&(0,i.jsx)(Ar,{color:"gray900",css:{flex:"1"},fontSize:"textLg",fontWeight:"medium",children:h}),t]}),(0,i.jsxs)(Sc,{role:"grid",children:[(0,i.jsx)(kc,{css:{borderRadius:"0 !important",borderTop:"1px solid $gray200"},children:n}),a,g&&(0,i.jsx)(Nc,{children:(0,i.jsx)(Fc,{limit:s,numberOfPages:o,offset:r,setLimit:l,setOffset:d,showLimits:c,totalCount:m??0})})]})]})};function Bc(){const e=Xn();return t=>(0,uc.A)(t.map(t=>({value:t,translation:e(t)})),({translation:e})=>u(e)).map(({value:e,translation:t},n)=>(0,i.jsx)("option",{value:e,children:t},n))}var Vc=n(4741);function Uc(e,t=500){return(0,L.useCallback)((0,Vc.A)(e,t),[])}function Wc(e,t=500){const[n,i]=(0,L.useState)(e),[s,o]=(0,L.useState)(e),r=Uc(e=>{o(e)},t);return[n,s,e=>{i(e),r(e)}]}const Gc=e=>(0,i.jsx)(Ba,{align:"center",className:"table-header-cell",css:{...zc(e.width,e.minWidth),color:"$gray500",overflow:"hidden",px:"$3",...e.css},height:1,role:"columnheader",tabIndex:0,onClick:()=>{e.onClick?.()},...(0,Er.A)(e,["aria-label","direction","align","justify","wrap","gap"]),children:e.children}),Hc=e=>(0,i.jsx)(Ba,{align:"center",css:{borderBottom:"1px solid $gray200",borderLeft:e.bx?"1px solid $gray200":void 0,borderRight:e.bx?"1px solid $gray200":void 0,padding:"$3",...e.css},height:72,width:1,children:(0,i.jsx)(lc,{borderRadius:"$1",height:1,width:1})});function qc(e){return e.endsWith("@weezevent.com")||e.endsWith("@weeztix.com")||e.endsWith("@kaboodle.com")}function Kc(e){return["benjamin.vuitton@weezevent.com","florent.odier@weezevent.com","matthieu.ravey@weezevent.com"].includes(e)}const Yc=e=>(0,i.jsxs)(Wd,{isOpen:e.isOpen,onStateChange:e.onStateChange,children:[(0,i.jsx)(Xd,{children:e.triggerElem||(0,i.jsx)(Ba,{align:"center",css:{cursor:"pointer"},height:20,justify:"center",width:20,children:(0,i.jsx)(nl,{icon:"ellipsis-vertical"})})}),(0,i.jsx)(Zd,{placement:"bottom-end",children:e.children})]}),Zc=({css:e,children:t,hideIcon:n,to:s,...o})=>{const r=new URL(s.toString(),P.HEAVENT_APP_URL),a=n?void 0:["http:","https:"].includes(r.protocol)&&r.origin!==location.origin?"arrow-up-right-from-square":o.download?"arrow-down-to-bracket":void 0;return(0,i.jsx)(Ba,{align:"center",as:"span",css:{cursor:"pointer",fontWeight:"$medium","&:hover":{textDecoration:"underline"},...e},gap:"2",children:(0,i.jsxs)(el,{to:r,...o,children:[t,a&&(0,i.jsx)(Ar,{as:"span",css:{marginInlineStart:"$1"},children:(0,i.jsx)(nl,{icon:a})})]})})};Zc.displayName="LinkText";const Xc=({children:e,css:t,gap:n,justify:s,width:o})=>(0,i.jsx)(Oc,{width:o??100,children:(0,i.jsx)(Ba,{align:"center",className:"h-controls",css:{cursor:"pointer",display:"none",...t},gap:n??"6",height:1,justify:s,width:1,onClick:Dl,children:e})});let Jc=class{translationService;constructor(e){this.translationService=e}now(){return Gs.c9.utc()}invalid(){return Gs.c9.invalid("Invalid")}toLocaleString(e,t){return e.toLocaleString(t,{locale:vd(this.translationService.language)})}};function Qc(e){return e.infos?.billingAddress?.company||""}function eu(e){return e.infos?.vatExonerated?e.amountCents:1.2*e.amountCents}function tu(e){switch(e){case Qe.Refunded:return{color:"warning",leftIcon:"rotate-left"};case Qe.Paid:return{color:"success",leftIcon:"check"};case Qe.Overdue:return{color:"error",leftIcon:"alarm-clock"};case Qe.Waiting:return{color:"error",leftIcon:"xmark"};default:return ll()}}var nu;Jc=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[qn])],Jc),function(e){e.Amount="amount",e.AmountTTC="amountTTC",e.CustomerName="customerName",e.Date="date",e.Organization="organization",e.PaidAt="paidAt",e.State="state",e.TransactionId="transactionId"}(nu||(nu={}));const iu=e=>{const t=Xn(),n=Zn(Jc),{user:s}=ai(),o=new Intl.NumberFormat(s?.language.toLowerCase()||"fr",{style:"currency",currency:e.invoice.currency}),r=(a=e.invoice).isRefunded?Qe.Refunded:a.paidAt?Qe.Paid:a.insertedAte.markAsPaid?.(),children:t("marqu_e_comme_p_72620")}),!e.invoice.isRefunded&&(0,i.jsx)(Kd,{icon:"rotate-left",onClick:()=>e.markAsRefunded?.(),children:t("marqu_e_comme_r_27551")})]})})]})},su=_r("dialog",{background:"white",border:"none",display:"flex",flexDirection:"column",variants:{mobile:{true:{height:"100%",paddingBottom:"$6",paddingTop:"$8",width:"100%"},false:{borderRadius:"12px",maxHeight:"calc(100% - 80px)",py:"$7"}},size:{sm:{},md:{},lg:{}}},compoundVariants:[{mobile:!1,size:"sm",css:{width:"$modalSm"}},{mobile:!1,size:"md",css:{width:"$modalMd"}},{mobile:!1,size:"lg",css:{width:"$modalLg"}}],defaultVariants:{mobile:!1}}),ou=_r("div",{display:"flex",flexDirection:"column",overflow:"auto",width:"100%",variants:{mobile:{true:{flex:"1",px:"$4"},false:{px:"$8"}}}}),ru=_r("div",{display:"flex",gap:"$3",variants:{mobile:{true:{boxShadow:"0px -1px 3px rgba(16, 24, 40, 0.1), 0px -1px 2px rgba(16, 24, 40, 0.06)",flexDirection:"column",padding:"$6 $4 0 $4","& .h-button-content":{textAlign:"center"}},false:{flexDirection:"row",justifyContent:"flex-end",px:"$8"}}}}),au=({buttons:e,children:t,onClose:n,role:s,size:o})=>{const r=Tc();return Ld(n),il("common-front/src/components/modals/__deprecated/modal/modal.tsx","common-front/src/components/modals/base/modal.tsx"),(0,Kt.createPortal)((0,i.jsx)(Ba,{align:"center",css:{background:"rgba(52, 64, 84, 0.7)",height:"100%",left:0,position:"absolute",top:0,width:"100%",zIndex:"300"},"data-testid":"modal-backdrop",justify:"center",role:"presentation",onMouseDown:n,children:(0,i.jsxs)(su,{mobile:r,open:!0,role:s,size:o,onClick:e=>Dl(e,!1),onMouseDown:e=>Dl(e,!1),children:[(0,i.jsx)(ou,{mobile:r,children:t}),e&&(0,i.jsx)(ru,{mobile:r,children:e})]})}),document.body)};var lu=n(6666);const du=e=>{const t=Xn(),{mutate:n,isLoading:s}=function(e={}){return ei("mutation BackofficeInvoiceMarkAsPaid($invoiceId: InvoiceId!, $transactionId: String!) {\n backofficeInvoiceMarkAsPaid(invoiceId: $invoiceId, transactionId: $transactionId)\n}\n",e)}(),{data:o}=Qn("query QontoTransactions {\n backoffice {\n qontoTransactions {\n id\n label\n amount\n }\n }\n}\n",{},[]),[r,a]=(0,L.useState)(null);return(0,i.jsxs)(au,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Ar,{color:"primary600",fontSize:"displayXs",textAlign:"center",children:(0,i.jsx)(nl,{icon:"file-invoice"})}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(Ar,{color:"gray900",fontSize:"textLg",textAlign:"center",children:t("marqu_e_une_fac_47139")}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(yc,{isSearchVisible:!0,label:t("s_lectionner_un_46296"),values:r?[r]:[],onChange:e=>{a((0,lu.A)(e)||null)},children:(o.backoffice?.qontoTransactions??[]).map(e=>(0,i.jsxs)("option",{value:e.id,children:[e.label," (",e.amount,"€)"]},e.id))}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsxs)(Ba,{gap:"3",justify:"end",children:[(0,i.jsx)(zl,{disabled:!r,isLoading:s,onClick:async()=>{await n({invoiceId:e.invoiceId,transactionId:r}),e.reload()},children:t("marqu_e_comme_p_72620")}),(0,i.jsx)(zl,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},cu=e=>{const{mutate:t}=function(e={}){return ei("mutation BackofficeInvoiceMarkAsRefunded($invoiceId: InvoiceId!) {\n backofficeInvoiceMarkAsRefunded(invoiceId: $invoiceId)\n}\n",e)}(),[n,s]=(0,L.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(iu,{invoice:e.invoice,isBackoffice:!0,markAsPaid:()=>s(!0),markAsRefunded:async()=>{await t({invoiceId:e.invoice.id}),e.reload()},showColumn:e.showColumn}),n&&(0,i.jsx)(du,{invoiceId:e.invoice.id,reload:e.reload,onClose:()=>{s(!1)}})]})},uu=()=>{const{history:e,translate:t}=vl(),n=si(),s=Bc(),{user:o}=ai(),[r,a,l]=Wc(""),[d,c]=(0,L.useState)([]),[u,h]=(0,L.useState)(0),{data:g,isLoading:p,reload:f}=Qn("query BackofficeInvoices($name: String, $states: [InvoiceState!], $offset: Int) {\n backoffice {\n invoices(name: $name, states: $states, limit: 25, offset: $offset) {\n nodes {\n id\n invoiceNumber\n amountCents\n smsAmountCents\n currency\n paidAt\n url\n organizationsNames\n dealId\n isRefunded\n insertedAt\n infos\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{name:m(a)?a:void 0,states:so(d)?d:void 0,offset:u},[]);const[_,x]=(0,L.useState)(()=>{const e=n.getItem(Ul.BACKOFFICE_INVOICES_COLUMNS);return e?JSON.parse(e):[]}),I=(0,L.useCallback)(e=>{x(e),n.setItem(Ul.BACKOFFICE_INVOICES_COLUMNS,JSON.stringify(e))},[x]),v=(0,L.useCallback)(async e=>{try{const t=new URLSearchParams;e?t.set("date",e):so(d)&&t.set("states",d.join(","));const n=await fetch(`${P.HEAVENT_API_URL}/invoice/all?${t}`,{method:"post",headers:{[N]:await Y()||""}}),{link:i}=await n.json();window.open(i,"_blank")}catch{window.alert(t("impossible_d_ex_55872"))}},[d]),b=e=>_.includes(e);return(0,i.jsx)(Ar,{css:{overflowY:"auto"},height:1,width:1,children:(0,i.jsxs)(Ba,{css:{padding:"$7"},direction:"column",width:1,children:[(0,i.jsxs)(Ba,{gap:"4",children:[(0,i.jsx)(Ar,{color:"gray900",css:{flex:"1"},fontSize:"displayXs",fontWeight:"semiBold",children:t("factures_03552")}),(0,i.jsx)(Ar,{children:(0,i.jsxs)(yc,{isSelectAllVisible:!0,multiple:!0,placeholder:"Colonnes visibles",values:_,onChange:I,children:[(0,i.jsx)("option",{value:"organization",children:t("organisation_71863")}),(0,i.jsx)("option",{value:"customerName",children:t("nom_du_client_28343")}),(0,i.jsx)("option",{value:"date",children:t("Date")}),(0,i.jsx)("option",{value:"paidAt",children:t("pay_e_le_92377")}),(0,i.jsx)("option",{value:"amount",children:t("montant_55595")}),(0,i.jsx)("option",{value:"amountTTC",children:t("montant_ttc_86677")}),(0,i.jsx)("option",{value:"state",children:t("status_06428")}),(0,i.jsx)("option",{value:"transactionId",children:t("id_de_la_transa_98869")})]})}),(0,i.jsx)(zl,{onClick:()=>{e.push(Ps.HOME)},children:"Home"}),(0,i.jsxs)(Wd,{children:[(0,i.jsx)(Xd,{children:(0,i.jsx)(zl,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Zd,{placement:"bottom-end",children:[(0,i.jsx)(Kd,{icon:"eye",onClick:()=>{e.push(Ps.BACKOFFICE_ORGANIZATIONS)},children:t("voir_les_organi_78756")}),(0,i.jsx)(Kd,{icon:"file-export",onClick:()=>v(null),children:"Exporter les factures sélectionnées"}),(0,i.jsx)(Kd,{icon:"file-export",onClick:()=>v("this-month"),children:t("exporter_les_fa_11017")}),(0,i.jsx)(Kd,{icon:"file-export",onClick:()=>v("last-month"),children:t("exporter_les_fa_01571")}),(0,i.jsx)(Kd,{icon:"file-export",onClick:()=>v("all"),children:t("exporter_toutes_46318")})]})]})]}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(Lc,{filters:(0,i.jsxs)(Ba,{align:"center",gap:"3",children:[(0,i.jsx)(Ar,{width:320,children:(0,i.jsx)(Bl,{icon:"magnifying-glass",placeholder:t("id_ou_nom_25064"),value:r,onChange:e=>{l(e),h(0)}})}),(0,i.jsx)(Ar,{width:200,children:(0,i.jsx)(yc,{isSearchVisible:!0,multiple:!0,values:d,onChange:c,children:s(vn)})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Gc,{children:t("num_ro_de_factu_68150")}),b(nu.Organization)&&(0,i.jsx)(Gc,{children:t("organisation_71863")}),b(nu.CustomerName)&&(0,i.jsx)(Gc,{children:t("nom_du_client_28343")}),b(nu.Date)&&(0,i.jsx)(Gc,{children:t("Date")}),b(nu.PaidAt)&&(0,i.jsx)(Gc,{children:t("pay_e_le_92377")}),b(nu.Amount)&&(0,i.jsx)(Gc,{children:t("montant_55595")}),b(nu.AmountTTC)&&(0,i.jsx)(Gc,{children:t("montant_ttc_86677")}),b(nu.State)&&(0,i.jsx)(Gc,{children:t("status_06428")}),b(nu.TransactionId)&&(0,i.jsx)(Gc,{children:t("id_de_la_transa_98869")}),Kc(o?.email||"")&&(0,i.jsx)(Gc,{width:100})]}),numberOfPages:g.backoffice?.invoices.numberOfPages??0,offset:u,rows:p?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Hc,{bx:!0}),(0,i.jsx)(Hc,{bx:!0}),(0,i.jsx)(Hc,{bx:!0})]}):(0,i.jsx)(i.Fragment,{children:g.backoffice.invoices.nodes.map(e=>(0,i.jsx)(cu,{invoice:e,reload:f,showColumn:b},e.id))}),setOffset:h,title:t("liste_des_factu_86735"),totalCount:g.backoffice?.invoices.totalCount??0})]})})};let hu=class{countries;countriesCodes;phoneCodes;constructor(e){const t=e.translate.bind(e);this.countries=(0,uc.A)([{phoneCode:"+93",code:"AF",name:t("afghanistan_59344"),nationality:t("afghan_10143"),emoji:"🇦🇫",language:["ps","ps-AR"],smsPrice:.27},{phoneCode:"+35818",code:"AX",name:t("_land_islands_92853"),nationality:t("_land_island_62794"),emoji:"🇦🇽"},{phoneCode:"+355",code:"AL",name:t("albania_07621"),nationality:t("albanian_82021"),emoji:"🇦🇱",language:["sq","sq-AL"],smsPrice:.12},{phoneCode:"+213",code:"DZ",name:t("algeria_37723"),nationality:t("algerian_97855"),emoji:"🇩🇿",language:"ar-DZ",smsPrice:.285},{phoneCode:"+1684",code:"AS",name:t("american_samoa_95023"),nationality:t("american_samoan_76272"),emoji:"🇦🇸"},{phoneCode:"+376",code:"AD",name:t("andorra_45150"),nationality:t("andorran_97838"),emoji:"🇦🇩",smsPrice:.52},{phoneCode:"+244",code:"AO",name:t("angola_15815"),nationality:t("angolan_91942"),emoji:"🇦🇴",smsPrice:.17},{phoneCode:"+1264",code:"AI",name:t("anguilla_53408"),nationality:t("anguillan_92612"),emoji:"🇦🇮"},{phoneCode:"+1268",code:"AG",name:t("antigua_and_bar_05164"),nationality:t("antiguan_or_bar_26833"),emoji:"🇦🇬"},{phoneCode:"+54",code:"AR",name:t("argentina_92219"),nationality:t("argentine_14780"),emoji:"🇦🇷",language:"es-AR",smsPrice:.11},{phoneCode:"+374",code:"AM",name:t("armenia_90330"),nationality:t("armenian_87788"),language:["hy","hy-AM"],emoji:"🇦🇲"},{phoneCode:"+297",code:"AW",name:t("aruba_62942"),nationality:t("aruban_18515"),emoji:"🇦🇼",smsPrice:.33},{phoneCode:"+61",code:"AU",name:t("australia_84647"),nationality:t("australian_83553"),emoji:"🇦🇺",language:"en-AU",smsPrice:.093},{phoneCode:"+43",code:"AT",name:t("austria_67457"),nationality:t("austrian_39761"),emoji:"🇦🇹",language:"de-AT",smsPrice:.066},{phoneCode:"+994",code:"AZ",name:t("azerbaijan_14476"),nationality:t("azerbaijani_az_92428"),emoji:"🇦🇿",language:"az-AZ",smsPrice:.39},{phoneCode:"+1242",code:"BS",name:t("bahamas_33701"),nationality:t("bahamian_86817"),emoji:"🇧🇸"},{phoneCode:"+973",code:"BH",name:t("bahrain_43417"),nationality:t("bahraini_76209"),emoji:"🇧🇭",language:"ar-BH",smsPrice:.12},{phoneCode:"+880",code:"BD",name:t("bangladesh_48531"),nationality:t("bangladeshi_66399"),emoji:"🇧🇩",smsPrice:.425},{phoneCode:"+1246",code:"BB",name:t("barbados_57235"),nationality:t("barbadian_02319"),emoji:"🇧🇧"},{phoneCode:"+375",code:"BY",name:t("belarus_97102"),nationality:t("belarusian_60742"),emoji:"🇧🇾",language:["be","be-BY"],smsPrice:.31},{phoneCode:"+32",code:"BE",name:t("belgium_21048"),nationality:t("belgian_00407"),emoji:"🇧🇪",language:["fr-BE","nl-BE"],smsPrice:.094},{phoneCode:"+501",code:"BZ",name:t("belize_94460"),nationality:t("belizean_90827"),emoji:"🇧🇿",language:"en-BZ",smsPrice:0},{phoneCode:"+229",code:"BJ",name:t("benin_88614"),nationality:t("beninese_benin_55987"),emoji:"🇧🇯",smsPrice:.04},{phoneCode:"+1441",code:"BM",name:t("bermuda_84448"),nationality:t("bermudian_berm_58878"),emoji:"🇧🇲"},{phoneCode:"+975",code:"BT",name:t("bhutan_12608"),nationality:t("bhutanese_34101"),emoji:"🇧🇹",smsPrice:.39},{phoneCode:"+591",code:"BO",name:t("bolivia_plurin_43912"),nationality:t("bolivian_98429"),emoji:"🇧🇴",language:["es-BO","qu-BO"],smsPrice:.38},{phoneCode:"+5997",code:"BQ",name:t("bonaire_sint_e_69605"),nationality:t("bonaire_07340"),emoji:"🇧🇶"},{phoneCode:"+387",code:"BA",name:t("bosnia_and_herz_91990"),nationality:t("bosnian_or_herz_88694"),emoji:"🇧🇦",language:["bs-BA","hr-BA","sr-BA"],smsPrice:.46},{phoneCode:"+267",code:"BW",name:t("botswana_49258"),nationality:t("motswana_botsw_32461"),emoji:"🇧🇼",smsPrice:.13},{phoneCode:"+55",code:"BR",name:t("brazil_03275"),nationality:t("brazilian_74116"),emoji:"🇧🇷",language:"pt-BR",smsPrice:.051},{phoneCode:"+246",code:"IO",name:t("british_indian_92949"),nationality:t("british_indian_08875"),emoji:"🇮🇴"},{phoneCode:"+673",code:"BN",name:t("brunei_darussal_84695"),nationality:t("bruneian_06218"),emoji:"🇧🇳",language:"ms-BN",smsPrice:.05},{phoneCode:"+359",code:"BG",name:t("bulgaria_97045"),nationality:t("bulgarian_79288"),emoji:"🇧🇬",language:["bg","bg-BG"],smsPrice:.16},{phoneCode:"+226",code:"BF",name:t("burkina_faso_55299"),nationality:t("burkinab_02690"),emoji:"🇧🇫",smsPrice:.032},{phoneCode:"+257",code:"BI",name:t("burundi_85561"),nationality:t("burundian_35605"),emoji:"🇧🇮",smsPrice:.05},{phoneCode:"+238",code:"CV",name:t("cabo_verde_28261"),nationality:t("cabo_verdean_88842"),emoji:"🇨🇻",smsPrice:.2},{phoneCode:"+855",code:"KH",name:t("cambodia_77971"),nationality:t("cambodian_19577"),emoji:"🇰🇭",smsPrice:.52},{phoneCode:"+237",code:"CM",name:t("cameroon_44200"),nationality:t("cameroonian_12953"),emoji:"🇨🇲",smsPrice:.024},{phoneCode:"+1",code:"CA",name:t("canada_52584"),nationality:t("canadian_90836"),emoji:"🇨🇦",language:["en-CA","fr-CA"],smsPrice:.03},{phoneCode:"+1345",code:"KY",name:t("cayman_islands_80923"),nationality:t("caymanian_07521"),emoji:"🇰🇾"},{phoneCode:"+236",code:"CF",name:t("central_african_74182"),nationality:t("central_african_89873"),emoji:"🇨🇫",smsPrice:.053},{phoneCode:"+235",code:"TD",name:t("chad_58721"),nationality:t("chadian_55061"),emoji:"🇹🇩",smsPrice:.035},{phoneCode:"+56",code:"CL",name:t("chile_06923"),nationality:t("chilean_69498"),emoji:"🇨🇱",language:"es-CL",smsPrice:.13},{phoneCode:"+86",code:"CN",name:t("china_40708"),nationality:t("chinese_12117"),emoji:"🇨🇳",language:["zh","zh-CN"],smsPrice:.055},{phoneCode:"+6189164",code:"CX",name:t("christmas_islan_46649"),nationality:t("christmas_islan_46649"),emoji:"🇨🇽"},{phoneCode:"+6189162",code:"CC",name:t("cocos_keeling_98180"),nationality:t("cocos_island_82627"),emoji:"🇨🇨"},{phoneCode:"+57",code:"CO",name:t("colombia_37632"),nationality:t("colombian_28222"),emoji:"🇨🇴",language:"es-CO",smsPrice:.033},{phoneCode:"+269",code:"KM",name:t("comoros_35439"),nationality:t("comoran_comori_49754"),emoji:"🇰🇲",smsPrice:.42},{phoneCode:"+242",code:"CG",name:t("congo_republic_97304"),nationality:t("congolese_04965"),emoji:"🇨🇬",smsPrice:.045},{phoneCode:"+243",code:"CD",name:t("congo_democrat_80102"),nationality:t("congolese_04965"),emoji:"🇨🇩",smsPrice:.2},{phoneCode:"+682",code:"CK",name:t("cook_islands_51542"),nationality:t("cook_island_99158"),emoji:"🇨🇰",smsPrice:.12},{phoneCode:"+506",code:"CR",name:t("costa_rica_57058"),nationality:t("costa_rican_17127"),emoji:"🇨🇷",language:"es-CR",smsPrice:.061},{phoneCode:"+225",code:"CI",name:t("c_te_d_ivoire_55380"),nationality:t("ivorian_01729"),emoji:"🇨🇮",smsPrice:.055},{phoneCode:"+385",code:"HR",name:t("croatia_52101"),nationality:t("croatian_62900"),emoji:"🇭🇷",language:["hr","hr-HR"],smsPrice:.13},{phoneCode:"+53",code:"CU",name:t("cuba_11922"),nationality:t("cuban_00956"),emoji:"🇨🇺",smsPrice:.08},{phoneCode:"+5999",code:"CW",name:t("cura_ao_46587"),nationality:t("cura_aoan_65055"),emoji:"🇨🇼"},{phoneCode:"+357",code:"CY",name:t("cyprus_86967"),nationality:t("cypriot_85282"),emoji:"🇨🇾",smsPrice:.083},{phoneCode:"+420",code:"CZ",name:t("czech_republic_57570"),nationality:t("czech_42120"),emoji:"🇨🇿",language:["cs","cs-CZ"],smsPrice:.08},{phoneCode:"+45",code:"DK",name:t("denmark_28356"),nationality:t("danish_44544"),emoji:"🇩🇰",language:["da","da-DK"],smsPrice:.06},{phoneCode:"+253",code:"DJ",name:t("djibouti_38156"),nationality:t("djiboutian_72034"),emoji:"🇩🇯",smsPrice:.12},{phoneCode:"+1767",code:"DM",name:t("dominica_13395"),nationality:t("dominican_54004"),emoji:"🇩🇲"},{phoneCode:["+1809","+1829","+1849"],code:"DO",name:t("dominican_repub_08891"),nationality:t("dominican_54004"),emoji:"🇩🇴",language:"es-DO"},{phoneCode:"+593",code:"EC",name:t("ecuador_25933"),nationality:t("ecuadorian_50591"),emoji:"🇪🇨",language:["es-EC","qu-EC"],smsPrice:.48},{phoneCode:"+20",code:"EG",name:t("egypt_61058"),nationality:t("egyptian_75798"),emoji:"🇪🇬",language:"ar-EG",smsPrice:.45},{phoneCode:"+503",code:"SV",name:t("el_salvador_37036"),nationality:t("salvadoran_02475"),emoji:"🇸🇻",language:"es-SV",smsPrice:.34},{phoneCode:"+240",code:"GQ",name:t("equatorial_guin_39570"),nationality:t("equatorial_guin_44537"),emoji:"🇬🇶",smsPrice:.21},{phoneCode:"+291",code:"ER",name:t("eritrea_67366"),nationality:t("eritrean_20355"),emoji:"🇪🇷",smsPrice:.045},{phoneCode:"+372",code:"EE",name:t("estonia_58256"),nationality:t("estonian_46354"),emoji:"🇪🇪",language:["et","et-EE"],smsPrice:.08},{phoneCode:"+251",code:"ET",name:t("ethiopia_72971"),nationality:t("ethiopian_03019"),emoji:"🇪🇹",smsPrice:.08},{phoneCode:"+500",code:"FK",name:t("falkland_island_59316"),nationality:t("falkland_island_15848"),emoji:"🇫🇰"},{phoneCode:"+298",code:"FO",name:t("faroe_islands_71549"),nationality:t("faroese_32806"),emoji:"🇫🇴",language:["fo","fo-FO"],smsPrice:.046},{phoneCode:"+679",code:"FJ",name:t("fiji_36369"),nationality:t("fijian_39649"),emoji:"🇫🇯",smsPrice:.21},{phoneCode:"+358",code:"FI",name:t("finland_07531"),nationality:t("finnish_24918"),emoji:"🇫🇮",language:["fi","fi-FI","se-FI","sv-FI"],smsPrice:.083},{phoneCode:"+33",code:"FR",name:t("france_26614"),nationality:t("french_86034"),emoji:"🇫🇷",language:["fr","fr-FR"],smsPrice:.045},{phoneCode:"+594",code:"GF",name:t("french_guiana_80598"),nationality:t("french_guianese_02041"),emoji:"🇬🇫",smsPrice:.17},{phoneCode:"+689",code:"PF",name:t("french_polynesi_50842"),nationality:t("french_polynesi_47751"),emoji:"🇵🇫",smsPrice:.18},{phoneCode:"+241",code:"GA",name:t("gabon_58286"),nationality:t("gabonese_62984"),emoji:"🇬🇦",smsPrice:.045},{phoneCode:"+220",code:"GM",name:t("gambia_93575"),nationality:t("gambian_30767"),emoji:"🇬🇲",smsPrice:.19},{phoneCode:"+995",code:"GE",name:t("georgia_93003"),nationality:t("georgian_79366"),emoji:"🇬🇪",language:["ka","ka-GE"]},{phoneCode:"+49",code:"DE",name:t("germany_31193"),nationality:t("german_36386"),emoji:"🇩🇪",language:["de","de-DE"],smsPrice:.089},{phoneCode:"+233",code:"GH",name:t("ghana_32464"),nationality:t("ghanaian_99745"),emoji:"🇬🇭",smsPrice:.033},{phoneCode:"+350",code:"GI",name:t("gibraltar_24360"),nationality:t("gibraltar_24360"),emoji:"🇬🇮",smsPrice:.076},{phoneCode:"+30",code:"GR",name:t("greece_28837"),nationality:t("greek_hellenic_39006"),emoji:"🇬🇷",language:["el","el-GR"],smsPrice:.061},{phoneCode:"+299",code:"GL",name:t("greenland_80916"),nationality:t("greenlandic_67508"),emoji:"🇬🇱",smsPrice:.036},{phoneCode:"+1473",code:"GD",name:t("grenada_04221"),nationality:t("grenadian_25686"),emoji:"🇬🇩"},{phoneCode:"+590",code:"GP",name:t("guadeloupe_95839"),nationality:t("guadeloupe_95839"),emoji:"🇬🇵"},{phoneCode:"+1671",code:"GU",name:t("guam_76384"),nationality:t("guamanian_guam_01132"),emoji:"🇬🇺"},{phoneCode:"+502",code:"GT",name:t("guatemala_49597"),nationality:t("guatemalan_60946"),emoji:"🇬🇹",language:"es-GT",smsPrice:.3},{phoneCode:["+441481","+447781","+447839","+447911"],code:"GG",name:t("guernsey_87507"),nationality:t("channel_island_53762"),emoji:"🇬🇬"},{phoneCode:"+224",code:"GN",name:t("guinea_20770"),nationality:t("guinean_42564"),emoji:"🇬🇳",smsPrice:.056},{phoneCode:"+245",code:"GW",name:t("guinea_bissau_80728"),nationality:t("bissau_guinean_66742"),emoji:"🇬🇼",smsPrice:.09},{phoneCode:"+592",code:"GY",name:t("guyana_92443"),nationality:t("guyanese_56902"),emoji:"🇬🇾",smsPrice:.3},{phoneCode:"+509",code:"HT",name:t("haiti_99471"),nationality:t("haitian_50142"),emoji:"🇭🇹",smsPrice:.3},{phoneCode:"+379",code:"VA",name:t("vatican_city_st_63732"),nationality:t("vatican_36370"),emoji:"🇻🇦"},{phoneCode:"+504",code:"HN",name:t("honduras_79402"),nationality:t("honduran_35392"),emoji:"🇭🇳",language:"es-HN",smsPrice:.267},{phoneCode:"+852",code:"HK",name:t("hong_kong_96239"),nationality:t("hong_kong_hong_64846"),emoji:"🇭🇰",language:"zh-HK",smsPrice:.079},{phoneCode:"+36",code:"HU",name:t("hungary_57981"),nationality:t("hungarian_magy_62212"),emoji:"🇭🇺",language:["hu","hu-HU"],smsPrice:.106},{phoneCode:"+354",code:"IS",name:t("iceland_79438"),nationality:t("icelandic_17689"),emoji:"🇮🇸",language:["is","is-IS"],smsPrice:.085},{phoneCode:"+91",code:"IN",name:t("india_39466"),nationality:t("indian_25592"),emoji:"🇮🇳",language:["gu","gu-IN","hi","hi-IN","kn","kn-IN","kok","kok-IN","mr","mr-IN","pa","pa-IN","sa","sa-IN","ta","ta-IN","te","te-IN"],smsPrice:.078},{phoneCode:"+62",code:"ID",name:t("indonesia_65003"),nationality:t("indonesian_29723"),emoji:"🇮🇩",language:["id","id-ID"],smsPrice:.464},{phoneCode:"+98",code:"IR",name:t("iran_76293"),nationality:t("iranian_persia_76791"),emoji:"🇮🇷",language:["fa","fa-IR"],smsPrice:.38},{phoneCode:"+964",code:"IQ",name:t("iraq_82027"),nationality:t("iraqi_31025"),emoji:"🇮🇶",language:"ar-IQ",smsPrice:.33},{phoneCode:"+353",code:"IE",name:t("ireland_62034"),nationality:t("irish_35774"),emoji:"🇮🇪",language:"en-IE",smsPrice:.065},{phoneCode:["+441624","+447524","+447624","+447924"],code:"IM",name:t("isle_of_man_64982"),nationality:t("manx_86314"),emoji:"🇮🇲"},{phoneCode:"+972",code:"IL",name:t("israel_20033"),nationality:t("israeli_69936"),emoji:"🇮🇱",language:["he","he-IL"],smsPrice:.3},{phoneCode:"+39",code:"IT",name:t("italy_14828"),nationality:t("italian_56623"),emoji:"🇮🇹",language:["it","it-IT"],smsPrice:.038},{phoneCode:"+1876",code:"JM",name:t("jamaica_55090"),nationality:t("jamaican_58881"),emoji:"🇯🇲",language:"en-JM"},{phoneCode:"+81",code:"JP",name:t("japan_61810"),nationality:t("japanese_82636"),emoji:"🇯🇵",language:["ja","ja-JP"],smsPrice:.08},{phoneCode:"+441534",code:"JE",name:t("jersey_78898"),nationality:t("channel_island_53762"),emoji:"🇯🇪"},{phoneCode:"+962",code:"JO",name:t("jordan_36280"),nationality:t("jordanian_41310"),emoji:"🇯🇴",language:"ar-JO",smsPrice:.39},{phoneCode:["+76","+77"],code:"KZ",name:t("kazakhstan_30541"),nationality:t("kazakhstani_ka_27277"),emoji:"🇰🇿",language:["kk","kk-KZ"]},{phoneCode:"+254",code:"KE",name:t("kenya_67944"),nationality:t("kenyan_92311"),emoji:"🇰🇪",language:["sw","sw-KE"],smsPrice:.3},{phoneCode:"+686",code:"KI",name:t("kiribati_25369"),nationality:t("i_kiribati_66745"),emoji:"🇰🇮",smsPrice:.036},{phoneCode:"+383",code:"XK",name:t("kosovo_44440"),nationality:t("kosovare_35920"),emoji:"🇽🇰",smsPrice:.12},{phoneCode:"+850",code:"KP",name:t("korea_democrat_48584"),nationality:t("north_korean_16553"),emoji:"🇰🇵",smsPrice:.045},{phoneCode:"+82",code:"KR",name:t("korea_republic_72269"),nationality:t("south_korean_89943"),emoji:"🇰🇷",language:["ko","ko-KR"],smsPrice:.029},{phoneCode:"+965",code:"KW",name:t("kuwait_22026"),nationality:t("kuwaiti_76148"),emoji:"🇰🇼",language:"ar-KW",smsPrice:.327},{phoneCode:"+996",code:"KG",name:t("kyrgyzstan_84406"),nationality:t("kyrgyzstani_ky_19120"),emoji:"🇰🇬",language:["ky","ky-KG"],smsPrice:.34},{phoneCode:"+856",code:"LA",name:t("lao_people_s_de_31069"),nationality:t("lao_laotian_28318"),emoji:"🇱🇦",smsPrice:.273},{phoneCode:"+371",code:"LV",name:t("latvia_73526"),nationality:t("latvian_53651"),emoji:"🇱🇻",language:["lv","lv-LV"],smsPrice:.057},{phoneCode:"+961",code:"LB",name:t("lebanon_49493"),nationality:t("lebanese_43182"),emoji:"🇱🇧",language:"ar-LB",smsPrice:.32},{phoneCode:"+266",code:"LS",name:t("lesotho_91086"),nationality:t("basotho_52532"),emoji:"🇱🇸",smsPrice:.35},{phoneCode:"+231",code:"LR",name:t("liberia_12077"),nationality:t("liberian_64388"),emoji:"🇱🇷",smsPrice:.3},{phoneCode:"+218",code:"LY",name:t("libya_26741"),nationality:t("libyan_35337"),emoji:"🇱🇾",language:"ar-LY",smsPrice:.38},{phoneCode:"+424",code:"LI",name:t("liechtenstein_56974"),nationality:t("liechtenstein_56974"),emoji:"🇱🇮",language:"de-LI"},{phoneCode:"+370",code:"LT",name:t("lithuania_95793"),nationality:t("lithuanian_94145"),emoji:"🇱🇹",language:["lt","lt-LT"],smsPrice:.06},{phoneCode:"+352",code:"LU",name:t("luxembourg_15613"),nationality:t("luxembourg_lux_47318"),emoji:"🇱🇺",language:["de-LU","fr-LU"],smsPrice:.1},{phoneCode:"+853",code:"MO",name:t("macao_74812"),nationality:t("macanese_chine_74224"),emoji:"🇲🇴",language:"zh-MO",smsPrice:.038},{phoneCode:"+389",code:"MK",name:t("macedonia_the_19021"),nationality:t("macedonian_20446"),emoji:"🇲🇰",language:["mk","mk-MK"],smsPrice:.095},{phoneCode:"+261",code:"MG",name:t("madagascar_57052"),nationality:t("malagasy_02353"),emoji:"🇲🇬",smsPrice:.029},{phoneCode:"+265",code:"MW",name:t("malawi_27143"),nationality:t("malawian_10093"),emoji:"🇲🇼",smsPrice:.3},{phoneCode:"+60",code:"MY",name:t("malaysia_54920"),nationality:t("malaysian_81474"),emoji:"🇲🇾",language:["ms","ms-MY"],smsPrice:.29},{phoneCode:"+960",code:"MV",name:t("maldives_67432"),nationality:t("maldivian_67878"),emoji:"🇲🇻",language:["dv","dv-MV"],smsPrice:.34},{phoneCode:"+223",code:"ML",name:t("mali_95091"),nationality:t("malian_malines_66005"),emoji:"🇲🇱",smsPrice:.055},{phoneCode:"+356",code:"MT",name:t("malta_73993"),nationality:t("maltese_52729"),emoji:"🇲🇹",language:["mt","mt-MT"],smsPrice:.08},{phoneCode:"+692",code:"MH",name:t("marshall_island_92726"),nationality:t("marshallese_30337"),emoji:"🇲🇭",smsPrice:.045},{phoneCode:"+586",code:"MQ",name:t("martinique_79541"),nationality:t("martiniquais_m_01923"),emoji:"🇲🇶"},{phoneCode:"+222",code:"MR",name:t("mauritania_77906"),nationality:t("mauritanian_68205"),emoji:"🇲🇷",smsPrice:.055},{phoneCode:"+230",code:"MU",name:t("mauritius_10801"),nationality:t("mauritian_09142"),emoji:"🇲🇺",smsPrice:.184},{phoneCode:["+262269","+262639"],code:"YT",name:t("mayotte_91167"),nationality:t("mahoran_45424"),emoji:"🇾🇹"},{phoneCode:"+52",code:"MX",name:t("mexico_21962"),nationality:t("mexican_80494"),emoji:"🇲🇽",language:"es-MX",smsPrice:.92},{phoneCode:"+691",code:"FM",name:t("micronesia_fed_39555"),nationality:t("micronesian_97912"),emoji:"🇫🇲",smsPrice:.045},{phoneCode:"+373",code:"MD",name:t("moldova_republ_08796"),nationality:t("moldovan_76486"),emoji:"🇲🇩"},{phoneCode:"+377",code:"MC",name:t("monaco_72117"),nationality:t("mon_gasque_mon_17281"),emoji:"🇲🇨",language:"fr-MC",smsPrice:.1},{phoneCode:"+976",code:"MN",name:t("mongolia_36757"),nationality:t("mongolian_33711"),emoji:"🇲🇳",language:["mn","mn-MN"],smsPrice:.33},{phoneCode:"+382",code:"ME",name:t("montenegro_78236"),nationality:t("montenegrin_68334"),emoji:"🇲🇪",smsPrice:.15},{phoneCode:"+1664",code:"MS",name:t("montserrat_38432"),nationality:t("montserratian_13585"),emoji:"🇲🇸"},{phoneCode:"+212",code:"MA",name:t("morocco_52420"),nationality:t("moroccan_14305"),emoji:"🇲🇦",language:"ar-MA"},{phoneCode:"+258",code:"MZ",name:t("mozambique_60988"),nationality:t("mozambican_68300"),emoji:"🇲🇿",smsPrice:.32},{phoneCode:"+95",code:"MM",name:t("myanmar_78678"),nationality:t("burmese_66869"),emoji:"🇲🇲",smsPrice:1.1},{phoneCode:"+264",code:"NA",name:t("namibia_19026"),nationality:t("namibian_01490"),emoji:"🇳🇦",smsPrice:.048},{phoneCode:"+674",code:"NR",name:t("nauru_16303"),nationality:t("nauruan_52578"),emoji:"🇳🇷",smsPrice:.21},{phoneCode:"+977",code:"NP",name:t("nepal_49088"),nationality:t("nepali_nepales_64761"),emoji:"🇳🇵",smsPrice:.35},{phoneCode:"+31",code:"NL",name:t("netherlands_38005"),nationality:t("dutch_netherla_42451"),emoji:"🇳🇱",language:["nl","nl-NL"],smsPrice:.095},{phoneCode:"+687",code:"NC",name:t("new_caledonia_14574"),nationality:t("new_caledonian_12113"),emoji:"🇳🇨",smsPrice:.1},{phoneCode:"+64",code:"NZ",name:t("new_zealand_61929"),nationality:t("new_zealander_71823"),emoji:"🇳🇿",language:["en-NZ","mi","mi-NZ"],smsPrice:.14},{phoneCode:"+505",code:"NI",name:t("nicaragua_14531"),nationality:t("nicaraguan_06649"),emoji:"🇳🇮",language:"es-NI",smsPrice:.17},{phoneCode:"+227",code:"NE",name:t("niger_59137"),nationality:t("nigerien_06144"),emoji:"🇳🇪",smsPrice:.067},{phoneCode:"+234",code:"NG",name:t("nigeria_77810"),nationality:t("nigerian_43407"),emoji:"🇳🇬",smsPrice:.47},{phoneCode:"+683",code:"NU",name:t("niue_97570"),nationality:t("niuean_70518"),emoji:"🇳🇺",smsPrice:.045},{phoneCode:"+6723",code:"NF",name:t("norfolk_island_62377"),nationality:t("norfolk_island_62377"),emoji:"🇳🇫"},{phoneCode:"+1670",code:"MP",name:t("northern_marian_94262"),nationality:t("northern_marian_82360"),emoji:"🇲🇵"},{phoneCode:"+47",code:"NO",name:t("norway_14236"),nationality:t("norwegian_50751"),emoji:"🇳🇴",language:["nb","nb-NO","nn-NO","se-NO"],smsPrice:.064},{phoneCode:"+968",code:"OM",name:t("oman_20900"),nationality:t("omani_15042"),emoji:"🇴🇲",language:"ar-OM",smsPrice:.21},{phoneCode:"+92",code:"PK",name:t("pakistan_59697"),nationality:t("pakistani_12622"),emoji:"🇵🇰",language:["ur","ur-PK"],smsPrice:.5},{phoneCode:"+680",code:"PW",name:t("palau_46088"),nationality:t("palauan_73033"),emoji:"🇵🇼",smsPrice:.1},{phoneCode:"+970",code:"PS",name:t("palestine_stat_33253"),nationality:t("palestinian_06829"),emoji:"🇵🇸",smsPrice:.35},{phoneCode:"+507",code:"PA",name:t("panama_16821"),nationality:t("panamanian_07882"),emoji:"🇵🇦",language:"es-PA",smsPrice:.17},{phoneCode:"+675",code:"PG",name:t("papua_new_guine_56959"),nationality:t("papua_new_guine_50302"),emoji:"🇵🇬",smsPrice:.2},{phoneCode:"+595",code:"PY",name:t("paraguay_66859"),nationality:t("paraguayan_50310"),emoji:"🇵🇾",language:"es-PY",smsPrice:.124},{phoneCode:"+51",code:"PE",name:t("peru_23048"),nationality:t("peruvian_85045"),emoji:"🇵🇪",language:["es-PE","qu-PE"],smsPrice:.31},{phoneCode:"+63",code:"PH",name:t("philippines_65361"),nationality:t("philippine_fil_40400"),emoji:"🇵🇭",language:["en-PH","tl","tl-PH"],smsPrice:.243},{phoneCode:"+64",code:"PN",name:t("pitcairn_59104"),nationality:t("pitcairn_island_58961"),emoji:"🇵🇳"},{phoneCode:"+48",code:"PL",name:t("poland_13527"),nationality:t("polish_26779"),emoji:"🇵🇱",language:["pl","pl-PL"],smsPrice:.036},{phoneCode:"+351",code:"PT",name:t("portugal_19698"),nationality:t("portuguese_08463"),emoji:"🇵🇹",language:["pt","pt-PT"],smsPrice:.025},{phoneCode:["+1787","+1939"],code:"PR",name:t("puerto_rico_88176"),nationality:t("puerto_rican_10401"),emoji:"🇵🇷",language:"es-PR"},{phoneCode:"+974",code:"QA",name:t("qatar_70548"),nationality:t("qatari_58016"),emoji:"🇶🇦",language:"ar-QA",smsPrice:.3},{phoneCode:"+262",code:"RE",name:t("r_union_34094"),nationality:t("r_unionese_r_u_86871"),emoji:"🇷🇪",smsPrice:.055},{phoneCode:"+40",code:"RO",name:t("romania_41618"),nationality:t("romanian_49647"),emoji:"🇷🇴",language:["ro","ro-RO"],smsPrice:.09},{phoneCode:"+7",code:"RU",name:t("russian_federat_68392"),nationality:t("russian_12506"),emoji:"🇷🇺",language:["ru","ru-RU","tt","tt-RU"],smsPrice:2.63},{phoneCode:"+250",code:"RW",name:t("rwanda_84901"),nationality:t("rwandan_47719"),emoji:"🇷🇼",smsPrice:.1},{phoneCode:"+590",code:"BL",name:t("saint_barth_lem_80830"),nationality:t("barth_lemois_35003"),emoji:"🇧🇱",smsPrice:.09},{phoneCode:"+290",code:"SH",name:t("saint_helena_a_39384"),nationality:t("saint_helenian_19012"),emoji:"🇸🇭",smsPrice:.1},{phoneCode:"+1869",code:"KN",name:t("saint_kitts_and_74455"),nationality:t("kittitian_or_ne_99867"),emoji:"🇰🇳"},{phoneCode:"+1758",code:"LC",name:t("saint_lucia_60679"),nationality:t("saint_lucian_97267"),emoji:"🇱🇨"},{phoneCode:"+590",code:"MF",name:t("saint_martin_f_87295"),nationality:t("saint_martinois_75974"),emoji:"🇸🇽"},{phoneCode:"+508",code:"PM",name:t("saint_pierre_an_55649"),nationality:t("saint_pierrais_60177"),emoji:"🇵🇲",smsPrice:.13},{phoneCode:"+1784",code:"VC",name:t("saint_vincent_a_23833"),nationality:t("saint_vincentia_81882"),emoji:"🇻🇨"},{phoneCode:"+685",code:"WS",name:t("samoa_25648"),nationality:t("samoan_97653"),emoji:"🇼🇸",smsPrice:.21},{phoneCode:"+378",code:"SM",name:t("san_marino_47437"),nationality:t("sammarinese_71553"),emoji:"🇸🇲",smsPrice:.045},{phoneCode:"+239",code:"ST",name:t("sao_tome_and_pr_10491"),nationality:t("s_o_tom_an_21489"),emoji:"🇸🇹",smsPrice:.045},{phoneCode:"+966",code:"SA",name:t("saudi_arabia_06433"),nationality:t("saudi_saudi_ar_22967"),emoji:"🇸🇦",language:"ar-SA",smsPrice:.215},{phoneCode:"+221",code:"SN",name:t("senegal_38099"),nationality:t("senegalese_64680"),emoji:"🇸🇳",smsPrice:.034},{phoneCode:"+381",code:"RS",name:t("serbia_45061"),nationality:t("serbian_68735"),emoji:"🇷🇸",smsPrice:.46},{phoneCode:"+248",code:"SC",name:t("seychelles_67712"),nationality:t("seychellois_69858"),emoji:"🇸🇨",smsPrice:.3},{phoneCode:"+232",code:"SL",name:t("sierra_leone_02995"),nationality:t("sierra_leonean_86179"),emoji:"🇸🇱",smsPrice:.4},{phoneCode:"+65",code:"SG",name:t("singapore_37928"),nationality:t("singaporean_41916"),emoji:"🇸🇬",language:"zh-SG",smsPrice:.064},{phoneCode:"+1721",code:"SX",name:t("sint_maarten_d_57391"),nationality:t("sint_maarten_82241"),emoji:"🇸🇽"},{phoneCode:"+421",code:"SK",name:t("slovakia_10924"),nationality:t("slovak_69840"),emoji:"🇸🇰",language:["sk","sk-SK"],smsPrice:.068},{phoneCode:"+386",code:"SI",name:t("slovenia_75447"),nationality:t("slovenian_slov_38562"),emoji:"🇸🇮",language:["sl","sl-SI"],smsPrice:.18},{phoneCode:"+677",code:"SB",name:t("solomon_islands_05259"),nationality:t("solomon_island_59052"),emoji:"🇸🇧",smsPrice:.155},{phoneCode:"+252",code:"SO",name:t("somalia_56358"),nationality:t("somali_somalia_97997"),emoji:"🇸🇴",smsPrice:.35},{phoneCode:"+27",code:"ZA",name:t("south_africa_61184"),nationality:t("south_african_82152"),emoji:"🇿🇦",language:["af-ZA","en-ZA","ns","ns-ZA","tn","tn-ZA","xh","xh-ZA","zu","zu-ZA"],smsPrice:.13},{phoneCode:"+500",code:"GS",name:t("south_georgia_a_39555"),nationality:t("south_georgia_o_65055"),emoji:"🇬🇸",smsPrice:.12},{phoneCode:"+211",code:"SS",name:t("south_sudan_88232"),nationality:t("south_sudanese_69140"),emoji:"🇸🇸"},{phoneCode:"+34",code:"ES",name:t("spain_40048"),nationality:t("spanish_74199"),emoji:"🇪🇸",language:["ca","ca-ES","es","es-ES","eu-ES","gl-ES"],smsPrice:.044},{phoneCode:"+94",code:"LK",name:t("sri_lanka_51563"),nationality:t("sri_lankan_09436"),emoji:"🇱🇰",smsPrice:.4},{phoneCode:"+249",code:"SD",name:t("sudan_18427"),nationality:t("sudanese_42330"),emoji:"🇸🇩",smsPrice:.322},{phoneCode:"+597",code:"SR",name:t("suriname_78561"),nationality:t("surinamese_38193"),emoji:"🇸🇷",smsPrice:.3},{phoneCode:"+4779",code:"SJ",name:t("svalbard_and_ja_38511"),nationality:t("svalbard_26353"),emoji:"🇸🇯"},{phoneCode:"+268",code:"SZ",name:t("swaziland_91614"),nationality:t("swazi_88825"),emoji:"🇸🇿",smsPrice:.3},{phoneCode:"+46",code:"SE",name:t("sweden_85663"),nationality:t("swedish_90836"),emoji:"🇸🇪",language:["se-SE","sv","sv-SE"],smsPrice:.098},{phoneCode:"+41",code:"CH",name:t("switzerland_07889"),nationality:t("swiss_23240"),emoji:"🇨🇭",language:["de-CH","fr-CH","it-CH"],smsPrice:.098},{phoneCode:"+963",code:"SY",name:t("syrian_arab_rep_72539"),nationality:t("syrian_06992"),emoji:"🇸🇾",language:["ar-SY","syr","syr-SY"],smsPrice:.37},{phoneCode:"+886",code:"TW",name:t("taiwan_provinc_87264"),nationality:t("chinese_taiwan_24003"),emoji:"🇹🇼",language:"zh-TW",smsPrice:.105},{phoneCode:"+992",code:"TJ",name:t("tajikistan_97104"),nationality:t("tajikistani_21375"),emoji:"🇹🇯",smsPrice:.38},{phoneCode:"+255",code:"TZ",name:t("tanzania_unite_52757"),nationality:t("tanzanian_71935"),emoji:"🇹🇿",smsPrice:.38},{phoneCode:"+66",code:"TH",name:t("thailand_97396"),nationality:t("thai_51972"),emoji:"🇹🇭",language:["th","th-TH"],smsPrice:.066},{phoneCode:"+670",code:"TL",name:t("timor_leste_95604"),nationality:t("timorese_87542"),emoji:"🇹🇱",smsPrice:.22},{phoneCode:"+228",code:"TG",name:t("togo_60267"),nationality:t("togolese_55079"),emoji:"🇹🇬",smsPrice:.03},{phoneCode:"+690",code:"TK",name:t("tokelau_79536"),nationality:t("tokelauan_89444"),emoji:"🇹🇰",smsPrice:.045},{phoneCode:"+676",code:"TO",name:t("tonga_96982"),nationality:t("tongan_52630"),emoji:"🇹🇴",smsPrice:.2},{phoneCode:"+1868",code:"TT",name:t("trinidad_and_to_31939"),nationality:t("trinidadian_or_65515"),emoji:"🇹🇹",language:"en-TT"},{phoneCode:"+216",code:"TN",name:t("tunisia_36732"),nationality:t("tunisian_19451"),emoji:"🇹🇳",language:"ar-TN",smsPrice:.35},{phoneCode:"+90",code:"TR",name:t("turkey_65699"),nationality:t("turkish_85889"),emoji:"🇹🇷",language:["tr","tr-TR"],smsPrice:.033},{phoneCode:"+993",code:"TM",name:t("turkmenistan_86069"),nationality:t("turkmen_63945"),emoji:"🇹🇲"},{phoneCode:"+1649",code:"TC",name:t("turks_and_caico_34033"),nationality:t("turks_and_caico_41685"),emoji:"🇹🇨"},{phoneCode:"+688",code:"TV",name:t("tuvalu_52410"),nationality:t("tuvaluan_49403"),emoji:"🇹🇻",smsPrice:.12},{phoneCode:"+256",code:"UG",name:t("uganda_42928"),nationality:t("ugandan_07085"),emoji:"🇺🇬",smsPrice:.3},{phoneCode:"+380",code:"UA",name:t("ukraine_86632"),nationality:t("ukrainian_77624"),emoji:"🇺🇦",language:["uk","uk-UA"],smsPrice:.26},{phoneCode:"+971",code:"AE",name:t("united_arab_emi_58689"),nationality:t("emirati_emiria_12413"),emoji:"🇦🇪",language:"ar-AE",smsPrice:.12},{phoneCode:"+44",code:"GB",name:t("united_kingdom_16783"),nationality:t("british_43680"),emoji:"🇬🇧",language:["cy","cy-GB","en","en-GB"],smsPrice:.078},{phoneCode:"+1",code:"US",name:t("united_states_o_43878"),nationality:t("american_36800"),emoji:"🇺🇸",language:"en-US",smsPrice:.03},{phoneCode:"+598",code:"UY",name:t("uruguay_21979"),nationality:t("uruguayan_28212"),emoji:"🇺🇾",language:"es-UY",smsPrice:.1},{phoneCode:"+998",code:"UZ",name:t("uzbekistan_27729"),nationality:t("uzbekistani_uz_10593"),emoji:"🇺🇿",language:["uz","uz-UZ"],smsPrice:.39},{phoneCode:"+678",code:"VU",name:t("vanuatu_82756"),nationality:t("ni_vanuatu_van_02924"),emoji:"🇻🇺",smsPrice:.21},{phoneCode:"+58",code:"VE",name:t("venezuela_boli_00470"),nationality:t("venezuelan_52634"),emoji:"🇻🇪",language:"es-VE",smsPrice:.31},{phoneCode:"+84",code:"VN",name:t("vietnam_82968"),nationality:t("vietnamese_55360"),emoji:"🇻🇳",language:["vi","vi-VN"],smsPrice:.27},{phoneCode:"+1284",code:"VG",name:t("virgin_islands_14222"),nationality:t("british_virgin_42963"),emoji:"🇻🇬"},{phoneCode:"+1340",code:"VI",name:t("virgin_islands_12516"),nationality:t("american_virgi_98088"),emoji:"🇻🇮"},{phoneCode:"+681",code:"WF",name:t("wallis_and_futu_93206"),nationality:t("wallisian_or_fu_60327"),emoji:"🇼🇫",smsPrice:.09},{phoneCode:"+212",code:"EH",name:t("western_sahara_02173"),nationality:t("sahrawi_sahraw_96671"),emoji:"🇪🇭",smsPrice:.053},{phoneCode:"+967",code:"YE",name:t("yemen_76340"),nationality:t("yemeni_26632"),emoji:"🇾🇪",language:"ar-YE",smsPrice:.23},{phoneCode:"+260",code:"ZM",name:t("zambia_50513"),nationality:t("zambian_85114"),emoji:"🇿🇲",smsPrice:.324},{phoneCode:"+263",code:"ZW",name:t("zimbabwe_70209"),nationality:t("zimbabwean_42291"),emoji:"🇿🇼",language:"en-ZW",smsPrice:.35}],({name:e})=>c(e)),this.countriesCodes=this.countries.map(({code:e})=>e),this.phoneCodes=this.countries.flatMap(({phoneCode:e})=>io(e))}countryCodeExists(e){return!!e&&void 0!==this.countries.find(t=>t.code===e)}getCountriesIdName(e){const t=this.getDefaultCountryValues(e).user.country;return(0,uc.A)(this.countries.map(({code:e,name:t})=>({id:e,name:t})),({id:e})=>e===t?1:2)}getNationalitiesIdName(e){const t=this.getDefaultCountryValues(e).user.nationality;return(0,uc.A)(this.countries.map(({code:e,nationality:t})=>({id:e,name:t})),({id:e})=>e===t?1:2)}getNationality(e){return this.countries.find(t=>t.code===e)?.nationality}getName(e){return this.countries.find(t=>t.code===e)?.name}getDefaultCountryValues(e){let t=this.countries.find(({code:t})=>t===e);if(!t){try{t=this.countries.find(e=>io(e.language||[]).map(e=>e.toLowerCase()).includes(navigator.language.toLowerCase()))}catch{}t||(t=this.countries.find(({code:e})=>"FR"===e))}const n=io(t.language||[]);return{user:{language:n.some(e=>e.toLowerCase().startsWith("fr"))?At.Fr:n.some(e=>e.toLowerCase().startsWith("es"))?At.Es:n.some(e=>e.toLowerCase().startsWith("de"))?At.De:n.some(e=>e.toLowerCase().startsWith("nl"))?At.Nl:At.En,country:t.code,nationality:t.code},phone:{country:t.code,code:io(t.phoneCode)[0]}}}getSmsPriceByPhone(e){return this.countries.find(t=>io(t.phoneCode).some(t=>e.startsWith(t)))?.smsPrice}};hu=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[qn])],hu);const mu=[We.Date,We.Number,We.Text,We.Textarea],gu=[We.Phone,We.Select,We.Text,We.Textarea];function pu(e,t,n){const i=[],s=[];for(const o of t)if(!m(n)||o.name.trim().toLowerCase().includes(n.trim().toLowerCase())||m(o.label)&&o.label.trim().toLowerCase().includes(n.trim().toLowerCase())){const t=e.find(({slug:e})=>e===o.slug);t?i.push({filter:o,predicate:t}):s.push({filter:o,predicate:t})}return[i,s]}function fu(e,t){return so(e.values)?e.values.map(({id:e,name:n})=>(0,i.jsx)("option",{value:e,children:t(n)},e)):so(e.valuesGroups)?e.valuesGroups.map(({name:e,values:t},n)=>(0,i.jsx)("optgroup",{label:e,children:t.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},n)):[]}let _u=class extends Wl{countriesService;dateTimeService;constructor(e,t,n){super(n),this.countriesService=e,this.dateTimeService=t}filterPredicateToText(e){const{filter:t,predicate:n}=e;if(!n)return"";{const i=Gs.c9.isDateTime(n.value)?n.value:Gs.c9.fromISO(n.value,{zone:"utc",setZone:!0}),s=!i.isValid||t.fieldType!==He.DateTimeRange&&t.fieldType!==He.Datetime?i.isValid&&t.fieldType===He.Date?this.dateTimeService.toLocaleString(i,eo.DateOnly.MonthLong):n.value:this.dateTimeService.toLocaleString(i,eo.DateTime),o=Gs.c9.isDateTime(n.value2)?n.value2:Gs.c9.fromISO(n.value2,{zone:"utc",setZone:!0}),r=!o.isValid||t.fieldType!==He.DateTimeRange&&t.fieldType!==He.Datetime?o.isValid&&t.fieldType===He.Date?this.dateTimeService.toLocaleString(o,eo.DateOnly.MonthLong):n.value2:this.dateTimeService.toLocaleString(o,eo.DateTime);switch(n.operator){case gt.Contains:return"condition"===t.slug?this.conditionFilterToString(e):"wishedPositions"===t.slug?this.t("mission_souhait_38008",r,this.valueToString(t,s)):"wishedPositionsCategories"===t.slug?this.t("cat_gorie_souha_24744",r,this.valueToString(t,s)):"isDelegationLeader"===t.slug?this.t("est_responsable_13012",this.valueToString(t,s)):this.t("_1_contient_2_40552",t.name,s);case gt.NotContains:return this.t("_1_ne_contient_14612",t.name,s);case gt.Is:if("isLeader"===t.slug)return this.t("est_responsable_19679");if("isPositionLeader"===t.slug)return this.t("est_responsable_27270");if("isPositionCategoryLeader"===t.slug)return this.t("est_responsable_72923");if("isDelegationLeader"===t.slug)return this.t("est_responsable_87662");if("privacy"===t.slug)return this.t("visibilit_est_12738");if("campaign"===t.slug)return this.campaignFilterToString(e);if("campaignReply"===t.slug)return this.campaignReplyFilterToString(e);if("condition"===t.slug)return this.t("champ_dont_un_a_44854");if("numberOfAssignmentsPerDay"===t.slug||"volunteersMinutesDays"===t.slug)return this.t("_1_pour_la_jou_73174",t.name,this.dateTimeService.toLocaleString(i,eo.DateOnly.MonthLong),r);if(t.fieldType===He.Date)return this.t("_1_est_gal_43375",t.name,this.valueDateToString(n.valueDate));if(t.fieldType===He.DateTimeRange){const e=i?.isValid?this.dateTimeService.toLocaleString(i,eo.DateOnly.MonthLong):n.value;return this.t("_1_est_gal_43375",t.name,e)}return this.t("_1_est_gal_43375",t.name,this.valueToString(t,s));case gt.IsNot:return"isLeader"===t.slug?this.t("n_est_pas_respo_55625"):"isPositionLeader"===t.slug?this.t("n_est_pas_respo_35508"):"isPositionCategoryLeader"===t.slug?this.t("n_est_pas_respo_07811"):"isDelegationLeader"===t.slug?this.t("n_est_pas_respo_91275"):"privacy"===t.slug?this.t("visibilit_est_55411"):"condition"===t.slug?this.t("champ_d_pendant_33676"):"numberOfAssignmentsPerDay"===t.slug||"volunteersMinutesDays"===t.slug?this.t("_1_pour_la_jou_61197",t.name,this.dateTimeService.toLocaleString(i,eo.DateOnly.MonthLong),r):t.fieldType===He.Date?this.t("_1_n_est_pas_38478",t.name,this.valueDateToString(n.valueDate)):this.t("_1_n_est_pas_38478",t.name,this.valueToString(t,s));case gt.IsEmpty:return this.t("_1_est_vide_08225",t.name);case gt.IsNotEmpty:return this.t("_1_n_est_pas_v_31530",t.name);case gt.IsValid:return this.t("_1_est_valide_45209",t.name);case gt.IsNotValid:return this.t("_1_n_est_pas_v_05077",t.name);case gt.GreaterThan:return"numberOfAssignmentsPerDay"===t.slug||"volunteersMinutesDays"===t.slug?this.t("_1_pour_la_jou_91055",t.name,this.dateTimeService.toLocaleString(i,eo.DateOnly.MonthLong),r):this.t("_1_est_plus_gr_93527",t.name,n.value);case gt.GreaterThanEqual:return"numberOfAssignmentsPerDay"===t.slug||"volunteersMinutesDays"===t.slug?this.t("_1_pour_la_jou_41388",t.name,this.dateTimeService.toLocaleString(i,eo.DateOnly.MonthLong),r):this.t("_1_est_gal_ou_95771",t.name,n.value);case gt.LessThan:return"numberOfAssignmentsPerDay"===t.slug||"volunteersMinutesDays"===t.slug?this.t("_1_pour_la_jou_99548",t.name,this.dateTimeService.toLocaleString(i,eo.DateOnly.MonthLong),r):this.t("_1_est_plus_pe_18306",t.name,n.value);case gt.LessThanEqual:return"numberOfAssignmentsPerDay"===t.slug||"volunteersMinutesDays"===t.slug?this.t("_1_pour_la_jou_37455",t.name,this.dateTimeService.toLocaleString(i,eo.DateOnly.MonthLong),r):this.t("_1_est_gal_ou_39305",t.name,n.value);case gt.Overlaps:return this.t("_1_chevauche_45834",t.name,s,r);case gt.NotOverlaps:return this.t("_1_ne_chevauch_01846",t.name,s,r);case gt.Engulfs:return this.t("_1_engloutis_32228",t.name,s,r);case gt.NotEngulfs:return this.t("_1_n_engloutis_52951",t.name,s,r);case gt.EngulfedBy:return this.t("_1_est_englout_36064",t.name,s,r);case gt.NotEngulfedBy:return this.t("_1_n_est_pas_e_89161",t.name,s,r);case gt.IsBefore:return"formsInsertedAt"===t.slug?this.t("_1_est_avant_l_83271",t.name,r):this.t("_1_est_avant_l_83271",t.name,s);case gt.IsAfter:return"formsInsertedAt"===t.slug?this.t("_1_est_apr_s_l_63712",t.name,r):this.t("_1_est_apr_s_l_63712",t.name,s);case gt.Between:return this.t("_1_est_entre_39871",t.name,s,r);case gt.StartsWith:return this.t("_1_commence_pa_47720",t.name,s);case gt.EndsWith:return this.t("_1_finit_par_65840",t.name,s);case gt.ThisDayMonth:return this.t("_1_est_aujourd_09227",t.name);case gt.Today:return this.t("_1_est_aujourd_42954",t.name);default:return ll(n.operator)}}}getValues(e){return e.fieldType===We.Sex?Rn.map(e=>({id:e,name:this.t(e)})):e.fieldType===We.Language?e.fieldProperty===Ve.Language?Id.map(e=>({id:e,name:this.t(e)})):bn.map(e=>({id:e,name:this.t(e)})):e.fieldType===We.Nationality?this.countriesService.getNationalitiesIdName():e.fieldType===We.Country?this.countriesService.getCountriesIdName():e.fieldType===We.Select&&so(e.values)?e.values.map(({id:e,value:t})=>({id:e,name:t})):[]}valueToString(e,t){const n=function(e){return so(e.values)?e.values:so(e.valuesGroups)?e.valuesGroups.flatMap(e=>e.values):[]}(e);return so(n)?io(t).map(e=>this.t(n.find(({id:t})=>t===e)?.name??e)).join(` ${this.t("ou_67404")} `):this.t(t)}valueDateToString(e){const t=[];return"number"==typeof e?.day&&-1!==e.day&&t.push(e.day),"number"==typeof e?.month&&-1!==e.month&&t.push(this.dateTimeService.toLocaleString(Gs.c9.now().set({month:e.month}),{month:"long"})),"number"==typeof e?.year&&-1!==e.year&&t.push(e.year),t.join(" ")}conditionFilterToString(e){if(e.predicate){const t=e.predicate.value.map(t=>e.filter.values?.find(e=>e.id===t)?.name??"");return 1===t.length?this.t("d_pend_du_champ_43516",t[0]):this.t("d_pend_des_cham_85348",t.join(", "))}return""}campaignFilterToString(e){if(e.predicate){const t=e.predicate.value.map(t=>e.filter.campaigns?.find(e=>e.id===t)?.name??"").join(", "),n=e.predicate.value2.map(e=>this.t(e)).join(", ");return this.t("a_re_u_un_messa_76546",t,n)}return""}campaignReplyFilterToString(e){if(e.predicate){const t=e.predicate.value.map(t=>e.filter.campaigns?.find(e=>e.id===t)?.name??"").join(", ");return this.t("la_r_ponse_des_14160",t,e.predicate.value2)}return""}customFieldsToFilters(e){return e.filter(({fieldType:e})=>[He.Address,He.Checkbox,He.Country,He.Date,He.Datetime,He.File,He.Language,He.Nationality,He.Number,He.Phone,He.Select,He.Sex,He.Text,He.Textarea,He.Validation].includes(e)).map(e=>({...e,category:this.t("champs_de_formu_64126"),fieldType:e.fieldType,values:this.getValues(e),color:"warning",isEncrypted:e.isEncrypted}))}customFieldsToPossibleColumns(e){return e.map(e=>({slug:e.slug,name:e.name,label:e.label,customField:e,isSearchable:gu.includes(e.fieldType),isSortable:!!mu.includes(e.fieldType)||e.fieldType===We.Select&&e.isSelectV2&&!e.canSelectMultiple,sortAttribute:e.slug,width:"picture"===e.slug?80:void 0,minWidth:"picture"===e.slug?void 0:180}))}};_u=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[hu,Jc,qn])],_u);var xu=n(1932),Iu=n(6360);const vu=({children:e,css:t,onClose:n,returnToFallback:s,size:o})=>{const r=ni(),a=()=>{n?n():r.goBack(s??Ps.HOME)};return Ld(a),il("common-front/src/designSystem/components/rightPanels/__deprecated/rightPanel.tsx","common-front/src/designSystem/components/rightPanels/base/rightPanel.tsx"),(0,Kt.createPortal)((0,i.jsx)(Ba,{css:{background:"rgba(52, 64, 84, 0.7)",height:"100%",left:0,position:"absolute",top:0,width:"100%",zIndex:"100",...t},"data-testid":"right-panel-backdrop",onClick:a,children:(0,i.jsxs)(Ba,{css:{background:"white",height:"100%",position:"absolute",right:"0",top:"0",width:"sm"===o?"480px":"650px"},"data-testid":"right-panel-body",direction:"column",onClick:e=>Dl(e,!1),children:[(0,i.jsx)(Ar,{color:"gray500",css:{cursor:"pointer",fontSize:"$textMd",position:"absolute",right:"$space$6",top:"$space$6"},onClick:a,children:(0,i.jsx)("i",{className:"far fa-xmark"})}),e]})}),document.body)},bu=L.forwardRef((e,t)=>(0,i.jsx)(Ba,{ref:t,css:{flex:"1",overflowY:"auto",px:"$6",...e.css},direction:"column",children:e.children}));bu.displayName="RightPanelBody";const ju=e=>(0,i.jsx)(Ar,{color:"gray800",css:{borderTop:"1px solid $gray200",px:"$6",py:"$4"},children:e.children}),Cu=_r("div",{alignItems:"center",borderRadius:"12px",cursor:"pointer",display:"flex",position:"relative","& > div":{background:"white",boxShadow:"$sm",position:"absolute",transition:"left 200ms ease-in"},variants:{disabled:{true:{cursor:"auto"}},size:{sm:{height:"16px",width:"30px","& > div":{borderRadius:"12px",height:"12px",width:"12px"}},md:{height:"24px",width:"44px","& > div":{borderRadius:"20px",height:"20px",width:"20px"}}},state:{unchecked:{background:"$gray200","& > div":{left:"2px"}},checked:{background:"$primary500"}}},compoundVariants:[{size:"sm",state:"checked",css:{"& > div":{left:"calc(100% - 2px - 12px)"}}},{size:"md",state:"checked",css:{"& > div":{left:"calc(100% - 2px - 20px)"}}},{disabled:!0,state:"checked",css:{background:"$gray100"}}],defaultVariants:{size:"sm"}}),yu=e=>(0,i.jsx)(Cu,{"aria-checked":e.value,"aria-describedby":e.descId,"aria-label":e.label,"aria-labelledby":e.labelId,disabled:e.disabled,id:e.inputId,role:"checkbox",size:e.size,state:e.value?"checked":"unchecked",tabIndex:e.tabIndex??0,onClick:()=>{e.disabled||e.onChange(!e.value)},onKeyDown:t=>{e.disabled||"Space"!==t.code||(t.preventDefault(),e.onChange(!e.value))},children:(0,i.jsx)("div",{})}),ku=e=>{const{inputId:t,descId:n,labelId:s}=qa(),o=m(e.subtext);return(0,i.jsxs)(Ba,{align:"center",css:{cursor:e.disabled?"auto":"pointer",userSelect:"none",...e.css},tabIndex:0,onClick:()=>{e.disabled||e.onChange(!e.value)},onKeyDown:t=>{e.disabled||"Space"!==t.code||(t.preventDefault(),e.onChange(!e.value))},children:[(0,i.jsx)(yu,{descId:n,disabled:e.disabled,inputId:t,labelId:s,size:e.size,tabIndex:-1,value:e.value,onChange:td.A}),(0,i.jsx)(Ya,{width:"2"}),(0,i.jsxs)(Ba,{css:{flex:"1",fontSize:"md"===e.size?"$3":"$2"},direction:"column",children:[(0,i.jsx)(Ml,{htmlFor:t,id:s,children:(0,i.jsx)(Ar,{color:"gray800",fontWeight:"medium",children:e.children})}),o&&(0,i.jsx)(Ar,{color:"gray500",id:n,children:e.subtext})]})]})},Au=e=>{const t=Xn(),[n,s]=(0,L.useState)(""),[o,r]=(0,L.useState)((0,uc.A)(e.columns.map(t=>({...t,isSelected:e.initialSelectedColumns.includes(t.slug)})),[({slug:t})=>{const n=e.initialSelectedColumns.indexOf(t);return-1===n?e.columns.length:n},({name:e})=>e]));return(0,i.jsxs)(vu,{css:e.css,size:"sm",onClose:e.onClose,children:[(0,i.jsxs)(bu,{children:[(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(Ar,{color:"gray900",fontSize:"textXl",children:e.title}),(0,i.jsx)(Ar,{color:"gray500",children:e.subtitle}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(Bl,{icon:"magnifying-glass",placeholder:e.searchPlaceholder,value:n,onChange:s}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(Ar,{color:"gray900",fontSize:"textMd",fontWeight:"semiBold",children:t("liste_des_champ_00325")}),(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(Iu.JY,{onDragEnd:({reason:e,source:t,destination:n})=>{"DROP"===e&&n&&t.index!==n.index&&r(lo(o,t.index,n.index))},children:(0,i.jsx)(Iu.gL,{droppableId:"1",children:e=>(0,i.jsxs)(Ba,{direction:"column",gap:"2",...e.droppableProps,ref:e.innerRef,children:[o.map((e,t)=>(e=>{if(m(n)){const t=n.trim().toLowerCase();return e.name.trim().toLowerCase().includes(t)||m(e.label)&&e.label.trim().toLowerCase().includes(t)}return!0})(e)?(0,i.jsx)(Iu.sx,{draggableId:e.slug,index:t,children:n=>(0,i.jsxs)(Ba,{css:{border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",padding:"$4"},gap:"4",...n.draggableProps,ref:n.innerRef,children:[(0,i.jsx)(Ar,{color:"gray300",css:{cursor:"grab"},...n.dragHandleProps,children:(0,i.jsx)(nl,{icon:"grip-vertical",iconStyle:"solid"})}),(0,i.jsxs)(Ba,{css:{flex:"1",overflow:"hidden"},direction:"column",gap:"1",children:[(0,i.jsx)(Ar,{color:"gray800",css:{ellipsis:!0},title:e.name,width:1,children:e.name}),m(e.label)&&(0,i.jsx)(Ar,{color:"gray500",css:{ellipsis:!0},title:e.label,width:1,children:e.label})]}),(0,i.jsx)(yu,{value:e.isSelected,onChange:()=>{var n,i;n=e,i=t,r((0,xu.jM)(e=>{e[i].isSelected=!n.isSelected}))}})]})},e.slug):null),e.placeholder]})})}),(0,i.jsx)(Ya,{height:"6"})]}),(0,i.jsx)(ju,{children:(0,i.jsxs)(Ba,{gap:"3",justify:"end",children:[(0,i.jsx)(zl,{onClick:()=>{e.onSave(o.filter(e=>e.isSelected).map(e=>e.slug)),e.onClose()},children:e.saveButtonText}),(0,i.jsx)(zl,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})})]})};function wu(e){const[t,n]=(0,L.useState)(e),[i,s]=(0,L.useState)(!1),o=(0,L.useMemo)(()=>{const e=Object.values(t).filter(e=>!0!==e.disabled),n=e.filter(e=>"checked"===e.state),i=n.map(e=>e.id),s=(0,Bs.A)(e.map(({state:e})=>e)),o=2===s.length?"indeterminate":"checked"===s[0]?"checked":"unchecked";return{numberOfSelected:n.length,selectAllState:o,selecteds:n,selectedsIds:i}},[t]),r=(0,L.useCallback)((e,t)=>{n(n=>({...n,[e]:{...n[e],state:t}})),"unchecked"===t&&s(!1)},[t,n,s]),a=(0,L.useCallback)(e=>{n(Object.fromEntries(Object.entries(t).filter(([e,t])=>!0!==t.disabled).map(([t,n])=>[t,{...n,state:e}]))),"unchecked"===e&&s(!1)},[t,n,s]);return{getSelectedsInput:(0,L.useCallback)((e,t)=>i?e?{ids:null,predicates:e,segmentId:null}:{ids:null,predicates:null,segmentId:t}:{ids:o.selectedsIds,predicates:null,segmentId:null},[i,o]),isAllSelected:i,numberOfSelected:o.numberOfSelected,selectAllState:o.selectAllState,selecteds:o.selecteds,selectedsIds:o.selectedsIds,setIsAllSelected:s,setStates:n,states:t,toggleRow:r,toggleSelectAll:a}}function Su(e){return{numberOfPages:(0,L.useMemo)(()=>e?.numberOfPages??1,[e]),totalCount:(0,L.useMemo)(()=>e?.totalCount??0,[e])}}var Eu=n(903);const Tu=e=>{const t=Xn(),[n,s]=(0,L.useState)(e.filterPredicate.predicate?.value??[]),[o,r]=(0,L.useState)(e.filterPredicate.predicate?.value2??[]),a=e.filterPredicate.filter.campaigns??[],l=(0,Bs.A)(a.filter(({id:e})=>n.includes(e)).map(({campaignType:e})=>e)),d=(0,Bs.A)(["NotSent",...l.includes(me.Email)?cn.filter(e=>e!==Oe.Queued):[],...l.includes(me.Sms)?Dn:[]]),c=so(n)&&so(o);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yc,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,placeholder:t("s_lectionner_un_28439"),values:n,onChange:s,children:a.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),n.length>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(yc,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,placeholder:t("s_lectionner_un_62901"),values:o,onChange:r,children:d.map(e=>(0,i.jsx)("option",{value:e,children:t(e)},e))})]}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(Ba,{children:(0,i.jsx)(zl,{disabled:!c,onClick:()=>{e.onAdd({operator:gt.Is,value:n,value2:o,slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},zu=e=>{const t=Xn(),[n,s]=(0,L.useState)(e.filterPredicate.predicate?.value??[]),[o,r]=(0,L.useState)(e.filterPredicate.predicate?.operator??gt.Contains),[a,l]=(0,L.useState)(e.filterPredicate.predicate?.value2??[]),d=e.filterPredicate.filter.campaigns??[],c=so(n)&&(o===gt.Contains&&m(a)||o===gt.IsEmpty||o===gt.IsNotEmpty);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yc,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,placeholder:t("s_lectionner_un_28439"),values:n,onChange:s,children:d.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),n.length>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:"contains"===o?"checked":"unchecked",onClick:()=>{r(gt.Contains)},children:t("contient_34012")}),"contains"===o&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"1"}),(0,i.jsxs)(Ba,{children:[(0,i.jsx)(Ya,{width:"6"}),(0,i.jsx)(Bl,{value:a,onChange:l})]}),(0,i.jsx)(Ya,{height:"1"})]}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:"isEmpty"===o?"checked":"unchecked",onClick:()=>{r(gt.IsEmpty)},children:t("est_vide_96759")}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:"isNotEmpty"===o?"checked":"unchecked",onClick:()=>{r(gt.IsNotEmpty)},children:t("n_est_pas_vide_45804")})]}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(Ba,{children:(0,i.jsx)(zl,{disabled:!c,onClick:()=>{e.onAdd({operator:o,value:n,value2:a,slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},Ou=_r("select",{backgroundColor:"$white",height:"100%",left:0,opacity:0,position:"absolute",top:0,width:"100%"}),Ru=_r("div",{ellipsis:""}),$u=({autoComplete:e,children:t,css:n,label:s,description:o,shouldParseAsInt:r,shouldParseAsBoolean:a,onChange:l,hint:d,icon:c,state:u,value:h="",...m})=>{const g=L.useMemo(()=>Cc(jc(t)),[t]),{inputId:p,descId:f,errorId:_}=qa();return(0,i.jsxs)(Ba,{css:n,direction:"column",width:1,children:[(0,i.jsx)(Ml,{htmlFor:p,children:s}),(0,i.jsx)(Pl,{id:f,children:o}),(s||o)&&(0,i.jsx)(Ya,{height:"1"}),(0,i.jsxs)(Ll,{cursor:"default",icon:c,state:u,children:[(0,i.jsx)(Ba,{align:"center",css:{flex:"1",overflow:"hidden"},height:1,width:1,children:(0,i.jsx)(Ru,{children:g[h.toString()]})}),(0,i.jsx)(Ba,{css:{color:"$gray500"},children:(0,i.jsx)(nl,{icon:"chevron-down"})}),(0,i.jsx)(Ou,{"aria-describedby":o?f:void 0,"aria-errormessage":"error"===u?_:void 0,"aria-invalid":"error"===u,autoComplete:e??"off",css:{cursor:"disabled"===u?"not-allowed":"pointer"},disabled:"disabled"===u,id:p,value:h.toString(),onChange:e=>{l(r?parseInt(e.target.value,10):a?"true"===e.target.value:e.target.value)},...m,children:t})]}),(0,i.jsx)(Fl,{id:_,state:u,children:d})]})},Du=e=>{const t=Xn(),[n,s]=(0,L.useState)(e.filterPredicate.predicate?.operator??gt.Is),[o,r]=(0,L.useState)(e.filterPredicate.predicate?.value??!0);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(vc,{state:"is"===n?"checked":"unchecked",onClick:()=>{s(gt.Is)},children:t("est_25967")}),"is"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"1"}),(0,i.jsxs)(Ba,{children:[(0,i.jsx)(Ya,{width:"6"}),(0,i.jsxs)($u,{shouldParseAsBoolean:!0,value:o,onChange:r,children:[(0,i.jsx)("option",{value:"true",children:t("true")}),(0,i.jsx)("option",{value:"false",children:t("false")})]})]}),(0,i.jsx)(Ya,{height:"1"})]}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:"isNot"===n?"checked":"unchecked",onClick:()=>{s(gt.IsNot)},children:t("n_est_pas_97826")}),"isNot"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"1"}),(0,i.jsxs)(Ba,{children:[(0,i.jsx)(Ya,{width:"6"}),(0,i.jsxs)($u,{shouldParseAsBoolean:!0,value:o,onChange:r,children:[(0,i.jsx)("option",{value:"true",children:t("true")}),(0,i.jsx)("option",{value:"false",children:t("false")})]})]}),(0,i.jsx)(Ya,{height:"1"})]}),!0!==e.filterPredicate.filter.hideEmpty&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:"isEmpty"===n?"checked":"unchecked",onClick:()=>{s(gt.IsEmpty)},children:t("est_vide_96759")}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:"isNotEmpty"===n?"checked":"unchecked",onClick:()=>{s(gt.IsNotEmpty)},children:t("n_est_pas_vide_45804")})]}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(Ba,{children:(0,i.jsx)(zl,{onClick:()=>{e.onAdd({operator:n,value:o,slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},Pu=e=>{const t=Xn(),[n,s]=(0,L.useState)(e.filterPredicate.predicate?.operator??gt.Is),o=e.filterPredicate.filter.values??[],[r,a]=(0,L.useState)(so(e.filterPredicate.predicate?.value)?e.filterPredicate.predicate.value:[]),l="is"===n||"isNot"===n||so(r);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(vc,{state:"is"===n?"checked":"unchecked",onClick:()=>{s(gt.Is)},children:t("champ_dont_un_a_44854")}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:"isNot"===n?"checked":"unchecked",onClick:()=>{s(gt.IsNot)},children:t("champ_d_pendant_33676")}),o.length>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:"contains"===n?"checked":"unchecked",onClick:()=>{s(gt.Contains)},children:t("d_pends_du_cham_39787")}),"contains"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"1"}),(0,i.jsxs)(Ba,{children:[(0,i.jsx)(Ya,{width:"6"}),(0,i.jsx)(yc,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,placeholder:t("s_lectionner_de_52380"),values:r,onChange:a,children:o.map(({id:e,name:t})=>(0,i.jsx)("option",{value:e,children:t},e))})]}),(0,i.jsx)(Ya,{height:"1"})]})]}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(Ba,{children:(0,i.jsx)(zl,{disabled:!l,onClick:()=>{e.onAdd({operator:n,value:r,slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})};function Fu(e){if(Gs.c9.isDateTime(e)&&e?.isValid)return e;if(m(e)){const t=Gs.c9.fromISO(e);return t.isValid?t:null}return null}const Mu=({value:e,css:t,label:n,description:s,hint:o,icon:r,min:a,onChange:l,max:d,state:c,rightIcon:u,onRightIconClick:h,zone:g,...p})=>{const f=e?Fu(e):null,_=f?.isValid?f.toFormat(Hs):"",{inputId:x,descId:I,errorId:v}=qa();return(0,i.jsxs)(Ba,{css:t,direction:"column",width:1,children:[(0,i.jsx)(Ml,{htmlFor:x,children:n}),(0,i.jsx)(Pl,{id:I,children:s}),(n||s)&&(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ll,{cursor:"default",icon:r,rightIcon:u,state:c,onRightIconClick:h,children:(0,i.jsx)(Ar,{css:{flex:"1",height:"100%","& input":{background:"transparent",border:"none",color:"$gray500",fontSize:"$textSm",height:"100%",lineHeight:"20px",outline:"none",width:"100%"}},children:(0,i.jsx)("input",{"aria-describedby":s?I:void 0,"aria-errormessage":"error"===c?v:void 0,"aria-invalid":"error"===c,disabled:"disabled"===c,id:x,max:d?.toFormat(Hs),min:a?.toFormat(Hs),type:"date",value:_,onChange:e=>{m(e.target.value)?l(Gs.c9.fromFormat(e.target.value,Hs,{zone:g||"UTC"})):l(Gs.c9.invalid("Invalid"))},...p})})}),(0,i.jsx)(Fl,{id:v,state:c,children:o})]})};var Nu=n(3551);const Lu=e=>{const t=Xn(),n=Zn(Jc),s=(0,L.useMemo)(()=>Gs.c9.now().startOf("year"),[]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"1"}),(0,i.jsxs)(Ba,{children:[(0,i.jsx)(Ya,{width:"6"}),(0,i.jsxs)($u,{shouldParseAsInt:!0,value:e.value.day,onChange:t=>{e.setValue({...e.value,day:t})},children:[(0,i.jsx)("option",{value:"-1",children:t("jour_74089")}),(0,Dc.A)(1,32).map(e=>(0,i.jsx)("option",{value:e,children:e},e))]})]}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsxs)(Ba,{children:[(0,i.jsx)(Ya,{width:"6"}),(0,i.jsxs)($u,{shouldParseAsInt:!0,value:e.value.month,onChange:t=>{e.setValue({...e.value,month:t})},children:[(0,i.jsx)("option",{value:"-1",children:t("mois_10165")}),(0,Dc.A)(1,13).map(e=>{const t=n.toLocaleString(s.set({month:e}),{month:"long"});return(0,i.jsx)("option",{value:e,children:t},e)})]})]}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsxs)(Ba,{children:[(0,i.jsx)(Ya,{width:"6"}),(0,i.jsxs)($u,{shouldParseAsInt:!0,value:e.value.year,onChange:t=>{e.setValue({...e.value,year:t})},children:[(0,i.jsx)("option",{value:"-1",children:t("ann_e_38546")}),(0,Nu.A)(1900,s.year+2).map(e=>(0,i.jsx)("option",{value:e,children:e},e))]})]}),(0,i.jsx)(Ya,{height:"1"})]})},Bu=e=>{const t=Xn(),[n,s]=(0,L.useState)(e.filterPredicate.predicate?.operator??gt.Is),[o,r]=(0,L.useState)(Fu(e.filterPredicate.predicate?.value)||""),[a,l]=(0,L.useState)(Fu(e.filterPredicate.predicate?.value2)||""),[d,c]=(0,L.useState)(e.filterPredicate.predicate?.valueDate??{day:-1,month:-1,year:-1}),u=["is","isNot"].includes(n)?"number"==typeof d.day&&-1!==d.day||"number"==typeof d.month&&-1!==d.month||"number"==typeof d.year&&-1!==d.year:["isBefore","isAfter"].includes(n)?Gs.c9.isDateTime(o)&&o.isValid:"between"!==n||Gs.c9.isDateTime(o)&&o.isValid&&Gs.c9.isDateTime(a)&&a.isValid;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(vc,{state:"is"===n?"checked":"unchecked",onClick:()=>{s(gt.Is)},children:t("est_25967")}),"is"===n&&(0,i.jsx)(Lu,{setValue:c,value:d}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:"isNot"===n?"checked":"unchecked",onClick:()=>{s(gt.IsNot)},children:t("n_est_pas_97826")}),"isNot"===n&&(0,i.jsx)(Lu,{setValue:c,value:d}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:"isBefore"===n?"checked":"unchecked",onClick:()=>{s(gt.IsBefore)},children:t("est_avant_le_16689")}),"isBefore"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"1"}),(0,i.jsxs)(Ba,{children:[(0,i.jsx)(Ya,{width:"6"}),(0,i.jsx)(Mu,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,value:o,onChange:r})]}),(0,i.jsx)(Ya,{height:"1"})]}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:"isAfter"===n?"checked":"unchecked",onClick:()=>{s(gt.IsAfter)},children:t("est_apr_s_le_79703")}),"isAfter"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"1"}),(0,i.jsxs)(Ba,{children:[(0,i.jsx)(Ya,{width:"6"}),(0,i.jsx)(Mu,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,value:o,onChange:r})]}),(0,i.jsx)(Ya,{height:"1"})]}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:"between"===n?"checked":"unchecked",onClick:()=>{s(gt.Between)},children:t("est_entre_born_59665")}),"between"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"1"}),(0,i.jsxs)(Ba,{children:[(0,i.jsx)(Ya,{width:"6"}),(0,i.jsx)(Mu,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,value:o,onChange:r}),(0,i.jsx)(Ya,{width:"3"}),(0,i.jsx)(Mu,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,value:a,onChange:l})]}),(0,i.jsx)(Ya,{height:"1"})]}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:"today"===n?"checked":"unchecked",onClick:()=>{s(gt.Today)},children:t("est_aujourd_hui_82571")}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:"thisDayMonth"===n?"checked":"unchecked",onClick:()=>{s(gt.ThisDayMonth)},children:t("est_aujourd_hui_70881")}),!0!==e.filterPredicate.filter.hideEmpty&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:"isEmpty"===n?"checked":"unchecked",onClick:()=>{s(gt.IsEmpty)},children:t("est_vide_96759")}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:"isNotEmpty"===n?"checked":"unchecked",onClick:()=>{s(gt.IsNotEmpty)},children:t("n_est_pas_vide_45804")})]}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(Ba,{children:(0,i.jsx)(zl,{disabled:!u,onClick:()=>{e.onAdd({operator:n,value:o,value2:a,valueDate:d,slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},Vu=({value:e,css:t,label:n,description:s,hint:o,icon:r,min:a,onChange:l,max:d,rightIcon:c,onRightIconClick:u,state:h,zone:g,...p})=>{const f=e?m(e)?Gs.c9.fromISO(e,{zone:"utc"}):e:null,_=f?.isValid?f.toFormat(qs):"",{inputId:x,descId:I,errorId:v}=qa();return(0,i.jsxs)(Ba,{css:t,direction:"column",width:1,children:[(0,i.jsx)(Ml,{htmlFor:x,children:n}),(0,i.jsx)(Pl,{id:I,children:s}),(n||s)&&(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ll,{cursor:"default",icon:r,rightIcon:c,state:h,onRightIconClick:u,children:(0,i.jsx)(Ar,{css:{flex:"1",height:"100%","& input":{background:"transparent",border:"none",color:"$gray800",height:"100%",outline:"none",width:"100%"}},children:(0,i.jsx)("input",{"aria-describedby":s?I:void 0,"aria-errormessage":"error"===h?v:void 0,"aria-invalid":"error"===h,disabled:"disabled"===h,id:x,max:d?.toFormat(qs),min:a?.toFormat(qs),type:"datetime-local",value:_,onChange:e=>{m(e.target.value)?l(Gs.c9.fromFormat(e.target.value,qs,{zone:g||"UTC"})):l(Gs.c9.invalid("Invalid"))},...p})})}),(0,i.jsx)(Fl,{id:v,state:h,children:o})]})},Uu=e=>{const t=Xn(),n=(0,L.useMemo)(()=>e.filterPredicate.filter.useLocalZone?to():void 0,[e.filterPredicate]),[s,o]=(0,L.useState)(e.filterPredicate.predicate?.operator??gt.Is),[r,a]=(0,L.useState)(Fu(e.filterPredicate.predicate?.value)||""),[l,d]=(0,L.useState)(Fu(e.filterPredicate.predicate?.value2)||""),c=["isBefore","isAfter"].includes(s)?Gs.c9.isDateTime(r)&&r.isValid:"between"!==s||Gs.c9.isDateTime(r)&&r.isValid&&Gs.c9.isDateTime(l)&&l.isValid;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(vc,{state:"isBefore"===s?"checked":"unchecked",onClick:()=>{o(gt.IsBefore)},children:t("est_avant_le_16689")}),"isBefore"===s&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"1"}),(0,i.jsxs)(Ba,{children:[(0,i.jsx)(Ya,{width:"6"}),(0,i.jsx)(Vu,{value:r,zone:n,onChange:a})]}),(0,i.jsx)(Ya,{height:"1"})]}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:"isAfter"===s?"checked":"unchecked",onClick:()=>{o(gt.IsAfter)},children:t("est_apr_s_le_79703")}),"isAfter"===s&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"1"}),(0,i.jsxs)(Ba,{children:[(0,i.jsx)(Ya,{width:"6"}),(0,i.jsx)(Vu,{value:r,zone:n,onChange:a})]}),(0,i.jsx)(Ya,{height:"1"})]}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:"between"===s?"checked":"unchecked",onClick:()=>{o(gt.Between)},children:t("est_entre_born_59665")}),"between"===s&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"1"}),(0,i.jsxs)(Ba,{children:[(0,i.jsx)(Ya,{width:"6"}),(0,i.jsx)(Vu,{value:r,zone:n,onChange:a})]}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsxs)(Ba,{children:[(0,i.jsx)(Ya,{width:"6"}),(0,i.jsx)(Vu,{value:l,zone:n,onChange:d})]}),(0,i.jsx)(Ya,{height:"1"})]}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:"today"===s?"checked":"unchecked",onClick:()=>{o(gt.Today)},children:t("est_aujourd_hui_82571")}),!0!==e.filterPredicate.filter.hideEmpty&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:"isEmpty"===s?"checked":"unchecked",onClick:()=>{o(gt.IsEmpty)},children:t("est_vide_96759")}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:"isNotEmpty"===s?"checked":"unchecked",onClick:()=>{o(gt.IsNotEmpty)},children:t("n_est_pas_vide_45804")})]}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(Ba,{children:(0,i.jsx)(zl,{disabled:!c,onClick:()=>{e.onAdd({operator:s,value:r,value2:l,slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},Wu=e=>{const t=Xn(),[n,s]=(0,L.useState)(e.filterPredicate.predicate?.operator??gt.Contains),[o,r]=(0,L.useState)(e.filterPredicate.predicate?.value??""),[a,l]=(0,L.useState)(e.filterPredicate.predicate?.value2??""),d=!!(Gs.c9.isDateTime(o)&&o.isValid&&["contains","notContains","is"].includes(n))||Gs.c9.isDateTime(a)&&a.isValid;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(vc,{state:"contains"===n?"checked":"unchecked",onClick:()=>{s(gt.Contains)},children:t("contient_34012")}),"contains"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"1"}),(0,i.jsxs)(Ba,{children:[(0,i.jsx)(Ya,{width:"6"}),(0,i.jsx)(Vu,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,value:o,onChange:r})]}),(0,i.jsx)(Ya,{height:"1"})]}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:"is"===n?"checked":"unchecked",onClick:()=>{s(gt.Is)},children:t("contient_date_89885")}),"is"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"1"}),(0,i.jsxs)(Ba,{children:[(0,i.jsx)(Ya,{width:"6"}),(0,i.jsx)(Mu,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,value:o,onChange:r})]})]}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:"notContains"===n?"checked":"unchecked",onClick:()=>{s(gt.NotContains)},children:t("ne_contient_pas_85399")}),"notContains"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"1"}),(0,i.jsxs)(Ba,{children:[(0,i.jsx)(Ya,{width:"6"}),(0,i.jsx)(Vu,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,value:o,onChange:r})]}),(0,i.jsx)(Ya,{height:"1"})]}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:"overlaps"===n?"checked":"unchecked",onClick:()=>{s(gt.Overlaps)},children:t("chevauche_49445")}),"overlaps"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"1"}),(0,i.jsxs)(Ba,{children:[(0,i.jsx)(Ya,{width:"6"}),(0,i.jsx)(Vu,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,placeholder:t("d_but_41840"),value:o,onChange:r})]}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsxs)(Ba,{children:[(0,i.jsx)(Ya,{width:"6"}),(0,i.jsx)(Vu,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,placeholder:t("fin_60104"),value:a,onChange:l})]}),(0,i.jsx)(Ya,{height:"1"})]}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:"notOverlaps"===n?"checked":"unchecked",onClick:()=>{s(gt.NotOverlaps)},children:t("ne_chevauche_pa_17307")}),"notOverlaps"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"1"}),(0,i.jsxs)(Ba,{children:[(0,i.jsx)(Ya,{width:"6"}),(0,i.jsx)(Vu,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,placeholder:t("d_but_41840"),value:o,onChange:r})]}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsxs)(Ba,{children:[(0,i.jsx)(Ya,{width:"6"}),(0,i.jsx)(Vu,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,placeholder:t("fin_60104"),value:a,onChange:l})]}),(0,i.jsx)(Ya,{height:"1"})]}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:"engulfs"===n?"checked":"unchecked",onClick:()=>{s(gt.Engulfs)},children:t("engloutis_42346")}),"engulfs"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"1"}),(0,i.jsxs)(Ba,{children:[(0,i.jsx)(Ya,{width:"6"}),(0,i.jsx)(Vu,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,placeholder:t("d_but_41840"),value:o,onChange:r})]}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsxs)(Ba,{children:[(0,i.jsx)(Ya,{width:"6"}),(0,i.jsx)(Vu,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,placeholder:t("fin_60104"),value:a,onChange:l})]}),(0,i.jsx)(Ya,{height:"1"})]}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:"notEngulfs"===n?"checked":"unchecked",onClick:()=>{s(gt.NotEngulfs)},children:t("n_engloutis_pas_42363")}),"notEngulfs"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"1"}),(0,i.jsxs)(Ba,{children:[(0,i.jsx)(Ya,{width:"6"}),(0,i.jsx)(Vu,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,placeholder:t("d_but_41840"),value:o,onChange:r})]}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsxs)(Ba,{children:[(0,i.jsx)(Ya,{width:"6"}),(0,i.jsx)(Vu,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,placeholder:t("fin_60104"),value:a,onChange:l})]}),(0,i.jsx)(Ya,{height:"1"})]}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:"engulfedBy"===n?"checked":"unchecked",onClick:()=>{s(gt.EngulfedBy)},children:t("est_englouti_pa_47852")}),"engulfedBy"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"1"}),(0,i.jsxs)(Ba,{children:[(0,i.jsx)(Ya,{width:"6"}),(0,i.jsx)(Vu,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,placeholder:t("d_but_41840"),value:o,onChange:r})]}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsxs)(Ba,{children:[(0,i.jsx)(Ya,{width:"6"}),(0,i.jsx)(Vu,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,placeholder:t("fin_60104"),value:a,onChange:l})]}),(0,i.jsx)(Ya,{height:"1"})]}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:"notEngulfedBy"===n?"checked":"unchecked",onClick:()=>{s(gt.NotEngulfedBy)},children:t("n_est_pas_englo_08733")}),"notEngulfedBy"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"1"}),(0,i.jsxs)(Ba,{children:[(0,i.jsx)(Ya,{width:"6"}),(0,i.jsx)(Vu,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,placeholder:t("d_but_41840"),value:o,onChange:r})]}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsxs)(Ba,{children:[(0,i.jsx)(Ya,{width:"6"}),(0,i.jsx)(Vu,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,placeholder:t("fin_60104"),value:a,onChange:l})]}),(0,i.jsx)(Ya,{height:"1"})]}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(Ba,{children:(0,i.jsx)(zl,{disabled:!d,onClick:()=>{e.onAdd({operator:n,value:o,value2:a,slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},Gu=e=>{const t=Xn(),[n,s]=(0,L.useState)(e.filterPredicate.predicate?.operator??gt.IsEmpty);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(vc,{state:"isEmpty"===n?"checked":"unchecked",onClick:()=>{s(gt.IsEmpty)},children:t("est_vide_96759")}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:"isNotEmpty"===n?"checked":"unchecked",onClick:()=>{s(gt.IsNotEmpty)},children:t("n_est_pas_vide_45804")}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(Ba,{children:(0,i.jsx)(zl,{onClick:()=>{e.onAdd({operator:n,value:"",slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},Hu=e=>{const t=Xn(),n=(0,L.useMemo)(()=>(e.filterPredicate.filter.values||[]).map(({id:e,name:t})=>(0,i.jsx)("option",{value:e,children:t},e)),[e.filterPredicate.filter]),[s,o]=(0,L.useState)(e.filterPredicate.predicate?.operator??gt.Is),[r,a]=(0,L.useState)(e.filterPredicate.predicate?.value??[]),[l,d]=(0,L.useState)(e.filterPredicate.predicate?.value2??""),[c,u]=(0,L.useState)(e.filterPredicate.predicate?.valueDate??{day:-1,month:-1,year:-1}),h=so(r)&&["is","isNot"].includes(s)?"number"==typeof c.day&&-1!==c.day||"number"==typeof c.month&&-1!==c.month||"number"==typeof c.year&&-1!==c.year:!!["isBefore","isAfter"].includes(s)&&Gs.c9.isDateTime(l)&&l.isValid;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yc,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,placeholder:t("s_lectionner_un_13356"),values:r,onChange:a,children:n}),r.length>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:"is"===s?"checked":"unchecked",onClick:()=>{o(gt.Is)},children:t("est_25967")}),"is"===s&&(0,i.jsx)(Lu,{setValue:u,value:c}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:"isNot"===s?"checked":"unchecked",onClick:()=>{o(gt.IsNot)},children:t("n_est_pas_97826")}),"isNot"===s&&(0,i.jsx)(Lu,{setValue:u,value:c}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:"isBefore"===s?"checked":"unchecked",onClick:()=>{o(gt.IsBefore)},children:t("est_avant_le_16689")}),"isBefore"===s&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"1"}),(0,i.jsxs)(Ba,{children:[(0,i.jsx)(Ya,{width:"6"}),(0,i.jsx)(Mu,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,value:l,onChange:d})]}),(0,i.jsx)(Ya,{height:"1"})]}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:"isAfter"===s?"checked":"unchecked",onClick:()=>{o(gt.IsAfter)},children:t("est_apr_s_le_79703")}),"isAfter"===s&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"1"}),(0,i.jsxs)(Ba,{children:[(0,i.jsx)(Ya,{width:"6"}),(0,i.jsx)(Mu,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,value:l,onChange:d})]}),(0,i.jsx)(Ya,{height:"1"})]})]}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(Ba,{children:(0,i.jsx)(zl,{disabled:!h,onClick:()=>{e.onAdd({operator:s,value:r,value2:l,valueDate:c,slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},qu=e=>{const t=Xn(),[n,s]=(0,L.useState)(e.filterPredicate.predicate?.operator??gt.Is);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(vc,{state:"is"===n?"checked":"unchecked",onClick:()=>{s(gt.Is)},children:t("est_administrat_15766")}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:"isNot"===n?"checked":"unchecked",onClick:()=>{s(gt.IsNot)},children:t("n_est_pas_admin_58612")}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(Ba,{children:(0,i.jsx)(zl,{onClick:()=>{e.onAdd({operator:n,value:"",slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},Ku=e=>{const t=Xn(),[n,s]=(0,L.useState)(e.filterPredicate.predicate?.operator??gt.Is),o=(0,L.useMemo)(()=>fu(e.filterPredicate.filter,t),[e.filterPredicate.filter]),[r,a]=(0,L.useState)(so(e.filterPredicate.predicate?.value)?e.filterPredicate.predicate.value:[]),l="contains"!==n||so(r),d=(0,L.useMemo)(()=>Array.isArray(r)?r.length:0,[r]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(vc,{state:"is"===n?"checked":"unchecked",onClick:()=>{s(gt.Is)},children:t("est_responsable_47377")}),(0,i.jsx)(Ya,{height:"3"}),"isDelegationLeader"===e.filterPredicate.filter.slug&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(vc,{state:"contains"===n?"checked":"unchecked",onClick:()=>{s(gt.Contains)},children:t("est_responsable_00281")}),"contains"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ba,{css:{paddingLeft:"$6"},children:(0,i.jsx)(yc,{hint:t("_1_s_lectionn_51286",d),isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,placeholder:t("s_lectionner_de_52380"),values:r,onChange:a,children:o})}),(0,i.jsx)(Ya,{height:"1"})]}),(0,i.jsx)(Ya,{height:"3"})]}),(0,i.jsx)(vc,{state:"isNot"===n?"checked":"unchecked",onClick:()=>{s(gt.IsNot)},children:t("n_est_pas_respo_55625")}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(Ba,{children:(0,i.jsx)(zl,{disabled:!l,onClick:()=>{e.onAdd({operator:n,value:r,slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},Yu=e=>{const t=Xn(),[n,s]=(0,L.useState)(e.filterPredicate.predicate?.operator??gt.Is);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(vc,{state:"is"===n?"checked":"unchecked",onClick:()=>{s(gt.Is)},children:t("est_inscrit_en_86193")}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:"isNot"===n?"checked":"unchecked",onClick:()=>{s(gt.IsNot)},children:t("n_est_pas_inscr_25311")}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(Ba,{children:(0,i.jsx)(zl,{onClick:()=>{e.onAdd({operator:n,value:"",slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},Zu=_r("div",{variants:{direction:{horizontal:{width:"100%"},vertical:{height:"100%"}},color:{gray100:{},gray200:{}}},compoundVariants:[{direction:"horizontal",color:"gray100",css:{borderTop:"1px solid $gray100"}},{direction:"vertical",color:"gray100",css:{borderRight:"1px solid $gray100"}},{direction:"horizontal",color:"gray200",css:{borderTop:"1px solid $gray200"}},{direction:"vertical",color:"gray200",css:{borderRight:"1px solid $gray200"}}],defaultVariants:{color:"gray200"}}),Xu=e=>(0,i.jsx)(Zu,{"aria-orientation":e.direction,color:e.color,css:e.css,direction:e.direction,role:"separator"}),Ju=e=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:e.height}),(0,i.jsx)(Zu,{color:e.color,direction:"horizontal",role:"separator"}),(0,i.jsx)(Ya,{height:e.height})]}),Qu=e=>{const t=Xn(),[n,s]=(0,L.useState)(e.filterPredicate.predicate?.operator??gt.Is),[o,r]=(0,L.useState)(e.filterPredicate.predicate?.value??""),[a,l]=(0,L.useState)(e.filterPredicate.predicate?.value2??""),[d,c]=(0,L.useState)(Fu(e.filterPredicate.predicate?.value3)||""),[u,h]=(0,L.useState)(Fu(e.filterPredicate.predicate?.value4)||""),[m,g]=(0,L.useState)(Gs.c9.isDateTime(d)&&d.isValid&&Gs.c9.isDateTime(u)&&u.isValid?"checked":"unchecked"),p=("checked"!==m||Gs.c9.isDateTime(d)&&d.isValid&&Gs.c9.isDateTime(u)&&u.isValid)&&["is","isNot","greaterThan","greaterThanEqual","lessThan","lessThanEqual"].includes(n)?"number"==typeof o:"between"!==n||"number"==typeof o&&"number"==typeof a;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(vc,{state:"is"===n?"checked":"unchecked",onClick:()=>{s(gt.Is)},children:t("est_25967")}),"is"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"1"}),(0,i.jsxs)(Ba,{children:[(0,i.jsx)(Ya,{width:"6"}),(0,i.jsx)(Bl,{shouldParseAsInt:!0,value:o,onChange:r})]}),(0,i.jsx)(Ya,{height:"1"})]}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:"isNot"===n?"checked":"unchecked",onClick:()=>{s(gt.IsNot)},children:t("n_est_pas_97826")}),"isNot"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"1"}),(0,i.jsxs)(Ba,{children:[(0,i.jsx)(Ya,{width:"6"}),(0,i.jsx)(Bl,{shouldParseAsInt:!0,value:o,onChange:r})]}),(0,i.jsx)(Ya,{height:"1"})]}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:"greaterThan"===n?"checked":"unchecked",onClick:()=>{s(gt.GreaterThan)},children:t("plus_grand_que_28412")}),"greaterThan"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"1"}),(0,i.jsxs)(Ba,{children:[(0,i.jsx)(Ya,{width:"6"}),(0,i.jsx)(Bl,{shouldParseAsInt:!0,value:o,onChange:r})]}),(0,i.jsx)(Ya,{height:"1"})]}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:"greaterThanEqual"===n?"checked":"unchecked",onClick:()=>{s(gt.GreaterThanEqual)},children:t("_gal_ou_plus_gr_76897")}),"greaterThanEqual"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"1"}),(0,i.jsxs)(Ba,{children:[(0,i.jsx)(Ya,{width:"6"}),(0,i.jsx)(Bl,{shouldParseAsInt:!0,value:o,onChange:r})]}),(0,i.jsx)(Ya,{height:"1"})]}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:"lessThan"===n?"checked":"unchecked",onClick:()=>{s(gt.LessThan)},children:t("plus_petit_que_35846")}),"lessThan"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"1"}),(0,i.jsxs)(Ba,{children:[(0,i.jsx)(Ya,{width:"6"}),(0,i.jsx)(Bl,{shouldParseAsInt:!0,value:o,onChange:r})]}),(0,i.jsx)(Ya,{height:"1"})]}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:"lessThanEqual"===n?"checked":"unchecked",onClick:()=>{s(gt.LessThanEqual)},children:t("_gal_ou_plus_pe_38400")}),"lessThanEqual"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"1"}),(0,i.jsxs)(Ba,{children:[(0,i.jsx)(Ya,{width:"6"}),(0,i.jsx)(Bl,{shouldParseAsInt:!0,value:o,onChange:r})]}),(0,i.jsx)(Ya,{height:"1"})]}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:"between"===n?"checked":"unchecked",onClick:()=>{s(gt.Between)},children:t("est_entre_born_59665")}),"between"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"1"}),(0,i.jsxs)(Ba,{children:[(0,i.jsx)(Ya,{width:"6"}),(0,i.jsx)(Bl,{shouldParseAsInt:!0,value:o,onChange:r}),(0,i.jsx)(Ya,{width:"3"}),(0,i.jsx)(Bl,{shouldParseAsInt:!0,value:a,onChange:l})]}),(0,i.jsx)(Ya,{height:"1"})]}),!0!==e.filterPredicate.filter.hideEmpty&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:"isEmpty"===n?"checked":"unchecked",onClick:()=>{s(gt.IsEmpty)},children:t("est_vide_96759")}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:"isNotEmpty"===n?"checked":"unchecked",onClick:()=>{s(gt.IsNotEmpty)},children:t("n_est_pas_vide_45804")})]}),"numberOfAssignmentsDays"===e.filterPredicate.filter.slug&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ju,{height:"3"}),(0,i.jsx)(_c,{state:m,onClick:g,children:t("filtrer_sur_une_06420")}),"checked"===m&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"3"}),(0,i.jsxs)(Ba,{gap:"3",children:[(0,i.jsx)(Mu,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,value:d,onChange:c}),(0,i.jsx)(Mu,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,value:u,onChange:h})]})]})]}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(Ba,{children:(0,i.jsx)(zl,{disabled:!p,onClick:()=>{e.onAdd({operator:n,value:o,value2:a,value3:d,value4:u,slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},eh=e=>{const t=Xn(),[n,s]=(0,L.useState)(e.filterPredicate.predicate?.operator??gt.Is),[o,r]=(0,L.useState)(e.filterPredicate.predicate?.value??""),[a,l]=(0,L.useState)(e.filterPredicate.predicate?.value2??""),d=!!(Gs.c9.isDateTime(o)&&o?.isValid&&["is","isNot","greaterThan","greaterThanEqual","lessThan","lessThanEqual"].includes(n))&&"number"==typeof a;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mu,{label:t("jour_d_affectat_27334"),max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,value:o,onChange:r}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(Ml,{children:e.filterPredicate.filter.name}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(vc,{state:"is"===n?"checked":"unchecked",onClick:()=>{s(gt.Is)},children:t("est_25967")}),"is"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"1"}),(0,i.jsxs)(Ba,{children:[(0,i.jsx)(Ya,{width:"6"}),(0,i.jsx)(Bl,{min:0,shouldParseAsInt:!0,value:a,onChange:l})]}),(0,i.jsx)(Ya,{height:"1"})]}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:"isNot"===n?"checked":"unchecked",onClick:()=>{s(gt.IsNot)},children:t("n_est_pas_97826")}),"isNot"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"1"}),(0,i.jsxs)(Ba,{children:[(0,i.jsx)(Ya,{width:"6"}),(0,i.jsx)(Bl,{min:0,shouldParseAsInt:!0,value:a,onChange:l})]}),(0,i.jsx)(Ya,{height:"1"})]}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:"greaterThan"===n?"checked":"unchecked",onClick:()=>{s(gt.GreaterThan)},children:t("plus_grand_que_28412")}),"greaterThan"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"1"}),(0,i.jsxs)(Ba,{children:[(0,i.jsx)(Ya,{width:"6"}),(0,i.jsx)(Bl,{min:0,shouldParseAsInt:!0,value:a,onChange:l})]}),(0,i.jsx)(Ya,{height:"1"})]}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:"greaterThanEqual"===n?"checked":"unchecked",onClick:()=>{s(gt.GreaterThanEqual)},children:t("_gal_ou_plus_gr_76897")}),"greaterThanEqual"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"1"}),(0,i.jsxs)(Ba,{children:[(0,i.jsx)(Ya,{width:"6"}),(0,i.jsx)(Bl,{min:0,shouldParseAsInt:!0,value:a,onChange:l})]}),(0,i.jsx)(Ya,{height:"1"})]}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:"lessThan"===n?"checked":"unchecked",onClick:()=>{s(gt.LessThan)},children:t("plus_petit_que_35846")}),"lessThan"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"1"}),(0,i.jsxs)(Ba,{children:[(0,i.jsx)(Ya,{width:"6"}),(0,i.jsx)(Bl,{min:0,shouldParseAsInt:!0,value:a,onChange:l})]}),(0,i.jsx)(Ya,{height:"1"})]}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:"lessThanEqual"===n?"checked":"unchecked",onClick:()=>{s(gt.LessThanEqual)},children:t("_gal_ou_plus_pe_38400")}),"lessThanEqual"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"1"}),(0,i.jsxs)(Ba,{children:[(0,i.jsx)(Ya,{width:"6"}),(0,i.jsx)(Bl,{min:0,shouldParseAsInt:!0,value:a,onChange:l})]}),(0,i.jsx)(Ya,{height:"1"})]}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(Ba,{children:(0,i.jsx)(zl,{disabled:!d,onClick:()=>{e.onAdd({operator:n,value:o,value2:a,slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},th=e=>{const t=Xn(),[n,s]=(0,L.useState)(e.filterPredicate.predicate?.operator??gt.Is);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(vc,{state:"is"===n?"checked":"unchecked",onClick:()=>{s(gt.Is)},children:t("Public")}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:"isNot"===n?"checked":"unchecked",onClick:()=>{s(gt.IsNot)},children:t("Private")}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(Ba,{children:(0,i.jsx)(zl,{onClick:()=>{e.onAdd({operator:n,value:"",slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},nh=e=>{const t=Xn(),[n,s]=(0,L.useState)(e.filterPredicate.predicate?.operator??gt.Is),o=(0,L.useMemo)(()=>fu(e.filterPredicate.filter,t),[e.filterPredicate.filter]),[r,a]=(0,L.useState)(so(e.filterPredicate.predicate?.value)?e.filterPredicate.predicate.value:[]),l="is"!==n&&"isNot"!==n||so(r),d=(0,L.useMemo)(()=>Array.isArray(r)?r.length:0,[r]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(vc,{state:"is"===n?"checked":"unchecked",onClick:()=>{s(gt.Is)},children:t("est_25967")}),"is"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ba,{css:{paddingLeft:"$6"},children:(0,i.jsx)(yc,{hint:t("_1_s_lectionn_51286",d),isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,placeholder:t("s_lectionner_de_52380"),values:r,onChange:a,children:o})}),(0,i.jsx)(Ya,{height:"1"})]}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:"isNot"===n?"checked":"unchecked",onClick:()=>{s(gt.IsNot)},children:t("n_est_pas_97826")}),"isNot"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ba,{css:{paddingLeft:"$6"},children:(0,i.jsx)(yc,{hint:t("_1_s_lectionn_51286",d),isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,placeholder:t("s_lectionner_de_52380"),values:r,onChange:a,children:o})}),(0,i.jsx)(Ya,{height:"1"})]}),!0!==e.filterPredicate.filter.hideEmpty&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:"isEmpty"===n?"checked":"unchecked",onClick:()=>{s(gt.IsEmpty)},children:t("est_vide_96759")}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:"isNotEmpty"===n?"checked":"unchecked",onClick:()=>{s(gt.IsNotEmpty)},children:t("n_est_pas_vide_45804")})]}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(Ba,{children:(0,i.jsx)(zl,{disabled:!l,onClick:()=>{e.onAdd({operator:n,value:r,slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},ih=e=>{const t=Xn(),[n,s]=(0,L.useState)(e.filterPredicate.predicate?.operator??(e.filterPredicate.filter.isEncrypted?gt.IsEmpty:gt.Contains)),[o,r]=(0,L.useState)(e.filterPredicate.predicate?.value??""),a="contains"!==n&&"notContains"!==n||m(o);return(0,i.jsxs)(i.Fragment,{children:[!0!==e.filterPredicate.filter.isEncrypted&&(0,i.jsx)(vc,{state:"contains"===n?"checked":"unchecked",onClick:()=>{s(gt.Contains)},children:t("contient_34012")}),"contains"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"1"}),(0,i.jsxs)(Ba,{children:[(0,i.jsx)(Ya,{width:"6"}),(0,i.jsx)(Bl,{value:o,onChange:r})]}),(0,i.jsx)(Ya,{height:"1"})]}),!0!==e.filterPredicate.filter.isEncrypted&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:"notContains"===n?"checked":"unchecked",onClick:()=>{s(gt.NotContains)},children:t("ne_contient_pas_85399")})]}),"notContains"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"1"}),(0,i.jsxs)(Ba,{children:[(0,i.jsx)(Ya,{width:"6"}),(0,i.jsx)(Bl,{value:o,onChange:r})]}),(0,i.jsx)(Ya,{height:"1"})]}),!0!==e.filterPredicate.filter.isEncrypted&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:"startsWith"===n?"checked":"unchecked",onClick:()=>{s(gt.StartsWith)},children:t("commence_par_11056")})]}),"startsWith"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"1"}),(0,i.jsxs)(Ba,{children:[(0,i.jsx)(Ya,{width:"6"}),(0,i.jsx)(Bl,{value:o,onChange:r})]}),(0,i.jsx)(Ya,{height:"1"})]}),!0!==e.filterPredicate.filter.isEncrypted&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:"endsWith"===n?"checked":"unchecked",onClick:()=>{s(gt.EndsWith)},children:t("finit_par_79657")})]}),"endsWith"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"1"}),(0,i.jsxs)(Ba,{children:[(0,i.jsx)(Ya,{width:"6"}),(0,i.jsx)(Bl,{value:o,onChange:r})]}),(0,i.jsx)(Ya,{height:"1"})]}),!0!==e.filterPredicate.filter.hideEmpty&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:"isEmpty"===n?"checked":"unchecked",onClick:()=>{s(gt.IsEmpty)},children:t("est_vide_96759")}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:"isNotEmpty"===n?"checked":"unchecked",onClick:()=>{s(gt.IsNotEmpty)},children:t("n_est_pas_vide_45804")})]}),e.showIsValid&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:"isValid"===n?"checked":"unchecked",onClick:()=>{s(gt.IsValid)},children:t("est_valide_72630")}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:"isNotValid"===n?"checked":"unchecked",onClick:()=>{s(gt.IsNotValid)},children:t("n_est_pas_valid_75405")})]}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(Ba,{children:(0,i.jsx)(zl,{disabled:!a,onClick:()=>{e.onAdd({operator:n,value:o,slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},sh=e=>{const t=Xn(),[n,s]=(0,L.useState)(e.filterPredicate.predicate?.operator??gt.Is),o=(0,L.useMemo)(()=>fu(e.filterPredicate.filter,t),[e.filterPredicate.filter]),[r,a]=(0,L.useState)(so(e.filterPredicate.predicate?.value)?e.filterPredicate.predicate.value:[]),[l,d]=(0,L.useState)(e.filterPredicate.predicate?.value2??1),c=so(r)||[gt.IsEmpty,gt.IsNotEmpty].includes(n);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(vc,{state:"is"===n?"checked":"unchecked",onClick:()=>{s(gt.Is)},children:t("est_25967")}),"is"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"1"}),(0,i.jsxs)(Ba,{children:[(0,i.jsx)(Ya,{width:"6"}),(0,i.jsx)(yc,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,placeholder:t("s_lectionner_de_52380"),values:r,onChange:a,children:o})]}),(0,i.jsx)(Ya,{height:"1"})]}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:"isNot"===n?"checked":"unchecked",onClick:()=>{s(gt.IsNot)},children:t("n_est_pas_97826")}),"isNot"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"1"}),(0,i.jsxs)(Ba,{children:[(0,i.jsx)(Ya,{width:"6"}),(0,i.jsx)(yc,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,placeholder:t("s_lectionner_de_52380"),values:r,onChange:a,children:o})]}),(0,i.jsx)(Ya,{height:"1"})]}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:"contains"===n?"checked":"unchecked",onClick:()=>{s(gt.Contains)},children:t("est_le_choix_07450")}),"contains"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"1"}),(0,i.jsxs)(Ba,{children:[(0,i.jsx)(Ya,{width:"6"}),(0,i.jsx)(Bl,{shouldParseAsInt:!0,value:l,onChange:d})]}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsxs)(Ba,{children:[(0,i.jsx)(Ya,{width:"6"}),(0,i.jsx)(yc,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,placeholder:t("s_lectionner_de_52380"),values:r,onChange:a,children:o})]}),(0,i.jsx)(Ya,{height:"1"})]}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:"isEmpty"===n?"checked":"unchecked",onClick:()=>{s(gt.IsEmpty)},children:t("est_vide_96759")}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:"isNotEmpty"===n?"checked":"unchecked",onClick:()=>{s(gt.IsNotEmpty)},children:t("n_est_pas_vide_45804")}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(Ba,{children:(0,i.jsx)(zl,{disabled:!c,onClick:()=>{e.onAdd({operator:n,value:r,value2:l,slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})};var oh=n(9669),rh=n(8389),ah=n(8047);const lh=({children:e,dateTime:t,...n})=>{const s=m(t)?t:t.toISO();return(0,i.jsx)(hl,{as:"time",dateTime:s,textStyle:"inherit",...n,children:e})};function dh(e,t){const n=t.formats?.localeFormat||eo.DateOnly.MonthLong,i=eo.TimeOnly,s=t.language?{locale:vd(t.language)}:{};t.formats?.displayWeekday&&(n.weekday="long");const o=e.start,r=e.end;return{startDateString:m(t.formats?.dateFormat)?o.toFormat(t.formats.dateFormat):o.toLocaleString(n,s),startTimeString:m(t.formats?.timeFormat)?o.toFormat(t.formats.timeFormat):o.toLocaleString(i,s),endDateString:m(t.formats?.dateFormat)?r.toFormat(t.formats.dateFormat):r.toLocaleString(n,s),endTimeString:m(t.formats?.timeFormat)?r.toFormat(t.formats.timeFormat):r.toLocaleString(i,s)}}function ch(e){return Math.ceil(e.end.endOf("day").diff(e.start.startOf("day"),"days").days)}function uh(e){return e.flatMap(e=>{const t=e.range,n=ch(t);return n>1?(0,Dc.A)(0,n).map(n=>{const i=t.start.plus({days:n}),s=i.startOf("day").equals(t.start.startOf("day"))?t.start:i.startOf("day"),o=i.endOf("day").equals(t.end.endOf("day"))?t.end:i.endOf("day");return{...e,range:Gs.IX.fromDateTimes(s,o)}}):[e]})}function hh(e,t,n,i){const s=Math.ceil(n.endOf("day").diff(t.startOf("day"),"days").days),o=(0,Dc.A)(0,s).map(e=>t.startOf("day").set({hour:i}).plus({day:e})),[r,a]=(0,oh.A)(e,e=>e.range.start.hour===i&&0===e.range.start.minute);return a.flatMap(e=>e.range.splitAt(...o).map(t=>({...e,range:t}))).concat(r)}function mh(e){const t=e.filter(e=>e.isValid);if(so(t)){const e=(0,uc.A)(t,e=>e.start.toMillis()),n=[e[0]];for(let t=1;te.start),i=n.reduce((e,t)=>Math.min(e,t.hour),t.minHour??8),s=i%2==0?i:i-1,o=e.map(e=>e.end),r=o.reduce((e,t)=>Math.max(e,t.hour),t.maxHour??20),a=r%2==0?r:r+1,l=(a-s)/2,d=(0,rh.A)(n,e=>e.toMillis()).startOf("day"),c=(0,ah.A)(o,e=>e.toMillis()).endOf("day"),u=Math.ceil(c.diff(d,"days").days);return{starts:n,ends:o,startHour:s,endHour:a,numberOfSlots:l,startDate:d,endDate:c,numberOfDays:u}}let ph=class{translationService;constructor(e){this.translationService=e}toDisplayString(e,t={}){return function(e,t={}){const{startDateString:n,startTimeString:i,endDateString:s,endTimeString:o}=dh(e,t);return e.start.year!==e.end.year||e.start.month!==e.end.month||e.start.day!==e.end.day?t.hideTime?`${n}–${s}`:t.hideDate?`${i}–${o}`:`${n} ${i}–${s} ${o}`:t.hideTime?`${n}`:t.hideDate?`${i}–${o}`:`${n} ${i}–${o}`}(e,{...t,language:this.translationService.language})}toComponents(e,t={}){return function(e,t={}){const{startDateString:n,startTimeString:s,endDateString:o,endTimeString:r}=dh(e,t);return e.start.year!==e.end.year||e.start.month!==e.end.month||e.start.day!==e.end.day?t.hideTime?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(lh,{dateTime:e.start,children:n}),"–",(0,i.jsx)(lh,{dateTime:e.end,children:o})]}):t.hideDate?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(lh,{dateTime:e.start,children:s}),"–",(0,i.jsx)(lh,{dateTime:e.end,children:s})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(lh,{dateTime:e.start,children:[n," ",s]}),"–",(0,i.jsxs)(lh,{dateTime:e.end,children:[o," ",r]})]}):t.hideTime?(0,i.jsx)(lh,{dateTime:e.start,children:n}):t.hideDate?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(lh,{dateTime:e.start,children:s}),"–",(0,i.jsx)(lh,{dateTime:e.end,children:r})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(lh,{dateTime:e.start,children:[n," ",s]}),"–",(0,i.jsx)(lh,{dateTime:e.end,children:r})]})}(e,{...t,language:this.translationService.language})}toLocaleString(e,t,n){return e.toLocaleString(n,t)}};ph=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[qn])],ph);var fh=n(7231),_h=n(6452),xh=n(5582);const Ih=/^\d{2}:\d{2}$/,vh=/^\d{2}:\d{2}:\d{2}$/;function bh(e){return m(e)&&(null!==e.match(Ih)||null!==e.match(vh))}function jh(e){if(bh(e)){const[t,n]=e.split(":");return[parseInt(t,10),parseInt(n,10)]}return null}function Ch(e,t,n,i={}){const s=m(t.name)?t.name:"",o=e.toDisplayString(t.range,i.interval?.options),r=(0,Za.A)([i.position?.includeName?n:"",s,i.slot?.includeRange||g(s)?o:"",i.position?.includeNameAtEnd?n:""]).join(" - ");return m(r)?r:n}function yh(e,t){return t.some(({id:t,range:n})=>e.id!==t&&n.overlaps(e.range))}function kh(e,t){const n=e.toISODate();return t.filter(e=>e.range.start.toISODate()===n)}function Ah(e,t,n){return!n.hiddenPositionsSlotsIds.includes(e.id)&&(0===n.displayedPositionsSlotsIds.length||n.displayedPositionsSlotsIds.includes(e.id))&&(n.showFullPosition||!e.isFull)&&(n.slotDisplay===It.Hide||n.positionFilter===xt.None||mh(t.map(Xs)).some(t=>t.engulfs(e.range)))}function wh(e,t,n,i,s,o){const r=[],a=[],l=[],d=e=>Eh(e.position,o),c=(e,t)=>t.some(t=>t.engulfs(e.range)),u=so(s),h=so(i)||so(n)||so(t),m=u&&h?"both":u?"ranges":h?"positions":"none";e.forEach(e=>{const o=i.includes(e.id)||n.includes(e.position.id)||t.includes(e.positionCategory.id);"both"===m&&c(e,s)&&d(e)&&o||"ranges"===m&&c(e,s)&&d(e)||"positions"===m&&d(e)&&o?r.push(e):d(e)&&(0===s.length||c(e,s))?a.push(e):l.push(e)});const g=e=>e.range.start.toMillis();return{wishedPositionsSlots:(0,uc.A)(r,g),possiblePositionsSlots:(0,uc.A)(a,g),otherPositionsSlots:(0,uc.A)(l,g)}}function Sh(e,t){const n=t[e.customField.slug];return"boolean"==typeof n&&e.customField.fieldType===We.Checkbox?n===e.conditionValue:e.customField.fieldType===We.Select&&e.customField.canSelectMultiple&&so(n)?(0,fh.A)(e.conditionValue,n??[]).length>0:e.customField.fieldType===We.Select&&"number"==typeof n&&e.conditionValue.includes(n)}function Eh(e,t){if(!so(e?.conditionsCustomFields))return!0;switch(e.conditionsOperator){case _e.Or:return e.conditionsCustomFields.some(e=>Sh(e,t));case _e.And:return e.conditionsCustomFields.every(e=>Sh(e,t));default:return ll(e.conditionsOperator)}}function Th(e,t,n,i){return!i.hiddenPositionsIds.includes(e.id)&&(0===i.displayedPositionsIds.length||i.displayedPositionsIds.includes(e.id))&&(0===i.hiddenPositionsTagsIds.length||oo((0,fh.A)(i.hiddenPositionsTagsIds,e.tagsIds)))&&(0===i.displayedPositionsTagsIds.length||so((0,fh.A)(i.displayedPositionsTagsIds,e.tagsIds)))&&Eh(e,t)&&e.slots.some(e=>Ah(e,n,i))}function zh(e){return m(e.address)}function Oh(e){return Tr(e.latitude)&&Tr(e.longitude)}function Rh(e){return zh(e)||Oh(e)}function $h(e){return(0,uc.A)(Object.values((0,cc.A)(e,e=>e.position.name)).map(e=>{const t=e[0].positionCategory,n=e[0].position,i=e.map(e=>e.positionSlot.range.start.toMillis());return{id:n.id,category:t.name,text:m(n.acronym)?n.acronym:n.name,minDate:(0,_h.A)(i),color:n.color,count:e.length,icon:n.icon}}),({category:e,text:t,minDate:n})=>[e.toLowerCase(),t.toLowerCase(),n])}function Dh(e,t,n,i={}){const s=m(t.name)?t.name:"",o=t.date?m(i?.date?.format)?t.date.toFormat(i?.date?.format??""):e.toLocaleString(t.date,i?.date?.localeFormat||eo.DateOnly.Numeric):"",r=(0,Za.A)([i?.accreditation?.includeName?n:"",s,o,i?.accreditation?.includeNameAtEnd?n:""]).join(" - ");return m(r)?r:m(i?.defaultName)?i?.defaultName:n}function Ph(e,t,n,i){return!e.isBlocked&&n.accreditationDisplay!==pt.None&&!n.hiddenAccreditationsSlotsIds.includes(e.id)&&(0===n.displayedAccreditationsSlotsIds.length||n.displayedAccreditationsSlotsIds.includes(e.id))&&(n.showFullAccreditation||!e.isFull)&&(n.slotDisplay===It.Hide||n.accreditationFilter===xt.None||!e.date||mh(t.map(Xs)).some(t=>Qs(t,e.date)))||i.some(i=>i.accreditationSlotId===e.id&&!i.accreditationSlot.isBlocked&&(n.showFullAccreditation||!i.isFull&&!i.accreditationSlot.isFull)&&(n.slotDisplay===It.Hide||n.accreditationFilter===xt.None||!i.accreditationSlot?.date||mh(t.map(Xs)).some(e=>Qs(e,i.accreditationSlot.date))))}function Fh(e){const t=e.filter(e=>e.date?.isValid),n=(0,rh.A)(t.map(e=>e.date),e=>e.toMillis()),i=(0,ah.A)(t.map(e=>e.date),e=>e.toMillis()),s=Math.ceil(i.endOf("month").diff(n.startOf("month"),"months").months),o=Math.ceil(i.diff(n,"days").days);return{minDate:n,maxDate:i,numberOfMonths:s,totalDaysDiff:o}}function Mh(e,t,n,i){const s=(0,mc.A)(e,t.flatMap(e=>e.date?.isValid&&n.equals(e.date.startOf("month"))?[e.id]:[]));return t.flatMap(e=>i.some(t=>e.date?.isValid&&t.startOf("day").equals(e.date.startOf("day")))?[e.id]:[]).concat(s)}function Nh(e){return(0,uc.A)(e,e=>[e.date?.toMillis()??1,e.name.toLowerCase()])}function Lh(e){return 3136===e}var Bh,Vh,Uh,Wh,Gh;function Hh(e){switch(e){case Vh.AccreditationsMatrix:case Gh.AccreditationsMatrix:return"table-cells";case Wh.Calendar:case Gh.Calendar:return"calendar";case Uh.Card:return"rectangle-list";case Bh.List:case Vh.List:case Uh.List:case Wh.List:case Gh.List:return"table";case Wh.Map:case Gh.Map:return"map-location";case Bh.SlotsList:case Wh.SlotsList:return"table";default:return ll()}}function qh(e,t){switch(t){case Vh.AccreditationsMatrix:case Gh.AccreditationsMatrix:return e("matrice_des_acc_84939");case Wh.Calendar:case Gh.Calendar:return e("vue_planning_91663");case Uh.Card:return e("vue_grille_37962");case Bh.List:case Vh.List:case Uh.List:case Wh.List:case Gh.List:return e("vue_liste_56882");case Wh.Map:case Gh.Map:return e("vue_carte_79064");case Bh.SlotsList:case Wh.SlotsList:return e("vue_liste_cr_n_47406");default:return ll()}}!function(e){e.List="List",e.SlotsList="SlotsList"}(Bh||(Bh={})),function(e){e.AccreditationsMatrix="AccreditationsMatrix",e.List="List"}(Vh||(Vh={})),function(e){e.Card="Card",e.List="List"}(Uh||(Uh={})),function(e){e.Calendar="Calendar",e.List="List",e.Map="Map",e.SlotsList="SlotsList"}(Wh||(Wh={})),function(e){e.AccreditationsMatrix="AccreditationsMatrix",e.Calendar="Calendar",e.List="List",e.Map="Map"}(Gh||(Gh={}));var Kh;function Yh(e,t,n){return t===Gh.AccreditationsMatrix?{includeAccreditations:!1,includeAccreditationsMatrix:!0,includeAvailability:!1,includeComments:!1,includeDelegation:!1,includeDuplicatedFrom:!1,includeEmails:!1,includeForms:!1,includeFormsUsersInfos:!1,includeNumberOfAccreditations:!1,includeNumberOfAssignments:!1,includeNumberOfAssignmentsDays:!1,includeNumberOfAvailableDays:!1,includePicture:!0,includePositions:!1,includePreassignedPositions:!1,includeRoles:!1,includeTags:!1,includeTeam:!1,includeTraces:!1,includeVolunteerMinutes:!1,includeWeezevent:!1,includeWeezeventChecklists:!1,includeWeezeventUrls:!1,includeWishedPositions:!1}:t===Gh.Map?{includeAccreditations:!1,includeAccreditationsMatrix:!1,includeAvailability:!1,includeComments:!1,includeDelegation:!1,includeDuplicatedFrom:!1,includeEmails:!1,includeForms:!1,includeFormsUsersInfos:!1,includeNumberOfAccreditations:!1,includeNumberOfAssignments:!1,includeNumberOfAssignmentsDays:!1,includeNumberOfAvailableDays:!1,includePicture:!1,includePositions:!1,includePreassignedPositions:!1,includeRoles:!1,includeTags:!1,includeTeam:!1,includeTraces:!0,includeVolunteerMinutes:!1,includeWeezevent:!1,includeWeezeventChecklists:!1,includeWeezeventUrls:!1,includeWishedPositions:!1}:{includeAccreditations:e.includes(Kh.Accreditations)||e.includes(Kh.AccreditationsCategories)||e.includes(Kh.AccreditationsSlots)||e.includes(Kh.WishedAccreditationSlots)||e.includes(Kh.ScannedAccreditations),includeAccreditationsMatrix:!1,includeAvailability:e.includes(Kh.Availability),includeComments:e.includes(Kh.Comments),includeDelegation:e.includes(Kh.Delegations)||e.includes(Kh.DelegationCategory)||e.includes(Kh.DelegationBannerNumber),includeDuplicatedFrom:e.includes(Kh.DuplicatedFrom),includeEmails:e.includes(Kh.CampaignsStates),includeFormsUsersInfos:e.includes(Kh.CompletedForms)||e.includes(Kh.FormsInsertedAt)||e.some(e=>e.startsWith("form_inserted_at"))||e.includes(Kh.Availability)||e.includes(Kh.TeamCode)||e.includes(Kh.TeamMembers),includeForms:e.includes(Kh.CompletedForms)||e.includes(Kh.FormsInsertedAt)||e.some(e=>e.startsWith("form_inserted_at"))||e.includes(Kh.Availability),includeNumberOfAccreditations:e.includes(Kh.NumberOfAccreditations),includeNumberOfAssignments:e.includes(Kh.NumberOfAssignments),includeNumberOfAssignmentsDays:e.includes(Kh.NumberOfAssignmentsDays),includeNumberOfAvailableDays:e.includes(Kh.NumberOfAvailableDays),includePicture:e.includes(Kh.Name)||e.includes("picture"),includePositions:e.includes(Kh.Positions)||e.includes(Kh.PositionsCategories)||e.includes(Kh.WishedPositions)||e.includes(Kh.CheckedInPositions),includeRoles:e.includes(Kh.Roles),includeTags:e.includes(Kh.Tags),includeTeam:e.includes(Kh.TeamCode)||e.includes(Kh.TeamMembers),includeTraces:!1,includeVolunteerMinutes:e.includes(Kh.VolunteerMinutes),includeWishedPositions:e.includes(Kh.WishedPositions),includePreassignedPositions:e.includes(Kh.PreassignedPositionsCategories)||e.includes(Kh.PreassignedPositions),includeWeezeventChecklists:e.includes(Kh.WeezaccessChecklists),includeWeezevent:e.includes(Kh.WeezeventBarcodeId)||e.includes(Kh.WeezeventPairedAt),includeWeezeventUrls:!0===n?.includeWeezeventUrls&&(e.includes(Kh.WeezeventBarcodeId)||e.includes(Kh.WeezeventShortTag))}}!function(e){e.AccreditationState="accreditation_state",e.Accreditations="accreditations",e.AccreditationsCategories="accreditations_categories",e.AccreditationsSlots="accreditations_slots",e.Availability="availability",e.CampaignsStates="campaigns_states",e.CheckedInPositions="checed_in_positions",e.Comments="comments",e.CompletedForms="forms",e.DelegationCategory="delegation_category",e.DelegationBannerNumber="delegation_banner_number",e.Delegations="delegations",e.DuplicatedFrom="duplicatedFrom",e.Email="email",e.FormsInsertedAt="forms_inserted_at",e.Id="id",e.InsertedAt="inserted_at",e.LocalId="local_id",e.Name="name",e.NumberOfAccreditations="number_of_accreditations",e.NumberOfAssignments="number_of_assignments",e.NumberOfAssignmentsDays="number_of_assignments_days",e.NumberOfAvailableDays="number_of_available_days",e.Positions="positions",e.PositionsCategories="positions_categories",e.PreassignedPositions="preassigned_positions",e.PreassignedPositionsCategories="preassigned_positions_categories",e.Roles="roles",e.ScannedAccreditations="scanned_accreditations",e.Tags="tags",e.TeamCode="teamCode",e.TeamMembers="teamMembers",e.VolunteerMinutes="volunteer_minutes",e.VolunteerRegistrationState="volunteer_registration_state",e.WeezaccessChecklists="weezevent_checklists",e.WeezeventBarcodeId="weezevent_barcode_id",e.WeezeventPairedAt="weezevent_paired_at",e.WeezeventShortTag="weezevent_short_tag",e.WishedAccreditationSlots="wished_accreditation_slots",e.WishedPositions="wished_positions"}(Kh||(Kh={}));let Zh=class extends _u{constructor(e,t,n){super(e,t,n)}getVolunteersFilters(e,t,n,i,s,{hasAccreditations:o,hasCampaigns:r,hasDelegations:a,hasForms:l,hasPositions:d,isWeezeventConnected:c}){return[...this.getBaseFilters(i),...this.getAvailabilitiesFilters(t,s),...d?this.getPositionsFilters(e,t,s):[],...o?this.getAccreditationsFilters(e,t,s):[],...a?this.getDelegationsFilters(e,t):[],...this.getSegmentsFilters(e,t,n,s),...l?this.getFormsFilters(t):[],...l?this.getTeamsFilters():[],...c?this.getWeezeventFilters(t):[],...this.getEmailsFilters(t,r),...this.getCommentsFilter(e,t),{slug:"tag",name:this.t("Tag"),category:this.t("autres_99130"),fieldType:He.Select,needLoading:!0,organizationId:e,eventId:t,tagContext:wt.UsersInfos},{slug:"sameEmail",name:this.t("nombre_de_profi_42316"),category:this.t("autres_99130"),fieldType:He.Number,hideEmpty:!0},{slug:"possibleDuplicates",name:this.t("potentiel_doubl_87672"),category:this.t("autres_99130"),fieldType:He.Checkbox,hideEmpty:!0},{slug:"isLeader",name:this.t("est_responsable_19679"),category:this.t("autres_99130"),fieldType:He.Checkbox},{slug:"isPositionLeader",name:this.t("est_responsable_27270"),category:this.t("autres_99130"),fieldType:He.Checkbox},{slug:"isPositionCategoryLeader",name:this.t("est_responsable_91796"),category:this.t("autres_99130"),fieldType:He.Checkbox}]}getPositionMembersFilters(e,t,n,i){return[...this.getBaseFilters(n),...this.getAvailabilitiesFilters(t,i),...this.getPositionsFilters(e,t,i)]}getAccreditationMembersFilters(e,t,n,i,{hasDelegations:s}){return[...this.getBaseFilters(n),...this.getAccreditationsFilters(e,t,i),...s?this.getDelegationsFilters(e,t):[]]}getDelegationCategoryMembersFilters(e,t,n,i,s){return[...this.getBaseFilters(n),...this.getAccreditationsFilters(e,t,i),...s?this.getWeezeventFilters(t):[]]}getDelegationMembersFilters(e,t,n,i,s,o){return[...this.getBaseFilters(n),...this.getAccreditationsFilters(e,t,i),...s.positionDisplay===_t.None?[]:this.getPositionMembersFilters(e,t,n,i),...o?this.getWeezeventFilters(t):[]]}getVolunteersPossibleColumns(e,t,n,{hasAccreditations:i,hasCampaigns:s,hasDelegations:o,hasForms:r,hasPositions:a,isWeezeventConnected:l}){return[...this.getBaseColumns(t),...r?this.getFormsColumns(n):[],...a?this.getPositionsColumns():[],...l?this.getWeezeventColumns():[],...i?this.getAccreditationsColumns():[],...this.getAvailabilitiesColumns(),...o?this.getDelegationsColumns(e):[],...s?[{slug:Kh.CampaignsStates,name:this.t("statut_des_camp_25280"),minWidth:320}]:[],{slug:Kh.Tags,name:this.t("tags_79499"),isSearchable:!0,minWidth:320},{slug:Kh.Comments,name:this.t("commentaires_96492"),isSearchable:!0,minWidth:320},{slug:Kh.Roles,name:this.t("r_les_61679"),minWidth:320}]}getPositionMembersPossibleColumns(e){return[...this.getBaseColumns(e),...this.getPositionsColumns()]}getAccreditationMembersPossibleColumns(e,t){return[...this.getBaseColumns(t),...this.getAccreditationsColumns(),...this.getDelegationsColumns(e)]}getDelegationCategoryMembersPossibleColumns(e,t,n){return[...this.getBaseColumns(t),...this.getAccreditationsColumns(),...this.getDelegationsColumns(e),...n?this.getWeezeventColumns():[],{slug:Kh.CampaignsStates,name:this.t("statut_des_camp_25280")},{slug:Kh.Delegations,name:this.t("Delegation"),isSearchable:!0}]}getDelegationMembersPossibleColumns(e,{isWeezeventConnected:t,positionDisplay:n,slotDisplay:i}){return[...this.getBaseColumns(e),...this.getAccreditationsColumns(),...n===_t.None?[]:this.getPositionsColumns(),...i===It.Hide?[]:this.getAvailabilitiesColumns(),...t?this.getWeezeventColumns():[],{slug:Kh.CampaignsStates,name:this.t("statut_des_camp_25280")}]}getBaseColumns(e){return[{slug:Kh.Email,name:this.t("e_mail_du_membr_69509"),isSearchable:!0,isSortable:!0,sortAttribute:Mt.Email,minWidth:180},{slug:Kh.Id,name:this.t("id_51738"),isSearchable:!0,isSortable:!0,sortAttribute:Mt.Id,width:100},{slug:Kh.LocalId,name:this.t("id_sur_l_v_nem_01171"),isSearchable:!0,isSortable:!0,sortAttribute:Mt.LocalId,width:100},{slug:Kh.Name,name:this.t("full_name"),isSearchable:!0,isSortable:!0,sortAttribute:Mt.Name,minWidth:240},{slug:Kh.InsertedAt,name:this.t("date_d_inscript_31369"),isSortable:!0,sortAttribute:Mt.InsertedAt,width:240},{slug:Kh.DuplicatedFrom,name:this.t("dupliqu_de_28582"),minWidth:240},...this.customFieldsToPossibleColumns(e)]}getAvailabilitiesColumns(){return[{slug:Kh.Availability,name:this.t("disponibilit_s_49923"),minWidth:320}]}getFormsColumns(e){return[{slug:Kh.CompletedForms,name:this.t("formulaires_rem_62495"),minWidth:320},{slug:Kh.FormsInsertedAt,name:this.t("dates_de_rempli_65075"),minWidth:320},...(0,uc.A)(e,e=>e.name).map(e=>({slug:`form_inserted_at_${e.id}`,name:this.t("date_de_remplis_00881",e.name),isSortable:!0,sortAttribute:`form_inserted_at_${e.id}`,minWidth:240})),{slug:Kh.TeamCode,name:this.t("code_quipe_14296"),isSearchable:!0,isSortable:!0,sortAttribute:Mt.TeamCode,minWidth:180},{slug:Kh.TeamMembers,name:this.t("membres_de_l_q_00891"),minWidth:240}]}getPositionsColumns(){return[{slug:Kh.NumberOfAssignments,name:this.t("nombre_d_affect_31455"),width:240},{slug:Kh.NumberOfAssignmentsDays,name:this.t("nombre_de_jours_86280"),width:240},{slug:Kh.NumberOfAvailableDays,name:this.t("nombre_de_jours_07962"),width:240},{slug:Kh.Positions,name:this.t("missions_affect_97811"),minWidth:320},{slug:Kh.PositionsCategories,name:this.t("cat_gories_de_m_93035"),minWidth:320},{slug:Kh.VolunteerMinutes,name:this.t("nombre_de_minut_50497"),width:240},{slug:Kh.VolunteerRegistrationState,name:this.t("status_d_affect_75769"),isSortable:!0,sortAttribute:Mt.State,width:240},{slug:Kh.WishedPositions,name:this.t("missions_souhai_23225"),minWidth:320},{slug:Kh.PreassignedPositions,name:this.t("missions_pr_af_02950"),minWidth:320},{slug:Kh.PreassignedPositionsCategories,name:this.t("cat_gories_pr_83825"),minWidth:320},{slug:Kh.CheckedInPositions,name:this.t("missions_point_05292"),minWidth:320}]}getAccreditationsColumns(){return(0,Za.A)([{slug:Kh.Accreditations,name:this.t("accr_ditations_33155"),minWidth:320},{slug:Kh.AccreditationsCategories,name:this.t("cat_gories_d_ac_37678"),minWidth:320},{slug:Kh.AccreditationState,name:this.t("statut_d_accr_d_75527"),isSortable:!0,sortAttribute:Mt.AccreditationState,width:240},{slug:Kh.NumberOfAccreditations,name:this.t("nombre_d_accr_d_02452"),width:240},{slug:Kh.WishedAccreditationSlots,name:this.t("accr_ditations_74375"),minWidth:320},{slug:Kh.ScannedAccreditations,name:this.t("accr_ditations_52153"),minWidth:320}])}getWeezeventColumns(){return[{slug:Kh.WeezeventBarcodeId,name:this.t("TicketId"),isSearchable:!0,minWidth:240},{slug:Kh.WeezeventShortTag,name:this.t("puce_50504"),isSearchable:!0,minWidth:180},{slug:Kh.WeezeventPairedAt,name:this.t("appair_le_70213"),minWidth:180},{slug:Kh.WeezaccessChecklists,name:this.t("listes_de_contr_55120"),minWidth:320}]}getDelegationsColumns(e){return(0,Za.A)([{slug:Kh.Delegations,name:this.t("Delegation"),isSearchable:!0,isSortable:!0,sortAttribute:Mt.Delegation,minWidth:240},{slug:Kh.DelegationCategory,name:this.t("cat_gorie_de_d_18027"),minWidth:240},Lh(e)?{slug:Kh.DelegationBannerNumber,name:this.t("num_ro_de_bande_16203"),isSearchable:!0,width:100}:null])}getBaseFilters(e){return[{slug:"email",name:this.t("Email"),category:this.t("champs_de_formu_64126"),fieldType:He.Text,hideEmpty:!0},{slug:"insertedAt",name:this.t("date_d_inscript_31369"),category:this.t("champs_de_formu_64126"),fieldType:He.Date,hideEmpty:!0},{slug:Kh.LocalId,name:this.t("id_sur_l_v_nem_01171"),category:this.t("champs_de_formu_64126"),fieldType:He.Number,hideEmpty:!0},{slug:Kh.DuplicatedFrom,name:this.t("est_dupliqu_62764"),category:this.t("champs_de_formu_64126"),fieldType:He.Checkbox,hideEmpty:!0},...this.customFieldsToFilters(e)]}getAvailabilitiesFilters(e,t){return[{slug:"numberOfAvailableDays",name:this.t("nombre_de_jours_07962"),category:this.t("disponibilit_s_49923"),fieldType:He.Number,hideEmpty:!0},{slug:"wishedSlots",name:this.t("disponibilit_s_49923"),category:this.t("disponibilit_s_49923"),fieldType:He.DateTimeRange,startAt:t.startAt,endAt:t.endAt},{slug:"wishedSlotsCustom",name:this.t("disponibilit_s_26280"),category:this.t("disponibilit_s_49923"),fieldType:He.Select,hideEmpty:!0,needLoading:!0,eventId:e},{slug:"numberOfWishedSlots",name:this.t("nombre_de_dispo_26405"),category:this.t("disponibilit_s_49923"),fieldType:He.Number,hideEmpty:!0}]}getPositionsFilters(e,t,n){return[{slug:"volunteerRegistrationState",name:this.t("statut_d_affect_57444"),category:this.t("missions_63972"),fieldType:He.Select,values:Mn.map(e=>({id:e,name:e})),hideEmpty:!0},{slug:"position",name:this.t("missions_affect_97811"),category:this.t("missions_63972"),fieldType:He.Select,hideEmpty:!0,needLoading:!0,eventId:t},{slug:"hasOtherEventPosition",name:this.t("has_shift_on_ot_92375"),category:this.t("missions_63972"),fieldType:He.Select,hideEmpty:!0,needLoading:!0,organizationId:e,eventId:t},{slug:"positionSlotId",name:this.t("cr_neau_affect_50400_plural"),category:this.t("missions_63972"),fieldType:He.Select,hideEmpty:!0,needLoading:!0,eventId:t},{slug:"positionSlot",name:this.t("date_d_affectat_98566"),category:this.t("missions_63972"),fieldType:He.DateTimeRange,startAt:n.startAt,endAt:n.endAt},{slug:"positionCategory",name:this.t("cat_gories_de_m_93035"),category:this.t("missions_63972"),fieldType:He.Select,hideEmpty:!0,needLoading:!0,eventId:t},{slug:"numberOfAssignments",name:this.t("nombre_d_affect_31455"),category:this.t("missions_63972"),fieldType:He.Number,hideEmpty:!0},{slug:"numberOfAssignmentsPerDay",name:this.t("nombre_d_affect_22087"),category:this.t("missions_63972"),fieldType:He.Number,hideEmpty:!0,startAt:n.startAt,endAt:n.endAt},{slug:"numberOfAssignmentsDays",name:this.t("nombre_de_jours_86280"),category:this.t("missions_63972"),fieldType:He.Number,hideEmpty:!0,startAt:n.startAt,endAt:n.endAt},{slug:"preassignedPosition",name:this.t("missions_pr_af_02950"),category:this.t("missions_63972"),fieldType:He.Select,hideEmpty:!0,needLoading:!0,eventId:t},{slug:"preassignedPositionCategory",name:this.t("cat_gories_pr_83825"),category:this.t("missions_63972"),fieldType:He.Select,hideEmpty:!0,needLoading:!0,eventId:t},{slug:"wishedPositionsCategories",name:this.t("cat_gories_souh_80851"),category:this.t("missions_63972"),fieldType:He.Select,needLoading:!0,eventId:t},{slug:"numberOfWishedPositionsCategories",name:this.t("nombre_de_cat_g_05961"),category:this.t("missions_63972"),fieldType:He.Number,hideEmpty:!0},{slug:"wishedPositions",name:this.t("missions_souhai_23225"),category:this.t("missions_63972"),fieldType:He.Select,needLoading:!0,eventId:t},{slug:"numberOfWishedPositions",name:this.t("nombre_de_missi_52579"),category:this.t("missions_63972"),fieldType:He.Number,hideEmpty:!0},{slug:"wishedPositionsSlots",name:this.t("cr_neaux_souhai_90108"),category:this.t("missions_63972"),fieldType:He.Select,needLoading:!0,eventId:t},{slug:"numberOfWishedPositionsSlots",name:this.t("nombre_de_cr_ne_28370"),category:this.t("missions_63972"),fieldType:He.Number,hideEmpty:!0},{slug:"volunteersMinutes",name:this.t("nombre_de_minut_50497"),category:this.t("missions_63972"),fieldType:He.Number,hideEmpty:!0},{slug:"volunteersMinutesDays",name:this.t("nombre_de_minut_89574"),category:this.t("missions_63972"),fieldType:He.Number,hideEmpty:!0,startAt:n.startAt,endAt:n.endAt},{slug:"checkInAt",name:this.t("point_le_93167"),category:this.t("missions_63972"),fieldType:He.Datetime,useLocalZone:!0},{slug:"checkOutAt",name:this.t("d_point_le_29289"),category:this.t("missions_63972"),fieldType:He.Datetime,useLocalZone:!0},{slug:"checkInState",name:this.t("statut_de_point_44328"),category:this.t("missions_63972"),fieldType:He.Select,values:nn.map(e=>({id:e,name:this.t(e)})),hideEmpty:!0},{slug:"checkInAtPositionSlot",name:this.t("cr_neaux_point_71408"),category:this.t("missions_63972"),fieldType:He.Select,hideEmpty:!0,needLoading:!0,eventId:t},{slug:"checkOutAtPositionSlot",name:this.t("cr_neaux_d_poin_45477"),category:this.t("missions_63972"),fieldType:He.Select,hideEmpty:!0,needLoading:!0,eventId:t},{slug:"overlappingAssignments",name:this.t("affectations_se_49339"),category:this.t("missions_63972"),fieldType:He.Checkbox,hideEmpty:!0}]}getAccreditationsFilters(e,t,n){return(0,Za.A)([{slug:"accreditationState",name:this.t("statut_d_accr_d_75527"),category:this.t("accr_ditations_39450"),fieldType:He.Select,values:Jt.map(e=>({id:e,name:e})),hideEmpty:!0},{slug:"numberOfAccreditations",name:this.t("nombre_d_accr_d_02452"),category:this.t("accr_ditations_39450"),fieldType:He.Number,hideEmpty:!0},{slug:"accreditation",name:this.t("accr_ditations_33155"),category:this.t("accr_ditations_39450"),fieldType:He.Select,hideEmpty:!0,needLoading:!0,eventId:t},{slug:"hasOtherEventAccreditation",name:this.t("has_accreditati_31831"),category:this.t("accr_ditations_39450"),fieldType:He.Select,hideEmpty:!0,needLoading:!0,organizationId:e,eventId:t},{slug:"accreditationCategory",name:this.t("cat_gories_d_ac_37678"),category:this.t("accr_ditations_39450"),fieldType:He.Select,hideEmpty:!0,needLoading:!0,eventId:t},{slug:"wishedAccreditationsSlots",name:this.t("accr_ditations_74375"),category:this.t("accr_ditations_39450"),fieldType:He.Select,needLoading:!0,eventId:t},{slug:"numberOfWishedAccreditationsSlots",name:this.t("nombre_d_accr_d_92021"),category:this.t("accr_ditations_39450"),fieldType:He.Number,hideEmpty:!0},{slug:"accreditationSlotId",name:this.t("cr_neaux_accr_d_70934"),category:this.t("accr_ditations_39450"),fieldType:He.Select,hideEmpty:!0,needLoading:!0,eventId:t},{slug:"accreditationSlot",name:this.t("date_d_accr_dit_26214"),category:this.t("accr_ditations_39450"),fieldType:He.Date,startAt:n.startAt,endAt:n.endAt},{slug:"scannedAccreditationsSlots",name:this.t("accr_ditations_52153"),category:this.t("accr_ditations_39450"),fieldType:He.Select,hideEmpty:!0,needLoading:!0,eventId:t}])}getDelegationsFilters(e,t){return[{slug:"delegation",name:this.t("inscrit_via_la_86398"),category:this.t("d_l_gations_78318"),fieldType:He.Select,needLoading:!0,eventId:t},{slug:"delegationCategory",name:this.t("inscrit_via_la_12241"),category:this.t("d_l_gations_78318"),fieldType:He.Select,needLoading:!0,organizationId:e,eventId:t},{slug:"isDelegationCategoryLeader",name:this.t("est_responsable_36610"),category:this.t("d_l_gations_78318"),fieldType:He.Checkbox},{slug:"isDelegationLeader",name:this.t("est_responsable_87662"),category:this.t("d_l_gations_78318"),fieldType:He.Checkbox,needLoading:!0,eventId:t}]}getSegmentsFilters(e,t,n,i){return[{slug:"segments",name:this.t("fait_partie_de_44650"),category:this.t("vues_personnali_80652"),fieldType:He.Select,values:i.segmentsFolders.flatMap(e=>e.segments).filter(e=>e.id!==n),hideEmpty:!0},{slug:"usersSegments",name:this.t("fait_partie_de_44893"),category:this.t("vues_personnali_80652"),fieldType:He.Select,hideEmpty:!0,needLoading:!0,organizationId:e},{slug:"positionsSegments",name:this.t("affecter_une_10657"),category:this.t("vues_personnali_80652"),fieldType:He.Select,hideEmpty:!0,needLoading:!0,eventId:t},{slug:"accreditationsSegments",name:this.t("affecter_une_91431"),category:this.t("vues_personnali_80652"),fieldType:He.Select,hideEmpty:!0,needLoading:!0,eventId:t},{slug:"delegationsSegments",name:this.t("affecter_une_45240"),category:this.t("vues_personnali_80652"),fieldType:He.Select,hideEmpty:!0,needLoading:!0,eventId:t}]}getFormsFilters(e){return[{slug:"forms",name:this.t("formulaires_rem_62495"),category:this.t("Form_plural"),fieldType:He.Select,needLoading:!0,eventId:e},{slug:"formsInsertedAt",name:this.t("dates_de_rempli_65075"),category:this.t("Form_plural"),fieldType:He.Date,hideEmpty:!0,needLoading:!0,eventId:e}]}getTeamsFilters(){return[{slug:"isTeam",name:this.t("est_inscrit_en_86193"),category:this.t("_quipes_18817"),fieldType:He.Checkbox,hideEmpty:!0},{slug:"teamCode",name:this.t("code_quipe_14296"),category:this.t("_quipes_18817"),fieldType:He.Text},{slug:"numberOfTeamMembers",name:this.t("nombre_de_membr_82302"),category:this.t("_quipes_18817"),fieldType:He.Number,hideEmpty:!0},{slug:"isTeamLeader",name:this.t("est_chef_d_qui_73792"),category:this.t("_quipes_18817"),fieldType:He.Checkbox,hideEmpty:!0}]}getWeezeventFilters(e){return[{slug:Kh.WeezeventBarcodeId,name:this.t("TicketId"),category:"Weezevent",fieldType:He.Text,hideEmpty:!0},{slug:Kh.WeezeventShortTag,name:this.t("puce_50504"),category:"Weezevent",fieldType:He.Text},{slug:Kh.WeezeventPairedAt,name:this.t("appair_le_70213"),category:"Weezevent",fieldType:He.Datetime,useLocalZone:!0},{slug:Kh.WeezaccessChecklists,name:this.t("listes_de_contr_55120"),category:"Weezevent",fieldType:He.Select,needLoading:!0,eventId:e}]}getEmailsFilters(e,t){return(0,Za.A)([t?{slug:"campaign",name:this.t("campagne_97871"),category:this.t("e_mails_09850"),fieldType:He.Campaign,needLoading:!0,eventId:e}:null,{slug:"assignmentEmailSentAt",name:this.t("date_d_envoi_de_01614"),category:this.t("e_mails_09850"),fieldType:He.Date},{slug:"assignmentEmailState",name:this.t("statut_de_de_l_36346"),category:this.t("e_mails_09850"),fieldType:He.Select,values:cn.filter(e=>e!==Oe.Queued).map(e=>({id:e,name:this.t(e)})),hideEmpty:!0},{slug:"accreditationEmailState",name:this.t("statut_de_l_e_m_97776"),category:this.t("e_mails_09850"),fieldType:He.Select,values:cn.filter(e=>e!==Oe.Queued).map(e=>({id:e,name:this.t(e)})),hideEmpty:!0},{slug:"emailBlacklist",name:this.t("ne_souhaite_plu_08853"),category:this.t("e_mails_09850"),fieldType:He.Checkbox,hideEmpty:!0},t?{slug:"campaignReply",name:this.t("r_ponse_une_c_32448"),category:this.t("e_mails_09850"),fieldType:He.Text,needLoading:!0,eventId:e}:null])}getCommentsFilter(e,t){return[{slug:"comments",name:this.t("commentaires_96492"),category:this.t("commentaires_96492"),fieldType:He.Text},{slug:"lastCommentAt",name:this.t("date_du_dernier_73554"),category:this.t("commentaires_96492"),fieldType:He.Date,hideEmpty:!0},{slug:"commentWrittenBy",name:this.t("commentaire_cr_96610"),category:this.t("commentaires_96492"),fieldType:He.Select,hideEmpty:!0,needLoading:!0,organizationId:e,eventId:t}]}};function Xh(e,t,n,i,s){const o=t.diff(e,"days").days;return(0,Dc.A)(0,o+1).map(t=>e.plus({days:t}).set({hour:s})).filter(e=>i===ft.AllDays||n.some(t=>t.contains(e)||t.start.startOf("day").equals(e)||t.end.startOf("day").equals(e)))}function Jh(e,t,n,i,s){const o=t.diff(e,"days").days;return(0,Dc.A)(0,o+1).flatMap(t=>{const i=e.plus({days:t});return n.map(e=>{const[t,n]=e.startTime.split(":").map(e=>parseInt(e,10)),[s,o]=e.endTime.split(":").map(e=>parseInt(e,10)),r=i.set({hour:t,minute:n});let a=i.set({hour:s,minute:o});return(ss===ft.AllDays||i.some(t=>t.overlaps(e.interval)))}function Qh(e,t){return m(e)?`${e} (${t.toFormat("HH:mm")})`:t.toFormat("HH:mm")}function em(e,t,n){const i=e.filter(e=>!t.equals(Zs(e)));return i.length===e.length&&n?[...e,Js(t)]:i.length===e.length||n?e:i}Zh=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[hu,Jc,qn])],Zh);const tm=(e,t)=>(0,uc.A)(Object.values((0,cc.A)(t,e=>e.position.name)).map(t=>({name:t[0].position.name,values:(0,uc.A)(t.map(t=>({id:t.id,name:Ch(e,t,t.position.name,{position:{includeNameAtEnd:!0}}),startTime:t.range.start.toMillis()})),({startTime:e})=>e)})),({name:e})=>e),nm=(e,t)=>(0,uc.A)(Object.values((0,cc.A)(t,e=>e.accreditation.name)).map(t=>({name:t[0].accreditation.name,values:(0,uc.A)(t.map(t=>({id:t.id,name:Dh(e,t,t.accreditation.name,{accreditation:{includeNameAtEnd:!0}})})),e=>e.name)})),({name:e})=>e),im=async(e,t,n)=>{const i=await Y();if("createdBy"===n.slug&&n.organizationId){const{organization:e}=await function(e,t){return go("query Admins($organizationId: OrganizationId!, $eventId: EventId) {\n organization(id: $organizationId) {\n usersInfos(eventId: $eventId, roleTypes: [OrganizationAdmin, EventAdmin]) {\n nodes {\n userId\n email\n name\n }\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({organizationId:n.organizationId,eventId:n.eventId},i);n.values=e.usersInfos.nodes.map(({userId:e,email:t,name:n})=>({id:e,name:`${m(n)?n:"-"} - ${t}`})),n.needLoading=!1}else if("categoryLeaders"===n.slug&&n.organizationId){const{organization:e}=await function(e,t){return go('query DelegationsSegmentsCategoryLeaders($organizationId: OrganizationId!, $eventId: EventId) {\n organization(id: $organizationId) {\n usersInfos(\n eventId: $eventId\n isDelegationCategoryLeader: true\n sort: { attribute: "Name", direction: Asc }\n ) {\n nodes {\n id\n name\n }\n }\n }\n}\n',{variables:e,token:t||void 0,fragments:[]})}({organizationId:n.organizationId,eventId:n.eventId},i);n.values=e.usersInfos.nodes,n.needLoading=!1}else if("leaders"===n.slug&&n.organizationId){const{organization:e}=await function(e,t){return go('query DelegationsSegmentsLeaders($organizationId: OrganizationId!, $eventId: EventId) {\n organization(id: $organizationId) {\n usersInfos(\n eventId: $eventId\n isDelegationLeader: true\n sort: { attribute: "Name", direction: Asc }\n ) {\n nodes {\n id\n name\n }\n }\n }\n}\n',{variables:e,token:t||void 0,fragments:[]})}({organizationId:n.organizationId,eventId:n.eventId},i);n.values=e.usersInfos.nodes,n.needLoading=!1}else if("delegationCategory"===n.slug&&n.organizationId){const{organization:e}=await function(e,t){return go("query VolunteersSegmentsDelegationsCategories(\n $organizationId: OrganizationId!\n $level: OrganizationEventLevel!\n $eventId: EventId\n) {\n organization(id: $organizationId) {\n delegationsCategories(level: $level, eventId: $eventId) {\n nodes {\n id\n name\n }\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({organizationId:n.organizationId,level:n.eventId?ot.Event:ot.Organization,eventId:n.eventId},i);n.values=(0,uc.A)(e.delegationsCategories.nodes,e=>e.name.toLowerCase()),n.needLoading=!1}else if("tag"===n.slug&&n.organizationId){const{organization:e}=await Uo({organizationId:n.organizationId,eventId:n.eventId,context:n.tagContext},i);n.values=(0,uc.A)(e.tags.nodes,e=>e.name.toLowerCase()),n.needLoading=!1}else if(n.eventId){if(["preassignedPosition","position","wishedPositions"].includes(n.slug)){const{event:e}=await function(e,t){return go("query VolunteersSegmentsPositions($eventId: EventId!) {\n event(id: $eventId) {\n positions {\n nodes {\n id\n name\n positionCategoryName\n }\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({eventId:n.eventId},i);n.valuesGroups=(0,uc.A)(Object.entries((0,cc.A)(e.positions.nodes,e=>e.positionCategoryName)).map(([e,t])=>({name:t[0].positionCategoryName,values:(0,uc.A)(t,e=>e.name.toLowerCase())})),({name:e})=>e.toLowerCase()),n.needLoading=!1}else if("hasOtherEventPosition"===n.slug&&n.organizationId){const{organization:{positions:e}}=await function(e,t){return go("query VolunteersSegmentsOtherPositions($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n positions(excludedEventId: $eventId) {\n nodes {\n id\n name\n positionCategoryName\n event {\n id\n name\n }\n }\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({organizationId:n.organizationId,eventId:n.eventId},i);n.valuesGroups=(0,uc.A)(Object.entries((0,cc.A)(e.nodes,e=>e.positionCategoryName)).map(([e,t])=>({name:`${t[0].event.name}: ${t[0].positionCategoryName}`,values:(0,uc.A)(t,e=>e.name.toLowerCase())})),({name:e})=>e.toLowerCase()),n.needLoading=!1}else if(["positionSlotId","wishedPositionsSlots","checkInAtPositionSlot","checkOutAtPositionSlot"].includes(n.slug)){const{event:e}=await function(e,t){return go("query VolunteersSegmentsPositionsSlots($eventId: EventId!) {\n event(id: $eventId) {\n positionsSlots {\n nodes {\n id\n name\n range\n\n position {\n name\n }\n }\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({eventId:n.eventId},i);n.valuesGroups=tm(t,e.positionsSlots.nodes),n.needLoading=!1}else if(["positionCategory","preassignedPositionCategory","wishedPositionsCategories"].includes(n.slug)){const{event:e}=await function(e,t){return go("query VolunteersSegmentsPositionsCategories($eventId: EventId!) {\n event(id: $eventId) {\n positionsCategories {\n id\n name\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({eventId:n.eventId},i);n.values=(0,uc.A)(e.positionsCategories,e=>e.name.toLowerCase()),n.needLoading=!1}else if("wishedSlotsCustom"===n.slug){const{event:t}=await function(e,t){return go("query VolunteeersSegmentsCustomSlotsPeriods($eventId: EventId!) {\n event(id: $eventId) {\n startAt\n endAt\n ranges\n\n customSlotsPeriods {\n name\n startDate\n endDate\n\n customSlots {\n name\n startTime\n endTime\n }\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({eventId:n.eventId},i);n.valuesGroups=((e,t)=>{const n=t.customSlotsPeriods.flatMap(e=>Jh(e.startDate??t.startAt,e.endDate??t.endAt,e.customSlots,t.ranges,ft.AllDays));return(0,uc.A)(Object.values((0,cc.A)(n,({interval:e})=>e.start.startOf("day").toMillis())),e=>e[0].interval.start.startOf("day").toMillis()).map(t=>{const n=t[0].interval;return{name:e.toLocaleString(n.start.startOf("day"),eo.DateOnly.WeekdayLongMonthLong),values:t.map(({name:e,interval:t})=>({id:t.toISO(),name:Qh(e,t)}))}})})(e,t),n.needLoading=!1}else if("accreditation"===n.slug){const{event:e}=await function(e,t){return go("query VolunteersSegmentsAccreditations($eventId: EventId!) {\n event(id: $eventId) {\n accreditations {\n nodes {\n id\n name\n accreditationCategoryName\n }\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({eventId:n.eventId},i);n.valuesGroups=(0,uc.A)(Object.entries((0,cc.A)(e.accreditations.nodes,e=>e.accreditationCategoryName)).map(([e,t])=>({name:t[0].accreditationCategoryName,values:(0,uc.A)(t,e=>e.name.toLowerCase())})),({name:e})=>e.toLowerCase()),n.needLoading=!1}else if("hasOtherEventAccreditation"===n.slug&&n.organizationId){const{organization:{accreditations:e}}=await function(e,t){return go("query VolunteersSegmentsOtherAccreditations($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n accreditations(excludedEventId: $eventId) {\n nodes {\n id\n name\n accreditationCategoryName\n event {\n id\n name\n }\n }\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({organizationId:n.organizationId,eventId:n.eventId},i);n.valuesGroups=(0,uc.A)(Object.entries((0,cc.A)(e.nodes,e=>e.accreditationCategoryName)).map(([e,t])=>({name:`${t[0].event.name}: ${t[0].accreditationCategoryName}`,values:(0,uc.A)(t,e=>e.name.toLowerCase())})),({name:e})=>e.toLowerCase()),n.needLoading=!1}else if("accreditationCategory"===n.slug){const{event:e}=await function(e,t){return go("query VolunteersSegmentsAccreditationsCategories($eventId: EventId!) {\n event(id: $eventId) {\n accreditationsCategories {\n id\n name\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({eventId:n.eventId},i);n.values=(0,uc.A)(e.accreditationsCategories,e=>e.name.toLowerCase()),n.needLoading=!1}else if("positionsSegments"===n.slug){const{event:e}=await function(e,t){return go("query VolunteersSegmentsPositionsSegments($eventId: EventId!) {\n event(id: $eventId) {\n segmentsFolders(segmentType: Positions) {\n id\n name\n index\n\n segments {\n id\n name\n index\n }\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({eventId:n.eventId},i);n.valuesGroups=(0,uc.A)(e.segmentsFolders,e=>e.index).map(e=>({name:e.name,values:(0,uc.A)(e.segments,e=>e.index)})),n.needLoading=!1}else if("accreditationsSegments"===n.slug){const{event:e}=await function(e,t){return go("query VolunteersSegmentsAccreditationsSegments($eventId: EventId!) {\n event(id: $eventId) {\n segmentsFolders(segmentType: Accreditations) {\n id\n name\n index\n\n segments {\n id\n name\n index\n }\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({eventId:n.eventId},i);n.valuesGroups=(0,uc.A)(e.segmentsFolders,e=>e.index).map(e=>({name:e.name,values:(0,uc.A)(e.segments,e=>e.index)})),n.needLoading=!1}else if("delegationsSegments"===n.slug||"isDelegationLeader"===n.slug){const{event:e}=await function(e,t){return go("query VolunteersSegmentsDelegationsSegments($eventId: EventId!) {\n event(id: $eventId) {\n segmentsFolders(segmentType: Delegations) {\n id\n name\n index\n\n segments {\n id\n name\n index\n }\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({eventId:n.eventId},i);n.valuesGroups=(0,uc.A)(e.segmentsFolders,e=>e.index).map(e=>({name:e.name,values:(0,uc.A)(e.segments,e=>e.index)})),n.needLoading=!1}else if("forms"===n.slug||"form"===n.slug||"formsInsertedAt"===n.slug){const{event:e}=await function(e,t){return go("query VolunteersSegmentsForms($eventId: EventId!) {\n event(id: $eventId) {\n forms {\n nodes {\n ...SegmentForm\n }\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[Vs.SegmentFormFragment]})}({eventId:n.eventId},i);n.values=(0,uc.A)(e.forms.nodes,e=>e.name.toLowerCase()),n.needLoading=!1}else if("campaign"===n.slug||"campaignReply"===n.slug){const{event:e}=await function(e,t){return go("query VolunteersSegmentsCampaigns($eventId: EventId!) {\n event(id: $eventId) {\n campaigns(states: [Done, Scheduled, Template]) {\n nodes {\n ...SegmentCampaign\n }\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[Vs.SegmentCampaignFragment]})}({eventId:n.eventId},i);n.campaigns=(0,uc.A)(e.campaigns.nodes,e=>e.name.toLowerCase()),n.needLoading=!1}else if("delegation"===n.slug){const{event:e}=await function(e,t){return go("query VolunteersSegmentsDelegations($eventId: EventId!) {\n event(id: $eventId) {\n delegations {\n nodes {\n id\n name\n }\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({eventId:n.eventId},i);n.values=(0,uc.A)(e.delegations.nodes,e=>e.name.toLowerCase()),n.needLoading=!1}else if(["accreditationSlotId","scannedAccreditationsSlots","wishedAccreditationsSlots"].includes(n.slug)){const{event:t}=await function(e,t){return go("query VolunteersSegmentsAccreditationsSlots($eventId: EventId!) {\n event(id: $eventId) {\n accreditationsSlots(includeHidden: true) {\n nodes {\n id\n name\n date\n\n accreditation {\n name\n }\n }\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({eventId:n.eventId},i);n.valuesGroups=nm(e,t.accreditationsSlots.nodes),n.needLoading=!1}else if(n.slug===Kh.WeezaccessChecklists){const{event:e}=await function(e,t){return go("query VolunteersWeezaccessChecklists($eventId: EventId!) {\n event(id: $eventId) {\n weezaccessChecklists {\n id\n name\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({eventId:n.eventId},i);n.values=(0,uc.A)(e.weezaccessChecklists,e=>e.name.toLowerCase()),n.needLoading=!1}else if("commentWrittenBy"===n.slug){const{organization:e}=await function(e,t){return go("query VolunteersSegmentsLoaders($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n admins: usersInfos(roleTypes: [OrganizationAdmin, EventAdmin]) {\n nodes {\n id\n nameOrEmail\n }\n }\n\n usersInfos(eventId: $eventId, hasRole: true) {\n nodes {\n id\n nameOrEmail\n }\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({organizationId:n.organizationId,eventId:n.eventId},i);n.values=(0,uc.A)((0,xh.A)(e.admins.nodes.concat(e.usersInfos.nodes),e=>e.id),e=>e.nameOrEmail.toLowerCase()).map(({id:e,nameOrEmail:t})=>({id:e,name:t})),n.needLoading=!1}}else if(n.organizationId)if("event"===n.slug){const{organization:e}=await function(e,t){return go("query UsersSegmentsEvents($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n events {\n nodes {\n ...SegmentEvent\n }\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[Vs.SegmentEventFragment]})}({organizationId:n.organizationId},i);n.values=(0,uc.A)(e.events.nodes,e=>e.name.toLowerCase()),n.needLoading=!1}else if("forms"===n.slug||"formsInsertedAt"===n.slug){const{organization:e}=await function(e,t){return go("query UsersSegmentsForms($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n forms(level: Organization) {\n nodes {\n ...SegmentForm\n }\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[Vs.SegmentFormFragment]})}({organizationId:n.organizationId},i);n.values=(0,uc.A)(e.forms.nodes,e=>e.name.toLowerCase()),n.needLoading=!1}else if("campaign"===n.slug){const{organization:e}=await function(e,t){return go("query UsersSegmentsCampaigns($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n campaigns(level: Organization, states: [Done, Scheduled, Template]) {\n nodes {\n ...SegmentCampaign\n }\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[Vs.SegmentCampaignFragment]})}({organizationId:n.organizationId},i);n.campaigns=(0,uc.A)(e.campaigns.nodes,e=>e.name.toLowerCase()),n.needLoading=!1}else if("positionCustomField"===n.slug||"accreditationCustomField"===n.slug){const{organization:e}=await function(e,t){return go("query ConditionsCustomFields($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n customFields(variety: UserInfo, privacy: All, fieldTypes: [Checkbox, Select]) {\n nodes {\n id\n name\n }\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({organizationId:n.organizationId},i);n.values=(0,uc.A)(e.customFields.nodes,e=>e.name.toLowerCase()),n.needLoading=!1}else if("delegation"===n.slug){const{organization:e}=await function(e,t){return go("query UsersSegmentsDelegations($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n name\n\n delegations(level: Both) {\n nodes {\n id\n name\n\n event {\n id\n name\n }\n }\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({organizationId:n.organizationId},i);n.valuesGroups=(0,uc.A)(Object.entries((0,cc.A)(e.delegations.nodes,e=>e.event?.id||-1)).map(([t,n])=>({name:n[0].event?.name??e.name,values:(0,uc.A)(n,e=>e.name.toLowerCase())})),({name:e})=>e.toLowerCase()),n.needLoading=!1}else if("usersSegments"===n.slug){const{organization:e}=await function(e,t){return go("query VolunteersSegmentsUsersSegments($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n segmentsFolders(level: Organization, segmentType: Volunteers) {\n id\n name\n index\n\n segments {\n id\n name\n index\n }\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({organizationId:n.organizationId},i);n.valuesGroups=(0,uc.A)(e.segmentsFolders,e=>e.index).map(e=>({name:e.name,values:(0,uc.A)(e.segments,e=>e.index)})),n.needLoading=!1}};function sm(e){const t=Zn(Jc),n=Zn(ph),[i,s]=(0,L.useState)(!1);return(0,L.useEffect)(()=>{const i=e.filter(({filter:e})=>e.needLoading);so(i)&&(s(!0),Promise.all(i.map(({filter:e})=>im(t,n,e))).then(()=>{s(!1)}))},[e]),i}const om=e=>{const t=Xn(),n=e.filterPredicate.filter.slug,s=e.filterPredicate.filter.fieldType,o=function(e){const t=Zn(Jc),n=Zn(ph),[i,s]=(0,L.useState)(!1);return(0,L.useEffect)(()=>{e.needLoading&&(s(!0),im(t,n,e).then(()=>{s(!1)}))},[e.needLoading]),i}(e.filterPredicate.filter);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ba,{align:"center",css:{color:"$gray500",cursor:"pointer",fontSize:"$textXs",fontWeight:"$semiBold"},gap:"3",onClick:e.onBack,children:[(0,i.jsx)("i",{className:"fa-regular fa-arrow-left"}),t("retour_la_lis_63860")]}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(Ar,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:e.filterPredicate.filter.name}),(0,i.jsx)(Ya,{height:"3"}),o?(0,i.jsx)(wl,{}):"condition"===n?(0,i.jsx)(Pu,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):"isLeader"===n||"isPositionLeader"===n||"isPositionCategoryLeader"===n||"isDelegationLeader"===n?(0,i.jsx)(Ku,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):"isAdmin"===n?(0,i.jsx)(qu,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):"privacy"===n?(0,i.jsx)(th,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):"isTeam"===n?(0,i.jsx)(Yu,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):"wishedPositions"===n||"wishedPositionsCategories"===n?(0,i.jsx)(sh,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):"formsInsertedAt"===n?(0,i.jsx)(Hu,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):"numberOfAssignmentsPerDay"===n||"volunteersMinutesDays"===n?(0,i.jsx)(eh,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):"campaignReply"===n?(0,i.jsx)(zu,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):[He.Address,He.Text,He.Textarea].includes(s)?(0,i.jsx)(ih,{filterPredicate:e.filterPredicate,showIsValid:!1,onAdd:e.onAdd}):[He.Country,He.Language,He.Nationality,He.Select,He.Sex].includes(s)?(0,i.jsx)(nh,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):[He.Checkbox,He.Validation].includes(s)?(0,i.jsx)(Du,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):s===He.Phone?(0,i.jsx)(ih,{filterPredicate:e.filterPredicate,showIsValid:!0,onAdd:e.onAdd}):s===He.Number?(0,i.jsx)(Qu,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):s===He.DateTimeRange?(0,i.jsx)(Wu,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):s===He.Date?(0,i.jsx)(Bu,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):s===He.Datetime?(0,i.jsx)(Uu,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):s===He.File?(0,i.jsx)(Gu,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):s===He.Campaign?(0,i.jsx)(Tu,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):(0,i.jsx)("div",{children:"TODO"})]})};function rm(e){switch(e){case He.Address:return"map-location";case He.Text:case He.Textarea:return"text";case He.Checkbox:return"square-check";case He.Validation:return"check";case He.Select:return"list-ul";case He.Date:return"calendar";case He.Datetime:return"calendar-day";case He.Time:return"clock";case He.File:return"file";case He.Phone:return"phone";case He.Language:return"language";case He.Number:return"00";case He.Sex:return"venus-mars";case He.Nationality:case He.Country:return"flag";case He.DateTimeRange:return"calendar-range";case He.Campaign:return"paper-plane";default:return ll()}}const am=e=>{const t=(0,L.useMemo)(()=>(0,Bs.A)(e.filtersPredicates.map(({filter:e})=>e.category)),[e.filtersPredicates]),n=(0,L.useMemo)(()=>(0,cc.A)(e.filtersPredicates,({filter:e})=>e.category),[e.filtersPredicates]);return(0,i.jsx)(Ba,{css:{border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",px:"$4"},direction:"column",children:t.map((t,s)=>{const o=n[t];return(0,i.jsxs)(L.Fragment,{children:[!e.isEdit&&(0,i.jsxs)(i.Fragment,{children:[0!==s&&(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(Ar,{css:{paddingBottom:"$2",paddingTop:"$3"},font:"gray500 textXs semiBold",children:t})]}),o.map(t=>{const{filter:n}=t;return(0,i.jsxs)(Ba,{align:"center",css:{py:"$2"},gap:"3",children:[(0,i.jsx)(Ba,{align:"center",css:{borderRadius:"$1",height:"32px",width:"32px"},justify:"center",children:(0,i.jsx)(nl,{icon:rm(n.fieldType)})}),(0,i.jsxs)(Ba,{css:{flex:"1",overflow:"hidden"},direction:"column",gap:"1",children:[(0,i.jsx)(Ar,{color:"gray900",css:{ellipsis:!0},fontWeight:"medium",title:n.name,width:1,children:n.name}),m(n.label)&&(0,i.jsx)(Ar,{color:"gray500",css:{ellipsis:!0},title:n.label,width:1,children:n.label})]}),e.isEdit?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zl,{color:"white",leftIcon:"pen",size:"sm",onClick:()=>{e.onEdit(t)}}),(0,i.jsx)(zl,{color:"white",leftIcon:"trash-can",size:"sm",onClick:()=>{e.onDelete(n.slug)}})]}):(0,i.jsx)(zl,{color:"white",leftIcon:"plus",size:"sm",onClick:()=>{e.onAdd(t)}})]},n.slug)})]},s)})})},lm=e=>{const t=Xn(),[n,s]=(0,L.useState)(e.selectedFilterPredicate),[o,r]=(0,L.useState)((0,Eu.A)(e.predicates)),a=(0,L.useCallback)(e=>{r((0,xu.jM)(t=>{const n=t.findIndex(t=>t.slug===e.slug);-1===n?t.push(e):t[n]=e})),s(null)},[r,s]),l=(0,L.useCallback)(e=>{r((0,xu.jM)(t=>{const n=t.findIndex(t=>t.slug===e);t.splice(n,1)}))},[r]),[d,c]=(0,L.useState)(""),[u,h]=pu(o,e.possibleFilters,d);return(0,i.jsxs)(vu,{size:"sm",onClose:e.onClose,children:[(0,i.jsxs)(bu,{children:[(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(Ar,{color:"gray900",fontSize:"textXl",children:t("filtres_64574")}),m(e.subtitle)&&(0,i.jsx)(Ar,{color:"gray500",children:e.subtitle}),(0,i.jsx)(Ya,{height:"6"}),n?(0,i.jsx)(om,{filterPredicate:n,onAdd:a,onBack:()=>{s(null)}}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Bl,{placeholder:t("rechercher_un_f_22061"),value:d,onChange:c}),(0,i.jsx)(Ya,{height:"6"}),o.length>0&&u.length>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ar,{color:"gray900",fontSize:"textMd",fontWeight:"semiBold",children:t("liste_des_filtr_29511")}),(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(am,{filtersPredicates:u,isEdit:!0,onDelete:l,onEdit:e=>{s(e)}}),(0,i.jsx)(Ya,{height:"8"})]}),(0,i.jsx)(Ar,{color:"gray900",fontSize:"textMd",fontWeight:"semiBold",children:t("liste_des_filtr_37728")}),h.length>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(am,{filtersPredicates:h,isEdit:!1,onAdd:e=>{s(e)}})]})]}),(0,i.jsx)(Ya,{height:"6"})]}),null===n&&(0,i.jsx)(ju,{children:(0,i.jsxs)(Ba,{gap:"3",justify:"end",children:[(0,i.jsx)(zl,{onClick:()=>{e.onFilter(o),e.onClose()},children:e.buttonText||t("filtrer_78031")}),(0,i.jsx)(zl,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})})]})},dm=L.createContext({});function cm(){return L.useContext(dm)}const um=()=>{const e=Xn(),t=Zn(_u),{filtersPredicates:n,clearNameCursors:s,setPredicates:o,setIsFilterOpen:r,setSelectedFilterPredicate:a,predicates:l}=cm(),d=(0,L.useCallback)(()=>{s(),o([])},[s,o]),c=(0,L.useCallback)(e=>{a(e),r(!0)},[r,a]),u=(0,L.useCallback)(e=>{s(),o((0,hc.A)(l,e.predicate))},[l,s,o]);return sm(n),so(n)?(0,i.jsxs)(Ba,{align:"center",gap:"3",width:1,wrap:"wrap",children:[n.map((e,n)=>e.filter.needLoading?(0,i.jsx)(rc,{leftIcon:"loader"},n):(0,i.jsx)(rc,{cursor:"pointer",ellipsis:!0,rightIcon:"xmark",onContentClick:()=>{c(e)},onRightIconClick:()=>{u(e)},children:t.filterPredicateToText(e)},n)),(0,i.jsx)(Ar,{color:"gray700",css:{cursor:"pointer"},fontWeight:"medium",onClick:d,children:e("r_initialiser_l_66835")})]}):null};function hm(){return(0,L.useMemo)(()=>navigator.platform.toLowerCase().startsWith("mac"),[])}function mm(e,t){const n=hm(),i=(0,L.useCallback)(i=>{i.key===e&&(n&&i.metaKey||!n&&i.ctrlKey)&&t(i)},[e,t]);(0,L.useEffect)(()=>(document.addEventListener("keydown",i,!1),()=>{document.removeEventListener("keydown",i,!1)}),[e,t,i])}const gm=e=>{const{translate:t}=vl(),{columnsSearch:n,setColumnsSearch:s}=cm(),[o,r]=(0,L.useState)(""),a=(0,L.useMemo)(()=>m(o)?e.searchableColumns.filter(e=>e.name.toLowerCase().trim().includes(o.toLowerCase().trim())):e.searchableColumns,[e.searchableColumns,o]);return(0,i.jsxs)(Wd,{children:[(0,i.jsx)(Xd,{children:(0,i.jsx)(zl,{color:"white",css:{borderLeft:"none",borderBottomLeftRadius:"0",borderTopLeftRadius:"0"},leftIcon:"bars-filter"})}),(0,i.jsx)(Zd,{css:{padding:"0"},maxHeight:350,placement:"bottom-end",width:320,children:(0,i.jsxs)(Ba,{css:{padding:"$4 $6"},direction:"column",gap:"3",children:[(0,i.jsx)(Ar,{font:"gray800 textMd medium",children:t("rechercher_sur_85243")}),(0,i.jsx)(Bl,{icon:"magnifying-glass",placeholder:t("filtrer_78031"),state:"search",value:o,onChange:r}),(0,i.jsx)(Ba,{direction:"column",gap:"3",children:a.map(({slug:e,name:t})=>(0,i.jsx)(_c,{state:n.includes(e)?"checked":"unchecked",onClick:t=>{s(ro(n,e,"checked"===t))},children:t},e))})]})})]})},pm=()=>{const e=Xn(),{isEditMode:t,massActions:n,name:s,possibleColumns:o,possibleRenderings:r,reload:a,renderActions:l,rendering:d,setAreColumnsOpen:c,setIsEditMode:u,setIsFilterOpen:h,setName:m,setNameDebounced:g,setRendering:p,showEditColumns:f,showEditMode:_,showFilters:x,showMassActions:I,showSearchColumns:v,totalCount:b}=cm(),j=I&&n.numberOfSelected>0,C=(0,L.useMemo)(()=>(0,uc.A)(o.filter(e=>e.isSearchable),e=>e.name),[o]),y=(0,L.useMemo)(()=>v?{"& .h-styled-input-container":{borderBottomRightRadius:"0",borderTopRightRadius:"0"}}:{},[v]);return mm("e",(0,L.useCallback)(()=>{_&&u(!t)},[t,_,u])),(0,i.jsxs)(Ba,{align:"center",gap:"4",children:[(0,i.jsxs)(Ba,{width:320,children:[(0,i.jsx)(Bl,{css:y,icon:"magnifying-glass",placeholder:e("rechercher_50038"),value:s,onChange:e=>{m(e),g(e)}}),v&&(0,i.jsx)(gm,{searchableColumns:C})]}),j?(0,i.jsx)(Ba,{css:{flex:"1"},gap:"4",children:"function"==typeof l?l(n,b,a):null}):(0,i.jsxs)(Ba,{css:{flex:"1"},gap:"4",children:[x&&(0,i.jsx)(zl,{color:"gray",leftIcon:"bars-filter",onClick:()=>{h(!0)},children:e("filtres_64574")}),(0,i.jsx)(Ar,{css:{flex:"1"}}),so(r)&&(0,i.jsxs)(Wd,{children:[(0,i.jsx)(Xd,{children:(0,i.jsx)(zl,{color:"white",leftIcon:Hh(d),children:qh(e,d)})}),(0,i.jsx)(Zd,{placement:"bottom-end",children:r.map(t=>(0,i.jsx)(Kd,{icon:Hh(t),onClick:()=>p(t),children:qh(e,t)},t))})]}),f&&(0,i.jsx)(zl,{color:"white",leftIcon:"gear",onClick:()=>{c(!0)},children:e("_diter_les_colo_39630")}),_&&(0,i.jsx)(ku,{value:t,onChange:u,children:e("mode_dition_93778")})]})]})},fm=()=>(0,i.jsxs)(Ba,{css:{border:"1px solid $gray200",borderBottom:"none",borderTopLeftRadius:"$1",borderTopRightRadius:"$1",padding:"$3 $4"},direction:"column",gap:"4",width:1,children:[(0,i.jsx)(pm,{}),(0,i.jsx)(um,{})]}),_m=e=>{const{translate:t}=vl(),[n,s]=L.useState(e.predicates),[o,r]=L.useState(e.columns),[a,l]=L.useState(e.columnsSearch),[d,c]=L.useState(e.rendering),[u,h]=L.useState(e.name||""),[g,p]=L.useState(e.name||""),[f,_]=L.useState(e.limit),[x,I]=L.useState(e.sort),[v,b]=L.useState(0),j=Uc(e=>{p(e),C()}),C=L.useCallback(()=>{b(0)},[b]),y=L.useCallback(t=>{e.setName?.(t),h(t)},[e.setName,h]),k=L.useCallback(()=>{y(""),p(""),C()},[y,p,C]),A=L.useCallback(t=>{e.setPredicates?.(t),s(t)},[e.setPredicates,s]),w=L.useCallback(t=>{e.setColumns?.(t),r(t)},[e.setColumns,r]),S=L.useCallback(t=>{e.setColumnsSearch?.(t),l(t)},[e.setColumnsSearch,l]),E=L.useCallback(t=>{e.setRendering?.(t),c(t)},[e.setRendering,c]),T=L.useCallback(t=>{e.setLimit?.(t),_(t)},[e.setLimit,_]),z=L.useCallback(t=>{e.setSort?.(t),I(t),b(0)},[e.setSort,I,b]),O=L.useMemo(()=>JSON.stringify(e.predicates),[e.predicates]),R=L.useMemo(()=>JSON.stringify(e.columns),[e.columns]),$=L.useMemo(()=>JSON.stringify(e.columnsSearch),[e.columnsSearch]),D=L.useMemo(()=>JSON.stringify(e.rendering),[e.rendering]),P=L.useMemo(()=>JSON.stringify(e.sort),[e.sort]),F=L.useMemo(()=>JSON.stringify(n)!==O||JSON.stringify(o)!==R||JSON.stringify(a)!==$||JSON.stringify(d)!==D||JSON.stringify(x)!==P,[O,n,R,o,$,a,D,d,P,x]),M=L.useMemo(()=>e.columnsToIncludes?.(o,d)??{},[o,d,e.columnsToIncludes]),[N,B]=L.useState(null),[V,U]=L.useState(!1),W=L.useCallback(async()=>{U(!0);const t=await e.loadDataList({...M,...e.loadDataListParams||{},organizationId:e.organizationId||void 0,eventId:e.eventId||void 0,name:m(g)?g:null,columnsSearch:so(a)?a:null,predicates:n,limit:f,offset:v,sort:x},await Y());B(t.data),U(!1)},[a,M,f,g,v,n,U,B,x,e.organizationId,e.eventId,e.loadDataList,e.loadDataListParams]),[G,H]=L.useState([]),{numberOfPages:q,totalCount:K}=Su(N?.rows),[Z,X]=L.useState({}),J=L.useCallback(async t=>{X(e=>({...e,[t]:!0}));const n=(await e.loadRow({...M,...e.loadRowParams||{},organizationId:e.organizationId||void 0,eventId:e.eventId||void 0,id:t},await Y())).data.row;H(e=>e.map(e=>e.id===t?n:e)),X(e=>({...e,[t]:!1}))},[M,X,e.organizationId,e.eventId,e.loadRow,e.loadRowParams]),Q=L.useCallback(t=>e.getMassActionId?.(t)??t.id,[e.getMassActionId]),ee=wu({}),[te]=L.useMemo(()=>pu(n,e.filters),[n,e.filters]),[ne,ie]=L.useState(!1),[se,oe]=L.useState(!1),[re,ae]=L.useState(!1),[le,de]=L.useState(null);return L.useEffect(()=>{W()},[a,M,f,g,v,n,x,e.organizationId,e.eventId,e.loadDataList]),L.useEffect(()=>{H(N?.rows?.nodes??[])},[N]),L.useEffect(()=>{ee.setStates(Object.fromEntries(G.map(e=>[`r${Q(e)}`,{id:Q(e),state:"unchecked"}])))},[G,ee.setStates]),(0,i.jsxs)(dm.Provider,{value:{areColumnsOpen:re,clearNameCursors:k,columns:o,columnsSearch:a,data:G,filtersPredicates:te,getMassActionId:Q,idToLoading:Z,isEditMode:ne,isFilterOpen:se,isLoading:V,isSaveVisible:F,limit:f,loadDataResult:N,massActions:ee,name:u,nameDebounced:g,numberOfPages:q,offset:v,possibleColumns:e.possibleColumns,possibleRenderings:e.possibleRenderings,predicates:n,reload:W,reloadRow:J,renderActions:e.renderActions,rendering:d,selectedFilterPredicate:le,setAreColumnsOpen:ae,setColumns:w,setColumnsSearch:S,setIsEditMode:ie,setIsFilterOpen:oe,setLimit:T,setName:y,setNameDebounced:j,setOffset:b,setPredicates:A,setRendering:E,setSelectedFilterPredicate:de,setSort:z,showEditColumns:e.showEditColumns,showEditMode:e.showEditMode,showFilters:e.showFilters,showMassActions:e.showMassActions,showRowDropdown:e.showRowDropdown,showRowEdit:e.showRowEdit,showSearchColumns:e.showSearchColumns,sort:x,totalCount:K},children:[(0,i.jsxs)(Ba,{css:{background:"white"},direction:"column",height:1,width:1,children:[(0,i.jsx)(fm,{}),e.children]}),se&&(0,i.jsx)(lm,{possibleFilters:e.filters,predicates:n,selectedFilterPredicate:le,onClose:()=>{oe(!1)},onFilter:e=>{k(),A(e)}}),re&&(0,i.jsx)(Au,{columns:e.possibleColumns,initialSelectedColumns:o,saveButtonText:t("_diter_les_colo_39630"),searchPlaceholder:t("rechercher_un_c_86475"),subtitle:t("personnaliser_l_03763"),title:t("_dition_des_col_70300"),onClose:()=>{ae(!1)},onSave:w})]})},xm={deserialize(e){const t=parseInt(e||"",10);return isNaN(t)?null:t},serialize:e=>e.toString(10)},Im={deserialize(e){try{return JSON.parse(e||"")}catch{return null}},serialize:e=>JSON.stringify(e)},vm={deserialize:e=>m(e)&&Gs.c9.fromISO(e)?.isValid?Gs.c9.fromISO(e):null,serialize:e=>e.toISO()};function bm(e,t,n={}){const i=si(),[s,o]=L.useState("function"==typeof n.deserialize?n.deserialize(i.getItem(e))||t:i.getItem(e)??t);return[s,L.useCallback(t=>{o(t),i.setItem(e,"function"==typeof n.serialize?n.serialize(t):t)},[e,o,i])]}const jm=e=>{return(0,i.jsxs)(Gc,{css:{cursor:"pointer",userSelect:"none",...e.css||{}},minWidth:e.minWidth,width:e.width,onClick:()=>{var t,n;e.setSort((t=e.sort,n=e.attribute,null===t||t.attribute!==n?{attribute:n,direction:yt.Asc}:t.direction===yt.Asc?{attribute:n,direction:yt.Desc}:null))},children:[e.children,(0,i.jsx)(Ya,{width:"2"}),(0,i.jsx)(nl,{icon:(t=e.sort,n=e.attribute,null===t||t.attribute!==n?"arrow-down-arrow-up":t.direction===yt.Asc?"arrow-up":"arrow-down")})]});var t,n},Cm=e=>{const t=!!e.paginationRow;return(0,i.jsx)(wc,{children:(0,i.jsxs)(Ba,{direction:"column",width:1,children:[(0,i.jsxs)(hd,{css:{borderLeft:"1px solid $gray200",borderRight:"1px solid $gray200",height:"100%",overflow:"auto hidden",width:"100%","& > div:first-child":{borderStartStartRadius:e.featureFlags?.isV4?"$radii$2":void 0,borderStartEndRadius:e.featureFlags?.isV4?"$radii$2":void 0},"& > div:last-child":{borderEndEndRadius:t?void 0:"$radii$2",borderEndStartRadius:t?void 0:"$radii$2"},"& .table-header-row, & .table-row":{borderLeft:"none",borderRight:"none"},...e.css},gridtemplaterows:"44px 1fr",children:[e.headerRow,(0,i.jsx)(Ar,{css:{overflow:"auto"},children:e.children})]}),e.paginationRow]})})},ym=L.createContext({}),km=e=>{const[t,n]=L.useState(!1),[s,o]=L.useState(null),[r,a]=L.useState(null),l=(0,Ha.A)("tooltip-");return(0,i.jsx)(ym.Provider,{value:{isVisible:t,referenceElement:s,popperElement:r,tooltipId:l,setIsVisible:n,setReferenceElement:o,setPopperElement:a},children:e.children})};function Am(){return L.useContext(ym)}const wm=e=>{const{isVisible:t,popperElement:n,referenceElement:s,setPopperElement:o,tooltipId:r}=Am(),{styles:a,attributes:l,update:d}=(0,Yd.E)(s,n,{placement:e.placement,modifiers:[{name:"offset",options:{offset:[0,4]}}]});L.useEffect(()=>{d?.()},[t,s]);const c=(0,i.jsx)(Ba,{ref:o,align:"center",css:{background:"$gray900",borderRadius:"$1",color:"white",display:t?"flex":"none",px:"$3",py:"6px",zIndex:1e3,...a.popper},id:r,justify:"center",role:"tooltip",...l.popper,children:e.children});return e.renderOnPortal?(0,Kt.createPortal)(c,document.body):c},Sm=e=>{const{setIsVisible:t,setReferenceElement:n,tooltipId:s}=Am(),o=L.cloneElement(L.Children.only(e.children),{ref(e){n(e)},"aria-labelledby":s,"aria-describedby":s,onMouseEnter(){t(!0)},onMouseLeave(){t(!1)},onFocus(){t(!0)},onBlur(){t(!1)}});return(0,i.jsx)(i.Fragment,{children:o})},Em=e=>{const{translate:t}=vl(),{showRowEdit:n,getMassActionId:s,massActions:o,reload:r,reloadRow:a,showMassActions:l,showRowDropdown:d}=cm(),c=o.states[`r${s(e.row)}`]?.state??"unchecked",u=L.useCallback(()=>{a(e.row.id)},[e.row.id,a]),h=d||n;return(0,i.jsxs)(Mc,{css:{background:"checked"===c?"$primary100":"white","&:hover":{background:"checked"===c?"$primary100":"$gray100"}},onMouseLeave:e=>{Vd(e.target)},children:[l&&(0,i.jsx)(Oc,{justify:"center",width:48,children:(0,i.jsx)(fc,{state:c,onClick:t=>{o.toggleRow(`r${s(e.row)}`,t)}})}),e.selectedColumns.map(t=>(0,i.jsx)(L.Fragment,{children:e.renderCell(t,e.row,u)},t.slug)),h&&(0,i.jsxs)(Xc,{justify:"center",children:[n&&e.getEditPath&&(0,i.jsxs)(km,{children:[(0,i.jsx)(Sm,{children:(0,i.jsx)(Ar,{children:(0,i.jsx)(nl,{icon:"pen",to:e.getEditPath(e.row)})})}),(0,i.jsx)(wm,{placement:"top",children:t("_diter_62574")})]}),d&&e.renderRowDropdown?.(e.row,r)]}),e.renderRowPanels?.(e.row,u)]})},Tm=e=>{const{columns:t,data:n,idToLoading:s,isLoading:o,limit:r,massActions:a,numberOfPages:l,offset:d,possibleColumns:c,setLimit:u,setOffset:h,setSort:m,showMassActions:g,showRowDropdown:p,showRowEdit:f,sort:_,totalCount:x}=cm(),I=L.useMemo(()=>t.flatMap(e=>(0,Za.A)([c.find(t=>t.slug===e)])),[t,c]);return(0,i.jsx)(Ba,{css:{flex:"1",overflow:"hidden"},width:1,children:(0,i.jsx)(Cm,{"aria-busy":o,headerRow:(0,i.jsxs)(kc,{children:[g&&(0,i.jsx)(Gc,{justify:"center",width:48,children:(0,i.jsx)(fc,{state:a.selectAllState,onClick:a.toggleSelectAll})}),I.map(e=>e.isSortable?(0,i.jsx)(jm,{attribute:e.sortAttribute,minWidth:e.minWidth,setSort:m,sort:_,width:e.width,children:(0,i.jsx)(Ar,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug):(0,i.jsx)(Gc,{minWidth:e.minWidth,width:e.width,children:(0,i.jsx)(Ar,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug)),(p||f)&&(0,i.jsx)(Gc,{width:100})]}),paginationRow:(0,i.jsx)(Nc,{children:(0,i.jsx)(Fc,{limit:r,numberOfPages:l,offset:d,setLimit:u,setOffset:h,showLimits:!0,totalCount:x})}),children:o?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Hc,{}),(0,i.jsx)(Hc,{}),(0,i.jsx)(Hc,{})]}):n.map(t=>s[t.id]?(0,i.jsx)(Hc,{},t.id):(0,i.jsx)(Em,{getEditPath:e.getEditPath,renderCell:e.renderCell,renderRowDropdown:e.renderRowDropdown,renderRowPanels:e.renderRowPanels,row:t,selectedColumns:I},t.id))})})};var zm;!function(e){e.Features="features",e.Id="id",e.InsertedAt="insertedAt",e.MembersLimit="membersLimit",e.Name="name",e.NumberOfEvents="numberOfEvents",e.NumberOfMembers="numberOfMembers",e.PeriodEndAt="periodEndAt",e.PricePerMember="pricePerMember",e.WeezeventOrganizationId="weezeventOrganizationId"}(zm||(zm={}));let Om=class extends _u{constructor(e,t,n){super(e,t,n)}getFilters(){return[{slug:"features",name:this.t("fonctionnalit_s_47714"),category:this.t("organisation_71863"),fieldType:He.Select,values:mn.map(e=>({id:e,name:e})),hideEmpty:!0},{slug:"isAdmin",name:this.t("est_admin_98471"),category:this.t("organisation_71863"),fieldType:He.Checkbox,hideEmpty:!0},{slug:"isActive",name:this.t("est_active_05309"),category:this.t("organisation_71863"),fieldType:He.Checkbox,hideEmpty:!0},{slug:"useOldBilling",name:this.t("utilise_l_ancie_27299"),category:this.t("organisation_71863"),fieldType:He.Checkbox},{slug:"isOverLimit",name:this.t("d_passe_la_limi_27046"),category:this.t("organisation_71863"),fieldType:He.Checkbox,hideEmpty:!0},{slug:zm.MembersLimit,name:this.t("nombre_de_membr_16400"),category:this.t("organisation_71863"),fieldType:He.Number},{slug:zm.PricePerMember,name:this.t("prix_par_membre_20633"),category:this.t("organisation_71863"),fieldType:He.Number}]}getPossibleColumns(){return[{slug:zm.Id,name:this.t("id_51738"),isSortable:!0,sortAttribute:rt.Id,width:100},{slug:zm.Name,name:this.t("nom_de_l_organi_49583"),minWidth:240},{slug:zm.InsertedAt,name:this.t("date_de_cr_atio_00749"),isSortable:!0,sortAttribute:rt.InsertedAt,width:200},{slug:zm.PeriodEndAt,name:this.t("date_de_fin_de_17750"),isSortable:!0,sortAttribute:rt.PeriodEndAt,width:200},{slug:zm.Features,name:this.t("fonctionnalit_s_47714"),minWidth:320},{slug:zm.NumberOfEvents,name:this.t("nombre_d_v_nem_14214"),minWidth:180},{slug:zm.NumberOfMembers,name:this.t("nombre_de_membr_49522"),minWidth:180},{slug:zm.MembersLimit,name:this.t("nombre_de_membr_16400"),minWidth:180},{slug:zm.PricePerMember,name:this.t("prix_par_membre_20633"),minWidth:180},{slug:zm.WeezeventOrganizationId,name:this.t("id_de_l_organis_67465"),isSortable:!0,sortAttribute:rt.WeezeventOrganizationId,width:100}]}};function Rm(e){switch(e){case Be.Accreditation:return"badge-check";case Be.Api:return"code-branch";case Be.Beta:return"flask";case Be.Community:return"people-group";case Be.CustomDocument:return"file";case Be.Delegation:return"users";case Be.Documents:return"file";case Be.Eid:return"id-card";case Be.KmlImport:return"cloud-arrow-up";case Be.Languages:return"language";case Be.Multiform:return"file-lines";case Be.Skidata:return"person-skiing";case Be.Sms:return"message";case Be.Weezevent:return"ticket";case Be.Zapier:return"bolt";default:return ll()}}Om=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[hu,Jc,qn])],Om);const $m=e=>{const t=Zn(Jc);return e.column.slug===zm.Id?(0,i.jsx)(Oc,{width:e.column.width,children:e.row.id}):e.column.slug===zm.WeezeventOrganizationId?(0,i.jsx)(Oc,{width:e.column.width,children:e.row.weezeventOrganizationId?(0,i.jsxs)(Zc,{to:`/ticket/O${e.row.weezeventOrganizationId}`,children:["O",e.row.weezeventOrganizationId]}):""}):e.column.slug===zm.Name?(0,i.jsx)(Oc,{css:{"& a":{color:"$primary500 !important"}},children:(0,i.jsx)(el,{to:yi.ORGANIZATION({organizationId:e.row.id}),children:e.row.name})}):e.column.slug===zm.InsertedAt?(0,i.jsx)(Oc,{width:e.column.width,children:t.toLocaleString(e.row.insertedAt,eo.DateOnly.MonthLong)}):e.column.slug===zm.PeriodEndAt?(0,i.jsx)(Oc,{width:e.column.width,children:t.toLocaleString(e.row.periodEndAt,eo.DateOnly.MonthLong)}):e.column.slug===zm.Features?(0,i.jsx)(Oc,{children:(0,i.jsx)(Ba,{align:"center",css:{overflow:"auto",py:"$2"},gap:"2",height:1,width:1,wrap:"wrap",children:e.row.features.map(e=>(0,i.jsx)(rc,{leftIcon:Rm(e),children:e},e))})}):e.column.slug===zm.NumberOfEvents?(0,i.jsx)(Oc,{children:e.row.numberOfEvents}):e.column.slug===zm.NumberOfMembers?(0,i.jsx)(Oc,{children:e.row.membersStats.numberOfMembers}):e.column.slug===zm.MembersLimit?(0,i.jsx)(Oc,{children:e.row.membersLimit}):e.column.slug===zm.PricePerMember?(0,i.jsx)(Oc,{children:e.row.pricePerMember}):(0,i.jsx)(Oc,{})},Dm=e=>{const t=Xn(),{user:n}=ai(),{mutate:s,isLoading:o}=function(e={}){return ei("mutation BackofficeOrganizationUserAdd($organizationId: OrganizationId!) {\n backofficeOrganizationUserAdd(organizationId: $organizationId)\n}\n",e)}(),{mutate:r,isLoading:a}=function(e={}){return ei("mutation BackofficeOrganizationUserRemove($organizationId: OrganizationId!) {\n backofficeOrganizationUserRemove(organizationId: $organizationId)\n}\n",e)}(),l=e.organization.users.map(({id:e})=>e);return(0,i.jsxs)(Yc,{children:[l.includes(n.id)?(0,i.jsx)(Kd,{color:a?"disabled":"default",icon:"minus",onClick:async()=>{await r({organizationId:e.organization.id}),e.reload()},children:t("s_enlever_comme_18919")}):(0,i.jsx)(Kd,{color:o?"disabled":"default",icon:"plus",onClick:async()=>{await s({organizationId:e.organization.id}),window.open(`${P.HEAVENT_APP_URL}${yi.ORGANIZATION({organizationId:e.organization.id})}`,"_blank"),e.reload()},children:t("s_ajouter_comme_70404")}),(0,i.jsx)(Kd,{icon:"pen",to:Ps.EDIT_BACKOFFICE_ORGANIZATION(e.organization.id),children:t("_diter_62574")})]})},Pm=()=>{const{history:e,translate:t}=vl(),n=Zn(Om),[s,o]=bm(Ul.BACKOFFICE_SEARCH,"",{deserialize(e){const t=new URL(location.href).searchParams.get("q");return m(t)?t:e}}),[r,a]=bm(Ul.BACKOFFICE_COLUMNS,[zm.Id,zm.Name,zm.InsertedAt,zm.PeriodEndAt],Im),[l,d]=bm(Ul.BACKOFFICE_LIMIT,Rc,xm),[c,u]=bm(Ul.BACKOFFICE_PREDICATES,[],Im),[h,g]=bm(Ul.BACKOFFICE_SORT,null,Im);return(0,i.jsx)(Ar,{css:{overflowY:"auto"},height:1,width:1,children:(0,i.jsxs)(Ba,{css:{padding:"$7"},direction:"column",gap:"7",width:1,children:[(0,i.jsxs)(Ba,{gap:"4",children:[(0,i.jsx)(Ar,{color:"gray900",css:{flex:"1"},fontSize:"displayXs",fontWeight:"semiBold",children:t("organisations_26509")}),(0,i.jsx)(zl,{color:"white",leftIcon:"plus",to:fi(yi.ORGANIZATIONS),children:t("cr_er_une_organ_06669")}),(0,i.jsx)(zl,{leftIcon:"house",onClick:()=>{e.push(Ps.HOME)},children:"WeezCrew"}),(0,i.jsxs)(Wd,{children:[(0,i.jsx)(Xd,{children:(0,i.jsx)(zl,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsx)(Zd,{placement:"bottom-end",children:(0,i.jsx)(Kd,{icon:"eye",onClick:()=>{e.push(Ps.BACKOFFICE_INVOICES)},children:t("voir_les_factur_82290")})})]})]}),(0,i.jsx)(_m,{columns:r,columnsSearch:[],eventId:null,filters:n.getFilters(),limit:l,loadDataList:Yr,loadRow:Kr,name:s,organizationId:null,possibleColumns:n.getPossibleColumns(),predicates:c,rendering:Gh.List,setColumns:a,setLimit:d,setName:o,setPredicates:u,setSort:g,showEditColumns:!0,showEditMode:!1,showFilters:!0,showMassActions:!1,showRowDropdown:!0,showRowEdit:!0,showSearchColumns:!1,sort:h,children:(0,i.jsx)(Tm,{getEditPath:e=>Ps.EDIT_BACKOFFICE_ORGANIZATION(e.id),renderCell:(e,t)=>(0,i.jsx)($m,{column:e,row:t}),renderRowDropdown:(e,t)=>(0,i.jsx)(Dm,{organization:e,reload:t})})})]})})},Fm=_r("div",{margin:"auto",width:"$containerTablet","@desktop":{width:"$container"}}),Mm=L.forwardRef((e,t)=>(0,i.jsx)(Ar,{ref:t,css:{background:"$gray50",overflowX:"hidden",overflowY:"auto",py:"$10",...e.css},height:1,width:1,children:(0,i.jsx)(Fm,{children:e.children})}));Mm.displayName="CenteredContainer";const Nm=_r("div",{display:"flex",flexDirection:"column",height:"100%",width:"100%",zIndex:"10","& .fsp-header":{px:"$7"},"& .fsp-category":{fontSize:"11px",fontWeight:"$semiBold",textTransform:"uppercase"},"& .fsp-title":{fontSize:"$textMd",fontWeight:"$semiBold"},variants:{color:{white:{"& .fsp-header":{background:"white",borderBottom:"1px solid $gray200"},"& .fsp-category":{color:"$gray600"},"& .fsp-title":{color:"$gray900"}},dark:{"& .fsp-header":{background:"$gray900"},"& .fsp-category":{color:"white"},"& .fsp-title":{color:"white"}}}},defaultVariants:{color:"white"}}),Lm=e=>{const t=ni();return(0,i.jsxs)(Nm,{color:e.color,children:[(0,i.jsxs)(Ba,{align:"center",className:"fsp-header",gap:"4",height:65,width:1,children:[(0,i.jsx)(Ar,{css:{flexShrink:3},width:300}),(0,i.jsxs)(Ba,{align:"center",css:{flex:"1"},direction:"column",children:[e.category&&(0,i.jsx)(Ar,{className:"fsp-category",children:e.category}),(0,i.jsx)(Ar,{className:"fsp-title",css:{maxWidth:"100%"},ellipsis:!0,children:e.heading})]}),(0,i.jsxs)(Ba,{gap:"4",justify:"end",width:300,children:[e.button,(0,i.jsx)(zl,{color:"dark"===e.color?"gray":"white",css:{flexShrink:0},leftIcon:"xmark",onClick:()=>{"function"==typeof e.onClose?e.onClose():t.goBack(e.fallbackClosePath||Ps.HOME)}})]})]}),(0,i.jsx)(Ar,{css:{height:"calc(100% - 65px)"},width:1,children:e.children})]})},Bm=e=>(0,i.jsx)(Ba,{css:{background:"white",borderRadius:"$2",boxShadow:"$sm",padding:"$6 $7",...e.css},direction:"column",children:e.children}),Vm=L.memo(function(e){const t=Xn(),{descId:n,labelId:s}=qa(),[o,r]=L.useState(e.initialIsOpen),a=L.useCallback(t=>{r(t),e.onToggle?.(t)},[e.onToggle,r]),l=e.descId??n,d=e.labelId??s;return(0,i.jsxs)(Ba,{as:"fieldset",css:{background:"white",borderRadius:"$2",boxShadow:"$sm",border:"inherit",margin:"inherit",padding:"$6 $7",...e.css},direction:"column",children:[(0,i.jsxs)(Ba,{align:"center","aria-describedby":l,"aria-labelledby":d,as:"legend",css:{float:"left",width:"100%",border:"none",padding:"none",...o&&!e.centerTitleAndSubtitle?{borderBottom:"1px solid $gray200",paddingBottom:"$5"}:{}},gap:"4",children:[(0,i.jsxs)(Ba,{css:e.centerTitleAndSubtitle?{flex:"1",alignItems:"center",marginBottom:"var(--space32)"}:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(Ar,{color:"gray900",fontSize:"textMd",fontWeight:"semiBold",id:d,children:e.heading}),m(e.subtitle)&&(0,i.jsx)(Ar,{color:"gray500",dangerouslySetInnerHTML:{__html:e.subtitle},id:l})]}),!e.hideToggle&&(0,i.jsx)(Ar,{children:(0,i.jsx)(yu,{label:t("toggle_section_92160"),size:"md",value:o,onChange:a})})]}),o&&(0,i.jsxs)(i.Fragment,{children:[!e.centerTitleAndSubtitle&&(0,i.jsx)(Ya,{height:"5"}),e.children]})]})}),Um=(0,L.createContext)({});function Wm(){return(0,L.useContext)(Um)}const Gm=({name:e,children:t,...n})=>{const{isDisabled:s}=Wm();return(0,i.jsx)(Ga.D0,{name:e,render:e=>{const o=!0===e.input.checked?"checked":"unchecked";return(0,i.jsx)(_c,{...n,disabled:s,state:o,onClick:()=>{e.input.onChange(!e.input.checked)},children:t})},type:"checkbox"})},Hm=(0,L.memo)(function({name:e,hint:t,state:n,...s}){return(0,i.jsx)(Ga.D0,{name:e,render:({input:o,meta:r})=>{const a=r.data?.forceDisplayError&&r.invalid||r.touched&&r.invalid;return(0,i.jsx)(Mu,{hint:a?r.error:t,name:e,state:a?"error":n,value:o.value,onBlur:o.onBlur,onChange:o.onChange,onFocus:o.onFocus,...s})}})}),qm=({value:e,onChange:t,...n})=>{const[s,o]=(0,L.useState)(e?.toString()??""),[r,a]=(0,L.useState)(e);return r!==e&&(o(e?.toString()??""),a(e)),(0,i.jsx)(Bl,{value:s,onChange:e=>{const n=parseFloat(e);o(e),a(isNaN(n)?null:n),t(isNaN(n)?null:n)},...n})},Km=({name:e,hint:t,state:n,...s})=>(0,i.jsx)(Ga.D0,{name:e,render:o=>{const r=$l(o.meta);return(0,i.jsx)(qm,{hint:r?o.meta.error:t,name:e,state:r?"error":n,value:o.input.value,onBlur:o.input.onBlur,onChange:o.input.onChange,onFocus:o.input.onFocus,...s})}}),Ym=({name:e,hint:t,state:n,multiple:s,...o})=>{const{isDisabled:r}=Wm();return(0,i.jsx)(Ga.D0,{name:e,render:a=>{const l=$l(a.meta);return(0,i.jsx)(yc,{hint:l?a.meta.error:t,multiple:s,name:e,state:l?"error":r?"disabled":n,values:s?Array.isArray(a.input.value)?a.input.value:[]:"number"==typeof a.input.value||m(a.input.value)?[a.input.value]:[],onChange:e=>{s?a.input.onChange(e):so(e)?a.input.onChange(e[0]):a.input.onChange(null)},...o})}})},Zm=({css:e,label:t,description:n,state:s,icon:o,hint:r,rightIcon:a,rightText:l,onChange:d,value:c,...u})=>{const{inputId:h,descId:m,errorId:g}=qa();return(0,i.jsxs)(Ba,{css:e,direction:"column",width:1,children:[(0,i.jsx)(Ml,{htmlFor:h,children:t}),(0,i.jsx)(Pl,{id:m,children:n}),(t||n)&&(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ll,{cursor:"text",height:"fluid",icon:o,rightIcon:a,rightText:l,state:s,children:(0,i.jsxs)(hd,{css:{flex:"1",minHeight:"100px",py:"$3","& .replicated-text":{whiteSpace:"pre-wrap",visibility:"hidden"},"& textarea":{outline:"none",overflow:"hidden",resize:"none"},"& .replicated-text, & textarea":{background:"transparent",border:"none",gridArea:"1 / 1 / 2 / 2",width:"100%"},"& textarea::placeholder":{color:"$gray500",opacity:1},"& input::-ms-input-placeholder":{color:"$gray500",opacity:1}},children:[(0,i.jsx)("textarea",{"aria-describedby":n?m:void 0,"aria-errormessage":"error"===s?g:void 0,"aria-invalid":"error"===s,disabled:"disabled"===s,id:h,value:c,onChange:e=>{d(e.target.value)},...u}),(0,i.jsxs)(Ar,{className:"replicated-text",children:[c," "]})]})}),(0,i.jsx)(Fl,{id:g,state:s,children:r})]})},Xm=({name:e,hint:t,state:n,...s})=>(0,i.jsx)(Ga.D0,{name:e,render:o=>{const r=$l(o.meta);return(0,i.jsx)(Zm,{hint:r?o.meta.error:t,name:e,state:r?"error":n,value:o.input.value,onBlur:o.input.onBlur,onChange:e=>{o.input.onChange(e)},onFocus:o.input.onFocus,...s})}}),Jm=e=>(0,i.jsx)(Ga.D0,{name:e.name,render:t=>(0,i.jsx)(ku,{disabled:e.disabled,size:e.size,subtext:e.subtext,value:t.input.value,onChange:t.input.onChange,children:e.children})}),Qm=d.gl(e=>e&&Gs.c9.fromISO(e).isValid);let eg=class extends Gl{constructor(e){super(e)}organizationInputDefault(e){return{name:e.name,features:e.features,customBadges:e.customBadges,periodEndAt:e.periodEndAt,usersIds:e.users.map(({id:e})=>e),isBlocked:e.isBlocked,weezeventOrganizationId:e.weezeventOrganizationId,useOldBilling:e.useOldBilling,membersLimit:e.membersLimit,pricePerMember:e.pricePerMember,billingComment:e.billingComment}}organizationInputSchema(){return d.Ik().shape({name:d.Yj().required(this.t("le_nom_de_l_org_60618")),periodEndAt:Qm.required(this.t("la_date_de_fin_04076")).typeError(this.t("la_date_de_fin_04076")),features:d.YO().of(d.Yj().oneOf(mn,this.t("les_fonctionnal_36778"))),usersIds:d.YO().of(d.ai()),isBlocked:d.zM().required()})}updateOrganizationSchema(){return d.Ik().shape({organization:this.organizationInputSchema()})}};eg=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[qn])],eg);const tg=_r("span",{variants:{color:{inherit:{color:"inherit"},cyan:{color:"$cyan"},gray25:{color:"$gray25"},gray50:{color:"$gray50"},gray100:{color:"$gray100"},gray200:{color:"$gray200"},gray300:{color:"$gray300"},gray400:{color:"$gray400"},gray500:{color:"$gray500"},gray600:{color:"$gray600"},gray700:{color:"$gray700"},gray800:{color:"$gray800"},gray900:{color:"$gray900"},primary25:{color:"$primary25"},primary50:{color:"$primary50"},primary100:{color:"$primary100"},primary200:{color:"$primary200"},primary300:{color:"$primary300"},primary400:{color:"$primary400"},primary500:{color:"$primary500"},primary600:{color:"$primary600"},primary700:{color:"$primary700"},primary800:{color:"$primary800"},primary900:{color:"$primary900"},error25:{color:"$error25"},error50:{color:"$error50"},error100:{color:"$error100"},error200:{color:"$error200"},error300:{color:"$error300"},error400:{color:"$error400"},error500:{color:"$error500"},error600:{color:"$error600"},error700:{color:"$error700"},error800:{color:"$error800"},error900:{color:"$error900"},warning25:{color:"$warning25"},warning50:{color:"$warning50"},warning100:{color:"$warning100"},warning200:{color:"$warning200"},warning300:{color:"$warning300"},warning400:{color:"$warning400"},warning500:{color:"$warning500"},warning600:{color:"$warning600"},warning700:{color:"$warning700"},warning800:{color:"$warning800"},warning900:{color:"$warning900"},success25:{color:"$success25"},success50:{color:"$success50"},success100:{color:"$success100"},success200:{color:"$success200"},success300:{color:"$success300"},success400:{color:"$success400"},success500:{color:"$success500"},success600:{color:"$success600"},success700:{color:"$success700"},success800:{color:"$success800"},success900:{color:"$success900"},blue25:{color:"$blue25"},blue50:{color:"$blue50"},blue100:{color:"$blue100"},blue200:{color:"$blue200"},blue300:{color:"$blue300"},blue400:{color:"$blue400"},blue500:{color:"$blue500"},blue600:{color:"$blue600"},blue700:{color:"$blue700"},blue800:{color:"$blue800"},blue900:{color:"$blue900"},blueGray25:{color:"$blueGray25"},blueGray50:{color:"$blueGray50"},blueGray100:{color:"$blueGray100"},blueGray200:{color:"$blueGray200"},blueGray300:{color:"$blueGray300"},blueGray400:{color:"$blueGray400"},blueGray500:{color:"$blueGray500"},blueGray600:{color:"$blueGray600"},blueGray700:{color:"$blueGray700"},blueGray800:{color:"$blueGray800"},blueGray900:{color:"$blueGray900"},blueLight100:{color:"$blueLight100"},blueLight400:{color:"$blueLight400"},blueLight600:{color:"$blueLight600"},blueLight900:{color:"$blueLight900"},purple25:{color:"$purple25"},purple50:{color:"$purple50"},purple100:{color:"$purple100"},purple200:{color:"$purple200"},purple300:{color:"$purple300"},purple400:{color:"$purple400"},purple500:{color:"$purple500"},purple600:{color:"$purple600"},purple700:{color:"$purple700"},purple800:{color:"$purple800"},purple900:{color:"$purple900"},pink25:{color:"$pink25"},pink50:{color:"$pink50"},pink100:{color:"$pink100"},pink200:{color:"$pink200"},pink300:{color:"$pink300"},pink400:{color:"$pink400"},pink500:{color:"$pink500"},pink600:{color:"$pink600"},pink700:{color:"$pink700"},pink800:{color:"$pink800"},pink900:{color:"$pink900"},orange100:{color:"$orange100"},orange400:{color:"$orange400"},orange600:{color:"$orange600"},orange700:{color:"$orange700"},indigo100:{color:"$indigo100"},indigo600:{color:"$indigo600"},white:{color:"white"}},fontSize:{inherit:{fontSize:"inherit"},textXs:{fontSize:"$textXs"},textSm:{fontSize:"$textSm"},textMd:{fontSize:"$textMd"},textLg:{fontSize:"$textLg"},textXl:{fontSize:"$textXl"},displayXs:{fontSize:"$displayXs"},displaySm:{fontSize:"$displaySm"},displayMd:{fontSize:"$displayMd"},displayLg:{fontSize:"$displayLg"},displayXl:{fontSize:"$displayXl"},display2Xl:{fontSize:"$display2Xl"}},fontWeight:{inherit:{fontWeight:"inherit"},regular:{fontWeight:"$regular"},medium:{fontWeight:"$medium"},semiBold:{fontWeight:"$semiBold"},bold:{fontWeight:"$bold"}}},defaultVariants:{color:"inherit",fontSize:"inherit",fontWeight:"inherit"}}),ng=L.forwardRef((e,t)=>(0,i.jsx)(tg,{...(0,ur.A)(e,"font"),...hr(e.font),ref:t,css:e.css}));ng.displayName="Span";const ig=1123,sg=794,og=561,rg=397,ag=397,lg=280,dg=325,cg=204,ug={A4:{height:"297mm",width:"210mm"},A5:{height:"210mm",width:"148mm"},A6:{height:"148mm",width:"105mm"}},hg=(e,t)=>{t?.startsWith("/")||(console.warn(`Path '${t}' missing leading slash`),t="/"+t);const n=new I(P.HEAVENT_PUBLIC_URL);return Fd.has(e)&&(n.host=Fd.get(e)),n.pathname+=t,n.href},mg=({organizationId:e,eventId:t,delegationId:n,formId:i,teamCode:s,query:o})=>{const r=new I(P.HEAVENT_PUBLIC_URL);return Fd.has(e)&&(r.host=Fd.get(e)),r.pathname+=`${(()=>{if(n)return"number"==typeof t?hs.DELEGATION_FORM({organizationId:e,delegationId:n,eventId:t,formId:i}):hs.DELEGATION_FORM({organizationId:e,delegationId:n,formId:i});{const n="number"==typeof t?Hi.EVENT_FORM({organizationId:e,eventId:t,formId:i}):yi.ORGANIZATION_FORM({organizationId:e,formId:i});return m(s)?`${n}/team/${s}`:n}})()}`,o?.preview&&r.searchParams.set("preview",o?.preview?.toString()),o?.previewState&&r.searchParams.set("state",o?.previewState?.toString()),r.href};var gg;!function(e){e.QR="qr",e.Code39="code39"}(gg||(gg={}));const pg=(e,t)=>{const n=new I(P.HEAVENT_API_URL);return n.pathname+=`/barcode/${t?.barcodeType??gg.QR}`,n.searchParams.set("text",e),n.searchParams.set("color",t?.color??"000000"),t?.height&&n.searchParams.set("height",t?.height?.toString()),t?.width&&n.searchParams.set("width",t?.width?.toString()),n.href},fg=({organizationId:e,eventId:t,lang:n,pathComponent:i,key:s})=>{const o=new I(P.HEAVENT_API_URL);return o.pathname+=t?`/export/organization/${e}/event/${t}/${i}`:`/export/organization/${e}/${i}`,o.searchParams.set("key",s),m(n)&&o.searchParams.set("lang",n),o.href};function _g(e,t,n={}){const i=new I(P.HEAVENT_API_URL);i.pathname+=`/documents/${e}.${t}`;const s=new URLSearchParams(Object.entries(n).filter(([e,t])=>m(t)));for(const[e,t]of s)i.searchParams.set(e,t);return i.href}function xg(e,t){return new I(`https://admin.${P.WEEZEVENT_DOMAIN}`,void 0,void 0,`access/O${e}/checkpoints/edit/${t}`).href}const Ig=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,s=(0,uc.A)(t.positionsSlotsUsersInfos,e=>e.positionSlot.range.start.toMillis());return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ba,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/animaje/convention-page1.jpg) no-repeat`,backgroundSize:"cover",color:"#040f29",fontFamily:"$neufileGrotesk",pageBreakBefore:"always",position:"relative"},height:ig,width:sg,children:[(0,i.jsxs)(Ar,{css:{fontSize:"24px",fontWeight:"700",left:"72px",position:"absolute",textTransform:"uppercase",top:"334px"},children:[n.fields?.firstName?.value||""," ",n.fields?.lastName?.value||""]}),(0,i.jsx)(Ar,{css:{fontSize:"14px",fontWeight:"500",left:"72px",position:"absolute",textTransform:"uppercase",top:"364px"},children:n.fields?.phone?.internationalFormat||""}),(0,i.jsx)(Ar,{css:{left:"650px",position:"absolute",top:"322px"},height:72,width:72,children:(0,i.jsx)("img",{height:"100%",src:pg(t.ticketId,{height:80,width:80}),width:"100%"})}),(0,i.jsx)(Ba,{css:{left:"72px",position:"absolute",top:"558px"},direction:"column",gap:"1",children:s.map((e,t)=>(0,i.jsxs)(Ar,{css:{fontSize:"12px",fontWeight:"500"},children:[(0,i.jsxs)(ng,{css:{fontWeight:"700",textTransform:"capitalize"},children:[e.positionSlot.range.start.toFormat("cccc dd MMMM 'de' HH'h'mm",{locale:"fr"})," ","à ",e.positionSlot.range.end.toFormat("HH'h'mm")]})," ",": ",e.position.name]},t))})]}),(0,i.jsxs)(Ba,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/animaje/convention-page2.jpg) no-repeat`,backgroundSize:"cover",color:"#040f29",fontFamily:"$neufileGrotesk",pageBreakBefore:"always",position:"relative"},height:ig,width:sg,children:[(0,i.jsxs)(Ar,{css:{fontSize:"24px",fontWeight:"700",left:"72px",position:"absolute",textTransform:"uppercase",top:"222px"},children:[n.fields?.firstName?.value||""," ",n.fields?.lastName?.value||""]}),(0,i.jsx)(Ar,{css:{fontSize:"14px",fontWeight:"500",left:"72px",position:"absolute",textTransform:"uppercase",top:"252px"},children:n.fields?.phone?.internationalFormat||""}),(0,i.jsx)(Ar,{css:{left:"650px",position:"absolute",top:"210px"},height:72,width:72,children:(0,i.jsx)("img",{height:"100%",src:pg(t.ticketId,{height:80,width:80}),width:"100%"})}),(0,i.jsxs)(Ar,{css:{fontSize:"12px",fontWeight:"700",left:"178px",position:"absolute",top:"455px"},children:[n.fields?.firstName?.value||""," ",n.fields?.lastName?.value||""]}),(0,i.jsxs)(Ar,{css:{fontSize:"12px",fontWeight:"700",left:"72px",position:"absolute",top:"537px"},children:[n.fields?.firstName?.value||""," ",n.fields?.lastName?.value||""]}),(0,i.jsxs)(Ar,{css:{fontSize:"12px",fontWeight:"700",left:"72px",position:"absolute",top:"617px"},children:[n.fields?.firstName?.value||""," ",n.fields?.lastName?.value||""]})]})]})};function vg(e,t,n){return e.filter(e=>{if(t?.isValid&&n?.isValid){const i=Gs.IX.fromDateTimes(t.startOf("day"),n.endOf("day"));return e.positionSlot.range.overlaps(i)}return!t?.isValid||e.positionSlot.range.start.startOf("day").equals(t.startOf("day"))})}function bg(e,t){const n=Object.fromEntries(Object.values((0,cc.A)(t,e=>e.positionSlot.range.start.startOf("day").toMillis())).map(e=>[`positions.${e[0].positionSlot.range.start.toFormat("yyyyMMdd")}`,(0,uc.A)((0,Bs.A)(e.map(e=>e.position.name))).join(" ")]));return{assignmentsDays:(0,xh.A)((t||[]).map(({positionSlot:e})=>e.range.start),e=>e.startOf("day").toMillis()).map(t=>e.toLocaleString(t,eo.DateOnly.WeekdayLongMonthLong)).join(", "),positionsCategories:(0,uc.A)((0,Bs.A)((t||[]).map(e=>e.position.category.name))).join(", "),positions:(0,uc.A)((0,Bs.A)((t||[]).map(e=>e.position.name))).join(", "),...n}}function jg(e){return{[`${e} p.h-small`]:{fontSize:"12px"},[`${e} h2`]:{fontSize:"20px",fontWeight:"$semiBold"},[`${e} h3`]:{fontSize:"18px",fontWeight:"$semiBold"},[`${e} h4`]:{fontSize:"16px",fontWeight:"$semiBold"},[`${e} a`]:{color:"$primary500"},[`${e} blockquote`]:{borderLeft:"3px solid $gray200",fontStyle:"italic",marginLeft:0,marginRight:0,px:"$4","& p":{margin:0,paddingBottom:"$2",paddingTop:"$2"}}}}const Cg=e=>(0,i.jsx)(Ar,{className:"h-rich-text",css:{...jg("&"),"& > p:first-child":{marginTop:0},"& > p:last-child":{marginBottom:0},"& figure":{margin:"auto","& img":{width:"100%"}},...e.css},dangerouslySetInnerHTML:{__html:e.text},width:1,onClick:e=>{const t=e.target;if(t){const n=t.closest("a");n&&(e.preventDefault(),window.open(n.getAttribute("href"),"_blank"))}}});function yg(e,t){return`https://www.google.com/maps/place/${e},${t}`}const kg=4427,Ag=4848,wg=e=>e===kg?{color:"#ff5501"}:e===Ag?{color:"#005a41"}:-1===e?{color:"#1e4850"}:{},Sg=e=>e===kg?{color:"white"}:e===Ag?{color:"#005a41"}:-1===e?{color:"#1e4850"}:{},Eg=e=>{const t=e.psuis[0].position,n=(0,uc.A)(e.psuis.map(({positionSlot:e})=>e),e=>e.range.start.toMillis()),s=t.leaders[0];return(0,i.jsxs)(Ba,{css:{background:`url(${o=e.eventId,o===kg?`${P.HEAVENT_ASSETS_URL}/badges/aso/2025_v4/semi.jpg`:o===Ag?`${P.HEAVENT_ASSETS_URL}/badges/aso/2025_v4/marathon.jpg`:-1===o?`${P.HEAVENT_ASSETS_URL}/badges/aso/2025_v4/10k.jpg`:""}) no-repeat`,backgroundSize:"cover",pageBreakBefore:"always",position:"relative"},height:ig,width:sg,children:[(0,i.jsx)(Ar,{css:{fontSize:"24px",left:"298px",position:"absolute",top:"101px",...Sg(e.eventId)},textAlign:"center",width:409,children:e.userInfo.name}),(0,i.jsx)(Ar,{css:{fontSize:"12px",left:"46px",position:"absolute",top:"374px"},children:m(e.options.habits)&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Ar,{css:{...Sg(e.eventId),"& .h-rich-text > p":{margin:"0"}},children:(0,i.jsx)(Cg,{text:e.options.habits})})})}),s&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ar,{css:{color:"#005a41",left:"46px",position:"absolute",top:"581px",...Sg(e.eventId)},textAlign:"center",width:150,children:s.userInfo.name}),(0,i.jsx)(Ar,{css:{left:"46px",position:"absolute",top:"602px",...Sg(e.eventId)},textAlign:"center",width:150,children:s.userInfo.phone?.internationalFormat})]}),(0,i.jsxs)(Ba,{css:{left:"228px",position:"absolute",padding:"32px",top:"167px"},direction:"column",width:550,children:[(0,i.jsx)(Ar,{css:{fontSize:"28px",fontWeight:"700",...wg(e.eventId)},textAlign:"center",children:t.name}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(Ar,{css:{fontWeight:"700",textTransform:"uppercase",...wg(e.eventId)},children:"Date et heure de la mission"}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ba,{css:{fontSize:"12px"},direction:"column",gap:"1",children:n.map((e,t)=>{const n=e.range.start;return(0,i.jsxs)(Ar,{children:[n.toFormat("cccc dd MMMM yyyy",{locale:"fr"})," à"," ",n.toFormat("H'h'mm",{locale:"fr"})]},t)})}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(Ar,{css:{fontWeight:"700",textTransform:"uppercase",...wg(e.eventId)},children:"Détail de la mission"}),(0,i.jsx)(Ya,{height:"1"}),m(t.description)&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Ar,{css:{color:"black",fontSize:"12px","& .h-rich-text > p":{margin:"0"}},children:(0,i.jsx)(Cg,{text:t.description})})}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(Ar,{css:{fontWeight:"700",textTransform:"uppercase",...wg(e.eventId)},children:"Lieu de rendez-vous"}),(0,i.jsx)(Ya,{height:"1"}),zh(t)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ar,{css:{fontSize:"12px"},children:t.address}),(0,i.jsx)(Ya,{height:"1"})]}),(0,i.jsxs)(Ba,{gap:"3",width:1,children:[(0,i.jsx)(Ar,{height:180,width:1,children:(0,i.jsx)("a",{href:yg(t.latitude,t.longitude),style:{background:`url(${P.HEAVENT_API_URL}/image/event/${e.eventId}/position/${t.id}.png)`,backgroundPosition:"center",backgroundSize:"cover",display:"block",height:"100%",width:"100%"}})}),m(t.fields?.cf45815?.url)&&(0,i.jsx)(Ar,{css:{background:`url(${t.fields.cf45815.url}) no-repeat`,backgroundSize:"contain"},height:180,width:204})]}),m(t.fields.cf44423)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(Ar,{css:{fontWeight:"700",textTransform:"uppercase",...wg(e.eventId)},children:"Ton kit bénévole"}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ar,{css:{fontSize:"12px"},dangerouslySetInnerHTML:{__html:t.fields.cf44423.replace(/\n/g," ")}})]}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(Ar,{css:{fontWeight:"700",textTransform:"uppercase",...wg(e.eventId)},children:"Un imprévu ?"}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ar,{css:{fontSize:"12px"},children:"Pour des raisons pratiques, il ne sera pas possible de procéder à des changements d’affectation sur le terrain. Merci de bien vouloir nous informer en cas d’indisponibilité le plus rapidement possible, afin de ne pas pénaliser le bon déroulement de l’épreuve"})]})]});var o},Tg=[120785,134101],zg=e=>{const t=vg(e.event.volunteerRegistration.positionsSlotsUsersInfos,e.date,null).filter(({position:e})=>!Tg.includes(e.id)),n=(0,uc.A)(Object.entries((0,cc.A)(t,({position:e})=>e.id)),([e])=>e);return(0,i.jsx)(i.Fragment,{children:n.map(([t,n],s)=>(0,i.jsx)(Eg,{eventId:e.event.id,options:e.options,psuis:n,userInfo:e.event.volunteerRegistration.userInfo},s))})};function Og(e={}){const t=_(e.firstName||"").trim();return`${_(e.lastName||"").trim().toUpperCase()} ${t}`.trim()}function Rg(e,t,n=null){return e?.[t]?.value||n}const $g=(e,t)=>e.split(t).map(e=>e.trim().length>0?e.trim()[0]:"").join("").substring(0,3);function Dg(e,t){if(m(e))return $g(e," ");if(m(t)){const[e]=t.split("@");return $g(e,".")}return""}const Pg=[xr.colors.success600.value,xr.colors.blueGray600.value,xr.colors.blueLight600.value,xr.colors.purple600.value,xr.colors.pink600.value,xr.colors.warning600.value];function Fg(e){const t=e.charCodeAt(0);return Pg[t%Pg.length]}const Mg=({children:e})=>(0,i.jsx)(Ba,{align:"center",css:{background:"#14243f",borderRadius:"5px 5px 0px 0px",color:"white",flex:"1",fontWeight:"600",padding:"10px"},justify:"center",children:e}),Ng=({children:e})=>(0,i.jsx)(Ba,{align:"center",css:{background:"white",border:"1px solid $gray200",color:"#142440",flex:"1",fontWeight:"600",padding:"10px"},justify:"center",children:e}),Lg=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,s=t.positionsSlotsUsersInfos.flatMap(e=>e.position.leaders)?.[0],o=(0,uc.A)(t.positionsSlotsUsersInfos.filter(e=>23066===e.position.category.id),e=>e.positionSlot.range.start.toMillis()),r=(0,uc.A)(t.positionsSlotsUsersInfos.filter(e=>23113===e.position.category.id),e=>e.positionSlot.range.start.toMillis());return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ba,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/cercle/fiche_livraison_masque.png) no-repeat`,backgroundSize:"cover",position:"relative"},height:ig,width:sg,children:[(0,i.jsx)(Ar,{css:{fontSize:"20px",fontWeight:"700",left:"32px",position:"absolute",textTransform:"uppercase",top:"193px"},children:Rg(n.fields,"cf42835","salut")}),(0,i.jsxs)(Ar,{css:{color:"#000dbd",fontSize:"17px",fontWeight:"600",left:"32px",position:"absolute",top:"225px"},children:[n.name," - ",n.fields?.phone?.internationalFormat]}),(0,i.jsxs)(Ar,{css:{color:"#000dbd",fontSize:"17px",fontWeight:"600",left:"32px",position:"absolute",top:"251px"},children:[s?.userInfo.name," - ",s?.userInfo.phone?.internationalFormat]}),(0,i.jsx)(Ar,{css:{position:"absolute",right:"32px",top:"188px"},height:90,width:90,children:(0,i.jsx)("img",{height:"100%",src:pg(t.ticketId,{height:90,width:90}),width:"100%"})}),(0,i.jsxs)(Ba,{css:{position:"absolute",px:"32px",top:"411px"},direction:"column",width:1,children:[(0,i.jsxs)(Ba,{direction:"column",gap:"1",width:1,children:[(0,i.jsxs)(Ba,{gap:"1",width:1,children:[(0,i.jsx)(Mg,{children:"DATE"}),(0,i.jsx)(Mg,{children:"HORAIRE"}),(0,i.jsx)(Mg,{children:"TYPE"}),(0,i.jsx)(Mg,{children:"N° IMMAT"})]}),o.map((e,t)=>(0,i.jsxs)(Ba,{gap:"1",width:1,children:[(0,i.jsx)(Ng,{children:e.positionSlot.range.start.toFormat("dd/MM/yyyy")}),(0,i.jsx)(Ng,{children:e.positionSlot.range.start.toFormat("HH:mm")}),(0,i.jsx)(Ng,{children:Rg(n.fields,"cf42931","")}),(0,i.jsx)(Ng,{children:Rg(n.fields,"cf42974","")})]},t))]}),so(r)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(Ar,{css:{fontSize:"22px",fontWeight:"700"},children:"Reprise"}),(0,i.jsx)(Ya,{height:"2"}),(0,i.jsxs)(Ba,{direction:"column",gap:"1",width:1,children:[(0,i.jsxs)(Ba,{gap:"1",width:1,children:[(0,i.jsx)(Mg,{children:"DATE"}),(0,i.jsx)(Mg,{children:"HORAIRE"}),(0,i.jsx)(Mg,{children:"TYPE"}),(0,i.jsx)(Mg,{children:"N° IMMAT"})]}),r.map((e,t)=>(0,i.jsxs)(Ba,{gap:"1",width:1,children:[(0,i.jsx)(Ng,{children:e.positionSlot.range.start.toFormat("dd/MM/yyyy")}),(0,i.jsx)(Ng,{children:e.positionSlot.range.start.toFormat("HH:mm")}),(0,i.jsx)(Ng,{children:Rg(n.fields,"cf42931","")}),(0,i.jsx)(Ng,{children:Rg(n.fields,"cf42974","")})]},t))]})]})]})]}),(0,i.jsx)(Ba,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/cercle/fiche_livraison_masque_1.png) no-repeat`,backgroundSize:"cover",pageBreakBefore:"always"},height:ig,width:sg})]})},Bg=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,s=t.delegation,o=(0,uc.A)((0,xh.A)(n.formsUsersInfos.flatMap(e=>e.slots.map(e=>e.range.start.startOf("day"))),e=>e.toMillis()),e=>e.toMillis());return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ba,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/cercle/op_com_1.jpg) no-repeat`,backgroundSize:"cover",position:"relative"},height:ig,width:sg,children:[(0,i.jsx)(Ar,{css:{fontFamily:"$kabel",fontSize:"20px",fontWeight:"700",left:"46px",position:"absolute",textTransform:"uppercase",top:"306px",width:"582px"},children:n.name}),(0,i.jsxs)(Ar,{css:{color:"#1e3159",fontSize:"17px",fontWeight:"600",left:"46px",position:"absolute",top:"338px",width:"582px"},children:["Nom du responsable : ",s?.leaders?.[0]?.name," ",s?.leaders?.[0]?.phone?.internationalFormat]}),(0,i.jsx)(Ar,{css:{left:"658px",position:"absolute",top:"288px"},height:90,width:90,children:(0,i.jsx)("img",{height:"100%",src:pg(t.ticketId,{height:90,width:90}),width:"100%"})}),(0,i.jsx)(Ba,{css:{gap:"6px",left:"46px",position:"absolute",top:"641px"},children:o.map((e,t)=>(0,i.jsxs)(Ba,{align:"center",css:{border:"1px solid black",borderRadius:"$1",fontFamily:"$montserrat",padding:"4px 6px"},direction:"column",justify:"center",children:[(0,i.jsx)(Ar,{css:{fontSize:"16px",fontWeight:"700"},children:e.toFormat("dd")}),(0,i.jsx)(Ar,{css:{fontSize:"10px",fontWeight:"500"},children:e.toFormat("MMM",{locale:"fr"})})]},t))})]}),(0,i.jsx)(Ba,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/cercle/op_com_2.jpg) no-repeat`,backgroundSize:"cover",pageBreakBefore:"always"},height:ig,width:sg}),(0,i.jsx)(Ba,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/cercle/op_com_3.jpg) no-repeat`,backgroundSize:"cover",pageBreakBefore:"always"},height:ig,width:sg})]})},Vg=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,s=t.delegation,o=(0,uc.A)((0,xh.A)(n.formsUsersInfos.flatMap(e=>e.slots.map(e=>e.range.start.startOf("day"))),e=>e.toMillis()),e=>e.toMillis());return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ba,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/cercle/fdr_press_et_partenaire_1.jpg) no-repeat`,backgroundSize:"cover",position:"relative"},height:ig,width:sg,children:[(0,i.jsx)(Ar,{css:{fontFamily:"$kabel",fontSize:"20px",fontWeight:"700",left:"46px",position:"absolute",textTransform:"uppercase",top:"306px",width:"582px"},children:n.name}),(0,i.jsxs)(Ar,{css:{color:"#1e3159",fontSize:"17px",fontWeight:"600",left:"46px",position:"absolute",top:"338px",width:"582px"},children:["Nom du responsable : ",s?.leaders?.[0]?.name," ",s?.leaders?.[0]?.phone?.internationalFormat]}),(0,i.jsx)(Ar,{css:{left:"658px",position:"absolute",top:"288px"},height:90,width:90,children:(0,i.jsx)("img",{height:"100%",src:pg(t.ticketId,{height:90,width:90}),width:"100%"})}),(0,i.jsx)(Ba,{css:{gap:"6px",left:"46px",position:"absolute",top:"641px"},children:o.map((e,t)=>(0,i.jsxs)(Ba,{align:"center",css:{border:"1px solid black",borderRadius:"$1",fontFamily:"$montserrat",padding:"4px 6px"},direction:"column",justify:"center",children:[(0,i.jsx)(Ar,{css:{fontSize:"16px",fontWeight:"700"},children:e.toFormat("dd")}),(0,i.jsx)(Ar,{css:{fontSize:"10px",fontWeight:"500"},children:e.toFormat("MMM",{locale:"fr"})})]},t))})]}),(0,i.jsx)(Ba,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/cercle/fdr_press_et_partenaire_2.jpg) no-repeat`,backgroundSize:"cover",pageBreakBefore:"always"},height:ig,width:sg}),(0,i.jsx)(Ba,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/cercle/fdr_press_et_partenaire_3.jpg) no-repeat`,backgroundSize:"cover",pageBreakBefore:"always"},height:ig,width:sg})]})},Ug=e=>"Staff"===e?`${P.HEAVENT_ASSETS_URL}/badges/cercle/fiche_missions_Staff.png`:`${P.HEAVENT_ASSETS_URL}/badges/cercle/fiche_missions_Visiteur.png`,Wg=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,s=Rg(n.fields,"population",""),o=t.delegation,r=(0,uc.A)((0,xh.A)(n.formsUsersInfos.flatMap(e=>e.slots.map(e=>e.range.start.startOf("day"))),e=>e.toMillis()),e=>e.toMillis()),a=(0,uc.A)((0,xh.A)(t.accreditationsUsersInfos.flatMap(e=>2826===e.accreditationCategory.id&&e.accreditationSlot.date?.isValid?[e.accreditationSlot.date]:[]),e=>e.toMillis()),e=>e.toMillis());return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ba,{css:{background:`url(${Ug(s)}) no-repeat`,backgroundSize:"cover",position:"relative"},height:ig,width:sg,children:[(0,i.jsx)(Ar,{css:{fontSize:"20px",fontWeight:"700",left:"32px",position:"absolute",textTransform:"uppercase",top:"206px"},children:n.name}),(0,i.jsxs)(Ar,{css:{color:"#1e3159",fontSize:"17px",fontWeight:"600",left:"32px",position:"absolute",top:"238px"},children:["Nom du responsable : ",o?.leaders?.[0]?.name," ",o?.leaders?.[0]?.phone?.internationalFormat]}),(0,i.jsx)(Ar,{css:{position:"absolute",right:"32px",top:"188px"},height:90,width:90,children:(0,i.jsx)("img",{height:"100%",src:pg(t.ticketId,{height:90,width:90}),width:"100%"})}),(0,i.jsx)(Ba,{css:{gap:"6px",left:"32px",position:"absolute",top:"Staff"===s?"461px":"452px"},children:r.map((e,t)=>(0,i.jsxs)(Ba,{align:"center",css:{border:"1px solid black",borderRadius:"$1",fontFamily:"$montserrat",padding:"4px 6px"},direction:"column",justify:"center",children:[(0,i.jsx)(Ar,{css:{fontSize:"16px",fontWeight:"700"},children:e.toFormat("dd")}),(0,i.jsx)(Ar,{css:{fontSize:"10px",fontWeight:"500"},children:e.toFormat("MMM",{locale:"fr"})})]},t))}),so(a)&&(0,i.jsx)(Ar,{css:{fontSize:"22px",fontWeight:"800",left:"32px",position:"absolute",textTransform:"uppercase",top:"Staff"===s?"530px":"521px"},children:"Catering"}),(0,i.jsx)(Ba,{css:{gap:"6px",left:"32px",position:"absolute",top:"Staff"===s?"562px":"553px"},children:a.map((e,t)=>(0,i.jsxs)(Ba,{align:"center",css:{border:"1px solid black",borderRadius:"$1",fontFamily:"$montserrat",padding:"4px 6px"},direction:"column",justify:"center",children:[(0,i.jsx)(Ar,{css:{fontSize:"16px",fontWeight:"700"},children:e.toFormat("dd")}),(0,i.jsx)(Ar,{css:{fontSize:"10px",fontWeight:"500"},children:e.toFormat("MMM",{locale:"fr"})})]},t))})]}),"Staff"===s&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/cercle/fiche_missions_Staff-01.png) no-repeat`,backgroundSize:"cover",pageBreakBefore:"always"},height:ig,width:sg}),(0,i.jsx)(Ba,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/cercle/fiche_missions_Staff-02.png) no-repeat`,backgroundSize:"cover",pageBreakBefore:"always"},height:ig,width:sg})]}),"Visiteur"===s&&(0,i.jsx)(Ba,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/cercle/fiche_missions_Visiteur_2.png) no-repeat`,backgroundSize:"cover",pageBreakBefore:"always"},height:ig,width:sg})]})},Gg=e=>e.includes("Régisseur")||e.includes("Team Delta")||e.includes("Warrior Chauffeur")?`${P.HEAVENT_ASSETS_URL}/badges/delta/2024/delta_tech_verso.jpg`:`${P.HEAVENT_ASSETS_URL}/badges/delta/2024/delta_qr_verso.jpg`,Hg=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,s=Zn(Jc),o=(0,L.useMemo)(()=>{const t=e.event.volunteerRegistration.positionsSlotsUsersInfos;return(0,uc.A)(Object.entries((0,cc.A)(t,e=>e.positionSlot.range.start.startOf("day").toMillis())),([e])=>e).map(([e,t])=>[s.toLocaleString(t[0].positionSlot.range.start,eo.DateOnly.WeekdayLongMonthLong),t])},[e.event]),r=n.fields?.cf1666?.value;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ba,{css:{background:`url(${a=r,a.includes("Régisseur")||a.includes("Team Delta")||a.includes("Warrior Chauffeur")?`${P.HEAVENT_ASSETS_URL}/badges/delta/2024/delta_tech_recto.jpg`:`${P.HEAVENT_ASSETS_URL}/badges/delta/2024/delta_qg_recto.jpg`}) no-repeat`,backgroundSize:"contain",color:"black",pageBreakBefore:"always",position:"relative"},direction:"column",height:ig,width:sg,children:[(0,i.jsx)(Ar,{css:{borderRadius:"100px",left:"60px",overflow:"hidden",position:"absolute",top:"286px"},height:100,width:100,children:m(n.fields?.picture?.url)&&(0,i.jsx)("img",{height:"100%",src:n.fields.picture.url,width:"100%"})}),(0,i.jsx)(Ar,{css:{fontSize:"24px",fontWeight:"700",left:"177px",position:"absolute",top:"289px"},children:n.fields?.firstName?.value||""}),(0,i.jsx)(Ar,{css:{fontSize:"24px",fontWeight:"700",left:"177px",position:"absolute",top:"322px"},children:n.fields?.lastName?.value||""}),(0,i.jsx)(Ar,{css:{fontSize:"18px",left:"177px",position:"absolute",top:"359px"},children:r}),(0,i.jsxs)(Ba,{align:"center",css:{position:"absolute",right:"71px",top:"282px"},direction:"column",gap:"2",children:[(0,i.jsx)(Ar,{height:90,width:90,children:(0,i.jsx)("img",{height:"100%",src:pg(t.ticketId,{height:90,width:90}),width:"100%"})}),(0,i.jsx)(Ar,{css:{fontSize:"10px"},children:t.ticketId})]})]}),(0,i.jsx)(Ba,{css:{background:`url(${Gg(r)}) no-repeat`,backgroundSize:"contain",color:"black",pageBreakBefore:"always",position:"relative"},direction:"column",height:ig,width:sg,children:(0,i.jsx)(Ba,{css:{left:"76px",position:"absolute",top:"328px"},direction:"column",gap:"6",children:o.map(([e,t],n)=>(0,i.jsxs)(Ba,{direction:"column",gap:"1",children:[(0,i.jsx)(Ar,{css:{fontSize:"18px",fontWeight:"700",textTransform:"uppercase"},children:e}),(0,i.jsx)(Ba,{direction:"column",children:t.map((e,t)=>(0,i.jsxs)(Ar,{css:{fontSize:"16px"},children:[e.position.name," /"," ",e.positionSlot.range.toFormat("HH:mm",{separator:"-"})]},t))})]},n))})})]});var a},qg=({css:e,children:t})=>(0,i.jsx)(Ba,{css:{alignItems:"center",border:"1px solid",flexDirection:"column",fontSize:"24px",fontWeight:700,height:"42px",justifyContent:"center",lineHeight:"24px",padding:"2px 0px",position:"absolute",width:"110px",...e},children:t}),Kg=({css:e,children:t})=>(0,i.jsx)(Ar,{css:{fontSize:"14px",fontWeight:600,lineHeight:"14px",...e},children:t}),Yg=["P0","P1","P1 Aire Régie","P2","P3","P4","ZONE 1 - PELOUSE","ZONE 2 - VESTIAIRES","ZONE 3 - TRIBUNES","ZONE 4 - MEDIAS","ZONE 5 - AIRE REGIE TV","ZONE 6 - HOSPITALITES","ZONE 7 - SERVICES","ZONE 8 - BORD TERRAIN","ZONE 9 - PRESIDENTIELLE","H-30","PC"],Zg=({event:e})=>{const t=e.volunteerRegistration,n=t.userInfo,s=`${n.fields?.firstName?.value||""} ${(n.fields?.lastName?.value||"").toUpperCase()}`,o=t.accreditationsUsersInfos.reduce((e,t)=>Yg.includes(t.accreditation.name)?{...e,[t.accreditation.name]:t.accreditation.color}:e,{}),r=t.ticketId;return(0,i.jsxs)(Ba,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/dfco/accred-a4.jpg) no-repeat`,backgroundSize:"cover",fontFamily:"$default",position:"relative"},height:ig,width:sg,children:[(0,i.jsx)(Ar,{css:{left:"423px",position:"absolute",top:"145px"},height:91,width:91,children:m(n.fields?.picture?.url)&&(0,i.jsx)("img",{height:"100%",src:n.fields.picture.url,width:"100%"})}),(0,i.jsx)(Ar,{css:{left:"530px",fontWeight:600,lineHeight:"normal",position:"absolute",top:"151px"},children:s}),(0,i.jsx)(Ar,{css:{left:"530px",fontWeight:700,lineHeight:"normal",position:"absolute",textTransform:"uppercase",top:"176px"},children:n.fields.cf36682?.value||""}),o.P0&&(0,i.jsx)(qg,{css:{left:"421px",top:"280px"},children:(0,i.jsx)(Ar,{children:"P0"})}),o.P1&&(0,i.jsx)(qg,{css:{left:"421px",top:"280px"},children:(0,i.jsx)(Ar,{children:"P1"})}),o["P1 Aire Régie"]&&(0,i.jsx)(qg,{css:{left:"421px",top:"280px"},children:(0,i.jsx)(Ar,{children:"P1 A-R"})}),o.P2&&(0,i.jsx)(qg,{css:{left:"421px",top:"280px"},children:(0,i.jsx)(Ar,{children:"P2"})}),o.P3&&(0,i.jsx)(qg,{css:{left:"421px",top:"280px"},children:(0,i.jsx)(Ar,{children:"P3"})}),o.P4&&(0,i.jsx)(qg,{css:{left:"421px",top:"280px"},children:(0,i.jsx)(Ar,{children:"P4"})}),o["H-30"]&&(0,i.jsx)(Ar,{css:{backgroundColor:o["H-30"],color:"#FFF",fontWeight:600,left:"698px",lineHeight:"14px",padding:"2px 4px",position:"absolute",textAlign:"center",top:"307px"},children:"H-30"}),o.PC&&(0,i.jsx)(Ar,{css:{backgroundColor:o.PC,color:"#FFF",fontWeight:600,left:"746px",lineHeight:"14px",padding:"2px 4px",position:"absolute",textAlign:"center",top:"307px"},children:"PC"}),o["ZONE 1 - PELOUSE"]&&(0,i.jsxs)(qg,{css:{backgroundColor:o["ZONE 1 - PELOUSE"],left:"421px",top:"337px"},children:[(0,i.jsx)(Ar,{children:"1"}),(0,i.jsx)(Kg,{children:"PELOUSE"})]}),o["ZONE 2 - VESTIAIRES"]&&(0,i.jsxs)(qg,{css:{backgroundColor:o["ZONE 2 - VESTIAIRES"],left:"541px",top:"337px"},children:[(0,i.jsx)(Ar,{children:"2"}),(0,i.jsx)(Kg,{children:"VESTIAIRE"})]}),o["ZONE 3 - TRIBUNES"]&&(0,i.jsxs)(qg,{css:{backgroundColor:o["ZONE 3 - TRIBUNES"],left:"661px",top:"337px"},children:[(0,i.jsx)(Ar,{children:"3"}),(0,i.jsx)(Kg,{children:"TRIBUNES"})]}),o["ZONE 4 - MEDIAS"]&&(0,i.jsxs)(qg,{css:{backgroundColor:o["ZONE 4 - MEDIAS"],left:"421px",top:"387px"},children:[(0,i.jsx)(Ar,{children:"4"}),(0,i.jsx)(Kg,{children:"MEDIAS"})]}),o["ZONE 5 - AIRE REGIE TV"]&&(0,i.jsxs)(qg,{css:{backgroundColor:o["ZONE 5 - AIRE REGIE TV"],left:"541px",top:"387px"},children:[(0,i.jsx)(Ar,{children:"5"}),(0,i.jsx)(Kg,{children:"AIRE REGIE TV"})]}),o["ZONE 6 - HOSPITALITES"]&&(0,i.jsxs)(qg,{css:{backgroundColor:o["ZONE 6 - HOSPITALITES"],left:"661px",top:"387px"},children:[(0,i.jsx)(Ar,{children:"6"}),(0,i.jsx)(Kg,{children:"HOSPITALITÉS"})]}),o["ZONE 7 - SERVICES"]&&(0,i.jsxs)(qg,{css:{backgroundColor:o["ZONE 7 - SERVICES"],left:"421px",top:"437px"},children:[(0,i.jsx)(Ar,{children:"7"}),(0,i.jsx)(Kg,{children:"SERVICES"})]}),o["ZONE 8 - BORD TERRAIN"]&&(0,i.jsxs)(qg,{css:{backgroundColor:o["ZONE 8 - BORD TERRAIN"],left:"541px",top:"437px"},children:[(0,i.jsx)(Ar,{children:"8"}),(0,i.jsx)(Kg,{children:"BORD TERRAIN"})]}),o["ZONE 9 - PRESIDENTIELLE"]&&(0,i.jsxs)(qg,{css:{backgroundColor:o["ZONE 9 - PRESIDENTIELLE"],left:"661px",top:"437px"},children:[(0,i.jsx)(Ar,{children:"9"}),(0,i.jsx)(Kg,{children:"PRESIDENTIELLE"})]}),(0,i.jsxs)(Ba,{css:{alignItems:"center",flexDirection:"column",gap:"4px",left:"478px",position:"absolute",top:"489px",width:"234px"},children:[(0,i.jsx)(Ar,{height:28,width:1,children:(0,i.jsx)("img",{height:"100%",src:pg(r,{barcodeType:gg.Code39,height:28,width:234}),width:"100%"})}),(0,i.jsx)(Ar,{css:{fontSize:"10px"},children:r})]})]})},Xg=({css:e,children:t})=>(0,i.jsx)(Ba,{css:{alignItems:"center",border:"1px solid",flexDirection:"column",fontSize:"14px",fontWeight:700,height:"18px",justifyContent:"center",lineHeight:"14px",padding:"2px 0px",position:"absolute",width:"22px",...e},children:t}),Jg=["ZONE 1 - PELOUSE","ZONE 2 - VESTIAIRES","ZONE 3 - TRIBUNES","ZONE 4 - MEDIAS","ZONE 5 - AIRE REGIE TV","ZONE 6 - HOSPITALITES","ZONE 7 - SERVICES","ZONE 8 - BORD TERRAIN","ZONE 9 - PRESIDENTIELLE"],Qg=({event:e})=>{const t=e.volunteerRegistration,n=t.userInfo,s=t.accreditationsUsersInfos.reduce((e,t)=>Jg.includes(t.accreditation.name)?{...e,[t.accreditation.name]:t.accreditation.color}:e,{}),o=t.ticketId;return(0,i.jsxs)(Ba,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/dfco/accred-badge.jpg) no-repeat`,backgroundSize:"cover",fontFamily:"$default",position:"relative"},height:204,width:643,children:[(0,i.jsx)(Ar,{css:{left:"400px",position:"absolute",top:"39px"},height:87,width:87,children:m(n.fields?.picture?.url)&&(0,i.jsx)("img",{height:"100%",src:n.fields.picture.url,width:"100%"})}),(0,i.jsx)(Ar,{css:{left:"497px",fontSize:"10px",fontWeight:600,lineHeight:"normal",position:"absolute",top:"59px"},children:n.fields?.firstName?.value||""}),(0,i.jsx)(Ar,{css:{left:"497px",fontSize:"10px",fontWeight:600,lineHeight:"normal",position:"absolute",textTransform:"uppercase",top:"73px"},children:n.fields?.lastName?.value||""}),(0,i.jsx)(Ar,{css:{left:"497px",fontSize:"10px",fontWeight:700,lineHeight:"normal",position:"absolute",textTransform:"uppercase",top:"88px"},children:n.fields.cf36682?.value||""}),s["ZONE 1 - PELOUSE"]&&(0,i.jsx)(Xg,{css:{backgroundColor:s["ZONE 1 - PELOUSE"],left:"363px",top:"174px"},children:(0,i.jsx)(Ar,{children:"1"})}),s["ZONE 2 - VESTIAIRES"]&&(0,i.jsx)(Xg,{css:{backgroundColor:s["ZONE 2 - VESTIAIRES"],left:"391px",top:"174px"},children:(0,i.jsx)(Ar,{children:"2"})}),s["ZONE 3 - TRIBUNES"]&&(0,i.jsx)(Xg,{css:{backgroundColor:s["ZONE 3 - TRIBUNES"],left:"419px",top:"174px"},children:(0,i.jsx)(Ar,{children:"3"})}),s["ZONE 4 - MEDIAS"]&&(0,i.jsx)(Xg,{css:{backgroundColor:s["ZONE 4 - MEDIAS"],left:"447px",top:"174px"},children:(0,i.jsx)(Ar,{children:"4"})}),s["ZONE 5 - AIRE REGIE TV"]&&(0,i.jsx)(Xg,{css:{backgroundColor:s["ZONE 5 - AIRE REGIE TV"],left:"475px",top:"174px"},children:(0,i.jsx)(Ar,{children:"5"})}),s["ZONE 6 - HOSPITALITES"]&&(0,i.jsx)(Xg,{css:{backgroundColor:s["ZONE 6 - HOSPITALITES"],left:"503px",top:"174px"},children:(0,i.jsx)(Ar,{children:"6"})}),s["ZONE 7 - SERVICES"]&&(0,i.jsx)(Xg,{css:{backgroundColor:s["ZONE 7 - SERVICES"],left:"531px",top:"174px"},children:(0,i.jsx)(Ar,{children:"7"})}),s["ZONE 8 - BORD TERRAIN"]&&(0,i.jsx)(Xg,{css:{backgroundColor:s["ZONE 8 - BORD TERRAIN"],left:"559px",top:"174px"},children:(0,i.jsx)(Ar,{children:"8"})}),s["ZONE 9 - PRESIDENTIELLE"]&&(0,i.jsx)(Xg,{css:{backgroundColor:s["ZONE 9 - PRESIDENTIELLE"],left:"587px",top:"174px"},children:(0,i.jsx)(Ar,{children:"9"})}),(0,i.jsxs)(Ba,{css:{alignItems:"center",flexDirection:"column",gap:"4px",left:"93px",position:"absolute",top:"166px",width:"136px"},children:[(0,i.jsx)(Ar,{height:20,width:1,children:(0,i.jsx)("img",{height:"100%",src:pg(o,{barcodeType:gg.Code39,height:20,width:166}),width:"100%"})}),(0,i.jsx)(Ar,{css:{fontSize:"8px"},children:o})]})]})};var ep=n(7957);function tp(e){return(0,uc.A)(Object.entries((0,cc.A)(e,e=>`${e.position.name}-${e.positionSlot.range.start.startOf("day").toMillis()}`)).map(([e,t])=>{const n=(0,uc.A)(t,e=>e.positionSlot.range.start.toMillis());return{name:t[0].position.name,ranges:n.map(e=>e.positionSlot.range),slotsNames:(0,Za.A)((0,Bs.A)(n.map(({positionSlot:e})=>e.name)))}}),({ranges:e})=>e[0].start.toMillis())}var np=n(791);const ip=e=>{switch(e){case 16:return 7;case 24:return 10;case 32:return 14;case 40:return 16;case 48:return 18;case 56:return 20;case 64:return 24;case 88:return 30;case 96:return 36;case 110:return 40;case 160:return 48;case 310:return 120}},sp=e=>{const[t,n]=(0,L.useState)(m(e.image)?e.image:void 0);if((0,L.useEffect)(()=>{m(e.image)&&n(e.image)},[e.image]),m(t))return(0,i.jsx)("div",{style:{border:e.border,borderRadius:e.size+"px",height:`${e.size}px`,overflow:"hidden",width:`${e.size}px`},children:(0,i.jsx)("img",{alt:"Avatar",src:t,style:{height:`${e.size}px`,width:`${e.size}px`,verticalAlign:"baseline"}})});{const t=Dg(e.name,e.email);return(0,i.jsx)("div",{style:{borderRadius:e.size+"px",height:e.size+"px",overflow:"hidden",width:e.size+"px"},children:(0,i.jsx)("div",{className:"h-avatar-initials",style:{alignItems:"center",background:Fg(t),color:"white",display:"flex",fontSize:`${ip(e.size)}px`,height:"100%",justifyContent:"center",textTransform:"uppercase",width:"100%"},children:t})})}},op=e=>{const t=e.event.volunteerRegistration.userInfo,n=(0,Bs.A)(e.assignments.map(({name:e})=>e)).length,s=e.assignments.flatMap(e=>e.ranges),o=(0,Bs.A)(s.map(e=>e.start.startOf("day").toMillis())).length,r=(0,np.A)(s.map(e=>e.length("hours")));return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{css:{paddingTop:"$6"},justify:"center",width:1,children:(0,i.jsx)("img",{height:"56px",src:`${P.HEAVENT_ASSETS_URL}/badges/eurockeennes/eurockeennesLogo.png`,width:"103px"})}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsxs)(Ba,{align:"center",gap:"3",children:[(0,i.jsx)(sp,{email:t.email,image:t.fields?.picture?.url,name:t.name,size:40}),(0,i.jsxs)(Ba,{direction:"column",gap:"1",children:[(0,i.jsx)(Ar,{font:"gray800 textMd semiBold",children:t.name}),(0,i.jsxs)(Ba,{gap:"3",children:[(0,i.jsxs)(Ar,{color:"gray500",children:["Nb. de missions : ",n]}),(0,i.jsxs)(Ar,{color:"gray500",children:["Nb. de jours : ",o]}),(0,i.jsxs)(Ar,{color:"gray500",children:["Temps total affecté : ",r,"h"]})]})]})]})]})};let rp=class{translationService;constructor(e){this.translationService=e}minutesToHoursMinutesString(e){const t=Gs.dw.fromObject({minutes:e},{locale:vd(this.translationService.language)}).shiftTo("hours","minutes");return 0===t.minutes?t.shiftTo("hours").toHuman({unitDisplay:"narrow"}):0===t.hours?t.shiftTo("minutes").toHuman({unitDisplay:"narrow"}):t.toHuman({unitDisplay:"narrow"})}};rp=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[qn])],rp);const ap=e=>{const t=Zn(Jc),n=Zn(rp);return(0,i.jsxs)(Ba,{css:{background:"white",pageBreakBefore:0!==e.index?"always":void 0,px:"$8"},direction:"column",width:1,children:[e.header,(0,i.jsx)(Ya,{height:"5"}),(0,i.jsx)(Ar,{font:"gray800 textMd semiBold",children:"Planning des missions Eurockéennes 2023"}),(0,i.jsx)(Ya,{height:"2"}),(0,i.jsxs)(Sc,{children:[(0,i.jsxs)(kc,{children:[(0,i.jsx)(Gc,{children:"Nom de la mission"}),(0,i.jsx)(Gc,{width:410,children:"Date"}),(0,i.jsx)(Gc,{width:120,children:"Total"})]}),e.assignments.map((e,s)=>{const o=so(e.slotsNames),r=(0,np.A)(e.ranges.map(e=>e.toDuration("minutes").minutes));return(0,i.jsxs)(Mc,{css:{height:o?"54px":"44px"},children:[(0,i.jsx)(Oc,{css:{color:"$gray900",fontWeight:"$medium"},children:e.name}),(0,i.jsxs)(Oc,{direction:"column",gap:"1",justify:"center",width:410,children:[o&&(0,i.jsx)(Ar,{color:"gray900",width:1,children:e.slotsNames.join(", ")}),(0,i.jsxs)(Ar,{width:1,children:[(0,xd.A)(t.toLocaleString(e.ranges[0].start,eo.DateOnly.WeekdayLongMonthLong))," ",e.ranges.map(e=>`${e.start.toFormat("HH:mm")}-${e.end.toFormat("HH:mm")}`).join(" | ")]})]}),(0,i.jsx)(Oc,{width:120,children:n.minutesToHoursMinutesString(r)})]},s)})]})]})},lp=e=>{const t=(0,L.useMemo)(()=>tp(e.event.volunteerRegistration.positionsSlotsUsersInfos),[e.event]),n=(0,L.useMemo)(()=>(0,i.jsx)(op,{assignments:t,event:e.event}),[t,e.event]);return(0,i.jsx)(i.Fragment,{children:(0,ep.A)(t,17).map((e,t)=>(0,i.jsx)(ap,{assignments:e,header:n,index:t},t))})},dp=e=>(0,i.jsx)(i.Fragment,{children:e.event.volunteersRegistrations.nodes.map((t,n)=>(0,i.jsx)(Ba,{css:{background:"white",pageBreakBefore:0!==n?"always":void 0},direction:"column",width:1,children:(0,i.jsx)(lp,{event:{...e.event,volunteerRegistration:t}})},t.utid))}),cp=e=>(0,i.jsxs)(Ba,{align:"center",width:1,children:[(0,i.jsx)(Ba,{align:"center",css:{background:e.backgroundColor,color:"white",fontWeight:700},height:24,justify:"center",width:30,children:e.zoneNumber}),(0,i.jsx)(Ya,{width:"2"}),(0,i.jsx)(Ar,{css:{fontSize:"13px",fontWeight:700},children:e.zoneText})]}),up=()=>(0,i.jsx)(Ar,{height:24,width:1}),hp=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,s=4444===e.event.id,o=t.accreditationsUsersInfos.map(({accreditation:e})=>e.acronym),r=o.includes("CAT 1"),a=o.includes("CAT 2"),l=o.includes("CAT 3"),d=o.includes("CAT 4"),c=o.includes("CAT 5"),u=o.includes("CAT 6"),h=s?`${P.HEAVENT_ASSETS_URL}/badges/fcg/2425/bg_badge_saison.jpg`:`${P.HEAVENT_ASSETS_URL}/badges/fcg/2425/bg_badge_match.jpg`;return(0,i.jsxs)(Ba,{css:{background:`url(${h}) no-repeat`,backgroundSize:"cover",fontFamily:"$montserrat",position:"relative"},height:563,width:397,children:[(0,i.jsx)(Ar,{css:{border:"2px solid #004994",left:"38px",position:"absolute",top:"38px"},height:80,width:80,children:m(n.fields?.picture?.url)&&(0,i.jsx)("img",{height:"100%",src:n.fields.picture.url,width:"100%"})}),(0,i.jsxs)(Ba,{css:{color:"#00384f",fontSize:"12px",fontWeight:"900",left:"128px",lineHeight:"18px",position:"absolute",textTransform:"uppercase",top:"52px"},direction:"column",children:[(0,i.jsx)(Ar,{children:n.fields.cf10106?.value||""}),(0,i.jsx)(Ar,{children:n.fields?.firstName?.value||""}),(0,i.jsx)(Ar,{children:n.fields?.lastName?.value||""})]}),(0,i.jsx)(Ar,{css:{border:"2px solid #004994",left:"273px",padding:"$1",position:"absolute",top:"38px"},height:80,width:80,children:m(t.utid)&&(0,i.jsx)("img",{height:"100%",src:pg(t.utid,{color:"5d9dcb"}),width:"100%"})}),!s&&(0,i.jsx)(Ba,{align:"center",css:{color:"#00384f",fontSize:"30px",fontWeight:"900",height:"54px",left:"129px",lineHeight:"24px",position:"absolute",textTransform:"uppercase",top:"183px",width:"230px"},justify:"center",wrap:"wrap",children:e.event.name}),(0,i.jsxs)(Ba,{css:{gap:"7px",left:"38px",position:"absolute",top:"293px"},children:[(0,i.jsxs)(Ba,{direction:"column",gap:"2",children:[r?(0,i.jsx)(cp,{backgroundColor:"#8ec89a",zoneNumber:1,zoneText:"Terrain"}):(0,i.jsx)(up,{}),a?(0,i.jsx)(cp,{backgroundColor:"#ddca00",zoneNumber:2,zoneText:"Zone mixte"}):(0,i.jsx)(up,{}),l?(0,i.jsx)(cp,{backgroundColor:"#cd1719",zoneNumber:3,zoneText:"Espaces Media"}):(0,i.jsx)(up,{})]}),(0,i.jsxs)(Ba,{direction:"column",gap:"2",children:[d?(0,i.jsx)(cp,{backgroundColor:"#009fe3",zoneNumber:4,zoneText:"Tribunes"}):(0,i.jsx)(up,{}),c?(0,i.jsx)(cp,{backgroundColor:"#d89fc7",zoneNumber:5,zoneText:"Espaces et Salon VIP"}):(0,i.jsx)(up,{}),u?(0,i.jsx)(cp,{backgroundColor:"#010000",zoneNumber:6,zoneText:"PC Sécurité"}):(0,i.jsx)(up,{})]})]})]})},mp=e=>(0,i.jsx)(i.Fragment,{children:(0,ep.A)(e.event.volunteersRegistrations.nodes,4).map((t,n)=>(0,i.jsx)(Ba,{css:{pageBreakBefore:0!==n?"always":void 0},justify:"between",width:sg,wrap:"wrap",children:t.map(t=>(0,i.jsx)(hp,{event:{...e.event,volunteerRegistration:t}},t.userInfo.id))},`page-${n}`))}),gp=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,s=(0,uc.A)(Object.values((0,cc.A)(t.positionsSlotsUsersInfos,e=>e.positionSlot.range.start.startOf("day").toMillis())),e=>e[0].positionSlot.range.start.startOf("day")),o="MRP"===n.fields?.cf32955?.value,r=(0,uc.A)(t.accreditationsUsersInfos.flatMap(e=>2927===e.accreditation.id&&e.accreditationSlot.date?.isValid?[e.accreditationSlot]:[]),e=>e.date.toMillis()??0).map(e=>e.name).join(", "),a=(0,uc.A)(t.accreditationsUsersInfos.flatMap(e=>2938===e.accreditation.id&&e.accreditationSlot.date?.isValid?[e.accreditationSlot]:[]),e=>e.date.toMillis()??0).map(e=>e.name).join(", "),l=(0,uc.A)(t.accreditationsUsersInfos.flatMap(e=>2928===e.accreditation.id&&e.accreditationSlot.date?.isValid?[e.accreditationSlot]:[]),e=>e.date.toMillis()??0).map(e=>e.name).join(", "),d=t.accreditationsUsersInfos.some(e=>2931===e.accreditation.id||2932===e.accreditation.id),c=(0,uc.A)(t.accreditationsUsersInfos.flatMap(e=>2929===e.accreditation.id&&e.accreditationSlot.date?.isValid?[e.accreditationSlot]:[]),e=>e.date.toMillis()??0).map(e=>e.name).join(", "),u=(0,uc.A)(t.accreditationsUsersInfos.flatMap(e=>2930===e.accreditation.id&&e.accreditationSlot.date?.isValid?[e.accreditationSlot]:[]),e=>e.date.toMillis()??0).map(e=>e.name).join(", "),h=t.accreditationsUsersInfos.some(e=>2933===e.accreditation.id);return(0,i.jsx)(Ba,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/garorock/planning.jpg) no-repeat`,backgroundSize:"cover",fontFamily:"$inter",position:"relative"},height:ig,width:sg,children:(0,i.jsxs)(Ba,{css:{position:"absolute",px:"96px",top:"240px"},direction:"column",gap:"5",children:[o&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{direction:"column",gap:"4",children:s.map((e,t)=>{const n=e[0],s=(0,uc.A)(Object.values((0,cc.A)(e,e=>e.position.id)),e=>(0,rh.A)(e,e=>e.positionSlot.range.start.toMillis()).positionSlot.range.start.toMillis());return(0,i.jsxs)(Ba,{direction:"column",children:[(0,i.jsx)(Ar,{css:{color:"#faf5dc",fontSize:"16px",fontWeight:"700",textTransform:"capitalize"},children:n.positionSlot.range.start.toFormat("cccc dd MMMM",{locale:"fr"})}),s.map((e,t)=>{const n=e[0];return(0,i.jsxs)(Ar,{css:{color:"#faf5dc",fontSize:"16px"},children:[n.position.name," :"," ",(s=e.map(({positionSlot:e})=>e.range),(0,uc.A)(s,e=>e.start.toMillis()).map(e=>`${e.start.toFormat("H:mm")}-${e.end.toFormat("H:mm")}`).join(" | "))]},t);var s})]},t)})}),(0,i.jsx)(Ba,{justify:"center",width:602,children:(0,i.jsx)(Ar,{height:4,width:332,children:(0,i.jsx)("img",{height:"100%",src:`${P.HEAVENT_ASSETS_URL}/badges/garorock/dot.png`,width:"100%"})})})]}),(0,i.jsxs)(Ba,{css:{color:"#faf5dc",fontSize:"16px"},direction:"column",gap:"5",children:[m(r)&&(0,i.jsxs)(Ba,{direction:"column",children:[(0,i.jsx)(Ar,{children:"Un petit déjeuner au catering bénévole est prévu pour toi le(s) :"}),(0,i.jsx)(Ar,{fontWeight:"medium",children:r})]}),m(a)&&(0,i.jsxs)(Ba,{direction:"column",children:[(0,i.jsx)(Ar,{children:"Un petit déjeuner au Garotri est prévu pour toi le(s) :"}),(0,i.jsx)(Ar,{fontWeight:"medium",children:a})]}),m(l)&&(0,i.jsxs)(Ba,{direction:"column",children:[(0,i.jsx)(Ar,{children:"Un panier repas est prévu pour toi le(s) :"}),(0,i.jsx)(Ar,{fontWeight:"medium",children:l})]}),d&&(0,i.jsx)(Ar,{children:"Une somme d’argent te sera crédité sur ta carte pour tes jours de présence"}),m(c)&&(0,i.jsxs)(Ba,{direction:"column",children:[(0,i.jsx)(Ar,{children:"Un repas au catering technique est prévu pour toi le(s) :"}),(0,i.jsx)(Ar,{fontWeight:"medium",children:c})]}),m(u)&&(0,i.jsxs)(Ba,{direction:"column",children:[(0,i.jsx)(Ar,{children:"Un repas au Garo snack d’une valeur de 6€ est prévu pour toi le(s) :"}),(0,i.jsx)(Ar,{fontWeight:"medium",children:u})]}),h&&(0,i.jsx)(Ar,{children:"Des tickets repas te seront fournis pour les utiliser sur tous les stands du festival"})]})]})})},pp=e=>"All Access Pass"===e||"All Access Pass + A"===e?`${P.HEAVENT_ASSETS_URL}/badges/goldenCoast/pass_back.jpg`:`${P.HEAVENT_ASSETS_URL}/badges/goldenCoast/classique_back.jpg`,fp=e=>{const t=e.event.volunteerRegistration.userInfo,n=t.fields?.cf37556?.value??"",s="All Access Pass"===n||"All Access Pass + A"===n?"#faed4f":"#294999";return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ba,{css:{background:`url(${o=n,"All Access Pass"===o?`${P.HEAVENT_ASSETS_URL}/badges/goldenCoast/pass_front.jpg`:"All Access Pass + A"===o?`${P.HEAVENT_ASSETS_URL}/badges/goldenCoast/pass_plus_front.jpg`:`${P.HEAVENT_ASSETS_URL}/badges/goldenCoast/classique_front.jpg`}) no-repeat`,backgroundSize:"212px 317px",fontFamily:"$neueMontreal",position:"relative"},height:317,width:212,children:[(0,i.jsx)(Ar,{css:{borderRadius:"4px",left:"55px",overflow:"hidden",position:"absolute",top:"105px"},height:102,width:102,children:m(t.fields?.picture?.url)&&(0,i.jsx)("img",{height:"100%",src:t.fields.picture.url,width:"100%"})}),(0,i.jsx)(Ar,{css:{color:s,fontSize:"24px",fontWeight:"700",position:"absolute",textTransform:"uppercase",top:"218px"},textAlign:"center",width:1,children:t.fields?.lastName?.value||""}),(0,i.jsx)(Ar,{css:{color:s,fontSize:"24px",fontWeight:"700",position:"absolute",top:"248px"},textAlign:"center",width:1,children:t.fields?.firstName?.value||""}),(0,i.jsx)(Ar,{css:{color:s,fontWeight:"700",position:"absolute",top:"286px"},textAlign:"center",width:1,children:t.fields.cf33258?.value})]}),(0,i.jsx)(Ba,{css:{background:`url(${pp(n)}) no-repeat`,backgroundSize:"212px 317px",pageBreakBefore:"always"},height:317,width:212})]});var o},_p=["TERRAIN","VESTIAIRES","ESPACE PRESSE","SALON NEODIF","SALON GEOFIT","SALON PRESTIGE"],xp={TERRAIN:"Mode_Isolation_1.png",VESTIAIRES:"Mode_Isolation_2.png","ESPACE PRESSE":"Mode_Isolation_3.png","SALON NEODIF":"Mode_Isolation_4.png","SALON GEOFIT":"Mode_Isolation_5.png","SALON PRESTIGE":"Mode_Isolation_6.png"},Ip=({css:e,name:t})=>(0,i.jsx)(Ar,{css:{background:`url(https://assets.recrewteer.com/badges/hbc/lnh/${xp[t]}) no-repeat`,backgroundSize:"cover",height:"30px",position:"absolute",width:"30px",...e}}),vp=({event:e})=>{const t=e.volunteerRegistration,n=t.userInfo,s=n.fields?.cf38222?.value,o=t.accreditationsUsersInfos.reduce((e,t)=>_p.includes(t.accreditation.name)?{...e,[t.accreditation.name]:!0}:e,{});return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ba,{css:{background:"url(https://assets.recrewteer.com/badges/hbc/ldc/2025/bg_badge_recto.jpg) no-repeat",backgroundSize:"cover",color:"#FFF",fontFamily:"$formulaCondensedBold",position:"relative"},height:476,width:363,children:[(0,i.jsx)(Ar,{css:{fontSize:"26px",fontWeight:700,left:"34px",lineHeight:"normal",position:"absolute",textAlign:"center",textDecoration:"uppercase",top:"221px"},children:`${n.fields?.firstName?.value||""} ${n.fields?.lastName?.value||""}`.trim().toUpperCase()}),(0,i.jsx)(Ar,{css:{fontSize:"13px",fontWeight:"700",left:"34px",lineHeight:"normal",position:"absolute",textAlign:"center",top:"172px"},children:n.fields.cf38077?.value}),(0,i.jsx)(Ar,{css:{fontSize:"26px",fontWeight:700,left:"34px",lineHeight:"normal",position:"absolute",textAlign:"center",textDecoration:"uppercase",top:"301px"},children:(s||"").toUpperCase()}),o.TERRAIN&&(0,i.jsx)(Ip,{css:{left:"251px",top:"314px"},name:"TERRAIN"}),o.VESTIAIRES&&(0,i.jsx)(Ip,{css:{left:"299px",top:"314px"},name:"VESTIAIRES"}),o["ESPACE PRESSE"]&&(0,i.jsx)(Ip,{css:{left:"251px",top:"363px"},name:"ESPACE PRESSE"}),o["SALON NEODIF"]&&(0,i.jsx)(Ip,{css:{left:"299px",top:"363px"},name:"SALON NEODIF"}),o["SALON GEOFIT"]&&(0,i.jsx)(Ip,{css:{left:"251px",top:"412px"},name:"SALON GEOFIT"}),o["SALON PRESTIGE"]&&(0,i.jsx)(Ip,{css:{left:"299px",top:"412px"},name:"SALON PRESTIGE"})]}),(0,i.jsx)(Ba,{css:{background:"url(https://assets.recrewteer.com/badges/hbc/ldc/2025/bg_badge_verso.jpg) no-repeat",backgroundSize:"cover",position:"relative"},height:476,width:363})]})},bp=["TERRAIN","VESTIAIRES","ESPACE PRESSE","SALON NEODIF","SALON GEOFIT","SALON PRESTIGE"],jp={TERRAIN:"Mode_Isolation_1.png",VESTIAIRES:"Mode_Isolation_2.png","ESPACE PRESSE":"Mode_Isolation_3.png","SALON NEODIF":"Mode_Isolation_4.png","SALON GEOFIT":"Mode_Isolation_5.png","SALON PRESTIGE":"Mode_Isolation_6.png"},Cp=({css:e,name:t})=>(0,i.jsx)(Ar,{css:{background:`url(https://assets.recrewteer.com/badges/hbc/lnh/${jp[t]}) no-repeat`,backgroundSize:"cover",height:"47px",position:"absolute",top:"463px",width:"47px",...e}}),yp=({event:e})=>{const t=e.volunteerRegistration,n=t.userInfo,s=n.fields?.cf38222?.value,o=t.accreditationsUsersInfos.reduce((e,t)=>bp.includes((t.accreditation?.name||"").toUpperCase())?{...e,[t.accreditation.name]:!0}:e,{});return(0,i.jsxs)(Ba,{css:{fontFamily:"$zuumeMedium",position:"relative"},height:og,width:rg,children:[(0,i.jsx)(Ar,{css:{left:"52px",position:"absolute",top:"205px"},height:111,width:111,children:m(n.fields?.picture?.url)&&(0,i.jsx)("img",{height:"100%",src:n.fields.picture.url,width:"100%"})}),(0,i.jsx)(Ar,{css:{left:"69px",position:"absolute",top:"317px"},textAlign:"center",width:77,children:n.id}),(0,i.jsx)(Ar,{css:{fontSize:"20px",left:"178px",lineHeight:"normal",position:"absolute",right:"52px",textAlign:"center",top:"205px"},children:n.fields?.lastName?.value||""}),(0,i.jsx)(Ar,{css:{fontSize:"20px",left:"178px",lineHeight:"normal",position:"absolute",right:"52px",textAlign:"center",top:"229px"},children:n.fields?.firstName?.value||""}),(0,i.jsx)(Ar,{css:{fontFamily:"$zuumeBold",fontSize:"25px",fontWeight:"700",left:"178px",lineHeight:"normal",position:"absolute",right:"52px",textAlign:"center",top:"261px"},children:n.fields.cf38077?.value}),(0,i.jsx)(Ar,{css:{fontSize:"20px",left:"178px",lineHeight:"normal",position:"absolute",right:"52px",textAlign:"center",textDecoration:"uppercase",top:"298px"},children:s}),o.TERRAIN&&(0,i.jsx)(Cp,{css:{left:"45px"},name:"TERRAIN"}),o.VESTIAIRES&&(0,i.jsx)(Cp,{css:{left:"96px"},name:"VESTIAIRES"}),o["ESPACE PRESSE"]&&(0,i.jsx)(Cp,{css:{left:"149px"},name:"ESPACE PRESSE"}),o["SALON NEODIF"]&&(0,i.jsx)(Cp,{css:{left:"201px"},name:"SALON NEODIF"}),o["SALON GEOFIT"]&&(0,i.jsx)(Cp,{css:{left:"253px"},name:"SALON GEOFIT"}),o["SALON PRESTIGE"]&&(0,i.jsx)(Cp,{css:{left:"306px"},name:"SALON PRESTIGE"})]})},kp=e=>{switch(e){case"ORGA":return`${P.HEAVENT_ASSETS_URL}/badges/lnh/Orga_Recto_v2.jpg`;case"Bénévoles":return`${P.HEAVENT_ASSETS_URL}/badges/lnh/Benevole_Recto.jpg`;case"MEDIA PRESSE":return`${P.HEAVENT_ASSETS_URL}/badges/lnh/Media_presse_Recto.jpg`;case"MEDIA PHOTOGRAPHE":return`${P.HEAVENT_ASSETS_URL}/badges/lnh/Media_Photo_Recto.jpg`;case"EQUIPES":return`${P.HEAVENT_ASSETS_URL}/badges/lnh/Equipe_Recto.jpg`;case"VIP":return`${P.HEAVENT_ASSETS_URL}/badges/lnh/VIP_recto.jpg`;default:return""}},Ap=e=>{switch(e){case"ORGA":return"#6f2c91";case"Bénévoles":return"#72BF44";case"MEDIA PRESSE":return"#294EA2";case"MEDIA PHOTOGRAPHE":return"#ED1C24";case"EQUIPES":return"#EBCB00";case"VIP":return"#F7941D";default:return""}},wp=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,s=Rg(n.fields,"population",""),o=t.positionsSlotsUsersInfos[0]?.position?.name||"",r=(0,Bs.A)((0,Za.A)(t.accreditationsUsersInfos.map(e=>e.accreditation.acronym))),a="Bénévoles"===s?o:"ORGA"===s?n.fields.cf36081?.value:"EQUIPES"===s?n.fields?.cf36079?.value:"MEDIA PRESSE"===s||"MEDIA PHOTOGRAPHE"===s?n.fields?.cf36082?.value:"VIP"===s?n.fields?.cf36085?.value:"";return(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(Ba,{css:{background:`url(${kp(s)}) no-repeat`,backgroundSize:"cover",fontFamily:"$tuskerGrotesk",fontWeight:"500",position:"relative"},height:321,width:212,children:[(0,i.jsx)(Ar,{css:{left:"125px",position:"absolute",top:"30px"},height:58,width:58,children:m(n.fields?.picture?.url)&&(0,i.jsx)("img",{height:"100%",src:n.fields.picture.url,width:"100%"})}),(0,i.jsx)(Ar,{css:{fontSize:"11px",left:"39px",position:"absolute",textTransform:"uppercase",top:"127px"},children:n.fields?.firstName?.value||""}),(0,i.jsx)(Ar,{css:{fontSize:"11px",left:"39px",position:"absolute",textTransform:"uppercase",top:"156px"},children:n.fields?.lastName?.value||""}),(0,i.jsx)(Ar,{css:{fontSize:"11px",left:"39px",position:"absolute",textTransform:"uppercase",top:"186px"},children:a}),(0,i.jsx)(Ba,{css:{gap:"2px",left:"31px",position:"absolute",top:"241px"},children:(0,Dc.A)(1,9).map(e=>(0,i.jsx)(Ba,{align:"center",css:{background:"white",borderRadius:"17px",color:Ap(s),fontFamily:"$gilroy",fontSize:"7px",fontWeight:"700",visibility:r.includes(e.toString(10))?"visible":"hidden"},height:17,justify:"center",width:17,children:e},e))})]})})},Sp=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,s=Object.values((0,cc.A)(t.positionsSlotsUsersInfos,e=>e.positionSlot.range.start.startOf("day").toMillis()));return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ba,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/moorea/contremarque.jpg) no-repeat`,backgroundSize:"cover",fontFamily:"$unbounded",position:"relative"},height:ig,width:sg,children:[(0,i.jsxs)(Ba,{css:{color:"$gray800",fontSize:"22px",fontWeight:"700",left:"96px",position:"absolute",top:"239px"},direction:"column",children:[(0,i.jsx)(Ar,{children:n.fields?.firstName?.value||""}),(0,i.jsx)(Ar,{children:n.fields?.lastName?.value||""})]}),(0,i.jsx)(Ar,{css:{position:"absolute",right:"96px",top:"222px"},height:90,width:90,children:(0,i.jsx)("img",{height:"100%",src:pg(t.ticketId,{height:90,width:90}),width:"100%"})}),(0,i.jsxs)(Ar,{color:"gray800",css:{fontSize:"12px",left:"96px",position:"absolute",top:"548px"},children:["Chèr.e ",n.fields?.firstName?.value||"",","]})]}),(0,i.jsx)(Ba,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/moorea/Planning.jpg) no-repeat`,backgroundSize:"cover",fontFamily:"$unbounded",pageBreakBefore:"always",position:"relative"},height:ig,width:sg,children:(0,i.jsx)(Ba,{css:{left:"92px",position:"absolute",top:"372px"},direction:"column",gap:"6",children:s.map((e,t)=>{const n=e[0];return(0,i.jsxs)(Ba,{direction:"column",gap:"2",children:[(0,i.jsx)(Ar,{css:{color:"#a26fd2",fontSize:"16px",fontWeight:"700",textTransform:"uppercase"},children:n.positionSlot.range.start.toFormat("cccc dd MMMM yyyy",{locale:"fr"})}),e.map(({position:e,positionSlot:{range:t}},n)=>(0,i.jsxs)(Ar,{children:[e.name," / ",t.start.toFormat("HH:mm"),"-",t.end.toFormat("HH:mm")]},n))]},t)})})})]})},Ep=e=>{const t=e.event.volunteerRegistration,n=t.userInfo;return(0,i.jsxs)(Ba,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/nuitssecretes/background.jpg) no-repeat`,backgroundSize:"cover",fontFamily:"$poppins",position:"relative"},height:ig,width:sg,children:[(0,i.jsx)(Ar,{css:{fontSize:"28px",fontWeight:"700",position:"absolute",textAlign:"center",top:"545px"},width:1,children:n.fields?.firstName?.value||""}),(0,i.jsx)(Ar,{css:{fontSize:"28px",fontWeight:"700",position:"absolute",textAlign:"center",top:"584px"},width:1,children:n.fields?.lastName?.value||""}),(0,i.jsxs)(Ba,{align:"center",css:{position:"absolute",top:"654px"},direction:"column",gap:"2",width:1,children:[(0,i.jsx)(Ar,{height:94,width:94,children:(0,i.jsx)("img",{height:"100%",src:pg(t.ticketId,{height:94,width:94}),width:"100%"})}),(0,i.jsx)(Ar,{css:{fontSize:"10px"},children:t.ticketId})]})]})},Tp=e=>{switch(e){case"PARTENAIRE":return`${P.HEAVENT_ASSETS_URL}/badges/openbrest/v2/VIP@3x.jpg`;case"PARTENAIRE - Fast Pass":default:return"";case"VIP LOGES":case"VIP LOGES Fast Pass":return`${P.HEAVENT_ASSETS_URL}/badges/openbrest/v2/vip_loges.png`;case"ADMINISTRATEUR":return`${P.HEAVENT_ASSETS_URL}/badges/openbrest/v2/ADMIN@3x.png`;case"MÉDIAS - JOURNALISTE":return`${P.HEAVENT_ASSETS_URL}/badges/openbrest/v2/MEDIAS_JOURNALISTE@3x.png`;case"MÉDIAS - PHOTOGRAPHE":return`${P.HEAVENT_ASSETS_URL}/badges/openbrest/v2/MEDIAS_PHOTOGRAPHE@3x.png`;case"BÉNÉVOLES":return`${P.HEAVENT_ASSETS_URL}/badges/openbrest/v2/STAFF@3x.png`;case"CHAUFFEUR":return`${P.HEAVENT_ASSETS_URL}/badges/openbrest/v2/CHAUFFEUR@3x.png`;case"RAMASSEUR DE BALLES":return`${P.HEAVENT_ASSETS_URL}/badges/openbrest/v2/ramasseurs.png`;case"JUGE DE LIGNE":return`${P.HEAVENT_ASSETS_URL}/badges/openbrest/v2/juge_lignes.png`;case"OFFICIEL ATP":return`${P.HEAVENT_ASSETS_URL}/badges/openbrest/v2/OFFICIEL@3x.png`;case"ORGANISATION":return`${P.HEAVENT_ASSETS_URL}/badges/openbrest/v2/ORGANISATION@3x.png`;case"PRESTATAIRE":return`${P.HEAVENT_ASSETS_URL}/badges/openbrest/v2/PRESTATAIRE@3x.png`;case"JOUEUR":return`${P.HEAVENT_ASSETS_URL}/badges/openbrest/v2/PLAYER@3x.png`;case"COACH":return`${P.HEAVENT_ASSETS_URL}/badges/openbrest/v2/COACH@3x.png`;case"GUEST":return`${P.HEAVENT_ASSETS_URL}/badges/openbrest/v2/GUEST@3x.png`;case"SUPERVISEUR":return`${P.HEAVENT_ASSETS_URL}/badges/openbrest/v2/supervisor_atp.png`}},zp=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,s=n.fields?.cf31279?.value??"",o="OFFICIEL ATP"===s||"ORGANISATION"===s||"ADMINISTRATEUR"===s||"PRESTATAIRE"===s||"MÉDIAS - PHOTOGRAPHE"===s||"MÉDIAS - JOURNALISTE"===s||"VIP LOGES"===s||"VIP LOGES Fast Pass"===s||"PARTENAIRE"===s?`${n.fields?.firstName?.value||""} ${n.fields?.lastName?.value||""}`:n.fields?.firstName?.value||"",r="OFFICIEL ATP"===s||"ORGANISATION"===s?n.fields?.cf36132?.value:"ADMINISTRATEUR"===s||"PRESTATAIRE"===s||"MÉDIAS - PHOTOGRAPHE"===s||"MÉDIAS - JOURNALISTE"===s||"VIP LOGES"===s||"VIP LOGES Fast Pass"===s||"PARTENAIRE"===s?n.fields?.cf31319?.value:(n.fields?.lastName?.value||"").toUpperCase();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ba,{css:{background:`url(${Tp(s)}) no-repeat`,backgroundSize:"cover",fontFamily:"$sharpGrotesk",position:"relative"},height:331,width:208,children:[(0,i.jsx)(Ar,{css:{borderRadius:"$1",left:"61px",overflow:"hidden",position:"absolute",top:"169px"},height:80,width:80,children:m(n.fields?.picture?.url)&&(0,i.jsx)("img",{height:"100%",src:n.fields.picture.url,width:"100%"})}),(0,i.jsx)(Ar,{css:{color:"white",fontWeight:"600",position:"absolute",top:"285px"},textAlign:"center",width:1,children:o}),(0,i.jsx)(Ar,{css:{color:"white",fontWeight:"600",position:"absolute",top:"301px"},textAlign:"center",width:1,children:r})]}),(0,i.jsx)(Ba,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/openbrest/v2/VERSO@3x.png) no-repeat`,backgroundSize:"cover",pageBreakBefore:"always",position:"relative"},height:331,width:208,children:(0,i.jsx)(Ar,{css:{left:"59px",position:"absolute",top:"115px"},height:90,width:90,children:(0,i.jsx)("img",{height:"100%",src:pg(t.ticketId,{height:90,width:90}),width:"100%"})})})]})},Op=e=>{const t=e.event.volunteerRegistration.userInfo,n=t.fields.phone?.internationalFormat||"";return(0,i.jsxs)(Ba,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/p2n/planning_masque.jpg) no-repeat`,backgroundSize:"cover",pageBreakBefore:"always",position:"relative"},direction:"column",height:ig,width:sg,children:[(0,i.jsx)(Ar,{css:{left:"48px",position:"absolute",top:"47px"},children:(0,i.jsx)(sp,{email:t.email,image:t.fields?.picture?.url,name:t.name,size:40})}),(0,i.jsxs)(Ba,{css:{left:"104px",position:"absolute",top:"45px"},direction:"column",children:[(0,i.jsx)(Ar,{css:{color:"$gray800",fontSize:"16px",fontWeight:"600"},children:t.name}),(0,i.jsx)(Ar,{color:"gray800",children:n})]}),(0,i.jsx)(Ar,{css:{color:"black",fontSize:"24px",fontWeight:"700",position:"absolute",top:"112px"},textAlign:"center",width:1,children:e.title}),(0,i.jsx)(Ba,{css:{gap:"28px",flex:"1",left:"48px",position:"absolute",top:"172px",width:"calc(100% - 96px)"},direction:"column",children:e.children})]})},Rp=Gs.IX.fromDateTimes(Gs.c9.fromObject({year:2025,month:6,day:6}).startOf("day"),Gs.c9.fromObject({year:2025,month:6,day:8}).endOf("day"));var $p;function Dp(){return Dp=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const t=Zn(Jc),n=e.psui.position,s=n.category,o=e.psui.positionSlot,r=(0,uc.A)((0,xh.A)(n.leaders.concat(s.leaders),e=>e.userInfo.id),e=>e.userInfo.name).map(e=>e.userInfo.name).join(", ");return(0,i.jsxs)(Ba,{direction:"column",children:[(0,i.jsx)(Ar,{css:{color:"black",fontWeight:"700",textTransform:"uppercase"},children:t.toLocaleString(o.range.start,eo.DateOnly.WeekdayLongMonthLong)}),(0,i.jsx)(Ya,{height:"2"}),(0,i.jsxs)(Ba,{align:"center",gap:"2",children:[(0,i.jsx)(Ba,{align:"center",css:{"& svg":{fill:"black",height:"100%",width:"100%"}},height:16,justify:"center",width:16,children:(0,i.jsx)(Pp,{})}),(0,i.jsxs)(Ar,{color:"gray800",children:[(0,i.jsx)(ng,{css:{fontWeight:"600"},children:n.name})," | De"," ",o.range.start.toFormat("H:mm")," à ",o.range.end.toFormat("H:mm")]})]}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsxs)(Ba,{gap:"2",children:[(0,i.jsx)(Ba,{align:"center",css:{"& svg":{fill:"black",height:"100%",width:"100%"}},height:16,justify:"center",width:16,children:(0,i.jsx)(Np,{})}),(0,i.jsxs)(Ar,{color:"gray800",children:[(0,i.jsx)(ng,{css:{fontWeight:"600"},children:"Responsable : "}),r]})]}),(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(Ar,{css:{color:"black"},children:(0,i.jsx)(Cg,{css:{"& > p:first-child":{marginTop:0},"& > p:last-child":{marginBottom:0}},text:n.description})})]})},Bp=e=>{const t=e.event.volunteerRegistration,[n,s]=(0,oh.A)(t.positionsSlotsUsersInfos,e=>e.positionSlot.range.overlaps(Rp));return(0,i.jsx)(i.Fragment,{children:so(n)&&(0,i.jsx)(Op,{event:e.event,title:"Planning P2N 2025",children:(0,uc.A)(n,({positionSlot:e})=>e.range.start.toMillis()).map(e=>(0,i.jsx)(Lp,{psui:e},e.id))})})},Vp=e=>{const t=Zn(Jc);return(0,i.jsxs)(Ba,{direction:"column",gap:"2",children:[(0,i.jsx)(Ar,{css:{color:"black",fontWeight:"700",textTransform:"uppercase"},children:e.psuis[0].position.name}),(0,uc.A)(e.psuis,e=>e.positionSlot.range.start.toMillis()).map(e=>{const n=e.positionSlot;return(0,i.jsxs)(Ar,{color:"gray800",css:{fontSize:"16px"},children:[(0,i.jsx)(ng,{css:{fontWeight:"600",textTransform:"capitalize"},children:t.toLocaleString(n.range.start,{month:"long",day:"numeric",weekday:"long"})})," ","| De ",n.range.start.toFormat("H:mm")," à"," ",n.range.end.toFormat("H:mm")]},e.id)})]})},Up=e=>{const t=e.event.volunteerRegistration,[n,s]=(0,oh.A)(t.positionsSlotsUsersInfos,e=>e.positionSlot.range.overlaps(Rp)),o=(0,uc.A)(Object.entries((0,cc.A)(s,e=>e.position.name)),([e])=>e);return(0,i.jsx)(i.Fragment,{children:so(s)&&(0,i.jsx)(Op,{event:e.event,title:"Planning Montage/ Démontage P2N 2025",children:o.map(([e,t],n)=>(0,i.jsx)(Vp,{psuis:t},n))})})},Wp=e=>{switch(e){case"BACKSTAGE":return`${P.HEAVENT_ASSETS_URL}/badges/p2n/badgev2/Backstage.png`;case"ALL ACCES":return`${P.HEAVENT_ASSETS_URL}/badges/p2n/badgev2/Orga_All_access.png`;case"BÉNÉVOLE":return`${P.HEAVENT_ASSETS_URL}/badges/p2n/badgev2/Benevole.png`;case"GENDARME":return`${P.HEAVENT_ASSETS_URL}/badges/p2n/badgev2/Gendarme.png`;case"MÉDIA":return`${P.HEAVENT_ASSETS_URL}/badges/p2n/badgev2/Media.png`;case"PARTENAIRE":return`${P.HEAVENT_ASSETS_URL}/badges/p2n/badgev2/Partenaire.png`;case"POMPIER":return`${P.HEAVENT_ASSETS_URL}/badges/p2n/badgev2/Pompier.png`;case"PRESTATAIRE":return`${P.HEAVENT_ASSETS_URL}/badges/p2n/badgev2/Prestataire.png`;case"PRÉVENTION":return`${P.HEAVENT_ASSETS_URL}/badges/p2n/badgev2/Prevention.png`;case"SÉCURITÉ":return`${P.HEAVENT_ASSETS_URL}/badges/p2n/badgev2/Securite.png`;default:return""}},Gp=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,s=3613===e.event.id?2434:2081,o=(0,uc.A)(t.accreditationsUsersInfos.filter(({accreditation:e})=>e.id===s),e=>e.accreditationSlot.date?.toMillis()??0).map(({accreditationSlot:e})=>e.name).join(""),r=n.fields?.cf26723?.value??"";return(0,i.jsxs)(Ba,{css:{background:`url(${Wp(r)}) no-repeat`,backgroundSize:"cover",fontFamily:"$now",position:"relative"},height:325,width:208,children:[(0,i.jsx)(Ar,{css:{color:"black",fontFamily:"$nowMedium",fontSize:"16px",fontWeight:"600",position:"absolute",textAlign:"center",textTransform:"uppercase",top:"111px",width:"100%"},children:n.fields?.firstName?.value||""}),(0,i.jsx)(Ar,{css:{color:"black",fontFamily:"$nowMedium",fontSize:"16px",fontWeight:"600",position:"absolute",textAlign:"center",textTransform:"uppercase",top:"139px",width:"100%"},children:n.fields?.lastName?.value||""}),(0,i.jsxs)(Ba,{align:"center",css:{position:"absolute",top:"170px",width:"100%"},children:[(0,i.jsx)(Ar,{css:{color:"black",flex:"1",fontFamily:"$nowMedium",fontSize:"16px",fontWeight:"600",textAlign:"center"},children:o}),(0,i.jsx)(Ba,{css:{paddingRight:"5px"},width:169,children:(0,i.jsx)(Ar,{height:26,width:1,children:(0,i.jsx)("img",{height:"100%",src:pg(t.ticketId,{barcodeType:gg.Code39,height:26,width:164}),width:"100%"})})})]}),["PRESTATAIRE","PRÉVENTION","SÉCURITÉ"].some(e=>e===r)&&(0,i.jsx)(Ba,{align:"center",css:{position:"absolute",top:"249px",width:"100%"},children:(0,i.jsx)(Ar,{css:{color:"white",flex:"1",fontFamily:"$kobe",fontSize:"12px",fontWeight:"900",lineHeight:"12.78px",margin:"0 53px",textAlign:"center"},children:e.event.volunteerRegistration.delegation?.name.toUpperCase()})})]})},Hp=e=>e.includes("BLEU_CLAIR")?`${P.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/versos/bleu_clair_verso.jpg`:e.includes("BLEU_FONCE")?`${P.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/versos/bleu_fonce_verso.jpg`:e.includes("JAUNE")?`${P.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/versos/jaune_verso.jpg`:e.includes("ORANGE")?`${P.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/versos/orange_verso.jpg`:e.includes("VERT")?`${P.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/versos/vert_verso.jpg`:e.includes("VIOLET")?`${P.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/versos/violet_verso.jpg`:"",qp=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,s=t.accreditationsUsersInfos.map(({accreditation:e})=>e.acronym),o=n.fields?.cf1019?.value;return(0,i.jsx)(Ba,{css:{background:`url(${Hp(s)}) no-repeat`,backgroundSize:"cover",pageBreakBefore:"always",position:"relative"},height:476,width:368,children:(0,i.jsx)(Ba,{align:"center",css:{color:"black",fontSize:"16px",fontWeight:"700",height:"39px",left:"29px",position:"absolute",top:"31px",width:"40px"},justify:"center",children:o})})},Kp=e=>e.includes("BLEU_CLAIR")?`${P.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/bleu_clair/bleu_clair_recto.jpg`:e.includes("BLEU_FONCE")?`${P.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/bleu_fonce/bleu_fonce_recto.jpg`:e.includes("JAUNE")?`${P.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/jaune/jaune_recto.jpg`:e.includes("ORANGE")?`${P.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/orange/orange_recto.jpg`:e.includes("VERT")?`${P.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/vert/vert_recto.jpg`:e.includes("VIOLET")?`${P.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/violet/violet_recto.jpg`:"",Yp=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,s=t.accreditationsUsersInfos.map(({accreditation:e})=>e.acronym),o=(0,Bs.A)(t.positionsSlotsUsersInfos.map(e=>e.position.name)),r=s.includes("JAUNE")||s.includes("BLEU_CLAIR")?"black":"white",a=n.fields?.cf20600?.value??"",l=n.fields?.cf21104?.value??"",d=n.fields?.cf21129?.value??[];return(0,i.jsxs)(Ba,{css:{background:`url(${Kp(s)}) no-repeat`,backgroundSize:"cover",pageBreakBefore:"always",position:"relative"},height:476,width:368,children:[(0,i.jsx)(Ar,{css:{position:"absolute",right:"40px",top:"43px"},height:65,width:65,children:(0,i.jsx)("img",{height:"100%",src:pg(t.ticketId,{height:65,width:65}),width:"100%"})}),(0,i.jsx)(Ar,{css:{borderRadius:"107px",height:"107px",left:"131px",overflow:"hidden",position:"absolute",top:"127px",width:"107px"},children:n.fields?.picture&&(0,i.jsx)("img",{height:"100%",src:n.fields.picture.url,width:"100%"})}),(0,i.jsx)(Ar,{css:{color:r,fontSize:"18px",fontWeight:"700",position:"absolute",textAlign:"center",top:"242px",width:"100%"},children:n.name}),(0,i.jsx)(Ba,{css:{color:r,fontSize:"12px",gap:"2px",position:"absolute",top:"271px",width:"100%"},direction:"column",children:t.state===Pt.NotApplicable||"Intervenant"===a?(0,i.jsx)(Ar,{textAlign:"center",width:1,children:l}):"Direction"===a?so(d)?d.map((e,t)=>(0,i.jsx)(Ar,{textAlign:"center",width:1,children:e},t)):null:o.map((e,t)=>(0,i.jsx)(Ar,{textAlign:"center",width:1,children:e},t))}),(0,i.jsx)(Ar,{css:{color:r,fontSize:"32px",fontWeight:"700",position:"absolute",textAlign:"center",textTransform:"uppercase",top:"364px",width:"100%"},children:a})]})},Zp=e=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Yp,{event:e.event}),(0,i.jsx)(qp,{event:e.event})]}),Xp=e=>{const t=e.psuis[0].position,n=(0,uc.A)(e.psuis.map(({positionSlot:e})=>e),e=>e.range.start.toMillis()),s=e.userInfo,o=t.leaders[0],r=t.leaders[1];return(0,i.jsxs)(Ba,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/paris20km/2024/assignment_v2.jpg) no-repeat`,backgroundSize:"cover",fontFamily:"$avenir",fontWeight:"500",pageBreakBefore:"always",position:"relative"},height:ig,width:sg,children:[(0,i.jsx)(Ar,{css:{borderRadius:"5px",left:"67px",overflow:"hidden",position:"absolute",top:"212px"},height:74,width:74,children:m(s.fields?.picture?.url)&&(0,i.jsx)("img",{height:"100%",src:s.fields.picture.url,width:"100%"})}),(0,i.jsx)(Ar,{css:{color:"white",fontSize:"15px",fontWeight:"900",left:"27px",position:"absolute",textTransform:"uppercase",top:"295px"},textAlign:"center",width:155,children:s.fields?.firstName?.value||""}),o&&(0,i.jsxs)(Ba,{align:"center",css:{color:"#00535e",gap:"2px",fontSize:"16px",fontWeight:"900",left:"12px",position:"absolute",top:"815px"},direction:"column",width:185,children:[(0,i.jsx)(Ar,{children:o.userInfo.firstName}),(0,i.jsx)(Ar,{children:o.userInfo.lastName}),(0,i.jsx)(Ar,{children:o.userInfo.phone?.internationalFormat})]}),r&&(0,i.jsxs)(Ba,{align:"center",css:{color:"#00535e",gap:"2px",fontSize:"16px",fontWeight:"900",left:"12px",position:"absolute",top:"932px"},direction:"column",width:185,children:[(0,i.jsx)(Ar,{children:r.userInfo.firstName}),(0,i.jsx)(Ar,{children:r.userInfo.lastName}),(0,i.jsx)(Ar,{children:r.userInfo.phone?.internationalFormat})]}),(0,i.jsxs)(Ba,{css:{left:"210px",padding:"24px 40px 0 40px",position:"absolute",top:"170px"},direction:"column",width:584,children:[(0,i.jsx)(Ba,{align:"center",css:{color:"#d7531e",fontSize:"18px",fontWeight:"900",textTransform:"uppercase"},height:38,justify:"center",width:1,children:t.name}),(0,i.jsx)(Ya,{height:"5"}),(0,i.jsx)(Ar,{css:{fontSize:"16px",fontWeight:"900"},children:"Date de ta mission :"}),(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(Ba,{direction:"column",gap:"1",children:n.map((e,t)=>{const n=e.range.start,s=e.range.end,o=n.startOf("day").toMillis()===s.startOf("day").toMillis();return(0,i.jsxs)(Ar,{css:{color:"#333333"},children:[n.toFormat("d MMMM yyyy HH:mm",{locale:"fr"})," -"," ",o?s.toFormat("HH:mm"):s.toFormat("d MMMM yyyy HH:mm",{locale:"fr"})]},t)})}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(Ar,{css:{fontSize:"16px",fontWeight:"900"},children:"Détails de ta mission :"}),(0,i.jsx)(Ya,{height:"2"}),m(t.description)&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Ar,{css:{color:"black","& .h-rich-text > p":{margin:"0"}},children:(0,i.jsx)(Cg,{text:t.description})})}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(Ar,{css:{fontSize:"16px",fontWeight:"900"},children:"Lieu de rendez-vous :"}),(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(Ar,{children:t.address}),(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(Ar,{height:180,width:1,children:(0,i.jsx)("a",{href:yg(t.latitude,t.longitude),style:{background:`url(${P.HEAVENT_API_URL}/image/event/${e.eventId}/position/${t.id}.png)`,backgroundPosition:"center",backgroundSize:"cover",display:"block",height:"100%",width:"100%"}})}),m(t.fields.cf38416)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(Ar,{children:t.fields.cf38416})]})]})]})},Jp=e=>{const t=vg(e.event.volunteerRegistration.positionsSlotsUsersInfos,e.date,null).filter(({position:e})=>e.tags.some(e=>"Fiche personnalisée"===e.name)),n=(0,uc.A)(Object.entries((0,cc.A)(t,({position:e})=>e.id)),([e])=>e);return(0,i.jsx)(i.Fragment,{children:n.map(([t,n],s)=>(0,i.jsx)(Xp,{eventId:e.event.id,psuis:n,userInfo:e.event.volunteerRegistration.userInfo},s))})},Qp=e=>{const t=e.event.volunteerRegistration,n=t.userInfo;return(0,i.jsxs)(Ba,{css:{background:`url(${s=e.event.id,4183===s?`${P.HEAVENT_ASSETS_URL}/badges/paris20km/2024/accreditation_vip.jpg`:3694===s?`${P.HEAVENT_ASSETS_URL}/badges/paris20km/2024/intervenant.jpg`:""}) no-repeat`,backgroundSize:"cover",fontFamily:"$avenir",position:"relative"},height:ig,width:sg,children:[(0,i.jsxs)(Ba,{css:{fontSize:"24px",fontWeight:"900",left:"80px",lineHeight:"28px",position:"absolute",top:"261px"},direction:"column",children:[(0,i.jsx)(Ar,{children:n.fields?.firstName?.value||""}),(0,i.jsx)(Ar,{children:n.fields?.lastName?.value||""})]}),(0,i.jsxs)(Ar,{css:{color:"#d8541d",fontSize:"20px",fontWeight:"800",left:"80px",position:"absolute",top:"325px"},children:[(0,i.jsxs)(ng,{css:{color:"black",fontWeight:"400"},children:[4183===e.event.id?"VIP":"Intervenant"," |"]})," ",n.fields.cf21104?.value]}),(0,i.jsx)(Ar,{css:{position:"absolute",right:"80px",top:"261px"},height:90,width:90,children:(0,i.jsx)("img",{height:"100%",src:pg(t.ticketId,{height:90,width:90}),width:"100%"})})]});var s},ef=()=>(0,i.jsx)(Ba,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/pastourelle2024/Badge_verso.png) no-repeat`,backgroundSize:"cover",overflow:"hidden",pageBreakBefore:"always",position:"relative"},direction:"column",height:597,width:435,children:(0,i.jsx)(Ar,{css:{height:"518px",left:"25px",position:"absolute",top:"15px",width:"385px"},children:(0,i.jsx)("img",{height:"100%",src:`${P.HEAVENT_ASSETS_URL}/badges/pastourelle2024/contact.png`,width:"100%"})})});var tf;function nf(){return nf=Object.assign?Object.assign.bind():function(e){for(var t=1;t(0,i.jsx)(Ba,{css:{position:"absolute",px:"34px",top:"516px"},justify:"between",width:1,children:e.event.volunteerRegistration.accreditationsUsersInfos.map((e,t)=>{const n=A_(e.accreditation.icon),s=Qd(e.accreditation.color);return(0,i.jsxs)(Ba,{align:"center",direction:"column",gap:"1",justify:"center",width:75,children:[(0,i.jsx)(Ba,{align:"center",css:{background:e.accreditation.color,borderRadius:"$1","& svg":{fill:s,height:"50%",width:"50%"}},height:24,justify:"center",width:24,children:(0,i.jsx)(n,{})}),(0,i.jsx)(Ar,{color:"gray800",css:{fontSize:"10px"},fontWeight:"medium",textAlign:"center",children:e.accreditation.name})]},t)})}),S_=e=>{const t=Zn(Jc),n=Zn(ph),s=e.event.volunteerRegistration.userInfo,o=(0,uc.A)(Object.values((0,cc.A)(e.event.volunteerRegistration.positionsSlotsUsersInfos,e=>e.positionSlot.range.start.startOf("day").toISO())),e=>e[0].positionSlot.range.start.startOf("day").toMillis()),r=(0,ur.A)(eo.DateOnly.WeekdayLongMonthLong,"year"),a=s.fields?.cf16442?.value??"";return(0,i.jsxs)(Ba,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/pastourelle2024/Badge_orga-bene_recto.png) no-repeat`,backgroundSize:"cover",overflow:"hidden",position:"relative"},direction:"column",height:597,width:434,children:[(0,i.jsx)(Ar,{color:"gray500",css:{fontSize:"12px",fontWeight:"500",position:"absolute",top:"248px"},textAlign:"center",width:1,children:s.name}),(0,i.jsx)(Ar,{css:{position:"absolute",textTransform:"uppercase",top:"268px"},font:"gray800 displayXs bold",textAlign:"center",width:1,children:a||"Bénévole"}),(0,i.jsx)(Ba,{css:{position:"absolute",px:"60px",top:"312px"},direction:"column",gap:"2",children:o.map((e,s)=>(0,i.jsxs)(Ba,{direction:"column",children:[(0,i.jsx)(Ar,{color:"gray800",css:{fontSize:"10px",textTransform:"capitalize"},children:t.toLocaleString(e[0].positionSlot.range.start,r)}),e.map((e,t)=>(0,i.jsxs)(Ar,{color:"gray800",css:{fontSize:"10px"},fontWeight:"semiBold",children:[e.position.name," :"," ",n.toLocaleString(e.positionSlot.range,{locale:"fr-FR"},{hour:"numeric",minute:"numeric"})]},t))]},s))}),(0,i.jsx)(w_,{event:e.event})]})},E_=e=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(S_,{event:e.event}),(0,i.jsx)(ef,{})]}),T_=()=>(0,i.jsx)(Ba,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/pastourelle2024/Badge_verso.png) no-repeat`,backgroundSize:"cover",overflow:"hidden",pageBreakBefore:"always",position:"relative"},direction:"column",height:597,width:435,children:(0,i.jsx)(Ar,{css:{height:"472px",left:"29px",position:"absolute",top:"45px",width:"376px"},children:(0,i.jsx)("img",{height:"100%",src:`${P.HEAVENT_ASSETS_URL}/badges/pastourelle2024/programme.png`,width:"100%"})})}),z_=e=>{const t=e.event.volunteerRegistration.userInfo,n=t.fields?.cf16442?.value??"";return(0,i.jsxs)(Ba,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/pastourelle2024/Badge_presta_recto.png) no-repeat`,backgroundSize:"cover",overflow:"hidden",position:"relative"},direction:"column",height:597,width:435,children:[(0,i.jsx)(Ar,{css:{position:"absolute",textTransform:"uppercase",top:"430px"},font:"gray800 displayXs bold",textAlign:"center",width:1,children:n}),(0,i.jsx)(w_,{event:e.event})]})},O_=e=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(z_,{event:e.event}),(0,i.jsx)(T_,{})]}),R_=({date:e})=>(0,i.jsxs)(Ba,{align:"center",css:{border:"1px solid black",borderRadius:"$1",padding:"4px 6px"},direction:"column",justify:"center",children:[(0,i.jsx)(Ar,{css:{fontSize:"16px",fontWeight:"700"},children:e.toFormat("d")}),(0,i.jsx)(Ar,{css:{fontSize:"10px",fontWeight:"500",textTransform:"uppercase"},children:e.toFormat("MMM",{locale:"fr"})})]}),$_=e=>e?`${P.HEAVENT_ASSETS_URL}/badges/pec/accorArena/bg_accor_v7.jpg`:`${P.HEAVENT_ASSETS_URL}/badges/pec/adidasArena/bg_adidas_v1.jpg`,D_=e=>(0,uc.A)((0,xh.A)(e.map(([e,t])=>t.startOf("day")),e=>e.toMillis()),e=>e.toMillis()),P_=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,s=e.event.tags.some(e=>"🏟️ Accor Arena"===e.name),o=(0,Za.A)(t.accreditationsUsersInfos.map(e=>e.accreditation.acronym)),r=(0,cc.A)(t.accreditationsUsersInfos.flatMap(e=>"Parking"!==e.accreditationCategory.name&&e.accreditationSlot.date?.isValid?[[e.accreditation.name,e.accreditationSlot.date]]:[]),([e])=>e),a=(0,uc.A)((0,xh.A)(t.accreditationsUsersInfos.flatMap(e=>"PARK 30"===e.accreditation.acronym&&e.accreditationSlot.date?[e.accreditationSlot.date.startOf("day")]:[]),e=>e.toMillis()),e=>e.toMillis()),l=(0,uc.A)((0,xh.A)(t.accreditationsUsersInfos.flatMap(e=>"PARK 38"===e.accreditation.acronym&&e.accreditationSlot.date?[e.accreditationSlot.date.startOf("day")]:[]),e=>e.toMillis()),e=>e.toMillis()),d=(0,uc.A)((0,xh.A)(t.accreditationsUsersInfos.flatMap(e=>"Liv. P30"===e.accreditation.acronym&&e.accreditationSlot.date?[e.accreditationSlot.date.startOf("day")]:[]),e=>e.toMillis()),e=>e.toMillis()),c=(0,uc.A)((0,xh.A)(t.accreditationsUsersInfos.flatMap(e=>"Liv. P38"===e.accreditation.acronym&&e.accreditationSlot.date?[e.accreditationSlot.date.startOf("day")]:[]),e=>e.toMillis()),e=>e.toMillis()),u=(0,uc.A)((0,xh.A)(t.accreditationsUsersInfos.flatMap(e=>"PKG"===e.accreditation.acronym&&e.accreditationSlot.date?[e.accreditationSlot.date.startOf("day")]:[]),e=>e.toMillis()),e=>e.toMillis()),h=(0,uc.A)((0,xh.A)(t.accreditationsUsersInfos.flatMap(e=>"PL"===e.accreditation.acronym&&e.accreditationSlot.date?[e.accreditationSlot.date.startOf("day")]:[]),e=>e.toMillis()),e=>e.toMillis()),g=so(a)||so(l)||so(d)||so(c)||so(u)||so(h),p=t.positionsSlotsUsersInfos[0],f=n.fields?.cf37410?.value??"",_=t.ticketId;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ba,{css:{background:`url(${$_(s)}) no-repeat`,backgroundSize:"cover",fontFamily:s?"$montserrat":"$franklinGothic",position:"relative"},height:ig,width:sg,children:[m(e.options.header?.content)&&(0,i.jsx)(Ar,{css:{borderTopLeftRadius:"10px",borderTopRightRadius:"10px",left:"44px",overflow:"hidden",position:"absolute",top:"40px"},height:217,width:706,children:(0,i.jsx)("img",{height:"100%",src:e.options.header.content,width:"100%"})}),(0,i.jsx)(Ar,{css:{left:"92px",position:"absolute",top:"285px"},children:(0,i.jsx)(sp,{email:n.email,image:n.fields?.picture?.url,name:n.name,size:56})}),(0,i.jsx)(Ar,{css:{color:"black",fontSize:"22px",fontWeight:"700",left:"172px",position:"absolute",top:"296px"},children:n.name}),(0,i.jsx)(Ar,{css:{color:"#0000e3",fontSize:"18px",fontWeight:"700",left:"172px",position:"absolute",top:"324px"},children:t.delegation?.name??""}),(0,i.jsx)(Ar,{css:{left:"614px",position:"absolute",top:"281px"},height:80,width:80,children:m(_)&&(0,i.jsx)("img",{height:"100%",src:pg(_,{height:80,width:80}),width:"100%"})}),(0,i.jsx)(Ba,{css:{gap:"10px",left:"92px",position:"absolute",top:s?"521px":"501px"},width:610,wrap:"wrap",children:Object.entries(r).map(([e,t])=>(0,i.jsxs)(Ba,{direction:"column",gap:"1",width:300,children:[(0,i.jsx)(Ar,{css:{fontWeight:"600"},children:e}),(0,i.jsx)(Ba,{css:{gap:"6px"},width:300,wrap:"wrap",children:D_(t).map(e=>(0,i.jsx)(R_,{date:e},e.toMillis()))})]},`group-${t[0]}`))}),g?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ba,{css:{lineHeight:"20px",left:"92px",position:"absolute",top:s?"643px":"623px"},direction:"column",children:[(0,i.jsx)(Ar,{fontWeight:"semiBold",children:"Plaque d'immatriculation"}),(0,i.jsx)(Ar,{children:n.fields.cf29549?.value})]}),(0,i.jsxs)(Ba,{css:{lineHeight:"20px",left:"402px",position:"absolute",top:s?"643px":"623px"},direction:"column",children:[(0,i.jsx)(Ar,{fontWeight:"semiBold",children:"Type de véhicule"}),(0,i.jsx)(Ar,{children:f})]}),(0,i.jsxs)(Ba,{css:{lineHeight:"20px",left:"92px",position:"absolute",top:"699px",visibility:so(a)?"visible":"hidden"},direction:"column",gap:"1",children:[(0,i.jsx)(Ar,{fontWeight:"semiBold",children:"Parking Porte 30"}),(0,i.jsx)(Ba,{css:{gap:"6px"},width:300,wrap:"wrap",children:a.map(e=>(0,i.jsx)(R_,{date:e},e.toMillis()))})]}),(0,i.jsxs)(Ba,{css:{lineHeight:"20px",left:"402px",position:"absolute",top:"699px",visibility:so(l)?"visible":"hidden"},direction:"column",gap:"1",children:[(0,i.jsx)(Ar,{fontWeight:"semiBold",children:"Parking Porte 38"}),(0,i.jsx)(Ba,{css:{gap:"6px"},width:300,wrap:"wrap",children:l.map(e=>(0,i.jsx)(R_,{date:e},e.toMillis()))})]}),(0,i.jsxs)(Ba,{css:{lineHeight:"20px",left:"92px",position:"absolute",top:"699px",visibility:so(d)?"visible":"hidden"},direction:"column",gap:"1",children:[(0,i.jsx)(Ar,{fontWeight:"semiBold",children:"Livraison Porte 30"}),(0,i.jsx)(Ba,{css:{gap:"6px"},width:300,wrap:"wrap",children:d.map(e=>(0,i.jsx)(R_,{date:e},e.toMillis()))})]}),(0,i.jsxs)(Ba,{css:{lineHeight:"20px",left:"402px",position:"absolute",top:"699px",visibility:so(c)?"visible":"hidden"},direction:"column",gap:"1",children:[(0,i.jsx)(Ar,{fontWeight:"semiBold",children:"Livraison Porte 38"}),(0,i.jsx)(Ba,{css:{gap:"6px"},width:300,wrap:"wrap",children:c.map(e=>(0,i.jsx)(R_,{date:e},e.toMillis()))})]}),(0,i.jsxs)(Ba,{css:{lineHeight:"20px",left:"92px",position:"absolute",top:"679px",visibility:so(u)?"visible":"hidden"},direction:"column",gap:"1",children:[(0,i.jsx)(Ar,{fontWeight:"semiBold",children:"Parking Privé"}),(0,i.jsx)(Ba,{css:{gap:"6px"},width:300,wrap:"wrap",children:u.map(e=>(0,i.jsx)(R_,{date:e},e.toMillis()))})]}),(0,i.jsxs)(Ba,{css:{lineHeight:"20px",left:"402px",position:"absolute",top:"679px",visibility:so(h)?"visible":"hidden"},direction:"column",gap:"1",children:[(0,i.jsx)(Ar,{fontWeight:"semiBold",children:"Aire de livraison :"}),(0,i.jsx)(Ba,{css:{gap:"6px"},width:300,wrap:"wrap",children:h.map(e=>(0,i.jsx)(R_,{date:e},e.toMillis()))})]})]}):(0,i.jsx)(Ba,{align:"center",css:{fontWeight:"600",left:"97px",position:"absolute",top:"643px"},height:104,justify:"center",width:600,children:"Aucun véhicule autorisé"}),(0,i.jsxs)(Ba,{css:{gap:"10px",left:"92px",position:"absolute",top:s?"817px":"795px"},direction:"column",width:219,children:[o.includes("P38")&&(0,i.jsxs)(Ba,{direction:"column",children:[(0,i.jsx)(Ar,{css:{fontWeight:"600"},children:"Porte 38 (selon horaire)"}),(0,i.jsx)(Ar,{children:"Accor Arena"}),(0,i.jsx)(Ar,{children:"8 Bd de Bercy,"}),(0,i.jsx)(Ar,{children:"75012 Paris"})]}),o.includes("P30")&&(0,i.jsxs)(Ba,{direction:"column",children:[(0,i.jsx)(Ar,{css:{fontWeight:"600"},children:"Porte 30"}),(0,i.jsx)(Ar,{children:"Accor Arena"}),(0,i.jsx)(Ar,{children:"222 Quai de Bercy,"}),(0,i.jsx)(Ar,{children:"75012 Paris"})]}),o.includes("P4")&&(0,i.jsxs)(Ba,{direction:"column",children:[(0,i.jsx)(Ar,{css:{fontWeight:"600"},children:"Porte 4"}),(0,i.jsx)(Ar,{children:"Accor Arena"}),(0,i.jsx)(Ar,{children:"8 Bd de Bercy,"}),(0,i.jsx)(Ar,{children:"75012 Paris"})]}),o.includes("P35/36")&&(0,i.jsxs)(Ba,{direction:"column",children:[(0,i.jsx)(Ar,{css:{fontWeight:"600"},children:"Porte 35/36"}),(0,i.jsx)(Ar,{children:"Accor Arena"}),(0,i.jsx)(Ar,{children:"Boulevard de Bercy,"}),(0,i.jsx)(Ar,{children:"75012 Paris"})]}),o.includes("P28")&&(0,i.jsxs)(Ba,{direction:"column",children:[(0,i.jsx)(Ar,{css:{fontWeight:"600"},children:"Porte 35/36"}),(0,i.jsx)(Ar,{children:"Accor Arena"}),(0,i.jsx)(Ar,{children:"222 Quai de Bercy,"}),(0,i.jsx)(Ar,{children:"75012 Paris"})]}),o.includes("PP+PM")&&(0,i.jsxs)(Ba,{direction:"column",children:[(0,i.jsx)(Ar,{css:{fontWeight:"600"},children:"Accès principal"}),(0,i.jsx)(Ar,{children:"Avenue de la Porte de la Chapelle"}),(0,i.jsx)(Ar,{children:"75018 Paris"})]}),o.includes("PP+PE")&&(0,i.jsxs)(Ba,{direction:"column",children:[(0,i.jsx)(Ar,{css:{fontWeight:"600"},children:"Entrée prestataire et exploitation"}),(0,i.jsx)(Ar,{children:"Avenue de la Porte de la Chapelle"}),(0,i.jsx)(Ar,{children:"75018 Paris"})]}),o.includes("ORG + EXP")&&(0,i.jsxs)(Ba,{direction:"column",children:[(0,i.jsx)(Ar,{css:{fontWeight:"600"},children:"Entrée organisation exploitation"}),(0,i.jsx)(Ar,{children:"Avenue de la Porte de la Chapelle"}),(0,i.jsx)(Ar,{children:"75018 Paris"})]})]})]}),p&&(0,i.jsxs)(Ba,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/pec/accorArena/Fiche_Affectation_Accor.jpg) no-repeat`,backgroundSize:"cover",fontFamily:s?"$montserrat":"$franklinGothic",pageBreakBefore:"always",position:"relative"},height:ig,width:sg,children:[m(e.options.header?.content)&&(0,i.jsx)(Ar,{css:{borderTopLeftRadius:"10px",borderTopRightRadius:"10px",left:"44px",overflow:"hidden",position:"absolute",top:"44px"},height:217,width:706,children:(0,i.jsx)("img",{height:"100%",src:e.options.header.content,width:"100%"})}),(0,i.jsxs)(Ba,{css:{position:"absolute",px:"92px",top:"381px"},direction:"column",children:[(0,i.jsx)(Ar,{css:{color:"black",fontSize:"14px",fontWeight:"700"},children:p.position.name}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ar,{color:"gray800",css:{fontWeight:"600",textTransform:"capitalize"},children:p.positionSlot.range.start.toLocaleString(eo.DateOnly.WeekdayLongMonthLong,{locale:"fr"})}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(Ar,{css:{color:"black"},children:(0,i.jsx)(Cg,{css:{"& > p:first-child":{marginTop:0},"& > p:last-child":{marginBottom:0}},text:p.position.description})})]})]})]})},F_=e=>3376===e?`${P.HEAVENT_ASSETS_URL}/badges/playground/fiche_reims_v2.jpg`:3827===e?`${P.HEAVENT_ASSETS_URL}/badges/playground/fiche_corrida.jpg`:3823===e?`${P.HEAVENT_ASSETS_URL}/badges/playground/fiche_semi_boulogne.jpg`:3808===e?`${P.HEAVENT_ASSETS_URL}/badges/playground/fiche_toulouse.jpg`:5233===e?`${P.HEAVENT_ASSETS_URL}/badges/playground/fiche_unicef.jpg`:5158===e?`${P.HEAVENT_ASSETS_URL}/badges/playground/fiche_marseille.jpg`:5644===e||5341===e?`${P.HEAVENT_ASSETS_URL}/badges/playground/fiche_montpellier.jpg`:`${P.HEAVENT_ASSETS_URL}/badges/playground/fiche_gcsd_v3.jpg`,M_=e=>3376===e?{color:"#c2ab62",fontFamily:"$movement",fontSize:"24px",fontWeight:"900",textTransform:"uppercase"}:3827===e?{color:"#ec1c24",fontFamily:"$graphie",fontSize:"24px",fontWeight:"800",textTransform:"uppercase"}:3823===e?{color:"#ff9900",fontFamily:"$archerBoldPro",fontSize:"24px",fontWeight:"700",textTransform:"uppercase"}:3808===e?{color:"#f39fc5",fontFamily:"$helveticaNeue97BlackCondensed",fontSize:"24px",fontWeight:"900",textTransform:"uppercase"}:5233===e?{color:"#1eaae3",fontFamily:"$roboto",fontSize:"24px",fontWeight:"800",textTransform:"uppercase"}:5158===e?{color:"#b3cc1b",fontFamily:"$acumin",fontSize:"24px",fontWeight:"700",textTransform:"uppercase"}:5644===e||5341===e?{color:"#662483",fontFamily:"$chillax",fontSize:"24px",fontWeight:"700",textTransform:"uppercase"}:{color:"#bfbe00",fontFamily:"$atrament",fontSize:"24px",fontWeight:"700",textTransform:"uppercase"},N_=e=>3827===e||5233===e?{top:"859px"}:5158===e?{top:"746px"}:5644===e||5341===e?{top:"744px"}:{top:"915px"},L_=e=>{const t=e.vr.userInfo,n=e.positionSlotUserInfo.position,s=e.positionSlotUserInfo.positionSlot,o=n.leaders[0],r=n.leaders[1],a=3376===(l=e.eventId)?{color:"#2b2378",fontFamily:"$movement",fontSize:"18px",fontWeight:"900",textTransform:"uppercase"}:3827===l?{color:"#434343",fontFamily:"$graphie",fontSize:"16px",fontWeight:"800",textTransform:"uppercase"}:3823===l?{color:"#1d2b71",fontFamily:"$archerBoldPro",fontSize:"18px",fontWeight:"700",textTransform:"uppercase"}:3808===l?{color:"#161b4a",fontFamily:"$helveticaNeue97BlackCondensed",fontSize:"18px",fontWeight:"900",textTransform:"uppercase"}:5233===l?{color:"#434343",fontFamily:"$roboto",fontSize:"18px",fontWeight:"800",textTransform:"uppercase"}:5158===l?{color:"#161b4a",fontFamily:"$acumin",fontSize:"18px",fontWeight:"700",textTransform:"uppercase"}:5644===l||5341===l?{color:"#161b4a",fontFamily:"$chillax",fontSize:"18px",fontWeight:"700",textTransform:"uppercase"}:{color:"black",fontFamily:"$atrament",fontSize:"18px",fontWeight:"700",textTransform:"uppercase"};var l;return(0,i.jsxs)(Ba,{css:{background:`url(${F_(e.eventId)}) no-repeat`,backgroundSize:"cover",color:"#333333",position:"relative"},direction:"column",height:ig,width:sg,children:[(0,i.jsx)(Ar,{css:{color:5233===e.eventId?"white":"#333333",fontSize:"22px",fontWeight:"700",position:"absolute",right:"40px",textTransform:"uppercase",top:"136px"},children:t.name}),(0,i.jsxs)(Ba,{css:{left:"210px",padding:"$7 $8 0 $8",position:"absolute",top:"170px"},direction:"column",width:584,children:[(0,i.jsx)(Ar,{css:M_(e.eventId),textAlign:"center",width:1,children:n.name}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(Ar,{css:a,children:"Détails de la mission :"}),(0,i.jsx)(Ya,{height:"2"}),m(n.description)&&(0,i.jsx)(Ar,{css:{"& .h-rich-text > p":{margin:"0"}},children:(0,i.jsx)(Cg,{text:n.description})}),Rh(n)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(Ar,{css:a,children:"Lieu de mission :"}),zh(n)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(Ar,{children:n.address})]}),Oh(n)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(Ar,{height:180,width:1,children:(0,i.jsx)("a",{href:yg(n.latitude,n.longitude),style:{background:`url(${P.HEAVENT_API_URL}/image/event/${e.eventId}/position/${n.id}.png)`,backgroundPosition:"center",backgroundSize:"cover",display:"block",height:"100%",width:"100%"}})})]})]}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(Ar,{css:a,children:"À cette heure ci :"}),(0,i.jsx)(Ya,{height:"2"}),(0,i.jsxs)(Ba,{css:{gap:"22px"},width:1,children:[(0,i.jsxs)(Ba,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(Ar,{css:{fontWeight:"700"},children:s.range.start.toFormat("dd MMMM yyyy",{locale:"fr"})}),(0,i.jsxs)(Ar,{children:["De ",s.range.start.toFormat("H'h'mm")," à"," ",s.range.end.toFormat("H'h'mm")]})]}),o&&(0,i.jsxs)(Ba,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(Ar,{css:{fontWeight:"700"},children:"Mon contact d'urgence"}),(0,i.jsxs)(Ar,{children:[o.userInfo.firstName," :"," ",o.userInfo.phone?.internationalFormat]}),r&&(0,i.jsxs)(Ar,{children:[r.userInfo.firstName," :"," ",r.userInfo.phone?.internationalFormat]})]})]}),(0,i.jsx)(Ya,{height:"6"}),m(n.fields.cf38780)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ar,{css:a,children:"Transports"}),(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(Ar,{dangerouslySetInnerHTML:{__html:n.fields.cf38780.split("\n").join(" ")}})]})]}),(0,i.jsx)(Ar,{css:{left:"53px",position:"absolute",...N_(e.eventId)},height:104,width:104,children:(0,i.jsx)("img",{height:"100%",src:pg(e.vr.ticketId,{height:104,width:104}),width:"100%"})})]})},B_=e=>{const t=(0,L.useMemo)(()=>(0,uc.A)(e.event.volunteerRegistration.positionsSlotsUsersInfos,e=>e.positionSlot.range.start.toMillis()),[e.event.volunteerRegistration.positionsSlotsUsersInfos]);return(0,i.jsx)(i.Fragment,{children:t.map(t=>(0,i.jsx)(L_,{eventId:e.event.id,positionSlotUserInfo:t,vr:e.event.volunteerRegistration},t.positionSlot.id))})},V_=e=>{const t=e.event.volunteerRegistration,n=t.userInfo;return(0,i.jsxs)(Ba,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/roiarthur/roiarthur.jpg) no-repeat`,backgroundSize:"cover",position:"relative"},height:ig,width:sg,children:[(0,i.jsx)(Ar,{css:{color:"#181d3a",fontSize:"18px",fontWeight:"700",left:"426px",position:"absolute",textAlign:"center",top:"89px"},width:320,children:n.name}),(0,i.jsxs)(Ar,{css:{color:"#181d3a",fontSize:"12px",left:"426px",position:"absolute",textAlign:"center",top:"116px"},width:320,children:["Numéro code-barres : ",t.ticketId]}),(0,i.jsx)(Ar,{css:{left:"530px",position:"absolute",top:"144px"},height:114,width:114,children:(0,i.jsx)("img",{height:"100%",src:pg(t.ticketId,{height:114,width:114}),width:"100%"})})]})},U_=(e,t)=>t?`${P.HEAVENT_ASSETS_URL}/badges/rose/v3/benevole/benevole_page1.jpg`:"Direction"===e||"All Access"===e?`${P.HEAVENT_ASSETS_URL}/badges/rose/v3/direction/direction_page1.jpg`:"Backstage"===e?`${P.HEAVENT_ASSETS_URL}/badges/rose/v3/backstage/backstage_page1.jpg`:"Stand & Food & Bar"===e?`${P.HEAVENT_ASSETS_URL}/badges/rose/v3/stand/stand_page1.jpg`:"Agora"===e||"Agora F"===e?`${P.HEAVENT_ASSETS_URL}/badges/rose/v3/agora/agora_page1.jpg`:"",W_=(e,t)=>t?`${P.HEAVENT_ASSETS_URL}/badges/rose/v3/benevole/benevole_page2.jpg`:"Direction"===e||"All Access"===e?`${P.HEAVENT_ASSETS_URL}/badges/rose/v3/direction/direction_page2.jpg`:"Backstage"===e?`${P.HEAVENT_ASSETS_URL}/badges/rose/v3/backstage/backstage_page2.jpg`:"Agora"===e||"Agora F"===e?`${P.HEAVENT_ASSETS_URL}/badges/rose/v3/agora/agora_page2.jpg`:"",G_=(e,t)=>t?`${P.HEAVENT_ASSETS_URL}/badges/rose/v3/benevole/benevole_page3.jpg`:"Direction"===e||"All Access"===e?`${P.HEAVENT_ASSETS_URL}/badges/rose/v3/direction/direction_page3.jpg`:"Backstage"===e?`${P.HEAVENT_ASSETS_URL}/badges/rose/v3/backstage/backstage_page3.jpg`:"Stand & Food & Bar"===e?`${P.HEAVENT_ASSETS_URL}/badges/rose/v3/stand/stand_page3.jpg`:"Agora"===e||"Agora F"===e?`${P.HEAVENT_ASSETS_URL}/badges/rose/v3/agora/agora_page3.jpg`:"",H_=e=>(0,i.jsx)(Ar,{css:{left:`${e.left}px`,position:"absolute",top:`${e.top}px`},children:(0,i.jsx)("img",{height:"19px",src:`${P.HEAVENT_ASSETS_URL}/badges/rose/v3/benevole/bracelet_asset.png`,width:"38px"})}),q_=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,s=3571===e.event.id,o=Rg(n.fields,"population"),r=t.accreditationsUsersInfos.find(e=>1602===e.accreditationCategory.id)?.accreditation.name||"",a="Direction"===r||"All Access"===r||"Backstage"===r,l=(0,uc.A)((0,xh.A)(t.accreditationsUsersInfos.flatMap(e=>e.accreditationSlot.date?[e.accreditationSlot.date.startOf("day")]:[]),e=>e.toMillis()),e=>e.toMillis()),d=(0,uc.A)((0,xh.A)(t.positionsSlotsUsersInfos.map(e=>e.positionSlot.range.start.startOf("day")),e=>e.toMillis()),e=>e.toMillis()),c=(s?d:l).filter(e=>[29,30,31,1].includes(e.day)),u=t.accreditationsUsersInfos.flatMap(e=>3229===e.accreditation.id?[e.accreditationSlot.name]:[]),h=t.accreditationsUsersInfos.flatMap(e=>3230===e.accreditation.id?[e.accreditationSlot.name]:[]),g=(0,Za.A)([u.includes("29")?"Midi":null,h.includes("29")?"Soir":null]).join(" & "),p=(0,Za.A)([u.includes("30")?"Midi":null,h.includes("30")?"Soir":null]).join(" & "),f=(0,Za.A)([u.includes("31")?"Midi":null,h.includes("31")?"Soir":null]).join(" & "),_=(0,Za.A)([u.includes("1")?"Midi":null,h.includes("1")?"Soir":null]).join(" & "),x=t.accreditationsUsersInfos.flatMap(e=>3436===e.accreditation.id?[e.accreditationSlot.name]:[]),I=t.accreditationsUsersInfos.flatMap(e=>3439===e.accreditation.id?[e.accreditationSlot.name]:[]),v=t.accreditationsUsersInfos.flatMap(e=>3437===e.accreditation.id?[e.accreditationSlot.name]:[]),b=t.accreditationsUsersInfos.flatMap(e=>3438===e.accreditation.id?[e.accreditationSlot.name]:[]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ba,{css:{background:`url(${U_(r,s)}) no-repeat`,backgroundSize:"cover",fontFamily:"$neueMontreal",position:"relative"},height:ig,width:sg,children:[!s&&(0,i.jsx)(Ar,{css:{color:"#ee78ac",fontFamily:"$helveticaBlackCondensed",fontSize:"22px",fontWeight:"900",left:"251px",position:"absolute",textTransform:"uppercase",top:"130px"},textAlign:"center",width:292,children:o}),!s&&(0,i.jsxs)(Ar,{css:{color:"black",fontSize:"18px",fontWeight:"700",left:"299px",position:"absolute",top:"167px"},textAlign:"center",width:244,children:["Bracelet ",r]}),(0,i.jsxs)(Ar,{css:{color:"black",fontSize:"24px",fontWeight:"700",lineHeight:"28px",left:"95px",position:"absolute",textTransform:"uppercase",top:"237px"},children:[n.fields?.firstName?.value||"",(0,i.jsx)("br",{}),n.fields?.lastName?.value||""]}),!s&&(0,i.jsx)(Ar,{css:{color:"#ee78ac",fontSize:"18px",fontWeight:"700",left:"95px",position:"absolute",top:"295px"},children:t.delegation?.name}),(0,i.jsx)(Ar,{css:{position:"absolute",right:"95px",top:"232px"},height:90,width:90,children:(0,i.jsx)("img",{height:"100%",src:pg(t.ticketId,{height:90,width:90}),width:"100%"})}),(0,i.jsx)(Ba,{css:{gap:"6px",left:"95px",position:"absolute",top:"430px"},children:c.map((e,t)=>(0,i.jsxs)(Ba,{align:"center",css:{border:"1px solid black",borderRadius:"4px",padding:"4px 6px"},direction:"column",justify:"center",children:[(0,i.jsx)(Ar,{css:{color:"black",fontFamily:"Helvetica",fontSize:"16px",fontWeight:"700"},children:e.toFormat("dd")}),(0,i.jsx)(Ar,{css:{color:"black",fontSize:"10px",fontWeight:"500",textTransform:"uppercase"},children:e.toFormat("MMMM",{locale:"fr"})})]},t))}),x.includes("29")&&(0,i.jsx)(H_,{left:289,top:803}),x.includes("30")&&(0,i.jsx)(H_,{left:402,top:803}),x.includes("31")&&(0,i.jsx)(H_,{left:515,top:803}),x.includes("1")&&(0,i.jsx)(H_,{left:628,top:803}),I.includes("29")&&(0,i.jsx)(H_,{left:289,top:839}),I.includes("30")&&(0,i.jsx)(H_,{left:402,top:839}),I.includes("31")&&(0,i.jsx)(H_,{left:515,top:839}),I.includes("1")&&(0,i.jsx)(H_,{left:628,top:839}),v.includes("29")&&(0,i.jsx)(H_,{left:289,top:875}),v.includes("30")&&(0,i.jsx)(H_,{left:402,top:875}),v.includes("31")&&(0,i.jsx)(H_,{left:515,top:875}),v.includes("1")&&(0,i.jsx)(H_,{left:628,top:875}),b.includes("29")&&(0,i.jsx)(H_,{left:289,top:911}),b.includes("30")&&(0,i.jsx)(H_,{left:402,top:911}),b.includes("31")&&(0,i.jsx)(H_,{left:515,top:911}),b.includes("1")&&(0,i.jsx)(H_,{left:628,top:911})]}),"Stand & Food & Bar"!==r&&(0,i.jsx)(Ba,{css:{background:`url(${W_(r,s)}) no-repeat`,backgroundSize:"cover",fontFamily:"$neueMontreal",pageBreakBefore:"always",position:"relative"},height:ig,width:sg,children:a&&(0,i.jsxs)(Ba,{css:{fontWeight:"700",left:"95px",lineHeight:"20px",position:"absolute",top:"598px"},direction:"column",children:[m(g)&&(0,i.jsxs)(Ar,{children:["29 août : ",g]}),m(p)&&(0,i.jsxs)(Ar,{children:["30 août : ",p]}),m(f)&&(0,i.jsxs)(Ar,{children:["31 août : ",f]}),m(_)&&(0,i.jsxs)(Ar,{children:["1 septembre : ",_]})]})}),(0,i.jsx)(Ba,{css:{background:`url(${G_(r,s)}) no-repeat`,backgroundSize:"cover",pageBreakBefore:"always"},height:ig,width:sg}),!s&&"Agora"!==r&&(0,i.jsx)(Ba,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/rose/v3/page4.jpg) no-repeat`,backgroundSize:"cover",pageBreakBefore:"always"},height:ig,width:sg})]})},K_=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,s=t.accreditationsUsersInfos.find(e=>1662===e.accreditationCategory.id),o=(0,uc.A)((0,xh.A)(t.accreditationsUsersInfos.flatMap(e=>e.accreditationSlot.date?[e.accreditationSlot.date.startOf("day")]:[]),e=>e.toMillis()),e=>e.toMillis());return(0,i.jsxs)(Ba,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/rose/parking_vide.jpg) no-repeat`,backgroundSize:"cover",position:"relative"},height:ig,width:sg,children:[(0,i.jsx)(Ba,{css:{position:"absolute",top:"232px"},justify:"center",width:1,children:(0,i.jsx)(Ar,{css:{background:s?.accreditation.color,color:Qd(s?.accreditation.color||"#000000"),fontSize:"50px",fontWeight:"800",padding:"$1 $3",textTransform:"uppercase"},children:s?.accreditation.name||"parking"})}),(0,i.jsx)(Ar,{css:{fontFamily:"$bnCartaNoirBold",fontSize:"36px",fontWeight:"700",left:"48px",position:"absolute",textTransform:"uppercase",top:"353px"},children:n.name}),(0,i.jsx)(Ar,{css:{position:"absolute",right:"57px",top:"359px"},height:100,width:100,children:(0,i.jsx)("img",{height:"100%",src:pg(t.ticketId,{height:100,width:100}),width:"100%"})}),(0,i.jsx)(Ba,{css:{gap:"6px",left:"48px",position:"absolute",top:"436px"},children:o.map((e,t)=>(0,i.jsxs)(Ba,{align:"center",css:{border:"1px solid black",borderRadius:"4px",padding:"4px 6px"},direction:"column",justify:"center",children:[(0,i.jsx)(Ar,{css:{color:"black",fontFamily:"Helvetica",fontSize:"16px",fontWeight:"700"},children:e.toFormat("dd")}),(0,i.jsx)(Ar,{css:{color:"black",fontSize:"10px",fontWeight:"500",textTransform:"uppercase"},children:e.toFormat("MMMM",{locale:"fr"})})]},t))})]})},Y_=e=>{const t=e.event.volunteerRegistration.userInfo.formsUsersInfos.map(e=>e.formId);return(0,i.jsxs)(Ba,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/salamandre/2024/verso_v2.jpg) no-repeat`,backgroundSize:"cover",overflow:"hidden",paddingBottom:"24px",paddingTop:"56px",px:"16px"},direction:"column",height:ag-5,width:lg,children:[(0,i.jsx)(Ar,{css:{color:"#336998",fontSize:"10px",fontWeight:"700"},children:"Renseignements complémentaires"}),(0,i.jsx)(Ya,{height:"3"}),t.includes(2163)?e.event.volunteerRegistration.positionsSlotsUsersInfos.length>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ar,{css:{color:"#5a9e9f",fontSize:"8px",fontWeight:"600"},children:"Responsable de la mission"}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ar,{css:{color:"#336998",fontSize:"10px",fontWeight:"500"},children:(0,Bs.A)(e.event.volunteerRegistration.positionsSlotsUsersInfos.flatMap(e=>e.position.leaders.map(e=>`${e.userInfo.name} : ${e.userInfo.phone?.internationalFormat??"-"}`))).join(", ")}),(0,i.jsx)(Ya,{height:"4"})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ar,{css:{color:"#5a9e9f",fontSize:"8px",fontWeight:"600"},children:"Responsable des bénévoles"}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ar,{css:{color:"#336998",fontSize:"10px",fontWeight:"500"},children:"Anika Andenmatten : 079 689 52 51"}),(0,i.jsx)(Ya,{height:"4"})]}),(0,i.jsx)(Ar,{css:{color:"#5a9e9f",fontSize:"8px",fontWeight:"600"},children:"Police"}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ar,{css:{color:"#336998",fontSize:"10px",fontWeight:"500"},children:"117"}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(Ar,{css:{color:"#5a9e9f",fontSize:"8px",fontWeight:"600"},children:"Pompiers"}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ar,{css:{color:"#336998",fontSize:"10px",fontWeight:"500"},children:"118"}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(Ar,{css:{color:"#5a9e9f",fontSize:"8px",fontWeight:"600"},children:"Ambulance"}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ar,{css:{color:"#336998",fontSize:"10px",fontWeight:"500"},children:"144"})]})};var Z_;function X_(){return X_=Object.assign?Object.assign.bind():function(e){for(var t=1;t(0,i.jsxs)(Ba,{align:"center",direction:"column",gap:"1",children:[(0,i.jsx)(Ba,{align:"center",css:{background:"white",borderRadius:"34px",color:"#336998",height:"34px",width:"34px",svg:{fill:"#5a9e9f",height:"50%",width:"50%"}},justify:"center",children:"Camera"===e.icon?(0,i.jsx)(kf,{}):(0,i.jsx)(J_,{})}),(0,i.jsx)(Ar,{css:{color:"#761c31",fontSize:"10px"},children:e.name})]}),ex={MAsoir:1,MERC:2,MEmatin:3,MEmidi:4,MEsoir:5,JEUD:6,JEmatin:7,JEmidi:8,JEsoir:9,VEND:10,VEmatin:11,VEmidi:12,VEsoir:13,SAM:14,SAmatin:15,SAmidi:16,SAsoir:17,DIM:18,DImatin:19,DImidi:20,DIsoir:21},tx=e=>{const t=e.event.volunteerRegistration.userInfo,n=(0,uc.A)(e.event.volunteerRegistration.accreditationsUsersInfos,e=>ex[e.accreditation.acronym||""]||-1),s=e.event.volunteerRegistration.userInfo.formsUsersInfos.map(e=>e.formId),o=t.fields?.cf11135?.value??"",r=t.fields?.cf10429?.value??"";return(0,i.jsxs)(Ba,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/salamandre/2024/recto.jpg) no-repeat`,backgroundSize:"cover",overflow:"hidden",padding:"12px 14px",position:"relative"},direction:"column",height:ag-5,width:lg,children:[(0,i.jsx)(Ar,{color:"white",css:{fontFamily:"$gravur",fontSize:"22px",left:"0",position:"absolute",textAlign:"center",top:"117px",width:"100%"},children:t.name}),(0,i.jsx)(Ar,{color:"white",css:{fontSize:"20px",fontWeight:"800",left:"0",position:"absolute",textAlign:"center",top:"139px",width:"100%"},children:s.includes(2164)?o:r}),(0,i.jsx)(hd,{css:{flex:"1",gap:"8px 40px",padding:"12px 36px",position:"absolute",top:"194px",left:0},gridtemplatecolumns:"repeat(3, 1fr)",gridtemplaterows:"repeat(3, 1fr)",height:187,width:1,children:n.map((e,t)=>(0,i.jsx)(Q_,{icon:e.accreditation.icon,name:e.accreditation.acronym||""},t))})]})},nx=e=>(0,i.jsxs)(Ba,{height:ag,width:2*lg,children:[(0,i.jsx)(tx,{event:e.event}),(0,i.jsx)(Y_,{event:e.event})]}),ix=e=>(0,i.jsx)(Ba,{height:ig,width:sg,children:(0,i.jsx)(nx,{event:e.event})}),sx=e=>(0,i.jsx)(i.Fragment,{children:(0,ep.A)(e.event.volunteersRegistrations.nodes,8).map((t,n)=>(0,i.jsxs)(L.Fragment,{children:[(0,i.jsx)(Ba,{css:{overflow:"hidden",pageBreakBefore:0!==n?"always":void 0},height:1,width:ig,wrap:"wrap",children:t.map(t=>(0,i.jsx)(tx,{event:{...e.event,volunteerRegistration:t}},`front-${t.userInfo.id}`))}),(0,i.jsx)(Ba,{css:{overflow:"hidden",pageBreakBefore:"always"},height:1,width:ig,wrap:"wrap",children:(0,ep.A)(t,4).map(t=>(0,i.jsx)(Ba,{direction:"rowReverse",width:1,children:t.map(t=>(0,i.jsx)(Y_,{event:{...e.event,volunteerRegistration:t}},`back-${t.userInfo.id}`))},`group-${t[0].utid}`))})]},`page-${n}`))}),ox="#e30613",rx="#26306b",ax={cf25078:"Parcours",cf25079:"Plan village",cf25080:"Poste vélo",cf25511:"Poste course à pied",cf25512:"Plan d'accès"},lx=Object.keys(ax),dx=e=>{const t=Zn(Jc),n=e.positionSlotUserInfo.position,s=n.category,o=e.positionSlotUserInfo.positionSlot,r=s.leaders[0],a=lx.some(e=>m(n.fields[e]?.url)),l=a||"Restauration athlètes"===s.name||"Ravitaillement"===s.name||"Retrait des dossards"===s.name;return(0,i.jsxs)(Ba,{css:{background:"white",fontFamily:"$roboto"},direction:"column",height:ig,width:sg,children:[(0,i.jsxs)(Ba,{height:185,width:1,children:[(0,i.jsx)(Ba,{height:1,width:185,children:m(e.options.logo?.content)&&(0,i.jsx)("img",{height:"100%",src:e.options.logo.content,width:"100%"})}),(0,i.jsx)(Ba,{css:{padding:"$4 $7"},width:609,children:(0,i.jsxs)(Ba,{direction:"column",justify:"between",width:1,children:[(0,i.jsxs)(Ba,{justify:"between",width:1,children:[(0,i.jsxs)(Ba,{direction:"column",width:1,children:[(0,i.jsx)(Ar,{css:{color:ox,fontSize:"34px",fontWeight:"700",lineHeight:"40px"},children:m(n.acronym)?n.acronym:n.name}),(0,i.jsxs)(Ar,{css:{color:ox,ellipsis:!0,fontSize:"18px",fontWeight:"700"},children:["POSTE / ",s.name]})]}),l&&(0,i.jsxs)(Ba,{direction:"column",width:1,children:[(0,i.jsx)(Ar,{css:{color:ox,fontSize:"18px",fontWeight:"700",textAlign:"right"},children:"Adresse"}),(0,i.jsx)(Ar,{css:{color:rx,fontSize:"16px",fontWeight:"500",textAlign:"right"},children:n.address})]})]}),l&&(0,i.jsxs)(Ba,{justify:"between",width:1,children:[(0,i.jsxs)(Ba,{direction:"column",children:[(0,i.jsx)(Ar,{css:{color:rx,fontSize:"18px",fontWeight:"700"},children:"Point GPS"}),(0,i.jsxs)(Ar,{css:{color:ox,fontSize:"16px",fontWeight:"500"},children:[n.latitude,", ",n.longitude]})]}),(0,i.jsxs)(Ba,{direction:"column",children:[(0,i.jsx)(Ar,{css:{color:rx,fontSize:"18px",fontWeight:"700",textAlign:"right"},children:"Horaires de mission"}),(0,i.jsxs)(Ar,{css:{color:ox,fontSize:"16px",fontWeight:"500",textAlign:"right",textTransform:"capitalize"},children:[t.toLocaleString(o.range.start,{month:"short",day:"numeric",weekday:"short"})," ","| ",o.range.start.toFormat("HH'h'mm")," -"," ",o.range.end.toFormat("HH'h'mm")]})]})]}),!l&&(0,i.jsx)(Ba,{width:1,children:(0,i.jsxs)(Ba,{direction:"column",children:[(0,i.jsx)(Ar,{css:{color:ox,fontSize:"18px",fontWeight:"700"},children:"Adresse"}),(0,i.jsx)(Ar,{css:{color:rx,fontSize:"16px",fontWeight:"500"},children:n.address})]})})]})})]}),(0,i.jsx)(Ar,{css:{background:ox},height:10,width:1}),(0,i.jsxs)(Ba,{css:{flex:"1",padding:"$6 $7"},direction:"column",gap:"1",width:1,children:[(0,i.jsx)(Ar,{css:{color:ox,fontSize:"20px",fontWeight:"700"},children:"VOTRE MISSION"}),(0,i.jsx)(Ar,{css:{color:rx,fontSize:"16px",fontWeight:"500","& .h-rich-text > p":{margin:0}},children:(0,i.jsx)(Cg,{text:n.description})})]}),a&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ar,{css:{background:ox},height:10,width:1}),(0,i.jsx)(Ba,{css:{padding:"$5 $7"},gap:"5",height:335,width:1,children:lx.map(e=>{if(m(n.fields[e]?.url)){const t=ax[e];return(0,i.jsxs)(Ba,{direction:"column",gap:"2",width:1,children:[(0,i.jsx)(Ar,{css:{color:ox,fontSize:"20px",fontWeight:"700"},children:t}),(0,i.jsx)(Ar,{height:255,width:1,children:(0,i.jsx)("img",{height:"100%",src:n.fields[e].url,width:"100%"})})]},e)}return null})})]}),(0,i.jsx)(Ba,{align:"center",css:{background:ox,color:"white",fontSize:"24px",fontWeight:"700",textTransform:"uppercase"},height:40,justify:"center",width:1,children:"Vous rencontrez un problème ?"}),(0,i.jsxs)(Ba,{css:{padding:"$4"},direction:"column",height:88,width:1,children:[(0,i.jsx)(Ar,{css:{color:rx,fontSize:"20px",fontWeight:"500",textAlign:"center"},width:1,children:"Contactez votre responsable de secteur"}),r&&(0,i.jsxs)(Ar,{css:{color:rx,fontSize:"20px",fontWeight:"700",textAlign:"center"},width:1,children:[r.userInfo.name," : ",r.userInfo.phone?.internationalFormat]})]}),(0,i.jsx)(Ba,{align:"center",css:{background:rx,color:"white",fontSize:"24px",fontWeight:"700",textTransform:"uppercase"},height:40,justify:"center",width:1,children:"Merci"})]})},cx=e=>(0,i.jsx)(i.Fragment,{children:e.event.volunteerRegistration.positionsSlotsUsersInfos.map((t,n)=>(0,i.jsx)(dx,{options:e.options,positionSlotUserInfo:t,userInfo:e.event.volunteerRegistration.userInfo},n))}),ux=e=>{switch(e){case"Organisateur":return`${P.HEAVENT_ASSETS_URL}/badges/triathlonLaRochelle/2025/Organisation_Recto.jpg`;case"Bénévole":default:return`${P.HEAVENT_ASSETS_URL}/badges/triathlonLaRochelle/2025/Benevole_Recto.jpg`;case"Partenaire":return`${P.HEAVENT_ASSETS_URL}/badges/triathlonLaRochelle/2025/Partenaire_Recto.jpg`;case"Officiel":return`${P.HEAVENT_ASSETS_URL}/badges/triathlonLaRochelle/2025/Officiel_Recto.jpg`;case"Exposant":return`${P.HEAVENT_ASSETS_URL}/badges/triathlonLaRochelle/2025/Exposant_Recto.jpg`;case"Prestataire":return`${P.HEAVENT_ASSETS_URL}/badges/triathlonLaRochelle/2025/Intervenant_Recto.jpg`}},hx=e=>{switch(e){case"Organisateur":return`${P.HEAVENT_ASSETS_URL}/badges/triathlonLaRochelle/2025/Organisation_Verso.jpg`;case"Bénévole":default:return`${P.HEAVENT_ASSETS_URL}/badges/triathlonLaRochelle/2025/Benevole_Verso.jpg`;case"Partenaire":return`${P.HEAVENT_ASSETS_URL}/badges/triathlonLaRochelle/2025/Partenaire_Verso.jpg`;case"Exposant":return`${P.HEAVENT_ASSETS_URL}/badges/triathlonLaRochelle/2025/Exposant_Verso.jpg`;case"Prestataire":return`${P.HEAVENT_ASSETS_URL}/badges/triathlonLaRochelle/2025/Intervenant_Verso.jpg`;case"Officiel":return`${P.HEAVENT_ASSETS_URL}/badges/triathlonLaRochelle/2025/Officiel_Verso.jpg`}},mx=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,s=n?.fields?.cf27672?.value||"Organisateur",o=(0,uc.A)(t.positionsSlotsUsersInfos,e=>e.positionSlot.range.start.toMillis()),r="Organisateur"!==s&&"Bénévole"!==s,a="Organisateur"===s||"Bénévole"==s;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ba,{css:{background:`url(${ux(s)}) no-repeat`,backgroundSize:"cover",fontFamily:"$montserrat",position:"relative"},height:597,width:435,children:[(0,i.jsx)(Ar,{css:{color:"black",fontSize:"22px",fontWeight:"700",position:"absolute",top:"449px"},textAlign:"center",width:1,children:n.fields?.firstName?.value||""}),(0,i.jsx)(Ar,{css:{color:"black",fontSize:"22px",fontWeight:"700",position:"absolute",top:"478px"},textAlign:"center",width:1,children:n.fields?.lastName?.value||""}),r&&(0,i.jsx)(Ar,{css:{color:"black",fontSize:"18px",fontWeight:"500",position:"absolute",top:"519px"},textAlign:"center",width:1,children:n.fields?.cf27673?.value})]}),(0,i.jsx)(Ba,{css:{background:`url(${hx(s)}) no-repeat`,backgroundSize:"cover",fontFamily:"$montserrat",pageBreakBefore:"always",position:"relative"},height:597,width:435,children:a&&(0,i.jsx)(Ba,{css:{position:"absolute",top:"83px"},direction:"column",gap:"2",width:1,children:o.map(e=>(0,i.jsxs)(Ar,{css:{color:"black",fontSize:"12px",fontWeight:"500"},textAlign:"center",width:1,children:[e.position.name," :"," ",e.positionSlot.range.start.toFormat("dd MMMM yyyy H'h'mm",{locale:"fr"})," ","à ",e.positionSlot.range.end.toFormat("H'h'mm")]},e.id))})})]})},gx=e=>e.includes("Intervenant")?`${P.HEAVENT_ASSETS_URL}/badges/utopiales/2024/a4/A4_Bordeaux.jpg`:e.includes("VIP")?`${P.HEAVENT_ASSETS_URL}/badges/utopiales/2024/a4/A4_Dore.jpg`:e.includes("Protocole")?`${P.HEAVENT_ASSETS_URL}/badges/utopiales/2024/a4/A4_Blanc.jpg`:e.includes("Accrédité")||e.includes("Spare")||e.includes("Press")||e.includes("Pro")?`${P.HEAVENT_ASSETS_URL}/badges/utopiales/2024/a4/A4_Vert.jpg`:`${P.HEAVENT_ASSETS_URL}/badges/utopiales/2024/a4/A4_Noir.jpg`,px=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,s=n.fields?.cf24297?.value||"Spare",o=s.includes("Protocole")?"black":"white";return(0,i.jsxs)(Ba,{css:{background:`url(${gx(s)}) no-repeat`,backgroundSize:"cover",fontFamily:"$utopiales",position:"relative"},height:ig,width:sg,children:[(0,i.jsx)(Ar,{css:{color:o,fontSize:"32px",position:"absolute",textTransform:"uppercase",top:"408px"},textAlign:"center",width:397,children:n.fields?.firstName?.value||""}),(0,i.jsx)(Ar,{css:{color:o,fontSize:"32px",position:"absolute",textTransform:"uppercase",top:"447px"},textAlign:"center",width:397,children:n.fields?.lastName?.value||""}),(0,i.jsx)(Ar,{css:{color:o,fontSize:"24px",position:"absolute",textTransform:"uppercase",top:"505px"},textAlign:"center",width:397,children:s.includes("Bénévole")?s:s.includes("VIP")?"Pass VIP":n.fields.cf38606?.value}),(0,i.jsx)(Ar,{css:{fontFamily:"$default",fontSize:"16px",left:"397px",position:"absolute",top:"300px"},textAlign:"center",width:397,children:"Code membre :"}),(0,i.jsx)(Ar,{css:{left:"543px",position:"absolute",top:"367px"},height:106,width:106,children:(0,i.jsx)("img",{height:"100%",src:pg(t.ticketId,{height:106,width:106}),width:"100%"})})]})},fx=e=>e.includes("Intervenant")?`${P.HEAVENT_ASSETS_URL}/badges/utopiales/2024/imprimeur_v2/Inrae_Recto.jpg`:e.includes("VIP")?`${P.HEAVENT_ASSETS_URL}/badges/utopiales/2024/imprimeur_v2/Pass_vip_Recto.jpg`:e.includes("Protocole")?`${P.HEAVENT_ASSETS_URL}/badges/utopiales/2024/imprimeur_v2/Ville_de_Nantes_Recto.jpg`:e.includes("Accrédité")||e.includes("Spare")||e.includes("Press")||e.includes("Pro")?`${P.HEAVENT_ASSETS_URL}/badges/utopiales/2024/imprimeur_v2/Cea_Recto.jpg`:`${P.HEAVENT_ASSETS_URL}/badges/utopiales/2024/imprimeur_v2/Staff_Recto.jpg`,_x=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,s=n.fields?.cf24297?.value||"Spare",o=s.includes("Protocole")?"black":"white";return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ba,{css:{background:`url(${fx(s)}) no-repeat`,backgroundSize:"cover",fontFamily:"$utopiales",position:"relative"},height:490,width:340,children:[(0,i.jsx)(Ar,{css:{color:o,fontSize:"32px",position:"absolute",textTransform:"uppercase",top:"336px"},textAlign:"center",width:1,children:n.fields?.firstName?.value||""}),(0,i.jsx)(Ar,{css:{color:o,fontSize:"32px",position:"absolute",textTransform:"uppercase",top:"375px"},textAlign:"center",width:1,children:n.fields?.lastName?.value||""}),(0,i.jsx)(Ar,{css:{color:o,fontSize:"24px",position:"absolute",textTransform:"uppercase",top:"433px"},textAlign:"center",width:1,children:s.includes("Bénévole")?s:s.includes("VIP")?"Pass VIP":n.fields.cf38606?.value})]}),(0,i.jsxs)(Ba,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/utopiales/2024/imprimeur_v2/Verso.jpg) no-repeat`,backgroundSize:"cover",pageBreakBefore:"always",position:"relative"},height:490,width:340,children:[(0,i.jsx)(Ar,{css:{fontSize:"16px",position:"absolute",top:"258px"},textAlign:"center",width:1,children:"Code membre :"}),(0,i.jsx)(Ar,{css:{left:"117px",position:"absolute",top:"315px"},height:106,width:106,children:(0,i.jsx)("img",{height:"100%",src:pg(t.ticketId,{height:106,width:106}),width:"100%"})})]})]})},xx=Gs.IX.after(Gs.c9.fromObject({day:23,month:8,year:2024}),Gs.dw.fromObject({day:3})),Ix=e=>Gs.IX.fromDateTimes(Gs.c9.fromObject({day:e,month:8,year:2024,hour:7}),Gs.c9.fromObject({day:e,month:8,year:2024,hour:25===e?15:16})),vx=e=>Gs.IX.fromDateTimes(Gs.c9.fromObject({day:e,month:8,year:2024,hour:25===e?15:16}),Gs.c9.fromObject({day:e+1,month:8,year:2024,hour:4})),bx=e=>Gs.IX.after(Gs.c9.fromObject({day:e,month:8,year:2024}),Gs.dw.fromObject({day:1})),jx=({event:e})=>{const t=e.volunteerRegistration,n=t.userInfo,s=n.fields?.cf22493?.value??"",o=n.fields?.cf26370?.value??"",r=t.positionsSlotsUsersInfos.filter(e=>e.positionSlot.range.overlaps(xx)),a=(0,Bs.A)(r.map(e=>e.position.category.name)).join(", "),l=r.reduce(([e,t,n],i)=>[e||i.positionSlot.range.overlaps(bx(23)),t||i.positionSlot.range.overlaps(bx(24)),n||i.positionSlot.range.overlaps(bx(25))],[!1,!1,!1]),d=(0,Za.A)((0,Bs.A)(t.positionsSlotsUsersInfos.flatMap(e=>[e.positionSlot.range.start?.day,e.positionSlot.range.end?.day])));let c=0;d.length>2?c=2:d.length>0&&(c=1);const u=l.reduce((e,t)=>t?e+12:e,0),h=r.reduce(([e,t],n)=>{const i=n.positionSlot.range;return[[e[0]||i.overlaps(Ix(23)),e[1]||i.overlaps(Ix(24)),e[2]||i.overlaps(Ix(25))],[t[0]||i.overlaps(vx(23)),t[1]||i.overlaps(vx(24)),t[2]||i.overlaps(vx(25))]]},[[!1,!1,!1],[!1,!1,!1]]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ba,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/vandb/Contremarque_1.jpg) no-repeat`,backgroundSize:"cover",color:"#103725",fontFamily:"$firaSans",position:"relative"},height:ig,width:sg,children:[(0,i.jsxs)(Ba,{css:{gap:"10px",justifyContent:"space-between",left:"109px",position:"absolute",top:"181px",right:"109px"},children:[(0,i.jsxs)(Ba,{css:{flexDirection:"column",gap:"6px"},children:[(0,i.jsx)(Ar,{css:{fontFamily:"$badTyp",fontSize:"22px",fontWeight:500,lineHeight:"28px",textTransform:"uppercase"},children:n.name}),(0,i.jsxs)(Ar,{css:{fontSize:"16px",lineHeight:"normal"},children:[(0,i.jsx)("span",{style:{fontWeight:700},children:s}),` | ${a}`]}),(0,i.jsxs)(Ar,{css:{fontSize:"16px",lineHeight:"normal"},children:[(0,i.jsx)("span",{style:{fontWeight:700},children:"T-shirt :"}),` ${c} en taille ${o||""}`]}),(0,i.jsxs)(Ar,{css:{fontSize:"16px",lineHeight:"normal"},children:[(0,i.jsx)("span",{style:{fontWeight:700},children:"Montant EXO :"}),` ${u}`]})]}),(0,i.jsxs)(Ba,{css:{alignItems:"flex-end",flexDirection:"column",gap:"4px"},children:[(0,i.jsx)(Ar,{height:80,width:80,children:(0,i.jsx)("img",{height:"100%",src:pg(t.ticketId,{height:80,width:80}),width:"100%"})}),(0,i.jsx)(Ar,{css:{fontSize:"10px"},children:t.ticketId})]})]}),h[0][0]&&(0,i.jsx)(Ba,{css:{height:"32px",justifyContent:"center",left:"265px",padding:"4px 10px",position:"absolute",top:"809px",width:"138px"},children:(0,i.jsx)("img",{height:"100%",src:`${P.HEAVENT_ASSETS_URL}/badges/vandb/catering.png`})}),h[0][1]&&(0,i.jsx)(Ba,{css:{height:"32px",justifyContent:"center",left:"407px",padding:"4px 10px",position:"absolute",top:"809px",width:"138px"},children:(0,i.jsx)("img",{height:"100%",src:`${P.HEAVENT_ASSETS_URL}/badges/vandb/catering.png`})}),h[0][2]&&(0,i.jsx)(Ba,{css:{height:"32px",justifyContent:"center",left:"549px",padding:"4px 10px",position:"absolute",top:"809px",width:"138px"},children:(0,i.jsx)("img",{height:"100%",src:`${P.HEAVENT_ASSETS_URL}/badges/vandb/catering.png`})}),h[1][0]&&(0,i.jsx)(Ba,{css:{height:"32px",justifyContent:"center",left:"265px",padding:"4px 10px",position:"absolute",top:"845px",width:"138px"},children:(0,i.jsx)("img",{height:"100%",src:`${P.HEAVENT_ASSETS_URL}/badges/vandb/catering.png`})}),h[1][1]&&(0,i.jsx)(Ba,{css:{height:"32px",justifyContent:"center",left:"407px",padding:"4px 10px",position:"absolute",top:"845px",width:"138px"},children:(0,i.jsx)("img",{height:"100%",src:`${P.HEAVENT_ASSETS_URL}/badges/vandb/catering.png`})}),h[1][2]&&(0,i.jsx)(Ba,{css:{height:"32px",justifyContent:"center",left:"549px",padding:"4px 10px",position:"absolute",top:"845px",width:"138px"},children:(0,i.jsx)("img",{height:"100%",src:`${P.HEAVENT_ASSETS_URL}/badges/vandb/catering.png`})})]}),(0,i.jsx)(Ba,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/vandb/Contremarque_2.jpg) no-repeat`,backgroundSize:"cover"},height:ig,width:sg})]})},Cx=e=>(0,i.jsxs)(Ba,{align:"center",css:{visibility:e.visible?"visible":"hidden"},direction:"column",gap:"1",children:[(0,i.jsx)(Ar,{css:{border:"1px solid white",borderRadius:"6px"},height:24,width:24}),(0,i.jsx)(Ar,{css:{color:"white",fontSize:"8px",fontWeight:"500"},children:e.children})]}),yx=e=>{switch(e){case"BENEVOLES":return"#f49538";case"PARTENAIRES":return"#fecc16";case"EXPOSANTS":return"#17bd6d";case"MEDIAS":case"PHOTOGRAPHE":case"VIDÉASTE":return"#fd5e97";case"FOURNISSEURS":case"PRESTATAIRES":case"OFFICIEL":return"#da43c2";case"MEDICAL":return"#ff0000";case"ORGANISATION":return"#36b3e9";default:return""}},kx=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,s=n.fields?.cf18560?.value||"",o=t.accreditationsUsersInfos.map(e=>e.accreditation.acronym||"");return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ba,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/vannes/2024/recto.png) no-repeat`,backgroundColor:yx(s),backgroundSize:"cover",fontFamily:"$montserrat",position:"relative"},height:454,width:378,children:[(0,i.jsx)(Ar,{css:{fontSize:"20px",fontWeight:"700",left:"39px",position:"absolute",top:"167px"},children:n.fields?.firstName?.value||""}),(0,i.jsx)(Ar,{css:{fontSize:"20px",fontWeight:"700",left:"39px",position:"absolute",top:"195px"},children:n.fields?.lastName?.value||""}),(0,i.jsx)(Ar,{css:{fontSize:"20px",fontWeight:"500",left:"39px",position:"absolute",textTransform:"capitalize",top:"241px"},children:s.toLowerCase()}),(0,i.jsx)(Ba,{css:{left:"41px",position:"absolute",top:"347px"},gap:"2",children:(0,Dc.A)(1,8).map(e=>(0,i.jsx)(Ba,{align:"center",css:{background:"#00e5ff",borderRadius:"32px",fontSize:"18px",fontWeight:"700",visibility:o.includes(e.toString(10))?"visible":"hidden"},height:32,justify:"center",width:32,children:e},e))})]}),(0,i.jsx)(Ba,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/vannes/2024/verso_v2.jpg) no-repeat`,backgroundSize:"cover",fontFamily:"$montserrat",position:"relative"},height:454,width:378,children:(0,i.jsxs)(Ba,{css:{gap:"32px",left:"38px",position:"absolute",top:"374px"},children:[(0,i.jsx)(Cx,{visible:o.includes("ven midi"),children:"Ven. Midi"}),(0,i.jsx)(Cx,{visible:o.includes("sam midi"),children:"Sam. Midi"}),(0,i.jsx)(Cx,{visible:o.includes("sam soir"),children:"Sam. Soir"}),(0,i.jsx)(Cx,{visible:o.includes("dim"),children:"Dim."}),(0,i.jsx)(Cx,{visible:o.includes("cocktail"),children:"Cocktail"})]})})]})};var Ax;function wx(){return wx=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const t=Zn(Jc),n=e.positionSlotUserInfo.positionSlot,s=e.positionSlotUserInfo.position,o=s.category,r=s.leaders.concat(o.leaders)[0];return(0,i.jsxs)(Ba,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/vannes/2024/assignemnt_v3.jpg) no-repeat`,backgroundSize:"cover",position:"relative"},height:ig,width:sg,children:[(0,i.jsx)(Ar,{css:{background:"#00e5ff",borderRadius:"$1",color:"white",fontSize:"24px",fontWeight:"700",padding:"10px",position:"absolute",right:"44px",top:"32px"},children:s.name}),(0,i.jsxs)(Ba,{css:{left:"56px",padding:"$7",position:"absolute",top:"152px"},direction:"column",width:682,children:[(0,i.jsxs)(Ba,{justify:"between",width:1,children:[(0,i.jsxs)(Ba,{css:{color:"#1d2939",fontSize:"24px",fontWeight:"700",lineHeight:"28px"},direction:"column",children:[(0,i.jsx)(Ar,{children:e.userInfo.fields?.firstName?.value||""}),(0,i.jsx)(Ar,{children:e.userInfo.fields?.lastName?.value||""})]}),(0,i.jsxs)(Ba,{align:"end",css:{lineHeight:"28px"},direction:"column",children:[(0,i.jsx)(Ar,{css:{fontSize:"22px",fontWeight:"600",textTransform:"capitalize"},children:t.toLocaleString(n.range.start,eo.DateOnly.WeekdayLongMonthLong)}),(0,i.jsx)(Ar,{css:{fontSize:"16px",fontWeight:"700"},children:o.name})]})]}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsxs)(Ar,{color:"gray800",children:["Nous te remercions chaleureusement d’avoir accepté de participer à l’organisation de la 24ème édition du"," ",(0,i.jsx)(ng,{fontWeight:"bold",children:"Marathon de Vannes"})," en tant que bénévole."]}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsxs)(Ba,{css:{border:"1px solid $gray200",borderRadius:"5px",boxShadow:"$xs",padding:"$4"},children:[(0,i.jsxs)(Ba,{css:{flex:"1"},direction:"column",gap:"4",children:[(0,i.jsxs)(Ba,{align:"center",gap:"2",children:[(0,i.jsx)(Ar,{css:{svg:{fill:"$gray700",height:"100%",width:"100%"}},height:16,width:16,children:(0,i.jsx)(Pp,{})}),(0,i.jsxs)(Ba,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(Ar,{color:"gray800",fontWeight:"semiBold",children:"Mission affectée"}),(0,i.jsx)(Ar,{color:"gray800",children:s.name})]})]}),(0,i.jsxs)(Ba,{align:"center",gap:"2",children:[(0,i.jsx)(Ar,{css:{svg:{fill:"$gray700",height:"100%",width:"100%"}},height:16,width:16,children:(0,i.jsx)(Sx,{})}),(0,i.jsxs)(Ba,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(Ar,{color:"gray800",fontWeight:"semiBold",children:"Heure de la mission"}),(0,i.jsxs)(Ar,{color:"gray800",children:["De"," ",t.toLocaleString(n.range.start,eo.TimeOnly)," ","à"," ",t.toLocaleString(n.range.end,eo.TimeOnly)]})]})]}),(0,i.jsxs)(Ba,{align:"center",gap:"2",children:[(0,i.jsx)(Ar,{css:{svg:{fill:"$gray700",height:"100%",width:"100%"}},height:16,width:16,children:(0,i.jsx)(Yf,{})}),(0,i.jsxs)(Ba,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(Ar,{color:"gray800",fontWeight:"semiBold",children:"Lieu de rendez-vous"}),(0,i.jsx)(Ar,{color:"gray800",children:s.address})]})]}),(0,i.jsxs)(Ba,{align:"center",gap:"2",children:[(0,i.jsx)(Ar,{css:{svg:{fill:"$gray700",height:"100%",width:"100%"}},height:16,width:16,children:(0,i.jsx)(zx,{})}),(0,i.jsxs)(Ba,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(Ar,{color:"gray800",fontWeight:"semiBold",children:"Coordonnées GPS"}),(0,i.jsxs)(Ar,{color:"gray800",children:[s.latitude,(0,i.jsx)("br",{}),s.longitude]})]})]})]}),(0,i.jsx)(Ar,{height:255,width:308,children:(0,i.jsx)("a",{href:yg(s.latitude,s.longitude),style:{background:`url(${P.HEAVENT_API_URL}/image/event/${e.eventId}/position/${s.id}.png)`,backgroundPosition:"center",backgroundSize:"cover",display:"block",height:"100%",width:"100%"}})})]}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsxs)(Ba,{css:{lineHeight:"20px"},direction:"column",children:[(0,i.jsx)(Ar,{fontWeight:"bold",children:"Description de la mission"}),m(s.description)&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Ar,{color:"gray800",css:{"& .h-rich-text > p":{margin:"0"}},children:(0,i.jsx)(Cg,{text:s.description})})})]}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsxs)(Ba,{css:{lineHeight:"20px"},direction:"column",children:[(0,i.jsx)(Ar,{fontWeight:"bold",children:"Coordonnées des responsables"}),(0,i.jsx)(Ar,{children:"Merci de te présenter avec cette convocation auprès de ton responsable sur place :"})]}),(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(Ar,{fontSize:"textMd",fontWeight:"bold",textAlign:"center",width:1,children:r?`${r.userInfo.name} : ${r.userInfo.phone?.internationalFormat}`:""})]})]})},Rx=e=>{const t=(0,L.useMemo)(()=>(0,uc.A)(e.event.volunteerRegistration.positionsSlotsUsersInfos,e=>e.positionSlot.range.start.toMillis()),[e.event.volunteerRegistration.positionsSlotsUsersInfos]);return(0,i.jsx)(i.Fragment,{children:t.map(t=>(0,i.jsx)(Ox,{eventId:e.event.id,positionSlotUserInfo:t,userInfo:e.event.volunteerRegistration.userInfo},t.positionSlot.id))})},$x=e=>(0,i.jsx)(Ba,{align:"center",css:{background:e.color,flex:"1",visibility:e.visible?"visible":"hidden"},height:28,justify:"center",width:45,children:(0,i.jsx)(Ar,{css:{color:"white",fontFamily:"$raleway",fontSize:"17px",fontWeight:"700"},children:e.children})}),Dx=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,s=t.accreditationsUsersInfos.map(({accreditation:e})=>e.acronym);return(0,i.jsxs)(Ba,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/vendanges/vendanges_2024.jpg) no-repeat`,backgroundSize:"cover",position:"relative"},height:325,width:204,children:[(0,i.jsx)(Ar,{css:{borderRadius:"92px",height:"92px",left:"56px",overflow:"hidden",position:"absolute",top:"133px",width:"92px"},children:n.fields?.picture&&(0,i.jsx)("img",{height:"100%",src:n.fields.picture?.url,width:"100%"})}),(0,i.jsx)(Ar,{css:{color:"#802c8d",fontFamily:"$raleway",fontSize:"12px",fontWeight:"800",position:"absolute",textAlign:"center",top:"240px",width:"100%"},children:n.name}),(0,i.jsxs)(Ba,{css:{left:"0",position:"absolute",top:"146px"},direction:"column",children:[(0,i.jsx)($x,{color:"#98cd00",visible:s.includes("JEU 19"),children:"JEU"}),(0,i.jsx)($x,{color:"#ff9f01",visible:s.includes("VEN 20")||s.includes("VEN 20 & SAM 21"),children:"VEN"}),(0,i.jsx)($x,{color:"#a655b1",visible:s.includes("SAM 21")||s.includes("VEN 20 & SAM 21"),children:"SAM"})]}),(0,i.jsxs)(Ba,{css:{height:"53px",left:"0",position:"absolute",top:"272px",width:"100%"},children:[(0,i.jsx)(Ba,{align:"center",css:{background:"#6eafe2",height:"100%",flex:"1",visibility:s.includes("1")?"visible":"hidden"},justify:"center",children:(0,i.jsx)(Ar,{css:{color:"white",fontSize:"32px",fontWeight:"700"},children:"1"})}),(0,i.jsx)(Ba,{align:"center",css:{background:"#9261a8",height:"100%",flex:"1",visibility:s.includes("2")?"visible":"hidden"},justify:"center",children:(0,i.jsx)(Ar,{css:{color:"white",fontSize:"32px",fontWeight:"700"},children:"2"})}),(0,i.jsx)(Ba,{align:"center",css:{background:"#accb44",height:"100%",flex:"1",visibility:s.includes("3")?"visible":"hidden"},justify:"center",children:(0,i.jsx)(Ar,{css:{color:"white",fontSize:"32px",fontWeight:"700"},children:"3"})}),(0,i.jsx)(Ba,{align:"center",css:{background:"#e7a726",height:"100%",flex:"1",visibility:s.includes("4")?"visible":"hidden"},justify:"center",children:(0,i.jsx)(Ar,{css:{color:"white",fontSize:"32px",fontWeight:"700"},children:"4"})}),(0,i.jsx)(Ba,{align:"center",css:{background:"#d23780",height:"100%",flex:"1",visibility:s.includes("5")?"visible":"hidden"},justify:"center",children:(0,i.jsx)(Ar,{css:{color:"white",fontSize:"32px",fontWeight:"700"},children:"5"})})]})]})},Px=e=>(0,i.jsx)(Ar,{css:{background:`url(${e.url})`,backgroundSize:"cover",visibility:e.visible?"visible":"hidden"},height:27,width:27}),Fx=e=>{switch(e){case"Organisation":return`${P.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/backgrounds/v2/VG24-rouge.jpg`;case"Intervenant":return`${P.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/backgrounds/v2/VG24-violet.jpg`;case"Media":return`${P.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/backgrounds/v2/VG24-vert.jpg`;case"Partenaire":return`${P.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/backgrounds/v2/VG24-gris.jpg`;case"Team":return`${P.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/backgrounds/v2/VG24-bleu.jpg`;case"Village":return`${P.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/backgrounds/v2/VG24-jaune.jpg`;default:return""}},Mx=e=>{const t="Media"===Rg(e.userInfo.fields,"population")?e.userInfo.fields?.cf37885?.value??"":e.delegation?.name??"";return t.includes("(")?t.substring(0,t.indexOf("(")).trim():t},Nx=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,s=Rg(n.fields,"population",""),o=Mx(t),r=t.accreditationsUsersInfos.map(e=>e.accreditation.acronym),a=r.includes("AAA")||r.includes("PVG")&&r.includes("PCM")&&r.includes("PCC")&&r.includes("ZE")&&r.includes("CAF"),l=n.fields?.cf37926?.value??"";return(0,i.jsxs)(Ba,{css:{background:`url(${Fx(s)}) no-repeat`,backgroundSize:"cover",color:"#231c45",fontFamily:"$poppins",position:"relative"},height:325,width:204,children:[(0,i.jsx)(Ar,{css:{left:"16px",position:"absolute",top:"81px"},height:78,width:78,children:(0,i.jsx)("img",{height:"100%",src:m(n.fields?.picture?.url)?n.fields.picture.url:`${P.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/assets/v3/avatar_defaut.jpg`,width:"100%"})}),(0,i.jsx)(Ba,{css:{bottom:"133px",fontSize:"10px",fontWeight:"700",left:"16px",lineHeight:"10px",position:"absolute",textTransform:"uppercase"},width:106,wrap:"wrap",children:o}),(0,i.jsx)(Ar,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/assets/v3/divider.png) no-repeat`,backgroundSize:"cover",height:"1px",left:"16px",position:"absolute",top:"194px",width:"78px"}}),(0,i.jsx)(Ar,{css:{fontSize:"10px",fontWeight:"700",left:"16px",position:"absolute",textTransform:"uppercase",top:"198px"},children:n.fields?.firstName?.value||""}),(0,i.jsx)(Ar,{css:{fontSize:"14px",fontWeight:"700",left:"16px",position:"absolute",textTransform:"uppercase",top:"208px"},children:n.fields?.lastName?.value||""}),(0,i.jsx)(Ar,{css:{color:"white",fontSize:"13px",fontWeight:"700",left:"15px",position:"absolute",textTransform:"uppercase",top:"244px"},children:s}),(0,i.jsx)(Ar,{css:{color:"rgba(255, 255, 255, 0.70)",fontSize:"10px",fontWeight:"700",left:"15px",position:"absolute",textTransform:"uppercase",top:"258px"},children:l}),r.includes("CLE")&&(0,i.jsx)(Ar,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/assets/v5/Accompagnant.png) no-repeat`,backgroundSize:"cover",left:"100px",position:"absolute",top:"81px"},height:59,width:27}),(0,i.jsx)(Ar,{css:{left:"139px",position:"absolute",top:"22px"},height:46,width:46,children:(0,i.jsx)("img",{height:"100%",src:pg(t.ticketId,{height:46,width:46}),width:"100%"})}),a?(0,i.jsx)(Ar,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/assets/v3/All_Access.png) no-repeat`,backgroundSize:"cover",left:"133px",position:"absolute",top:"80px"},height:143,width:27}):(0,i.jsxs)(Ba,{css:{gap:"2px",left:"133px",position:"absolute",top:"80px"},direction:"column",children:[(0,i.jsx)(Px,{url:`${P.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/assets/v2/Ponton.png`,visible:r.includes("PVG")}),(0,i.jsx)(Px,{url:`${P.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/assets/v2/Media.png`,visible:r.includes("PCM")}),(0,i.jsx)(Px,{url:`${P.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/assets/v2/PC_Course.png`,visible:r.includes("PCC")}),(0,i.jsx)(Px,{url:`${P.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/assets/v2/Equipage.png`,visible:r.includes("ZE")}),(0,i.jsx)(Px,{url:`${P.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/assets/v2/Cafe_de_Presse.png`,visible:r.includes("CAF")})]}),(0,i.jsxs)(Ba,{css:{gap:"2px",left:"164px",position:"absolute",top:"80px"},direction:"column",children:[(0,i.jsx)(Px,{url:`${P.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/assets/v2/Hospitalite.png`,visible:r.includes("VH")}),(0,i.jsx)(Px,{url:`${P.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/assets/v2/24h.png`,visible:r.includes("H24")}),(0,i.jsx)(Px,{url:`${P.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/assets/v2/Regie_TV.png`,visible:r.includes("TV")}),(0,i.jsx)(Px,{url:`${P.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/assets/v2/Couloir_Ponton.png`,visible:r.includes("COU")}),(0,i.jsx)(Px,{url:`${P.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/assets/v2/Passerrelle.png`,visible:r.includes("PAS")})]})]})},Lx=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,s=Mx(t),o=n.fields?.cf37884?.value||[],r=Rg(n.fields,"population",""),a=n.fields?.cf37926?.value??"";return(0,i.jsxs)(Ba,{css:{background:`url(${l=o,l.some(e=>e.includes("Anglais"))?`${P.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/contremarque/contremarque_en.jpg`:`${P.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/contremarque/contremarque_fr.jpg`}) no-repeat`,backgroundSize:"cover",color:"#231c45",fontFamily:"$poppins",position:"relative"},height:ig,width:sg,children:[(0,i.jsx)(Ar,{css:{fontSize:"20px",fontWeight:"700",left:"431px",position:"absolute",textTransform:"uppercase",top:"68px"},children:r}),(0,i.jsx)(Ar,{css:{fontSize:"18px",left:"431px",position:"absolute",top:"99px"},children:a}),(0,i.jsx)(Ar,{css:{fontSize:"20px",fontWeight:"700",left:"431px",position:"absolute",top:"172px"},children:n.fields?.firstName?.value||""}),(0,i.jsx)(Ar,{css:{fontSize:"20px",fontWeight:"700",left:"431px",position:"absolute",top:"201px"},children:n.fields?.lastName?.value||""}),(0,i.jsx)(Ar,{css:{fontSize:"18px",left:"431px",position:"absolute",top:"238px"},children:s}),(0,i.jsx)(Ar,{css:{position:"absolute",right:"60px",top:"64px"},height:84,width:84,children:(0,i.jsx)("img",{height:"100%",src:pg(t.ticketId,{height:84,width:84}),width:"100%"})}),(0,i.jsx)(Ar,{css:{fontSize:"9px",fontWeight:"700",position:"absolute",right:"60px",top:"150px"},children:t.ticketId})]});var l};function Bx(e,t,n,s){switch(e){case xe.Animajeconvention:return(0,i.jsx)(Ig,{event:t});case xe.Asoassignment:return(0,i.jsx)(zg,{date:s,event:t,options:n});case xe.Cerclestaff:return(0,i.jsx)(Wg,{event:t});case xe.Cerclelivraison:return(0,i.jsx)(Lg,{event:t});case xe.Cerclepressandpartenaire:return(0,i.jsx)(Vg,{event:t});case xe.Cercleopcom:return(0,i.jsx)(Bg,{event:t});case xe.Delta:return(0,i.jsx)(Hg,{event:t});case xe.Dfcoa4:return(0,i.jsx)(Zg,{event:t});case xe.Dfcosmall:return(0,i.jsx)(Qg,{event:t});case xe.Eurockeennes:return(0,i.jsx)(lp,{event:t});case xe.Fcg:return(0,i.jsx)(hp,{event:t});case xe.Garorockplanning:return(0,i.jsx)(gp,{event:t});case xe.Goldencoast:return(0,i.jsx)(fp,{event:t});case xe.Hbcldc:return(0,i.jsx)(vp,{event:t});case xe.Hbclnh:return(0,i.jsx)(yp,{event:t});case xe.Lnh:return(0,i.jsx)(wp,{event:t});case xe.Moorea:return(0,i.jsx)(Sp,{event:t});case xe.Nuitssecretes:return(0,i.jsx)(Ep,{event:t});case xe.Openbrest:return(0,i.jsx)(zp,{event:t});case xe.P2nassignment:return(0,i.jsx)(Bp,{event:t});case xe.P2nassignmentmontagedemontage:return(0,i.jsx)(Up,{event:t});case xe.P2nbadge:return(0,i.jsx)(Gp,{event:t});case xe.Paris20km:return(0,i.jsx)(Zp,{event:t});case xe.Paris20kmassignment:return(0,i.jsx)(Jp,{date:s,event:t});case xe.Paris20kmcontremarque:return(0,i.jsx)(Qp,{event:t});case xe.Pastourelle:return(0,i.jsx)(E_,{event:t});case xe.Pastourelleexposant:return(0,i.jsx)(O_,{event:t});case xe.Pec:return(0,i.jsx)(P_,{event:t,options:n});case xe.Playground:return(0,i.jsx)(B_,{event:t});case xe.Roiarthur:return(0,i.jsx)(V_,{event:t});case xe.Rose:return(0,i.jsx)(q_,{event:t});case xe.Roseparking:return(0,i.jsx)(K_,{event:t});case xe.Salamandre:return(0,i.jsx)(ix,{event:t});case xe.T24assignment:return(0,i.jsx)(cx,{event:t,options:n});case xe.Triathlonlarochellebadge:return(0,i.jsx)(mx,{event:t});case xe.Utopialesimprimeur:return(0,i.jsx)(_x,{event:t});case xe.Utopialesa4:return(0,i.jsx)(px,{event:t});case xe.Vandbcontremarque:return(0,i.jsx)(jx,{event:t});case xe.Vannes:return(0,i.jsx)(kx,{event:t});case xe.Vannesassignment:return(0,i.jsx)(Rx,{event:t});case xe.Vendanges:return(0,i.jsx)(Dx,{event:t});case xe.Vendeeglobebadge:return(0,i.jsx)(Nx,{event:t});case xe.Vendeeglobecontremarque:return(0,i.jsx)(Lx,{event:t});default:return ll()}}function Vx(e){switch(e){case xe.Animajeconvention:return"Animaje Convention";case xe.Asoassignment:return"Fiche d'affectation ASO";case xe.Cerclestaff:return"Cercle Staff & Visiteurs";case xe.Cerclelivraison:return"Cercle Livraison";case xe.Cerclepressandpartenaire:return"Cercle Press & Partenaire";case xe.Cercleopcom:return"Cercle OPCom";case xe.Delta:return"Badge Delta";case xe.Dfcoa4:return"Badge Dijon DFCO A4";case xe.Dfcosmall:return"Badge Dijon DFCO Carte";case xe.Eurockeennes:return"Planning Les Eurockéennes";case xe.Fcg:return"Accréditation FCG";case xe.Garorockplanning:return"Planning Garorock";case xe.Goldencoast:return"Badge Golden Coast";case xe.Hbcldc:return"Badge HBC Ligue des Champions";case xe.Hbclnh:return"Badge HBC LNH";case xe.Lnh:return"Badge LNH";case xe.Moorea:return"Badge Moorea";case xe.Nuitssecretes:return"Badge Nuits Secrètes";case xe.Openbrest:return"Badge Open de Brest";case xe.P2nassignment:return"Fiche d'affectation P2N (Exploit)";case xe.P2nassignmentmontagedemontage:return"Fiche d'affectation P2N (Montage/Démontage)";case xe.P2nbadge:return"Badge P2N";case xe.Paris20km:return"Badge 20km de Paris";case xe.Paris20kmassignment:return"Fiche d'affectation 20km de Paris";case xe.Paris20kmcontremarque:return"Contremarque 20km de Paris";case xe.Pastourelle:return"Badge Pastourelle bénévoles";case xe.Pastourelleexposant:return"Badge Pastourelle staffs";case xe.Pec:return"Badge Paris Entertainment Company";case xe.Playground:return"Fiche d'affectation Playground";case xe.Roiarthur:return"Badge Roi Arthur";case xe.Rose:return"Contremarque Rose Festival";case xe.Roseparking:return"Rose Festival Pass Parking";case xe.Salamandre:return"Badge Salamandre";case xe.T24assignment:return"Fiche d'affectation T24";case xe.Triathlonlarochellebadge:return"Badge Triathlon la Rochelle";case xe.Utopialesimprimeur:return"Badge Utopiales (version imprimeur)";case xe.Utopialesa4:return"Badge Utopiales (version A4)";case xe.Vandbcontremarque:return"V and B Fest' Convocation";case xe.Vannes:return"Badge Marathon de Vannes";case xe.Vannesassignment:return"Fiche d'affectation Marathon de Vannes";case xe.Vendanges:return"Badge Les Vendanges Musicales";case xe.Vendeeglobebadge:return"Badge Vendée Globe";case xe.Vendeeglobecontremarque:return"Contremarque Vendée Globe";default:return ll()}}function Ux(e){return"number"==typeof e?.latitude&&"number"==typeof e?.longitude?{lat:e.latitude,lng:e.longitude}:void 0}function Wx(e,t,n){const i=eo.DateOnly.MonthLong;return t.equals(n)?e.toLocaleString(t,i):[e.toLocaleString(t,eo.DateOnly.MonthShort),e.toLocaleString(n,eo.DateOnly.MonthShort)].join(" - ")}function Gx(e){switch(e){case Me.Archived:case Me.Done:return"error";case Me.Ongoing:return"success";case Me.Upcoming:return"purple";default:return ll()}}function Hx(e,t){const n=Gs.c9.now().setZone("utc",{keepLocalTime:!0}).startOf("day");return Gs.IX.fromDateTimes(e.startOf("day"),t.endOf("day")).contains(n)?n:e}const qx=e=>{const{translate:t}=vl(),{mutate:n}=function(e={}){return ei("mutation BackofficeEventUnarchive($eventId: EventId!) {\n backofficeEventUnarchive(eventId: $eventId)\n}\n",e)}();return(0,i.jsxs)(Mc,{children:[(0,i.jsx)(Oc,{width:100,children:e.event.id}),(0,i.jsx)(Oc,{children:(0,i.jsx)(Zc,{to:Hi.EVENT({organizationId:e.organizationId,eventId:e.event.id}),children:e.event.name})}),(0,i.jsx)(Oc,{children:(0,i.jsx)(rc,{color:Gx(e.event.state),children:t(e.event.state)})}),(0,i.jsx)(Oc,{children:e.event.state===Me.Archived&&(0,i.jsx)(zl,{color:"invisible",onClick:async()=>{await n({eventId:e.event.id}),e.reload()},children:t("d_sarchiver_76082")})})]})},Kx=e=>{const{history:t,translate:n}=vl(),s=Bc(),o=Zn(eg),r=Zn(Ua),{mutate:a}=function(e={}){return ei("mutation BackofficeOrganizationUpdate(\n $id: OrganizationId!\n $organization: BackofficeOrganizationInput!\n) {\n backofficeOrganizationUpdate(id: $id, organization: $organization) {\n id\n }\n}\n",e)}(),[l,d,c]=Wc(""),[u,h]=(0,L.useState)([]),[g,p]=(0,L.useState)({direction:yt.Asc,attribute:Fe.Name}),[f,_]=(0,L.useState)(0),{data:x,isLoading:I,reload:v}=Qn("query BackofficeEvents(\n $organizationId: OrganizationId!\n $name: String\n $states: [EventState!]\n $sort: EventsSort\n $offset: Int\n) {\n backoffice {\n events(\n organizationId: $organizationId\n name: $name\n states: $states\n sort: $sort\n limit: 25\n offset: $offset\n ) {\n nodes {\n id\n name\n state\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{organizationId:e.organization.id,name:m(d)?d:void 0,states:so(u)?u:void 0,sort:g,offset:f},[]);const{numberOfPages:b,totalCount:j}=Su(x.backoffice?.events),C=(0,L.useMemo)(()=>(0,xh.A)(P.ADMINS.concat(e.organization.users).map(e=>({id:e.id,name:e.email})),({id:e})=>e),[e.organization]),y=(0,L.useMemo)(()=>(0,uc.A)(sn.map(e=>({value:e,name:Vx(e)})),({name:e})=>e),[]),k=e=>{p(e),_(0)};return(0,i.jsx)(kl,{height:1,hideDefaultErrors:!0,initialValues:{organization:o.organizationInputDefault(e.organization)},render:({form:t,handleSubmit:o,submitting:r})=>(0,i.jsx)(Lm,{button:(0,i.jsx)(zl,{isLoading:r,textAlign:"center",onClick:o,children:n("mettre_jour_l_12499")}),category:"Backoffice",fallbackClosePath:Ps.BACKOFFICE_ORGANIZATIONS,heading:n("mise_jour_de_17055",e.organization.name),children:(0,i.jsxs)(Mm,{children:[(0,i.jsx)(jl,{}),(0,i.jsxs)(Bm,{children:[(0,i.jsx)(Vl,{label:n("nom_de_l_organi_49583"),name:"organization.name"}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(Hm,{label:n("date_de_fin_de_17750"),name:"organization.periodEndAt"}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(Ym,{isSearchVisible:!0,isSelectAllVisible:!0,label:n("fonctionnalit_s_47714"),multiple:!0,name:"organization.features",children:mn.map(e=>(0,i.jsx)("option",{value:e,children:e},e))}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(Ym,{isSearchVisible:!0,label:n("badges_personna_27045"),multiple:!0,name:"organization.customBadges",children:y.map(({value:e,name:t})=>(0,i.jsx)("option",{value:e,children:t},e))}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(Ym,{isSearchVisible:!0,label:n("utilisateurs_ay_27051"),multiple:!0,name:"organization.usersIds",children:C.map(({id:e,name:t})=>(0,i.jsx)("option",{value:e,children:t},e))}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(Vl,{label:n("id_de_l_organis_67465"),name:"organization.weezeventOrganizationId",rightIcon:"xmark",shouldParseAsInt:!0,onRightIconClick:()=>{t.change("organization.weezeventOrganizationId",null)}}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(Gm,{name:"organization.isBlocked",children:n("bloquer_l_organ_81103")})]}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsxs)(Vm,{hideToggle:!0,initialIsOpen:!0,heading:n("facturation_53594"),children:[(0,i.jsx)(Jm,{name:"organization.useOldBilling",children:n("utilise_l_ancie_40491")}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsxs)(Ba,{gap:"4",children:[(0,i.jsx)(Vl,{label:n("nombre_de_membr_16400"),name:"organization.membersLimit",shouldParseAsInt:!0}),(0,i.jsx)(Km,{label:n("prix_par_membre_20633"),name:"organization.pricePerMember"})]}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(Ar,{children:n("nombre_de_membr_20439",e.organization.membersStats.numberOfMembers)}),(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(Ar,{children:n("nombre_de_membr_54470",e.organization.membersStats2024.numberOfMembers)}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(Xm,{label:n("commentaire_sur_40207"),name:"organization.billingComment"})]}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(Vm,{hideToggle:!0,initialIsOpen:!0,heading:n("Event"),children:(0,i.jsx)(Lc,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ar,{width:200,children:(0,i.jsx)(yc,{isSelectAllVisible:!0,multiple:!0,placeholder:n("status_06428"),values:u,onChange:e=>{h(e),_(0)},children:s(hn)})}),(0,i.jsx)(Ar,{width:320,children:(0,i.jsx)(Bl,{icon:"magnifying-glass",placeholder:n("rechercher_un_40024"),value:l,onChange:e=>{c(e),_(0)}})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Gc,{width:100,children:"ID"}),(0,i.jsx)(jm,{attribute:Fe.Name,setSort:k,sort:g,children:n("nom_de_l_v_nem_08711")}),(0,i.jsx)(Gc,{children:n("status_06428")}),(0,i.jsx)(Gc,{})]}),numberOfPages:b,offset:f,rows:I?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Hc,{bx:!0}),(0,i.jsx)(Hc,{bx:!0}),(0,i.jsx)(Hc,{bx:!0})]}):x.backoffice.events.nodes.map(t=>(0,i.jsx)(qx,{event:t,organizationId:e.organization.id,reload:v},t.id)),setOffset:_,title:n("liste_des_v_ne_29929"),totalCount:j})}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(Bm,{children:(0,i.jsx)(zl,{isLoading:r,textAlign:"center",onClick:o,children:n("mettre_jour_l_12499")})})]})}),validate:r.validateForForm(o.updateOrganizationSchema()),width:1,onSubmit:async n=>{await a({id:e.organization.id,organization:n.organization}),t.goBack(Ps.BACKOFFICE)}})},Yx=()=>{const{organizationId:e}=ti(),{data:t,loader:n}=Qn(Ur,{organizationId:e},[Vs.OrganizationBackofficeFragment]);return n||(0,i.jsx)(Kx,{organization:t.data.row})},Zx=()=>(Md(Xn()("back_office_83072")),(0,i.jsxs)(Sr.dO,{children:[(0,i.jsx)(Sr.qh,{exact:!0,path:Ps.BACKOFFICE_ORGANIZATIONS,children:(0,i.jsx)(Pm,{})}),(0,i.jsx)(Sr.qh,{exact:!0,path:Ps.EDIT_BACKOFFICE_ORGANIZATION(":organizationId"),children:(0,i.jsx)(Yx,{})}),(0,i.jsx)(Sr.qh,{exact:!0,path:Ps.BACKOFFICE_INVOICES,children:(0,i.jsx)(uu,{})}),(0,i.jsx)(Sr.qh,{children:(0,i.jsx)(oi,{path:Ps.BACKOFFICE_ORGANIZATIONS,replace:!0})})]})),Xx=_r(Ba,{backgroundColor:"$blueGray900",".amicale-theme &, .volunteers-theme &":{backgroundColor:"white"},".mso-theme &":{backgroundColor:"$cyan"}}),Jx=()=>(0,i.jsx)(id,{}),Qx=L.forwardRef((e,t)=>(0,i.jsxs)(Xx,{ref:t,align:"stretch",css:{overflow:"auto",padding:"$6"},justify:"between",width:1,children:[(0,i.jsx)(Ar,{width:100}),(0,i.jsxs)(Ba,{align:"stretch",css:{height:"fit-content",py:"$2",width:"920px"},direction:"column",gap:"6",children:[(0,i.jsx)(Ba,{css:{marginBottom:"$7","& svg":{height:"100%"}},height:32,justify:"center",children:(0,i.jsx)(Jx,{})}),e.children]}),(0,i.jsx)(Ba,{justify:"end",width:100,children:(0,i.jsx)(zl,{color:"gray",leftIcon:"xmark",onClick:e.onClose})})]}));Qx.displayName="OnboardingView";const eI=["Africa/Abidjan","Africa/Accra","Africa/Addis_Ababa","Africa/Algiers","Africa/Asmara","Africa/Asmera","Africa/Bamako","Africa/Bangui","Africa/Banjul","Africa/Bissau","Africa/Blantyre","Africa/Brazzaville","Africa/Bujumbura","Africa/Cairo","Africa/Casablanca","Africa/Ceuta","Africa/Conakry","Africa/Dakar","Africa/Dar_es_Salaam","Africa/Djibouti","Africa/Douala","Africa/El_Aaiun","Africa/Freetown","Africa/Gaborone","Africa/Harare","Africa/Johannesburg","Africa/Juba","Africa/Kampala","Africa/Khartoum","Africa/Kigali","Africa/Kinshasa","Africa/Lagos","Africa/Libreville","Africa/Lome","Africa/Luanda","Africa/Lubumbashi","Africa/Lusaka","Africa/Malabo","Africa/Maputo","Africa/Maseru","Africa/Mbabane","Africa/Mogadishu","Africa/Monrovia","Africa/Nairobi","Africa/Ndjamena","Africa/Niamey","Africa/Nouakchott","Africa/Ouagadougou","Africa/Porto-Novo","Africa/Sao_Tome","Africa/Timbuktu","Africa/Tripoli","Africa/Tunis","Africa/Windhoek","America/Adak","America/Anchorage","America/Anguilla","America/Antigua","America/Araguaina","America/Argentina/Buenos_Aires","America/Argentina/Catamarca","America/Argentina/Cordoba","America/Argentina/Jujuy","America/Argentina/La_Rioja","America/Argentina/Mendoza","America/Argentina/Rio_Gallegos","America/Argentina/Salta","America/Argentina/San_Juan","America/Argentina/San_Luis","America/Argentina/Tucuman","America/Argentina/Ushuaia","America/Aruba","America/Asuncion","America/Atikokan","America/Atka","America/Bahia","America/Bahia_Banderas","America/Barbados","America/Belem","America/Belize","America/Blanc-Sablon","America/Boa_Vista","America/Bogota","America/Boise","America/Buenos_Aires","America/Cambridge_Bay","America/Campo_Grande","America/Cancun","America/Caracas","America/Catamarca","America/Cayenne","America/Cayman","America/Chicago","America/Chihuahua","America/Coral_Harbour","America/Cordoba","America/Costa_Rica","America/Creston","America/Cuiaba","America/Curacao","America/Danmarkshavn","America/Dawson","America/Dawson_Creek","America/Denver","America/Detroit","America/Dominica","America/Edmonton","America/Eirunepe","America/El_Salvador","America/Ensenada","America/Fort_Nelson","America/Fort_Wayne","America/Fortaleza","America/Glace_Bay","America/Godthab","America/Goose_Bay","America/Grand_Turk","America/Grenada","America/Guadeloupe","America/Guatemala","America/Guayaquil","America/Guyana","America/Halifax","America/Havana","America/Hermosillo","America/Indiana/Indianapolis","America/Indiana/Knox","America/Indiana/Marengo","America/Indiana/Petersburg","America/Indiana/Tell_City","America/Indiana/Vevay","America/Indiana/Vincennes","America/Indiana/Winamac","America/Indianapolis","America/Inuvik","America/Iqaluit","America/Jamaica","America/Jujuy","America/Juneau","America/Kentucky/Louisville","America/Kentucky/Monticello","America/Kralendijk","America/La_Paz","America/Lima","America/Los_Angeles","America/Louisville","America/Lower_Princes","America/Maceio","America/Managua","America/Manaus","America/Marigot","America/Martinique","America/Matamoros","America/Mazatlan","America/Mendoza","America/Menominee","America/Merida","America/Metlakatla","America/Mexico_City","America/Miquelon","America/Moncton","America/Monterrey","America/Montevideo","America/Montreal","America/Montserrat","America/Nassau","America/New_York","America/Nipigon","America/Nome","America/Noronha","America/North_Dakota/Beulah","America/North_Dakota/Center","America/North_Dakota/New_Salem","America/Ojinaga","America/Panama","America/Pangnirtung","America/Paramaribo","America/Phoenix","America/Port-au-Prince","America/Port_of_Spain","America/Porto_Acre","America/Porto_Velho","America/Puerto_Rico","America/Punta_Arenas","America/Rainy_River","America/Rankin_Inlet","America/Recife","America/Regina","America/Resolute","America/Rio_Branco","America/Rosario","America/Santa_Isabel","America/Santarem","America/Santiago","America/Santo_Domingo","America/Sao_Paulo","America/Scoresbysund","America/Shiprock","America/Sitka","America/St_Barthelemy","America/St_Johns","America/St_Kitts","America/St_Lucia","America/St_Thomas","America/St_Vincent","America/Swift_Current","America/Tegucigalpa","America/Thule","America/Thunder_Bay","America/Tijuana","America/Toronto","America/Tortola","America/Vancouver","America/Virgin","America/Whitehorse","America/Winnipeg","America/Yakutat","America/Yellowknife","Antarctica/Casey","Antarctica/Davis","Antarctica/DumontDUrville","Antarctica/Macquarie","Antarctica/Mawson","Antarctica/Palmer","Antarctica/Rothera","Antarctica/South_Pole","Antarctica/Syowa","Antarctica/Troll","Antarctica/Vostok","Arctic/Longyearbyen","Asia/Aden","Asia/Almaty","Asia/Amman","Asia/Anadyr","Asia/Aqtau","Asia/Aqtobe","Asia/Ashgabat","Asia/Ashkhabad","Asia/Atyrau","Asia/Baghdad","Asia/Bahrain","Asia/Baku","Asia/Bangkok","Asia/Barnaul","Asia/Beirut","Asia/Bishkek","Asia/Brunei","Asia/Calcutta","Asia/Chita","Asia/Choibalsan","Asia/Chongqing","Asia/Chungking","Asia/Colombo","Asia/Dacca","Asia/Damascus","Asia/Dhaka","Asia/Dili","Asia/Dubai","Asia/Dushanbe","Asia/Famagusta","Asia/Gaza","Asia/Harbin","Asia/Hebron","Asia/Ho_Chi_Minh","Asia/Hong_Kong","Asia/Hovd","Asia/Irkutsk","Asia/Istanbul","Asia/Jakarta","Asia/Jayapura","Asia/Jerusalem","Asia/Kabul","Asia/Kamchatka","Asia/Karachi","Asia/Kashgar","Asia/Kathmandu","Asia/Katmandu","Asia/Khandyga","Asia/Kolkata","Asia/Krasnoyarsk","Asia/Kuala_Lumpur","Asia/Kuching","Asia/Kuwait","Asia/Macao","Asia/Macau","Asia/Magadan","Asia/Makassar","Asia/Manila","Asia/Muscat","Asia/Nicosia","Asia/Novokuznetsk","Asia/Novosibirsk","Asia/Omsk","Asia/Oral","Asia/Phnom_Penh","Asia/Pontianak","Asia/Pyongyang","Asia/Qatar","Asia/Qostanay","Asia/Qyzylorda","Asia/Rangoon","Asia/Riyadh","Asia/Saigon","Asia/Sakhalin","Asia/Samarkand","Asia/Seoul","Asia/Shanghai","Asia/Singapore","Asia/Srednekolymsk","Asia/Taipei","Asia/Tashkent","Asia/Tbilisi","Asia/Tehran","Asia/Tel_Aviv","Asia/Thimbu","Asia/Thimphu","Asia/Tokyo","Asia/Tomsk","Asia/Ujung_Pandang","Asia/Ulaanbaatar","Asia/Ulan_Bator","Asia/Urumqi","Asia/Ust-Nera","Asia/Vientiane","Asia/Vladivostok","Asia/Yakutsk","Asia/Yangon","Asia/Yekaterinburg","Asia/Yerevan","Atlantic/Azores","Atlantic/Bermuda","Atlantic/Canary","Atlantic/Cape_Verde","Atlantic/Faeroe","Atlantic/Faroe","Atlantic/Jan_Mayen","Atlantic/Madeira","Atlantic/Reykjavik","Atlantic/South_Georgia","Atlantic/St_Helena","Atlantic/Stanley","Australia/Adelaide","Australia/Brisbane","Australia/Broken_Hill","Australia/Canberra","Australia/Currie","Australia/Darwin","Australia/Eucla","Australia/Hobart","Australia/Lindeman","Australia/Lord_Howe","Australia/Melbourne","Australia/North","Australia/Perth","Australia/Queensland","Australia/South","Australia/Sydney","Australia/Tasmania","Australia/Victoria","Australia/West","Australia/Yancowinna","Brazil/Acre","Brazil/East","Brazil/West","Canada/Atlantic","Canada/Central","Canada/Eastern","Canada/Mountain","Canada/Newfoundland","Canada/Pacific","Canada/Saskatchewan","Canada/Yukon","Chile/Continental","Europe/Amsterdam","Europe/Andorra","Europe/Astrakhan","Europe/Athens","Europe/Belfast","Europe/Belgrade","Europe/Berlin","Europe/Bratislava","Europe/Brussels","Europe/Bucharest","Europe/Budapest","Europe/Busingen","Europe/Chisinau","Europe/Copenhagen","Europe/Dublin","Europe/Gibraltar","Europe/Guernsey","Europe/Helsinki","Europe/Isle_of_Man","Europe/Istanbul","Europe/Jersey","Europe/Kaliningrad","Europe/Kiev","Europe/Kirov","Europe/Lisbon","Europe/Ljubljana","Europe/London","Europe/Luxembourg","Europe/Madrid","Europe/Malta","Europe/Mariehamn","Europe/Minsk","Europe/Monaco","Europe/Moscow","Europe/Nicosia","Europe/Oslo","Europe/Paris","Europe/Podgorica","Europe/Prague","Europe/Riga","Europe/Rome","Europe/Samara","Europe/San_Marino","Europe/Sarajevo","Europe/Saratov","Europe/Simferopol","Europe/Skopje","Europe/Sofia","Europe/Stockholm","Europe/Tallinn","Europe/Tirane","Europe/Tiraspol","Europe/Ulyanovsk","Europe/Uzhgorod","Europe/Vaduz","Europe/Vatican","Europe/Vienna","Europe/Vilnius","Europe/Volgograd","Europe/Warsaw","Europe/Zagreb","Europe/Zaporozhye","Europe/Zurich","Indian/Antananarivo","Indian/Chagos","Indian/Christmas","Indian/Cocos","Indian/Comoro","Indian/Kerguelen","Indian/Mahe","Indian/Maldives","Indian/Mauritius","Indian/Mayotte","Indian/Reunion","Mexico/General","Pacific/Apia","Pacific/Auckland","Pacific/Bougainville","Pacific/Chatham","Pacific/Chuuk","Pacific/Easter","Pacific/Efate","Pacific/Enderbury","Pacific/Fakaofo","Pacific/Fiji","Pacific/Funafuti","Pacific/Galapagos","Pacific/Gambier","Pacific/Guadalcanal","Pacific/Guam","Pacific/Honolulu","Pacific/Johnston","Pacific/Kiritimati","Pacific/Kosrae","Pacific/Kwajalein","Pacific/Majuro","Pacific/Marquesas","Pacific/Midway","Pacific/Nauru","Pacific/Niue","Pacific/Norfolk","Pacific/Noumea","Pacific/Pago_Pago","Pacific/Palau","Pacific/Pitcairn","Pacific/Pohnpei","Pacific/Ponape","Pacific/Port_Moresby","Pacific/Rarotonga","Pacific/Saipan","Pacific/Samoa","Pacific/Tahiti","Pacific/Tarawa","Pacific/Tongatapu","Pacific/Truk","Pacific/Wake","Pacific/Wallis","Pacific/Yap"];function tI(e){return"string"!=typeof e||""===e.trim()||c(e.toLowerCase())===e}const nI=["country","code","number"];let iI=class extends Gl{countriesService;constructor(e,t){super(e),this.countriesService=t}basePhoneInputDefault(){return{country:"",code:"",number:""}}phoneInputDefault(e){return{...this.basePhoneInputDefault(),...e.phone}}phoneInputSchema(){return d.Ik().shape({country:d.Yj().required(this.t("le_num_ro_de_t_76885")).oneOf(this.countriesService.countriesCodes,this.t("le_num_ro_de_t_76885")),code:d.Yj().required(this.t("le_num_ro_de_t_76885")).oneOf(this.countriesService.phoneCodes,this.t("le_num_ro_de_t_76885")),number:d.Yj().required(this.t("le_num_ro_de_t_76885"))})}phoneInputSchemaNotRequired(){return d.Ik().nullable().shape({country:d.Yj(),code:d.Yj(),number:d.Yj()})}};iI=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[qn,hu])],iI);let sI=class extends Gl{countriesService;phoneInputService;constructor(e,t,n){super(n),this.countriesService=e,this.phoneInputService=t}organizationInputDefault(e){const t=this.countriesService.getDefaultCountryValues();return{name:"",adminFirstName:"",adminLastName:"",adminPhone:this.phoneInputService.phoneInputDefault(t),weezeventOrganizationId:e}}organizationInputSchema(e){let t=d.Ik().shape({name:d.Yj().required(this.t("le_nom_de_l_org_60618")),adminFirstName:d.Yj().required(this.t("le_pr_nom_est_r_10935")),adminLastName:d.Yj().required(this.t("le_nom_est_requ_61536")),adminPhone:this.phoneInputService.phoneInputSchema()});return e||(t=t.shape({termsAccepted:d.zM().oneOf([!0],this.t("il_est_n_cessai_83896")).required(this.t("il_est_n_cessai_83896"))})),t}createOrganizationSchema(e){return d.Ik().shape({organization:this.organizationInputSchema(e)})}organizationInfosInputDefault(e){const t=this.countriesService.getDefaultCountryValues();return{name:e.name??"",adminName:e.adminName??"",adminEmail:e.adminEmail??"",street:e.street??"",postalCode:e.postalCode??"",city:e.city??"",country:e.country??t.user.country,timeZone:e.timeZone??Gs.c9.local().zoneName,emailSenderId:e.emailSenderId,dateFormat:e.dateFormat,datetimeFormat:e.datetimeFormat,timeFormat:e.timeFormat}}organizationInfosInputSchema(){return d.Ik().shape({name:d.Yj().required(this.t("le_nom_de_l_org_60618")),adminName:d.Yj().required(this.t("le_nom_du_respo_43823")),adminEmail:d.Yj().required(this.t("l_e_mail_du_rep_90871")).email(this.t("l_e_mail_du_rep_90871")).test("clean-admin-email",this.t("l_e_mail_du_rep_90871"),function(){return tI(this.parent.adminEmail)}),street:d.Yj().required(this.t("l_adresse_est_r_40489")),postalCode:d.Yj().required(this.t("le_code_postal_43189")),city:d.Yj().required(this.t("la_ville_est_re_35239")),country:d.Yj().oneOf(this.countriesService.countriesCodes).required(this.t("le_pays_est_req_33749")),emailSenderId:d.ai().nullable(),dateFormat:d.Yj().required(this.t("le_format_est_r_17097")),datetimeFormat:d.Yj().required(this.t("le_format_est_r_17097")),timeFormat:d.Yj().required(this.t("le_format_est_r_17097"))})}updateOrganizationGeneralSchema(){return d.Ik().shape({organization:this.organizationInfosInputSchema()})}};sI=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[hu,iI,qn])],sI);let oI=class extends Wl{countriesService;organizationInputService;translationService;constructor(e,t,n){super(n),this.countriesService=e,this.organizationInputService=t,this.translationService=n}eventInputDefault(e){const t=this.countriesService.getDefaultCountryValues();return{name:e?.name??"",description:e?.description??"",startAt:e?.startAt??Gs.c9.invalid("Invalid"),endAt:e?.endAt??Gs.c9.invalid("Invalid"),languages:e?.languages??[t.user.language],timeZone:e?.timeZone??Gs.c9.local().zoneName??"utc",country:e?.country??t.user.country,layer:e?.layer??nt.Google,latitude:e?.latitude??43.6087733,longitude:e?.longitude??3.87963579999996,emailSenderId:e?.emailSenderId,dayStartTime:e?.dayStartTime??"00:00",tagsIds:e?.tagsIds??[],fields:e?.fields??{},isWeezeventSynchronized:e?.isWeezeventSynchronized??!0,useAccreditations:e?.useAccreditations??!0,useCampaigns:e?.useCampaigns??!0,useDelegations:e?.useDelegations??!0,useDocuments:e?.useDocuments??!0,useForms:e?.useForms??!0,usePositions:e?.usePositions??!0,useWorkflows:e?.useWorkflows??!0}}eventInputSchema(){return d.Ik().shape({name:d.Yj().required(this.t("nom_de_l_v_nem_58512")),description:d.Yj(),startAt:Qm.required(this.t("la_date_d_but_d_30022")).typeError(this.t("la_date_d_but_d_30022")),endAt:Qm.required(this.t("la_date_de_fin_45068")).typeError(this.t("la_date_de_fin_45068")).test("after-start-at",this.t("la_date_de_fin_00429"),function(){return Gs.c9.isDateTime(this.parent.startAt)&&this.parent.startAt.isValid&&Gs.c9.isDateTime(this.parent.endAt)&&this.parent.endAt.isValid&&this.parent.endAt>=this.parent.startAt}),languages:d.YO().of(d.Yj().oneOf(Id,this.t("les_langues_doi_27712"))).required(this.t("les_langues_son_53717")).min(1,this.t("vous_devez_s_le_16610")),timeZone:d.Yj().required(this.t("le_fuseau_horai_37109")).oneOf(eI,this.t("le_fuseau_horai_37109")),latitude:d.ai().nullable().typeError(this.t("la_latitude_doi_17800")).min(-90,this.t("la_latitude_doi_17800")).max(90,this.t("la_latitude_doi_17800")),longitude:d.ai().nullable().typeError(this.t("la_longitude_do_28762")).min(-180,this.t("la_longitude_do_28762")).max(180,this.t("la_longitude_do_28762")),emailSenderId:d.ai().nullable(),dayStartTime:d.Yj().required(this.t("l_heure_laque_87748")),isWeezeventSynchronized:d.zM().required(),usePositions:d.zM().required(),useAccreditations:d.zM().required(),useDelegations:d.zM().required(),useForms:d.zM().required(),useDocuments:d.zM().required(),useWorkflows:d.zM().required()})}eventOrganizationInputSchema(e){return d.Ik().shape({event:this.eventInputSchema(),organization:this.organizationInputService.organizationInputSchema(e)})}createUpdateEventSchema(){return d.Ik().shape({event:this.eventInputSchema()})}};oI=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[hu,sI,qn])],oI);const rI=e=>{if(0===e.names.length)return e.render(e.fields);{const[t,...n]=e.names;return(0,i.jsx)(Ga.D0,{name:t,render:s=>(0,i.jsx)(rI,{fields:{...e.fields||{},[t]:s},names:n,render:e.render,subscription:e.subscription}),subscription:e.subscription})}},aI=({value:e,onChange:t,css:n,label:s,state:o,description:r,hint:a,...l})=>{const d=Xn(),u=(0,L.useCallback)(e=>{e&&p(e.getBoundingClientRect().width)},[]),h=(0,L.useCallback)(e=>e?.focus({preventScroll:!0}),[]),[g,p]=(0,L.useState)(200),[f,_]=(0,L.useState)(!1),[x,I]=(0,L.useState)(""),v=Zn(hu),b=(0,L.useMemo)(()=>(0,uc.A)(v.countries.flatMap(e=>io(e.phoneCode).map(t=>({...e,phoneCode:t}))),({name:e})=>c(e)),[]),j=(0,L.useMemo)(()=>b.find(({code:t,phoneCode:n})=>t===e.country&&n===e.code),[e.country,e.code]),C=(0,L.useMemo)(()=>b.filter(e=>!m(x)||e.name.toLowerCase().includes(x.trim().toLowerCase())||e.phoneCode.includes(x.trim())),[b,x]),y=(0,L.useMemo)(()=>C.map((n,s)=>(0,i.jsx)(qd,{onClick:()=>{t({...e,country:n.code,code:n.phoneCode}),I(""),_(!1)},children:(0,i.jsxs)(Ba,{gap:"2",width:1,children:[(0,i.jsx)(Ar,{children:n.emoji}),(0,i.jsx)(Ar,{css:{ellipsis:!0},children:n.name}),(0,i.jsx)(Ar,{color:"gray500",children:n.phoneCode})]})},s)),[C,e,t]),{inputId:k,descId:A,errorId:w}=qa();return(0,i.jsxs)(Ba,{ref:u,css:n,direction:"column",width:1,children:[(0,i.jsx)(Ml,{htmlFor:k,children:s}),(0,i.jsx)(Pl,{id:A,children:r}),(s||r)&&(0,i.jsx)(Ya,{height:"1"}),(0,i.jsxs)(Ba,{children:[(0,i.jsxs)(Wd,{disabled:"disabled"===o,isOpen:f,onStateChange:e=>_(e),children:[(0,i.jsx)(Xd,{children:(0,i.jsx)(Ll,{css:{borderRight:"none",borderBottomRightRadius:"0",borderTopRightRadius:"0",userSelect:"none",width:"100px","& .styled-input-container-circle-exclamation":{display:"none"},cursor:"disabled"===o?"not-allowed !important":void 0},cursor:"pointer",rightIcon:f?"chevron-up":"chevron-down",state:o,children:j&&(0,i.jsxs)(Ar,{width:1,children:[j.emoji," ",j.phoneCode]})})}),(0,i.jsx)(Zd,{placement:"bottom-start",renderOnPortal:!0,width:g,children:(0,i.jsxs)(Ba,{direction:"column",height:Math.min(201,40*C.length+41),width:1,children:[(0,i.jsx)(Ar,{css:{padding:"$2 $4","& input":{background:"transparent",border:"none",color:"$gray800",height:"100%",outline:"none",width:"100%"},"& input::placeholder":{color:"$gray500",opacity:1},"& input::-ms-input-placeholder ":{color:"$gray500",opacity:1}},height:40,children:(0,i.jsx)("input",{ref:h,"aria-label":d("indicatif_t_l_p_02025"),placeholder:d("rechercher_un_p_04678"),type:"text",value:x,onChange:e=>{I(e.target.value)}})}),(0,i.jsx)(Xu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Ba,{css:{height:"calc(100% - 41px)",overflowY:"auto"},direction:"column",children:y})]})})]}),(0,i.jsx)(Ll,{css:{borderBottomLeftRadius:"0",borderTopLeftRadius:"0",flex:"1"},cursor:"text",state:o,children:(0,i.jsx)(Ar,{css:{flex:"1",height:"100%","& input":{background:"transparent",border:"none",color:"$gray800",height:"100%",outline:"none",width:"100%"},"& input::placeholder":{color:"$gray500",opacity:1},"& input::-ms-input-placeholder ":{color:"$gray500",opacity:1}},children:(0,i.jsx)("input",{"aria-describedby":r?A:void 0,"aria-errormessage":"error"===o?w:void 0,"aria-invalid":"error"===o,autoComplete:"tel-national",disabled:"disabled"===o,id:k,type:"tel",value:e.number,onChange:n=>{t({...e,number:n.target.value})},...l})})})]}),(0,i.jsx)(Fl,{id:w,state:o,children:a})]})},lI=(0,L.memo)(function({prefix:e,hint:t,state:n,...s}){const{isDisabled:o}=Wm(),r=`${e}country`,a=`${e}code`,l=`${e}number`;return(0,i.jsx)(rI,{names:[r,a,l],render:e=>{const d=$l(e[a].meta)||$l(e[l].meta);return(0,i.jsx)(aI,{hint:d?e[a].meta.error||e[l].meta.error:t,state:d?"error":o?"disabled":n,value:{country:e[r].input.value,code:e[a].input.value,number:e[l].input.value},onChange:t=>{e[r].input.onChange(t.country),e[a].input.onChange(t.code),e[l].input.onChange(t.number)},...s})}})}),dI=(0,L.memo)(function(){const e=Xn();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Vl,{label:e("nom_de_l_organi_49583"),name:"organization.name"}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsxs)(Ba,{gap:"4",children:[(0,i.jsx)(Vl,{label:e("pr_nom_66988"),name:"organization.adminFirstName"}),(0,i.jsx)(Vl,{label:e("last_name"),name:"organization.adminLastName"})]}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(lI,{label:e("Phone"),prefix:"organization.adminPhone."})]})}),cI=()=>{const e=Xn(),{user:t}=ai();return(0,i.jsx)(Gm,{name:"organization.termsAccepted",children:(0,i.jsx)("span",{dangerouslySetInnerHTML:{__html:e("en_cr_ant_votre_88363",kd(jd(t?.language,new URL(location.href).searchParams)),Cd)}})})},uI=e=>{const t=Xn(),n=Gs.c9.utc(),{event:s}=e.values;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Nr.Yr,{name:"event.startAt",children:t=>{t.isValid&&!1===e.form.getFieldState("event.endAt").touched&&e.form.change("event.endAt",t)}}),(0,i.jsx)(Vl,{label:t("nom_de_l_v_nem_08711"),name:"event.name"}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsxs)(Ba,{gap:"6",children:[(0,i.jsx)(Hm,{label:t("date_de_d_but_43380"),min:n,name:"event.startAt"}),(0,i.jsx)(Hm,{label:t("date_de_fin_86920"),min:s.startAt&&s.startAt.isValid?s.startAt:n,name:"event.endAt"})]})]})},hI=()=>{const{translate:e,params:{weezeventOrganizationId:t}}=vl(),n=Zn(oI),s=Zn(sI),o=Zn(Ua),{mutate:r}=function(e={}){return ei("mutation EventOrganizationCreate($eventOrganization: EventOrganizationInput!) {\n eventOrganizationCreate(eventOrganization: $eventOrganization) {\n id\n organizationId\n }\n}\n",e)}({redirectOnSuccess:!0}),a=ni(),l=(0,L.useRef)(null),d=!!ai().user?.termsAcceptedAt;return(0,i.jsx)(kl,{customErrorRef:l,height:1,initialValues:{event:n.eventInputDefault(),organization:s.organizationInputDefault(t)},render:({form:t,values:n,handleSubmit:s})=>(0,i.jsxs)(Qx,{ref:l,onClose:X,children:[(0,i.jsx)(jl,{}),(0,i.jsx)(Vm,{centerTitleAndSubtitle:!0,hideToggle:!0,initialIsOpen:!0,subtitle:e("param_trer_votr_94121"),heading:e("dites_en_nous_u_13238"),children:(0,i.jsx)(uI,{form:t,values:n})}),(0,i.jsx)(Vm,{hideToggle:!0,initialIsOpen:!0,subtitle:e("ajouter_le_nom_69919"),heading:e("_propos_de_vot_88855"),children:(0,i.jsx)(dI,{})}),(0,i.jsxs)(Bm,{children:[!d&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(cI,{}),(0,i.jsx)(Ya,{height:"4"})]}),(0,i.jsx)(zl,{textAlign:"center",onClick:s,children:e("cr_er_l_v_neme_16731")})]})]}),validate:o.validateForForm(n.eventOrganizationInputSchema(d)),width:1,onSubmit:async e=>{const{eventOrganizationCreate:{id:t,organizationId:n}}=await r({eventOrganization:e});a.push(Hi.EVENT({organizationId:n,eventId:t}))}})},mI=()=>{const{data:e,loader:t}=Qn("query HomeOrganizations {\n user {\n roles {\n organizationId\n }\n }\n}\n",{},[]),n=ni();return(0,i.jsx)(Od,{loader:t,onLoad:()=>{const t=e.user?.roles?.[0]?.organizationId;t?n.replace(Hi.EVENTS({organizationId:t})):n.replace(Ps.CREATE_EVENT_WITH_ORGANIZATION())}})},gI=()=>{const{translate:e,history:t}=vl(),n=Zn(sI),s=Zn(Ua),{mutate:o}=function(e={}){return ei("mutation OrganizationCreate($organization: OrganizationInput!) {\n organizationCreate(organization: $organization) {\n id\n }\n}\n",e)}({redirectOnSuccess:!0}),r=(0,L.useRef)(null),{user:a}=ai(),l=!!a?.termsAcceptedAt;return(0,i.jsx)(kl,{customErrorRef:r,height:1,hideDefaultErrors:!0,initialValues:{organization:n.organizationInputDefault()},render:({handleSubmit:n})=>(0,i.jsxs)(Qx,{ref:r,onClose:()=>t.goBack(Ps.BACKOFFICE),children:[(0,i.jsx)(jl,{}),(0,i.jsx)(Vm,{centerTitleAndSubtitle:!0,hideToggle:!0,initialIsOpen:!0,subtitle:e("ajouter_le_nom_69919"),heading:e("_propos_de_vot_88855"),children:(0,i.jsx)(dI,{})}),(0,i.jsxs)(Bm,{children:[!l&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(cI,{}),(0,i.jsx)(Ya,{height:"4"})]}),(0,i.jsx)(zl,{textAlign:"center",onClick:n,children:e("cr_er_l_organis_55358")})]})]}),validate:s.validateForForm(n.createOrganizationSchema(l)),width:1,onSubmit:async e=>{const{organizationCreate:{id:n}}=await o({organization:e.organization});t.push(yi.ORGANIZATION({organizationId:n}))}})},pI=({children:e,termsAccepted:t})=>{const{organizationId:n}=ti(),s=ni();return t||window.location.pathname.includes(Ps.ACCEPT_TERMS_AND_CONDITIONS(n))?(0,i.jsx)(i.Fragment,{children:e}):(0,i.jsx)(oi,{path:Ps.ACCEPT_TERMS_AND_CONDITIONS(n),state:s.location})};var fI=n(5830);class _I extends fI.Ay{events;forms;organizations;segmentsFolders;constructor(){super("recrewteer"),this.version(6).stores({events:"id",forms:"id",organizations:"id",segmentsFolders:"id"})}}const xI=new _I,II=L.createContext({}),vI=e=>{const{history:t,params:{organizationId:n}}=vl(),{data:s,loader:o,reload:r}=Qn('query CommonOrganization($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n features\n }\n\n user {\n email\n language\n\n userInfo(organizationId: $organizationId) {\n name\n firstName: fieldValue(slug: "firstName")\n picture {\n url\n }\n }\n }\n}\n',{organizationId:n},[]),a=L.useCallback(e=>!!s.organization&&function(e,t){return e.features.includes(t)}(s.organization,e),[s.organization]);return o||(o||s.organization?(0,i.jsx)(II.Provider,{value:{user:s.user,hasFeature:a,reload:r},children:e.children}):(setTimeout(()=>{t.replace(Ps.HOME)},100),null))},bI=[bt.OrganizationAdmin],jI=[bt.OrganizationAdmin,bt.EventAdmin],CI=[bt.OrganizationAdmin,bt.OrganizationReader],yI=[bt.OrganizationAdmin,bt.OrganizationReader,bt.EventAdmin,bt.EventReader];function kI(e,t,n){if("positionCategoryId"in n){const i=e.usersPositionsCategories.some(e=>"ANY"===n.positionCategoryId?t===e.roleId:t===e.roleId&&e.positionCategoryId===n.positionCategoryId);if("positionId"in n){const s=e.usersPositions.some(e=>t===e.roleId&&e.positionId===n.positionId);return i||s}return i}return"delegationCategoryId"in n?e.usersDelegationsCategories.some(e=>"ANY"===n.delegationCategoryId?t===e.roleId:t===e.roleId&&e.delegationCategoryId===n.delegationCategoryId):"eventId"in n&&e.usersEvents.some(e=>"ANY"===n.eventId?t===e.roleId:t===e.roleId&&e.eventId===n.eventId)}function AI(e,t,n){const i=n?e.roles.filter(t=>"positionCategoryId"in n||"positionId"in n?t.accessLevel===vt.Position?kI(e,t.id,n):t.accessLevel===vt.Organization||t.accessLevel===vt.Event:"delegationCategoryId"in n?t.accessLevel===vt.DelegationCategory?kI(e,t.id,n):t.accessLevel===vt.Organization||t.accessLevel===vt.Event:"eventId"in n&&(t.accessLevel===vt.Event?kI(e,t.id,n):t.accessLevel===vt.Organization)):e.roles;return t.map(e=>i.some(t=>"1"===t.permissions[e]))}function wI(e,t){return e.roles.filter(e=>e.accessLevel===vt.Organization).some(e=>"1"===e.permissions[t])}const SI=L.createContext({}),EI=e=>{const{history:t,params:{organizationId:n},translate:s}=vl(),{data:o,loader:r,reload:a}=Qn('query Organization($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n id\n name\n periodEndAt\n features\n customBadges\n isBlocked\n key\n weezeventOrganizationId\n\n invoices(state: Overdue) {\n invoiceNumber\n url\n insertedAt\n }\n\n events(whereUserIsLeader: true, sort: { attribute: StartAt, direction: Desc }) {\n nodes {\n id\n name\n state\n weezeventEventId\n }\n }\n\n roles {\n id\n accessLevel\n name\n type\n }\n }\n\n user {\n email\n language\n termsAcceptedAt\n\n roles(organizationId: $organizationId) {\n id\n accessLevel\n type\n permissions\n }\n\n userInfo(organizationId: $organizationId) {\n name\n firstName: fieldValue(slug: "firstName")\n picture {\n url\n }\n }\n }\n}\n',{organizationId:n},[]),{hasFeature:l,reload:d}=L.useContext(II),[c,h]=L.useState(),[m,g]=L.useState(null),p=L.useCallback(async e=>{const t=(0,Xa.A)(m,{id:n},e);await xI.organizations.put(t),g(t)},[n,m,g]),f=L.useMemo(()=>so(o.user?.roles??[]),[o.user]),_=L.useMemo(()=>(o.user?.roles??[]).some(e=>e.type===bt.OrganizationAdmin),[o.user]),x=L.useMemo(()=>(o.user?.roles??[]).some(e=>e.type===bt.OrganizationAdmin||e.type===bt.OrganizationReader),[o.user]),I=L.useMemo(()=>o.organization?{organizationRoles:(0,uc.A)(o.organization.roles.filter(e=>e.accessLevel===vt.Organization),e=>u(e.name)),eventRoles:(0,uc.A)(o.organization.roles.filter(e=>e.accessLevel===vt.Event),e=>u(e.name)),delegationCategoryRoles:(0,uc.A)(o.organization.roles.filter(e=>e.accessLevel===vt.DelegationCategory),e=>u(e.name)),positionRoles:(0,uc.A)(o.organization.roles.filter(e=>e.accessLevel===vt.Position),e=>u(e.name))}:{organizationRoles:[],eventRoles:[],delegationCategoryRoles:[],positionRoles:[]},[o.organization]);return L.useEffect(()=>{o.organization&&(async()=>{let e=await xI.organizations.get(n);e||(e={id:n},await xI.organizations.put(e)),g(e)})()},[n,o.organization]),r||(r||o.organization?f?(0,i.jsx)(SI.Provider,{value:{isOrganizationAdmin:_,isOrganizationReader:x,localOrganization:m,organization:o.organization,roles:I,selectedEventId:c,user:o.user,hasPermission:e=>wI(o.user,e),hasPermissions:e=>function(e,t){return t.map(t=>wI(e,t))}(o.user,e),hasFeature:l,reload:()=>{d(),a()},setSelectedEventId:h,updateLocalOrganization:p},children:(0,i.jsx)(pI,{termsAccepted:null!==o.user.termsAcceptedAt,children:e.children})}):(0,i.jsx)(au,{size:"sm",onClose:td.A,children:(0,i.jsxs)(Ba,{align:"center",direction:"column",gap:"3",children:[(0,i.jsx)(Ar,{children:s("vous_n_avez_pas_23261")}),(0,i.jsx)(zl,{color:"invisible",onClick:X,children:s("se_d_connecter_74151")})]})}):(setTimeout(()=>{t.replace(Ps.HOME)},100),null))};function TI(){return L.useContext(SI)}const zI=e=>{const t=Xn();return(0,i.jsxs)(Ba,{align:"center",direction:"column",children:[(0,i.jsx)(Ba,{align:"center",css:{background:"$primary500",borderRadius:"48px",fontSize:"$textXl",color:"white",height:"48px",width:"48px"},justify:"center",children:(0,i.jsx)(nl,{icon:e.icon})}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(Ar,{color:"gray900",fontSize:"textMd",children:e.title||t("la_fonctionnali_59786")}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ar,{color:"gray500",children:e.subtitle||t("si_vous_voulez_24448")}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(zl,{to:`mailto:${P.EMAIL_FROM}`,children:t("contacter_l_qu_16617")})]})},OI={PLURAL:"campaigns",SINGLE:"campaign"},RI={CAMPAIGNS:OI.PLURAL,CAMPAIGN:e=>ci([OI.SINGLE,e])},$I={CAMPAIGNS:({organizationId:e,eventId:t})=>ci([t?Hi.EVENT({organizationId:e,eventId:t}):wi.COMMUNITY({organizationId:e}),RI.CAMPAIGNS]),CAMPAIGNS_SEGMENT:({organizationId:e,segmentId:t})=>ci([$I.CAMPAIGNS({organizationId:e}),t]),CAMPAIGN:({organizationId:e,eventId:t,campaignId:n})=>ci([t?Hi.EVENT({organizationId:e,eventId:t}):wi.COMMUNITY({organizationId:e}),RI.CAMPAIGN(n)]),CAMPAIGN_DASHBOARD:e=>ci([$I.CAMPAIGN(e),gi.DASHBOARD]),CAMPAIGN_PREVIEW:({userInfoId:e,...t})=>ci([$I.CAMPAIGN(t),gi.PREVIEW,e]),CREATE(e){const t=fi($I.CAMPAIGNS(e));return e.options?`${t}/${e.options}`:t},CREATE_TEMPLATE:e=>ci([fi($I.CAMPAIGNS(e)),"template"]),UPDATE:e=>_i($I.CAMPAIGN(e))},DI={PLURAL:"members",SINGLE:"member"},PI={PLURAL:"profiles",SINGLE:"profile"},FI="accreditations",MI="actions",NI="availabilities",LI="campaigns",BI="comments",VI="documents",UI="events",WI="history",GI="informations",HI="messages",qI="positions",KI="forms",YI="form",ZI="scans",XI=e=>ci([DI.SINGLE,e]),JI=e=>ci([PI.SINGLE,e]),QI={USER_PROFILE:({userInfoId:e,...t})=>ci([yi.ORGANIZATION(t),JI(e)]),USER_PROFILES:e=>ci([yi.ORGANIZATION(e),PI.PLURAL]),MEMBERS:e=>ci(["delegationId"in e?hs.DELEGATION(e):"eventId"in e&&e.eventId?Hi.EVENT(e):wi.COMMUNITY(e),DI.PLURAL]),MEMBER:({userInfoId:e,...t})=>ci(["eventId"in t&&t.eventId?Hi.EVENT(t):wi.COMMUNITY(t),XI(e)]),MEMBER_INFORMATION:e=>ci([QI.MEMBER(e),GI]),MEMBER_ACTIONS:e=>ci([QI.MEMBER(e),MI]),MEMBER_AVAILABILITIES:e=>ci([QI.MEMBER(e),NI]),MEMBER_COMMENTS:e=>ci([QI.MEMBER(e),BI]),MEMBER_HISTORY:e=>ci([QI.MEMBER(e),WI]),MEMBER_HISTORY_CAMPAIGNS:e=>ci([QI.MEMBER(e),WI,LI]),MEMBER_HISTORY_EVENTS:e=>ci([QI.MEMBER(e),WI,UI]),MEMBER_HISTORY_FORMS:e=>ci([QI.MEMBER(e),WI,KI]),MEMBER_HISTORY_SCANS:e=>ci([QI.MEMBER(e),WI,ZI]),MEMBER_POSITIONS:e=>ci([QI.MEMBER(e),qI]),MEMBER_ACCREDITATIONS:e=>ci([QI.MEMBER(e),FI]),MEMBER_FORMS:e=>ci([QI.MEMBER(e),KI]),MEMBER_FORM:e=>ci([QI.MEMBER(e),YI,e.formId]),MEMBER_FORM_EDIT:e=>_i(QI.MEMBER_FORM(e)),MEMBER_MESSAGES:e=>ci([QI.MEMBER(e),HI]),MEMBER_DOCUMENTS:e=>ci([QI.MEMBER(e),VI]),CREATE:e=>fi(QI.MEMBERS(e))},ev={PLURAL:"workflows",SINGLE:"workflow"},tv=e=>ci([ev.SINGLE,e]),nv={WORKFLOWS:({eventId:e,...t})=>ci([e?Hi.EVENT({...t,eventId:e}):wi.COMMUNITY(t),ev.PLURAL]),WORKFLOW:({workflowId:e,eventId:t,...n})=>ci([t?Hi.EVENT({...n,eventId:t}):wi.COMMUNITY(n),tv(e)]),CREATE:e=>fi(nv.WORKFLOWS(e)),UPDATE:e=>_i(nv.WORKFLOW(e))};var iv;!function(e){e.Assignments="Assignments",e.Badge="Badge",e.Certificate="Certificate",e.UserHours="UserHours",e.UserPlanning="UserPlanning",e.UserPlanningDays="UserPlanningDays",e.UserPlanningList="UserPlanningList"}(iv||(iv={}));const sv=[iv.Assignments,iv.Badge,iv.Certificate,iv.UserHours,iv.UserPlanning,iv.UserPlanningDays,iv.UserPlanningList];function ov(e){let t=e;try{t=new URL(e).pathname}catch{}if(m(t)){const e=t.split(/[\\/]/).pop(),n=e.lastIndexOf(".");let i=e,s="";return n>=0&&(i=e.substring(0,n),s=e.substring(n+1).toLowerCase()),{path:t,name:i,extension:s}}return{path:"",name:"",extension:""}}const rv=["jpg","png","jpeg","gif"];var av;!function(e){e.Csv="text/csv",e.Default="application/octet-stream",e.Excel="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",e.Gif="image/gif",e.Jpeg="image/jpeg",e.Pdf="application/pdf",e.Png="image/png",e.Zip="application/zip"}(av||(av={}));const lv=e=>{switch(e.toLowerCase()){case"csv":return av.Csv;case"xls":case"xlsx":return av.Excel;case"gif":return av.Gif;case"jpg":case"jpeg":return av.Jpeg;case"pdf":return av.Pdf;case"png":return av.Png;case"zip":return av.Zip;default:return av.Default}};const dv=5e9;let cv=class extends Gl{constructor(e){super(e)}schema(){const e=this.t("le_document_est_86403");return d.Ik().shape({acl:d.Yj().required(e),key:d.Yj().required(e).test("is-a-zip",this.t("le_fichier_n_es_91526"),e=>lv(ov(e).extension)===av.Zip),name:d.Yj().required(e),file:d.gl().test("is-not-too-big",this.t("le_fichier_est_17522"),e=>!e||e.size=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[qn])],cv);var uv=n(5526);const hv=[" ","@","£","$","¥","è","é","ù","ì","ò","Ç","Ø","ø","Å","å","Æ","æ","ß","É","!",'"',"#","¤","%","&","'","(",")","*","+",",","-",".","/","0","1","2","3","4","5","6","7","8","9",":",";","<","=",">","?","¡","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","Ä","Ö","Ñ","Ü","§","¿","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","ä","ö","ñ","ü","à"],mv=["^","{","}","\\","|","[","]","~","€","\n"],gv=hv.concat(mv);function pv(e,t){const n=t?145:160,i=Array.from(e??"").reduce((e,t)=>hv.includes(t)?e+1:mv.includes(t)?e+2:e,0);return i<=n?{numberOfCharacters:i,numberOfSms:1}:{numberOfCharacters:i,numberOfSms:Math.ceil(i/153)}}const fv=/^[a-z][a-z0-9]{2,10}$/i,_v=2e7;var xv;!function(e){e.Accreditations="accreditations",e.Everyone="everyone",e.Positions="positions",e.Segments="segments",e.States="states",e.Users="users"}(xv||(xv={}));let Iv=class extends Gl{constructor(e){super(e)}createUpdateCampaignValuesDefault(e,t,n,i){const s=this.campaignInputDefault(e,t,n,i);return{campaign:s,recipients:s.sendToEveryone?xv.Everyone:so(s.states)?xv.States:so(s.segmentsIds)?xv.Segments:so(s.accreditationsCategoriesIds)||so(s.accreditationsIds)||so(s.accreditationsSlotsIds)?xv.Accreditations:so(s.positionsCategoriesIds)||so(s.positionsIds)||so(s.positionsSlotsIds)?xv.Positions:xv.Users,customSender:m(n?.sender),textOrHtml:m(n?.html)?"html":"text",delivery:s.state===he.Scheduled&&n?.scheduledAt?.isValid?"later":"now"}}campaignStep1Fields(){return{name:d.Yj().required(this.t("le_nom_de_la_ca_63405")),campaignType:d.Yj().required(this.t("le_type_de_camp_96559")).oneOf(tn,this.t("le_type_de_camp_56467"))}}campaignStep1Schema(){return d.Ik().shape({campaign:d.Ik().shape({...this.campaignStep1Fields()})})}campaignStep2Fields(){const e=this;return{sender:d.Yj().test("is-valid",this.t("l_metteur_ne_r_16421"),function(){return!m(this.parent.sender)||fv.test(this.parent.sender)}),text:d.Yj().test("non-empty-text",this.t("le_contenu_est_45048"),function(){return m(this.parent.text)||m(this.parent.html)}).test("only-valid-characters","",function(){if(this.parent.campaignType===me.Email)return!0;{const n=(t=this.parent.text,new Set(Array.from(t??"").filter(e=>!gv.includes(e))));return!(n.size>0)||this.createError({message:e.translationService.translate("les_caract_res_84839",Array.from(n).join(", "))})}var t}).test("max-length",this.t("le_contenu_ne_p_25416"),function(){return this.parent.campaignType===me.Email||this.parent.text.length<1e3}).test("no-percent-encoded-variables",this.t("le_texte_de_l_e_71717"),function(){return!this.parent.text.includes("%7B")&&!this.parent.text.includes("%7D")}),subject:d.Yj().when("campaignType",{is:me.Email,then:e=>e.required(this.t("le_sujet_est_re_18923"))}),html:d.Yj().test("non-empty-text",this.t(this.t("le_code_html_es_52280")),function(){return m(this.parent.text)||m(this.parent.html)}),replyTo:d.Yj().email(this.t("l_adresse_de_r_53879")).test("clean-reply-to",this.t("l_adresse_de_r_53879"),function(){return tI(this.parent.replyTo)}),documents:d.YO().test("max-size",this.t("l_ensemble_des_32797"),function(){return this.parent.campaignType!==me.Email||!so(this.parent.documents)||(0,uv.A)(this.parent.documents,e=>e.size)<_v}),emailSenderId:d.ai().nullable(),attachments:d.YO().of(d.Yj()),hasCalendarInvite:d.zM().required(),calendarInviteName:d.Yj().when("hasCalendarInvite",{is:!0,then:e=>e.required(this.t("nom_de_l_v_nem_58512")),otherwise:e=>e.nullable()}),calendarInviteStartDate:Qm.when("hasCalendarInvite",{is:!0,then:e=>e.required(this.t("la_date_de_d_bu_05030")).typeError(this.t("la_date_de_d_bu_05030")),otherwise:e=>e.nullable()}),calendarInviteStartTime:d.Yj().when("hasCalendarInvite",{is:!0,then:e=>e.required(this.t("heure_de_d_but_90785")),otherwise:e=>e.nullable()}),calendarInviteEndDate:Qm.when("hasCalendarInvite",{is:!0,then:e=>e.required(this.t("la_date_de_fin_32246")).typeError(this.t("la_date_de_fin_32246")),otherwise:e=>e.nullable()}),calendarInviteEndTime:d.Yj().when("hasCalendarInvite",{is:!0,then:e=>e.required(this.t("l_heure_de_fin_78626")),otherwise:e=>e.nullable()})}}campaignStep2Schema(){return d.Ik().shape({campaign:d.Ik().shape({...this.campaignStep2Fields()})})}campaignStep3Fields(){const e=this,t=function(){return this.parent.state!==he.Draft&&this.parent.state!==he.Scheduled||!1!==this.parent.sendToEveryone||0!==this.parent.states.length||0!==this.parent.positionsCategoriesIds.length||0!==this.parent.positionsIds.length||0!==this.parent.positionsSlotsIds.length||0!==this.parent.tagsIds.length||0!==this.parent.accreditationsCategoriesIds.length||0!==this.parent.accreditationsIds.length||0!==this.parent.accreditationsSlotsIds.length||0!==this.parent.usersInfosIds.length||0!==this.parent.segmentsIds.length||this.createError({message:e.translationService.translate("vous_devez_s_le_80552")})};return{sendToEveryone:d.zM().required(this.t("requis_75853")),states:d.YO().of(d.Yj()).test("non-empty","",t),positionsCategoriesIds:d.YO().of(d.ai()).test("non-empty","",t),positionsIds:d.YO().of(d.ai()).test("non-empty","",t),positionsSlotsIds:d.YO().of(d.ai()).test("non-empty","",t),tagsIds:d.YO().of(d.ai()).test("non-empty","",t),accreditationsCategoriesIds:d.YO().of(d.ai()).test("non-empty","",t),accreditationsIds:d.YO().of(d.ai()).test("non-empty","",t),accreditationsSlotsIds:d.YO().of(d.ai()).test("non-empty","",t),usersInfosIds:d.YO().of(d.ai()).test("non-empty","",t),segmentsIds:d.YO().of(d.ai()).test("non-empty","",t)}}campaignStep3Schema(){return d.Ik().shape({campaign:d.Ik().shape({...this.campaignStep3Fields()})})}campaignStep4Fields(){return{scheduledAtDate:Qm.when("state",{is:he.Scheduled,then:e=>e.required(this.t("la_date_d_envoi_17792")).typeError(this.t("la_date_d_envoi_17792"))}),scheduledAtTime:d.Yj().when("state",{is:he.Scheduled,then:e=>e.required(this.t("l_heure_d_envoi_53643")).matches(/\d{2}:\d{2}/,this.t("l_heure_d_envoi_53643"))})}}campaignStep4Schema(){return d.Ik().shape({campaign:d.Ik().shape({...this.campaignStep4Fields()})})}campaignInputSchema(){return d.Ik().shape({...this.campaignStep1Fields(),...this.campaignStep2Fields(),...this.campaignStep3Fields(),...this.campaignStep4Fields()})}createUpdateCampaignSchema(){return d.Ik().shape({campaign:this.campaignInputSchema()})}campaignInputDefault(e,t,n,i){let s=n?.segmentsIds??[],o=n?.usersInfosIds??[];if(m(i))try{const e=JSON.parse(r(i));e.segmentId&&(s=[e.segmentId]),so(e.usersInfosIds)&&(o=e.usersInfosIds)}catch{}const a=!so(s)&&!so(o)&&(n?.sendToEveryone??!1);return{name:n?.name??"",state:n?.state??(e?he.Template:he.Draft),campaignType:n?.campaignType??me.Email,sender:n?.sender??"",text:n?.text??"",subject:n?.subject??"",html:n?.html??"",replyTo:n?.replyTo??"",sendToEveryone:a,states:n?.states??[],positionsCategoriesIds:n?.positionsCategoriesIds??[],positionsIds:n?.positionsIds??[],positionsSlotsIds:n?.positionsSlotsIds??[],tagsIds:n?.tagsIds??[],accreditationsCategoriesIds:n?.accreditationsCategoriesIds??[],accreditationsIds:n?.accreditationsIds??[],accreditationsSlotsIds:n?.accreditationsSlotsIds??[],usersInfosIds:o,segmentsIds:s,scheduledAtDate:n?.scheduledAt??void 0,scheduledAtTime:n?.scheduledAt?.toFormat("HH:mm")??void 0,documents:n?.documents??[],emailSenderId:n?.emailSenderId??t,attachments:n?.attachments??[],hasCalendarInvite:n?.hasCalendarInvite??!1,calendarInviteName:n?.calendarInviteName??null,calendarInviteStartDate:n?.calendarInviteStartDate??null,calendarInviteStartTime:n?.calendarInviteStartTime??null,calendarInviteEndDate:n?.calendarInviteEndDate??null,calendarInviteEndTime:n?.calendarInviteEndTime??null}}};Iv=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[qn])],Iv);var vv=n(4809),bv=n.n(vv);const jv=2e7;let Cv=class extends Gl{constructor(e){super(e)}csvDocumentInputDefault(e){return{key:"",name:"",acl:"",formats:{timeFormat:"HH:mm",dateFormat:Hs,datetimeFormat:"yyyy-MM-dd HH:mm",...e}}}schema(){const e=this.t("le_document_est_86403");return d.Ik().shape({acl:d.Yj().required(e),delimiter:d.Yj().optional().test("is-valid-value",this.t("delimiter_value_52108"),e=>!e||!bv().BAD_DELIMITERS.includes(e)),key:d.Yj().required(e).test("is-a-csv",this.t("le_fichier_n_es_33134"),e=>lv(ov(e).extension)===av.Csv),name:d.Yj().required(e),newline:d.Yj().optional().test("is-valid-value",this.t("newline_charact_88066"),e=>!e||["\r","\n","\r\n"].includes(e)),quoteChar:d.Yj().optional(),formats:d.Ik().shape({timeFormat:d.Yj().optional(),dateFormat:d.Yj().optional(),datetimeFormat:d.Yj().optional()}),file:d.gl().test("is-not-empty",this.t("the_file_is_emp_77243"),e=>!e||e.size>0).test("is-not-too-big",this.t("le_fichier_est_17522"),e=>!e||e.size{switch(e){case yv.Archives:return["zip"];case yv.Csv:return["csv"];case yv.Gpx:return["gpx"];case yv.Images:return["jpg","png","jpeg","gif"];case yv.Kml:return["kml"];case yv.Pdf:return["pdf"];case yv.SmallImages:return["jpg","png","jpeg"];default:return ll()}})}function Av(e){return Math.min(...io(e).flatMap(e=>{switch(e){case yv.Archives:return dv;case yv.Csv:return jv;case yv.Images:case yv.Pdf:return _v;case yv.Kml:case yv.Gpx:return 1/0;case yv.SmallImages:return 2e6;default:return ll()}}))}function wv(e){return io(e).flatMap(e=>e===yv.Images?"image/*":kv(e).map(e=>`.${e}`)).join(",")}async function Sv(e,t,n,i){const s=await Y(),{awsS3PostCredentials:{endpointUrl:o,policy:r,amzCredential:a,amzSignature:l,amzDate:d}}=await function(e,t){return go("query AwsS3PostCredentials($organizationId: OrganizationId!, $acl: String!) {\n awsS3PostCredentials(organizationId: $organizationId, acl: $acl) {\n endpointUrl\n policy\n amzSignature\n amzCredential\n amzDate\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({organizationId:e,acl:n},s),{name:c,extension:u}=ov(t.name),m=`organization/${e}/${V()}/${h(c)}.${u}`,g=new FormData;return g.append("key",m),g.append("acl",n),g.append("success_action_status","201"),g.append("X-Amz-Credential",a),g.append("X-Amz-Algorithm","AWS4-HMAC-SHA256"),g.append("X-Amz-Date",d),g.append("Policy",r),g.append("X-Amz-Signature",l),g.append("Content-Type",lv(u)),g.append("file",t),new Promise((e,s)=>{const r=new XMLHttpRequest;r.upload.onprogress=e=>{if(e.lengthComputable){const t=Math.round(e.loaded/e.total*100);i?.(t)}},r.onerror=()=>{s(new Error("Could not upload file to S3"))},r.onreadystatechange=()=>{if(4===r.readyState){const i=r.responseXML?.querySelector("Error Code");null!==i?(di("Could not upload file to S3",{code:i?.textContent??"",message:r.responseXML?.querySelector("Error Message")?.textContent??""}),s(new Error("Could not upload file to S3"))):e({acl:n,key:m,name:t.name,size:t.size})}},r.open("POST",o,!0),r.send(g)})}Cv=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[qn])],Cv),function(e){e[e.Archives=0]="Archives",e[e.Csv=1]="Csv",e[e.Gpx=2]="Gpx",e[e.Images=3]="Images",e[e.Kml=4]="Kml",e[e.Pdf=5]="Pdf",e[e.SmallImages=6]="SmallImages"}(yv||(yv={}));const Ev=e=>{switch(e.split(".").at(-1)){case"csv":return _d.FileCSV;case"jpeg":case"jpg":return _d.FileJPG;case"pdf":return _d.FilePDF;case"png":return _d.FilePNG;case"zip":return _d.FileZIP;default:return _d.FileBlank}};function Tv(e,t){return`https://${t}.s3-eu-west-1.amazonaws.com/${e.key}`}function zv(e){return new Promise((t,n)=>{!function(e,n,i){const s=document.createElement("script");s.onload=()=>{t(!0)},s.onerror=()=>{i&&i()},s.src=e,document.body.appendChild(s)}(e,0,()=>{n(new Error(`Could not load ${e}`))})})}function Ov(e,t,n){return 25===e?{transform:`translateX(${t}px) rotate(0.25turn)`,transformOrigin:"top left"}:50===e?{transform:"rotate(0.5turn)"}:75===e?{transform:`translateY(${n}px) rotate(0.75turn)`,transformOrigin:"top left"}:{}}const Rv=_r("div",{alignItems:"center",background:"#434c5e",borderRadius:"$1",color:"white",cursor:"pointer",display:"flex",variants:{controls:{true:{height:"calc(100% - 10px)",paddingLeft:"10px",paddingRight:"10px",width:"200px"}},rotate:{true:{height:"40px",justifyContent:"center",marginLeft:"10px",width:"40px"}}}}),$v=_r("input",{"-webkit-appearance":"none",background:"transparent",marginLeft:"10px",marginRight:"10px",width:"100%","&::-webkit-slider-thumb":{"-webkit-appearance":"none",background:"white",borderRadius:"16px",cursor:"pointer",height:"16px",marginTop:"-7px",width:"16px"},"&::-webkit-slider-runnable-track":{background:"white",borderRadius:"2px",cursor:"pointer",height:"2px",width:"100%"},"&:focus::-webkit-slider-runnable-track":{background:"white"},"&::-moz-range-thumb":{background:"white",borderRadius:"16px",cursor:"pointer",height:"16px",width:"16px"},"&::-moz-range-track":{background:"white",borderRadius:"2px",cursor:"pointer",height:"2px",width:"100%"},"&::-ms-thumb":{background:"white",borderRadius:"16px",cursor:"pointer",height:"16px",width:"16px"},"&:focus":{ouline:"none"}});var Dv;!function(e){e[e.EmptyFile=0]="EmptyFile",e[e.Pdf=1]="Pdf",e[e.Image=2]="Image"}(Dv||(Dv={}));class Pv extends L.Component{contentRef;renderPagesDebounced;constructor(e){super(e);let t=Dv.Image;"string"!=typeof this.props.fileUrl||0===this.props.fileUrl.trim().length?t=Dv.EmptyFile:"pdf"===ov(this.props.fileUrl).extension&&(t=Dv.Pdf),this.state={image:null,isLoading:!0,fileType:t,pdf:null,rotate:0,zoomLevel:100},this.renderPagesDebounced=(0,Vc.A)(()=>{this.renderPdfPages()},200),this.contentRef=L.createRef()}componentDidMount(){var e;this.state.fileType===Dv.Pdf?(e=this.props.fileUrl,(void 0===window.pdfjsLib?zv("https://cdn.jsdelivr.net/npm/pdfjs-dist@2.0.943/build/pdf.min.js"):Promise.resolve(!0)).then(()=>window.pdfjsLib.getDocument(e))).then(e=>{this.setState({pdf:e}),this.renderPdfPages()}):this.state.fileType===Dv.Image&&this.loaderImage()}renderPdfPages(){this.state.fileType===Dv.Pdf&&async function(e,t,n,i){Array.from(t.childNodes).forEach(e=>{t.removeChild(e)});for(let s=1;s<=e.numPages;s++){const o=await e.getPage(s),r=o.getViewport(n),a=document.createElement("div"),l=document.createElement("canvas"),d=l.getContext("2d"),c=Ov(i,r.height,r.width);25===i||75===i?(a.style.height=`${r.width}px`,a.style.width=`${r.height}px`):(a.style.height=`${r.height}px`,a.style.width=`${r.width}px`),l.height=r.height,l.width=r.width,l.style.transform=c.transform||"",l.style.transformOrigin=c.transformOrigin||"",a.appendChild(l),t.appendChild(a),o.render({canvasContext:d,viewport:r})}}(this.state.pdf,this.contentRef.current,this.state.zoomLevel/100,this.state.rotate).then(()=>{this.setState({isLoading:!1})})}loaderImage(){if(this.state.fileType===Dv.Image){const e=new Image;e.onload=()=>{const t=this.contentRef.current.getBoundingClientRect(),n=t.height/e.height,i=t.width/e.width,s=Math.min(n,i);let o=100;s<1&&(o=100*(s-.1*s)),this.setState({image:e,isLoading:!1,zoomLevel:o})},e.onerror=()=>{this.setState({isLoading:!1,fileType:Dv.EmptyFile})},e.src=this.props.fileUrl}}imageHeight(){return this.state.image.height*(this.state.zoomLevel/100)}imageWidth(){return this.state.image.width*(this.state.zoomLevel/100)}zoomMinus(){this.setState({zoomLevel:Math.max(1,10*Math.floor((this.state.zoomLevel-10)/10))}),this.renderPagesDebounced()}zoomPlus(){this.setState({zoomLevel:10*Math.ceil((this.state.zoomLevel+10)/10)}),this.renderPagesDebounced()}rangeChange(e){this.setState({zoomLevel:parseInt(e.target.value,10)}),this.renderPagesDebounced()}rotate(){this.setState(e=>{const t=e.rotate+25;return{rotate:t>=100?0:t}}),this.renderPagesDebounced()}render(){return(0,i.jsx)(Yn,{children:({container:e})=>{const t=e.get(qn);return(0,i.jsxs)(Ba,{css:{position:"relative"},direction:"column",height:1,width:1,children:[(0,i.jsx)(Ar,{ref:this.contentRef,css:{height:"calc(100% - 50px)",overflow:"auto",padding:"10px",width:"100%",zIndex:"1","& > div":{margin:"auto",marginBottom:"20px"},"& > div:last-child":{marginBottom:"0"}}}),this.state.fileType===Dv.Image&&!1===this.state.isLoading&&(0,i.jsx)(Ar,{css:{background:"white",height:"calc(100% - 50px)",left:"0",overflow:"auto",padding:"10px",position:"absolute",top:"0",width:"100%",zIndex:"5","& > div:last-child":{marginBottom:"0"}},children:(0,i.jsx)("img",{src:this.state.image.src,style:{height:`${this.imageHeight()}px`,width:`${this.imageWidth()}px`,...Ov(this.state.rotate,this.imageHeight(),this.imageWidth())}})}),!0===this.state.isLoading&&(0,i.jsx)(Ar,{css:{background:"white",height:"calc(100% - 50px)",left:"0",position:"absolute",top:"0",width:"100%",zIndex:"10"},children:(0,i.jsx)(wl,{})}),this.state.fileType===Dv.EmptyFile&&(0,i.jsx)(Ba,{align:"center",css:{background:"white",fontSize:"22px",height:"calc(100% - 50px)",left:"0",position:"absolute",top:"0",width:"100%",zIndex:"20"},justify:"center",children:t.translate("aucun_fichier_77247")}),(0,i.jsxs)(Ba,{align:"center",css:{height:"50px",width:"100%"},justify:"center",children:[(0,i.jsxs)(Rv,{controls:!0,children:[(0,i.jsx)("i",{className:"fas fa-minus",onClick:this.zoomMinus.bind(this)}),(0,i.jsx)($v,{max:"200",min:"1",step:"1",type:"range",value:this.state.zoomLevel,onChange:this.rangeChange.bind(this)}),(0,i.jsx)("i",{className:"fas fa-plus",onClick:this.zoomPlus.bind(this)})]}),(0,i.jsx)(Rv,{rotate:!0,onClick:this.rotate.bind(this),children:(0,i.jsx)("i",{className:"far fa-undo"})})]})]})}})}}const Fv=({acl:e,document:t,onDelete:n,...s})=>{const{translate:o}=vl(),[r,a]=(0,L.useState)(!1),l=Tc(),d="public-read"===e||m(t.url),c=m(t.url)?t.url:Tv(t,P.HEAVENT_AWS_UPLOADS_BUCKET),{designSystem:u}=Il();return(0,i.jsxs)(Ba,{align:"center",css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",fontSize:"$textSm",overflow:"hidden",minHeight:"72px","@tablet":{border:"1px solid $gray300",borderRadius:"$2",fontSize:"$textMd"},...(()=>{switch(u){case"old":return{padding:"$3","@tablet":{padding:"$3"}};case"new2025":return{padding:"$4 $6"};default:ll()}})()},justify:"between",width:1,...l&&{onClick:()=>{!function(e,t){const n=document.createElement("a");n.href=e,n.target="_blank",n.download=t,n.click()}(c,t.name)}},...s,children:[(0,i.jsxs)(Ba,{align:"center",css:{maxInlineSize:"80%"},gap:"4",children:[(0,i.jsx)("img",{src:Ev(t.name),style:{color:"black"}}),(0,i.jsx)(hl,{css:{ellipsis:!0,wordBreak:"break-all",...(()=>{if("new2025"===u)return{fontWeight:"$medium"}})()},children:t.name})]}),(0,i.jsx)(Ar,{css:{flex:"1"}}),(0,i.jsxs)(Ba,{gap:"2",children:[d&&(0,i.jsxs)(i.Fragment,{children:[!1===l&&(0,i.jsx)(zl,{"aria-label":o("view_48132"),color:"white",leftIcon:"eye",onClick:()=>{a(!0)}}),(0,i.jsx)(zl,{"aria-label":o("download_47607"),color:"white",download:t.name,leftIcon:"download",target:"_blank",to:c})]}),n&&(0,i.jsx)(zl,{"aria-label":o("delete_file_40417"),color:"white",leftIcon:"trash-can",onClick:n})]}),r&&(0,Kt.createPortal)((0,i.jsx)(Ba,{css:{background:"white",left:"0",position:"absolute",top:"0",zIndex:"250"},height:1,width:1,children:(0,i.jsx)(Lm,{heading:t.name,onClose:()=>a(!1),children:(0,i.jsx)(Pv,{fileUrl:c})})}),document.body)]})},Mv=_r("progress",{}),Nv=e=>(0,i.jsx)(Mv,{...e,children:e.children}),Lv=({name:e,progress:t,...n})=>{const s=Math.min(100,Math.max(0,t)),{inputId:o}=qa();return(0,i.jsxs)(Ba,{css:{border:"1px solid $gray300",borderRadius:"$2",padding:"$4"},direction:"column",width:1,gap:"2",...n,children:[(0,i.jsx)(Ml,{htmlFor:o,children:e}),(0,i.jsxs)(Nv,{id:o,max:"100",value:s,children:[s,"%"]})]})};var Bv=n(3112);let Vv=class{translationService;constructor(e){this.translationService=e}getFormatter(e={}){return Intl.NumberFormat(vd(this.translationService.language),{notation:e.notation||"compact",style:e.style||"unit",unit:e.unit||"byte",unitDisplay:e.unitDisplay||"narrow"})}toNumberOrInfinity(e){return"number"==typeof e&&e!==1/0?e.toLocaleString():"∞"}static bytesToMegabytes(e){return`${parseFloat((e/1e6).toPrecision(1))} MB`}static bytesToGigabytes(e){return`${parseFloat((e/1e9).toPrecision(1))} GB`}};Vv=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[qn])],Vv),n(8181);var Uv=n(9618);const Wv=({allowCrop:e,onChange:t,hint:n,label:s,...o})=>{const r=Xn(),{isDisabled:a}=Wm(),l=(0,L.useRef)(null),[d,c]=(0,L.useState)(!1),[u,h]=(0,L.useState)(null),[m,g]=(0,L.useState)(!1),p=kv(yv.Images),f=e=>{if(e&&e[0]){const t=URL.createObjectURL(e[0]),n=e[0].type,i=new FileReader;i.onload=i=>{h({src:t,type:(0,Bv.h)(i.target?.result,n),name:e[0].name})},i.readAsArrayBuffer(e[0])}g(!0)};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ba,{gap:"4",width:1,children:[(0,i.jsx)(Ba,{align:"center",css:{background:d?"$primary50":"$gray50",border:d?"1px solid $primary300":"1px solid $gray200",borderRadius:"$1",cursor:a?"not-allowed":"pointer"},disabled:a,height:126,justify:"center",width:126,onClick:()=>{l.current?.click()},onDragEnter:e=>{Dl(e),c(!0)},onDragLeave:e=>{Dl(e),c(!1)},onDragOver:e=>{Dl(e),d||c(!0)},onDrop:n=>{Dl(n),c(!1);const i=n.dataTransfer.files.item(0);i&&p.includes(ov(i.name).extension)&&(e?f(n.dataTransfer.files):t(i))},children:(0,i.jsx)(Ba,{align:"center",css:{background:d?"$primary100":"$gray100",borderRadius:"36px",color:d?"$primary600":"$gray600"},height:d?48:32,justify:"center",width:d?48:32,children:(0,i.jsx)(nl,{icon:"plus"})})}),(0,i.jsxs)(Ba,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(Ar,{color:"gray700",fontWeight:"medium",children:s}),n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ar,{color:"gray400",children:n})]}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(Ba,{children:(0,i.jsx)(zl,{onClick:()=>{l.current?.click()},children:r("s_lectionner_un_50712")})})]}),(0,i.jsx)(Ar,{css:{display:"none"},children:(0,i.jsx)("input",{ref:l,accept:wv(yv.Images),type:"file",onChange:n=>{n.target.files?.[0]&&(e?f(n.target.files):t(n.target.files[0]))},...o})})]}),e&&m&&u&&(0,i.jsx)(Gv,{image:u,onChange:t,onClose:()=>g(!1)})]})},Gv=({image:e,onChange:t,onClose:n})=>{const s=Xn(),o=(0,L.useRef)(null);return(0,L.useEffect)(()=>()=>{e&&e.src&&URL.revokeObjectURL(e.src)},[e]),(0,i.jsx)(au,{size:"md",onClose:n,children:(0,i.jsxs)(Ba,{css:{overflow:"auto"},direction:"column",gap:"3",children:[(0,i.jsx)(Uv.IOb,{ref:o,className:"cropper",defaultSize:({imageSize:e,visibleArea:t})=>({width:(t||e).width,height:(t||e).height}),src:e.src,stencilProps:{aspectRatio:1}}),(0,i.jsx)(zl,{size:"lg",textAlign:"center",onClick:()=>{const i=o.current?.getCanvas();i&&i.toBlob(n=>{if(n){const i=new File([n],e.name,{lastModified:(new Date).getTime(),type:e.type});t(i)}},e.type,.95),n()},children:s("submit_21373")})]})})},Hv="dragover",qv=({accept:e,allowCrop:t,"aria-describedby":n,capture:s,onChange:o,...r})=>{const{translate:a}=vl(),l=Jn(),{isDisabled:d}=Wm(),c=(0,Ha.A)(),u=(0,L.useRef)(null),[h,m]=(0,L.useState)(void 0),[g,p]=(0,L.useState)(null),[f,_]=(0,L.useState)(!1),x=kv(e||[]),I=Av(e||[]),v=e=>{if(e&&e[0]){const t=URL.createObjectURL(e[0]),n=e[0].type,i=new FileReader;i.onload=i=>{p({src:t,type:(0,Bv.h)(i.target?.result,n),name:e[0].name})},i.readAsArrayBuffer(e[0])}_(!0)},{designSystem:b}=(0,L.useContext)(xl);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("input",{ref:u,accept:e?wv(e):void 0,"aria-describedby":[n,c].join(" "),capture:s,style:{display:"none"},type:"file",onChange:n=>{if(n.target.files?.[0])if(t){if(e!==yv.Images)throw new Error("Crop enabled on non-image file uploader");v(n.target.files)}else o(n.target.files[0])},...r}),(0,i.jsxs)(Ba,{align:"center",className:h,css:{background:"$gray50",borderWidth:"1px",borderColor:"$gray200",borderRadius:"$2",cursor:d?"not-allowed":"pointer",padding:"$4",[`&.${Hv}`]:{background:"$primary50",borderColor:"$gray200"},...(()=>{switch(b){case"old":return{borderStyle:"solid"};case"new2025":return{borderStyle:"dashed",[`&:hover, &:has( input:focus), &.${Hv}`]:{borderStyle:"solid",borderColor:"$primary500"}};default:ll()}})()},direction:"column",disabled:d,gap:"2",width:1,onClick:()=>u.current?.click(),onDragLeave:()=>{m(void 0)},onDragOver:e=>{Dl(e),m(Hv)},onDrop:n=>{Dl(n),m(void 0);const i=n.dataTransfer.files.item(0);if(i&&(0===x.length||x.includes(ov(i.name).extension)))if(t){if(e!==yv.Images&&e!=yv.SmallImages)throw new Error("Crop enabled on non-image file uploader");v(n.dataTransfer.files)}else o(i)},children:[(0,i.jsx)(Ba,{align:"center","aria-hidden":!0,css:{color:"$gray600",...(()=>{switch(b){case"old":return{background:"$gray100",borderRadius:"36px"};case"new2025":return;default:ll()}})()},height:32,justify:"center",width:32,children:(0,i.jsx)(nl,{icon:"cloud-arrow-down"})}),(0,i.jsxs)(Ba,{css:{textAlign:"center"},direction:"column",justify:"center",wrap:"wrap",children:[(0,i.jsx)(hl,{textStyle:"subtitle",children:[...l(a("_1_ou_glisser_61813","{1}"),(0,i.jsx)(zl,{color:"invisible",css:{height:"auto",padding:0},id:"clickHereLink",type:"button",children:a("cliquez_ici_98447")}))]}),(0,i.jsx)(hl,{id:c,textStyle:"subtitle",children:[...l(a("_1_accept_2_30390","{1}","{2}"),so(x)?x.map((e,t,{length:n})=>(0,i.jsxs)(L.Fragment,{children:[t>0?n-1!==t?", ":" & ":"",(0,i.jsxs)("code",{children:[".",e]})]},e)):a("all_file_format_50211"),I!==1/0?Vv.bytesToMegabytes(I):a("no_55268"))]})]})]}),t&&f&&g&&(0,i.jsx)(Gv,{image:g,onChange:o,onClose:()=>_(!1)})]})};var Kv;!function(e){e[e.File=0]="File",e[e.Uploader=1]="Uploader",e[e.Uploading=2]="Uploading"}(Kv||(Kv={}));const Yv=({acl:e,css:t,descId:n,description:s,errorId:o,inputId:r,label:a,labelId:l,hint:d,onChange:c,organizationId:u,state:h,value:m,...g})=>{const{translate:p}=vl(),[f,_]=(0,L.useState)(m?Kv.File:Kv.Uploader),[x,I]=(0,L.useState)(""),[v,b]=(0,L.useState)(0);return(0,i.jsxs)(Ba,{"aria-live":"polite",css:t,direction:"column",gap:"1",width:1,children:[(a||s)&&(0,i.jsxs)(Ba,{direction:"column",children:[(0,i.jsx)(Ml,{htmlFor:r,id:l,children:a}),(0,i.jsx)(Pl,{id:n,children:s})]}),f===Kv.File&&m?(0,i.jsx)(Fv,{acl:e,"aria-label":p("delete_uploaded_14711"),document:m,id:r,role:"button",onDelete:()=>{c(null),_(Kv.Uploader)}}):f===Kv.Uploading?(0,i.jsx)(Lv,{"aria-busy":!0,"aria-describedby":n,"aria-label":p("uploading_file_46483"),id:r,name:x,progress:v}):(0,i.jsx)(qv,{"aria-describedby":n,"aria-errormessage":o,"aria-invalid":"error"===h,"aria-label":p("upload_file_97740"),id:r,onChange:async t=>{_(Kv.Uploading),I(t.name),b(0);try{if(t.size>Av(g.accept||[]))throw I(""),alert(p("file_is_too_lar_57859")),new Error;const n=await Sv(u,t,e,b);c({...n,file:t}),_(Kv.File)}catch{_(Kv.Uploader)}},...g}),(0,i.jsx)(Fl,{state:h,children:d})]})},Zv=e=>{const t=Xn();return(0,i.jsxs)(Ba,{align:"center",gap:"1",children:[e.children,(0,i.jsxs)(Ar,{color:"gray500",fontSize:"textXs",fontWeight:"regular",children:["(",t("facultatif_76747"),")"]})]})},Xv=(0,L.createContext)({}),Jv=_r("div",{background:"$gray50",border:"1px solid $gray100",borderRadius:"$2",display:"flex",gap:"$2",height:"44px",minHeight:"44px",padding:"$1",position:"relative",width:"100%"}),Qv=_r("div",{alignItems:"center",color:"$gray500",cursor:"pointer",display:"flex",fontWeight:"$medium",height:"100%",justifyContent:"center",userSelect:"none",width:"100%",variants:{selected:{true:{background:"white",borderRadius:"6px",boxShadow:"$sm",color:"$gray700"}}}}),eb=e=>(0,i.jsx)(Xv.Provider,{value:{selectedItem:e.selectedItem,onChange:e.onChange},children:(0,i.jsx)(Jv,{children:e.children})}),tb=e=>{const{selectedItem:t,onChange:n}=(0,L.useContext)(Xv);return(0,i.jsx)(Qv,{selected:t===e.item,onClick:()=>{n(e.item)},children:e.children})};var nb=n(3333),ib=n(5488),sb=n.n(ib);n(4385),n(5833),n(9844),n(6871),n(2830);const ob=({css:e,label:t,description:n,state:s,initialValue:o,onChange:r,onBlur:a,onFocus:l,hint:d,placeholder:c,value:u,...h})=>{const{translate:m,params:{organizationId:g}}=vl(),{language:p}=Zn(qn),f=(0,L.useMemo)(()=>[{color:"white",label:m("blanc_36425")},{color:xr.colors.gray800.value,label:m("gris_fonc_51159")},{color:xr.colors.gray400.value,label:m("gris_clair_52465")},{color:xr.colors.primary900.value,label:m("bleu_fonc_40491")},{color:xr.colors.primary500.value,label:m("bleu_41949")},{color:xr.colors.error700.value,label:m("rouge_fonc_45023")},{color:xr.colors.error500.value,label:m("rouge_75079")},{color:xr.colors.warning300.value,label:m("jaune_53503")},{color:xr.colors.warning600.value,label:m("orange_64132")},{color:xr.colors.success700.value,label:m("vert_fonc_37265")},{color:xr.colors.success500,label:m("vert_27018")},{color:xr.colors.purple700.value,label:m("violet_fonc_77270")},{color:xr.colors.purple500.value,label:m("violet_54005")},{color:xr.colors.pink700.value,label:m("rose_fonc_98996")},{color:xr.colors.pink500.value,label:m("rose_49360")}],[]);return(0,i.jsxs)(Ba,{css:e,direction:"column",width:1,children:[(0,i.jsx)(Ml,{children:t}),(0,i.jsx)(Pl,{children:n}),(t||n)&&(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ar,{css:{"--ck-border-radius":"$radii$1","--ck-color-toolbar-background":"$colors$gray100","& .ck.ck-toolbar":{borderColor:"error"===s?"$error500":"$gray300",borderBottom:"none","& .ck.ck-toolbar__separator":{background:"$gray200"},"& .ck.ck-button":{color:"$gray600","&:hover":{background:"$gray200",color:"$gray800",cursor:"pointer"},"&.ck-on, &.ck-on:hover:not(.ck-disabled)":{background:"$primary100",color:"$primary500"}}},"& .ck.ck-content":{borderColor:"error"===s?"$error500 !important":"$gray300 !important",borderStyle:"solid",borderWidth:"1px",borderTop:"none !important",color:"$gray800",minHeight:"100px",px:"$3","&.ck-editor__editable.ck-focused":{boxShadow:"none"},"& p.h-small":{fontSize:"12px"}},"& .ck.ck-editor__editable > .ck-placeholder::before":{color:"$gray500"},...jg("& .ck.ck-content")},width:1,children:(0,i.jsx)(nb.CKEditor,{config:{placeholder:c,fontColor:{colors:f},fontBackgroundColor:{colors:f},language:p.toString().toLowerCase(),simpleUpload:{uploadUrl:`${P.HEAVENT_API_URL}/image/upload?organizationId=${g}`},heading:{options:[{model:"paragraphSmall",view:{name:"p",classes:"h-small"},title:m("paragraphe_pet_01073"),class:"ck-heading_paragraph_small",converterPriority:"high"},{model:"paragraph",title:"Paragraph",class:"ck-heading_paragraph"},{model:"heading1",view:"h2",title:"Heading 1",class:"ck-heading_heading1"},{model:"heading2",view:"h3",title:"Heading 2",class:"ck-heading_heading2"},{model:"heading3",view:"h4",title:"Heading 3",class:"ck-heading_heading2"}]}},data:o,editor:sb(),onBlur:()=>{a?.()},onChange:(e,t)=>{r(t.getData())},onFocus:()=>{l?.()},...h})}),(0,i.jsx)(Fl,{state:s,children:d})]})},rb=({name:e,hint:t,state:n,...s})=>(0,i.jsx)(Ga.D0,{name:e,parse:Rl.A,render:o=>{const r=$l(o.meta);return(0,i.jsx)(ob,{hint:r?o.meta.error:t,initialValue:o.input.value,name:e,state:r?"error":n,onChange:e=>{o.input.onChange(e)},...s})}}),ab=({value:e,css:t,label:n,description:s,hint:o,icon:r,onChange:a,state:l,...d})=>{const c=m(e)&&e.length>5?e.substring(0,5):e,{inputId:u,descId:h,errorId:g}=qa();return(0,i.jsxs)(Ba,{css:t,direction:"column",width:1,children:[(0,i.jsx)(Ml,{htmlFor:u,children:n}),(0,i.jsx)(Pl,{id:h,children:s}),(n||s)&&(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ll,{cursor:"default",icon:r,state:l,children:(0,i.jsx)(Ar,{css:{flex:"1",height:"100%","& input":{background:"transparent",border:"none",color:"$gray800",height:"100%",outline:"none",width:"100%"}},children:(0,i.jsx)("input",{"aria-describedby":s?h:void 0,"aria-errormessage":"error"===l?g:void 0,"aria-invalid":"error"===l,disabled:"disabled"===l,id:u,type:"time",value:c,onChange:e=>{a(e.target.value)},...d})})}),(0,i.jsx)(Fl,{id:g,state:l,children:o})]})},lb=({name:e,hint:t,state:n,...s})=>(0,i.jsx)(Ga.D0,{name:e,render:o=>{const r=$l(o.meta);return(0,i.jsx)(ab,{hint:r?o.meta.error:t,name:e,state:r?"error":n,value:o.input.value,onBlur:o.input.onBlur,onChange:o.input.onChange,onFocus:o.input.onFocus,...s})}}),db=e=>{const{translate:t}=vl();return(0,i.jsxs)(Ba,{direction:"column",gap:"3",children:[(0,i.jsx)(Gm,{name:`${e.prefix}hasCalendarInvite`,children:(0,i.jsxs)(Ba,{align:"center",gap:"2",children:[t("ajouter_une_inv_92123"),(0,i.jsxs)(km,{children:[(0,i.jsx)(Sm,{children:(0,i.jsx)(Ar,{color:"gray500",children:(0,i.jsx)(nl,{icon:"circle-exclamation"})})}),(0,i.jsx)(wm,{placement:"top",children:t("un_fichier_ics_01663")})]})]})}),e.hasCalendarInvite&&(0,i.jsx)(Ba,{css:{paddingLeft:"$6"},width:1,children:(0,i.jsxs)(Ba,{css:{background:"$gray50",bd:!0,padding:"$4 $6"},direction:"column",gap:"4",width:1,children:[(0,i.jsx)(Vl,{label:t("nom_de_l_v_nem_08711"),name:`${e.prefix}calendarInviteName`}),(0,i.jsxs)(Ba,{gap:"4",children:[(0,i.jsx)(Hm,{label:t("date_de_d_but_43380"),name:`${e.prefix}calendarInviteStartDate`}),(0,i.jsx)(lb,{label:t("heure_de_d_but_27566"),name:`${e.prefix}calendarInviteStartTime`})]}),(0,i.jsxs)(Ba,{gap:"4",children:[(0,i.jsx)(Hm,{label:t("date_de_fin_86920"),name:`${e.prefix}calendarInviteEndDate`}),(0,i.jsx)(lb,{label:t("heure_de_fin_95071"),name:`${e.prefix}calendarInviteEndTime`})]})]})})]})},cb=e=>{const{history:t,translate:n,params:{organizationId:s}}=vl(),[o,r]=(0,L.useState)(e.values.campaign.documents);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Vl,{label:n("sujet_36033"),name:"campaign.subject"}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsxs)(eb,{selectedItem:e.values.textOrHtml,onChange:t=>{e.form.change("textOrHtml",t)},children:[(0,i.jsx)(tb,{item:"text",children:n("contenu_en_vers_04808")}),(0,i.jsx)(tb,{item:"html",children:n("contenu_parti_04631")})]}),(0,i.jsx)(Ya,{height:"7"}),"text"===e.values.textOrHtml&&(0,i.jsx)(rb,{hint:(0,i.jsx)(Ar,{css:{"& a":{color:"$primary500"}},dangerouslySetInnerHTML:{__html:n("vous_pouvez_ajo_23408")}}),label:n("contenu_29668"),name:"campaign.text"}),"html"===e.values.textOrHtml&&(0,i.jsx)(Xm,{hint:(0,i.jsx)(Ar,{css:{"& a":{color:"$primary500"}},dangerouslySetInnerHTML:{__html:n("vous_pouvez_ajo_23408")}}),label:n("code_html_60711"),name:"campaign.html"}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(Ym,{isCreateVisible:!0,isSearchVisible:!0,label:(0,i.jsx)(Zv,{children:n("_metteur_de_l_e_51616")}),name:"campaign.emailSenderId",onCreateClick:()=>{t.push(Ps.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(s))},children:e.emailsSenders.map(t=>(0,i.jsx)("option",{value:t.id,children:`${t.name} ${t.id===e.emailSenderId?n("_metteur_par_d_03442"):t.isValidToSendEmail?"":n("_e_mail_non_con_07618")}`},t.id))}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(Vl,{isEmail:!0,label:(0,i.jsx)(Zv,{children:n("adresse_de_r_po_86181")}),name:"campaign.replyTo"}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsxs)(Ba,{align:"center",gap:"1",children:[(0,i.jsx)(Ar,{color:"gray700",fontSize:"textMd",fontWeight:"semiBold",children:n("pi_ce_s_jointe_82370")}),(0,i.jsxs)(km,{children:[(0,i.jsx)(Sm,{children:(0,i.jsx)(Ar,{color:"gray500",children:(0,i.jsx)(nl,{icon:"circle-exclamation"})})}),(0,i.jsx)(wm,{placement:"bottom",children:n("si_vos_pi_ces_j_95233")})]})]}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ar,{color:"gray500",children:n("int_grer_dans_v_73429")}),e.canCustomDocuments&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"4"}),(0,i.jsxs)(Ym,{isSearchVisible:!0,label:n("documents_dit_25968"),multiple:!0,name:"campaign.attachments",children:[e.customDocuments.map(e=>(0,i.jsx)("option",{value:e.slug,children:e.name},e.slug)),sv.map(e=>(0,i.jsx)("option",{value:e,children:n(e)},e))]})]}),o.map(t=>(0,i.jsxs)(L.Fragment,{children:[(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(Yv,{acl:"public-read",organizationId:s,value:t,onChange:()=>{const n=(0,hc.A)(o,t);r(n),e.form.change("campaign.documents",n)}})]},t.key)),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(Yv,{acl:"public-read",label:n("fichier_personn_20046"),organizationId:s,value:null,onChange:t=>{const n=[...o,(0,ur.A)(t,"file")];r(n),e.form.change("campaign.documents",n)}}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(db,{hasCalendarInvite:e.values.campaign.hasCalendarInvite,prefix:"campaign."})]})},ub=e=>(0,i.jsx)(Ga.D0,{name:e.name,render:t=>{const n=t.input.checked?"checked":"unchecked";return(0,i.jsx)(vc,{disabled:e.disabled,size:e.size,state:n,subtext:e.subtext,onClick:()=>{t.input.onChange(e.value)},children:e.children})},type:"radio",value:e.value}),hb=e=>{const t=Xn(),n=e.formRenderProps.values,{numberOfCharacters:s,numberOfSms:o}=pv(n.campaign.text,n.customSender);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ar,{color:"gray800",fontWeight:"medium",children:t("voulez_vous_per_07528")}),(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(ub,{name:"customSender",value:!1,children:t("non_je_souhait_47056")}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(ub,{name:"customSender",value:!0,children:t("oui_je_souhait_40974")}),e.formRenderProps.values.customSender&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(Ar,{css:{paddingLeft:"$6"},children:(0,i.jsx)(Vl,{hint:t("doit_commencer_93759"),name:"campaign.sender",placeholder:t("_metteur_du_mes_17005")})})]}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(Xm,{hint:(0,i.jsx)(Ar,{css:{"& a":{color:"$primary500"}},dangerouslySetInnerHTML:{__html:t("vous_pouvez_ajo_23408")}}),label:(0,i.jsxs)(Ba,{justify:"between",children:[(0,i.jsx)(Ar,{children:t("contenu_29668")}),(0,i.jsx)(Ar,{color:"gray500",children:t("_1_caract_re_04414",s,o)})]}),name:"campaign.text"})]})},mb=e=>{const t=Xn();return(0,i.jsxs)(i.Fragment,{children:[e.formRenderProps.values.campaign.campaignType===me.Email?(0,i.jsx)(cb,{canCustomDocuments:e.canCustomDocuments,customDocuments:e.customDocuments,emailSenderId:e.emailSenderId,emailsSenders:e.emailsSenders,form:e.formRenderProps.form,values:e.formRenderProps.values}):(0,i.jsx)(hb,{formRenderProps:e.formRenderProps}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(Ba,{children:(0,i.jsx)(zl,{isLoading:e.formRenderProps.submitting,onClick:e.formRenderProps.handleSubmit,children:e.isTemplate?e.isEdit?t("mettre_jour_l_13576"):t("cr_er_le_mod_le_06346"):e.isSent?t("mettre_jour_l_32694"):t("suivant_desti_10756")})})]})},gb=({css:e,footer:t,header:n,heading:s,subtitle:o,children:r,...a})=>(0,i.jsxs)(Ba,{as:Ma.Section,className:"card",css:{padding:"unset !important",bd:!0,inlineSize:"100%",backgroundColor:"$white","& .card":{backgroundColor:"$gray50","& .card__body":{padding:"$4 $5"}},...e},direction:"column",...a,children:[n||(s||o)&&(0,i.jsx)(Ba,{align:"center",as:Ma.Header,css:{borderBlockEnd:"1px solid $gray200",padding:"$6 $7 $5 $7"},gap:"3",children:(0,i.jsxs)(Ar,{css:{flex:"1"},children:[s&&(0,i.jsx)(ml,{children:s}),o&&(0,i.jsx)(hl,{textStyle:"subtitle",children:o})]})}),(0,i.jsx)(Ba,{className:"card__body",css:{gap:"$6",padding:"$6 $7","&:empty":{display:"none"}},direction:"column",children:r}),t&&(0,i.jsx)(Ba,{as:Ma.Footer,css:{borderBlockStart:"1px solid $gray200",padding:"$6","&:empty":{display:"none"}},gap:"3",children:t})]}),pb=e=>(0,i.jsx)(Ba,{as:"legend",css:{position:"absolute",overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(50%)",width:"1px",height:"1px",whiteSpace:"nowrap"},direction:"column",children:e.heading});var fb;!function(e){e.Dark="dark",e.Normal="normal"}(fb||(fb={}));const _b=({canSelect:e,children:t,disabled:n,footerActions:s,heading:o,header:r,headerStyle:a=fb.Normal,headerActions:l,hideHeader:d,isCompleted:c,isOpen:u,onSelect:h,stepNumber:m,subtitle:g,...p})=>{const{descId:f}=qa();return(0,i.jsx)(Um.Provider,{value:{isDisabled:n},children:(0,i.jsx)(gb,{"aria-describedby":f,as:"fieldset",css:{"&:disabled :is(input, select, textarea, datalist, button)":{cursor:"not-allowed !important"},...p.css},direction:"column",disabled:n,footer:!1!==u&&s,header:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(pb,{heading:o}),!d&&(0,i.jsxs)(Ba,{align:"center",as:"header",css:{paddingBlockEnd:"$5",padding:"$6 $7 $5 $7",...a===fb.Normal?{borderBlockEnd:"1px solid $gray200"}:{background:u?"$gray900":"white",cursor:e&&!u?"pointer":"default",px:"$6"}},gap:"3",onClick:h,children:[a===fb.Dark&&(0,i.jsx)(Ba,{align:"center",css:{background:c?"$success200":"white",border:c?"none":"1px solid $gray200",borderRadius:"32px",color:c?"$success700":"$gray800",fontWeight:"$medium"},height:32,justify:"center",width:32,children:c?(0,i.jsx)(nl,{icon:"check"}):m}),(0,i.jsxs)(Ar,{css:{flex:"1"},children:[o&&(0,i.jsx)(ml,{"aria-hidden":"true",css:{color:u?"white":"gray800"},children:o}),g&&(0,i.jsx)(hl,{color:u?"white":"gray800",id:f,textStyle:"subtitle",children:g})]}),l&&(0,i.jsx)(Ba,{gap:"4",justify:"end",children:l})]})]}),...p,children:!1!==u&&(0,i.jsx)(Ba,{css:{gap:"$3","&:has(> fieldset.fieldset--column)":{gap:"$9"},"&:has(> fieldset.fieldset--row)":{gap:"unset"}},direction:"column",children:t})})})},xb=e=>(0,i.jsxs)(Ar,{css:{borderRadius:"$1",boxShadow:"$sm",overflow:"hidden",width:"100%"},children:[(0,i.jsxs)(Ba,{align:"center",css:{background:e.isOpen?"$gray900":"white",cursor:e.canSelect&&!e.isOpen?"pointer":"default",px:"$6"},gap:"4",height:64,width:1,onClick:()=>{e.canSelect&&e.onSelect()},children:[(0,i.jsx)(Ba,{align:"center",css:{background:e.isCompleted?"$success200":"white",border:e.isCompleted?"none":"1px solid $gray200",borderRadius:"32px",color:e.isCompleted?"$success700":"$gray800",fontWeight:"$medium"},height:32,justify:"center",width:32,children:e.isCompleted?(0,i.jsx)(nl,{icon:"check"}):e.stepNumber}),(0,i.jsx)(Ar,{color:e.isOpen?"white":"gray800",fontSize:"textMd",fontWeight:"medium",children:e.heading})]}),e.isOpen&&(0,i.jsx)(Ar,{css:{background:"white",padding:"$6 70px",width:"100%"},children:e.children}),(0,i.jsx)(Ba,{children:e.actions})]}),Ib=e=>(0,i.jsx)(yl,{direction:"column",formRenderProps:e.formRenderProps,render:e.render}),vb=e=>{const{translate:t}=vl(),[n,s]=L.useState(!1),[o,r]=L.useState(0),a=Zn(Ua),l=L.Children.toArray(e.children),{designSystem:d}=Il(),[c,u]=L.useState(!1);return c?(0,i.jsx)(_b,{heading:t("r_capitulaif_76565"),children:e.summaryStep}):(0,i.jsx)(Ga.lV,{initialValues:e.initialValues,initialValuesEqual:Mr.A,mutators:{...Wa.A,forceErrors:Cl},render:t=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ga.Pc,{subscription:{dirtyFields:!0},children:({dirtyFields:e})=>Object.keys(e).map((e,t)=>(0,i.jsx)(Ga.D0,{name:e,render:()=>null,subscription:{}},t))}),l.map((a,l)=>{const c=o>=l||e.isEdit&&t.valid;if("string"==typeof a||"number"==typeof a||"boolean"==typeof a||!("props"in a))throw new Error("Invalid step passed to wizard");return(0,i.jsxs)(Ka.Provider,{value:{formRenderProps:t,showErrors:n,setShowErrors:s},children:["new2025"===d?(0,i.jsx)(_b,{canSelect:c,footerActions:a.props.actions?.(t),headerStyle:fb.Dark,heading:a.props.heading,isCompleted:o>l,isOpen:o===l,stepNumber:l+1,onSelect:()=>{c&&(s(!1),r(l))},children:L.cloneElement(a,{formRenderProps:t})}):(0,i.jsx)(xb,{canSelect:c,handleSubmit:t.handleSubmit,heading:a.props.heading,isCompleted:o>l,isOpen:o===l,stepNumber:l+1,onSelect:()=>{c&&(s(!1),r(l))},children:L.cloneElement(a,{formRenderProps:t})}),(0,i.jsx)(Ya,{height:"6"})]},l)})]}),validate:e=>a.validateForForm(l[o].props.schema)(e),onSubmit:async(t,n)=>{if(o===l.length-1){const i=await e.onSubmit(t,n);return i?(s(!0),e.containerRef&&e.containerRef.current&&(e.containerRef.current.scrollIntoView(),e.containerRef.current.scrollTop=0),i):void u(!0)}return s(!1),void r(o+1)}})},bb=L.createContext({}),jb=e=>{const{params:{eventId:t}}=vl(),n=L.useMemo(()=>function(e){return e.roles.some(e=>yI.includes(e.type))}(e.userPermissions),[e.userPermissions]);return t?(0,i.jsx)(bb.Provider,{value:{isEventAdmin:e.isEventAdmin??!1,isEventReader:n,userPermissions:e.userPermissions,hasPermission:(t,n)=>function(e,t,n){return AI(e,[t],n)[0]}(e.userPermissions,t,n),hasPermissions:(t,n)=>AI(e.userPermissions,t,n)},children:e.children}):(0,i.jsx)(i.Fragment,{children:e.children})};function Cb(){return L.useContext(bb)}var yb=n(8923);const kb=L.createContext({}),Ab=e=>{const[t,n]=L.useState(e.numberOfWaitingAccreditations),[s,o]=L.useState(e.numberOfWaitingAssigments),[r,a]=L.useState(null),l=L.useCallback(async t=>{const n=(0,yb.A)(r,{id:e.event.id},t);await xI.events.put(n),a(n)},[e.event.id,r,a]),{isEventAdmin:d,isEventReader:c,userPermissions:u,hasPermission:h,hasPermissions:m}=Cb();return L.useEffect(()=>{(async()=>{let t=await xI.events.get(e.event.id);t||(t={id:e.event.id},await xI.events.put(t)),a(t)})()},[e.event]),(0,i.jsx)(kb.Provider,{value:{event:e.event,isEventAdmin:d,isEventReader:c,localEvent:r,numberOfWaitingAccreditations:t,numberOfWaitingAssigments:s,userPermissions:u,hasPermission:h,hasPermissions:m,setNumberOfWaitingAccreditations:n,setNumberOfWaitingAssigments:o,updateLocalEvent:l},children:e.children})};function wb(){return L.useContext(kb)}const Sb=e=>{const t=(0,L.useRef)(null),n=(0,L.useCallback)(e=>{e&&(t.current=e,setTimeout(()=>{e.style.right=xr.space[6].value},100))},[]),s=(0,L.useCallback)(()=>{t.current.style.right="-400px",e.onClose()},[e.onClose]);return(0,Kt.createPortal)((0,i.jsxs)(Ba,{ref:n,align:"center",className:"h-notification",css:{background:"black"===e.color?"$gray900":"error"===e.color?"$error400":"$success500",borderRadius:"$2",boxShadow:"$lg",maxHeight:"120px",padding:"$2 $4",position:"absolute",right:"-400px",top:"$6",transition:"0.5s right ease-in-out",zIndex:"1000"},gap:"3",role:"status",width:400,children:[(0,i.jsx)(Ba,{align:"center",css:{color:"white"},justify:"center",children:(0,i.jsx)(nl,{icon:"black"===e.color?"circle-exclamation":"error"===e.color?"circle-xmark":"circle-check",iconStyle:"solid"})}),(0,i.jsx)(Ar,{color:"white",css:{flex:"1","& a":{color:"white",textDecoration:"underline"}},dangerouslySetInnerHTML:{__html:e.text},fontWeight:"medium"}),(0,i.jsx)(Ba,{align:"center",css:{color:"white",cursor:"pointer",fontSize:"$textMd"},height:32,justify:"center",width:32,onClick:s,children:(0,i.jsx)(nl,{icon:"xmark"})})]}),document.body)},Eb=2e3,Tb=L.createContext({}),zb=e=>{const t=Xn(),[n,s]=L.useState(!1),[o,r]=L.useState({color:"success",text:""}),a=L.useCallback(()=>{setTimeout(()=>{s(!1)},1200)},[s]),l=L.useCallback(e=>{s(!0),r("string"==typeof e?{text:e}:e),setTimeout(a,Gs.dw.fromObject({seconds:5}).toMillis())},[s,r,a]),{mutate:d}=function(e={}){return ei("mutation DelegationsImportResult(\n $jobId: UUID!\n $organizationId: OrganizationId!\n $eventId: EventId!\n) {\n delegationsImportResult(jobId: $jobId, organizationId: $organizationId, eventId: $eventId) {\n state\n event {\n name\n }\n }\n}\n",e)}(),c=L.useRef(null),u=L.useCallback((e,n,i)=>{c.current=window.setInterval(async()=>{const{delegationsImportResult:{state:s,event:o}}=await d({jobId:e,organizationId:n,eventId:i});s===ke.Done&&(clearInterval(c.current),l({color:"success",text:t("votre_import_es_98992",o.name)}))},Eb)},[]),{mutate:h}=function(e={}){return ei("mutation EventDocumentsExportResult(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $delegationId: DelegationId\n $jobId: UUID!\n) {\n eventDocumentsExportResult(\n organizationId: $organizationId\n eventId: $eventId\n delegationId: $delegationId\n jobId: $jobId\n ) {\n state\n url\n }\n}\n",e)}(),m=L.useRef(null),g=L.useCallback((e,n,i)=>{m.current=window.setInterval(async()=>{const{eventDocumentsExportResult:s}=await h({jobId:e,organizationId:n,eventId:i});s.state===Le.Done&&(clearInterval(m.current),l({color:"success",text:t("l_export_de_vos_38257",s.url)}))},Eb)},[]),{mutate:p}=function(e={}){return ei("mutation EventsImportResult($jobId: UUID!, $organizationId: OrganizationId!) {\n eventsImportResult(jobId: $jobId, organizationId: $organizationId) {\n state\n }\n}\n",e)}(),f=L.useRef(null),_=L.useCallback((e,n)=>{f.current=window.setInterval(async()=>{const{eventsImportResult:{state:i}}=await p({jobId:e,organizationId:n});i===Pe.Done&&(clearInterval(f.current),l({color:"success",text:t("votre_import_es_60265")}))},Eb)},[]),{mutate:x}=function(e={}){return ei("mutation ExportResult($jobId: UUID!, $organizationId: OrganizationId!, $eventId: EventId) {\n exportResult(jobId: $jobId, organizationId: $organizationId, eventId: $eventId) {\n state\n url\n }\n}\n",e)}(),I=L.useRef(null),v=L.useCallback((e,n,i)=>{I.current=window.setInterval(async()=>{const{exportResult:s}=await x({jobId:e,organizationId:n,eventId:i});s.state===Le.Done&&(clearInterval(I.current),l({color:"success",text:t("votre_export_es_96069",s.url)}))},Eb)},[]),{mutate:b}=function(e={}){return ei("mutation FilesImportResult($jobId: UUID!, $organizationId: OrganizationId!, $eventId: EventId) {\n filesImportResult(jobId: $jobId, organizationId: $organizationId, eventId: $eventId) {\n state\n event {\n name\n }\n }\n}\n",e)}(),j=L.useRef(null),C=L.useCallback((e,n,i)=>{j.current=window.setInterval(async()=>{const{filesImportResult:{state:s,event:o}}=await b({jobId:e,organizationId:n,eventId:i});s===Ge.Done&&(clearInterval(j.current),l({color:"success",text:o?t("votre_import_es_11791",o.name):t("votre_import_es_10672")}))},Eb)},[]),{mutate:y}=function(e={}){return ei("mutation PositionsImportResult(\n $jobId: UUID!\n $organizationId: OrganizationId!\n $eventId: EventId!\n) {\n positionsImportResult(jobId: $jobId, organizationId: $organizationId, eventId: $eventId) {\n state\n event {\n name\n }\n }\n}\n",e)}(),k=L.useRef(null),A=L.useCallback((e,n,i)=>{k.current=window.setInterval(async()=>{const{positionsImportResult:{state:s,event:o}}=await y({jobId:e,organizationId:n,eventId:i});s===ct.Done&&(clearInterval(k.current),l({color:"success",text:t("votre_import_es_11848",o.name)}))},Eb)},[]),{mutate:w}=function(e={}){return ei("mutation VolunteersImportResult(\n $jobId: UUID!\n $organizationId: OrganizationId!\n $eventId: EventId\n $delegationId: DelegationId\n) {\n volunteersImportResult(\n jobId: $jobId\n organizationId: $organizationId\n eventId: $eventId\n delegationId: $delegationId\n ) {\n state\n event {\n name\n }\n }\n}\n",e)}(),S=L.useRef(null),E=L.useCallback((e,n,i)=>{S.current=window.setInterval(async()=>{const{volunteersImportResult:{state:s,event:o}}=await w({jobId:e,organizationId:n,eventId:i});s===Ft.Done&&(clearInterval(S.current),l({color:"success",text:o?t("votre_import_es_37822",o.name):t("votre_import_es_14145")}))},Eb)},[]);return(0,i.jsx)(Tb.Provider,{value:{checkDelegationsImport:u,checkDocumentsExport:g,checkEventsImport:_,checkExport:v,checkFilesImport:C,checkPositionsImport:A,checkVolunteersImport:E,showNotification:l},children:(0,i.jsxs)(i.Fragment,{children:[n&&(0,i.jsx)(Sb,{color:o.color??"success",text:o.text,onClose:a}),e.children]})})};function Ob(){return L.useContext(Tb)}const Rb=L.createContext({});function $b(){return L.useContext(Rb)}const Db=_r("dialog",{background:"white",border:"none",display:"flex",flexDirection:"column",overflowY:"auto",padding:"0",variants:{mobile:{true:{height:"100%",width:"100%"},false:{borderRadius:"12px",maxHeight:"calc(100% - 80px)",width:"688px"}}},defaultVariants:{mobile:!1}}),Pb=e=>{const t=Xn(),{onClose:n}=$b();return(0,i.jsxs)(Ba,{css:{borderTop:e.hideBorder?void 0:"1px solid $gray200",padding:"$6 $7"},gap:"3",justify:"end",children:[!e.hideCancelButton&&(0,i.jsx)(zl,{color:"white",onClick:n,children:t("annuler_48254")}),"function"==typeof e.children?e.children(n):e.children]})},Fb=e=>(0,i.jsx)(Ba,{direction:"column",...Na(e),css:{borderTop:e.hideBorder?void 0:"1px solid $gray200",padding:"$5 $7 $7 $7",...e.css},children:e.children}),Mb=({icon:e,iconColor:t,children:n,subtitle:s,onClose:o})=>(0,i.jsxs)(Ba,{children:[(0,i.jsxs)(Ba,{align:"center",css:{flexGrow:"1",padding:"$6 $7 $5 $7"},gap:"4",children:[(0,i.jsx)(Ba,{align:"center",css:{border:"1px solid $gray200",borderRadius:"10px",boxShadow:"$xs",color:t||"$gray700",fontSize:"textMd",padding:"$3"},height:48,justify:"center",width:48,children:(0,i.jsx)(nl,{className:"fa-xl",icon:e})}),(0,i.jsxs)(Ba,{direction:"column",children:[(0,i.jsx)(Ar,{font:"gray900 textLg medium",children:n}),m(s)&&(0,i.jsx)(Ar,{color:"gray500",children:s})]})]}),o&&(0,i.jsx)(Ba,{align:"center",css:{color:"$gray500",cursor:"pointer",fontSize:"textMd",padding:"$2",margin:"$3 $3"},height:24,justify:"center",width:24,onClick:o,children:(0,i.jsx)(nl,{className:"fa-xl",icon:"xmark"})})]}),Nb=({children:e})=>{const{isOpen:t,onClose:n}=$b();return Ld(n),il("common-front/src/designSystem/components/modals/__deprecated/modal/modal.tsx","common-front/src/designSystem/components/modals/base/modal.tsx"),t?(0,Kt.createPortal)((0,i.jsx)(Ba,{align:"center",css:{background:"rgba(52, 64, 84, 0.7)",height:"100%",left:0,position:"absolute",top:0,width:"100%",zIndex:"300"},justify:"center",onClick:n,children:(0,i.jsx)(Db,{onClick:e=>Dl(e,!1),children:e})}),document.body):null},Lb=e=>{const[t,n]=L.useState(e.isOpen??!1),s=L.useCallback(()=>{n(!1),e.onClose?.()},[n,e.onClose]);return L.useEffect(()=>{"boolean"==typeof e.isOpen&&n(e.isOpen)},[e.isOpen]),(0,i.jsx)(Rb.Provider,{value:{isOpen:t,onClose:s,setIsOpen:n},children:e.children})},Bb=e=>{const{setIsOpen:t}=$b(),n=e.children,s=L.useCallback(e=>{Dl(e),t(!0),n.props.onClick?.(e)},[t,n]),o=L.useMemo(()=>L.cloneElement(L.Children.only(n),{onClick:s,onKeyPress:s,tabIndex:0}),[n,s]);return(0,i.jsx)(i.Fragment,{children:o})};var Vb=n(7431);const Ub=()=>{const{translate:e}=vl(),t=Zn(hu),[n,s]=(0,L.useState)(""),o=(0,L.useMemo)(()=>t.countries.filter(e=>"number"==typeof e.smsPrice),[t]),r=(0,L.useMemo)(()=>{if(m(n)){const e=u(n);return o.filter(t=>u(t.name).includes(e)||io(t.phoneCode).some(e=>e.includes(n)))}return o},[o,n]);return(0,i.jsxs)(Lb,{children:[(0,i.jsx)(Bb,{children:(0,i.jsx)(Ar,{color:"primary500",children:e("voir_la_liste_d_69122")})}),(0,i.jsxs)(Nb,{children:[(0,i.jsx)(Mb,{icon:"message",children:e("liste_des_prix_58579")}),(0,i.jsxs)(Fb,{css:{overflow:"auto"},direction:"column",gap:"3",height:300,children:[(0,i.jsx)(Bl,{icon:"magnifying-glass",placeholder:"Rechercher un pays",state:"search",value:n,onChange:s}),(0,i.jsxs)(Sc,{children:[(0,i.jsxs)(kc,{children:[(0,i.jsx)(Gc,{children:e("Country")}),(0,i.jsx)(Gc,{children:e("indicatif_40634")}),(0,i.jsx)(Gc,{children:e("prix_ht_10965")})]}),r.map(e=>{return(0,i.jsxs)(Mc,{children:[(0,i.jsx)(Oc,{children:e.name}),(0,i.jsx)(Oc,{children:e.phoneCode}),(0,i.jsx)(Oc,{children:(0,Vb.A)((t=e.smsPrice,t*(14/9)),3)})]},e.code);var t})]})]}),(0,i.jsx)(Pb,{})]})]})},Wb=e=>{const t=Xn(),{hasFeature:n}=TI(),s=n(Be.Sms);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Nr.Yr,{name:"campaign.campaignType",children:t=>{t===me.Sms?s?(e.formRenderProps.form.change("campaign.text",""),e.formRenderProps.form.change("campaign.html","")):e.formRenderProps.form.change("campaign.campaignType",me.Email):(e.formRenderProps.form.change("campaign.text",""),e.formRenderProps.form.change("campaign.html",""))}}),(0,i.jsx)(Vl,{label:e.isTemplate?t("nom_de_votre_mo_02364"):t("nom_de_votre_ca_08001"),name:"campaign.name"}),!e.isSent&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(Ar,{color:"gray700",fontWeight:"medium",children:e.isTemplate?t("quel_type_de_mo_32965"):t("quel_type_de_ca_11960")}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(ub,{name:"campaign.campaignType",value:me.Email,children:t("e_mail_13869")}),(0,i.jsx)(Ya,{height:"3"}),e.isAdmin&&(0,i.jsx)(ub,{disabled:!s,name:"campaign.campaignType",value:me.Sms,children:(0,i.jsxs)(Ba,{align:"center",gap:"2",children:[(0,i.jsx)(Ar,{children:"SMS"}),(0,i.jsx)(Ub,{}),!s&&(0,i.jsx)(Ar,{color:"gray500",css:{"& a":{color:"$primary500"}},dangerouslySetInnerHTML:{__html:t("contactez_nous_22980",P.EMAIL_FROM,P.EMAIL_FROM)},fontSize:"textXs"})]})})]}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(Ba,{children:(0,i.jsx)(zl,{onClick:e.formRenderProps.handleSubmit,children:e.isTemplate?t("suivant_conte_33443"):t("suivant_conte_90603")})})]})},Gb=e=>{const t=Xn(),{form:n,handleSubmit:s,values:o}=e.formRenderProps;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Nr.Yr,{name:"delivery",children:e=>{n.change("campaign.state","now"===e?he.Draft:he.Scheduled)}}),(0,i.jsx)(Ar,{color:"gray800",children:t("quand_voulez_vo_96615")}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(ub,{name:"delivery",value:"now",children:t("je_souahite_l_e_46027")}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(ub,{name:"delivery",value:"later",children:t("je_souhaite_pro_98854")}),"later"===o.delivery&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"2"}),(0,i.jsxs)(Ba,{gap:"4",children:[(0,i.jsx)(Hm,{min:Gs.c9.local(),name:"campaign.scheduledAtDate",placeholder:t("choisissez_la_d_30578")}),(0,i.jsx)(lb,{hint:t("le_fuseau_horai_57116",e.timeZone),name:"campaign.scheduledAtTime",placeholder:t("choisissez_l_he_55311")})]})]}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(Ba,{children:(0,i.jsx)(zl,{onClick:s,children:t("suivant_r_cap_22677")})})]})};var Hb;!function(e){e[e.POSITION_READ=0]="POSITION_READ",e[e.POSITION_EDIT=1]="POSITION_EDIT",e[e.MEMBER_EDIT=2]="MEMBER_EDIT",e[e.MEMBER_ASSIGNMENT_STATE_EDIT=3]="MEMBER_ASSIGNMENT_STATE_EDIT",e[e.COMMENT_READ=4]="COMMENT_READ",e[e.COMMENT_ADD=5]="COMMENT_ADD",e[e.MEMBER_AVAILABILITIES_EDIT=6]="MEMBER_AVAILABILITIES_EDIT",e[e.MEMBER_ASSIGN=7]="MEMBER_ASSIGN",e[e.CAMPAIGN_SEND=8]="CAMPAIGN_SEND",e[e.ACCREDITATION_READ=9]="ACCREDITATION_READ",e[e.ACCREDITATION_EDIT=10]="ACCREDITATION_EDIT",e[e.MEMBER_ACCREDIT=11]="MEMBER_ACCREDIT",e[e.DELEGATION_READ=12]="DELEGATION_READ",e[e.DELEGATION_EDIT=13]="DELEGATION_EDIT",e[e.FORM_READ=14]="FORM_READ",e[e.FORM_EDIT=15]="FORM_EDIT",e[e.EMAIL_EDIT=16]="EMAIL_EDIT",e[e.CAMPAIGN_READ=17]="CAMPAIGN_READ",e[e.DOCUMENT_READ=18]="DOCUMENT_READ",e[e.DOCUMENT_EDIT=19]="DOCUMENT_EDIT",e[e.WORKFLOW_READ=20]="WORKFLOW_READ",e[e.WORKFLOW_EDIT=21]="WORKFLOW_EDIT",e[e.CUSTOM_FIELD_READ=22]="CUSTOM_FIELD_READ",e[e.CUSTOM_FIELD_EDIT=23]="CUSTOM_FIELD_EDIT",e[e.SEGMENT_EDIT=24]="SEGMENT_EDIT",e[e.MEMBER_CREATE=25]="MEMBER_CREATE",e[e.MEMBER_DELETE=26]="MEMBER_DELETE",e[e.EVENT_EDIT=27]="EVENT_EDIT",e[e.ORGANIZATION_PARAM_READ=28]="ORGANIZATION_PARAM_READ",e[e.ORGANIZATION_PARAM_EDIT=29]="ORGANIZATION_PARAM_EDIT",e[e.ORGANIZATION_USER_READ=30]="ORGANIZATION_USER_READ",e[e.ORGANIZATION_USER_EDIT=31]="ORGANIZATION_USER_EDIT"}(Hb||(Hb={}));const qb=e=>{const{translate:t,params:{eventId:n}}=vl(),s=Zn(Jc),[o,r]=(0,L.useState)(!0),[a,l]=(0,L.useState)(!0),[d,c]=(0,L.useState)([]),[u,h]=(0,L.useState)([]),[m,g]=(0,L.useState)(!1),[p,f]=(0,L.useState)([]);return(0,L.useEffect)(()=>{(async()=>{if("accreditations"===e.recipients&&o){const e=await(t={eventId:n},i=await Y(),go("query CampaignEventAccreditationsRecipients($eventId: EventId!) {\n event(id: $eventId) {\n accreditationsCategories {\n id\n name\n }\n\n accreditations {\n nodes {\n id\n name\n accreditationCategoryName\n\n slots {\n id\n name\n date\n }\n }\n }\n }\n}\n",{variables:t,token:i||void 0,fragments:[]}));c((0,uc.A)(e.event.accreditationsCategories,e=>e.name)),h(Object.entries((0,cc.A)(e.event.accreditations.nodes,e=>e.accreditationCategoryName))),g(so(e.event.accreditations.nodes.flatMap(e=>e.slots))),f(e.event.accreditations.nodes.map(e=>{const t=e.slots.map(t=>{const n=t.date?s.toLocaleString(t.date,eo.DateOnly.MonthLong):"",i=t.date?`${t.name} - ${n} - ${e.name}`:`${t.name} - ${e.name}`;return{id:t.id,name:i}});return[e.name,t]})),r(!1),l(!1)}var t,i})()},[e.recipients,o]),e.recipients===xv.Accreditations?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(Ar,{css:{marginLeft:"$2"},children:a?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(lc,{borderRadius:"$1",height:40,width:1}),(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(lc,{borderRadius:"$1",height:40,width:1}),(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(lc,{borderRadius:"$1",height:40,width:1})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ym,{isSearchVisible:!0,multiple:!0,name:"campaign.accreditationsCategoriesIds",placeholder:t("ajouter_des_cat_17200"),children:d.map(({id:e,name:t})=>(0,i.jsx)("option",{value:e,children:t},e))}),(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(Ym,{isSearchVisible:!0,multiple:!0,name:"campaign.accreditationsIds",placeholder:t("ajouter_des_acc_26514"),children:u.map(([e,t],n)=>(0,i.jsx)("optgroup",{label:e,children:t.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},n))}),m&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(Ym,{isSearchVisible:!0,multiple:!0,name:"campaign.accreditationsSlotsIds",placeholder:t("ajouter_des_cr_25566"),children:p.map(([e,t],n)=>(0,i.jsx)("optgroup",{label:e,children:t.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},n))})]})]})})]}):null},Kb=e=>{const t=TI(),n=wb(),s=L.useMemo(()=>(t?.user?.roles.map(e=>e.type)||[]).concat(n?.userPermissions?.roles.map(e=>e.type)||[]),[t,n]);return L.useMemo(()=>!!s.includes(bt.OrganizationAdmin)||(so(e.rolesTypes)?so((0,fh.A)(s,e.rolesTypes)):"function"==typeof n?.hasPermissions&&so(io(e.permissions))?n.hasPermissions(io(e.permissions),e.scope).some(e=>e):!!so(io(e.permissions))&&t.hasPermissions(io(e.permissions)).some(e=>e)),[e.permissions,e.rolesTypes,e.scope,s,n])?(0,i.jsx)(i.Fragment,{children:e.children}):null},Yb=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=vl(),o=Zn(ph),{isEventAdmin:r}=wb(),[a,l]=(0,L.useState)(!0),[d,c]=(0,L.useState)(!0),[u,h]=(0,L.useState)([]),[g,p]=(0,L.useState)([]),[f,_]=(0,L.useState)([]),[x,I]=(0,L.useState)([]);return(0,L.useEffect)(()=>{(async()=>{if("positions"===e.recipients&&a){const e=await(t={organizationId:n,eventId:s},i=await Y(),go("query CampaignEventPositionsRecipients($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n tags {\n nodes {\n id\n name\n }\n }\n }\n\n event(id: $eventId) {\n positionsCategories {\n id\n name\n }\n\n positions {\n nodes {\n id\n name\n positionCategoryName\n\n slots {\n id\n name\n range\n }\n }\n }\n }\n}\n",{variables:t,token:i||void 0,fragments:[]}));h((0,uc.A)(e.event.positionsCategories,e=>e.name)),p(Object.entries((0,cc.A)(e.event.positions.nodes,e=>e.positionCategoryName))),_(e.event.positions.nodes.map(e=>{const t=e.slots.map(t=>{const n=m(t.name)?`${t.name} - `:"",i=o.toDisplayString(t.range,{formats:{displayWeekday:!0}});return{id:t.id,name:`${n}${i} - ${e.name}`}});return[e.name,t]})),I(e.organization.tags.nodes),l(!1),c(!1)}var t,i})()},[e.recipients,a]),e.recipients===xv.Positions?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(Ar,{css:{marginLeft:"$6"},children:d?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(lc,{borderRadius:"$1",height:40,width:1}),(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(lc,{borderRadius:"$1",height:40,width:1}),(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(lc,{borderRadius:"$1",height:40,width:1}),(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(lc,{borderRadius:"$1",height:40,width:1})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Kb,{permissions:Hb.CAMPAIGN_SEND,scope:{positionCategoryId:"ANY"},children:[(0,i.jsx)(Ym,{isSearchVisible:!0,multiple:!0,name:"campaign.positionsCategoriesIds",placeholder:t("ajouter_des_cat_15537"),children:u.map(({id:e,name:t})=>(0,i.jsx)("option",{value:e,children:t},e))}),(0,i.jsx)(Ya,{height:"2"})]}),(0,i.jsx)(Ym,{isSearchVisible:!0,multiple:!0,name:"campaign.positionsIds",placeholder:t("ajouter_des_mis_44522"),children:g.map(([e,t],n)=>(0,i.jsx)("optgroup",{label:e,children:t.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},n))}),(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(Ym,{isSearchVisible:!0,multiple:!0,name:"campaign.positionsSlotsIds",placeholder:t("ajouter_des_cr_25566"),children:f.map(([e,t],n)=>(0,i.jsx)("optgroup",{label:e,children:t.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},n))}),r&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(Ym,{isSearchVisible:!0,multiple:!0,name:"campaign.tagsIds",placeholder:t("ajouter_des_tag_57392"),children:x.map(({id:e,name:t})=>(0,i.jsx)("option",{value:e,children:t},e))})]})]})})]}):null},Zb=e=>{const{translate:t,params:{eventId:n}}=vl(),[s,o]=(0,L.useState)(!0),[r,a]=(0,L.useState)(!0),[l,d]=(0,L.useState)([]);return(0,L.useEffect)(()=>{(async()=>{if("segments"===e.recipients&&s){const e=await(t={eventId:n},i=await Y(),go("query CampaignEventSegmentsRecipients($eventId: EventId!) {\n event(id: $eventId) {\n segmentsFolders(segmentType: Volunteers) {\n id\n name\n\n segments {\n id\n name\n }\n }\n }\n}\n",{variables:t,token:i||void 0,fragments:[]}));d(e.event.segmentsFolders),o(!1),a(!1)}var t,i})()},[e.recipients,s]),"segments"===e.recipients?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(Ar,{css:{marginLeft:"$6"},children:r?(0,i.jsx)(lc,{borderRadius:"$1",height:40,width:1}):(0,i.jsx)(Ym,{isSearchVisible:!0,multiple:!0,name:"campaign.segmentsIds",placeholder:t("ajouter_des_vue_58990"),children:l.map(e=>(0,i.jsx)("optgroup",{label:e.name,children:e.segments.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},e.id))})})]}):null};function Xb({eventId:e,hasSelected:t,includePhone:n,nameDebounced:s,organizationId:o,populationsIds:r,reloadKey:a,userInfoIds:l}){const[d,c]=L.useState(!1),[u,h]=L.useState(null),g=L.useMemo(()=>(0,uc.A)((0,xh.A)((u?.usersInfos.nodes??[]).concat(u?.selectedUsersInfos?.nodes??[]),e=>e.id),e=>e.name.toLowerCase()),[u]),p=L.useMemo(()=>g.map(e=>(0,i.jsxs)("option",{value:e.id,children:[m(e.name)?e.name:"-"," (",n?e.phone?.internationalFormat||"-":e.email,")"]},e.id)),[g]);return L.useEffect(()=>{(async()=>{c(!0);const{organization:i}=await(a={organizationId:o,eventId:e,hasSelected:t,includePhone:n||!1,userInfoIds:l,name:m(s)?s:void 0,populationsIds:r},d=await Y(),go('query UsersSearch(\n $organizationId: OrganizationId!\n $eventId: EventId\n $hasSelected: Boolean!\n $userInfoIds: [UsersInfoId!]!\n $populationsIds: [BigInt!]\n $name: String\n $includePhone: Boolean!\n) {\n organization(id: $organizationId) {\n usersInfos(\n eventId: $eventId\n name: $name\n populationsIds: $populationsIds\n limit: 50\n sort: { attribute: "Name", direction: Asc }\n ) {\n nodes {\n id\n email\n name\n phone: fieldValue(slug: "phone") @include(if: $includePhone)\n }\n }\n\n selectedUsersInfos: usersInfos(ids: $userInfoIds) @include(if: $hasSelected) {\n nodes {\n id\n email\n name\n phone: fieldValue(slug: "phone") @include(if: $includePhone)\n }\n }\n }\n}\n',{variables:a,token:d||void 0,fragments:[]}));var a,d;h(i),c(!1)})()},[o,e,n,s,r,a]),{usersInfos:g,usersInfosOptions:p,isLoading:d}}const Jb=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=vl(),[o,r,a]=Wc(""),{usersInfosOptions:l,isLoading:d}=Xb({organizationId:n,eventId:s,includePhone:e.campaignType===me.Sms,hasSelected:so(e.usersInfosIds),nameDebounced:r,userInfoIds:e.usersInfosIds});return"users"===e.recipients?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(Ar,{css:{marginLeft:"$6"},children:(0,i.jsx)(Ym,{isSearchLoading:d,isSearchVisible:!0,multiple:!0,name:"campaign.usersInfosIds",placeholder:t("ajouter_des_mem_58427"),searchElement:(0,i.jsx)(Bl,{icon:"magnifying-glass",name:o,placeholder:t("rechercher_un_m_05904"),state:"search",onChange:a}),children:l})})]}):null},Qb=e=>{const t=Xn(),{event:n,isEventAdmin:s,hasPermission:o}=wb(),{form:r,handleSubmit:a,values:l}=e.formRenderProps,d=n.usePositions,c=n.useAccreditations&&s;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Nr.Yr,{name:"recipients",children:e=>{if("everyone"===e)r.change("campaign.sendToEveryone",!0),r.change("campaign.states",[]),r.change("campaign.positionsCategoriesIds",[]),r.change("campaign.positionsIds",[]),r.change("campaign.positionsSlotsIds",[]),r.change("campaign.accreditationsCategoriesIds",[]),r.change("campaign.accreditationsIds",[]),r.change("campaign.accreditationsSlotsIds",[]),r.change("campaign.tagsIds",[]),r.change("campaign.usersInfosIds",[]),r.change("campaign.segmentsIds",[]);else if("states"===e)r.change("campaign.sendToEveryone",!1),r.change("campaign.positionsCategoriesIds",[]),r.change("campaign.positionsIds",[]),r.change("campaign.positionsSlotsIds",[]),r.change("campaign.accreditationsCategoriesIds",[]),r.change("campaign.accreditationsIds",[]),r.change("campaign.accreditationsSlotsIds",[]),r.change("campaign.tagsIds",[]),r.change("campaign.usersInfosIds",[]),r.change("campaign.segmentsIds",[]);else if("positions"===e)r.change("campaign.sendToEveryone",!1),r.change("campaign.states",[]),r.change("campaign.accreditationsCategoriesIds",[]),r.change("campaign.accreditationsIds",[]),r.change("campaign.accreditationsSlotsIds",[]),r.change("campaign.usersInfosIds",[]),r.change("campaign.segmentsIds",[]);else if("accreditations"===e)r.change("campaign.sendToEveryone",!1),r.change("campaign.states",[]),r.change("campaign.positionsCategoriesIds",[]),r.change("campaign.positionsIds",[]),r.change("campaign.positionsSlotsIds",[]),r.change("campaign.usersInfosIds",[]),r.change("campaign.segmentsIds",[]);else if("users"===e)r.change("campaign.sendToEveryone",!1),r.change("campaign.states",[]),r.change("campaign.positionsCategoriesIds",[]),r.change("campaign.positionsIds",[]),r.change("campaign.positionsSlotsIds",[]),r.change("campaign.accreditationsCategoriesIds",[]),r.change("campaign.accreditationsIds",[]),r.change("campaign.accreditationsSlotsIds",[]),r.change("campaign.tagsIds",[]),r.change("campaign.segmentsIds",[]);else{if("segments"!==e)throw new Error(`Recipients ${e} is not possible`);r.change("campaign.sendToEveryone",!1),r.change("campaign.states",[]),r.change("campaign.positionsCategoriesIds",[]),r.change("campaign.positionsIds",[]),r.change("campaign.positionsSlotsIds",[]),r.change("campaign.accreditationsCategoriesIds",[]),r.change("campaign.accreditationsIds",[]),r.change("campaign.accreditationsSlotsIds",[]),r.change("campaign.tagsIds",[]),r.change("campaign.usersInfosIds",[])}}}),(0,i.jsx)(Nr.Yr,{name:"campaign.sendToEveryone",children:e=>{e&&(r.change("campaign.states",[]),r.change("campaign.positionsCategoriesIds",[]),r.change("campaign.positionsIds",[]),r.change("campaign.positionsSlotsIds",[]),r.change("campaign.tagsIds",[]),r.change("campaign.accreditationsCategoriesIds",[]),r.change("campaign.accreditationsIds",[]),r.change("campaign.accreditationsSlotsIds",[]),r.change("campaign.usersInfosIds",[]))}}),(0,i.jsx)(Nr.Yr,{name:"campaign.positionsCategoriesIds",children:()=>{l.campaign.sendToEveryone&&l.campaign.positionsCategoriesIds.length>0&&r.change("campaign.positionsCategoriesIds",[])}}),(0,i.jsx)(Nr.Yr,{name:"campaign.positionsIds",children:()=>{l.campaign.sendToEveryone&&l.campaign.positionsIds.length>0&&r.change("campaign.positionsIds",[])}}),(0,i.jsx)(Nr.Yr,{name:"campaign.positionsSlotsIds",children:()=>{l.campaign.sendToEveryone&&l.campaign.positionsSlotsIds.length>0&&r.change("campaign.positionsSlotsIds",[])}}),(0,i.jsx)(Nr.Yr,{name:"campaign.tagsIds",children:()=>{l.campaign.sendToEveryone&&l.campaign.tagsIds.length>0&&r.change("campaign.tagsIds",[])}}),(0,i.jsx)(Nr.Yr,{name:"campaign.usersInfosIds",children:()=>{l.campaign.sendToEveryone&&l.campaign.usersInfosIds.length>0&&r.change("campaign.usersInfosIds",[])}}),(0,i.jsx)(Nr.Yr,{name:"campaign.segmentsIds",children:()=>{l.campaign.sendToEveryone&&l.campaign.segmentsIds.length>0&&r.change("campaign.segmentsIds",[])}}),(0,i.jsx)(Ar,{color:"gray800",children:t("_qui_voulez_vo_96064")}),(0,i.jsx)(Ya,{height:"3"}),s&&d&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ub,{name:"recipients",value:"everyone",children:t("_tous_vos_memb_31761")}),(0,i.jsx)(Ya,{height:"3"})]}),s&&d&&(0,i.jsx)(ub,{name:"recipients",value:"states",children:t("_certains_memb_35722")}),"states"===l.recipients&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(Ar,{css:{marginLeft:"$6"},children:(0,i.jsx)(Ym,{isSearchVisible:!0,multiple:!0,name:"campaign.states",placeholder:t("ajouter_des_sta_70922"),children:Mn.map(e=>(0,i.jsx)("option",{value:e,children:t(e)},e))})})]}),d&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(ub,{name:"recipients",value:"positions",children:s?t("_certaines_cat_59188"):o(Hb.CAMPAIGN_SEND,{positionCategoryId:"ANY"})?t("_certaines_cat_22161"):t("_certaines_mis_80674")})]}),(0,i.jsx)(Yb,{recipients:l.recipients}),(0,i.jsx)(Ya,{height:"3"}),c&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ub,{name:"recipients",value:"accreditations",children:t("_certaines_cat_14293")}),(0,i.jsx)(qb,{recipients:l.recipients}),(0,i.jsx)(Ya,{height:"3"})]}),(0,i.jsx)(ub,{name:"recipients",value:"users",children:t("_certains_memb_91094")}),(0,i.jsx)(Jb,{campaignType:e.formRenderProps.values.campaign.campaignType,recipients:l.recipients,usersInfosIds:e.formRenderProps.values.campaign.usersInfosIds}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(ub,{name:"recipients",value:"segments",children:t("_certaines_vue_55512")}),(0,i.jsx)(Zb,{recipients:l.recipients}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(Ba,{children:(0,i.jsx)(zl,{onClick:a,children:t("suivant_livra_97068")})})]})},ej=e=>{const{translate:t,params:{organizationId:n}}=vl(),[s,o]=(0,L.useState)(!0),[r,a]=(0,L.useState)(!0),[l,d]=(0,L.useState)([]);return(0,L.useEffect)(()=>{(async()=>{if("segments"===e.recipients&&s){const e=await(t={organizationId:n},i=await Y(),go("query CampaignOrganizationSegmentsRecipients($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n segmentsFolders(level: Organization, segmentType: Volunteers) {\n id\n name\n\n segments {\n id\n name\n }\n }\n }\n}\n",{variables:t,token:i||void 0,fragments:[]}));d(e.organization.segmentsFolders),o(!1),a(!1)}var t,i})()},[e.recipients,s]),"segments"===e.recipients?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(Ar,{css:{marginLeft:"$6"},children:r?(0,i.jsx)(lc,{borderRadius:"$1",height:40,width:1}):(0,i.jsx)(Ym,{isSearchVisible:!0,multiple:!0,name:"campaign.segmentsIds",placeholder:t("ajouter_des_vue_58990"),children:l.map(e=>(0,i.jsx)("optgroup",{label:e.name,children:e.segments.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},e.id))})})]}):null},tj=e=>{const t=Xn(),{form:n,handleSubmit:s,values:o}=e.formRenderProps;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Nr.Yr,{name:"recipients",children:e=>{if("everyone"===e)n.change("campaign.sendToEveryone",!0),n.change("campaign.usersInfosIds",[]),n.change("campaign.segmentsIds",[]);else if("users"===e)n.change("campaign.sendToEveryone",!1),n.change("campaign.segmentsIds",[]);else{if("segments"!==e)throw new Error(`Recipients ${e} is not possible`);n.change("campaign.sendToEveryone",!1),n.change("campaign.usersInfosIds",[])}}}),(0,i.jsx)(Nr.Yr,{name:"campaign.sendToEveryone",children:e=>{e&&(n.change("campaign.segmentsIds",[]),n.change("campaign.usersInfosIds",[]))}}),(0,i.jsx)(Nr.Yr,{name:"campaign.usersInfosIds",children:()=>{o.campaign.sendToEveryone&&o.campaign.usersInfosIds.length>0&&n.change("campaign.usersInfosIds",[])}}),(0,i.jsx)(Nr.Yr,{name:"campaign.segmentsIds",children:()=>{o.campaign.sendToEveryone&&o.campaign.segmentsIds.length>0&&n.change("campaign.segmentsIds",[])}}),(0,i.jsx)(ub,{name:"recipients",value:"everyone",children:t("_tous_vos_memb_83616")}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(ub,{name:"recipients",value:"users",children:t("_certains_memb_91094")}),(0,i.jsx)(Jb,{campaignType:e.formRenderProps.values.campaign.campaignType,recipients:o.recipients,usersInfosIds:e.formRenderProps.values.campaign.usersInfosIds}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(ub,{name:"recipients",value:"segments",children:t("_certaines_vue_55512")}),(0,i.jsx)(ej,{recipients:o.recipients}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(Ba,{children:(0,i.jsx)(zl,{onClick:s,children:t("suivant_livra_97068")})})]})},nj=e=>{const t=Xn(),{organizationId:n,eventId:s}=ti(),[o,r]=(0,L.useState)(null),{mutate:a}=function(e={}){return ei("mutation CampaignEstimate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $campaign: CampaignInput!\n) {\n campaignEstimate(organizationId: $organizationId, eventId: $eventId, campaign: $campaign) {\n numberOfRecipients\n price\n }\n}\n",e)}(),{form:l,handleSubmit:d,submitting:c,values:u}=e.formRenderProps,h=(0,L.useMemo)(()=>{if(e.formRenderProps.values.campaign.campaignType===me.Email){const t=e.emailsSenders.find(t=>t.id===e.formRenderProps.values.campaign.emailSenderId);return t&&!t.isValidToSendEmail}return!1},[e.emailsSenders,e.formRenderProps.values.campaign.emailSenderId]);return(0,L.useEffect)(()=>{a({organizationId:n,eventId:s,campaign:e.formRenderProps.values.campaign}).then(e=>{r(e.campaignEstimate)})},[]),o?(0,i.jsxs)(i.Fragment,{children:[h&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(rl,{color:"error",leftIcon:"circle-exclamation",children:t("vous_ne_pouvez_33410")}),(0,i.jsx)(Ya,{height:"4"})]}),(0,i.jsxs)(Ba,{gap:"1",children:[(0,i.jsx)(Ar,{color:"gray800",fontWeight:"medium",children:t("nombre_de_desti_22505")}),(0,i.jsx)(Ar,{color:"gray800",children:t("_1_membre_49737",o.numberOfRecipients)})]}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsxs)(Ba,{gap:"1",children:[(0,i.jsx)(Ar,{color:"gray800",fontWeight:"medium",children:t("prix_total_03054")}),(0,i.jsx)(Ar,{color:"gray800",children:0===o.price?t("gratuit_13712"):`${o.price}€`})]}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsxs)(Ba,{gap:"4",children:[(0,i.jsx)(zl,{disabled:h,isLoading:c,onClick:()=>{u.campaign.state!==he.Scheduled&&l.change("campaign.state",he.InProgress),d()},children:u.campaign.state===he.Scheduled?t("programmer_la_c_01938"):e.isEdit?t("mettre_jour_l_63945"):t("cr_er_et_envoye_81501")}),(0,i.jsx)(zl,{color:"white",isLoading:c,onClick:()=>{l.change("campaign.state",he.Draft),d()},children:t("enregistrer_en_81222")})]})]}):(0,i.jsx)(wl,{})},ij=e=>{const{history:t,params:{organizationId:n,eventId:s},translate:o}=vl(),{showNotification:r}=Ob(),a=Zn(Iv),l=e.initialValues.campaign.state===he.Template,d=(0,L.useMemo)(()=>e.isEdit?o("mise_jour_de_17055",e.initialValues.campaign.name):o(l?"cr_ation_d_un_m_50096":"cr_ation_d_une_80936"),[e.isEdit,e.initialValues]);Md(d);const c=[he.Done,he.InProgress].includes(e.initialValues.campaign.state),u=$I.CAMPAIGNS({organizationId:n,eventId:s});return(0,i.jsx)(Lm,{category:d,fallbackClosePath:u,heading:e.isEdit?e.initialValues.campaign.name:o(l?"nouveau_mod_le_74336":"nouvelle_campag_28814"),children:(0,i.jsx)(Mm,{children:(0,i.jsxs)(vb,{initialValues:e.initialValues,isEdit:e.isEdit,onSubmit:async n=>{await e.mutate(n.campaign),r(e.isEdit?o("la_campagne_a_50262"):o("la_campagne_a_02968")),t.goBack(u)},children:[(0,i.jsx)(Ib,{heading:o(l?"initialisation_84842":"initialisation_48904"),render:t=>(0,i.jsx)(Wb,{formRenderProps:t,isAdmin:e.isAdmin,isSent:c,isTemplate:l}),schema:a.campaignStep1Schema()}),(0,i.jsx)(Ib,{heading:o("contenu_29668"),render:t=>(0,i.jsx)(mb,{canCustomDocuments:e.canCustomDocuments,customDocuments:e.customDocuments,emailSenderId:e.emailSenderId,emailsSenders:e.emailsSenders,formRenderProps:t,isEdit:e.isEdit,isSent:c,isTemplate:l}),schema:a.campaignStep2Schema()}),!l&&!c&&(0,i.jsx)(Ib,{heading:o("destinataires_19592"),render:t=>"event"===e.campaignType?(0,i.jsx)(Qb,{formRenderProps:t}):(0,i.jsx)(tj,{formRenderProps:t}),schema:a.campaignStep3Schema()}),!l&&!c&&(0,i.jsx)(Ib,{heading:o("livraison_86944"),render:t=>(0,i.jsx)(Gb,{formRenderProps:t,timeZone:e.timeZone}),schema:a.campaignStep4Schema()}),!l&&!c&&(0,i.jsx)(Ib,{heading:o("r_capitulatif_a_79107"),render:t=>(0,i.jsx)(nj,{emailsSenders:e.emailsSenders,formRenderProps:t,isEdit:e.isEdit}),schema:a.createUpdateCampaignSchema()})]})})})},sj=e=>{const{organizationId:t,eventId:n,options:s}=ti(),o=Zn(Iv),{data:r,loader:a}=wo({organizationId:t,eventId:n}),{mutate:l}=ko(),{event:d}=wb();return a||(0,i.jsx)(ij,{campaignType:n?"event":"organization",canCustomDocuments:d?.useDocuments??!1,customDocuments:r.organization?.event?.customDocuments??[],emailSenderId:r.organization?.event?.emailSender?.id??r.organization.emailSenderId,emailsSenders:r.organization.emailsSenders,initialValues:o.createUpdateCampaignValuesDefault(e.isTemplate,r.organization.emailSenderId,null,s),isAdmin:!0,isEdit:!1,mutate:async e=>{const{campaignCreate:{id:i}}=await l({organizationId:t,eventId:n,campaign:e});return i},timeZone:r.organization?.event?.timeZone??r.organization.timeZone})},oj=()=>{const{organizationId:e,eventId:t,campaignId:n}=ti(),{data:s,loader:o}=Qn("query CampaignToEdit(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $campaignId: CampaignId!\n) {\n organization(id: $organizationId) {\n emailsSenders(isValidToSendEmail: true) {\n ...CreateCampaignEmailSender\n }\n }\n\n event(id: $eventId) {\n timeZone\n\n campaign(id: $campaignId) {\n ...CampaignEdit\n }\n\n customDocuments {\n slug\n name\n }\n\n emailSender {\n ... on EmailsSender {\n id\n }\n }\n }\n}\n",{organizationId:e,eventId:t,campaignId:n},[Vs.CreateCampaignEmailSenderFragment,Vs.CampaignEditFragment]),r=Zn(Iv),{mutate:a}=Ao(),{event:l,isEventAdmin:d}=wb();return o||(0,i.jsx)(ij,{campaignType:"event",canCustomDocuments:l.useDocuments,customDocuments:s.event.customDocuments,emailSenderId:s.event.emailSender?.id,emailsSenders:s.organization.emailsSenders,initialValues:r.createUpdateCampaignValuesDefault(!1,s.event.emailSender?.id,s.event.campaign,null),isAdmin:d,isEdit:!0,mutate:async i=>{const{campaignUpdate:{id:s}}=await a({organizationId:e,eventId:t,campaignId:n,campaign:i});return s},timeZone:s.event.timeZone})},rj=()=>{const{organizationId:e,campaignId:t}=ti(),{data:n,loader:s}=Qn("query CampaignOrganizationToEdit($organizationId: OrganizationId!, $campaignId: CampaignId!) {\n organization(id: $organizationId) {\n adminEmail\n emailSenderId\n timeZone\n\n campaign(id: $campaignId) {\n ...CampaignEdit\n }\n\n emailsSenders(isValidToSendEmail: true) {\n ...CreateCampaignEmailSender\n }\n }\n}\n",{organizationId:e,campaignId:t},[Vs.CampaignEditFragment,Vs.CreateCampaignEmailSenderFragment]),o=Zn(Iv),{mutate:r}=Ao();return s||(0,i.jsx)(ij,{campaignType:"organization",canCustomDocuments:!1,customDocuments:[],emailSenderId:n.organization.emailSenderId,emailsSenders:n.organization.emailsSenders,initialValues:o.createUpdateCampaignValuesDefault(!1,n.organization.emailSenderId,n.organization.campaign,null),isAdmin:!0,isEdit:!0,mutate:async n=>{const{campaignUpdate:{id:i}}=await r({organizationId:e,campaignId:t,campaign:n});return i},timeZone:n.organization.timeZone})},aj=e=>(0,i.jsx)(Ba,{...Na(e),css:{background:"$gray50",flex:"1",padding:"$7",...e.css},direction:"column",children:e.children}),lj=e=>(0,i.jsx)(Ba,{as:Ma.Header,...Na(e),css:{background:"white",borderBottom:e.hideBorder?"":"1px solid $gray200",padding:"$6 $7","& :is(h1, h2, h3, h4, h5, h6)":{fontSize:"$displayXs",lineHeight:"32px"},...e.css},children:e.children}),dj=e=>(0,i.jsx)(Ba,{css:e.css,direction:"column",height:1,width:1,children:e.children}),cj=e=>{const t=ii().pathname.includes(e.basePath||e.path);return(0,i.jsxs)(i.Fragment,{children:[e.disabled?(0,i.jsxs)(km,{children:[(0,i.jsx)(Sm,{children:(0,i.jsx)(Ar,{color:"gray500",css:{borderBottom:"unset",paddingBlock:"$3"},children:e.children})}),(0,i.jsx)(wm,{placement:"top",children:e.disabledMessage})]}):(0,i.jsx)(el,{replace:!0,to:e.path,children:(0,i.jsx)(Ar,{color:t?"primary500":"gray500",css:{borderBottom:t?"2px solid $primary500":"unset",cursor:t?"inherit":"pointer",paddingBlock:"$3","&:hover":{color:t?"$primary800":"$gray800"}},children:e.children})}),(0,i.jsx)(Ar,{width:24})]})},uj=e=>(0,i.jsxs)(Ba,{"aria-orientation":"horizontal",as:Ma.Nav,css:{borderBottom:"1px solid $gray200",...e.css},width:1,children:[e.center&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Ar,{css:{flex:"1"}})}),e.children,(0,i.jsx)(Ar,{css:{flex:"1"}})]}),hj=e=>(0,i.jsx)(i.Fragment,{children:e.children});hj.displayName="TabPanel";const mj=e=>{const[t,n]=(0,oh.A)(L.Children.toArray(e.children),e=>L.isValidElement(e)&&e.type===hj);return(0,i.jsxs)(Ba,{direction:"column",width:1,...Na(e),children:[n,(0,i.jsx)(Sr.dO,{children:t.map((e,t)=>(0,i.jsx)(Sr.qh,{path:e.props.path,children:e},t))})]})},gj=L.createContext({}),pj=e=>(0,i.jsx)(gj.Provider,{value:{...e},children:e.children}),fj=e=>(0,i.jsxs)(Ar,{css:{background:"white",bd:!0,padding:"$6",width:"100%"},children:[(0,i.jsx)(Ar,{color:"gray500",fontWeight:"medium",children:e.title}),(0,i.jsx)(Ar,{color:"gray900",fontSize:"displayMd",fontWeight:"semiBold",children:e.content})]}),_j=_r(Ba,{gap:"$3",variants:{avatarOnTop:{true:{flexDirection:"column",gap:"$2"},false:{alignItems:"center",flexDirection:"row"}}}}),xj=e=>{const{params:{organizationId:t,eventId:n}}=vl(),s=L.useMemo(()=>m(e.userInfo.name)?e.userInfo.name:"-",[e.userInfo.name]),o=()=>(0,i.jsx)(Ar,{color:e.disabled?"gray300":"gray800",css:{ellipsis:""},disabled:e.disabled,fontWeight:"medium",title:s,children:s});return(0,i.jsxs)(_j,{avatarOnTop:{"@initial":!!e.badge,"@tablet":!1},width:1,children:[(0,i.jsx)(sp,{email:e.userInfo.email,image:e.userInfo.picture?.url,name:e.userInfo.name,size:e.size||40}),(0,i.jsxs)(Ba,{css:{flex:"1",overflow:"hidden"},direction:"column",justify:"center",children:[(0,i.jsxs)(Ba,{align:"center",gap:"2",children:[e.isClickDisabled?o():(0,i.jsx)(Zc,{to:QI.MEMBER_INFORMATION({organizationId:t,eventId:n,userInfoId:e.userInfo.id}),children:o()}),(0,i.jsx)(Ar,{css:{flexShrink:0},children:e.badge})]}),(0,i.jsx)(Ar,{color:e.disabled?"gray300":"gray500",css:{ellipsis:""},fontSize:"textSm",title:e.userInfo.email,children:e.areContactLinksEnabled?(0,i.jsx)(Zc,{css:{fontWeight:"normal"},to:`mailto:${e.userInfo.email}`,children:e.userInfo.email}):(0,i.jsx)(i.Fragment,{children:e.userInfo.email})}),e.showPhoneNumber&&(0,i.jsx)(Ar,{color:e.disabled?"gray300":"gray500",css:{ellipsis:""},fontSize:"textSm",title:e.userInfo.phone?.internationalFormat,children:e.areContactLinksEnabled?(0,i.jsx)(Zc,{css:{fontWeight:"normal"},to:`tel:${e.userInfo.phone?.internationalFormat}`,children:e.userInfo.phone?.internationalFormat}):(0,i.jsx)(i.Fragment,{children:e.userInfo.phone?.internationalFormat})})]})]})};function Ij(e){switch(e){case Oe.Waiting:case Oe.Queued:return{color:"warning",leftIcon:"hourglass-empty"};case Oe.Bounced:return{color:"error",leftIcon:"circle-exclamation"};default:return{color:"success",leftIcon:"check"}}}const vj=e=>{const{translate:t,params:{organizationId:n,eventId:s,campaignId:o}}=vl(),r=Zn(Jc),{mutate:a}=lr(),{mutate:l}=Yo();return(0,i.jsxs)(Mc,{children:[(0,i.jsx)(Oc,{children:(0,i.jsx)(xj,{userInfo:e.email.userInfo})}),(0,i.jsx)(Oc,{children:e.email.sentAt?r.toLocaleString(e.email.sentAt.toLocal(),eo.DateTime):""}),(0,i.jsxs)(Oc,{align:"start",direction:"column",gap:"1",justify:"center",children:[(0,i.jsx)(rc,{...Ij(e.email.state),children:t(e.email.state)}),e.email.state===Oe.Bounced&&m(e.email.infos?.bounceDiagnosticCode)&&(0,i.jsx)(Ar,{css:{ellipsis:!0},title:e.email.infos.bounceDiagnosticCode,width:1,children:e.email.infos.bounceDiagnosticCode})]}),(0,i.jsx)(Xc,{justify:"end",children:(0,i.jsx)(Yc,{children:(0,i.jsx)(Kd,{icon:"paper-plane",onClick:async()=>{e.emailType?await l({organizationId:n,eventId:s,userInfoId:e.email.userInfo.id,emailType:e.emailType}):await a({organizationId:n,eventId:s,campaignId:o,selecteds:{ids:[e.email.userInfo.id]}}),e.reload()},children:t("r_envoyer_90741")})})})]})},bj=e=>{const{params:{organizationId:t,campaignId:n},translate:s}=vl(),[o,r,a]=Wc(""),[l,d]=(0,L.useState)(""),[c,u]=(0,L.useState)(0),{data:h,isLoading:g,reload:p}=Qn("query CampaignEmails(\n $organizationId: OrganizationId!\n $campaignId: CampaignId!\n $name: String\n $state: EmailState\n $offset: Int\n) {\n organization(id: $organizationId) {\n campaign(id: $campaignId) {\n emails(name: $name, state: $state, limit: 25, offset: $offset) {\n nodes {\n ...EmailRecipient\n }\n\n numberOfPages\n totalCount\n }\n }\n }\n}\n",{organizationId:t,campaignId:n,name:m(r)?r:void 0,state:""!==l?l:void 0,offset:c},[Vs.EmailRecipientFragment]);const f=Bc();return(0,i.jsxs)(aj,{direction:"column",gap:"7",children:[(0,i.jsxs)(Ba,{gap:"6",children:[(0,i.jsx)(fj,{content:e.campaign.numberOfRecipients,title:s("nombre_de_desti_21374")}),(0,i.jsx)(fj,{content:e.campaign.numberOfOpen??0,title:s("nombre_d_ouvert_84187")}),(0,i.jsx)(fj,{content:e.campaign.numberOfClick??0,title:s("nombre_de_clics_64232")})]}),(0,i.jsx)(Lc,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ar,{width:200,children:(0,i.jsxs)($u,{value:l,onChange:e=>{d(e),u(0)},children:[(0,i.jsx)("option",{value:"",children:s("tous_les_status_67644")}),f(cn.filter(e=>e!==Oe.Queued))]})}),(0,i.jsx)(Ar,{width:320,children:(0,i.jsx)(Bl,{icon:"magnifying-glass",placeholder:s("rechercher_un_d_02329"),value:o,onChange:e=>{a(e),u(0)}})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Gc,{children:s("nom_du_membre_69353")}),(0,i.jsx)(Gc,{children:s("date_d_envoi_74668")}),(0,i.jsx)(Gc,{children:s("status_06428")}),(0,i.jsx)(Gc,{width:100})]}),numberOfPages:h.organization?.campaign.emails.numberOfPages??0,offset:c,rows:g?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Hc,{bx:!0}),(0,i.jsx)(Hc,{bx:!0}),(0,i.jsx)(Hc,{bx:!0})]}):(0,i.jsx)(i.Fragment,{children:h.organization.campaign.emails.nodes.map((e,t)=>(0,i.jsx)(vj,{email:e,emailType:null,reload:p},t))}),setOffset:u,title:s("liste_des_desti_16448"),totalCount:h.organization?.campaign.emails.totalCount??0})]})},jj=e=>{const{history:t,translate:n,params:{organizationId:s,eventId:o,userInfoId:r}}=vl(),[a,l,d]=Wc(""),{usersInfosOptions:c,isLoading:u}=Xb({organizationId:s,eventId:o,hasSelected:!0,nameDebounced:l,userInfoIds:[r],populationsIds:e.populationsIds});return(0,i.jsxs)(Ba,{align:"center",css:{background:"$gray100",border:"1px solid $gray200",borderBottom:"none",padding:"$3 $7",...e.css},gap:"4",children:[(0,i.jsx)(Ar,{font:"gray900 textMd semiBold",children:n("aper_u_pour_le_81451")}),(0,i.jsx)(Ar,{width:320,children:(0,i.jsx)(yc,{isSearchLoading:u,isSearchVisible:!0,searchElement:(0,i.jsx)(Bl,{icon:"magnifying-glass",name:a,placeholder:n("rechercher_un_m_05904"),state:"search",onChange:d}),values:[r],onChange:n=>{so(n)&&t.replace(e.getPath(n[0]))},children:c})}),m(e.downloadPath)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ar,{css:{flex:"1"}}),(0,i.jsx)(Ar,{children:(0,i.jsx)(zl,{color:"white",to:e.downloadPath,children:n("t_l_charger_03283")})})]})]})};function Cj(e){switch(e){case Pt.Assigned:return{color:"success",leftIcon:"check"};case Pt.Refused:return{color:"error",leftIcon:"xmark"};case Pt.PreAssigned:return{color:"pink",leftIcon:"wand-magic-sparkles"};case Pt.WaitingAssignment:return{color:"warning",leftIcon:"hourglass-empty"};case Pt.NotApplicable:return{color:"gray",leftIcon:"infinity"};default:return ll()}}function yj(e){switch(e){case le.Accredited:return{color:"success",leftIcon:"check"};case le.AutoAccredited:return{color:"success",leftIcon:"bolt-auto"};case le.Refused:return{color:"error",leftIcon:"xmark"};case le.WaitingAccreditation:return{color:"warning",leftIcon:"hourglass-empty"};case le.NotApplicable:return{color:"gray",leftIcon:"infinity"};default:return ll()}}const kj=e=>{const{history:t,translate:n,params:{organizationId:s,eventId:o}}=vl(),{getVolunteersSegmentPath:r}=L.useContext(gj),a=(0,L.useMemo)(()=>e.campaign.positionsCategories.map(e=>({id:`pc-${e.id}`,name:e.name,link:xs.POSITION_CATEGORY({organizationId:s,eventId:o,positionCategoryId:e.id})})).concat(e.campaign.positions.map(e=>({id:`p-${e.id}`,name:e.name,link:xs.POSITION({organizationId:s,eventId:o,positionId:e.id})}))).concat(e.campaign.positionsSlots.map(e=>({id:`ps-${e.id}`,name:`${e.position.name} - ${e.nameOrRange}`,link:xs.POSITION({organizationId:s,eventId:o,positionId:e.position.id})}))).concat(e.campaign.tags.map(e=>({id:`t-${e.id}`,name:e.name,link:""}))),[e.campaign]),l=(0,L.useMemo)(()=>e.campaign.accreditationsCategories.map(e=>({id:`ac-${e.id}`,name:e.name,link:""})).concat(e.campaign.accreditations.map(e=>({id:`a-${e.id}`,name:e.name,link:is.ACCREDITATION({organizationId:s,eventId:o,accreditationId:e.id})}))).concat(e.campaign.accreditationsSlots.map(e=>({id:`as-${e.id}`,name:`${e.accreditation.name} - ${e.name}}`,link:is.ACCREDITATION({organizationId:s,eventId:o,accreditationId:e.accreditation.id})}))),[e.campaign]),d=(0,L.useMemo)(()=>l.length+a.length,[l,a]);return(0,i.jsxs)(Ba,{gap:"1",children:[(0,i.jsx)(Ar,{color:"gray500",children:n("_96502")}),e.campaign.sendToEveryone?(0,i.jsx)(Ar,{color:"gray800",children:n("tous_vos_membre_30731")}):so(e.campaign.states)?(0,i.jsx)(Ba,{css:{flex:"1"},gap:"2",wrap:"wrap",children:e.campaign.states.map(e=>(0,i.jsx)(rc,{...Cj(e),children:n(e)},e))}):so(e.campaign.usersInfos)?(0,i.jsx)(Ba,{css:{flex:"1"},gap:"1",wrap:"wrap",children:e.campaign.usersInfos.map((n,r)=>(0,i.jsxs)(Ar,{color:"primary500",css:{cursor:"pointer",textDecoration:"underline"},onClick:()=>{t.push(QI.MEMBER_INFORMATION({organizationId:s,eventId:o,userInfoId:n.id}))},children:[n.nameOrEmail,r!==e.campaign.usersInfos.length-1&&", "]},n.id))}):so(e.campaign.segments)?(0,i.jsx)(Ba,{css:{flex:"1"},gap:"1",wrap:"wrap",children:e.campaign.segments.map((n,s)=>(0,i.jsxs)(Ar,{color:"primary500",css:{cursor:"pointer",textDecoration:"underline"},onClick:()=>{t.push(r(n.id))},children:[n.name,s!==e.campaign.segments.length-1&&", "]},n.id))}):(0,i.jsx)(Ba,{css:{flex:"1"},gap:"1",wrap:"wrap",children:a.concat(l).map((e,n)=>(0,i.jsxs)(Ar,{color:m(e.link)?"primary500":"gray800",css:{cursor:m(e.link)?"pointer":"initial",textDecoration:"underline"},onClick:()=>{m(e.link)&&t.push(e.link)},children:[e.name,n!==d-1?", ":""]},e.id))})]})},Aj=e=>{const t=Xn(),n=(0,L.useCallback)(e=>{e&&(e.onload=()=>{const t=e.contentDocument.body.scrollHeight;e.style.height=`${t}px`,e.contentDocument.body.style.margin="0",e.contentDocument.body.style.overflow="hidden",e.parentElement.style.height=`${t+64}px`})},[]);return(0,i.jsx)(Ba,{css:{background:"$gray50",minHeight:"100%",py:"$6"},justify:"center",width:1,children:(0,i.jsxs)(Ba,{css:{background:"white",borderRadius:"$2",boxShadow:"$md",minHeight:"100%",overflow:"hidden",paddingTop:e.userSelector?"0":"$6"},direction:"column",gap:"3",width:664,children:[e.userSelector,e.createdBy&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ba,{css:{margin:"0 $6"},gap:"1",children:[(0,i.jsx)(Ar,{color:"gray500",children:t("cr_e_par_16667")}),(0,i.jsx)(Ar,{color:"gray800",children:e.createdBy})]}),(0,i.jsx)(Ar,{css:{borderTop:"1px solid $gray200",height:"1px",margin:"0 $6"}})]}),e.from&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ba,{css:{margin:"0 $6"},gap:"1",children:[(0,i.jsx)(Ar,{color:"gray500",children:t("de_70487")}),(0,i.jsx)(Ar,{color:"gray800",children:e.from})]}),(0,i.jsx)(Ar,{css:{borderTop:"1px solid $gray200",height:"1px",margin:"0 $6"}})]}),e.to&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ar,{css:{margin:"0 $6"},width:1,children:(0,i.jsx)(kj,{campaign:e.to})}),(0,i.jsx)(Ar,{css:{borderTop:"1px solid $gray200",height:"1px",margin:"0 $6"}})]}),e.subject&&(0,i.jsxs)(Ba,{css:{margin:"0 $6"},gap:"1",children:[(0,i.jsx)(Ar,{color:"gray500",children:t("objet_86482")}),(0,i.jsx)(Ar,{color:"gray800",fontWeight:"medium",children:e.subject})]}),e.content&&(0,i.jsxs)(Ba,{css:{background:"$gray100",borderBottomLeftRadius:"$2",borderBottomRightRadius:"$2",flexGrow:"1",padding:"$7"},direction:"column",gap:"6",children:[(0,i.jsx)(Ar,{css:{minHeight:"300px",marginTop:"$3","& iframe":{background:"white",border:"none",borderRadius:"$2",overflow:"hidden",width:"100%"}},width:1,children:(0,i.jsx)("iframe",{ref:n,srcDoc:e.content})}),(so(e.attachments)||so(e.documents))&&(0,i.jsxs)(Ba,{direction:"column",gap:"2",children:[(0,i.jsx)(Ar,{font:"gray900 textXl semiBold",children:t("pi_ces_jointes_36761")}),(0,i.jsx)(Ba,{gap:"2",children:(e.attachments||[]).map(e=>(0,i.jsx)(rc,{color:"white",size:"md",children:sv.includes(e)?t(e):sn.includes(e)?Vx(e):e},e))}),(0,i.jsx)(Ba,{direction:"column",gap:"3",children:(e.documents||[]).map(e=>(0,i.jsx)(Fv,{acl:"public-read",document:e},e.id))})]})]})]})})},wj=()=>{const{params:{organizationId:e,eventId:t,campaignId:n,userInfoId:s}}=vl(),{data:o,loader:r}=Zr({organizationId:e,campaignId:n,userInfoId:s}),a=(0,L.useMemo)(()=>o.organization?.campaign.createdBy?`${o.organization.campaign.createdBy.name} (${o.organization.campaign.createdBy.email})`:null,[o.organization]),l=(0,L.useMemo)(()=>o.organization?.campaign.emailSender?`${o.organization.campaign.emailSender.fromName} (${o.organization.campaign.emailSender.fromEmail})`:P.EMAIL_FROM,[o.organization]);return r||(0,i.jsx)(aj,{children:(0,i.jsx)(Aj,{attachments:o.organization.campaign.attachments,content:o.organization.campaign.preview,createdBy:a,documents:o.organization.campaign.documents,from:l,subject:o.organization.campaign.subject,to:o.organization.campaign,userSelector:(0,i.jsx)(jj,{css:{border:"none",px:"$6"},getPath:i=>$I.CAMPAIGN_PREVIEW({organizationId:e,eventId:t,campaignId:n,userInfoId:i})})})})},Sj=({children:e,color:t,fontWeight:n,returnPathFallback:s})=>{const o=ni();return(0,i.jsxs)(Ba,{align:"center",css:{color:"primary"===t?"$primary500":"$gray900",cursor:"pointer",fontSize:"textXl",fontWeight:n??"normal",padding:0},gap:"2",onClick:()=>o.goBack(s),children:[(0,i.jsx)(nl,{icon:"arrow-left"}),e]})},Ej=e=>{const{translate:t,params:{organizationId:n,eventId:s,campaignId:o}}=vl(),{isOrganizationAdmin:r}=TI(),{hasPermission:a}=wb(),l=r||a(Hb.CAMPAIGN_SEND);return(0,i.jsxs)(lj,{align:"center",gap:"3",hideBorder:!0,children:[(0,i.jsx)(Sj,{returnPathFallback:$I.CAMPAIGNS({organizationId:n,eventId:s})}),(0,i.jsx)(Ar,{css:{flex:"1"},font:"gray900 displayXs medium",children:e.campaign.name}),l&&(0,i.jsx)(zl,{to:$I.UPDATE({organizationId:n,eventId:s,campaignId:o}),children:t("_diter_la_campa_04069")})]})};function Tj(e){switch(e){case Et.Waiting:return{color:"warning",leftIcon:"hourglass-empty"};case Et.Sent:case Et.Delivered:return{color:"success",leftIcon:"check"};default:return{color:"error",leftIcon:"circle-exclamation"}}}const zj=e=>(0,i.jsx)(Ar,{color:"gray800",css:{borderBottom:"1px solid $gray200",padding:"$6"},fontSize:"textXl",fontWeight:"medium",children:e.children}),Oj=e=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"6"}),(0,i.jsxs)(Ba,{gap:"3",width:1,children:[(0,i.jsxs)(Ba,{css:{flex:"1"},direction:"column",gap:"1",children:[e.message.createdBy&&(0,i.jsx)(Ar,{color:"gray800",textAlign:"end",children:e.message.createdBy.name}),(0,i.jsx)(Ar,{css:{background:"$primary600",borderRadius:"$2",borderTopRightRadius:"0",boxShadow:"$sm",color:"white",padding:"$3"},width:1,children:e.message.text})]}),e.message.createdBy&&(0,i.jsx)(Ar,{children:(0,i.jsx)(sp,{email:e.message.createdBy.email,image:e.message.createdBy.picture?.url,name:e.message.createdBy.name,size:40})})]}),e.message.replies.map((t,n)=>(0,i.jsxs)(L.Fragment,{children:[(0,i.jsx)(Ya,{height:"6"}),(0,i.jsxs)(Ba,{gap:"3",width:1,children:[(0,i.jsx)(Ar,{children:(0,i.jsx)(sp,{email:e.userInfo.email,image:e.userInfo.picture?.url,name:e.userInfo.name,size:40})}),(0,i.jsxs)(Ba,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(Ar,{color:"gray800",children:e.userInfo.name}),(0,i.jsx)(Ar,{color:"gray800",css:{background:"$gray100",borderRadius:"$2",borderTopLeftRadius:"0",boxShadow:"$sm",padding:"$3"},width:1,children:unescape(t)})]})]})]},n))]}),Rj=e=>{const t=Xn(),{mutate:n}=function(e={}){return ei("mutation TextMessageSend(\n $organizationId: OrganizationId!\n $eventId: EventId\n $parentId: TextMessageId!\n $content: String!\n) {\n textMessageSend(\n organizationId: $organizationId\n eventId: $eventId\n parentId: $parentId\n content: $content\n ) {\n id\n }\n}\n",e)}(),[s,o]=(0,L.useState)(""),{numberOfCharacters:r,numberOfSms:a}=pv(s,!1),l=m(s);return(0,i.jsxs)(Ba,{direction:"column",gap:"3",width:1,children:[(0,i.jsx)(Zm,{label:(0,i.jsxs)(Ba,{justify:"between",children:[(0,i.jsx)(Ar,{children:t("contenu_de_la_r_08075")}),(0,i.jsx)(Ar,{color:"gray500",children:t("_1_caract_re_04414",r,a)})]}),value:s,onChange:o}),(0,i.jsx)(Ba,{justify:"end",children:(0,i.jsx)(zl,{disabled:!l,onClick:async()=>{await n({organizationId:e.organizationId,eventId:e.eventId,parentId:e.parentId,content:s}),e.reload()},children:t("envoyer_le_mess_41092")})})]})},$j=e=>{const t=Xn(),{data:n,loader:s,reload:o}=Qn("query TextMessageReplies($organizationId: OrganizationId!, $textMessageId: TextMessageId!) {\n organization(id: $organizationId) {\n textMessage(id: $textMessageId) {\n replies\n\n children {\n text: content\n replies\n sentAt: insertedAt\n\n createdBy {\n ...CreatedBy\n }\n }\n }\n }\n}\n",{organizationId:e.organizationId,textMessageId:e.textMessage.id},[Vs.CreatedByFragment]);const r=(0,L.useMemo)(()=>(0,uc.A)([{text:e.text,replies:n.organization?.textMessage.replies??[],sentAt:e.textMessage.sentAt,createdBy:e.createdBy}].concat(n.organization?.textMessage.children??[]),e=>e.sentAt.toMillis()),[n.organization]);return(0,i.jsxs)(vu,{size:"sm",onClose:e.onClose,children:[(0,i.jsx)(zj,{children:t("r_ponse_de_1_77675",e.userInfo.name)}),s||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(bu,{children:[r.map((t,n)=>(0,i.jsx)(Oj,{message:t,userInfo:e.userInfo},n)),(0,i.jsx)(Ya,{height:"6"})]}),(0,i.jsx)(ju,{children:(0,i.jsx)(Rj,{eventId:e.eventId,organizationId:e.organizationId,parentId:e.textMessage.id,reload:o})})]})]})},Dj=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=vl(),o=Zn(Jc),{mutate:r}=function(e={}){return ei("mutation TextMessageRepliesRead(\n $organizationId: OrganizationId!\n $eventId: EventId\n $textMessageId: TextMessageId!\n) {\n textMessageRepliesRead(\n organizationId: $organizationId\n eventId: $eventId\n textMessageId: $textMessageId\n ) {\n id\n }\n}\n",e)}(),[a,l]=(0,L.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Mc,{css:{cursor:"pointer","&:hover":{background:"$gray100"}},children:[(0,i.jsx)(Oc,{children:(0,i.jsx)(xj,{userInfo:e.textMessage.userInfo})}),(0,i.jsx)(Oc,{children:e.textMessage.userInfo.phone?.internationalFormat??""}),(0,i.jsx)(Oc,{children:e.textMessage.sentAt?o.toLocaleString(e.textMessage.sentAt,eo.DateTime):""}),(0,i.jsx)(Oc,{children:(0,i.jsx)(rc,{...Tj(e.textMessage.state),children:t(e.textMessage.state)})}),(0,i.jsx)(Oc,{children:e.textMessage.numberOfReplies>0?(0,i.jsx)(zl,{color:"white",size:"sm",onClick:async t=>{Dl(t),await r({organizationId:n,eventId:s,textMessageId:e.textMessage.id}),l(!0)},children:t("voir_la_reponse",e.textMessage.numberOfReplies)}):""})]}),a&&(0,i.jsx)($j,{createdBy:e.createdBy,eventId:s,organizationId:n,text:e.text,textMessage:e.textMessage,userInfo:e.textMessage.userInfo,onClose:()=>{l(!1)}})]})},Pj=e=>{const{params:{organizationId:t,campaignId:n},translate:s}=vl(),[o,r,a]=Wc(""),[l,d]=(0,L.useState)(""),[c,u]=(0,L.useState)(""),[h,g]=(0,L.useState)(0),{data:p,isLoading:f}=Qn("query CampaignTextMessages(\n $organizationId: OrganizationId!\n $campaignId: CampaignId!\n $name: String\n $state: TextMessageState\n $replies: TextMessageReplies\n $offset: Int\n) {\n organization(id: $organizationId) {\n campaign(id: $campaignId) {\n createdBy {\n ...CreatedBy\n }\n\n textMessages(\n name: $name\n state: $state\n replies: $replies\n limit: 25\n offset: $offset\n ) {\n nodes {\n id\n state\n sentAt: insertedAt\n numberOfReplies\n\n userInfo {\n ...CampaignUserInfo\n }\n }\n\n numberOfPages\n totalCount\n }\n }\n }\n}\n",{organizationId:t,campaignId:n,name:m(r)?r:void 0,state:""!==l?l:void 0,replies:""!==c?c:void 0,offset:h},[Vs.CreatedByFragment,Vs.CampaignUserInfoFragment]);const _=Bc(),{numberOfPages:x,totalCount:I}=Su(p.organization?.campaign.textMessages);return(0,i.jsxs)(aj,{direction:"column",gap:"7",children:[(0,i.jsxs)(Ba,{gap:"6",children:[(0,i.jsx)(fj,{content:e.campaign.numberOfRecipients,title:s("nombre_de_desti_21374")}),(0,i.jsx)(fj,{content:e.campaign.numberOfDelivery??0,title:s("nombre_de_messa_93859")}),(0,i.jsx)(fj,{content:e.campaign.cost,title:s("co_t_de_la_camp_54312")})]}),(0,i.jsx)(Lc,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ar,{width:200,children:(0,i.jsxs)($u,{value:l,onChange:e=>{d(e),g(0)},children:[(0,i.jsx)("option",{value:"",children:s("tous_les_status_67644")}),_(Dn)]})}),(0,i.jsx)(Ar,{width:240,children:(0,i.jsxs)($u,{value:c,onChange:e=>{u(e),g(0)},children:[(0,i.jsx)("option",{value:"",children:s("avec_et_sans_r_23765")}),_($n)]})}),(0,i.jsx)(Ar,{width:320,children:(0,i.jsx)(Bl,{icon:"magnifying-glass",placeholder:s("rechercher_un_d_02329"),value:o,onChange:e=>{a(e),g(0)}})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Gc,{children:s("nom_du_membre_69353")}),(0,i.jsx)(Gc,{children:s("Phone")}),(0,i.jsx)(Gc,{children:s("date_d_envoi_74668")}),(0,i.jsx)(Gc,{children:s("status_06428")}),(0,i.jsx)(Gc,{children:s("r_ponses_97000")})]}),numberOfPages:x,offset:h,rows:f?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Hc,{bx:!0}),(0,i.jsx)(Hc,{bx:!0}),(0,i.jsx)(Hc,{bx:!0})]}):(0,i.jsx)(i.Fragment,{children:p.organization.campaign.textMessages.nodes.map((t,n)=>(0,i.jsx)(Dj,{createdBy:p.organization.campaign.createdBy,text:e.campaign.text,textMessage:t},n))}),setOffset:g,title:s("liste_des_desti_16448"),totalCount:I})]})},Fj=()=>{const{params:{organizationId:e,eventId:t,campaignId:n,userInfoId:s}}=vl(),o=Zn(Jc),{data:r,loader:a}=Zr({organizationId:e,campaignId:n,userInfoId:s}),l=r.organization?.campaign.sentAt?.setZone(Gs.c9.local().zone);return a||(0,i.jsx)(aj,{children:(0,i.jsx)(Ba,{css:{background:"$gray50",py:"$6"},justify:"center",width:1,children:(0,i.jsxs)(Ba,{css:{background:"white",borderRadius:"$2",boxShadow:"$md",overflow:"hidden",paddingBottom:"$6"},direction:"column",gap:"3",width:640,children:[(0,i.jsx)(jj,{css:{border:"none",px:"$6"},getPath:i=>$I.CAMPAIGN_PREVIEW({organizationId:e,eventId:t,campaignId:n,userInfoId:i})}),(0,i.jsx)(Ar,{css:{px:"$6"},children:(0,i.jsx)(kj,{campaign:r.organization.campaign})}),(0,i.jsx)(Ar,{css:{borderTop:"1px solid $gray200",height:"1px",px:"$6"}}),(0,i.jsxs)(Ba,{css:{px:"$6"},gap:"3",width:1,children:[r.organization.campaign.createdBy&&(0,i.jsx)(Ar,{children:(0,i.jsx)(sp,{email:r.organization.campaign.createdBy.email,image:r.organization.campaign.createdBy.picture?.url,name:r.organization.campaign.createdBy.name,size:40})}),(0,i.jsxs)(Ba,{direction:"column",gap:"1",width:1,children:[(r.organization.campaign.createdBy||l)&&(0,i.jsxs)(Ba,{gap:"3",width:1,children:[r.organization.campaign.createdBy&&(0,i.jsx)(Ar,{color:"gray800",css:{flex:"1"},fontWeight:"medium",children:r.organization.campaign.createdBy.name}),l&&(0,i.jsx)(Ar,{color:"gray500",children:o.toLocaleString(l,eo.DateTime)})]}),(0,i.jsx)(Ar,{color:"gray800",css:{background:"$gray100",borderRadius:"$2",borderTopLeftRadius:"0",boxShadow:"$sm",padding:"$3"},dangerouslySetInnerHTML:{__html:r.organization.campaign.preview}})]})]})]})})})},Mj=()=>{const{params:{organizationId:e,eventId:t,campaignId:n},translate:s}=vl(),{data:o,loader:r}=Qn("query Campaign($organizationId: OrganizationId!, $eventId: EventId, $campaignId: CampaignId!) {\n organization(id: $organizationId) {\n campaign(id: $campaignId) {\n name\n state\n campaignType\n text\n numberOfRecipients\n numberOfDelivery\n numberOfOpen\n numberOfClick\n cost\n states\n }\n\n usersInfos(limit: 1) {\n nodes {\n id\n }\n }\n\n event: eventMaybe(id: $eventId) {\n volunteersRegistrations(limit: 1) {\n nodes {\n userInfoId\n }\n }\n }\n }\n}\n",{organizationId:e,eventId:t,campaignId:n},[]),a=(0,L.useMemo)(()=>o.organization?t?o.organization.event?.volunteersRegistrations.nodes[0]?.userInfoId:o.organization.usersInfos.nodes[0].id:-1,[t,o.organization]);Md(`${o.organization?.campaign.name??""} ${s("campagne_97871")}`);const l=i=>({organizationId:i?":organizationId":e,eventId:t?i?":eventId":t:void 0,campaignId:i?":campaignId":n}),d=e=>({...l(e),userInfoId:e?":userInfoId":a}),c=ci([$I.CAMPAIGN(l(!1)),gi.PREVIEW]);return r||(0,i.jsxs)(dj,{children:[(0,i.jsx)(Ej,{campaign:o.organization.campaign}),(0,i.jsxs)(mj,{css:{flex:"1"},children:[(0,i.jsxs)(uj,{css:{px:"$7"},children:[(0,i.jsx)(cj,{path:$I.CAMPAIGN_DASHBOARD(l(!1)),children:s("tableau_de_bord_24627")}),(0,i.jsx)(cj,{basePath:c,disabled:!a,disabledMessage:s("vous_devez_avoir_2345"),path:$I.CAMPAIGN_PREVIEW(d(!1)),children:s("aper_u_25595")})]}),(0,i.jsx)(hj,{path:$I.CAMPAIGN_DASHBOARD(l(!0)),children:o.organization?.campaign.campaignType===me.Email?(0,i.jsx)(bj,{campaign:o.organization?.campaign}):(0,i.jsx)(Pj,{campaign:o.organization?.campaign})}),(0,i.jsx)(hj,{path:$I.CAMPAIGN_PREVIEW(d(!0)),children:o.organization?.campaign.campaignType===me.Email?(0,i.jsx)(wj,{}):(0,i.jsx)(Fj,{})})]})]})},Nj=()=>{const{organizationId:e,eventId:t}=ti();return(0,i.jsx)(pj,{getVolunteersSegmentPath:n=>Ps.VOLUNTEERS_SEGMENT(e,t,n),isOrganizationCampaign:!1,children:(0,i.jsx)(Mj,{})})},Lj=()=>{const{organizationId:e}=ti();return(0,i.jsx)(pj,{getVolunteersSegmentPath:t=>Ps.COMMUNITY_USERS_SEGMENT(e,t),isOrganizationCampaign:!0,children:(0,i.jsx)(Mj,{})})};function Bj(e){switch(e){case we.Expired:return{color:"error",leftIcon:"clock"};case we.Full:return{color:"error",leftIcon:"hundred-points"};case we.Locked:return{color:"error",leftIcon:"lock-keyhole"};case we.Ongoing:return{color:"success",leftIcon:"check"};default:return ll()}}let Vj=class extends Gl{constructor(e){super(e)}createUpdateDelegationValuesDefault(e,t){return{delegation:this.delegationInputDefault(e,t),selectedAccreditationsSlotsIds:[]}}delegationInputDefault(e,t){const n=t?.forms&&t?.parentDelegation?t.forms.find(e=>e.name===t.parentDelegation?.form.name):null,i=e?.formId??n?.id??-1,s=so(t?.delegationsCategories)&&t?.parentDelegation?t.delegationsCategories.find(e=>e.name===t.parentDelegation?.delegationCategory.name):null;let o=e?.delegationCategoryId??s?.id??t?.delegationCategoryId;return Number.isInteger(o)||(o=null),{...this.getDefaultAccreditations(e),delegationCategoryId:o,parentId:e?.parentId??t?.parentId??null,name:e?.name??"",description:e?.description??"",leadersIds:e?.leadersIds??t?.parentDelegation?.leadersIds??[],formId:i,deadlineDate:e?.deadlineDate??null,maxResources:e?.maxResources??null,showInDelegationSpace:e?.showInDelegationSpace??!0,showFormLinkInDelegationSpace:e?.showFormLinkInDelegationSpace??!0,columns:e?.columns??t?.parentDelegation?.columns??["name","accreditations","accreditation_state"],canLeadersAddMembers:e?.canLeadersAddMembers??!0,canLeadersDeleteMembers:e?.canLeadersDeleteMembers??!0,canLeadersEditColumns:e?.canLeadersEditColumns??!0,canLeadersEditCustomFields:e?.canLeadersEditCustomFields??!0,canLeadersEditMembers:e?.canLeadersEditMembers??!0,canLeadersImportMembers:e?.canLeadersImportMembers??!1,canLeadersSeeHiddenAccreditationsSlots:e?.canLeadersSeeHiddenAccreditationsSlots??!1,privateNote:e?.privateNote??t?.parentDelegation?.privateNote??"",addDefaultAccreditationsByAvailability:e?.addDefaultAccreditationsByAvailability??!1,tagsIds:e?.tagsIds??t?.parentDelegation?.tagsIds??[],customFields:e?.customFields||[],fields:e?.fields??{},campaignsIds:e?.campaignsIds??[],customDocumentsSlugs:e?.customDocumentsSlugs??[],usedCustomFieldsIds:e?.usedCustomFieldsIds??[]}}delegationInputSchema(){return d.Ik().shape({parentId:d.ai().nullable(),name:d.Yj().when("parentId",{is:null,then:e=>e.required(this.t("le_nom_de_la_d_10042"))}),description:d.Yj(),delegationCategoryId:d.ai().required(this.t("la_cat_gorie_es_14008")).positive(this.t("la_cat_gorie_es_14008")).typeError(this.t("la_cat_gorie_es_14008")),leadersIds:d.YO().of(d.ai()),formId:d.ai().required(this.t("le_formulaire_e_77404")).typeError(this.t("le_formulaire_e_77404")).test("form-id-valid",this.t("le_formulaire_e_77404"),e=>"number"==typeof e&&e>0),deadlineDate:Qm.typeError(this.t("la_date_limite_91708")).nullable(),maxResources:d.ai().min(0).nullable(),showInDelegationSpace:d.zM().required(),showFormLinkInDelegationSpace:d.zM().required(),columns:d.YO().of(d.Yj()).required(this.t("vous_devez_choi_82605")).min(1,this.t("vous_devez_choi_82605")),canLeadersAddMembers:d.zM().required(),canLeadersDeleteMembers:d.zM().required(),canLeadersEditColumns:d.zM().required(),canLeadersEditMembers:d.zM().required(),canLeadersEditCustomFields:d.zM().required(),canLeadersImportMembers:d.zM().required(),canLeadersSeeHiddenAccreditationsSlots:d.zM().required(),privateNote:d.Yj(),accreditations:d.YO().of(d.Ik().shape({accreditationCategoryId:d.ai().required(),accreditationId:d.ai().required(),maxResources:d.gl().nullable(),willAutoAccredit:d.zM().required()})),accreditationsSlots:d.YO().of(d.Ik().shape({accreditationCategoryId:d.ai().required(),accreditationId:d.ai().required(),accreditationSlotId:d.ai().required(),isDefault:d.zM().required(),maxResources:d.gl().nullable()})),campaignsIds:d.YO().of(d.ai()),customDocumentsSlugs:d.YO().of(d.gl()),usedCustomFieldsIds:d.YO().of(d.ai())})}createUpdateDelegationSchema(){return d.Ik().shape({delegation:this.delegationInputSchema()})}adminAddSchema(){return d.Ik().shape({usersInfosIds:d.YO().of(d.ai())})}getDefaultAccreditations(e){let t=e?.accreditations||[];const n=e?.accreditationsSlots||[];return oo(t)&&so(n)&&(t=(0,xh.A)(n,e=>e.accreditationId).map(e=>({accreditationCategoryId:e.accreditationCategoryId,accreditationId:e.accreditationId,maxResources:null,willAutoAccredit:!1}))),{accreditations:t,accreditationsSlots:n}}};Vj=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[qn])],Vj);var Uj=n(2662);const Wj=["key","name","acl"];let Gj=class extends Gl{constructor(e){super(e)}documentInputDefault(){return{key:"",name:"",acl:""}}documentInputSchema(e){const t=m(e)?this.t("_1_est_requis_99856",e):this.t("le_document_est_86403");return d.Ik().shape({key:d.Yj().required(t),name:d.Yj().required(t),acl:d.Yj().required(t)})}documentInputSchemaNotRequired(){return d.Ik().shape({key:d.Yj(),name:d.Yj(),acl:d.Yj()})}};Gj=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[qn])],Gj);const Hj=({onChange:e,css:t,label:n,description:s,value:o,hint:r,state:a,initialValue:l,icon:d,...c})=>{const u=Xn(),h=(0,L.useRef)(null),m=(0,Vc.A)(t=>{e(t)},500),{inputId:g,descId:p,errorId:f}=qa();return(0,i.jsxs)(Ba,{css:t,direction:"column",width:1,children:[(0,i.jsx)(Ml,{htmlFor:g,isClickable:!1,children:n}),(0,i.jsx)(Pl,{id:p,children:s}),(n||s)&&(0,i.jsx)(Ya,{height:"1"}),(0,i.jsxs)(Ll,{cursor:"default",icon:d,state:a,onClick:()=>{h.current?.click()},children:[(0,i.jsxs)(Ba,{align:"center",css:{flex:"1"},height:1,children:[(0,i.jsx)(Ar,{css:{background:o,borderRadius:"$1",height:"24px",width:"24px","& input":{background:"transparent",border:"none",borderRadius:"$1",cursor:"pointer",height:"24px",width:"24px","&::-webkit-color-swatch-wrapper":{padding:0},"&::-webkit-color-swatch":{borderRadius:"$1",border:"none"},"&::-moz-color-swatch":{border:"none"}}},children:(0,i.jsx)("input",{ref:h,"aria-describedby":s?p:void 0,id:g,type:"color",value:o,onChange:e=>{m(e.target.value)},...c})}),(0,i.jsx)(Ya,{width:"3"}),(0,i.jsx)(Ar,{color:"gray800",css:{flex:"1","& input[type=text]":{background:"transparent",border:"none",color:"$gray800",height:"100%",outline:"none",width:"100%"}},height:1,onClick:Dl,children:(0,i.jsx)("input",{"aria-describedby":s?p:void 0,"aria-errormessage":"error"===a?f:void 0,"aria-invalid":"error"===a,disabled:"disabled"===a,id:g,type:"text",value:o,onChange:t=>{e(t.target.value)},...c})})]}),l&&o!==l&&(0,i.jsx)(zl,{color:"invisible",css:{color:"$primary500"},onClick:t=>{Dl(t),e(l)},children:u("remettre_sa_v_90478")})]}),(0,i.jsx)(Fl,{id:f,state:a,children:r})]})},qj=({name:e,hint:t,state:n,...s})=>(0,i.jsx)(Ga.D0,{name:e,render:o=>{const r=$l(o.meta);return(0,i.jsx)(Hj,{hint:r?o.meta.error:t,name:e,state:r?"error":n,value:o.input.value,onChange:e=>{o.input.onChange(e)},...s})}}),Kj=({name:e,hint:t,state:n,...s})=>(0,i.jsx)(Ga.D0,{name:e,render:o=>{const r=o.meta.data?.forceDisplayError&&o.meta.invalid||o.meta.touched&&o.meta.invalid;return(0,i.jsx)(Vu,{hint:r?o.meta.error:t,name:e,state:r?"error":n,value:o.input.value,onBlur:o.input.onBlur,onChange:o.input.onChange,onFocus:o.input.onFocus,...s})}}),Yj=({onChange:e,prefix:t,state:n,withFileField:s,...o})=>{const r=`${t}key`,a=`${t}name`,l=`${t}acl`,d=[r,a,l];let c;return s&&(c=`${t}file`,d.push(c)),(0,i.jsx)(rI,{names:d,render:t=>{let d=null;m(t[r].input.value)&&m(t[a].input.value)&&m(t[l].input.value)&&(d={key:t[r].input.value,name:t[a].input.value,acl:t[l].input.value});const{invalid:u,hint:h}=Object.values(t).reduce((e,t)=>e.invalid?e:$l(t.meta)?{invalid:!0,hint:t.meta.error||t.meta.submitError}:e,{invalid:!1,hint:void 0});return(0,i.jsx)(Yv,{hint:h,state:u?"error":n,value:d,onChange:n=>{t[r].input.onChange(n?.key??""),t[r].input.onBlur(),t[a].input.onChange(n?.name??""),t[a].input.onBlur(),t[l].input.onChange(n?.acl??""),t[l].input.onBlur(),s&&(t[c].input.onChange(n?.file),t[c].input.onBlur(),n?.file&&e?.(n.file))},...o})}})},Zj=_r("div",{alignItems:"center",borderRadius:"$1",color:"$gray600",cursor:"pointer",display:"flex",height:"40px",justifyContent:"center",width:"40px",variants:{active:{true:{background:"$primary100",color:"$primary500"},false:{"&:hover":{background:"$gray200",color:"$gray800"}}}}}),Xj=({css:e,label:t,description:n,value:s,height:o,renderOnPortal:r,onChange:a,...l})=>{const d=Xn(),[c,u]=(0,L.useState)(!1),h=(0,L.useMemo)(()=>(0,uc.A)(xn.map(e=>({value:e,name:d(e)})),e=>e.name),[]);return(0,i.jsxs)(Ba,{css:e,direction:"column",width:1,children:[(0,i.jsx)(Ml,{children:t}),(0,i.jsx)(Pl,{children:n}),(t||n)&&(0,i.jsx)(Ya,{height:"1"}),(0,i.jsxs)(Wd,{isOpen:c,onStateChange:u,children:[(0,i.jsx)(Xd,{children:(0,i.jsx)(Ll,{cursor:"pointer",icon:tl(s),rightIcon:c?"chevron-up":"chevron-down",...l,children:(0,i.jsx)(Ar,{css:{flex:"1"},children:d(s)})})}),(0,i.jsx)(Zd,{maxHeight:300,placement:"bottom",renderOnPortal:r,width:"match",children:(0,i.jsx)(Ba,{css:{px:"$2"},gap:"2",width:1,wrap:"wrap",children:h.map(e=>(0,i.jsx)(Zj,{active:s===e.value,onClick:()=>{u(!1),a(e.value)},children:(0,i.jsx)(nl,{icon:tl(e.value)})},e.value))})})]})]})},Jj=({name:e,hint:t,state:n,...s})=>(0,i.jsx)(Ga.D0,{name:e,render:o=>{const r=$l(o.meta);return(0,i.jsx)(Xj,{hint:r?o.meta.error:t,name:e,state:r?"error":n,value:o.input.value,onBlur:o.input.onBlur,onChange:e=>{o.input.onChange(e)},onFocus:o.input.onFocus,...s})}}),Qj=({name:e,hint:t,state:n,...s})=>(0,i.jsx)(Ga.D0,{name:e,render:o=>{const r=$l(o.meta);return(0,i.jsx)($u,{hint:r?o.meta.error:t,name:e,state:r?"error":n,value:o.input.value,onBlur:o.input.onBlur,onChange:e=>{o.input.onChange(e)},onFocus:o.input.onFocus,...s})}}),eC=e=>{const{translate:t,params:{organizationId:n}}=vl(),s=Zn(Gj),o=Zn(iI),r=Zn(hu),a=Bc();if((0,L.useEffect)(()=>{e.slug===se.Acronym||e.slug===se.Address||e.slug===se.Color||e.slug===se.Description||e.slug===se.Icon||e.slug===se.Name||e.slug===lt.Acronym||e.slug===lt.Address||e.slug===lt.Color||e.slug===lt.Description||e.slug===lt.Icon||e.slug===lt.Name||e.slug===Ce.Description||e.slug===Ce.Name||e.customField?.fieldType===We.Address||e.customField?.fieldType===We.Country||e.customField?.fieldType===We.Language||e.customField?.fieldType===We.Nationality||e.customField?.fieldType===We.Sex||e.customField?.fieldType===We.Text||e.customField?.fieldType===We.Textarea||e.customField?.fieldType===We.Time?"string"!=typeof e.value&&e.change(e.name,""):e.slug===se.AutoAccredit||e.slug===se.WeezeventIsSynchronized||e.slug===ve.Privacy||e.slug===Ce.IsLocked||e.slug===Ce.ShowInDelegationSpace||e.slug===Ce.CanLeadersAddMembers||e.slug===Ce.CanLeadersEditCustomFields||e.slug===Ce.CanLeadersEditMembers||e.slug===Ce.CanLeadersDeleteMembers||e.slug===Ce.CanLeadersEditColumns||e.slug===Ce.CanLeadersImportMembers||e.slug===Ce.CanLeadersSeeHiddenAccreditationsSlots||e.slug===Ce.ShowFormLinkInDelegationSpace||e.customField?.fieldType===We.Checkbox||e.customField?.fieldType===We.Validation?"boolean"!=typeof e.value&&e.change(e.name,!1):e.slug===se.Category||e.slug===Ce.Category||e.slug===lt.Category?"number"!=typeof e.value&&e.change(e.name,e.categories[0]?.id):e.slug===se.Index||e.slug===se.Latitude||e.slug===se.Longitude||e.slug===lt.Latitude||e.slug===lt.Longitude||e.slug===Ce.MaxResources||e.customField?.fieldType===We.Number?"number"!=typeof e.value&&e.change(e.name,0):e.slug===se.Tag||e.slug===lt.Tag||e.slug===Ce.Campaigns||e.slug===Ce.Documents||e.slug===Ce.Tag||e.slug===lt.Traces?Array.isArray(e.value)||e.change(e.name,[]):e.slug===Ce.DeadlineDate||e.customField?.fieldType===We.Date||e.customField?.fieldType===We.Datetime?Gs.c9.isDateTime(e.value)||m(e.value)||e.change(e.name,Gs.c9.invalid("Invalid")):e.customField?.fieldType===We.File?null!==e.value&&"object"==typeof e.value||e.change(e.name,s.documentInputDefault()):e.customField?.fieldType===We.Phone?null!==e.value&&"object"==typeof e.value||e.change(e.name,o.basePhoneInputDefault()):e.customField?.fieldType===We.Select?e.customField.canSelectMultiple&&!Array.isArray(e.value)?e.change(e.name,[]):e.customField.canSelectMultiple||"number"==typeof e.value||e.change(e.name,""):e.slug===Ce.Form&&"number"!=typeof e.value&&e.change("massEdit.value",e.forms[0].id)},[e.customField,e.slug]),e.slug===se.Acronym||e.slug===lt.Acronym||e.slug===se.Address||e.slug===lt.Address||e.customField?.fieldType===We.Address||e.customField?.fieldType===We.Text)return(0,i.jsx)(Vl,{name:e.name});if(e.slug===se.AutoAccredit||e.slug===se.WeezeventIsSynchronized||e.slug===Ce.IsLocked||e.slug===Ce.ShowFormLinkInDelegationSpace||e.slug===Ce.ShowInDelegationSpace||e.slug===Ce.CanLeadersAddMembers||e.slug===Ce.CanLeadersEditCustomFields||e.slug===Ce.CanLeadersEditMembers||e.slug===Ce.CanLeadersDeleteMembers||e.slug===Ce.CanLeadersEditColumns||e.slug===Ce.CanLeadersImportMembers||e.slug===Ce.CanLeadersSeeHiddenAccreditationsSlots||e.customField?.fieldType===We.Checkbox||e.customField?.fieldType===We.Validation)return(0,i.jsxs)(Qj,{name:e.name,shouldParseAsBoolean:!0,children:[(0,i.jsx)("option",{value:"true",children:t("oui_54361")}),(0,i.jsx)("option",{value:"false",children:t("non_33516")})]});if(e.slug===ve.Privacy)return(0,i.jsxs)(Qj,{name:e.name,shouldParseAsBoolean:!0,children:[(0,i.jsx)("option",{value:"true",children:t("Private")}),(0,i.jsx)("option",{value:"false",children:t("Public")})]});if(e.slug===se.Category||e.slug===Ce.Category||e.slug===lt.Category)return(0,i.jsx)(Ym,{isSearchVisible:!0,name:e.name,children:e.categories.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))});if(e.slug===se.Color||e.slug===lt.Color)return(0,i.jsx)(qj,{name:e.name});if(e.slug===se.Description||e.slug===Ce.Description||e.slug===lt.Description)return(0,i.jsx)(Ar,{css:{overflow:"hidden auto"},width:1,children:(0,i.jsx)(rb,{name:e.name})});if(e.slug===se.Icon||e.slug===lt.Icon)return(0,i.jsx)(Jj,{name:e.name});if(e.slug===se.Latitude||e.slug===lt.Latitude)return(0,i.jsx)(Km,{name:e.name});if(e.slug===se.Longitude||e.slug===lt.Longitude)return(0,i.jsx)(Km,{name:e.name});if(e.slug===se.Name||e.slug===lt.Name)throw new Error("Should not happen");if(e.slug===Ce.Campaigns)return(0,i.jsx)(Ym,{isSearchVisible:!0,multiple:!0,name:e.name,children:e.campaigns.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))});if(e.slug===Ce.Documents)return(0,i.jsx)(Ym,{isSearchVisible:!0,multiple:!0,name:e.name,children:e.customDocuments.map(e=>(0,i.jsx)("option",{value:e.slug,children:e.name},e.slug))});if(e.slug===se.Tag||e.slug===lt.Tag||e.slug===Ce.Tag)return(0,i.jsx)(Ym,{isSearchVisible:!0,multiple:!0,name:e.name,children:e.tags.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))});if(e.slug===lt.Traces)return(0,i.jsx)(Ym,{isSearchVisible:!0,multiple:!0,name:e.name,children:e.traces.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))});if(e.slug===se.Index||e.slug===Ce.MaxResources||e.customField?.fieldType===We.Number)return(0,i.jsx)(Vl,{name:e.name,shouldParseAsInt:!0});if(e.customField?.fieldType===We.Country)return(0,i.jsx)(Ym,{isSearchVisible:!0,name:e.name,children:r.getCountriesIdName().map(({id:e,name:t})=>(0,i.jsx)("option",{value:e,children:t},e))});if(e.slug===Ce.DeadlineDate||e.customField?.fieldType===We.Date)return(0,i.jsx)(Hm,{name:e.name});if(e.customField?.fieldType===We.Datetime)return(0,i.jsx)(Kj,{name:e.name});if(e.customField?.fieldType===We.File){const t=e.customField.fieldProperty===Ve.Picture?[yv.Images]:[yv.Images,yv.Pdf],s=e.customField.fieldProperty===Ve.Picture?"public-read":"private";return(0,i.jsx)(Yj,{accept:t,acl:s,organizationId:n,prefix:`${e.name}.`})}return e.customField?.fieldType===We.Language?e.customField.fieldProperty===Ve.Language?(0,i.jsxs)(Qj,{name:e.name,children:[(0,i.jsx)("option",{value:"",children:t("s_lectionnez_un_31086")}),a(Id)]}):(0,i.jsxs)(Qj,{name:e.name,children:[(0,i.jsx)("option",{value:"",children:t("s_lectionnez_un_31086")}),a(bn)]}):e.customField?.fieldType===We.Nationality?(0,i.jsx)(Ym,{isSearchVisible:!0,name:e.name,children:r.getNationalitiesIdName().map(({id:e,name:t})=>(0,i.jsx)("option",{value:e,children:t},e))}):e.customField?.fieldType===We.Phone?(0,i.jsx)(lI,{prefix:`${e.name}.`}):e.customField?.fieldType===We.Select?e.customField.canSelectMultiple?(0,i.jsx)(Ym,{isSearchVisible:!0,multiple:!0,name:e.name,children:e.customField.values.map(({id:e,value:t})=>(0,i.jsx)("option",{value:e,children:t},e))}):(0,i.jsx)(Ym,{isSearchVisible:!0,name:e.name,placeholder:t("s_lectionnez_un_44130"),children:e.customField.values.map(({id:e,value:t})=>(0,i.jsx)("option",{value:e,children:t},e))}):e.customField?.fieldType===We.Sex?(0,i.jsxs)(Qj,{name:e.name,children:[(0,i.jsx)("option",{value:"",children:t("s_lectionnez_un_43620")}),a(Rn)]}):e.customField?.fieldType===We.Textarea?(0,i.jsx)(Xm,{name:e.name}):e.customField?.fieldType===We.Time?(0,i.jsx)(lb,{name:e.name}):e.slug===Ce.Form?(0,i.jsx)(Ym,{isSearchVisible:!0,multiple:!1,name:"massEdit.value",children:e.forms.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}):null},tC=e=>(0,i.jsxs)(gb,{children:[(0,i.jsxs)(Ba,{align:"center",gap:"4",children:[(0,i.jsx)(ml,{css:{flex:"1",textTransform:"uppercase"},textStyle:"smallcapsheading",children:e.title}),e.buttons]}),e.children]}),nC=e=>{const{translate:t}=vl(),n=e.customFields.find(t=>t.id===e.customFieldValues.customFieldId);return(0,i.jsx)(tC,{buttons:(0,i.jsxs)(km,{children:[(0,i.jsx)(Sm,{children:(0,i.jsx)(Ar,{children:(0,i.jsx)(zl,{color:"white",leftIcon:"trash-can",size:"sm",onClick:e.remove})})}),(0,i.jsx)(wm,{placement:"top",children:t("supprimer_43083")})]}),title:t("champ_de_formul_73221",e.index+1),children:(0,i.jsxs)(Ba,{direction:"column",gap:"4",children:[(0,i.jsxs)(Ym,{isSearchVisible:!0,label:t("CustomField"),name:`${e.field}.customFieldId`,children:[(0,i.jsx)("option",{value:"-1",children:t("s_lectionner_un_48159")}),e.customFields.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))]}),n&&(0,i.jsxs)(Ba,{direction:"column",gap:"1",children:[(0,i.jsx)(Ar,{font:"gray700 textSm medium",children:t("nouvelle_valeur_39039",n.name)}),(0,i.jsx)(eC,{campaigns:[],categories:[],change:e.change,customDocuments:[],customField:n,forms:[],name:`${e.field}.value`,slug:n.slug,tags:[],traces:[],value:e.customFieldValues.value}),n.fieldType===We.Select&&n.canSelectMultiple&&(0,i.jsx)(Gm,{name:`${e.field}.addValues`,children:t("ajouter_les_val_22996")})]})]})})},iC=e=>{const t=Xn();return(0,i.jsx)(Ba,{direction:"column",gap:"3",children:so(e.values)?(0,i.jsxs)(i.Fragment,{children:[e.values.map((t,n)=>{const s=`${e.name}[${n}]`;return(0,i.jsx)(Ba,{direction:"column",children:(0,i.jsx)(Ba,{gap:"3",children:(0,i.jsx)(nC,{change:e.change,customFieldValues:e.values[n],customFields:e.customFields,field:s,index:n,remove:()=>{e.change(e.name,co(e.values,n))}})})},n)}),(0,i.jsx)(zl,{color:"invisible",css:{"::before":{content:"+",marginInlineEnd:"$1"}},onClick:()=>{e.change(e.name,e.values.concat([{customFieldId:-1,addValues:!1}]))},children:t("ajouter_un_nouv_22370")})]}):(0,i.jsx)(gb,{align:"center",css:{background:"$gray50",textAlign:"center"},gap:"2",children:(0,i.jsxs)(Ba,{align:"center",css:{textAlign:"center"},direction:"column",gap:"2",children:[(0,i.jsx)(hl,{css:{fontWeight:"$medium"},children:t("aucun_champ_est_98607")}),(0,i.jsx)(zl,{color:"invisible",css:{inlineSize:"fit-content","::before":{content:"+",marginInlineEnd:"$1"}},onClick:()=>{e.change(e.name,e.values.concat([{customFieldId:-1,addValues:!1}]))},children:t("_lier_un_champ_52842")})]})})})},sC=e=>(0,i.jsx)(Ba,{align:"center",css:{background:`$${e.color}50`,borderRadius:"48px",color:`$${e.color}700`,...e.css||{}},height:48,justify:"center",width:48,children:(0,i.jsx)(Ba,{align:"center",css:{background:`$${e.color}100`,borderRadius:"32px"},height:32,justify:"center",width:32,children:(0,i.jsx)(nl,{icon:e.icon})})}),oC=e=>{const t=Xn(),n=Zn(Ua),s=qa();return(0,i.jsx)(au,{size:e.size||"sm",onClose:e.onClose,children:(0,i.jsx)(kl,{css:{overflow:"hidden"},direction:"column",height:1,hideDefaultErrors:!0,initialValues:e.initialValues,render:n=>{const{handleSubmit:o,submitting:r}=n;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{justify:"center",children:(0,i.jsx)(sC,{color:"primary",icon:e.icon})}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(Ar,{color:"gray900",fontSize:"textLg",fontWeight:"medium",id:s.labelId,textAlign:"center",children:e.title}),e.subtitle&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ar,{color:"gray500",id:s.descId,textAlign:"center",children:e.subtitle})]}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(jl,{errorId:s.errorId}),(0,i.jsx)(Ba,{css:{overflowY:"auto"},direction:"column",children:"function"==typeof e.children?e.children(n):e.children}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsxs)(Ba,{gap:"3",justify:"end",children:[(0,i.jsx)(zl,{isLoading:r,onClick:o,children:e.buttonText}),(0,i.jsx)(zl,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},validate:t=>e.schema?n.validateForForm(e.schema)(t):{},onSubmit:e.onSubmit})})},rC=e=>{const t=Xn(),{mutate:n}=function(e={}){return ei("mutation TagCreate($organizationId: OrganizationId!, $eventId: EventId, $tag: String!) {\n tagCreate(organizationId: $organizationId, eventId: $eventId, tag: $tag) {\n id\n name\n }\n}\n",e)}();return(0,i.jsx)(oC,{buttonText:t("cr_er_82895"),icon:"tag",initialValues:{name:""},title:t("cr_er_un_tag_59505"),onClose:e.onClose,onSubmit:async t=>{const{tagCreate:i}=await n({organizationId:e.organizationId,tag:t.name});e.onSuccess(i),e.onClose()},children:(0,i.jsx)(Vl,{label:t("nom_du_tag_95054"),name:"name"})})},aC=e=>{const t=Xn(),[n,s]=(0,L.useState)(e.tags),[o,r]=(0,L.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ym,{isCreateVisible:!0,isSearchVisible:!0,label:(0,i.jsx)(Zv,{children:t("tags_79499")}),multiple:!0,name:`${e.name}tagsIds`,onCreateClick:()=>{r(!0)},children:n.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),o&&(0,i.jsx)(rC,{organizationId:e.organizationId,onClose:()=>{r(!1)},onSuccess:t=>{s([...n,t]),e.change(`${e.name}tagsIds`,[...e.tagsIds,t.id])}})]})},lC=/^[0-9]{11}$/i,dC=Gs.c9.now().year-2e3;function cC(e){if(m(e)&&lC.test(e)){const t=(0,Uj.A)(e.substring(0,2),10);let n=(0,Uj.A)(e.substring(0,9),10);const i=(0,Uj.A)(e.substring(9),10);return t<=dC&&(n=2e9+n),i===97-n%97}return!1}const uC=/^[A-Z]{2}[0-9]{2}[A-Z0-9]{1,30}$/,hC={AD:24,AE:23,AL:28,AO:25,AT:20,AX:18,AZ:28,BA:20,BE:16,BF:28,BG:22,BH:22,BI:27,BJ:28,BL:27,BR:29,BY:28,CF:27,CG:27,CH:21,CI:28,CM:27,CR:22,CV:25,CY:28,CZ:24,DE:22,DJ:27,DK:18,DO:28,DZ:26,EA:24,EE:20,EG:29,ES:24,FI:18,FK:18,FO:18,FR:27,GA:27,GB:22,GE:22,GF:27,GG:22,GI:23,GL:18,GP:27,GQ:27,GR:27,GT:28,GW:25,HN:28,HR:21,HU:28,IC:24,IE:22,IL:23,IM:22,IQ:23,IR:26,IS:26,IT:27,JE:22,JO:30,KM:27,KW:30,KZ:20,LB:28,LC:32,LI:21,LT:20,LU:20,LV:21,LY:25,MA:28,MC:27,MD:24,ME:22,MF:27,MG:27,MK:19,ML:28,MN:20,MQ:27,MR:27,MT:31,MU:30,MZ:25,NC:27,NE:28,NI:28,NL:18,NO:15,OM:23,PF:27,PK:24,PL:28,PM:27,PS:29,PT:25,QA:29,RE:27,RO:24,RS:22,RU:33,SA:24,SC:31,SD:18,SE:24,SI:19,SK:24,SM:27,SN:28,SO:23,ST:25,SV:28,TD:27,TF:27,TG:28,TL:23,TN:24,TR:26,UA:29,VA:22,VG:24,WF:27,XK:20,YE:30,YT:27};let mC=class{countriesService;dateTimeService;translationService;constructor(e,t,n){this.countriesService=e,this.dateTimeService=t,this.translationService=n}getValueString(e,t,n={}){switch(e.fieldType){case We.Text:case We.Textarea:case We.Time:case We.Address:return t[e.slug]||"";case We.Sex:return this.getSexValue(e,t);case We.Language:return this.getLanguageValue(e,t);case We.Nationality:return this.getNationalityValue(e,t);case We.Country:return this.getCountryValue(e,t);case We.Select:return this.getSelectValue(e,t);case We.Checkbox:case We.Validation:return this.getBooleanValue(e,t);case We.Date:return this.getDateValue(e,t,n.dateFormat);case We.Datetime:return this.getDatetimeValue(e,t,n.datetimeFormat);case We.File:return"name"===n.fileReturnValue?t[e.slug]?.name||"":t[e.slug]?.url||"";case We.Phone:return this.getPhoneValue(e,t);case We.Number:return this.getIntValue(e,t);default:return ll(e.fieldType)}}getValue(e,t){return t[e.slug]}getSelectValues(e,t){const n=io(this.getValue(e,t)??[]);return(0,Za.A)(n.map(t=>e.values.find(e=>e.id===t)?.value))}getSexValue(e,t){return this.translationService.translate(this.getValue(e,t)??"")}getLanguageValue(e,t){return this.translationService.translate(this.getValue(e,t)??"")}getNationalityValue(e,t){return this.countriesService.getNationality(this.getValue(e,t)??"")??""}getCountryValue(e,t){return this.countriesService.getName(this.getValue(e,t)??"")??""}getBooleanValue(e,t){const n=this.getValue(e,t);return!0===n?this.translationService.translate("oui_54361"):!1===n?this.translationService.translate("non_33516"):""}getDateValue(e,t,n){let i=this.getValue(e,t);return m(i)&&(i=Gs.c9.fromISO(i,{zone:"utc"})),Gs.c9.isDateTime(i)&&i.isValid?m(n)?i.toFormat(n):this.dateTimeService.toLocaleString(i,eo.DateOnly.MonthLong):""}getDatetimeValue(e,t,n){let i=this.getValue(e,t);return m(i)&&(i=Gs.c9.fromISO(i,{zone:"utc"})),Gs.c9.isDateTime(i)&&i.isValid?m(n)?i.toFormat(n):this.dateTimeService.toLocaleString(i,eo.DateTime):""}getPhoneValue(e,t){return this.getValue(e,t)?.internationalFormat??""}getIntValue(e,t){return this.getValue(e,t)?.toString()??""}getSelectValue(e,t){const n=io(this.getValue(e,t)??[]);return(0,Za.A)(n.map(t=>e.values.find(e=>e.id===t)?.value)).join(", ")}};mC=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[hu,Jc,qn])],mC);const gC=[We.Country,We.Language,We.Nationality,We.Select];function pC(e,t,n){if(e.hasCondition&&e.conditionCustomField){const i=n.find(t=>t.id===e.conditionCustomField.id);if(i){if(pC(i,t,n)){const n=t[e.conditionCustomField.slug];return"boolean"==typeof n&&e.conditionCustomField.fieldType===We.Checkbox?n===e.conditionValue:!(!gC.includes(e.conditionCustomField.fieldType)||!so(e.conditionValue))&&(0,fh.A)(io(n),e.conditionValue).length>0}return!1}return!1}return!0}const fC=Id.concat(bn);let _C=class extends Gl{countriesService;documentInputService;phoneInputService;translationService;constructor(e,t,n,i){super(i),this.countriesService=e,this.documentInputService=t,this.phoneInputService=n,this.translationService=i}fieldsUpdateInputDefault(e,t,n,i){return Object.fromEntries(t.map(t=>{const s=this.getFieldValue(e,t);return[t.slug,s??this.fieldUpdateInputDefault(t,n,i)]}))}fieldSchema(e,t){const n=(n,i)=>{if(e.conditionCustomField)return d.Ik().when(e.conditionCustomField.slug,([s])=>t&&(e.conditionCustomField.fieldType===We.Checkbox&&s===e.conditionValue||gC.includes(e.conditionCustomField.fieldType)&&so(e.conditionValue)&&(0,fh.A)(io(s),e.conditionValue).length>0)?n():i());{let e;return e=t?n():i(),e}};switch(e.fieldType){case We.File:return n(()=>this.documentInputService.documentInputSchema(e.name),()=>this.documentInputService.documentInputSchemaNotRequired());case We.Phone:return n(()=>this.phoneInputService.phoneInputSchema(),()=>this.phoneInputService.phoneInputSchemaNotRequired());case We.Text:case We.Textarea:case We.Time:case We.Address:return e.fieldProperty===Ve.Eid?n(()=>d.Yj().required(this.t("_1_est_requis_99856",e.name)).typeError(this.t("_1_est_requis_99856",e.name)).test("valid-eid",this.t("le_num_ro_de_re_71488"),cC),()=>d.Yj()):e.fieldSubtype!==Ue.Freeform?n(()=>d.Yj().required(this.t("_1_est_requis_99856",e.name)).typeError(this.t("_1_est_requis_99856",e.name)).test("valid-eid",this.t("_1_n_est_pas_a_14932",e.name),t=>{switch(e.fieldSubtype){case Ue.Eid:return cC(t);case Ue.Avs:return function(e){if(m(e)){const t=e.replace(/\D/g,"");if(13===t.length&&t.startsWith("756")){const e=t.substring(0,12).split("").reduce((e,t,n)=>n%2==0?e+Number(t):e+3*Number(t),0)%10;return(0===e?0:10-e)===Number(t[12])}return!1}return!1}(t);case Ue.Iban:return function(e){if(m(e)){const t=e.toUpperCase().trim().replace(/\s+/g,"");if(uC.test(t)){const e=t.substring(0,2);if(t.length===hC[e]){const e=`${t.substring(4)}${t.substring(0,4)}`;let n="";for(const t of e)n=/[A-Z]/.test(t)?`${n}${t.charCodeAt(0)-55}`:`${n}${t}`;return BigInt(n)%97n==1n}return!1}return!1}return!1}(t);case Ue.Freeform:return!0;default:return ll(e.fieldSubtype)}}),()=>d.Yj()):n(()=>d.Yj().required(this.t("_1_est_requis_99856",e.name)).typeError(this.t("_1_est_requis_99856",e.name)),()=>d.Yj());case We.Number:return n(()=>d.ai().required(this.t("_1_est_requis_99856",e.name)).typeError(this.t("_1_est_requis_99856",e.name)),()=>d.ai().nullable());case We.Checkbox:return n(()=>d.zM().required(this.t("_1_est_requis_99856",e.name)).typeError(this.t("_1_est_requis_99856",e.name)),()=>d.zM());case We.Validation:return n(()=>d.zM().required(this.t("_1_est_requis_99856",e.name)).typeError(this.t("_1_est_requis_99856",e.name)).oneOf([!0],this.t("_1_doit_obliga_82862",e.name)),()=>d.zM());case We.Select:return e.canSelectMultiple?n(()=>d.YO().of(d.ai().required()).required(this.t("_1_est_requis_99856",e.name)).min(1,this.t("vous_devez_s_le_55757",e.name)),()=>d.YO().of(d.ai())):n(()=>d.ai().oneOf(e.values.map(({id:e})=>e),this.oneOfMessage(e.name,e.values.map(({value:e})=>e))).required(this.t("_1_est_requis_99856",e.name)).typeError(this.t("_1_est_requis_99856",e.name)),()=>d.ai().oneOf(e.values.map(({id:e})=>e),this.oneOfMessage(e.name,e.values.map(({value:e})=>e))));case We.Date:case We.Datetime:return n(()=>Qm.required(this.t("_1_est_requis_99856",e.name)).typeError(this.t("la_date_est_inv_22002",e.name)),()=>d.gl().nullable());case We.Sex:return n(()=>d.Yj().oneOf(Rn,this.oneOfMessage(e.name,Rn)).required(this.t("_1_est_requis_99856",e.name)).typeError(this.t("_1_est_requis_99856",e.name)),()=>d.Yj().oneOf(Rn,this.oneOfMessage(e.name,Rn)));case We.Language:return n(()=>d.Yj().oneOf(fC,this.oneOfMessage(e.name,fC)).required(this.t("_1_est_requis_99856",e.name)).typeError(this.t("_1_est_requis_99856",e.name)),()=>d.Yj().oneOf(fC,this.oneOfMessage(e.name,fC)));case We.Nationality:case We.Country:return n(()=>d.Yj().oneOf(this.countriesService.countriesCodes,this.oneOfMessage(e.name,this.countriesService.countriesCodes)).required(this.t("_1_est_requis_99856",e.name)).typeError(this.t("_1_est_requis_99856",e.name)),()=>d.Yj().oneOf(this.countriesService.countriesCodes,this.oneOfMessage(e.name,this.countriesService.countriesCodes)));default:return ll(e.fieldType)}}fieldUpdateInputDefault(e,t,n){switch(e.fieldType){case We.Checkbox:case We.Validation:return!!n&&void 0;case We.File:return this.documentInputService.documentInputDefault();case We.Phone:return this.phoneInputService.phoneInputDefault(t);case We.Select:return e.canSelectMultiple?[]:void 0;case We.Address:case We.Date:case We.Datetime:case We.Language:case We.Number:case We.Sex:case We.Text:case We.Textarea:case We.Time:return;case We.Country:return t.user.country;case We.Nationality:return t.user.nationality;default:return ll(e.fieldType)}}getFieldValue(e,t){const n=e[t.slug];return t.fieldType===We.Phone&&n?(0,Er.A)(n,nI):t.fieldType===We.File?(0,Er.A)(n,Wj):t.fieldType===We.Date&&n?Gs.c9.fromISO(n,{zone:"UTC"}):n}};_C=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[hu,Gj,iI,qn])],_C);const xC=({formattedAddressProps:e,latitudeProps:t,longitudeProps:n,placeProps:s,...o})=>{const r=(0,L.useRef)(null);return(0,L.useEffect)(()=>{const i=new google.maps.places.Autocomplete(r.current,{types:["geocode"]});i.addListener("place_changed",async()=>{const o=i.getPlace(),r=o.geometry.location.lat(),a=o.geometry.location.lng();e.input.onChange(o.formatted_address),t?.input.onChange(r),n?.input.onChange(a),s?.input.onChange(o)})},[]),(0,i.jsx)(Bl,{ref:r,value:e.input.value,onBlur:e.input.onBlur,onChange:e.input.onChange,onFocus:e.input.onFocus,...o})},IC=({addressName:e,latitudeName:t,longitudeName:n,placeName:s,...o})=>{const r=[e];return t&&r.push(t),n&&r.push(n),s&&r.push(s),(0,i.jsx)(rI,{names:r,render:r=>(0,i.jsx)(xC,{formattedAddressProps:r[e],latitudeProps:t?r[t]:void 0,longitudeProps:n?r[n]:void 0,placeProps:s?r[s]:void 0,...o})})},vC=e=>{const t=Xn();return(0,i.jsxs)(Ba,{gap:"4",width:1,children:[(0,i.jsx)(Ar,{css:{border:"1px solid $gray200",borderRadius:"$1",overflow:"hidden"},height:126,width:126,children:(0,i.jsx)("img",{src:e.url,style:{objectFit:"cover",inlineSize:"100%",blockSize:"100%"}})}),(0,i.jsxs)(Ba,{direction:"column",children:[(0,i.jsx)(Ar,{color:"gray700",fontWeight:"medium",children:e.label}),e.hint&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ar,{color:"gray400",children:e.hint})]}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(Ar,{color:"error700",css:{cursor:"pointer"},fontWeight:"medium",onClick:e.onDelete,children:t("supprimer_43083")})]})]})},bC=e=>(0,i.jsxs)(Ba,{gap:"4",width:1,children:[(0,i.jsx)(Ba,{align:"center",css:{background:"$gray50",border:"1px solid $gray200",borderRadius:"$1",cursor:"pointer"},height:126,justify:"center",width:126,children:(0,i.jsx)(Ba,{height:64,width:64,children:(0,i.jsx)(Al,{color:xr.colors.gray900.value,height:"64px",strokeWidth:"4",width:"64px"})})}),(0,i.jsxs)(Ba,{direction:"column",children:[(0,i.jsx)(Ar,{color:"gray700",fontWeight:"medium",children:e.label}),e.hint&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ar,{color:"gray400",children:e.hint})]})]})]}),jC=({value:e,onChange:t,label:n,hint:s,organizationId:o,...r})=>{const[a,l]=(0,L.useState)(e?Kv.File:Kv.Uploader);return a===Kv.File&&e?(0,i.jsx)(vC,{hint:s,label:n,url:Tv(e,P.HEAVENT_AWS_UPLOADS_BUCKET),onDelete:()=>{t(null),l(Kv.Uploader)}}):a===Kv.Uploading?(0,i.jsx)(bC,{hint:s,label:n}):(0,i.jsx)(Wv,{hint:s,label:n,onChange:async e=>{l(Kv.Uploading);try{const n=await Sv(o,e,"public-read");t(n),l(Kv.File)}catch{l(Kv.Uploader)}},...r})},CC=({prefix:e,...t})=>{const n=`${e}key`,s=`${e}name`,o=`${e}acl`;return(0,i.jsx)(rI,{names:[n,s,o],render:e=>{let r=null;return m(e[n].input.value)&&m(e[s].input.value)&&m(e[o].input.value)&&(r={key:e[n].input.value,name:e[s].input.value,acl:e[o].input.value}),(0,i.jsx)(jC,{value:r,onChange:t=>{e[n].input.onChange(t?.key??""),e[s].input.onChange(t?.name??""),e[o].input.onChange(t?.acl??"")},...t})}})},yC=e=>{const t=Xn(),n=Bc(),s=Zn(hu),o=Zn(_C),r=e.isMandatory?e.field.name:(0,i.jsx)(Zv,{children:e.field.name}),a=`${e.prefix}${e.field.slug}`,l=e.field.description,d=(0,L.useMemo)(()=>a.startsWith("formRegister.userInfo.fields."),[a]);if((0,L.useEffect)(()=>{e.display||e.change(a,o.fieldUpdateInputDefault(e.field,s.getDefaultCountryValues()))},[e.display,e.field,e.change]),!e.display)return null;switch(e.field.fieldType){case We.Text:return(0,i.jsx)(Vl,{description:l,label:r,name:a});case We.Textarea:return(0,i.jsx)(Xm,{description:l,label:r,name:a});case We.Checkbox:return(0,i.jsx)(Gm,{name:a,subtext:l,children:r});case We.Validation:return(0,i.jsx)(Gm,{name:a,subtext:(0,i.jsxs)(i.Fragment,{children:[m(l)&&(0,i.jsx)("span",{children:l}),m(l)&&e.field.document&&(0,i.jsx)("br",{}),e.field.document&&(0,i.jsx)(Zc,{css:{color:"$primary500"},download:e.field.document.name,to:e.field.document.url,onClick:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},children:t("consulter_le_do_69928")})]}),children:r});case We.Select:return e.field.canSelectMultiple?(0,i.jsx)(Ym,{description:l,isSearchVisible:!0,isSelectAllVisible:!0,label:r,multiple:!0,name:a,children:e.field.values.map(({id:e,value:t})=>(0,i.jsx)("option",{value:e,children:t},e))}):(0,i.jsx)(Ym,{description:l,isSearchVisible:!0,label:r,name:a,placeholder:t("choisir_une_val_00277"),children:e.field.values.map(({id:e,value:t})=>(0,i.jsx)("option",{value:e,children:t},e))});case We.Date:return"dateOfBirth"===e.field.slug?(0,i.jsx)(Hm,{autoComplete:d?"bday":void 0,description:l,label:r,max:Gs.c9.now(),name:a}):(0,i.jsx)(Hm,{description:l,label:r,name:a});case We.Datetime:return(0,i.jsx)(Kj,{description:l,label:r,name:a});case We.Time:return(0,i.jsx)(lb,{description:l,label:r,name:a});case We.Phone:return(0,i.jsx)(lI,{description:l,label:r,prefix:`${a}.`});case We.Number:return(0,i.jsx)(Vl,{description:l,label:r,name:a,shouldParseAsInt:!0});case We.Sex:return(0,i.jsxs)(Qj,{autoComplete:d?"sex":void 0,description:l,label:r,name:a,children:[(0,i.jsx)("option",{disabled:!0,value:"",children:t("choisir_une_val_00277")}),n(Rn)]});case We.Language:return e.field.fieldProperty===Ve.Language?(0,i.jsx)(Ym,{autoComplete:d?"language":void 0,description:l,isSearchVisible:!0,label:r,name:a,placeholder:t("choisir_une_val_00277"),children:n(Id)}):(0,i.jsx)(Ym,{description:l,isSearchVisible:!0,label:r,name:a,placeholder:t("choisir_une_val_00277"),children:n(bn)});case We.Nationality:return(0,i.jsx)(Ym,{description:l,isSearchVisible:!0,label:r,name:a,placeholder:t("choisir_une_val_00277"),children:s.getNationalitiesIdName(e.countryCode).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))});case We.Address:return(0,i.jsx)(IC,{addressName:a,autoComplete:d?"street-address":void 0,description:l,label:r,placeName:e.field.fieldProperty===Ve.Street?"place":void 0});case We.Country:return(0,i.jsx)(Ym,{autoComplete:d?"country":void 0,description:l,isSearchVisible:!0,label:r,name:a,placeholder:t("choisir_une_val_00277"),children:s.getCountriesIdName(e.countryCode).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))});case We.File:return e.field.fieldProperty===Ve.Picture?(0,i.jsx)(CC,{allowCrop:!0,hint:l,label:r,organizationId:e.organizationId,prefix:`${a}.`}):(0,i.jsx)(Yj,{accept:[yv.Images,yv.Pdf],acl:e.fileAcl??"private",description:l,label:r,organizationId:e.organizationId,prefix:`${a}.`});default:return ll(e.field.fieldType)}},kC=e=>{const t=Xn(),[n,s]=(0,L.useState)(""),o=(0,L.useMemo)(()=>{if(m(n)){const t=n.trim().toLowerCase();return e.customFields.filter(e=>e.name.trim().toLowerCase().includes(t)||m(e.label)&&e.label.trim().toLowerCase().includes(t))}return e.customFields},[e.customFields,n]),r=(0,L.useMemo)(()=>(0,uc.A)(Object.entries((0,cc.A)(o,e=>e.category.name)),([e])=>e).map(([e,t])=>[e,(0,uc.A)(t,e=>e.name)]),[o]);return(0,i.jsxs)(Ba,{css:{padding:"$3"},direction:"column",width:1,children:[(0,i.jsx)(Bl,{icon:"magnifying-glass",placeholder:t("rechercher_un_c_86475"),state:"search",value:n,onChange:s}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(Ar,{css:{maxHeight:"300px",overflowY:"auto"},children:r.map(([n,s],o)=>(0,i.jsxs)(L.Fragment,{children:[(0,i.jsx)(gc,{index:o,children:n}),s.map(n=>n.conditionCustomField&&!e.selectedCustomFieldsIds.has(n.conditionCustomField.id)?(0,i.jsxs)(km,{children:[(0,i.jsx)(Sm,{children:(0,i.jsxs)(Ba,{align:"center",css:{px:"$3"},gap:"3",height:40,width:1,children:[(0,i.jsx)(fc,{disabled:!0,shouldPreventDefault:!1,state:"unchecked",onClick:td.A}),(0,i.jsx)(Ar,{color:"gray400",css:{ellipsis:!0,flex:"1"},title:n.name,children:n.name})]},n.id)}),(0,i.jsx)(wm,{placement:"top-start",children:t("ce_champ_d_pend_31209",n.conditionCustomField?.name)})]},n.id):(0,i.jsx)(bc,{isCheckbox:!0,isRadio:!1,isSelected:e.selectedCustomFieldsIds.has(n.id),subtext:n.label,value:n.id,onClick:()=>{e.toggle(n)},children:n.name},n.id))]},o))})]})},AC=e=>{const{translate:t}=vl();return(0,i.jsxs)(Wd,{children:[(0,i.jsx)(Xd,{children:(0,i.jsx)(zl,{color:"invisible",leftIcon:"plus",children:t("ajouter_97327")})}),(0,i.jsx)(Zd,{placement:"top-start",width:400,children:(0,i.jsx)(kC,{customFields:e.customFields,selectedCustomFieldsIds:e.usedCustomFieldsIds,toggle:e.toggle})})]})},wC=e=>{const{translate:t}=vl();return(0,i.jsxs)(Ba,{align:"center",css:{background:"$gray50",bd:"gray200 2",padding:"$6"},direction:"column",gap:"2",width:1,children:[(0,i.jsx)(Ar,{font:"gray800 textSm medium",children:t("aucun_champ_per_21094")}),(0,i.jsx)(AC,{customFields:e.customFields,toggle:e.toggle,usedCustomFieldsIds:e.usedCustomFieldsIds})]})},SC=e=>{const{params:{organizationId:t}}=vl(),n=(0,L.useMemo)(()=>e.customFields.filter(t=>e.usedCustomFieldsIds.includes(t.id)),[e.customFields,e.usedCustomFieldsIds]),s=(0,L.useMemo)(()=>new Set(e.usedCustomFieldsIds),[e.usedCustomFieldsIds]),o=(0,L.useCallback)(t=>{s.has(t.id)?e.change(`${e.prefix}usedCustomFieldsIds`,e.usedCustomFieldsIds.filter(e=>e!==t.id)):e.change(`${e.prefix}usedCustomFieldsIds`,[...e.usedCustomFieldsIds,t.id])},[e.prefix,e.usedCustomFieldsIds,s]);return(0,i.jsx)(Ba,{children:so(e.usedCustomFieldsIds)?(0,i.jsxs)(Ba,{css:{flex:"1"},direction:"column",gap:"4",children:[n.map(n=>(0,i.jsxs)(Ba,{align:"end",gap:"3",children:[(0,i.jsx)(Ar,{css:{flex:"1"},children:(0,i.jsx)(yC,{change:e.change,display:!0,field:n,fileAcl:"public-read",isMandatory:!1,organizationId:t,prefix:`${e.prefix}fields.`})}),(0,i.jsx)(zl,{color:"white",leftIcon:"trash-can",onClick:()=>o(n)})]},n.id)),(0,i.jsx)(AC,{customFields:e.customFields,toggle:o,usedCustomFieldsIds:s})]}):(0,i.jsx)(wC,{customFields:e.customFields,toggle:o,usedCustomFieldsIds:s})})},EC=e=>{const t=Xn();return(0,i.jsxs)(Wd,{doNotCloseOnOtherOpen:!0,isOpen:e.isOpen,onStateChange:e.onStateChange,children:[(0,i.jsx)(Xd,{children:(0,i.jsx)(Ar,{children:(0,i.jsxs)(zl,{color:e.color,leftIcon:"bars-filter",children:[t("filtres_64574")," ",(e.numberOfAppliedFilters||0)>0?`(${e.numberOfAppliedFilters})`:""]})})}),(0,i.jsx)(Zd,{placement:"bottom-end",width:385,children:(0,i.jsxs)(Ba,{direction:"column",onChange:Dl,children:[(0,i.jsxs)(Ba,{css:{padding:"$2 $6 $4 $6"},direction:"column",gap:"4",children:[(0,i.jsx)(Ar,{font:"gray800 textMd medium",children:t("liste_des_filtr_75605")}),e.children]}),e.showButtons&&(0,i.jsxs)(Ba,{align:"center",css:{borderTop:"1px solid $gray200",padding:"$4 $6 $2 $6"},gap:"4",justify:"end",children:[(0,i.jsx)(Ar,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:e.reinit,children:t("r_initialiser_77538")}),(0,i.jsx)(zl,{size:"sm",onClick:e.apply,children:t("appliquer_05753")})]})]})})]})};function TC(e){return`${e.name}${m(e.acronym)?` (${e.acronym})`:""}`}function zC(e,t,n,i,s){return i.accreditationDisplay!==pt.None&&!i.hiddenAccreditationsIds.includes(e.id)&&(0===i.displayedAccreditationsIds.length||i.displayedAccreditationsIds.includes(e.id))&&Eh(e,n)&&(!e.hasSlots||e.slots.some(e=>Ph(e,t,i,s)))||s.some(n=>n.accreditationId===e.id&&(!e.hasSlots||e.slots.some(e=>Ph(e,t,i,s))))}function OC(e){return RC(e.map(({accreditationSlot:e})=>e))}function RC(e){return(0,uc.A)(Object.values((0,cc.A)(e,e=>e.accreditation.id)).map(e=>{const t=e[0].accreditationCategory,n=e[0].accreditation,i=e.map(e=>e.date?.toMillis()??1);return{id:n.id,category:t.name,index:n.index,text:m(n.acronym)?n.acronym:n.name,minDate:(0,_h.A)(i),color:n.color,count:e.length,icon:n.icon}}),({category:e,index:t,text:n,minDate:i})=>[e.toLowerCase(),$C(t),n.toLowerCase(),i])}function $C(e){return"number"!=typeof e||isNaN(e)?"9999":e.toString(10).padStart(4,"0")}function DC(e){return(0,uc.A)(e,e=>[e.accreditationCategoryName||"",$C(e.index),e.name.toLowerCase()])}function PC(e,t,n,i,s){let o;const r=t.map(e=>e.accreditationId);if(n){const t={accreditationCategoryId:i.accreditationCategoryId,accreditationId:i.accreditationId,maxResources:null,willAutoAccredit:!0};o=(0,xh.A)([...e,t],e=>e.accreditationId)}else o=e.filter(e=>r.includes(e.accreditationId));s("delegation.accreditations",o)}const FC=({accreditationCategoryId:e,accreditationId:t,accreditationName:n,accreditationSlotsIdsValues:s,change:o,slot:r,values:a})=>{const l=Zn(Jc),d=(0,L.useMemo)(()=>s.includes(r.id),[s]);return(0,i.jsx)(_c,{state:d?"checked":"unchecked",onClick:()=>{const n={accreditationCategoryId:e,accreditationId:t,accreditationSlotId:r.id,isDefault:!1,isVisible:!0},i=d?a.accreditationsSlots.filter(e=>e.accreditationSlotId!==r.id):[...a.accreditationsSlots,n];o("delegation.accreditationsSlots",i),PC(a.accreditations,i,!d,n,o)},children:Dh(l,r,n)})},MC=({accreditationCategoryId:e,accreditation:t,accreditationSlotsIdsValues:n,change:s,fullAccreditation:o,values:r})=>{const a=Xn(),[l,d]=(0,L.useState)(!0),c=(0,L.useMemo)(()=>!o.slots.some(e=>!n.includes(e.id)),[t.slots,n]),u=so((0,L.useMemo)(()=>r.accreditationsSlots.filter(e=>e.accreditationId==t.id),[r])),h=(e,t,n)=>{const i=e?[...r.accreditationsSlots,...n]:r.accreditationsSlots.filter(e=>e.accreditationId!==t);s("delegation.accreditationsSlots",i),PC(r.accreditations,i,e,n[0],s)};return o.hasSlots?(0,i.jsxs)(Ba,{css:{padding:"$4 0",borderRadius:"5px",border:"1px solid $gray200",boxShadow:"$xs",background:"$white"},direction:"column",gap:"4",children:[(0,i.jsxs)(Ba,{css:{padding:"0 $5"},children:[(0,i.jsxs)(Ba,{align:"center",css:{cursor:"pointer"},gap:"2",onClick:()=>{d(!l)},children:[(0,i.jsx)(nl,{icon:l?"chevron-down":"chevron-up"}),t.name]}),(0,i.jsx)(Ar,{css:{flex:"1"}}),(0,i.jsx)(zl,{color:"invisible",onClick:()=>{const n=t.slots.map(n=>({accreditationCategoryId:e,accreditationId:t.id,accreditationSlotId:n.id,isDefault:!1,isVisible:!0}));h(!c,t.id,n)},children:a(c?"tout_des_lectio_13935":"tout_s_lectionn_48027")})]}),l&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Xu,{direction:"horizontal"}),(0,i.jsx)(Ba,{css:{padding:"0 $5"},direction:"column",gap:"4",children:t.slots.toSorted((e,t)=>{if(e.date&&t.date){const n=e.date.toJSDate(),i=t.date.toJSDate();return ni?1:0}return e.namet.name?1:0}).map(o=>(0,i.jsx)(FC,{accreditationCategoryId:e,accreditationId:t.id,accreditationName:t.name,accreditationSlotsIdsValues:n,change:s,slot:o,values:r},o.id))})]})]}):(0,i.jsx)(_c,{css:{padding:"$4 $5",borderRadius:"5px",border:"1px solid $gray200",boxShadow:"$xs",background:"$white"},state:u?"checked":"unchecked",onClick:()=>{const n=[{accreditationCategoryId:e,accreditationId:t.id,accreditationSlotId:t.hiddenSlotId,isDefault:!1,isVisible:!0}];h(!u,t.id,n)},children:t.name})},NC=({accreditationCategory:e,accreditationSlotsIdsValues:t,change:n,fullAccreditationCategory:s,values:o})=>{const r=(0,L.useMemo)(()=>DC(e.accreditations),[e.accreditations]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ar,{color:"gray500",fontSize:"textSm",children:e.name}),r.map(r=>(0,i.jsx)(MC,{accreditation:r,accreditationCategoryId:e.id,accreditationSlotsIdsValues:t,change:n,fullAccreditation:s.accreditations.find(e=>e.id===r.id),values:o},r.id))]})},LC=({allAccreditationCategories:e,change:t,eventStartAt:n,eventEndAt:s,setIsAddAccreditationOpen:o,values:r})=>{const{params:{organizationId:a,eventId:l,delegationId:d},translate:c}=vl(),[u,h]=(0,L.useState)(""),[m,p]=(0,L.useState)([]),[f,_]=(0,L.useState)([]),[x,I]=(0,L.useState)(Gs.c9.invalid("Invalid")),v=(0,L.useMemo)(()=>r.accreditationsSlots.flatMap(e=>e.accreditationSlotId),[r]),b=(0,L.useMemo)(()=>e.flatMap(e=>e.accreditations),[e]),j=(0,L.useMemo)(()=>(0,uc.A)(e.flatMap(e=>{const t=oo(m)||m.includes(e.id),n=e.accreditations.flatMap(e=>{const t=(g(u)||(n=e.name,i=u,n.toUpperCase().includes(i.toUpperCase())))&&(oo(f)||f.includes(e.id));var n,i;const s=e.slots.filter(e=>!x?.isValid||!e.date?.isValid||e.date.equals(x));return t&&(oo(e.slots)||so(s))?[{...e,slots:s}]:[]});return t&&so(n)?[{...e,accreditations:n}]:[]}),e=>e.name.toLowerCase()),[u,m,f,x]);return(0,i.jsxs)(vu,{returnToFallback:hs.DELEGATION_ACCREDITATIONS({organizationId:a,eventId:l,delegationId:d}),size:"md",onClose:()=>{o(!1)},children:[(0,i.jsxs)(bu,{children:[(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(Ar,{font:"gray900 textXl medium",children:c("add_an_accreditation")}),(0,i.jsx)(Ar,{color:"gray500",children:c("add_default_accreditations_to_delegation")}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsxs)(Ba,{gap:"3",justify:"evenly",children:[(0,i.jsx)(Bl,{icon:"magnifying-glass",placeholder:c("rechercher_une_65646"),value:u,onChange:e=>{h(e)}}),(0,i.jsxs)(EC,{color:"gray",showButtons:!1,children:[(0,i.jsx)(yc,{isSearchVisible:!0,isSelectAllVisible:!0,label:c("cat_gories_24533"),multiple:!0,renderOnPortal:!0,values:m,onChange:p,children:e.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(yc,{isSearchVisible:!0,isSelectAllVisible:!0,label:c("accr_ditations_39450"),multiple:!0,renderOnPortal:!0,values:f,onChange:_,children:b.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(Mu,{label:"Date",max:s,min:n,value:x,onChange:I})]})]}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(Ba,{direction:"column",gap:"4",children:j.map(n=>(0,i.jsx)(NC,{accreditationCategory:n,accreditationSlotsIdsValues:v,change:t,fullAccreditationCategory:e.find(e=>e.id===n.id),values:r},n.id))}),(0,i.jsx)(Ya,{height:"6"})]}),(0,i.jsx)(ju,{children:(0,i.jsxs)(Ba,{gap:"3",justify:"end",children:[(0,i.jsx)(zl,{onClick:()=>o(!1),children:c("ajouter_97327")}),(0,i.jsx)(zl,{color:"white",onClick:()=>{t("delegation.accreditations",[]),t("delegation.accreditationsSlots",[])},children:c("r_initialiser_77538")})]})})]})},BC=e=>(0,i.jsx)(Ba,{css:{background:"$gray50",overflowX:"auto",padding:"$6",...e.css},direction:"column",gap:"4",height:1,width:1,children:e.children}),VC=e=>(0,i.jsxs)(Ba,{direction:"column",gap:"2",children:[(0,i.jsx)(Ar,{font:"gray800 textMd medium",children:e.category.name}),(0,i.jsx)(Ba,{direction:"column",gap:"3",children:e.children})]},e.category.id),UC=_r(Ba,{borderRadius:"$2",fontSize:"$textSm",height:"32px",width:"32px","@tablet":{borderRadius:"$3",fontSize:"$textMd",height:"40px",width:"40px"}}),WC=e=>{const t=(0,L.useMemo)(()=>ic(e.color??""),[e.color]),n=(0,L.useMemo)(()=>xn.includes(e.icon)?tl(e.icon):e.icon,[e.icon]);return(0,i.jsx)(UC,{align:"center",css:{background:t[100],color:t[700],...e.css},justify:"center",role:"presentation",children:(0,i.jsx)(nl,{icon:n})})},GC=e=>{const{translate:t}=vl(),n=L.useMemo(()=>TC(e.accreditation),[e.accreditation]),[s,o]=L.useState(!0),r=e.displaySlots||"function"==typeof e.renderCheckbox;return(0,i.jsxs)(Ba,{css:{background:"white",bd:!0,overflow:"hidden",userSelect:"none"},direction:"column",children:[(0,i.jsxs)(Ba,{align:"center",css:{cursor:r?"pointer":"default",padding:"$3 $4"},gap:"2",onClick:()=>{o(!s),e.onClick?.()},children:[e.displaySlots&&(0,i.jsx)(Ba,{align:"center",css:{fontSize:"$textXs"},height:20,justify:"center",width:20,children:(0,i.jsx)(nl,{icon:s?"chevron-down":"chevron-right"})}),e.renderCheckbox?.(),(0,i.jsx)(WC,{color:e.accreditation.color,icon:e.accreditation.icon}),(0,i.jsxs)(Ba,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(Ar,{font:"gray800 textSm semiBold",children:n}),e.displayNumberOfSlots&&(0,i.jsx)(Ar,{color:"gray500",children:t("creneau",e.numberOfSlots)})]}),e.renderActions?.()]}),(e.displayFormCustomFields||e.displaySlots&&s)&&(0,i.jsx)(Ba,{css:{borderTop:"1px solid $gray200"},direction:"column",children:e.children})]})},HC=e=>{const{translate:t}=vl(),[n,s]=(0,L.useState)(void 0),o=(0,L.useCallback)(t=>{e.change("delegation.accreditationsSlots",(0,xu.jM)(e.values.delegation.accreditationsSlots,n=>{n.forEach(n=>{e.slotsIds.includes(n.accreditationSlotId)&&(n.maxResources=t)})})),s(t)},[e.selectedSlotsIds,e.slotsIds,e.values,e.change,s]),r=(0,L.useMemo)(()=>e.values.delegation.accreditationsSlots.find(t=>t.accreditationSlotId===e.selectedSlotsIds[0]),[e.selectedSlotsIds,e.values]),a=r?.isDefault??!1,l=r?.isVisible??!0,d=(0,L.useCallback)(()=>{e.change("delegation.accreditationsSlots",(0,xu.jM)(e.values.delegation.accreditationsSlots,t=>{t.forEach(t=>{e.selectedSlotsIds.includes(t.accreditationSlotId)&&(a?(t.isDefault=!1,t.isVisible=!0):t.isDefault=!0)})})),e.change("selectedAccreditationsSlotsIds",[])},[e.selectedSlotsIds,e.values,e.change,a]),c=(0,L.useCallback)(()=>{e.change("delegation.accreditationsSlots",(0,xu.jM)(e.values.delegation.accreditationsSlots,t=>{t.forEach(t=>{e.selectedSlotsIds.includes(t.accreditationSlotId)&&(l?(t.isDefault=!0,t.isVisible=!1):t.isVisible=!0)})})),e.change("selectedAccreditationsSlotsIds",[])},[e.selectedSlotsIds,e.values,e.change,l]),u=(0,L.useCallback)(()=>{e.change("selectedAccreditationsSlotsIds",(0,mc.A)(e.values.selectedAccreditationsSlotsIds,e.selectedSlotsIds)),e.change("delegation.accreditationsSlots",e.values.delegation.accreditationsSlots.filter(t=>!e.selectedSlotsIds.includes(t.accreditationSlotId)))},[e.selectedSlotsIds,e.values,e.change]);return so(e.selectedSlotsIds)?(0,i.jsxs)(Ba,{gap:"3",onClick:Dl,children:[(0,i.jsxs)(Ba,{align:"center",css:{color:"$gray800",cursor:"pointer"},gap:"2",onClick:d,children:[(0,i.jsx)(Ar,{fontSize:"textXs",children:(0,i.jsx)(nl,{icon:"badge"})}),(0,i.jsx)(Ar,{fontWeight:"medium",children:t(a?"ne_pas_accr_dit_59893":"accr_diter_par_72403")})]}),(0,i.jsxs)(Ba,{align:"center",css:{color:"$gray800",cursor:"pointer"},gap:"2",onClick:c,children:[(0,i.jsx)(Ar,{fontSize:"textXs",children:(0,i.jsx)(nl,{icon:l?"eye-slash":"eye"})}),(0,i.jsx)(Ar,{fontWeight:"medium",children:t(l?"masquer_34645":"rendre_visible_37057")})]}),(0,i.jsxs)(Ba,{align:"center",css:{color:"$gray800",cursor:"pointer"},gap:"2",children:[(0,i.jsx)(Ar,{fontWeight:"medium",children:t("total_07173")}),(0,i.jsx)(Ar,{width:100,children:(0,i.jsx)(Bl,{min:0,rightIcon:"xmark",shouldParseAsInt:!0,value:n??"",onChange:o,onRightIconClick:()=>o(void 0)})})]}),(0,i.jsxs)(Ba,{align:"center",css:{color:"$gray800",cursor:"pointer"},gap:"2",onClick:u,children:[(0,i.jsx)(Ar,{fontSize:"textXs",children:(0,i.jsx)(nl,{icon:"trash-can"})}),(0,i.jsx)(Ar,{fontWeight:"medium",children:t("supprimer_43083")})]})]}):(0,i.jsxs)(Ba,{align:"center",gap:"6",onClick:Dl,children:[e.hasSlots&&(0,i.jsxs)(Ba,{align:"center",gap:"2",children:[(0,i.jsx)(Ar,{children:t("limite_totale_35352")}),(0,i.jsx)(Ar,{width:100,children:(0,i.jsx)(Vl,{name:`${e.prefix}maxResources`,shouldParseAsInt:!0,treatIntNaNAsNull:!0})})]}),(0,i.jsx)(Jm,{name:`${e.prefix}willAutoAccredit`,children:t("attribuer_autom_13895")})]})},qC=e=>{const{translate:t}=vl(),n=Zn(Jc),s=(0,L.useMemo)(()=>e.values.delegation.accreditationsSlots.findIndex(t=>t.accreditationSlotId===e.slot.id),[e.values,e.slot]),o=e.values.delegation.accreditationsSlots[s],r=`delegation.accreditationsSlots[${s}].`,a=o?.isDefault?"checked":"unchecked",l=(0,L.useMemo)(()=>e.values.selectedAccreditationsSlotsIds.includes(e.slot.id)?"checked":"unchecked",[e.slot,e.values.selectedAccreditationsSlotsIds]),d=(0,L.useCallback)(t=>{e.change(`${r}isDefault`,"checked"===t),"checked"===t&&e.values.delegation.accreditationsSlots.forEach((t,n)=>{t.accreditationSlotId!==o.accreditationSlotId&&t.accreditationId===o.accreditationId&&e.change(`delegation.accreditationsSlots[${n}].isDefault`,!1)}),"unchecked"===t&&e.change(`${r}isVisible`,!0)},[r,o,e.values,e.change]),c=(0,L.useCallback)(t=>{e.change(`${r}isDefault`,"checked"===t),"unchecked"===t&&e.change(`${r}isVisible`,!0)},[r,e.change]),u=(0,L.useCallback)(t=>{e.change("selectedAccreditationsSlotsIds",ro(e.values.selectedAccreditationsSlotsIds,e.slot.id,"checked"===t))},[e.slot,e.values.selectedAccreditationsSlotsIds,e.change]);return(0,i.jsxs)(Mc,{children:[e.displaySelectedCheckbox&&(0,i.jsx)(Oc,{width:48,children:(0,i.jsx)(fc,{state:l,onClick:u})}),(0,i.jsx)(Oc,{css:{textTransform:"capitalize"},children:e.slot.date?n.toLocaleString(e.slot.date,eo.DateOnly.WeekdayShortMonthShort):"-"}),(0,i.jsx)(Oc,{children:m(e.slot.name)?e.slot.name:"-"}),(0,i.jsx)(Oc,{children:e.accreditationDisplay===ie.Radio?(0,i.jsx)(vc,{state:a,onClick:d,children:t("accr_ditation_p_28030")}):(0,i.jsx)(_c,{state:a,onClick:c,children:t("accr_ditation_p_28030")})}),(0,i.jsx)(Oc,{width:100,children:(0,i.jsx)(zl,{color:"white",disabled:!o.isDefault,leftIcon:o.isVisible?"eye":"eye-slash",onClick:()=>{e.change(`${r}isVisible`,!o.isVisible)}})}),(0,i.jsx)(Oc,{width:130,children:(0,i.jsx)(Vl,{min:0,name:`${r}maxResources`,shouldParseAsInt:!0,treatIntNaNAsNull:!0})})]})},KC=e=>{const{translate:t}=vl(),n=(0,L.useMemo)(()=>e.values.delegation.accreditations.findIndex(t=>t.accreditationId===e.accreditation.id),[e.values,e.accreditation]),s=(0,L.useMemo)(()=>Nh(e.slots.filter(t=>t.accreditationId===e.accreditation.id)),[e.slots,e.accreditation]),o=(0,L.useMemo)(()=>s.map(e=>e.id),[s]),r=`delegation.accreditations[${n}].`,a=(0,L.useMemo)(()=>{if(e.accreditation.hasSlots){const t=(0,Bs.A)(s.map(t=>e.values.selectedAccreditationsSlotsIds.includes(t.id)));return 2===t.length?"indeterminate":t[0]?"checked":"unchecked"}return"unchecked"},[e.accreditation,e.values.selectedAccreditationsSlotsIds,s]),l=(0,L.useMemo)(()=>o.filter(t=>e.values.selectedAccreditationsSlotsIds.includes(t)),[e.values.selectedAccreditationsSlotsIds,o]),d=(0,L.useCallback)(t=>{"checked"===t?e.change("selectedAccreditationsSlotsIds",(0,Bs.A)(e.values.selectedAccreditationsSlotsIds.concat(o))):e.change("selectedAccreditationsSlotsIds",(0,mc.A)(e.values.selectedAccreditationsSlotsIds,o))},[e.values.selectedAccreditationsSlotsIds,e.change,o]);return(0,i.jsx)(GC,{accreditation:e.accreditation,displayNumberOfSlots:!0,displaySlots:!0,numberOfSlots:s.length,renderActions:()=>(0,i.jsx)(HC,{change:e.change,hasSlots:e.accreditation.hasSlots,prefix:r,selectedSlotsIds:l,slotsIds:o,values:e.values}),children:(0,i.jsxs)(Sc,{hideBorder:!0,children:[(0,i.jsxs)(kc,{children:[e.accreditation.hasSlots&&(0,i.jsx)(Gc,{width:48,children:(0,i.jsx)(fc,{state:a,onClick:d})}),(0,i.jsx)(Gc,{children:t("date_du_cr_neau_82295")}),(0,i.jsx)(Gc,{children:t("nom_du_cr_neau_54351")}),(0,i.jsx)(Gc,{children:t("accr_ditation_p_28030")}),(0,i.jsx)(Gc,{width:100,children:t("Privacy")}),(0,i.jsx)(Gc,{width:130,children:t("total_07173")})]}),s.map((t,n)=>(0,i.jsx)(qC,{accreditationDisplay:e.accreditation.accreditationDisplay,change:e.change,displaySelectedCheckbox:e.accreditation.hasSlots,slot:t,values:e.values},`${t.id}-${n}`))]})})},YC=e=>{const t=(0,L.useMemo)(()=>DC(e.accreditations.filter(t=>t.accreditationCategoryId===e.category.id)),[e.accreditations,e.category]);return(0,i.jsx)(VC,{category:e.category,children:t.map((t,n)=>(0,i.jsx)(KC,{accreditation:t,change:e.change,slots:e.slots,values:e.values},`${t.id}-${n}`))})},ZC=e=>{const t=(0,L.useMemo)(()=>e.values.delegation.accreditationsSlots.map(e=>e.accreditationCategoryId),[e.values]),n=(0,L.useMemo)(()=>e.values.delegation.accreditationsSlots.map(e=>e.accreditationId),[e.values]),s=(0,L.useMemo)(()=>e.values.delegation.accreditationsSlots.map(e=>e.accreditationSlotId),[e.values]),o=(0,L.useMemo)(()=>(0,uc.A)(e.accreditationCategories.filter(e=>t.includes(e.id)),e=>e.name.toLowerCase()),[e.accreditationCategories,t]),r=(0,L.useMemo)(()=>e.accreditationCategories.flatMap(e=>e.accreditations).filter(e=>n.includes(e.id)),[e.accreditationCategories,n]),a=(0,L.useMemo)(()=>r.flatMap(e=>e.slots).filter(e=>s.includes(e.id)),[r,s]);return(0,i.jsx)(BC,{css:{border:"1px solid $gray100",borderRadius:"$1"},children:o.map(t=>(0,i.jsx)(YC,{accreditations:r,category:t,change:e.change,slots:a,values:e.values},t.id))})},XC=({allAccreditationCategories:e,setIsAddAccreditationOpen:t,change:n,values:s})=>{const{translate:o}=vl(),r=(0,L.useMemo)(()=>s.delegation.accreditationsSlots.some(({isDefault:e})=>e),[s]);return(0,i.jsxs)(Ba,{direction:"column",children:[(0,i.jsx)(Ar,{font:"gray900 textMd medium",children:o("liste_des_accr_46997")}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(ZC,{accreditationCategories:e,change:n,values:s}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(zl,{color:"invisible",leftIcon:"plus",onClick:()=>{t(!0)},children:o("add_accreditation")}),r&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(Ar,{font:"gray900 textMd medium",children:o("attribution_des_59896")}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Jm,{name:"delegation.addDefaultAccreditationsByAvailability",children:o("attribuer_les_a_56919")})]})]})},JC=e=>(0,i.jsxs)(Ba,{gap:"7",children:[(0,i.jsx)(Ar,{font:"gray800 textSm medium",width:280,children:e.title}),(0,i.jsx)(Ba,{css:{flex:"1"},direction:"column",children:e.children})]}),QC=e=>{const{translate:t}=vl(),n=Zn(Zh),[s,o]=(0,L.useState)(!1),r=(0,L.useMemo)(()=>n.getDelegationMembersPossibleColumns(e.customFields,{isWeezeventConnected:!0,positionDisplay:_t.Position,slotDisplay:It.Custom}),[n,e.customFields]),a=(0,L.useMemo)(()=>(0,Za.A)(e.values.delegation.columns.map(e=>r.find(t=>t.slug===e))),[r,e.values.delegation]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ba,{css:{bd:!0,overflow:"hidden"},direction:"column",width:1,children:[(0,i.jsx)(Ba,{css:{background:"$gray50",borderBottom:"1px solid $gray200",color:"$gray500",padding:"$3 $6"},children:t("liste_des_colon_20101")}),(0,i.jsxs)(Ba,{css:{padding:"$4"},direction:"column",gap:"4",children:[(0,i.jsx)(Ba,{direction:"column",gap:"2",children:a.map(t=>(0,i.jsxs)(Ba,{align:"center",css:{border:"1px solid $gray200",borderRadius:"$1",overflow:"hidden",padding:"$3"},gap:"3",children:[(0,i.jsx)(Ar,{color:"gray700",css:{flex:"1"},children:t.name}),(0,i.jsx)(zl,{color:"white",leftIcon:"trash-can",size:"sm",onClick:()=>{e.change("delegation.columns",(0,hc.A)(e.values.delegation.columns,t.slug))}})]},t.slug))}),(0,i.jsx)(zl,{color:"invisible",leftIcon:"gear",onClick:()=>{o(!0)},children:t("_diter_les_colo_39630")})]})]}),s&&(0,i.jsx)(Au,{columns:r,initialSelectedColumns:e.values.delegation.columns,saveButtonText:t("_diter_62574"),searchPlaceholder:t("rechercher_un_c_86475"),subtitle:t("personnaliser_l_96096"),title:t("_dition_des_col_70300"),onClose:()=>{o(!1)},onSave:t=>{e.change("delegation.columns",t)}})]})},ey=e=>{const{translate:t}=vl();return(0,i.jsxs)(Ba,{direction:"column",children:[(0,i.jsx)(JC,{title:t("liste_des_colon_20101"),children:(0,i.jsx)(QC,{change:e.change,customFields:e.customFields,values:e.values})}),(0,i.jsx)(Ju,{height:"5"}),(0,i.jsx)(JC,{title:t("droits_des_resp_01552"),children:(0,i.jsxs)(Ba,{direction:"column",gap:"3",width:1,children:[(0,i.jsx)(Jm,{name:"delegation.showFormLinkInDelegationSpace",children:t("afficher_le_lie_05841")}),(0,i.jsx)(Jm,{name:"delegation.canLeadersAddMembers",children:t("CanLeadersAddMembers")}),(0,i.jsx)(Jm,{name:"delegation.canLeadersImportMembers",children:t("CanLeadersImportMembers")}),(0,i.jsx)(Jm,{name:"delegation.canLeadersEditMembers",children:t("CanLeadersEditMembers")}),(0,i.jsx)(Jm,{name:"delegation.canLeadersDeleteMembers",children:t("CanLeadersDeleteMembers")}),(0,i.jsx)(Jm,{name:"delegation.canLeadersEditColumns",children:t("CanLeadersEditColumns")}),(0,i.jsx)(Jm,{name:"delegation.canLeadersEditCustomFields",children:t("CanLeadersEditCustomFields")}),(0,i.jsx)(Jm,{name:"delegation.canLeadersSeeHiddenAccreditationsSlots",children:t("CanLeadersSeeHiddenAccreditationsSlots")})]})}),(0,i.jsx)(Ju,{height:"5"}),(0,i.jsx)(JC,{title:t("communication_05277"),children:(0,i.jsxs)(Ba,{direction:"column",gap:"6",width:1,children:[(0,i.jsx)(Ym,{isSearchVisible:!0,isSelectAllVisible:!0,label:t("liste_des_campa_21201"),multiple:!0,name:"delegation.campaignsIds",children:e.campaigns.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(Ym,{isSearchVisible:!0,isSelectAllVisible:!0,label:t("liste_des_docum_18767"),multiple:!0,name:"delegation.customDocumentsSlugs",children:e.customDocuments.map(e=>(0,i.jsx)("option",{value:e.slug,children:e.name},e.slug))})]})})]})};function ty(e){return(0,uc.A)(e,e=>e.name.toLowerCase())}const ny=e=>{const t=Xn(),n=(0,L.useMemo)(()=>d.Ik().shape({name:d.Yj().required(t("le_nom_est_requ_61536"))}),[]);return(0,i.jsx)(oC,{buttonText:e.isEdit?t("renommer_42135"):t("cr_er_82895"),icon:"pen",initialValues:{name:e.initialName},schema:n,title:e.isEdit?t("renommer_1_40542",e.initialName):t("cr_er_une_nouve_72722"),onClose:e.onClose,onSubmit:async t=>{const n=await e.mutate(t.name);e.onClose(),e.onSuccess(n)},children:(0,i.jsx)(Vl,{label:t("nom_de_la_cat_g_03860"),name:"name"})})},iy=e=>{const{mutate:t}=function(e={}){return ei("mutation DelegationCategoryCreate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $delegationCategory: DelegationsCategoryInput!\n) {\n delegationCategoryCreate(\n organizationId: $organizationId\n eventId: $eventId\n delegationCategory: $delegationCategory\n ) {\n id\n name\n }\n}\n",e)}();return(0,i.jsx)(ny,{initialName:"",isEdit:!1,mutate:async n=>(await t({organizationId:e.organizationId,eventId:e.eventId,delegationCategory:{name:n}})).delegationCategoryCreate,onClose:e.onClose,onSuccess:e.onSuccess})},sy=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=vl(),[o,r]=(0,L.useState)(0),[a,l,d]=Wc(""),{usersInfosOptions:c,isLoading:u}=Xb({organizationId:n,eventId:null,hasSelected:so(e.leadersIds),nameDebounced:l,reloadKey:o,userInfoIds:e.leadersIds}),[h,m]=(0,L.useState)(!1),[g,p]=(0,L.useState)(ty(e.categories)),[f,_]=(0,L.useState)(!!e.initialParentId),x=(0,L.useCallback)(t=>{t||e.change("delegation.parentId",null),_(t)},[e.change,_]),I=(0,L.useCallback)(t=>{const n=e.organizationDelegations.find(e=>e.id===t);n&&(e.change("delegation.leadersIds",n.leadersIds),r(e=>e+1))},[e.organizationDelegations,e.leadersIds]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Nr.Yr,{name:"delegation.parentId",children:I}),"event"===e.delegationType&&so(e.organizationDelegations)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ku,{value:f,onChange:x,children:t("lier_cette_d_l_78975")}),(0,i.jsx)(Ya,{height:"6"})]}),f?(0,i.jsx)(Ym,{isSearchVisible:!0,label:t("_quelle_d_l_ga_70215"),name:"delegation.parentId",children:e.organizationDelegations.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}):(0,i.jsx)(Vl,{label:t("nom_de_votre_d_69290"),name:"delegation.name"}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(Ym,{isCreateVisible:!0,isSearchVisible:!0,label:t("cat_gorie_00291"),name:"delegation.delegationCategoryId",onCreateClick:()=>{m(!0)},children:g.map(({id:e,name:t})=>(0,i.jsx)("option",{value:e,children:t},e))}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(Ym,{isSearchLoading:u,isSearchVisible:!0,label:t("reponsable_82458_plural"),multiple:!0,name:"delegation.leadersIds",searchElement:(0,i.jsx)(Bl,{icon:"magnifying-glass",placeholder:t("rechercher_un_m_05904"),state:"search",value:a,onChange:d}),children:c}),h&&(0,i.jsx)(iy,{eventId:s,organizationId:n,onClose:()=>{m(!1)},onSuccess:t=>{p(ty([...g,t])),e.change("delegation.delegationCategoryId",t.id)}})]})},oy=e=>(0,i.jsx)(sy,{categories:e.categories,change:e.change,delegationType:"event",initialParentId:e.initialParentId,leadersIds:e.leadersIds,organizationDelegations:e.organizationDelegations}),ry=e=>(0,i.jsx)(sy,{categories:e.categories,change:e.change,delegationType:"organization",initialParentId:null,leadersIds:e.leadersIds,organizationDelegations:[]}),ay=e=>{const t=Xn(),n=(0,L.useMemo)(()=>(0,uc.A)(e.forms,e=>e.name),[e.forms]),[s,o]=(0,L.useState)(!!e.initialValues.delegation.deadlineDate),[r,a]=(0,L.useState)(Number.isInteger(e.initialValues.delegation.maxResources));return(0,i.jsxs)(Ba,{direction:"column",children:[(0,i.jsx)(JC,{title:t("Form"),children:(0,i.jsx)(Ym,{isSearchVisible:!0,label:t("avec_quel_formu_60160"),name:"delegation.formId",placeholder:t("s_lectionnez_un_77066"),children:n.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})}),(0,i.jsx)(Ju,{height:"5"}),(0,i.jsxs)(JC,{title:t("inscription_dan_16147"),children:[(0,i.jsx)(Ar,{font:"gray800 textSm semiBold",children:t("les_inscription_64653")}),(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(vc,{state:s?"checked":"unchecked",onClick:()=>{o(!0)},children:t("oui_il_y_a_une_68479")}),s&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(Hm,{name:"delegation.deadlineDate"}),(0,i.jsx)(Ya,{height:"3"})]}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:s?"unchecked":"checked",onClick:()=>{o(!1),e.change("delegation.deadlineDate",null)},children:t("non_les_inscri_87979")}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(Ar,{font:"gray800 textSm semiBold",children:t("les_inscription_76218")}),(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(vc,{state:r?"checked":"unchecked",onClick:()=>{a(!0)},children:t("oui_il_y_a_une_02976")}),r&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(Vl,{name:"delegation.maxResources",shouldParseAsInt:!0}),(0,i.jsx)(Ya,{height:"3"})]}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:r?"unchecked":"checked",onClick:()=>{a(!1),e.change("delegation.maxResources",null)},children:t("non_les_inscri_07566")})]})]})},ly=e=>{const{translate:t}=vl();return(0,i.jsx)(Lb,{isOpen:e.isOpen,onClose:e.onClose,children:(0,i.jsxs)(Nb,{children:[(0,i.jsx)(Mb,{icon:"triangle-exclamation",children:t("accr_ditations_34551")}),(0,i.jsx)(Fb,{children:(0,i.jsxs)(Ba,{align:"center",direction:"column",gap:"1",width:1,children:[(0,i.jsx)(Ar,{font:"gray900 textLg medium",children:t("voulez_vous_met_24993")}),(0,i.jsx)(Ar,{color:"gray500",textAlign:"center",children:t("les_accr_ditati_76418",e.deletedAccreditationsSlots.join(", "))})]})}),(0,i.jsx)(Pb,{children:(0,i.jsx)(zl,{isLoading:e.submitting,onClick:e.handleSubmit,children:t("mettre_jour_l_69948")})})]})})},dy=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=vl(),o=L.useMemo(()=>m(e.initialValues.delegation.description)||m(e.initialValues.delegation.privateNote),[e.initialValues]),r=L.useMemo(()=>e.isEdit&&so(e.initialValues.delegation.accreditationsSlots),[e.initialValues,e.isEdit]),a=L.useMemo(()=>e.isEdit&&so(e.initialValues.delegation.usedCustomFieldsIds),[e.initialValues,e.isEdit]),l=L.useMemo(()=>e.isEdit&&so(e.initialValues.delegation.customFields),[e.initialValues,e.isEdit]),d=L.useMemo(()=>so(e.initialValues.delegation.tagsIds),[e.initialValues]),c=function(e,t,n){const i=Zn(Jc),s=(0,L.useMemo)(()=>{const e=t.delegation.accreditationsSlots.map(e=>e.accreditationSlotId),i=n.delegation.accreditationsSlots.map(e=>e.accreditationSlotId);return(0,mc.A)(e,i)},[t,n]);return(0,L.useMemo)(()=>e.flatMap(e=>e.accreditations.flatMap(e=>e.slots.flatMap(t=>s.includes(t.id)?[Dh(i,t,e.name,{accreditation:{includeName:!0}})]:[]))),[s,e])}("event"===e.delegationType?e.accreditationsCategories:[],e.initialValues,e.values),[u,h]=L.useState(!1),[g,p]=L.useState(!1),f=L.useCallback(()=>{so(c)?p(!0):e.handleSubmit()},[c,p,e.handleSubmit]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Lm,{button:e.isEdit?(0,i.jsx)(zl,{isLoading:e.submitting,onClick:f,children:t("mettre_jour_l_69948")}):null,category:e.isEdit?t("mise_jour_de_17055",e.initialValues.delegation.name):t("cr_ation_d_une_07120"),color:"dark",fallbackClosePath:hs.DELEGATIONS({organizationId:n,eventId:s}),heading:e.isEdit?e.initialValues.delegation.name:t("nouvelle_d_l_ga_42871"),children:(0,i.jsxs)(Mm,{ref:e.centeredContainerRef,children:[(0,i.jsx)(jl,{}),(0,i.jsx)(Vm,{hideToggle:!0,initialIsOpen:!0,heading:t("informations_su_34607"),children:"event"===e.delegationType?(0,i.jsx)(oy,{categories:e.categories,change:e.form.change,initialParentId:e.initialValues.delegation.parentId,leadersIds:e.values.delegation.leadersIds,organizationDelegations:e.organizationDelegations}):(0,i.jsx)(ry,{categories:e.categories,change:e.form.change,leadersIds:e.values.delegation.leadersIds})}),(0,i.jsx)(Ya,{height:"5"}),(0,i.jsx)(Vm,{hideToggle:!0,initialIsOpen:!0,heading:t("param_tres_de_l_81810"),children:(0,i.jsx)(ay,{change:e.form.change,forms:e.forms,initialValues:e.initialValues})}),(0,i.jsx)(Ya,{height:"5"}),(0,i.jsx)(Vm,{initialIsOpen:e.values.delegation.showInDelegationSpace,subtitle:t("param_trer_les_35157"),heading:t("espace_d_l_gati_59251"),onToggle:t=>{t||(e.form.change("delegation.campaignsIds",[]),e.form.change("delegation.customDocumentsSlugs",[])),e.form.change("delegation.showInDelegationSpace",t)},children:(0,i.jsx)(ey,{campaigns:e.campaigns,change:e.form.change,customDocuments:"event"===e.delegationType?e.customDocuments:[],customFields:e.customFields,values:e.values})}),(0,i.jsx)(Ya,{height:"5"}),"event"===e.delegationType&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Vm,{initialIsOpen:r,subtitle:t("delegation_accreditations_desc"),heading:t("accr_ditations_39450"),onToggle:t=>{t||e.form.change("delegation.accreditationsSlots",[])},children:(0,i.jsx)(XC,{allAccreditationCategories:e.accreditationsCategories,change:e.form.change,setIsAddAccreditationOpen:h,values:e.values})}),(0,i.jsx)(Ya,{height:"5"})]}),(0,i.jsx)(Vm,{initialIsOpen:a,subtitle:t("ajouter_des_inf_57824"),heading:t("champs_de_formu_64126"),onToggle:t=>{t||(e.form.change("delegation.usedCustomFieldsIds",[]),e.form.change("delegation.fields",(0,ur.A)(e.values.delegation.fields,e.delegationCustomFields.map(e=>e.slug))))},children:(0,i.jsx)(SC,{change:e.form.change,customFields:e.delegationCustomFields,prefix:"delegation.",usedCustomFieldsIds:e.values.delegation.usedCustomFieldsIds})}),(0,i.jsx)(Ya,{height:"5"}),(0,i.jsx)(Vm,{initialIsOpen:l,subtitle:t("choisissez_une_24029"),heading:t("d_finir_la_vale_27863"),onToggle:t=>{t||e.form.change("delegation.customFields",[])},children:(0,i.jsx)(iC,{change:e.form.change,customFields:e.customFields,name:"delegation.customFields",values:e.values.delegation.customFields})}),(0,i.jsx)(Ya,{height:"5"}),(0,i.jsxs)(Vm,{initialIsOpen:o,subtitle:t("ajoutez_une_des_54307"),heading:t("description_et_59312"),onToggle:t=>{t||(e.form.change("delegation.description",""),e.form.change("delegation.privateNote",""))},children:[(0,i.jsx)(rb,{label:(0,i.jsx)(Zv,{children:t("description_58935")}),name:"delegation.description"}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(rb,{label:(0,i.jsx)(Zv,{children:t("note_priv_e_06303")}),name:"delegation.privateNote"})]}),(0,i.jsx)(Ya,{height:"5"}),(0,i.jsx)(Vm,{initialIsOpen:d,subtitle:t("ajouter_des_tag_35833"),heading:t("tags_79499"),onToggle:t=>{t||e.form.change("delegation.tagsIds",[])},children:(0,i.jsx)(aC,{change:e.form.change,name:"delegation.",organizationId:n,tags:e.tags,tagsIds:e.values.delegation.tagsIds})}),(0,i.jsx)(Ya,{height:"5"}),(0,i.jsx)(Bm,{children:(0,i.jsx)(zl,{isLoading:e.submitting,textAlign:"center",onClick:f,children:e.isEdit?t("mettre_jour_l_69948"):t("cr_er_la_d_l_ga_53268")})})]})}),"event"===e.delegationType&&u&&(0,i.jsx)(LC,{allAccreditationCategories:e.accreditationsCategories,change:e.form.change,eventEndAt:e.eventEndAt,eventStartAt:e.eventStartAt,setIsAddAccreditationOpen:h,values:e.values.delegation}),(0,i.jsx)(ly,{deletedAccreditationsSlots:c,handleSubmit:e.handleSubmit,isOpen:g,submitting:e.submitting,onClose:()=>{p(!1)}})]})},cy=e=>{const{history:t,translate:n,params:{organizationId:s,eventId:o}}=vl(),{showNotification:r}=Ob(),a=Zn(Vj),l=Zn(Ua),d=(0,L.useRef)(null);return Md((0,L.useMemo)(()=>e.isEdit?n("mise_jour_de_17055",e.initialValues.delegation.name):n("cr_ation_d_une_07120"),[e.isEdit,e.initialValues])),(0,i.jsx)(kl,{customErrorRef:d,height:1,initialValues:e.initialValues,render:({form:t,handleSubmit:n,submitting:s,values:o})=>(0,i.jsx)(dy,{...e,centeredContainerRef:d,form:t,handleSubmit:n,submitting:s,values:o}),validate:l.validateForForm(a.createUpdateDelegationSchema()),width:1,onSubmit:async i=>{await e.mutate({organizationId:s,eventId:o,delegation:i.delegation}),r(e.isEdit?n("la_d_l_gation_a_86694"):n("la_d_l_gation_a_01157")),t.goBack(hs.DELEGATIONS({organizationId:s,eventId:o}))}})},uy=(e,t)=>{try{if(m(e)&&!isNaN((0,Uj.A)(e,10)))return{delegationCategoryId:(0,Uj.A)(e,10)};if(m(e)){const n=JSON.parse(r(e)),i=n.parentId,s=n.applyParentSettings?t.find(e=>e.id===i):null;return{parentId:i,parentDelegation:s}}return{}}catch{return{}}},hy=()=>{const{params:{organizationId:e,eventId:t,options:n}}=vl(),s=Zn(Vj),{data:o,loader:r}=Qn("query DelegationEventInfos($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n ...CreatePositionTags\n ...OrganizationCustomFields\n\n delegationsCategories(level: Event, eventId: $eventId) {\n nodes {\n id\n name\n }\n }\n\n delegationCustomFields: customFields(variety: Delegation, privacy: Public) {\n nodes {\n ...AttachCustomField\n }\n }\n\n delegations(level: Organization) {\n nodes {\n id\n name\n privateNote\n leadersIds\n tagsIds\n columns\n\n delegationCategory {\n name\n }\n\n form {\n name\n }\n }\n }\n }\n\n event(id: $eventId) {\n ...CreateDelegationEvent\n }\n}\n",{organizationId:e,eventId:t},[Vs.CreatePositionTagsFragment,Vs.OrganizationCustomFieldsFragment,Vs.AttachCustomFieldFragment,Vs.CreateDelegationEventFragment]),{mutate:a}=ea(),l=(0,L.useMemo)(()=>{if(o.organization){const{delegationCategoryId:e,parentId:t,parentDelegation:i}=uy(n,o.organization.delegations.nodes);return s.createUpdateDelegationValuesDefault(null,{delegationCategoryId:e,delegationsCategories:o.organization.delegationsCategories.nodes,forms:o.event.forms.nodes,parentId:t,parentDelegation:i})}return{}},[n,o]);return r||(0,i.jsx)(cy,{accreditationsCategories:o.event.accreditationsCategories,campaigns:o.event.campaigns.nodes,categories:o.organization.delegationsCategories.nodes,closePath:hs.DELEGATIONS({organizationId:e,eventId:t}),customDocuments:o.event.customDocuments,customFields:o.organization.customFields.nodes,delegationCustomFields:o.organization.delegationCustomFields.nodes,delegationType:"event",eventEndAt:o.event.endAt,eventStartAt:o.event.startAt,forms:o.event.forms.nodes,initialValues:l,isEdit:!1,mutate:async e=>(await a(e)).delegationCreate.id,organizationDelegations:o.organization.delegations.nodes,tags:o.organization.tags.nodes})},my=()=>{const{params:{organizationId:e,options:t}}=vl(),n=Zn(Vj),{data:s,loader:o}=Qn("query DelegationOrganizationInfos($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n ...CreatePositionTags\n ...OrganizationCustomFields\n\n campaigns(level: Organization, states: [Template]) {\n nodes {\n id\n name\n }\n }\n\n delegationsCategories(level: Organization) {\n nodes {\n id\n name\n }\n }\n\n delegationCustomFields: customFields(variety: Delegation, privacy: Public) {\n nodes {\n ...AttachCustomField\n }\n }\n\n forms(level: Organization) {\n nodes {\n ...CreateDelegationForm\n }\n }\n }\n}\n",{organizationId:e},[Vs.CreatePositionTagsFragment,Vs.OrganizationCustomFieldsFragment,Vs.AttachCustomFieldFragment,Vs.CreateDelegationFormFragment]),{mutate:r}=ea(),a=(0,L.useMemo)(()=>{const{delegationCategoryId:e}=uy(t,[]);return n.createUpdateDelegationValuesDefault(null,{delegationCategoryId:e})},[]);return o||(0,i.jsx)(cy,{campaigns:s.organization.campaigns.nodes,categories:s.organization.delegationsCategories.nodes,closePath:Ps.COMMUNITY_DELEGATIONS(e),customFields:s.organization.customFields.nodes,delegationCustomFields:s.organization.delegationCustomFields.nodes,delegationType:"organization",forms:s.organization.forms.nodes,initialValues:a,isEdit:!1,mutate:async e=>(await r(e)).delegationCreate.id,tags:s.organization.tags.nodes})},gy=()=>{const{params:{organizationId:e,eventId:t,delegationId:n}}=vl(),s=Zn(Vj),{data:o,loader:r}=Qn("query DelegationEventToEdit(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $delegationId: DelegationId!\n) {\n organization(id: $organizationId) {\n ...CreatePositionTags\n ...OrganizationCustomFields\n\n delegationsCategories(level: Event, eventId: $eventId) {\n nodes {\n id\n name\n }\n }\n\n delegationCustomFields: customFields(variety: Delegation, privacy: Public) {\n nodes {\n ...AttachCustomField\n }\n }\n\n delegations(level: Organization) {\n nodes {\n id\n name\n leadersIds\n }\n }\n }\n\n event(id: $eventId) {\n ...CreateDelegationEvent\n\n delegation(id: $delegationId) {\n name\n description\n delegationCategoryId\n parentId\n leadersIds\n formId\n deadlineDate\n maxResources\n columns\n privateNote\n tagsIds\n addDefaultAccreditationsByAvailability\n showInDelegationSpace\n showFormLinkInDelegationSpace\n fields\n canLeadersAddMembers\n canLeadersDeleteMembers\n canLeadersEditColumns\n canLeadersEditCustomFields\n canLeadersEditMembers\n canLeadersImportMembers\n canLeadersSeeHiddenAccreditationsSlots\n campaignsIds\n customDocumentsSlugs\n usedCustomFieldsIds\n\n customFields {\n addValues\n customFieldId\n value\n }\n\n accreditations {\n accreditationCategoryId\n accreditationId\n maxResources\n willAutoAccredit\n }\n\n accreditationsSlots {\n accreditationCategoryId\n accreditationId\n accreditationSlotId\n isDefault\n maxResources\n isVisible\n }\n }\n }\n}\n",{organizationId:e,eventId:t,delegationId:n},[Vs.CreatePositionTagsFragment,Vs.OrganizationCustomFieldsFragment,Vs.AttachCustomFieldFragment,Vs.CreateDelegationEventFragment]),{mutate:a}=ta(),l=(0,L.useMemo)(()=>s.createUpdateDelegationValuesDefault(o.event?.delegation,null),[o.event]);return r||(0,i.jsx)(cy,{accreditationsCategories:o.event.accreditationsCategories,campaigns:o.event.campaigns.nodes,categories:o.organization.delegationsCategories.nodes,closePath:hs.DELEGATION({organizationId:e,eventId:t,delegationId:n}),customDocuments:o.event.customDocuments,customFields:o.organization.customFields.nodes,delegationCustomFields:o.organization.delegationCustomFields.nodes,delegationType:"event",eventEndAt:o.event.endAt,eventStartAt:o.event.startAt,forms:o.event.forms.nodes,initialValues:l,isEdit:!0,mutate:async e=>(await a({...e,delegationId:n})).delegationUpdate.id,organizationDelegations:o.organization.delegations.nodes,tags:o.organization.tags.nodes})},py=()=>{const{params:{organizationId:e,delegationId:t}}=vl(),n=Zn(Vj),{data:s,loader:o}=Qn("query DelegationOrganizationToEdit($organizationId: OrganizationId!, $delegationId: DelegationId!) {\n organization(id: $organizationId) {\n ...CreatePositionTags\n ...OrganizationCustomFields\n\n campaigns(level: Organization, states: [Template]) {\n nodes {\n id\n name\n }\n }\n\n delegationsCategories(level: Organization) {\n nodes {\n id\n name\n }\n }\n\n delegationCustomFields: customFields(variety: Delegation, privacy: Public) {\n nodes {\n ...AttachCustomField\n }\n }\n\n forms(level: Organization) {\n nodes {\n ...CreateDelegationForm\n }\n }\n\n delegation(id: $delegationId) {\n name\n description\n delegationCategoryId\n leadersIds\n formId\n deadlineDate\n maxResources\n columns\n privateNote\n tagsIds\n addDefaultAccreditationsByAvailability\n showInDelegationSpace\n showFormLinkInDelegationSpace\n fields\n canLeadersAddMembers\n canLeadersDeleteMembers\n canLeadersEditColumns\n canLeadersEditCustomFields\n canLeadersEditMembers\n canLeadersImportMembers\n canLeadersSeeHiddenAccreditationsSlots\n campaignsIds\n customDocumentsSlugs\n usedCustomFieldsIds\n\n customFields {\n addValues\n customFieldId\n value\n }\n }\n }\n}\n",{organizationId:e,delegationId:t},[Vs.CreatePositionTagsFragment,Vs.OrganizationCustomFieldsFragment,Vs.AttachCustomFieldFragment,Vs.CreateDelegationFormFragment]),{mutate:r}=ta(),a=(0,L.useMemo)(()=>n.createUpdateDelegationValuesDefault(s.organization?{...s.organization.delegation,accreditations:[],accreditationsSlots:[]}:null,null),[s.organization]);return o||(0,i.jsx)(cy,{campaigns:s.organization.campaigns.nodes,categories:s.organization.delegationsCategories.nodes,closePath:Ps.COMMUNITY_DELEGATION(e,t),customFields:s.organization.customFields.nodes,delegationCustomFields:s.organization.delegationCustomFields.nodes,delegationType:"organization",forms:s.organization.forms.nodes,initialValues:a,isEdit:!0,mutate:async e=>(await r({...e,delegationId:t})).delegationUpdate.id,tags:s.organization.tags.nodes})};function fy(e,t,n){const{getLocalOrganization:i,updateLocalOrganization:s}=function(e){const t=L.useCallback(async()=>{let t=await xI.organizations.get(e);return t||(t={id:e},await xI.organizations.put(t)),t},[e]),n=L.useCallback(async n=>{const i=await t(),s=(0,yb.A)(i,{id:e},n);return await xI.organizations.put(s),s},[e,t]);return{getLocalOrganization:t,updateLocalOrganization:n}}(e),[o,r]=L.useState(n),[a,l]=L.useState(!0),d=L.useCallback(async e=>{r(e),await s({[t]:e})},[t,r,s]);return L.useEffect(()=>{(async()=>{const e=await i();e[t]&&r(e[t]),l(!1)})()},[e,i,r,l]),[o,d,a]}function _y(e){return(0,L.useMemo)(()=>new Map(e.map(e=>[e.slug,e])),[e])}function xy(e,t,n){if(t.startsWith("form_inserted_at")){const i=parseInt(t.substring(17),10);if(isNaN(i))return"";{const t=n.find(({form:e})=>e?.id===i);return t?e.toLocaleString(t.insertedAt.toLocal(),eo.DateTime):""}}return""}const Iy=(0,L.createContext)({});function vy(){return(0,L.useContext)(Iy)}const by=e=>{const t=Zn(mC),{isEditMode:n}=vy(),{isEditMode:s}=cm(),o=n||s,r=t.getValue(e.customField,e.fields),a=t.getValueString(e.customField,e.fields),l=!0===r?"checked":!1===r?"unchecked":"indeterminate";return o&&e.updatable?(0,i.jsxs)(Oc,{css:{border:"2px solid transparent","& > .h-checkbox-cell-hover":{display:"none"},"&:hover":{border:"2px solid $primary500"},"&:hover > .h-checkbox-cell-default":{display:"none"},"&:hover > .h-checkbox-cell-hover":{display:"block"}},minWidth:e.column.minWidth,width:e.column.width,onClick:Dl,children:[(0,i.jsx)(Ar,{className:"h-checkbox-cell-default",children:a}),(0,i.jsx)(Ar,{className:"h-checkbox-cell-hover",children:(0,i.jsx)(fc,{state:l,onClick:async t=>{await e.mutate("checked"===t,e.customField.slug),e.reload()}})})]}):(0,i.jsx)(Oc,{css:{border:"2px solid transparent"},minWidth:e.column.minWidth,width:e.column.width,children:a})},jy="h-update-cell-open",Cy=e=>{const t=Xn(),n=L.useRef(V()),[s,o]=L.useState(!1),[r,a]=L.useState(e.initialValue),l=L.useCallback(t=>{o(t),document.body.dispatchEvent(new CustomEvent(jy,{bubbles:!0,detail:{uuid:n.current}})),e.onStateChange?.(t)},[o,e.onStateChange]),d=L.useCallback(e=>{e.detail.uuid!==n.current&&o(!1)},[o]),c=L.useCallback(()=>{l(!1),a(e.initialValue)},[e.initialValue,l,a]);return L.useEffect(()=>(document.addEventListener(jy,d),()=>{document.removeEventListener(jy,d)}),[d]),(0,i.jsxs)(Wd,{doNotCloseOnOtherOpen:!0,isOpen:s,onStateChange:l,children:[(0,i.jsx)(Xd,{children:(0,i.jsx)(Oc,{css:{...e.css,border:"2px solid transparent",cursor:"text","&:hover":{border:"2px solid $primary700"}},minWidth:e.column.minWidth,width:e.column.width,onClick:Dl,children:"string"==typeof e.renderValue?e.renderValue:e.renderValue()})}),(0,i.jsxs)(Zd,{css:{padding:"0",overflowBlock:"auto",maxBlockSize:"50vh"},placement:"bottom-start",width:380,children:[(0,i.jsx)(Ba,{css:{padding:"$4 $6"},onKeyDown:t=>{"Enter"===t.key&&e.onSave(r)},children:e.renderInput(r,a)}),(0,i.jsxs)(Ba,{align:"center",css:{borderTop:"1px solid $gray200",padding:"$4 $6"},gap:"4",justify:"end",children:[(0,i.jsx)(Ar,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:c,children:t("annuler_48254")}),(0,i.jsx)(zl,{size:"sm",onClick:()=>{e.onSave(r)},children:t("appliquer_05753")})]})]})]})},yy=e=>{const{isEditMode:t}=vy(),{isEditMode:n}=cm();return(t||n)&&e.updatable?(0,i.jsx)(Cy,{column:e.column,initialValue:e.initialValue,renderInput:e.renderInput,renderValue:e.renderValue,onSave:async t=>{await e.mutate(t),e.reload()}}):(0,i.jsx)(Oc,{css:{border:"2px solid transparent"},minWidth:e.column.minWidth,width:e.column.width,children:"string"==typeof e.renderValue?e.renderValue:e.renderValue()})};function ky(e,t){return(0,L.useCallback)(n=>t(n,e.slug),[e,t])}const Ay=e=>{const t=Zn(mC),n=t.getValueString(e.customField,e.fields),s=(0,L.useMemo)(()=>{const n=t.getValue(e.customField,e.fields);return m(n)?Gs.c9.fromISO(n,{zone:"utc"}):n},[]),o=ky(e.customField,e.mutate);return(0,i.jsx)(yy,{column:e.column,initialValue:s,mutate:o,reload:e.reload,renderInput:(t,n)=>(0,i.jsx)(Mu,{label:e.customField.name,value:t,onChange:n}),renderValue:n,updatable:e.updatable})},wy=e=>{const t=Zn(mC),n=t.getValueString(e.customField,e.fields),s=(0,L.useMemo)(()=>{const n=t.getValue(e.customField,e.fields);return m(n)?Gs.c9.fromISO(n,{zone:"utc"}):n},[]),o=ky(e.customField,e.mutate);return(0,i.jsx)(yy,{column:e.column,initialValue:s,mutate:o,reload:e.reload,renderInput:(t,n)=>(0,i.jsx)(Vu,{label:e.customField.name,value:t,onChange:n}),renderValue:n,updatable:e.updatable})},Sy=e=>{const{params:{organizationId:t}}=vl(),n=Zn(mC),s=n.getValueString(e.customField,e.fields,{fileReturnValue:"name"}),o=n.getValueString(e.customField,e.fields,{fileReturnValue:"url"}),r=(0,L.useMemo)(()=>n.getValue(e.customField,e.fields),[e.customField,e.fields]),a=ky(e.customField,e.mutate);return(0,i.jsx)(yy,{column:e.column,initialValue:r,mutate:a,reload:e.reload,renderInput:(n,s)=>(0,i.jsx)(Yv,{accept:[yv.Images,yv.Pdf],acl:"private",label:e.customField.name,organizationId:t,value:n,onChange:s}),renderValue:()=>(0,i.jsx)(Zc,{css:{fontWeight:"$regular"},to:o,children:s}),updatable:e.updatable})},Ey=e=>{const t=Zn(mC),n=t.getValueString(e.customField,e.fields),s=(0,L.useMemo)(()=>t.getValue(e.customField,e.fields)||0,[e.customField,e.fields]),o=ky(e.customField,e.mutate);return(0,i.jsx)(yy,{column:e.column,initialValue:s,mutate:o,reload:e.reload,renderInput:(t,n)=>(0,i.jsx)(Bl,{label:e.customField.name,shouldParseAsInt:!0,value:t,onChange:n}),renderValue:n,updatable:e.updatable})},Ty=e=>{const t=Zn(mC),n=Zn(iI),s=t.getValueString(e.customField,e.fields),o=(0,L.useMemo)(()=>{const i=t.getValue(e.customField,e.fields),s=n.basePhoneInputDefault();return{country:i?.country||s.country,code:i?.code||s.code,number:i?.number||s.number}},[e.fields]),r=ky(e.customField,e.mutate);return(0,i.jsx)(yy,{column:e.column,initialValue:o,mutate:r,reload:e.reload,renderInput:(t,n)=>(0,i.jsx)(aI,{label:e.customField.name,value:t,onChange:n}),renderValue:s,updatable:e.updatable})};function zy(e){const t=Zn(hu),n=Bc();return(0,L.useMemo)(()=>e?e.fieldType===We.Country?t.getCountriesIdName().map(({id:e,name:t})=>(0,i.jsx)("option",{value:e,children:t},e)):e.fieldType===We.Language?e.fieldProperty===Ve.Language?n(Id):n(bn):e.fieldType===We.Nationality?t.getNationalitiesIdName().map(({id:e,name:t})=>(0,i.jsx)("option",{value:e,children:t},e)):e.fieldType===We.Sex?n(Rn):e.values.map(({id:e,value:t})=>(0,i.jsx)("option",{value:e,children:t},e)):(0,i.jsx)(i.Fragment,{}),[e])}let Oy=null;function Ry(e,{fontSize:t,fontWeight:n}={}){Oy||=document.createElement("canvas");const i=Oy.getContext("2d");return i.font=`${n||"400"} ${t||"14px"} 'Open Sans`,i.measureText(e).width}const $y=({badge:e})=>(0,i.jsx)(rc,{color:e.color,count:e.count,css:{cursor:e.onClick?"pointer":"inherit"},leftIcon:e.icon?xn.includes(e.icon)?tl(e.icon):e.icon:void 0,size:"md",onClick:e.onClick,children:e.text}),Dy=({badges:e})=>(0,i.jsxs)(Wd,{children:[(0,i.jsx)(Xd,{children:(0,i.jsx)(rc,{cursor:"pointer",size:"md",children:`+${e.length}`})}),(0,i.jsx)(Zd,{css:{flexWrap:"wrap",gap:"$2",overflow:"auto",padding:"$4",zIndex:100},maxHeight:300,placement:"top-end",width:400,children:e.map(e=>(0,i.jsx)(Ba,{children:(0,i.jsx)($y,{badge:e})},e.id))})]}),Py=({badges:e,doNotSort:t,onClick:n})=>{const[s,o]=(0,L.useState)(0),r=(0,L.useCallback)(e=>{e&&o(e.getBoundingClientRect().width)},[]),a=(0,L.useMemo)(()=>{const n=e.map(e=>({...e,textWidth:Math.floor(Ry(e.text,{fontSize:"12px"}))+60}));return!0===t?n:(0,uc.A)(n,({textWidth:e})=>e)},[e,t]),[l,d]=(0,L.useMemo)(()=>{let e=37;const t=[],n=[];for(const i of a)e+=i.textWidth+8,eso(d),[d]);return(0,i.jsxs)(Ba,{ref:r,align:"center",css:{cursor:n?"pointer":"inherit","&:hover":{color:"black"}},gap:"2",height:1,width:1,onClick:e=>{n&&so(a)&&(Dl(e),n())},children:[l.map(e=>(0,i.jsx)($y,{badge:e},e.id)),c&&(n?(0,i.jsx)(rc,{css:{cursor:"pointer"},size:"md",children:"+"+(a.length-l.length)}):(0,i.jsx)(Dy,{badges:d}))]})},Fy=e=>{const t=Xn(),n=Zn(mC),s=(0,L.useMemo)(()=>{if(e.customField.canSelectMultiple){const t=n.getSelectValues(e.customField,e.fields).map(e=>({id:e,color:"gray",icon:null,text:e}));return()=>(0,i.jsx)(Py,{badges:t})}return n.getValueString(e.customField,e.fields)},[n,e.customField,e.fields]),o=(0,L.useMemo)(()=>{const t=n.getValue(e.customField,e.fields);return e.customField.canSelectMultiple?so(t)?t:[]:t||""},[]),r=zy(e.customField),a=ky(e.customField,e.mutate);return(0,i.jsx)(yy,{column:e.column,initialValue:o,mutate:a,reload:e.reload,renderInput:(n,s)=>e.customField.canSelectMultiple?(0,i.jsx)(yc,{isSearchVisible:!0,isSelectAllVisible:!0,label:e.customField.name,multiple:!0,renderOnPortal:!0,values:n,onChange:s,children:r}):(0,i.jsx)(yc,{isSearchVisible:!0,label:e.customField.name,multiple:!1,placeholder:t("choisir_une_val_00277"),renderOnPortal:!0,values:[n],onChange:e=>{so(e)?s(e[0]):s(null)},children:r}),renderValue:s,updatable:e.updatable})},My=e=>{const t=Zn(mC).getValueString(e.customField,e.fields),n=ky(e.customField,e.mutate);return(0,i.jsx)(yy,{column:e.column,initialValue:t,mutate:n,reload:e.reload,renderInput:(t,n)=>(0,i.jsx)(Zm,{label:e.customField.name,value:t,onChange:n}),renderValue:t,updatable:e.updatable})},Ny=e=>{const t=Zn(mC).getValueString(e.customField,e.fields),n=ky(e.customField,e.mutate);return(0,i.jsx)(yy,{column:e.column,initialValue:t,mutate:n,reload:e.reload,renderInput:(t,n)=>(0,i.jsx)(Bl,{autoFocus:!0,label:e.customField.name,value:t,onChange:n}),renderValue:t,updatable:e.updatable})},Ly=e=>{const t=Zn(mC),n=t.getValueString(e.customField,e.fields),s=(0,L.useMemo)(()=>t.getValueString(e.customField,e.fields),[]),o=ky(e.customField,e.mutate);return(0,i.jsx)(yy,{column:e.column,initialValue:s,mutate:o,reload:e.reload,renderInput:(t,n)=>(0,i.jsx)(ab,{label:e.customField.name,value:t,onChange:n}),renderValue:n,updatable:e.updatable})},By=e=>{const t=Zn(mC);return e.customField?.fieldType===We.Checkbox?(0,i.jsx)(by,{column:e.column,customField:e.customField,fields:e.fields,mutate:e.mutate,reload:e.reload,updatable:e.updatable}):e.customField?.fieldType===We.Date?(0,i.jsx)(Ay,{column:e.column,customField:e.customField,fields:e.fields,mutate:e.mutate,reload:e.reload,updatable:e.updatable}):e.customField?.fieldType===We.Phone?(0,i.jsx)(Ty,{column:e.column,customField:e.customField,fields:e.fields,mutate:e.mutate,reload:e.reload,updatable:e.updatable}):e.customField?.fieldType===We.Select||e.customField?.fieldType===We.Country||e.customField?.fieldType===We.Language||e.customField?.fieldType===We.Sex||e.customField?.fieldType===We.Nationality?(0,i.jsx)(Fy,{column:e.column,customField:e.customField,fields:e.fields,mutate:e.mutate,reload:e.reload,updatable:e.updatable}):e.customField?.fieldType===We.Text?(0,i.jsx)(Ny,{column:e.column,customField:e.customField,fields:e.fields,mutate:e.mutate,reload:e.reload,updatable:e.updatable}):e.customField?.fieldType===We.Textarea?(0,i.jsx)(My,{column:e.column,customField:e.customField,fields:e.fields,mutate:e.mutate,reload:e.reload,updatable:e.updatable}):e.customField?.fieldType===We.Number?(0,i.jsx)(Ey,{column:e.column,customField:e.customField,fields:e.fields,mutate:e.mutate,reload:e.reload,updatable:e.updatable}):e.customField?.fieldType===We.File?(0,i.jsx)(Sy,{column:e.column,customField:e.customField,fields:e.fields,mutate:e.mutate,reload:e.reload,updatable:e.updatable}):e.customField?.fieldType===We.Datetime?(0,i.jsx)(wy,{column:e.column,customField:e.customField,fields:e.fields,mutate:e.mutate,reload:e.reload,updatable:e.updatable}):e.customField?.fieldType===We.Time?(0,i.jsx)(Ly,{column:e.column,customField:e.customField,fields:e.fields,mutate:e.mutate,reload:e.reload,updatable:e.updatable}):(0,i.jsx)(Oc,{children:e.customField?t.getValueString(e.customField,e.fields,{fileReturnValue:"name"}):""})},Vy=e=>{const{translate:t}=vl(),{isEditMode:n}=vy(),{isEditMode:s}=cm(),o=n||s,r=(0,L.useMemo)(()=>({firstName:e.userInfo.fields.firstName||"",lastName:e.userInfo.fields.lastName||""}),[e.userInfo]),a=(0,L.useCallback)(async t=>{await e.mutate(t.firstName,"firstName"),await e.mutate(t.lastName,"lastName"),e.reload()},[e.mutate,e.reload]);return o&&e.updatable?(0,i.jsx)(Cy,{column:e.column,initialValue:r,renderInput:(e,n)=>(0,i.jsxs)(Ba,{direction:"column",gap:"2",width:1,children:[(0,i.jsx)(Bl,{label:t("pr_nom_66988"),value:e.firstName,onChange:t=>{n({...e,firstName:t})}}),(0,i.jsx)(Bl,{label:t("last_name"),value:e.lastName,onChange:t=>{n({...e,lastName:t})}})]}),renderValue:()=>(0,i.jsx)(xj,{isClickDisabled:!0,size:32,userInfo:e.userInfo}),onSave:a}):(0,i.jsx)(Oc,{css:{border:"2px solid transparent"},minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(xj,{isClickDisabled:!e.canClickMemberName,size:32,userInfo:e.userInfo})})};function Uy(e,t){return e?(e.usersOrganizations||[]).map(e=>({id:e.role.id,color:"gray",icon:e.role.type===bt.OrganizationAdmin?"gem":"glasses-round",text:`${e.role.name}`})).concat((e.usersEvents||[]).map(e=>({id:e.role.id,color:"gray",icon:e.role.type===bt.EventAdmin?"gem":"glasses-round",text:`${e.event.name} - ${e.role.name}`}))).concat((e.usersDelegations||[]).map((e,n)=>({id:`ud-${n}`,color:"gray",icon:"user-group",text:`${e.delegation.name} - ${t("responsable_de_70462")}`}))).concat((e.usersDelegationsCategories||[]).map(e=>({id:e.role.id,color:"gray",icon:"user-group",text:`${e.delegationCategory.name} - ${e.role.name}`}))).concat((e.usersPositions||[]).map(e=>({id:e.role.id,color:"gray",icon:"sitemap",text:`${e.position.name} - ${e.role.name}`}))).concat((e.usersPositionsCategories||[]).map(e=>({id:e.role.id,color:"gray",icon:"sitemap",text:`${e.positionCategory.name} - ${e.role.name}`}))):[]}const Wy=e=>{const t=Xn(),n=(0,L.useMemo)(()=>Uy(e.userPermissions,t),[e.userPermissions]);return(0,i.jsx)(Oc,{minWidth:e.minWidth,width:e.width,children:(0,i.jsx)(Py,{badges:n,doNotSort:!0})})},Gy=({column:e,eventId:t,onClick:n,reload:s,updatable:o,volunteerRegistration:r})=>{const a=Xn(),{mutate:l}=yo(),{mutate:d}=Jo(),c=Zn(Jc),{isEditMode:u}=vy(),{isEditMode:h}=cm(),m=u||h,[g,p]=(0,L.useState)(!0),[f,_]=(0,L.useState)(null),x=(0,L.useMemo)(()=>r?.accreditationsUsersInfos||[],[r]),I=(0,L.useMemo)(()=>OC(x),[x]),v=(0,L.useMemo)(()=>x.map(e=>e.accreditationSlot.id),[x]),b=(0,L.useCallback)(async e=>{if(e&&g){const{event:e}=await(n={eventId:t},s=await Y(),go("query UpdateCellAccreditationsSlots($eventId: EventId!) {\n event(id: $eventId) {\n accreditationsCategories {\n name\n\n accreditations {\n id\n name\n accreditationDisplay\n hasSlots\n index\n\n slots(includeHidden: true) {\n id\n name\n date\n isBlocked\n }\n }\n }\n }\n}\n",{variables:n,token:s||void 0,fragments:[]})),o=(0,uc.A)(e.accreditationsCategories,e=>e.name.toLowerCase()).flatMap(e=>DC(e.accreditations).map(t=>{const n=t.accreditationDisplay===ie.Radio?t.name:void 0,s=Nh(t.slots);return(0,i.jsx)("optgroup",{label:`${e.name} - ${t.name}`,children:s.map(e=>{const s=Dh(c,e,t.name,{accreditation:{includeNameAtEnd:!0}});return(0,i.jsx)("option",{"data-radio":n,disabled:e.isBlocked,value:e.id,children:s},e.id)})},t.id)}));_(o),p(!1)}var n,s},[g]),j=(0,L.useCallback)(async e=>{so(e)?await l({eventId:t,massAccredit:{accreditationsSlotsIds:e,selecteds:{ids:[r.userInfo.id]},strategy:it.Replace}}):await d({eventId:t,massStateUpdate:{selecteds:{ids:[r.userInfo.id]},state:le.WaitingAccreditation}}),s()},[t,r,l,s]);return m&&o?(0,i.jsx)(Cy,{column:e,css:{gap:"$2"},initialValue:v,renderInput:(e,t)=>g?(0,i.jsxs)(Ba,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(lc,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(lc,{borderRadius:"$1",height:40,width:1})]}):(0,i.jsx)(yc,{isSearchVisible:!0,label:a("accr_ditations_39450"),multiple:!0,renderOnPortal:!0,values:e,onChange:t,children:f}),renderValue:()=>(0,i.jsx)(Py,{badges:I,doNotSort:!0}),onSave:j,onStateChange:b}):(0,i.jsx)(Oc,{css:{border:"2px solid transparent"},minWidth:e.minWidth,width:e.width,children:(0,i.jsx)(Py,{badges:I,doNotSort:!0,onClick:n})})},Hy=e=>{const t=(0,L.useMemo)(()=>(0,xh.A)(e.volunteerRegistration?.accreditationsUsersInfos??[],e=>e.accreditationSlot.accreditationCategory.id).map(e=>({id:e.accreditationSlot.accreditationCategory.id,color:"gray",icon:null,text:e.accreditationSlot.accreditationCategory.name})),[e.volunteerRegistration]);return(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Py,{badges:t})})},qy=e=>{const t=Xn(),{mutate:n}=sr();return(0,i.jsx)(Ba,{css:{cursor:"pointer",padding:"$3","&:hover":{background:"$gray100"}},onClick:async()=>{await n({eventId:e.eventId,volunteerRegistrationId:e.volunteerRegistrationId,slug:"accreditation_state",value:e.state}),e.reload(),e.close()},children:(0,i.jsx)(rc,{...yj(e.state),children:t(e.state)})})},Ky=e=>{const t=Xn(),{isEditMode:n}=vy(),{isEditMode:s}=cm(),o=n||s,[r,a]=(0,L.useState)(!1),l=(0,L.useCallback)(e=>{o&&a(e)},[o,a]),d=(0,L.useCallback)(()=>{l(!1)},[l]);return o&&e.updatable?(0,i.jsx)(Oc,{css:{border:"2px solid transparent","&:hover":{border:"2px solid $primary500"}},minWidth:e.column.minWidth,width:e.column.width,onClick:Dl,children:(0,i.jsxs)(Wd,{isOpen:r,onStateChange:l,children:[(0,i.jsx)(Xd,{children:(0,i.jsxs)(Ba,{align:"center",gap:"3",height:1,justify:"between",width:1,children:[(0,i.jsx)(rc,{...yj(e.state),cursor:"text",children:t(e.state)}),r&&(0,i.jsx)(Ar,{children:(0,i.jsx)(nl,{icon:"chevron-down"})})]})}),(0,i.jsxs)(Zd,{offset:2,placement:"bottom",width:240,children:[e.state!==le.WaitingAccreditation&&(0,i.jsx)(qy,{close:d,eventId:e.eventId,reload:e.reload,state:le.WaitingAccreditation,volunteerRegistrationId:e.volunteerRegistrationId}),e.state!==le.NotApplicable&&(0,i.jsx)(qy,{close:d,eventId:e.eventId,reload:e.reload,state:le.NotApplicable,volunteerRegistrationId:e.volunteerRegistrationId})]})]})}):(0,i.jsx)(Oc,{css:{border:"2px solid transparent"},minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(rc,{...yj(e.state),children:t(e.state)})})},Yy=e=>{const t=Zn(Jc),n=Zn(ph),s=(0,L.useMemo)(()=>{const i=e.volunteerRegistration.userInfo.formsUsersInfos||[];return(0,uc.A)(i.flatMap(e=>(e.slots||[]).map(t=>({range:t.range,display:e.form.slotDisplay}))),({range:e})=>e.start.toMillis()).map((e,i)=>({id:i,color:"gray",icon:null,text:e.display===It.Calendar||e.display===It.DisplayDays?t.toLocaleString(e.range.start,eo.DateOnly.Numeric):n.toDisplayString(e.range,{formats:{localeFormat:eo.DateOnly.Numeric}})}))},[e.volunteerRegistration.userInfo.formsUsersInfos]);return(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Py,{badges:s,doNotSort:!0,onClick:e.onClick})})},Zy=e=>{const{translate:t}=vl();return(0,i.jsxs)(Lb,{children:[(0,i.jsx)(Bb,{children:(0,i.jsx)(Ar,{css:{cursor:"pointer"},height:e.size,width:e.size,children:(0,i.jsx)("img",{height:"100%",src:pg(e.ticketId,{height:e.size,width:e.size}),width:"100%"})})}),(0,i.jsxs)(Nb,{children:[(0,i.jsx)(Mb,{icon:"qrcode",children:t("code_barres_1_82428",e.nameOrEmail)}),(0,i.jsxs)(Fb,{align:"center",css:{padding:"$4"},gap:"3",justify:"center",children:[(0,i.jsx)(Ar,{height:100,width:100,children:(0,i.jsx)("img",{height:"100%",src:pg(e.ticketId,{height:100,width:100}),width:"100%"})}),(0,i.jsx)(Ar,{children:e.ticketId})]}),(0,i.jsx)(Pb,{})]})]})},Xy=e=>{const t=e.volunteerRegistration.ticketId;return(0,i.jsxs)(Oc,{align:"center",gap:"2",minWidth:e.column.minWidth,width:e.column.width,children:[(0,i.jsx)(Zy,{nameOrEmail:e.volunteerRegistration.userInfo.nameOrEmail,size:30,ticketId:e.volunteerRegistration.ticketId}),m(e.volunteerRegistration.weezeventTicketUrl)?(0,i.jsx)(Zc,{css:{fontWeight:"normal"},to:e.volunteerRegistration.weezeventTicketUrl,children:t}):t]})},Jy=e=>{const{translate:t}=vl(),n=(0,L.useMemo)(()=>(e.volunteerRegistration.userInfo.emails??[]).map(e=>{const{color:n,leftIcon:i}=Ij(e.state);return{id:e.id,color:n,icon:i,text:`${e.campaign?.name??""} - ${t(e.state)}`}}),[e.volunteerRegistration]);return(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Py,{badges:n})})},Qy=e=>{const t=(0,L.useMemo)(()=>(e.volunteerRegistration.positionsSlotsUsersInfos||[]).filter(e=>e.state!==pe.Waiting),[e.volunteerRegistration]),n=(0,L.useMemo)(()=>$h(t),[t]);return(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Py,{badges:n,doNotSort:!0,onClick:e.onClick})})},ek=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=vl(),{mutate:o}=er(),{mutate:r}=No(),{isEditMode:a}=vy(),{isEditMode:l}=cm(),d=a||l,c=(0,L.useMemo)(()=>e.volunteerRegistration.delegation,[e.volunteerRegistration.delegation]),u=(0,L.useMemo)(()=>c?[c.id]:[],[c]),[h,m]=(0,L.useState)(!0),[g,p]=(0,L.useState)([]),f=(0,L.useCallback)(async e=>{if(e&&h){const{event:{delegations:e}}=await ir({eventId:s},await Y());p(e.nodes),m(!1)}},[h]),_=(0,L.useCallback)(async t=>{so(t)?await o({eventId:s,delegationId:t[0],selecteds:{ids:[e.volunteerRegistration.userInfo.id]}}):c&&await r({organizationId:n,eventId:s,delegationId:c.id,selecteds:{ids:[e.volunteerRegistration.userInfo.id]},deleteFromEvent:!1}),e.reload()},[s,e.volunteerRegistration]);return d&&e.updatable?(0,i.jsx)(Cy,{column:e.column,css:{gap:"$2"},initialValue:u,renderInput:(e,n)=>h?(0,i.jsxs)(Ba,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(lc,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(lc,{borderRadius:"$1",height:40,width:1})]}):(0,i.jsx)(yc,{isSearchVisible:!0,label:t("Delegation"),renderOnPortal:!0,values:e,onChange:n,children:g.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),renderValue:()=>c?(0,i.jsx)(rc,{cursor:"pointer",ellipsis:!0,children:c.name}):null,onSave:_,onStateChange:f}):(0,i.jsx)(Oc,{css:{border:"2px solid transparent"},minWidth:e.column.minWidth,width:e.column.width,children:c&&(0,i.jsx)(rc,{cursor:"pointer",ellipsis:!0,title:c.name,children:(0,i.jsx)(el,{to:hs.DELEGATION({organizationId:n,eventId:s,delegationId:c.id}),children:c.name})})})},tk=e=>{const{params:{organizationId:t,eventId:n}}=vl(),s=e.volunteerRegistration.delegation?.delegationCategory;return(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:s&&(0,i.jsx)(rc,{cursor:"pointer",ellipsis:!0,title:s.name,children:(0,i.jsx)(el,{to:hs.DELEGATION_CATEGORY({organizationId:t,eventId:n,delegationCategoryId:s.id}),children:s.name})})})},nk=e=>{const t=(0,L.useMemo)(()=>(e.volunteerRegistration.userInfo?.formsUsersInfos??[]).flatMap(e=>e.form?[{id:e.form.id,color:"gray",icon:null,text:e.form.name}]:[]),[e.volunteerRegistration.userInfo]);return(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Py,{badges:t})})},ik=e=>{const t=Xn(),{mutate:n}=Qo(),{mutate:s}=tr(),o=Zn(ph),{isEditMode:r}=vy(),{isEditMode:a}=cm(),l=r||a,d=(0,L.useMemo)(()=>e.volunteerRegistration?.positionsSlotsUsersInfos||[],[e.volunteerRegistration]),c=(0,L.useMemo)(()=>$h(d),[d]),u=(0,L.useMemo)(()=>d.map(e=>e.positionSlot.id),[d]),[h,m]=(0,L.useState)(!0),[g,p]=(0,L.useState)([]),f=(0,L.useCallback)(async t=>{if(t&&h){const{event:{positionsSlots:t}}=await(n={eventId:e.eventId},i=await Y(),go("query UpdateCellPositionsSlots($eventId: EventId!) {\n event(id: $eventId) {\n positionsSlots {\n nodes {\n id\n name\n range\n\n position {\n name\n }\n }\n }\n }\n}\n",{variables:n,token:i||void 0,fragments:[]})),s=(0,uc.A)(t.nodes,e=>[e.range.start.toMillis(),e.name]).map(e=>({id:e.id,positionName:e.position.name,name:Ch(o,e,e.position.name,{position:{includeNameAtEnd:!0}})}));p((0,uc.A)(Object.entries((0,cc.A)(s,e=>e.positionName)),([e])=>e)),m(!1)}var n,i},[h]),_=(0,L.useCallback)(async t=>{so(t)?await n({eventId:e.eventId,massAssign:{positionsSlotsIds:t,selecteds:{ids:[e.volunteerRegistration.userInfo.id]},strategy:it.Replace}}):await s({eventId:e.eventId,massStateUpdate:{selecteds:{ids:[e.volunteerRegistration.userInfo.id]},state:Pt.WaitingAssignment}}),e.reload()},[e.eventId,e.volunteerRegistration,n,e.reload]);return l&&e.updatable?(0,i.jsx)(Cy,{column:e.column,css:{gap:"$2"},initialValue:u,renderInput:(e,n)=>h?(0,i.jsxs)(Ba,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(lc,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(lc,{borderRadius:"$1",height:40,width:1})]}):(0,i.jsx)(yc,{isSearchVisible:!0,label:t("missions_63972"),multiple:!0,renderOnPortal:!0,values:e,onChange:n,children:g.map(([e,t],n)=>(0,i.jsx)("optgroup",{label:e,children:t.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},n))}),renderValue:()=>(0,i.jsx)(Py,{badges:c,doNotSort:!0}),onSave:_,onStateChange:f}):(0,i.jsx)(Oc,{css:{border:"2px solid transparent"},minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Py,{badges:c,doNotSort:!0,onClick:e.onClick})})},sk=e=>{const t=(0,L.useMemo)(()=>(0,xh.A)(e.volunteerRegistration?.positionsSlotsUsersInfos??[],e=>e.positionCategory.id).map(e=>({id:e.positionCategory.id,color:"gray",icon:null,text:e.positionCategory.name})),[e.volunteerRegistration]);return(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Py,{badges:t})})},ok=e=>{const t=(0,L.useMemo)(()=>(e.volunteerRegistration?.preassignPositions||[]).map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[e.volunteerRegistration]);return(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Py,{badges:t})})},rk=e=>{const t=(0,L.useMemo)(()=>(e.volunteerRegistration?.preassignPositionsCategories||[]).map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[e.volunteerRegistration]);return(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Py,{badges:t})})},ak=e=>{const t=(0,L.useMemo)(()=>(e.volunteerRegistration.accreditationsUsersInfos||[]).filter(e=>e.checkInAt?.isValid),[e.volunteerRegistration]),n=(0,L.useMemo)(()=>OC(t),[t]);return(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Py,{badges:n,doNotSort:!0,onClick:e.onClick})})},lk=e=>(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:m(e.volunteerRegistration.shortTag)&&m(e.volunteerRegistration.weezeventPayUrl)?(0,i.jsx)(Zc,{css:{fontWeight:"normal"},to:e.volunteerRegistration.weezeventPayUrl,children:e.volunteerRegistration.shortTag}):e.volunteerRegistration.shortTag||""}),dk=(...e)=>({name:"canCommentFn",args:e}),ck=(...e)=>({name:"canRegistrationStateUpdateFn",args:e}),uk=(...e)=>({name:"canUserInfoSlotsUpdateFn",args:e});async function hk(e){try{const t=await Y(),n=await function(e,t){return go("query UserPermission($checks: [PermissionCheck!]!) {\n user {\n permission(checks: $checks)\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}(e,t);return n.user.permission}catch{return e.checks.map(e=>!1)}}const mk=new Map;function gk({checks:e}){const t=e.map(e=>[e,JSON.stringify(e)]),n=t.filter(([e,t])=>!mk.has(t));if(n.length>0){const e=hk({checks:n.map(([e,t])=>e)});n.forEach(([t,n],i)=>{mk.set(n,e.then(e=>e[i]))})}return Promise.all(t.map(([e,t])=>mk.get(t)))}function pk({withCaching:e,checks:t}){const[{isLoading:n,permissions:i},s]=(0,L.useState)({isLoading:!0,permissions:new Array(t.length).fill(!1)}),o=e?gk:hk;return(0,L.useEffect)(()=>{o({checks:t}).then(e=>{s({isLoading:!1,permissions:e})},()=>{s({isLoading:!1,permissions:i})})},[]),{isLoading:n,permissions:i}}function fk(...e){return pk({withCaching:!0,checks:e})}const _k=e=>{const t=Xn(),{mutate:n}=sr();return(0,i.jsx)(Ba,{css:{cursor:"pointer",padding:"$3","&:hover":{background:"$gray100"}},onClick:async()=>{await n({eventId:e.eventId,volunteerRegistrationId:e.volunteerRegistrationId,slug:"volunteer_registration_state",value:e.state}),e.reload(),e.close()},children:(0,i.jsx)(rc,{cursor:"pointer",...Cj(e.state),children:t(e.state)})})},xk=e=>{const{permissions:[t,n],isLoading:s}=function(...e){return pk({withCaching:!1,checks:e})}(ck(e.eventId,Pt.PreAssigned,e.volunteerRegistrationId),ck(e.eventId,Pt.Assigned,e.volunteerRegistrationId));return s?null:(0,i.jsxs)(i.Fragment,{children:[n&&e.state!==Pt.WaitingAssignment&&(0,i.jsx)(_k,{close:e.close,eventId:e.eventId,reload:e.reload,state:Pt.WaitingAssignment,volunteerRegistrationId:e.volunteerRegistrationId}),t&&(0,i.jsx)(_k,{close:e.close,eventId:e.eventId,reload:e.reload,state:Pt.PreAssigned,volunteerRegistrationId:e.volunteerRegistrationId}),n&&e.state!==Pt.Refused&&(0,i.jsx)(_k,{close:e.close,eventId:e.eventId,reload:e.reload,state:Pt.Refused,volunteerRegistrationId:e.volunteerRegistrationId}),n&&e.state!==Pt.NotApplicable&&(0,i.jsx)(_k,{close:e.close,eventId:e.eventId,reload:e.reload,state:Pt.NotApplicable,volunteerRegistrationId:e.volunteerRegistrationId})]})},Ik=e=>{const t=Xn(),{isEditMode:n}=vy(),{isEditMode:s}=cm(),o=n||s,[r,a]=(0,L.useState)(!1),l=(0,L.useCallback)(e=>{o&&a(e)},[o,a]),d=(0,L.useCallback)(()=>{l(!1)},[l]);return o&&e.updatable?(0,i.jsx)(Oc,{css:{border:"2px solid transparent","&:hover":{border:"2px solid $primary500"}},minWidth:e.column.minWidth,width:e.column.width,onClick:Dl,children:(0,i.jsxs)(Wd,{isOpen:r,onStateChange:l,children:[(0,i.jsx)(Xd,{children:(0,i.jsxs)(Ba,{align:"center",gap:"3",height:1,justify:"between",width:1,children:[(0,i.jsx)(rc,{...Cj(e.state),cursor:"text",ellipsis:!0,children:t(e.state)}),r&&(0,i.jsx)(Ar,{children:(0,i.jsx)(nl,{icon:"chevron-down"})})]})}),(0,i.jsx)(Zd,{offset:2,placement:"bottom",width:230,children:(0,i.jsx)(xk,{close:d,...e})})]})}):(0,i.jsx)(Oc,{css:{border:"2px solid transparent"},minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(rc,{...Cj(e.state),children:t(e.state)})})},vk=e=>{const t=(0,L.useMemo)(()=>e.volunteerRegistration.userInfo.tags||[],[e.volunteerRegistration]),n=(0,L.useMemo)(()=>t.map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[]);return(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Py,{badges:n})})},bk=e=>{const{history:t,translate:n,params:{organizationId:s,eventId:o,segmentId:r}}=vl(),{isEditMode:a}=vy(),{isEditMode:l}=cm(),d=a||l,{mutate:c}=sr(),u=(0,L.useMemo)(()=>e.volunteerRegistration.teams||[],[e.volunteerRegistration]),h=(0,L.useMemo)(()=>u.map(({teamCode:n})=>({id:n,color:"gray",icon:null,text:n,onClick:d?void 0:()=>{t.push(Ps.VOLUNTEERS_LIST_USER_PANEL_TEAM(s,o,r,e.volunteerRegistration.userInfo.id,n))}})),[u,d]);return 1===u.length&&d?(0,i.jsx)(Cy,{column:e.column,css:{gap:"$2"},initialValue:u[0].teamCode,renderInput:(e,t)=>(0,i.jsx)(Bl,{label:n("code_quipe_14296"),value:e,onChange:t}),renderValue:()=>(0,i.jsx)(Py,{badges:h}),onSave:async t=>{await c({eventId:o,volunteerRegistrationId:e.volunteerRegistration.id,slug:"team_code",value:t}),e.reload()}}):(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Py,{badges:h})})},jk=e=>{const{params:{organizationId:t,eventId:n}}=vl(),s=(0,L.useMemo)(()=>(0,uc.A)(e.teamMembers,e=>u(e.name)),[e.teamMembers]);return(0,i.jsx)(Ba,{children:s.map((e,s)=>(0,i.jsxs)(km,{children:[(0,i.jsx)(Sm,{children:(0,i.jsx)(Ar,{css:{cursor:"pointer",position:"relative",left:-4*s+"px"},children:(0,i.jsx)(el,{to:QI.MEMBER_INFORMATION({organizationId:t,eventId:n,userInfoId:e.id}),children:(0,i.jsx)(sp,{email:e.email,image:e.picture?.url,name:e.name,size:24})})})}),(0,i.jsx)(wm,{placement:"top",children:e.name})]},e.id))})},Ck=e=>{const t=(0,L.useMemo)(()=>(e.volunteerRegistration.userInfo.formsUsersInfos||[]).flatMap(e=>e.teamMembers||[]),[e.volunteerRegistration]);return(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(jk,{teamMembers:t})})},yk=e=>{const t=(0,L.useMemo)(()=>(e.volunteerRegistration.weezaccessChecklists||[]).map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[e.volunteerRegistration]);return(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Py,{badges:t})})},kk=e=>{const t=(0,L.useMemo)(()=>RC(e.volunteerRegistration?.accreditationsSlots||[]),[e.volunteerRegistration]);return(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Py,{badges:t,doNotSort:!0,onClick:e.onClick})})},Ak=e=>{const t=Zn(ph),n=(0,L.useMemo)(()=>function(e,t,n,i){return(0,xh.A)(t,e=>e.id).map(e=>({id:`c-${e.id}`,color:"gray",icon:null,text:e.name})).concat((0,xh.A)(n,e=>e.id).map(e=>({id:`p-${e.id}`,color:e.color,icon:e.icon,text:m(e.acronym)?e.acronym:e.name}))).concat((0,xh.A)(i,e=>e.id).map(t=>{const n=m(t.position.acronym)?t.position.acronym:t.position.name,i=Ch(e,t,n,{interval:{options:{formats:{localeFormat:eo.DateOnly.Numeric}}}});return{id:`s-${t.id}`,color:t.position.color,icon:t.position.icon,text:`${n} | ${i}`}}))}(t,e.volunteerRegistration?.positionsCategories||[],e.volunteerRegistration?.positions||[],e.volunteerRegistration?.positionsSlots||[]),[e.volunteerRegistration]);return(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Py,{badges:n,onClick:e.onClick})})},wk=e=>{const{history:t}=vl(),n=Zn(Jc),s=Zn(rp),o=(0,L.useMemo)(()=>function(e,t){return t.flatMap(t=>t.form?[`${t.form.name} : ${e.toLocaleString(t.insertedAt.toLocal(),eo.DateTime)}`]:[]).join(", ")}(n,e.row.userInfo.formsUsersInfos||[]),[e.row]),{mutate:r}=sr(),a=(0,L.useCallback)((t,n)=>r({eventId:e.eventId,volunteerRegistrationId:e.row.id,slug:n,value:t}),[e.eventId,e.row,r]),l=e.row.userInfo;switch(e.column.slug){case Kh.Accreditations:return(0,i.jsx)(Gy,{column:e.column,eventId:e.eventId,reload:e.reloadRow,updatable:e.canAccredit,volunteerRegistration:e.row,onClick:m(e.accreditationsPanelPath)?()=>{t.push(`${e.accreditationsPanelPath}/assigned`)}:void 0});case Kh.AccreditationsCategories:return(0,i.jsx)(Hy,{column:e.column,volunteerRegistration:e.row});case Kh.AccreditationState:return(0,i.jsx)(Ky,{column:e.column,eventId:e.eventId,field:e.column,reload:e.reloadRow,state:e.row.accreditationState,updatable:e.canAccredit,volunteerRegistrationId:e.row.id});case Kh.ScannedAccreditations:return(0,i.jsx)(ak,{column:e.column,volunteerRegistration:e.row,onClick:m(e.accreditationsPanelPath)?()=>{t.push(`${e.accreditationsPanelPath}/scanned`)}:void 0});case Kh.Availability:return(0,i.jsx)(Yy,{column:e.column,volunteerRegistration:e.row,onClick:m(e.availabilitiesPanelPath)?()=>{t.push(e.availabilitiesPanelPath)}:void 0});case Kh.Comments:return(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:so(l.comments)?l.comments.flatMap(e=>e.content).join("; "):""});case Kh.CampaignsStates:return(0,i.jsx)(Jy,{column:e.column,volunteerRegistration:e.row});case Kh.CheckedInPositions:return(0,i.jsx)(Qy,{column:e.column,volunteerRegistration:e.row,onClick:m(e.positionsPanelPath)?()=>{t.push(`${e.positionsPanelPath}/assigned`)}:void 0});case Kh.CompletedForms:return(0,i.jsx)(nk,{column:e.column,volunteerRegistration:e.row});case Kh.FormsInsertedAt:return(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Ar,{css:{ellipsis:!0},title:o,children:o})});case Kh.Delegations:return(0,i.jsx)(ek,{column:e.column,reload:e.reloadRow,updatable:e.canChangeDelegation,volunteerRegistration:e.row});case Kh.DelegationBannerNumber:return(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.delegationBannerNumber||""});case Kh.DuplicatedFrom:return(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.duplicatedFrom?(0,i.jsx)(xj,{size:32,userInfo:e.row.duplicatedFrom.userInfo}):null});case Kh.DelegationCategory:return(0,i.jsx)(tk,{column:e.column,volunteerRegistration:e.row});case Kh.Email:return(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:l.email});case Kh.Id:return(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:l.id});case Kh.LocalId:return(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.localId});case Kh.InsertedAt:return(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:n.toLocaleString(e.row.insertedAt.toLocal(),eo.DateTime)});case Kh.Name:return(0,i.jsx)(Vy,{canClickMemberName:e.canClickMemberName,column:e.column,mutate:a,reload:e.reloadRow,updatable:e.row.userInfo.isEditable??!0,userInfo:e.row.userInfo});case Kh.NumberOfAccreditations:return(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.numberOfAccreditations});case Kh.NumberOfAssignments:return(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.numberOfAssignments});case Kh.NumberOfAssignmentsDays:return(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.numberOfAssignmentsDays});case Kh.NumberOfAvailableDays:return(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.numberOfAvailableDays});case"picture":return(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(sp,{email:l.email,image:l.picture?.url,name:l.name,size:32})});case Kh.Positions:return(0,i.jsx)(ik,{column:e.column,eventId:e.eventId,reload:e.reloadRow,updatable:e.canAssign,volunteerRegistration:e.row,onClick:m(e.positionsPanelPath)?()=>{t.push(`${e.positionsPanelPath}/assigned`)}:void 0});case Kh.PositionsCategories:return(0,i.jsx)(sk,{column:e.column,volunteerRegistration:e.row});case Kh.PreassignedPositions:return(0,i.jsx)(ok,{column:e.column,volunteerRegistration:e.row});case Kh.PreassignedPositionsCategories:return(0,i.jsx)(rk,{column:e.column,volunteerRegistration:e.row});case Kh.Roles:return(0,i.jsx)(Wy,{minWidth:e.column.minWidth,userPermissions:e.row.userInfo,width:e.column.width});case Kh.Tags:return(0,i.jsx)(vk,{column:e.column,volunteerRegistration:e.row});case Kh.TeamCode:return(0,i.jsx)(bk,{column:e.column,reload:e.reloadRow,volunteerRegistration:e.row});case Kh.TeamMembers:return(0,i.jsx)(Ck,{column:e.column,volunteerRegistration:e.row});case Kh.VolunteerMinutes:return(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:s.minutesToHoursMinutesString(e.row.volunteerMinutes)});case Kh.VolunteerRegistrationState:return(0,i.jsx)(Ik,{column:e.column,eventId:e.eventId,field:e.column,reload:e.reloadRow,state:e.row.state,updatable:e.row.canRegistrationStateUpdate??!0,volunteerRegistrationId:e.row.id});case Kh.WishedAccreditationSlots:return(0,i.jsx)(kk,{column:e.column,volunteerRegistration:e.row,onClick:m(e.accreditationsPanelPath)?()=>{t.push(`${e.accreditationsPanelPath}/wished`)}:void 0});case Kh.WishedPositions:return(0,i.jsx)(Ak,{column:e.column,volunteerRegistration:e.row,onClick:m(e.positionsPanelPath)?()=>{t.push(`${e.positionsPanelPath}/wished`)}:void 0});case Kh.WeezaccessChecklists:return(0,i.jsx)(yk,{column:e.column,volunteerRegistration:e.row});case Kh.WeezeventBarcodeId:return(0,i.jsx)(Xy,{column:e.column,volunteerRegistration:e.row});case Kh.WeezeventPairedAt:return(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.weezeventPairedAt?.isValid?n.toLocaleString(e.row.weezeventPairedAt.toLocal(),eo.DateTime):""});case Kh.WeezeventShortTag:return(0,i.jsx)(lk,{column:e.column,volunteerRegistration:e.row});default:return Object.values(Kh).includes(e.column.slug)?(console.error(`003: Unhandled default column ${e.column.slug}`),(0,i.jsx)(Oc,{children:"ERR"})):e.column.slug.startsWith("form_inserted_at")?(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:xy(n,e.column.slug,e.row.userInfo.formsUsersInfos||[])}):(0,i.jsx)(By,{column:e.column,customField:e.customField,fields:e.row.userInfo.fields,mutate:a,reload:e.reloadRow,updatable:e.row.userInfo.isEditable??!0})}},Sk=({title:e,subtitle:t})=>(0,i.jsx)(Mc,{css:{height:"fit-content"},children:(0,i.jsx)(Oc,{children:(0,i.jsxs)(Ba,{align:"center",css:{padding:"$8 0"},direction:"column",justify:"center",width:1,children:[(0,i.jsx)(sC,{color:"primary",icon:"magnifying-glass"}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(Ar,{color:"gray900",fontSize:"textMd",fontWeight:"medium",children:e}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ar,{color:"gray500",children:t})]})})}),Ek=L.createContext({}),Tk=e=>{const{mutate:t}=yo(),{mutate:n}=dr(),[s,o]=L.useState(e.volunteerRegistration.accreditationsUsersInfos.map(e=>e.accreditationSlot)),r=L.useMemo(()=>s.map(({id:e})=>e),[s]),[a,l]=L.useState(e.volunteerRegistration.accreditationsUsersInfos.flatMap(e=>e.checkInAt?.isValid?[e.accreditationSlot]:[])),[d,c]=L.useState(e.volunteerRegistration.accreditationsSlots),u=L.useMemo(()=>(0,uc.A)((0,xh.A)(s.map(e=>e.accreditationCategory),e=>e.id),e=>e.name.toLowerCase()),[s]),h=L.useMemo(()=>(0,uc.A)((0,xh.A)(a.map(e=>e.accreditationCategory),e=>e.id),e=>e.name.toLowerCase()),[a]),m=L.useMemo(()=>(0,uc.A)((0,xh.A)(d.map(e=>e.accreditationCategory),e=>e.id),e=>e.name.toLowerCase()),[d]),g=L.useMemo(()=>(0,xh.A)(s.map(e=>e.accreditation),e=>e.id),[s]),p=L.useMemo(()=>(0,xh.A)(a.map(e=>e.accreditation),e=>e.id),[a]),f=L.useMemo(()=>(0,xh.A)(d.map(e=>e.accreditation),e=>e.id),[d]),_=L.useCallback(async n=>{await t({eventId:e.eventId,massAccredit:{accreditationsSlotsIds:[n],selecteds:{ids:[e.userInfoId]},strategy:it.Delete}}),o(e=>e.filter(e=>e.id!==n)),l(e=>e.filter(e=>e.id!==n))},[e.eventId,e.userInfoId,o,l]),x=L.useCallback(async t=>{await n({organizationId:e.organizationId,eventId:e.eventId,delegationId:e.delegationId,massAccredit:{accreditationsSlotsIds:[t],selecteds:{ids:[e.userInfoId]},strategy:it.Delete}}),c(e=>e.filter(e=>e.id!==t))},[e.eventId,e.delegationId,e.userInfoId]),I=L.useCallback(async n=>{await t({eventId:e.eventId,massAccredit:{accreditationsSlotsIds:[n],selecteds:{ids:[e.userInfoId]},strategy:it.Add}});const i=d.find(e=>e.id===n);o(e=>[...e,i])},[e.eventId,e.volunteerRegistration,d,o]),v=L.useCallback(t=>e.volunteerRegistration.accreditationsUsersInfos.find(e=>e.accreditationSlot.id===t).checkInAt,[e.volunteerRegistration]);return(0,i.jsx)(Ek.Provider,{value:{assignedAccreditations:g,assignedCategories:u,assignedSlots:s,assignedSlotsIds:r,canAccredit:e.canAccredit,canEditWished:e.canEditWished,defaultHiddenAccreditationsSlotsIds:e.defaultHiddenAccreditationsSlotsIds,scannedCategories:h,scannedAccreditations:p,scannedSlots:a,wishedAccreditations:f,wishedCategories:m,wishedSlots:d,assignSlot:I,deleteAssignedSlot:_,deleteWishedSlot:x,getScannedAt:v},children:e.children})};function zk(){return L.useContext(Ek)}const Ok=e=>{const{translate:t}=vl(),n=Zn(Jc),{assignedSlotsIds:s,assignSlot:o,canAccredit:r,canEditWished:a,defaultHiddenAccreditationsSlotsIds:l,deleteAssignedSlot:d,deleteWishedSlot:c,getScannedAt:u}=zk(),[h,m]=(0,L.useState)(!1);return"assigned"===e.state&&!e.isBlocked&&r?(0,i.jsx)(Ba,{css:{flex:"1",px:"$4"},justify:"end",children:h?(0,i.jsx)(lc,{borderRadius:"$1",height:20,children:t("retirer_05155")}):(0,i.jsx)(Ar,{css:{cursor:"pointer"},font:"error700 textSm medium",onClick:async()=>{m(!0),await d(e.accreditationSlotId)},children:t("retirer_05155")})}):"wished"===e.state&&r?(0,i.jsx)(Ba,{css:{flex:"1",px:"$4"},justify:"end",children:s.includes(e.accreditationSlotId)?(0,i.jsxs)(Ba,{align:"center",gap:"1",children:[(0,i.jsx)(Ar,{color:"success500",children:(0,i.jsx)(nl,{icon:"badge-check",iconStyle:"solid"})}),(0,i.jsx)(Ar,{font:"gray800 textXs medium",children:t("d_j_attribu_e_06450")})]}):e.isBlocked?null:(0,i.jsx)(zl,{isLoading:h,size:"sm",onClick:async()=>{m(!0),await o(e.accreditationSlotId),m(!1)},children:t("ajouter_97327")})}):"wished"!==e.state||!a||e.isBlocked||l.includes(e.accreditationSlotId)?"scanned"===e.state?(0,i.jsx)(Ba,{css:{flex:"1",px:"$4"},children:(0,i.jsx)(Ar,{css:{ellipsis:!0},children:n.toLocaleString(u(e.accreditationSlotId),eo.DateTime)})}):(0,i.jsx)(Ba,{css:{flex:"1",px:"$4"}}):(0,i.jsx)(Ba,{css:{flex:"1",px:"$4"},justify:"end",children:h?(0,i.jsx)(lc,{borderRadius:"$1",height:20,children:t("retirer_05155")}):(0,i.jsx)(Ar,{css:{cursor:"pointer"},font:"error700 textSm medium",onClick:async()=>{m(!0),await c(e.accreditationSlotId)},children:t("retirer_05155")})})},Rk=e=>{const t=Zn(Jc),{canAccredit:n,canEditWished:s}=zk(),o="assigned"===e.state&&n||"scanned"===e.state||"wished"===e.state&&(n||s),r=m(e.slot.name)?e.slot.name:"-";return(0,i.jsxs)(Mc,{children:[(0,i.jsx)(Oc,{css:{textTransform:"capitalize"},children:e.slot.date?t.toLocaleString(e.slot.date,eo.DateOnly.WeekdayShortMonthShort):"-"}),(0,i.jsx)(Oc,{children:(0,i.jsx)(Ar,{css:{ellipsis:!0},title:r,width:1,children:r})}),o&&(0,i.jsx)(Ok,{accreditationSlotId:e.slot.id,isBlocked:e.slot.isBlocked,state:e.state})]})},$k=e=>{const{translate:t}=vl(),{assignedSlots:n,canAccredit:s,canEditWished:o,scannedSlots:r,wishedSlots:a}=zk(),l=(0,L.useMemo)(()=>(0,uc.A)(("assigned"===e.state?n:"scanned"===e.state?r:a).filter(t=>t.accreditationId===e.accreditation.id),e=>[e.date?.toMillis()??1,e.name?.toLowerCase()||""]),[n,r,a,e.accreditation,e.state]),d="assigned"===e.state&&s||"scanned"===e.state||"wished"===e.state&&(s||o);return(0,i.jsx)(GC,{accreditation:e.accreditation,displayNumberOfSlots:!0,displaySlots:e.accreditation.hasSlots,numberOfSlots:l.length,renderActions:!e.accreditation.hasSlots&&d?()=>(0,i.jsx)(Ok,{accreditationSlotId:e.accreditation.hiddenSlotId,isBlocked:!1,state:e.state}):void 0,children:(0,i.jsxs)(Sc,{hideBorder:!0,children:[(0,i.jsxs)(kc,{children:[(0,i.jsx)(Gc,{children:t("date_du_cr_neau_82295")}),(0,i.jsx)(Gc,{children:t("nom_du_cr_neau_54351")}),d&&(0,i.jsx)(Gc,{children:"scanned"===e.state&&t("scann_e_le_27812")})]}),l.map(t=>(0,i.jsx)(Rk,{slot:t,state:e.state},t.id))]})})},Dk=e=>{const{assignedAccreditations:t,scannedAccreditations:n,wishedAccreditations:s}=zk(),o=(0,L.useMemo)(()=>DC(("assigned"===e.state?t:"scanned"===e.state?n:s).filter(t=>t.accreditationCategoryId===e.category.id)),[t,s,e.category,e.state]);return(0,i.jsx)(VC,{category:e.category,children:o.map(t=>(0,i.jsx)($k,{accreditation:t,state:e.state},t.id))})},Pk=e=>{const t=Xn(),{assignedCategories:n,scannedCategories:s,wishedCategories:o}=zk(),r="assigned"===e.state?n:"scanned"===e.state?s:o;return(0,i.jsx)(BC,{children:so(r)?r.map(t=>(0,i.jsx)(Dk,{category:t,state:e.state},t.id)):(0,i.jsx)(Sk,{title:t("no_accreditations")})})},Fk=e=>{const{translate:t}=vl();return(0,i.jsx)(Tk,{canAccredit:e.canAccredit,canEditWished:e.canEditWished,defaultHiddenAccreditationsSlotsIds:e.defaultHiddenAccreditationsSlotsIds,delegationId:e.delegationId,eventId:e.eventId,organizationId:e.organizationId,userInfoId:e.userInfoId,volunteerRegistration:e.volunteerRegistration,children:(0,i.jsxs)(vu,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(zj,{children:t("accr_ditations_39450")}),(0,i.jsx)(bu,{css:{padding:"0"},children:(0,i.jsxs)(mj,{height:1,children:[(0,i.jsxs)(uj,{center:!0,children:[(0,i.jsx)(cj,{path:`${e.basePath}/assigned`,children:t("attribu_es_48167")}),(0,i.jsx)(cj,{path:`${e.basePath}/wished`,children:t("souhait_es_78101")}),(0,i.jsx)(cj,{path:`${e.basePath}/scanned`,children:t("scann_es_13169")})]}),(0,i.jsx)(hj,{path:`${e.basePath}/assigned`,children:(0,i.jsx)(Pk,{state:"assigned"})}),(0,i.jsx)(hj,{path:`${e.basePath}/wished`,children:(0,i.jsx)(Pk,{state:"wished"})}),(0,i.jsx)(hj,{path:`${e.basePath}/scanned`,children:(0,i.jsx)(Pk,{state:"scanned"})})]})})]})})},Mk=e=>{const{translate:t,params:{organizationId:n}}=vl(),{mutate:s}=Bo(),[o,r]=(0,L.useState)(fe.CheckInOut),[a,l]=(0,L.useState)(e.positionSlotUserInfo.checkInAt?.toLocal()),[d,c]=(0,L.useState)(e.positionSlotUserInfo.checkOutAt?.toLocal()),[u,h]=(0,L.useState)(e.positionSlotUserInfo.breakTime),[m,g]=(0,L.useState)(!1),p=(0,L.useMemo)(()=>to(),[]),f=o===fe.Reset||a?.isValid&&d?.isValid&&d>a||a?.isValid&&!d?.isValid;return(0,i.jsx)(Lb,{isOpen:e.isOpen,onClose:e.onClose,children:(0,i.jsxs)(Nb,{children:[(0,i.jsx)(Mb,{icon:"sliders",children:t("mise_jour_du_76261")}),(0,i.jsxs)(Fb,{gap:"2",children:[(0,i.jsx)(Ar,{font:"gray700 textSm medium",children:t("que_souhaitez_v_87607")}),(0,i.jsx)(vc,{state:o===fe.CheckInOut?"checked":"unchecked",onClick:()=>{r(fe.CheckInOut)},children:t("mettre_jour_l_00128")}),o===fe.CheckInOut&&(0,i.jsxs)(Ba,{css:{paddingBottom:"$3",paddingLeft:"$6"},gap:"6",children:[(0,i.jsx)(Vu,{hint:t("date_et_heure_d_93417"),rightIcon:"xmark",value:a,zone:p,onChange:l,onRightIconClick:()=>l(null)}),(0,i.jsx)(Vu,{hint:t("date_et_heure_d_65738"),rightIcon:"xmark",value:d,zone:p,onChange:c,onRightIconClick:()=>c(null)}),(0,i.jsx)(Bl,{css:{visibility:2723===n?"hidden":"visible"},hint:t("temps_de_pause_00051"),shouldParseAsInt:!0,value:u,onChange:h})]}),(0,i.jsx)(vc,{state:o===fe.Reset?"checked":"unchecked",onClick:()=>{r(fe.Reset)},children:t("remettre_z_ro_11572")})]}),(0,i.jsx)(Pb,{children:n=>(0,i.jsx)(zl,{disabled:!f,isLoading:m,onClick:async()=>{g(!0),await s({eventId:e.positionSlotUserInfo.eventId,checkIn:{breakTime:u,checkInAt:a?.toUTC(),checkOutAt:d?.toUTC(),strategy:o,positionsSlotsUsersInfosIds:[e.positionSlotUserInfo.id]}}),n()},children:t("mettre_jour_85141")})})]})})},Nk=e=>{const{translate:t}=vl(),{mutate:n}=Bo(),{mutate:s}=Qo(),[o,r]=L.useState(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Yc,{triggerElem:e.triggerElem,children:[e.canCheckIn&&(0,i.jsx)(Kd,{icon:"circle-check",onClick:()=>{r(!0)},children:t("mettre_jour_l_00128")}),e.canCheckIn&&e.psui.state!==pe.Waiting&&(0,i.jsx)(Kd,{icon:"arrows-rotate",onClick:async()=>{await n({eventId:e.psui.eventId,checkIn:{strategy:fe.Reset,positionsSlotsUsersInfosIds:[e.psui.id]}}),e.reloadCheckIn(e.psui.id)},children:t("remettre_z_ro_11572")}),e.canDelete&&(0,i.jsx)(Kd,{color:"red",icon:"user-xmark",onClick:async()=>{await s({eventId:e.psui.eventId,massAssign:{positionsSlotsIds:[e.psui.positionSlot.id],selecteds:{ids:[e.psui.userInfoId]},strategy:it.Delete}}),e.onDelete(e.psui.id)},children:t("d_saffecter_du_47122")})]}),(0,i.jsx)(Mk,{isOpen:o,positionSlotUserInfo:e.psui,onClose:()=>{e.reloadCheckIn(e.psui.id),r(!1)}})]})},Lk=e=>{const{translate:t}=vl(),n=Zn(Jc),s=Zn(rp),o=Zn(ph),{mutate:r}=Bo(),a=Tc(),l=(0,L.useMemo)(()=>{const t=e.positionSlotUserInfo.positionSlot;return m(t.name)?`${t.name} - ${o.toDisplayString(t.range)}`:o.toDisplayString(t.range)},[e.positionSlotUserInfo.positionSlot]),d=()=>(0,i.jsxs)(Ba,{align:"center",css:{padding:"$3","@tablet":{padding:"$3 $4"}},gap:"3",width:1,wrap:"wrap",children:[(0,i.jsx)(WC,{color:e.positionSlotUserInfo.position.color,icon:e.positionSlotUserInfo.position.icon}),(0,i.jsxs)(Ba,{css:{flex:"1",overflow:"hidden"},direction:"column",gap:"1",children:[(0,i.jsx)(Ar,{color:"gray800",css:{fontWeight:"$medium",overflow:"hidden",textOverflow:"ellipsis","@tablet":{fontWeight:"$semiBold"}},children:e.positionSlotUserInfo.position.name}),(0,i.jsx)(Ar,{color:"gray500",fontSize:"textSm",children:l})]})]});return(0,i.jsxs)(Ba,{css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs","@tablet":{borderRadius:"$2"}},direction:"column",width:1,children:[e.canCheckIn?(0,i.jsx)(el,{to:xs.POSITION({organizationId:e.positionSlotUserInfo.organizationId,eventId:e.positionSlotUserInfo.eventId,positionId:e.positionSlotUserInfo.position.id}),children:d()}):d(),(e.canCheckIn||e.canDelete)&&(0,i.jsxs)(Ba,{align:"center",css:{borderTop:"1px solid $gray200",padding:"$3","@tablet":{padding:"$3 $4"}},justify:"between",width:1,children:[e.positionSlotUserInfo.state===pe.CheckedOut?(0,i.jsx)(rc,{leftIcon:"clock",children:t("temps_total_79448",s.minutesToHoursMinutesString(e.positionSlotUserInfo.timeDifferenceMinutes))}):e.positionSlotUserInfo.state===pe.CheckedIn?(0,i.jsx)(rc,{color:"success",leftIcon:"circle",leftIconStyle:"solid",children:t("point_le_1_63576",n.toLocaleString(e.positionSlotUserInfo.checkInAt.toLocal(),a?eo.ShortDateTime:eo.DateTime))}):(0,i.jsx)(rc,{color:"warning",leftIcon:"circle",leftIconStyle:"solid",children:t("non_point_42145")}),(0,i.jsxs)(Ba,{gap:"3",children:[e.canCheckIn&&e.positionSlotUserInfo.state===pe.Waiting&&(0,i.jsx)(zl,{size:"sm",onClick:async()=>{await r({eventId:e.positionSlotUserInfo.eventId,checkIn:{strategy:fe.CheckIn,positionsSlotsUsersInfosIds:[e.positionSlotUserInfo.id]}}),e.reloadCheckIn(e.positionSlotUserInfo.id)},children:t("pointer_80927")}),e.canCheckIn&&e.positionSlotUserInfo.state===pe.CheckedIn&&(0,i.jsx)(zl,{color:"white",size:"sm",onClick:async()=>{await r({eventId:e.positionSlotUserInfo.eventId,checkIn:{strategy:fe.CheckOut,positionsSlotsUsersInfosIds:[e.positionSlotUserInfo.id]}}),e.reloadCheckIn(e.positionSlotUserInfo.id)},children:t("d_pointer_25328")}),(0,i.jsx)(Nk,{canCheckIn:e.canCheckIn,canDelete:e.canDelete,psui:e.positionSlotUserInfo,reloadCheckIn:e.reloadCheckIn,triggerElem:(0,i.jsx)(Ar,{children:(0,i.jsx)(zl,{color:"white",rightIcon:"ellipsis-vertical",size:"sm"})}),onDelete:e.onDelete})]})]})]})},Bk=L.createContext({}),Vk=e=>{const{data:t}=Vo({organizationId:e.organizationId,eventId:e.eventId,userInfoId:e.volunteerRegistration.userInfo.id}),[n,s]=L.useState(e.volunteerRegistration.positionsSlotsUsersInfos),o=L.useMemo(()=>(0,uc.A)((0,xh.A)(n.map(e=>e.positionCategory),e=>e.id),e=>e.name.toLowerCase()),[n]),r=L.useCallback(e=>{s(t=>t.filter(t=>t.id!==e))},[s]),a=L.useCallback(async t=>{const i=n.find(e=>e.id===t),{event:{volunteerRegistration:{positionSlotUserInfo:o}}}=await(r={eventId:e.eventId,volunteerRegistrationId:e.volunteerRegistration.id,positionSlotId:i.positionSlot.id},a=await Y(),go("query PositionSlotUserInfo(\n $eventId: EventId!\n $volunteerRegistrationId: VolunteersRegistrationId!\n $positionSlotId: PositionsSlotId!\n) {\n event(id: $eventId) {\n volunteerRegistration(id: $volunteerRegistrationId) {\n positionSlotUserInfo(positionSlotId: $positionSlotId) {\n ...UserPositionSlotUserInfo\n }\n }\n }\n}\n",{variables:r,token:a||void 0,fragments:[Vs.UserPositionSlotUserInfoFragment]}));var r,a;s(e=>e.map(e=>e.id===t?o:e))},[e.eventId,e.volunteerRegistration,n,s]);return(0,i.jsx)(Bk.Provider,{value:{assignedCategories:o,assignedPsuis:n,canCheckIn:e.canCheckIn,canDelete:e.canDelete,formsUsersInfos:t.organization?.userInfo.formsUsersInfos??[],onAssignedPsuiDelete:r,reloadCheckIn:a},children:e.children})};function Uk(){return L.useContext(Bk)}const Wk=()=>{const{assignedCategories:e,assignedPsuis:t,canCheckIn:n,canDelete:s,onAssignedPsuiDelete:o,reloadCheckIn:r}=Uk(),a=(0,L.useMemo)(()=>(0,cc.A)(t,e=>e.positionCategory.id),[t]);return(0,i.jsx)(BC,{children:e.map(e=>{const t=a[e.id];return(0,i.jsx)(VC,{category:e,children:t.map(e=>(0,i.jsx)(Lk,{canCheckIn:"function"==typeof n?n(e.positionCategoryId,e.position.id):n,canDelete:s(e.positionCategoryId,e.position.id),positionSlotUserInfo:e,reloadCheckIn:r,onDelete:o},e.id))},e.id)})})},Gk=e=>(0,i.jsxs)(Ba,{align:"center",css:e.css,direction:"column",height:1,justify:"center",width:1,children:[(0,i.jsx)(Ar,{css:{inlineSize:"70%","@tablet":{inlineSize:"50%",blockSize:"auto",maxInlineSize:"100px"}},children:(0,i.jsx)("img",{alt:"Blank image",className:"blank-image",height:"100%",src:e.imageSrc??_d.WeezeventBlankPerson,width:"100%"})}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(Ar,{css:{color:"$gray800",fontSize:"$textMd",fontWeight:"$semiBold","@tablet":{color:"$gray900",fontSize:"$textMd",fontWeight:"$medium"}},textAlign:"center",children:e.title}),m(e.subtitle)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(Ar,{color:"gray500",fontSize:"textSm",textAlign:"center",children:e.subtitle})]}),e.button&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(Ba,{justify:"center",children:e.button})]})]});function Hk(e,t,n,i){return(0,uc.A)(e.map(e=>{const s=e.positions.map((s,o)=>({name:s.name,range:s.range?t.toDisplayString(s.range):"-",path:xs.POSITION({organizationId:n,eventId:i,positionId:s.id}),form:e.form,rank:o+1})),o=e.positionsCategories.map((s,o)=>({name:s.name,range:s.range?t.toDisplayString(s.range):"-",path:xs.POSITION_CATEGORY({organizationId:n,eventId:i,positionCategoryId:s.id}),form:e.form,rank:o+1})),r=e.positionsSlots.map(t=>({name:t.position.name,range:t.nameOrRange,path:xs.POSITION({organizationId:n,eventId:i,positionId:t.position.id}),form:e.form,rank:-1}));return s.concat(o).concat(r)}).flat(),[e=>e.form.name,(e,t)=>t])}const qk=({message:e,title:t})=>(0,i.jsxs)(rl,{color:"warning",leftIcon:"triangle-exclamation",children:[(0,i.jsx)(Ba,{css:{fontWeight:"$medium"},direction:"column",children:t}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ba,{css:{fontWeight:"normal"},children:e})]}),Kk=({editDisabled:e,editPath:t,eventId:n,form:s,organizationId:o,userInfoId:r})=>{const a=ni();return(0,i.jsx)(rc,{color:"primary",cursor:e?"default":"pointer",onContentClick:()=>{e||a.push(t?n?t(o,r,n,s.id):t(o,r,s.id):Vi.FORM({organizationId:o,eventId:n??void 0,formId:s.id}))},children:s.name})},Yk=({editFormPath:e,editPath:t,formsUsersInfos:n,isEditDisabled:s=!1})=>{const{history:o,params:{organizationId:r,eventId:a,userInfoId:l},translate:d}=vl(),c=Zn(ph),u=(0,L.useMemo)(()=>Hk(n,c,r,a),[n]),h=Tc();return(0,i.jsxs)(Ba,{direction:"column",gap:"6",width:1,children:[s&&(0,i.jsx)(qk,{message:d("you_are_already_assigned_to_missions"),title:d("wished_positions_can_no_longer_be_changed")}),(0,i.jsx)(Lc,{filters:m(t)&&(0,i.jsx)(zl,{color:"white",disabled:s,size:"sm",to:t,children:d("_diter_62574")}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Gc,{children:d("nom_de_la_missi_64605")}),!h&&(0,i.jsx)(Gc,{children:d("Date")}),!h&&(0,i.jsx)(Gc,{children:d("Form")})]}),numberOfPages:0,offset:0,rows:(0,i.jsx)(i.Fragment,{children:so(u)?u.map((t,n)=>(0,i.jsxs)(Mc,{children:[(0,i.jsxs)(Oc,{align:"start",css:{color:"$gray800",fontWeight:"$medium",fontSize:"$textSm"},direction:"column",gap:"1",justify:"center",children:[(0,i.jsx)(Ar,{color:"gray900",css:{cursor:"pointer"},fontWeight:"medium",onClick:()=>{o.push(t.path)},children:t.name}),t.form.positionRanking===Ke.Ranked&&(0,i.jsx)(Ar,{color:"gray500",children:d("choix_n_1_00613",t.rank)}),h&&(0,i.jsx)(Ar,{color:"gray500",css:{fontWeight:400,lineHeight:"20px"},fontSize:"textSm",children:t.range})]}),!h&&(0,i.jsx)(Oc,{children:t.range}),!h&&(0,i.jsx)(Oc,{children:(0,i.jsx)(Kk,{editDisabled:s,editPath:e,eventId:a,form:t.form,organizationId:r,userInfoId:l})})]},n)):(0,i.jsx)(Mc,{css:{height:"200px"},children:(0,i.jsx)(Oc,{children:(0,i.jsx)(Gk,{title:d("aucune_mission_61179")})})})}),setOffset:td.A,title:d("missions_souhai_23225"),totalCount:0})]})},Zk=()=>{const{formsUsersInfos:e}=Uk();return(0,i.jsx)(Ba,{css:{background:"$gray50",padding:"$6"},height:1,width:1,children:(0,i.jsx)(Yk,{formsUsersInfos:e})})},Xk=e=>{const{translate:t}=vl();return(0,i.jsx)(Vk,{canCheckIn:e.canCheckIn,canDelete:e.canDelete,eventId:e.eventId,organizationId:e.organizationId,volunteerRegistration:e.volunteerRegistration,children:(0,i.jsxs)(vu,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(zj,{children:t("missions_63972")}),(0,i.jsx)(bu,{css:{padding:"0"},children:(0,i.jsxs)(mj,{height:1,children:[(0,i.jsxs)(uj,{center:!0,children:[(0,i.jsx)(cj,{path:`${e.basePath}/assigned`,children:t("attribu_es_48167")}),(0,i.jsx)(cj,{path:`${e.basePath}/wished`,children:t("souhait_es_78101")})]}),(0,i.jsx)(hj,{path:`${e.basePath}/assigned`,children:(0,i.jsx)(Wk,{})}),(0,i.jsx)(hj,{path:`${e.basePath}/wished`,children:(0,i.jsx)(Zk,{})})]})})]})})},Jk=L.createContext({}),Qk=e=>{const{data:t,loader:n}=Qn("query TeamRightPanel($eventId: EventId!, $teamCode: TeamCode!) {\n event(id: $eventId) {\n team(teamCode: $teamCode) {\n form {\n name\n }\n\n members {\n ...UserInfoTeamRightPanel\n }\n }\n }\n}\n",{eventId:e.eventId,teamCode:e.teamCode},[Vs.UserInfoTeamRightPanelFragment]);const{mutate:s}=Qo(),[o,r]=L.useState([]),a=L.useMemo(()=>{const e=o.flatMap(e=>e.positionsCategories.flatMap(e=>e.positions.flatMap(e=>e.slots.map(t=>({...t,position:(0,Er.A)(e,["id","name","icon","color"])}))))),t=o.flatMap(e=>e.positions.flatMap(e=>e.slots.map(t=>({...t,position:(0,Er.A)(e,["id","name","icon","color"])})))),n=o.flatMap(e=>e.positionsSlots);return(0,xh.A)(e.concat(t).concat(n),e=>e.id)},[o]),l=L.useMemo(()=>(0,xh.A)(o.flatMap(e=>e.positionsSlotsUsersInfos.map(e=>({...e.positionSlot,position:e.position}))),e=>e.id),[o]),d=L.useMemo(()=>(0,uc.A)((0,xh.A)(a.concat(l),e=>e.id),e=>[e.position.name.toLowerCase(),e.range.start.toMillis()]),[a,l]),c=L.useMemo(()=>Object.fromEntries(o.map(e=>{const t=(0,Bs.A)(e.positionsCategories.flatMap(e=>e.positions.flatMap(e=>e.slots.map(e=>e.id))).concat(e.positions.flatMap(e=>e.slots.map(e=>e.id))).concat(e.positionsSlots.map(e=>e.id)));return[e.userInfo.id,t]})),[o]),u=L.useMemo(()=>Object.fromEntries(o.map(e=>{const t=e.positionsSlotsUsersInfos.map(e=>e.positionSlot.id);return[e.userInfo.id,t]})),[o]),h=L.useCallback(async(t,n)=>{await s({eventId:e.eventId,massAssign:{positionsSlotsIds:[n],selecteds:{ids:[t]},strategy:it.Add}});const{event:i}=await function(e,t){return go("query TeamRightPanelMember($eventId: EventId!, $userInfoId: UsersInfoId!) {\n event(id: $eventId) {\n volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n ...UserInfoTeamRightPanel\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[Vs.UserInfoTeamRightPanelFragment]})}({eventId:e.eventId,userInfoId:t},await Y());r(e=>e.map(e=>e.userInfo.id===t?i.volunteerRegistration:e))},[e.eventId,r]);return L.useEffect(()=>{r(t.event?.team?.members??[])},[t.event,r]),(0,i.jsx)(Jk.Provider,{value:{allSlots:d,form:t.event?.team?.form,loader:n,memberIdToAssignedSlotsIds:u,memberIdToWishedSlotsIds:c,members:o,assign:h},children:e.children})};function eA(){return L.useContext(Jk)}const tA=e=>{const{translate:t}=vl(),{assign:n,memberIdToAssignedSlotsIds:s,memberIdToWishedSlotsIds:o}=eA(),[r,a]=(0,L.useState)(!1),l=s[e.member.userInfo.id].includes(e.slot.id),d=o[e.member.userInfo.id].includes(e.slot.id);return(0,i.jsxs)(Mc,{children:[(0,i.jsx)(Oc,{children:(0,i.jsx)(xj,{size:32,userInfo:e.member.userInfo})}),(0,i.jsx)(Oc,{justify:"end",children:l?(0,i.jsxs)(Ba,{align:"center",gap:"1",children:[(0,i.jsx)(Ar,{color:"success500",children:(0,i.jsx)(nl,{icon:"badge-check",iconStyle:"solid"})}),(0,i.jsx)(Ar,{font:"gray800 textXs medium",children:t("d_j_affect_71706")})]}):d?(0,i.jsx)(zl,{isLoading:r,size:"sm",onClick:()=>{a(!0),n(e.member.userInfo.id,e.slot.id)},children:t("affecter_94255")}):(0,i.jsxs)(Ba,{align:"center",gap:"1",children:[(0,i.jsx)(Ar,{color:"error500",children:(0,i.jsx)(nl,{icon:"circle-xmark",iconStyle:"solid"})}),(0,i.jsx)(Ar,{font:"gray800 textXs medium",children:t("non_souhait_46147")})]})})]})},nA=e=>{const{translate:t}=vl(),{members:n}=eA(),s=Zn(ph),o=(0,L.useMemo)(()=>Ch(s,e.slot,e.slot.position.name,{slot:{includeRange:!0}}),[e.slot]);return(0,i.jsxs)(Ba,{css:{background:"white",bd:!0,overflow:"hidden"},direction:"column",children:[(0,i.jsxs)(Ba,{css:{padding:"$3 $4"},gap:"3",children:[(0,i.jsx)(WC,{color:e.slot.position.color,icon:e.slot.position.icon}),(0,i.jsxs)(Ba,{direction:"column",children:[(0,i.jsx)(Ar,{font:"gray800 textSm semiBold",children:e.slot.position.name}),(0,i.jsx)(Ar,{color:"gray500",children:o})]})]}),(0,i.jsxs)(Sc,{hideBorder:!0,children:[(0,i.jsxs)(kc,{children:[(0,i.jsx)(Gc,{children:t("full_name")}),(0,i.jsx)(Gc,{})]}),n.map(t=>(0,i.jsx)(tA,{member:t,slot:e.slot},t.userInfo.id))]})]})},iA=()=>{const{allSlots:e}=eA();return(0,i.jsx)(Ba,{direction:"column",gap:"3",width:1,children:e.map(e=>(0,i.jsx)(nA,{slot:e},e.id))})},sA=e=>{const{translate:t}=vl(),{form:n,loader:s}=eA();return(0,i.jsxs)(vu,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(zj,{children:(0,i.jsxs)(Ba,{direction:"column",gap:"1",children:[(0,i.jsx)(Ar,{children:t("_quipe_1_19590",e.teamCode)}),(0,i.jsx)(Ar,{color:"gray500",fontSize:"textSm",children:t("formulaire_1_39637",n?.name)})]})}),(0,i.jsx)(bu,{css:{background:"$gray50",py:"$6"},children:s||(0,i.jsx)(iA,{})})]})},oA=e=>(0,i.jsx)(Qk,{eventId:e.eventId,teamCode:e.teamCode,children:(0,i.jsx)(sA,{...e})}),rA=({editFormPath:e,editPath:t,eventId:n,organizationId:s,formsUsersInfos:o,showEditButton:r,userInfoId:a,isEditDisabled:l=!1})=>{const{translate:d}=vl(),c=Zn(Jc),u=Zn(ph),h=(0,L.useMemo)(()=>(0,uc.A)(o.flatMap(e=>e.slots.map(t=>({range:t.range,display:e.form.slotDisplay,form:e.form}))),({range:e})=>e.start.toMillis()),[o]),m=Tc(),g=(0,L.useCallback)((e,t)=>{switch(t){case It.Calendar:case It.DisplayDays:return(0,i.jsx)(Ar,{children:c.toLocaleString(e.start,eo.DateOnly.MonthLong)});case It.Display:case It.Custom:return(0,i.jsxs)(Ba,{direction:"column",children:[(0,i.jsx)(Ar,{css:{lineHeight:"20px"},children:u.toDisplayString(e,{hideTime:!0})}),(0,i.jsx)(Ar,{color:"gray500",css:{fontWeight:400,lineHeight:"20px"},fontSize:"textSm",children:u.toDisplayString(e,{hideDate:!0})})]});case It.Hide:return null;default:return ll()}},[]);return(0,i.jsxs)(Ba,{direction:"column",gap:"6",children:[l&&(0,i.jsx)(qk,{message:d("you_are_already_assigned_to_missions"),title:d("availabilities_can_no_longer_be_changed")}),(0,i.jsx)(Lc,{filters:r&&(0,i.jsx)(zl,{color:"white",disabled:l,size:"sm",to:t,children:d("_diter_62574")}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Gc,{children:d("Date")}),!m&&(0,i.jsx)(Gc,{children:d("Form")})]}),numberOfPages:0,offset:0,rows:(0,i.jsx)(i.Fragment,{children:so(h)?h.map((t,o)=>(0,i.jsxs)(Mc,{children:[(0,i.jsx)(Oc,{children:g(t.range,t.display)}),!m&&(0,i.jsx)(Oc,{children:(0,i.jsx)(Kk,{editDisabled:l,editPath:e,eventId:n,form:t.form,organizationId:s,userInfoId:a})})]},o)):(0,i.jsx)(Mc,{css:{height:"200px"},children:(0,i.jsx)(Oc,{children:(0,i.jsx)(Gk,{title:d("aucune_disponib_15602")})})})}),setOffset:td.A,title:d("disponibilit_s_49923"),totalCount:0})]})},aA=e=>{const t=Xn(),{data:n,loader:s}=Zo({organizationId:e.organizationId,eventId:e.eventId,userInfoId:e.userInfoId}),{permissions:[o],isLoading:r}=fk(uk({eventId:e.eventId,userInfoId:e.userInfoId}));return(0,i.jsxs)(vu,{returnToFallback:e.returnPathFallback,size:"md",children:[(0,i.jsx)(zj,{children:t("disponibilit_s_49923")}),(0,i.jsx)(bu,{children:s||r?s:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(rA,{editFormPath:(t,n,i,s)=>location.host.startsWith("app.")?Ps.EDIT_USER_SLOTS_FORM(t,i,n,s):e.delegationId?hs.MEMBER_EDIT({organizationId:t,userInfoId:n,delegationId:e.delegationId,eventId:i,formId:s}):QI.MEMBER_FORM_EDIT({organizationId:t,userInfoId:n,eventId:i,formId:s}),editPath:Ps.EDIT_USER_SLOTS(e.organizationId,e.eventId,e.userInfoId),eventId:e.eventId,formsUsersInfos:n.organization.userInfo.formsUsersInfos,organizationId:e.organizationId,showEditButton:o,userInfoId:e.userInfoId}),(0,i.jsx)(Ya,{height:"6"})]})})]})},lA=e=>{const{history:t}=vl();return(0,i.jsxs)(Sr.dO,{children:[(0,i.jsx)(Sr.qh,{path:e.accreditationsPanelPath,children:(0,i.jsx)(Fk,{basePath:e.accreditationsPanelPath,canAccredit:e.canAccredit,canEditWished:e.canEditWishedAccreditations,defaultHiddenAccreditationsSlotsIds:e.defaultHiddenAccreditationsSlotsIds,delegationId:e.delegationId,eventId:e.eventId,organizationId:e.organizationId,userInfoId:e.volunteerRegistration.userInfo.id,volunteerRegistration:e.volunteerRegistration,onClose:()=>{e.reloadRow(),t.goBack(e.returnPathFallback)}})}),(0,i.jsx)(Sr.qh,{path:e.availabilitiesPanelPath,children:(0,i.jsx)(aA,{delegationId:e.delegationId,eventId:e.eventId,organizationId:e.organizationId,returnPathFallback:e.availabilitiesPanelPath,userInfoId:e.volunteerRegistration.userInfo.id})}),(0,i.jsx)(Sr.qh,{path:e.positionsPanelPath,children:(0,i.jsx)(Xk,{basePath:e.positionsPanelPath,canCheckIn:e.canCheckIn,canDelete:e.canDeletePosition,eventId:e.eventId,organizationId:e.organizationId,volunteerRegistration:e.volunteerRegistration,onClose:()=>{e.reloadRow(),t.goBack(e.returnPathFallback)}})}),(e.teamsPanelsPath||[]).map((n,s)=>(0,i.jsx)(Sr.qh,{path:n,children:(0,i.jsx)(oA,{eventId:e.eventId,teamCode:(e.volunteerRegistration.teams||[])[s].teamCode,onClose:()=>{e.reloadRow(),t.goBack(e.returnPathFallback)}})},s))]})};function dA(e,t){return 0===e.length||e.includes(t)}const cA=e=>{const t=Xn(),[n,s]=L.useState(!1),o=L.useCallback(async()=>{let t=!0;return s(!0),await e.onDelete(),t&&s(!1),()=>{t=!1}},[e.onDelete,n,s]);return(0,i.jsxs)(au,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Ba,{justify:"center",children:(0,i.jsx)(Ba,{align:"center",css:{background:"$error100",borderRadius:"48px",color:"$error600",height:"48px",fontSize:"20px",width:"48px"},justify:"center",children:(0,i.jsx)(nl,{icon:"circle-exclamation",iconStyle:"light"})})}),(0,i.jsx)(Ya,{height:"5"}),(0,i.jsx)(Ar,{css:{ellipsis:!0},font:"gray900 textLg regular",textAlign:"center",title:e.text,children:e.text}),"subtext"in e&&io(e.subtext).map((e,t)=>(0,i.jsxs)(L.Fragment,{children:[(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(Ar,{color:"gray500",textAlign:"center",children:e})]},t)),"children"in e&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(Ar,{color:"gray500",css:{alignSelf:"center"},children:e.children})]}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsxs)(Ba,{gap:"3",justify:"end",children:[(0,i.jsx)(zl,{color:"error",isLoading:n,onClick:o,children:e.buttonText}),(0,i.jsx)(zl,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},uA=e=>{const{translate:t,params:{organizationId:n,eventId:s,delegationId:o}}=vl(),{mutate:r}=Xo(),{mutate:a}=No(),{mutate:l}=Wo(),[d,c]=(0,L.useState)(!1),[u,h]=(0,L.useState)(!1),m=(0,L.useMemo)(()=>e.customDocuments.filter(t=>dA(t.populationsIds,e.member.fields.population)),[e.customDocuments,e.member]),g=s&&e.canAccredit&&e.accreditationState===le.WaitingAccreditation,p=s&&e.showDocumentsDownload&&void 0!==e.member.links&&so(e.allowedCustomDocuments);return g||p||e.canDelete||e.showDeleteFromEvent?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Yc,{children:[g&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Kd,{icon:"check",onClick:async()=>{await r({eventId:s,delegationId:o,usersInfosIds:[e.member.id]}),e.reload()},children:t("valider_les_acc_80801")}),(0,i.jsx)(Kd,{icon:"badge-check",to:Ps.ACCREDIT(n,s,e.member.id),children:t("accr_diter_70543")}),(0,i.jsx)(Xu,{color:"gray100",direction:"horizontal"})]}),p&&(0,i.jsx)(i.Fragment,{children:so(e.allowedCustomDocuments)&&(0,i.jsx)(i.Fragment,{children:e.allowedCustomDocuments.map((n,s)=>{const o=m.find(e=>e.slug===n);return o?(0,i.jsx)(Kd,{download:`${e.member.nameOrEmail}-${o.name}`,icon:"arrow-down-to-bracket",target:"_blank",to:_g(e.member.links?.userCustomDocumentLinks[n],"pdf"),children:t("t_l_charger_1_80752",o.name)},s):sn.includes(n)?(0,i.jsx)(Kd,{download:`${e.member.nameOrEmail}-custom-badge`,icon:"arrow-down-to-bracket",target:"_blank",to:_g(e.member.links?.userCustomBadgeLinks[n],"pdf"),children:t("t_l_charger_1_80752",Vx(n))},s):null})})}),p&&e.canDelete&&(0,i.jsx)(Xu,{color:"gray100",direction:"horizontal"}),e.canDelete&&(0,i.jsx)(Kd,{color:"red",icon:"user-xmark",onClick:()=>c(!0),children:t("retirer_de_la_d_64963")}),e.showDeleteFromEvent&&(0,i.jsx)(Kd,{color:"red",icon:"trash-can",onClick:()=>h(!0),children:t("delete_from_eve_69290")})]}),d&&(0,i.jsx)(cA,{buttonText:t("supprimer_43083"),subtext:[t("_tes_vous_sur_d_88752")],text:t("suppression_de_73669",e.member.nameOrEmail),onClose:()=>c(!1),onDelete:async()=>{await a({organizationId:n,eventId:s,delegationId:o,selecteds:{ids:[e.member.id]},deleteFromEvent:e.deleteFromEvent}),e.reload()}}),u&&e.volunteerRegistrationId&&(0,i.jsx)(cA,{buttonText:t("supprimer_43083"),subtext:[t("are_you_sure_yo_46668")],text:t("suppression_de_73669",e.member.nameOrEmail),onClose:()=>h(!1),onDelete:async()=>{await l({eventId:s,selecteds:{ids:[e.member.id]}}),e.reload()}})]}):null};function hA(e,t){switch(t){case je.Accreditation:return e("accr_ditations_39450");case je.Delegation:return e("d_l_gations_78318");case je.Event:return e("Event");case je.Position:return e("missions_63972");case je.UserInfo:return e("membres_11310");default:return ll()}}function mA(e){return m(e.label)?`${e.name} (${e.label})`:e.name}const gA=({displayName:e,isAddDeleteVisible:t,isResetVisible:n,massEditFieldInput:s,reset:o,strategy:r,change:a})=>{const{translate:l}=vl();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(Ar,{font:"gray700 textSm medium",children:l("que_souhaitez_v_87607")}),(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(vc,{state:o||r!==it.Replace?"unchecked":"checked",onClick:()=>{a("massEdit.reset",!1),a("massEdit.strategy",it.Replace)},children:l("remplacer_les_v_78885")}),!o&&r===it.Replace&&s,(0,i.jsx)(Ya,{height:"3"}),t&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(vc,{state:o||r!==it.Add?"unchecked":"checked",onClick:()=>{a("massEdit.reset",!1),a("massEdit.strategy",it.Add)},children:l("ajouter_des_val_80159")}),!o&&r===it.Add&&s,(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:o||r!==it.Delete?"unchecked":"checked",onClick:()=>{a("massEdit.reset",!1),a("massEdit.strategy",it.Delete)},children:l("supprimer_des_v_96120")}),!o&&r===it.Delete&&s,(0,i.jsx)(Ya,{height:"3"})]}),n&&(0,i.jsx)(vc,{state:o?"checked":"unchecked",onClick:()=>a("massEdit.reset",!0),children:l("r_initialiser_42983",e)})]})},pA=e=>{const t=Xn(),n=(0,L.useMemo)(()=>(0,uc.A)(e.customFields??[],e=>e.name.toLowerCase()),[e.customFields]),s=(0,L.useMemo)(()=>(0,uc.A)(n.map(e=>({slug:e.slug,name:e.name,label:e.label})).concat(e.properties.map(e=>({slug:e,name:t(e),label:null}))),e=>e.name.toLowerCase()),[n,e.properties]);return(0,i.jsx)(au,{size:"md",onClose:e.onClose,children:(0,i.jsx)(Ga.lV,{initialValues:{massEdit:{reset:!1,selecteds:e.selecteds,slug:"",value:"",strategy:it.Replace}},initialValuesEqual:Mr.A,render:({form:o,handleSubmit:r,submitting:a,values:l})=>{const{reset:d,slug:c,strategy:u}=l.massEdit,h=s.find(e=>e.slug===c),g=n.find(e=>e.slug===c),p=m(c)?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ar,{css:{paddingLeft:"$6"},children:(0,i.jsx)(eC,{campaigns:e.campaigns,categories:e.categories,change:o.change,customDocuments:e.customDocuments,customField:g,forms:e.forms,name:"massEdit.value",slug:c,tags:e.tags,traces:e.traces,value:l.massEdit.value})})]}):null,f=c===se.Tag||c===Ce.Campaigns||c===Ce.Documents||!0===g?.canSelectMultiple,_=c!==se.Category&&c!==ve.Category&&c!==Ce.Category&&c!==lt.Category&&c!==se.WeezeventIsSynchronized&&c!==ve.Privacy&&c!==Ce.Form&&c!==Ce.IsLocked&&c!==Ce.ShowFormLinkInDelegationSpace&&c!==Ce.ShowInDelegationSpace&&c!==Ce.CanLeadersAddMembers&&c!==Ce.CanLeadersEditCustomFields&&c!==Ce.CanLeadersEditMembers&&c!==Ce.CanLeadersDeleteMembers&&c!==Ce.CanLeadersEditColumns&&c!==Ce.CanLeadersImportMembers&&c!==Ce.CanLeadersSeeHiddenAccreditationsSlots;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{justify:"center",children:(0,i.jsx)(sC,{color:"primary",icon:"sliders"})}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(Ar,{color:"gray900",fontSize:"textLg",fontWeight:"medium",textAlign:"center",children:t("_dition_de_la_v_67585")}),(0,i.jsx)(Ya,{height:"7"}),e.isLoading?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(lc,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(lc,{borderRadius:"$1",height:40,width:1})]}):(0,i.jsx)(Ym,{isSearchVisible:!0,label:t("quel_est_le_cha_81138"),name:"massEdit.slug",placeholder:t("s_lectionnez_un_82446"),children:s.map(e=>(0,i.jsx)("option",{value:e.slug,children:mA(e)},e.slug))}),h&&(0,i.jsx)(gA,{change:o.change,displayName:h.name,isAddDeleteVisible:f,isResetVisible:_,massEditFieldInput:p,reset:d,strategy:u}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsxs)(Ba,{gap:"3",justify:"end",children:[(0,i.jsx)(zl,{disabled:(x=l.massEdit,I=g,!(x.reset||!I||I.fieldType!==We.Select||I.canSelectMultiple||"number"==typeof x.value&&!isNaN(x.value))),isLoading:a,onClick:r,children:t("modifier_la_val_07602")}),(0,i.jsx)(zl,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]});var x,I},onSubmit:async t=>{const n=(await e.mutate(t.massEdit)).numberOfEdited;e.onSuccess(n),e.onClose()}})})},fA=e=>{const{data:t,isLoading:n}=Qn("query PositionsMassEditInfos($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n customFields(variety: Position, sort: { attribute: Name, direction: Asc }) {\n nodes {\n ...MassEditCustomField\n }\n }\n\n tags {\n nodes {\n id\n name\n }\n }\n }\n\n event(id: $eventId) {\n positionsCategories {\n id\n name\n }\n\n traces {\n id\n name\n }\n }\n}\n",{organizationId:e.organizationId,eventId:e.eventId},[Vs.MassEditCustomFieldFragment]);const s=(0,L.useMemo)(()=>kn.filter(e=>e!==lt.Name),[]);return(0,i.jsx)(pA,{campaigns:[],categories:t.event?.positionsCategories??[],customDocuments:[],customFields:t.organization?.customFields.nodes??[],forms:[],isLoading:n,mutate:e.mutate,properties:s,selecteds:e.selecteds,tags:t.organization?.tags.nodes??[],traces:t.event?.traces??[],onClose:e.onClose,onSuccess:e.onSuccess})},_A=e=>{const{data:t,isLoading:n}=Qn("query AccreditationsMassEditInfos($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n customFields(variety: Accreditation, sort: { attribute: Name, direction: Asc }) {\n nodes {\n ...MassEditCustomField\n }\n }\n\n tags {\n nodes {\n id\n name\n }\n }\n }\n\n event(id: $eventId) {\n accreditationsCategories {\n id\n name\n }\n }\n}\n",{organizationId:e.organizationId,eventId:e.eventId},[Vs.MassEditCustomFieldFragment]);const s=(0,L.useMemo)(()=>Xt.filter(e=>e!==se.Name),[]);return(0,i.jsx)(pA,{campaigns:[],categories:t.event?.accreditationsCategories??[],customDocuments:[],customFields:t.organization?.customFields.nodes??[],forms:[],isLoading:n,mutate:e.mutate,properties:s,selecteds:e.selecteds,tags:t.organization?.tags.nodes??[],traces:[],onClose:e.onClose,onSuccess:e.onSuccess})},xA=e=>{const{data:t,isLoading:n}=(s={organizationId:e.organizationId},Qn(fo,s,[]));var s;const o=(0,L.useMemo)(()=>on.filter(e=>e!==ve.Label&&e!==ve.Name),[]);return(0,i.jsx)(pA,{campaigns:[],categories:t.organization?.customFieldsCategories.nodes??[],customDocuments:[],customFields:[],forms:[],isLoading:n,mutate:e.mutate,properties:o,selecteds:e.selecteds,tags:[],traces:[],onClose:e.onClose,onSuccess:e.onSuccess})},IA=e=>{const{data:t,isLoading:n}=(s={organizationId:e.organizationId,eventId:e.eventId,level:e.eventId?ot.Event:ot.Organization},Qn(_o,s,[Vs.MassEditCustomFieldFragment]));var s;const o=(0,L.useMemo)(()=>an.filter(e=>e!==Ce.Name&&e!==Ce.Columns),[]);return(0,i.jsx)(pA,{campaigns:t.organization?.campaigns.nodes??[],categories:t.organization?.delegationsCategories.nodes??[],customDocuments:t.organization?.event?.customDocuments??[],customFields:t.organization?.customFields.nodes??[],forms:t.organization?.forms.nodes??[],isLoading:n,mutate:e.mutate,properties:o,selecteds:e.selecteds,tags:t.organization?.tags.nodes??[],traces:[],onClose:e.onClose,onSuccess:e.onSuccess})},vA=e=>{const{data:t,isLoading:n}=Qn("query UsersInfosMassEditInfos($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n customFields(variety: UserInfo, sort: { attribute: Name, direction: Asc }) {\n nodes {\n ...MassEditCustomField\n }\n }\n }\n}\n",{organizationId:e.organizationId},[Vs.MassEditCustomFieldFragment]);return(0,i.jsx)(pA,{campaigns:[],categories:[],customDocuments:[],customFields:t.organization?.customFields.nodes??[],forms:[],isLoading:n,mutate:e.mutate,properties:[],selecteds:e.selecteds,tags:[],traces:[],onClose:e.onClose,onSuccess:e.onSuccess})},bA=e=>(0,i.jsx)(pA,{campaigns:[],categories:[],customDocuments:[],customFields:e.customFields,forms:[],isLoading:!1,mutate:e.mutate,properties:[],selecteds:e.selecteds,tags:[],traces:[],onClose:e.onClose,onSuccess:e.onSuccess});let jA=class extends Gl{translationService;constructor(e){super(e),this.translationService=e}massAccreditStep1Schema(){return d.Ik().shape({massAccredit:d.Ik().shape({...this.massAccreditStep1Fields()})})}massAccreditStep2Schema(){return d.Ik().shape({massAccredit:d.Ik().shape({...this.massAccreditStep2Fields()})})}massAccreditSchema(){return d.Ik().shape({...this.massAccreditStep1Fields(),...this.massAccreditStep2Fields()})}massAccreditStep1Fields(){return{strategy:d.Yj().required(this.t("la_strat_gie_es_82287")).oneOf(Cn,this.t("la_strat_gie_es_82287"))}}massAccreditStep2Fields(){return{accreditationsSlotsIds:d.YO().of(d.ai()).required(this.t("vous_devez_s_le_72138")).min(1,this.t("vous_devez_s_le_72138"))}}};jA=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[qn])],jA);const CA=e=>(0,Kt.createPortal)((0,i.jsx)(Ar,{css:{background:"white",left:"0",position:"absolute",top:"0",zIndex:"50",...e.css},height:1,width:1,children:e.children}),document.body),yA=e=>{const t=Xn();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ar,{font:"gray900 textSm medium",children:t("que_souhaitez_v_87607")}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(ub,{name:"massAccredit.strategy",value:it.Add,children:t("ajouter_des_acc_17744")}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(ub,{name:"massAccredit.strategy",value:it.Replace,children:t("remplacer_les_a_92733")}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(ub,{name:"massAccredit.strategy",value:it.Delete,children:t("supprimer_des_a_04246")}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(Ba,{children:(0,i.jsx)(zl,{onClick:e.handleSubmit,children:t("suivant_accr_25709")})})]})};var kA=n(9120);const AA=e=>(0,uc.A)(e,e=>e.toMillis()),wA=_r("div",{alignItems:"center",borderRadius:"$2",color:"$gray400",display:"flex",fontWeight:"$medium",height:"32px",justifyContent:"center",userSelect:"none",width:"32px",variants:{isSelectable:{true:{color:"$gray800",cursor:"pointer","&:hover":{background:"$primary500",color:"white"}}},isSelected:{true:{background:"$primary500",color:"white",cursor:"pointer"}}},compoundVariants:[{isSelectable:!0,isSelected:!0,css:{background:"$primary500",color:"white",cursor:"pointer"}}]}),SA=({disabledDates:e,firstDayOfMonth:t,max:n,min:s,onChange:o,startHour:r,values:a})=>{const l=Xn(),d=Zn(Jc),c=(0,L.useMemo)(()=>t.minus({day:t.weekday-1}),[t]),u=(0,L.useMemo)(()=>t.endOf("month"),[t]),h=(0,L.useMemo)(()=>{const e=u.plus({day:7-u.weekday});return Math.ceil(e.diff(c,"days").days)},[u]),m=(0,L.useMemo)(()=>(0,Dc.A)(0,h).map(i=>{const o=c.plus({day:i}).set({hour:r||0}),l=o.toMillis(),d=a.some(e=>e.toMillis()===l),u=!!so(e)&&e.some(e=>e.toMillis()===l);return{day:o,isSelected:d,isDisabled:u,isSelectable:!u&&o.month===t.month&&o>=s&&o<=n}}),[c,h,a,e,r]),g=(0,L.useMemo)(()=>!m.some(({isSelectable:e,isSelected:t})=>e&&!t),[m]),p=(0,L.useCallback)(()=>{o(g?[]:m.flatMap(({day:e,isSelectable:t,isSelected:n})=>t||n?[e]:[]))},[m,g,o]);return(0,i.jsxs)(Ba,{css:{background:"white",bd:!0,padding:"$5 $4"},direction:"column",children:[(0,i.jsx)(Ar,{css:{textTransform:"capitalize"},font:"gray800 textXl semiBold",textAlign:"center",width:1,children:d.toLocaleString(t,{month:"long",year:"numeric"})}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(hd,{gap:"2",gridtemplatecolumns:"repeat(7, 32px)",gridtemplaterows:"auto",children:(0,Dc.A)(0,7).map(e=>{const t=c.plus({day:e});return(0,i.jsx)(Ar,{css:{textTransform:"capitalize"},font:"gray500 textXs medium",width:32,children:d.toLocaleString(t,{weekday:"short"})},e)})}),(0,i.jsx)(Ya,{height:"5"}),(0,i.jsx)(hd,{gap:"2",gridtemplatecolumns:"repeat(7, 32px)",gridtemplaterows:"auto",children:m.map(({day:e,isSelected:t,isSelectable:n},s)=>(0,i.jsx)(wA,{isSelectable:n,isSelected:t,onClick:i=>{if(n&&t)o(AA((0,kA.A)(a,[e],e=>e.toMillis())));else if(n&&!t){const t=a.findLast(t=>tt.plus({day:e+1}));o(AA([...a,...i]))}else o(AA([...a,e]))}},children:e.day},s))}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(zl,{color:"white",textAlign:"center",onClick:p,children:l(g?"tout_d_s_lectio_37372":"tout_s_lectionn_48027")})]})},EA=e=>{const{minDate:t,maxDate:n,numberOfMonths:s,totalDaysDiff:o}=(0,L.useMemo)(()=>Fh(e.slots),[e.slots]),r=(0,L.useMemo)(()=>e.slots.flatMap(t=>t.date?.isValid&&e.accreditationsSlotsIds.includes(t.id)?[t.date]:[]),[e.slots,e.accreditationsSlotsIds]),a=(0,L.useMemo)(()=>(0,Dc.A)(0,o).flatMap(n=>{const i=t.plus({day:n});return e.slots.some(e=>e.date?.isValid&&e.date.toMillis()===i.toMillis())?[]:[i]}),[t,o,e.slots]);return(0,i.jsx)(Ba,{gap:"4",wrap:"wrap",children:(0,Dc.A)(0,s).map(o=>{const l=t.plus({month:o}).startOf("month"),d=0===o?t:l,c=o===s-1?n:l.endOf("month"),u=r.filter(e=>e.startOf("month").equals(l));return(0,i.jsx)(SA,{disabledDates:a,firstDayOfMonth:l,max:c,min:d,values:u,onChange:t=>{e.change(`${e.prefix}accreditationsSlotsIds`,Mh(e.accreditationsSlotsIds,e.slots,l,t))}},o)})})},TA=e=>{const{translate:t}=vl(),n=(0,L.useMemo)(()=>e.slots.filter(e=>e.date?.isValid),[e.slots]);return so(n)?(0,i.jsx)(EA,{...e,slots:n}):(0,i.jsx)(Gk,{imageSrc:_d.WeezeventBlankPerson,subtitle:t("this_may_be_bec_43194"),title:t("no_items_are_cu_47996")})},zA=e=>{const{translate:t}=vl(),n=Zn(Vv),s=(0,L.useMemo)(()=>TC(e.accreditation),[e.accreditation]),o=e.accreditationsSlotsIds.includes(e.slot.id)?"checked":"unchecked";return(0,i.jsxs)(Ba,{align:"center",css:{background:"white",bd:!0,cursor:"pointer",px:"$4",userSelect:"none"},gap:"2",height:64,onClick:()=>{e.onClick(e.slot.id,"unchecked"===o)},children:[(0,i.jsx)(fc,{shouldPreventDefault:!1,state:o,onClick:td.A}),(0,i.jsx)(WC,{color:e.accreditation.color,icon:e.accreditation.icon}),(0,i.jsx)(Ar,{css:{flex:"1"},font:"gray800 textSm semiBold",children:s}),(0,i.jsx)(Ba,{css:{px:"$3"},width:310,children:(0,i.jsx)(rc,{color:e.slot.assignedResources>=(e.slot.maxResources||1/0)?"success":"warning",leftIcon:"user-group",children:t("_1_2_membres_04485",e.slot.assignedResources,n.toNumberOrInfinity(e.slot.maxResources))})})]})},OA=e=>{const t=Xn(),n=Zn(Jc),s=Zn(Vv),o=e.accreditationsSlotsIds.includes(e.slot.id)?"checked":"unchecked";return(0,i.jsxs)(Mc,{css:{cursor:"pointer"},onClick:()=>{e.onClick(e.slot.id,"unchecked"===o)},children:[(0,i.jsx)(Oc,{justify:"center",width:48,children:e.shouldDisplayList?(0,i.jsx)(fc,{shouldPreventDefault:!1,state:o,onClick:td.A}):(0,i.jsx)(Ic,{shouldPreventDefault:!1,state:o,onClick:td.A})}),(0,i.jsx)(Oc,{children:m(e.slot.name)?e.slot.name:"-"}),(0,i.jsx)(Oc,{children:e.slot.date?.isValid?n.toLocaleString(e.slot.date,eo.DateOnly.WeekdayLongMonthLong):"-"}),(0,i.jsx)(Oc,{children:(0,i.jsx)(rc,{color:e.slot.assignedResources>=(e.slot.maxResources||1/0)?"success":"warning",leftIcon:"user-group",children:t("_1_2_membres_04485",e.slot.assignedResources,s.toNumberOrInfinity(e.slot.maxResources))})})]})},RA=e=>{const t=Xn(),n=(0,L.useMemo)(()=>(0,uc.A)(e.slots.filter(t=>t.accreditation.id===e.accreditation.id),e=>(0,Za.A)([e.date?.toMillis(),e.name.toLowerCase()])),[e.slots,e.accreditation]),s=(0,L.useMemo)(()=>n.map(e=>e.id),[n]),o=(0,L.useMemo)(()=>{const t=(0,fh.A)(e.accreditationsSlotsIds,s);return t.length===s.length?"checked":0===t.length?"unchecked":"indeterminate"},[s,e.accreditationsSlotsIds]),r=(0,L.useCallback)((t,n)=>{if(e.accreditation.accreditationDisplay===ie.Radio){const i=(0,mc.A)(e.accreditationsSlotsIds,s).concat(n?[t]:[]);e.change("massAccredit.accreditationsSlotsIds",i)}else e.change("massAccredit.accreditationsSlotsIds",ro(e.accreditationsSlotsIds,t,n))},[e.accreditation,e.accreditationsSlotsIds,e.change,s]),a=e.accreditation.accreditationDisplay===ie.List||e.strategy===it.Delete;return e.accreditation.hasSlots?(0,i.jsx)(GC,{accreditation:e.accreditation,displayNumberOfSlots:!0,displaySlots:!0,numberOfSlots:n.length,children:e.accreditation.accreditationDisplay===ie.Calendar?(0,i.jsx)(Ba,{css:{background:"$gray50",padding:"$4"},children:(0,i.jsx)(TA,{accreditationsSlotsIds:e.accreditationsSlotsIds,change:e.change,prefix:"massAccredit.",slots:n})}):(0,i.jsxs)(Sc,{hideBorder:!0,children:[(0,i.jsxs)(kc,{children:[(0,i.jsx)(Gc,{justify:"center",width:48,children:a&&(0,i.jsx)(fc,{state:o,onClick:t=>{"checked"===t?e.change("massAccredit.accreditationsSlotsIds",(0,Bs.A)(e.accreditationsSlotsIds.concat(s))):e.change("massAccredit.accreditationsSlotsIds",(0,mc.A)(e.accreditationsSlotsIds,s))}})}),(0,i.jsx)(Gc,{children:t("nom_du_cr_neau_54351")}),(0,i.jsx)(Gc,{children:t("date_du_cr_neau_82295")}),(0,i.jsx)(Gc,{})]}),n.map(t=>(0,i.jsx)(OA,{accreditationsSlotsIds:e.accreditationsSlotsIds,shouldDisplayList:a,slot:t,onClick:r},t.id))]})}):(0,i.jsx)(zA,{accreditation:e.accreditation,accreditationsSlotsIds:e.accreditationsSlotsIds,slot:n[0],onClick:r})},$A=e=>{const t=(0,L.useMemo)(()=>(0,uc.A)(e.accreditations.filter(t=>t.accreditationCategoryId===e.category.id),e=>e.name.toLowerCase()),[]);return(0,i.jsx)(VC,{category:e.category,children:t.map(t=>(0,i.jsx)(RA,{accreditation:t,accreditationsSlotsIds:e.accreditationsSlotsIds,change:e.change,slots:e.slots,strategy:e.strategy},t.id))})},DA=e=>{const t=Xn(),[n,s]=(0,L.useState)(!1),[o,r]=(0,L.useState)(e.excludeEmpty?"checked":"unchecked"),[a,l]=(0,L.useState)(e.excludeFull?"checked":"unchecked"),[d,c]=(0,L.useState)(e.excludePast?"checked":"unchecked"),u=(e.excludeEmpty?1:0)+(e.excludeFull?1:0)+(e.excludePast?1:0);return(0,i.jsxs)(Ba,{css:{background:"$gray100",borderRadius:"$2",padding:"$4"},gap:"3",children:[(0,i.jsx)(Ar,{css:{flex:"1"},children:(0,i.jsx)(Bl,{icon:"magnifying-glass",placeholder:t("rechercher_une_65646"),value:e.name,onChange:t=>{e.setName(t)}})}),(0,i.jsxs)(EC,{apply:()=>{e.setExcludeEmpty("checked"===o),e.setExcludeFull("checked"===a),e.setExcludePast("checked"===d),s(!1)},color:"white",isOpen:n,numberOfAppliedFilters:u,reinit:()=>{e.setExcludeEmpty(!1),r("unchecked"),e.setExcludeFull(!1),l("unchecked"),e.setExcludePast(!1),c("unchecked"),e.setName(""),s(!1)},showButtons:!0,onStateChange:s,children:[(0,i.jsx)(_c,{state:o,onClick:r,children:t("cacher_les_cr_n_76382")}),(0,i.jsx)(_c,{state:a,onClick:l,children:t("cacher_les_cr_n_31908")}),(0,i.jsx)(_c,{state:d,onClick:c,children:t("masquer_les_cr_05336")})]})]})},PA=e=>{const t=Xn(),[n,s,o]=Wc(""),[r,a]=(0,L.useState)(!1),[l,d]=(0,L.useState)(!1),[c,u]=(0,L.useState)(!1),{data:h,loader:g}=Qn("query MassAccreditSlots(\n $eventId: EventId!\n $delegationId: DelegationId\n $accreditationName: String\n $excludeFull: Boolean\n $excludeEmpty: Boolean\n $excludePast: Boolean\n) {\n event(id: $eventId) {\n accreditationsSlots(\n delegationId: $delegationId\n accreditationName: $accreditationName\n includeHidden: true\n excludeFull: $excludeFull\n excludeEmpty: $excludeEmpty\n excludePast: $excludePast\n ) {\n nodes {\n id\n name\n assignedResources\n maxResources\n date\n isBlocked\n isFull\n\n accreditation {\n id\n accreditationCategoryId\n name\n accreditationDisplay\n hasSlots\n color\n icon\n }\n\n accreditationCategory {\n id\n name\n }\n }\n }\n }\n}\n",{eventId:e.eventId,delegationId:e.delegationId,accreditationName:m(s)?s:void 0,excludeEmpty:r,excludeFull:l,excludePast:c},[]);const p=(0,L.useMemo)(()=>(h.event?.accreditationsSlots.nodes??[]).filter(e=>!e.isBlocked),[h.event]),f=(0,L.useMemo)(()=>(0,uc.A)((0,xh.A)(p.map(e=>e.accreditationCategory),e=>e.id),e=>e.name.toLowerCase()),[p]),_=(0,L.useMemo)(()=>(0,xh.A)(p.map(e=>e.accreditation),e=>e.id),[p]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(DA,{excludeEmpty:r,excludeFull:l,excludePast:c,name:n,setExcludeEmpty:a,setExcludeFull:d,setExcludePast:u,setName:o}),(0,i.jsx)(Ya,{height:"6"}),g||(0,i.jsx)(BC,{css:{border:"1px solid $gray100",borderRadius:"$1"},children:f.map(t=>(0,i.jsx)($A,{accreditations:_,accreditationsSlotsIds:e.values.massAccredit.accreditationsSlotsIds,category:t,change:e.change,slots:p,strategy:e.values.massAccredit.strategy},t.id))}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(Ba,{children:(0,i.jsx)(zl,{isLoading:e.submitting,onClick:e.handleSubmit,children:m(e.buttonText)?e.buttonText:t(e.values.massAccredit.strategy===it.Add?"accr_diter_les_78545":e.values.massAccredit.strategy===it.Replace?"r_accr_diter_le_34059":"d_saccr_diter_l_28590",e.numberOfSelected)})})]})},FA=({eventId:e,numberOfSelected:t,onClose:n,onSuccess:s,selecteds:o})=>{const r=Xn(),a=Zn(jA),{mutate:l}=yo();return(0,i.jsx)(CA,{children:(0,i.jsx)(Lm,{category:r("Accreditation"),heading:r("accr_diter_les_48281"),onClose:n,children:(0,i.jsx)(Mm,{children:(0,i.jsxs)(vb,{initialValues:{massAccredit:{selecteds:o,strategy:it.Add,accreditationsSlotsIds:[]}},isEdit:!1,onSubmit:async t=>{const i=(await l({eventId:e,massAccredit:t.massAccredit})).numberOfMembers;s(r("_1_membres_ont_05068",i)),n()},children:[(0,i.jsx)(Ib,{heading:r("initialisation_38640"),render:({handleSubmit:e})=>(0,i.jsx)(yA,{handleSubmit:e}),schema:a.massAccreditStep1Schema()}),(0,i.jsx)(Ib,{heading:r("accr_ditations_39450"),render:({form:n,handleSubmit:s,submitting:o,values:r})=>(0,i.jsx)(PA,{change:n.change,delegationId:null,eventId:e,handleSubmit:s,numberOfSelected:t,submitting:o,values:r}),schema:a.massAccreditStep2Schema()})]})})})})},MA=e=>{const{history:t,translate:n}=vl(),{mutate:s,isLoading:r}=lr(),[a,l]=(0,L.useState)([]),d=so(a);return(0,i.jsxs)(au,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Ba,{justify:"center",children:(0,i.jsx)(sC,{color:"primary",icon:"people-group"})}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(Ar,{font:"gray900 textLg medium",textAlign:"center",children:n("SendCampaign")}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(yc,{isSearchVisible:!0,label:n("campagne_97871"),values:a,onChange:l,children:e.campaigns.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),e.canCreate&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(zl,{color:"invisible",leftIcon:"plus",onClick:()=>{const n=o(JSON.stringify({usersInfosIds:e.selecteds.ids}));t.push($I.CREATE({organizationId:e.organizationId,eventId:e.eventId||void 0,options:n}))},children:n("cr_er_une_nouve_86635")})]}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsxs)(Ba,{gap:"3",justify:"end",children:[(0,i.jsx)(zl,{disabled:!d,isLoading:r,onClick:async()=>{if(so(a)){const t=e.campaigns.find(e=>e.id===a[0]),i=(await s({organizationId:e.organizationId,eventId:e.eventId,delegationId:e.delegationId,selecteds:e.selecteds,campaignId:a[0]})).numberOfMembers;e.onSuccess(n("la_campagne_1_62015",t.name,i)),e.onClose()}},children:n("envoyer_26609")}),(0,i.jsx)(zl,{color:"white",onClick:e.onClose,children:n("annuler_48254")})]})]})},NA=e=>{const{data:t}=Qn("query MassCampaignSendCampaigns(\n $organizationId: OrganizationId!\n $level: OrganizationEventLevel!\n $eventId: EventId\n) {\n organization(id: $organizationId) {\n campaigns(level: $level, eventId: $eventId) {\n nodes {\n id\n name\n }\n }\n }\n}\n",{organizationId:e.organizationId,level:e.eventId?ot.Event:ot.Organization,eventId:e.eventId},[]);return(0,i.jsx)(MA,{campaigns:t.organization?.campaigns.nodes??[],canCreate:!0,delegationId:null,eventId:e.eventId,organizationId:e.organizationId,selecteds:e.selecteds,onClose:e.onClose,onSuccess:e.onSuccess})},LA=e=>{const{translate:t}=vl(),n=Zn(jA),{mutate:s}=dr();return(0,i.jsx)(CA,{children:(0,i.jsx)(Lm,{category:t("Accreditation"),heading:t("update_desired_accreditations"),onClose:e.onClose,children:(0,i.jsx)(Mm,{css:{py:"$7"},children:(0,i.jsxs)(vb,{initialValues:{massAccredit:{selecteds:e.selecteds,strategy:it.Add,accreditationsSlotsIds:[]}},isEdit:!1,onSubmit:async t=>{await s({organizationId:e.organizationId,eventId:e.eventId,delegationId:e.delegationId,massAccredit:t.massAccredit}),e.onSuccess(),e.onClose()},children:[(0,i.jsx)(Ib,{heading:t("initialisation_38640"),render:({handleSubmit:e})=>(0,i.jsx)(yA,{handleSubmit:e}),schema:n.massAccreditStep1Schema()}),(0,i.jsx)(Ib,{heading:t("accr_ditations_39450"),render:({form:n,handleSubmit:s,values:o,submitting:r})=>(0,i.jsx)(PA,{buttonText:o.massAccredit.strategy===it.Delete?t("supprimer_les_a_93519"):t("update_desired_accreditations"),change:n.change,delegationId:e.delegationId,eventId:e.eventId,handleSubmit:s,numberOfSelected:e.numberOfSelected,submitting:r,values:o}),schema:n.massAccreditStep2Schema()})]})})})})},BA=e=>{const{translate:t,params:{organizationId:n,eventId:s,delegationId:o}}=vl(),{mutate:r}=Po(),{mutate:a}=Xo(),{mutate:l}=No(),[d,c]=(0,L.useState)(!1),[u,h]=(0,L.useState)(!1),[m,g]=(0,L.useState)(!1),[p,f]=(0,L.useState)(!1),[_,x]=(0,L.useState)(!1),I=e.massActions.getSelectedsInput(null,null),v=e.showAccreditationsValidate||so(e.campaigns)||e.showDelete;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zl,{color:"invisible-gray",leftIcon:"pen",onClick:()=>{c(!0)},children:t("_diter_un_champ_64621")}),e.showWishedAccreditationsEdit&&(0,i.jsx)(zl,{color:"invisible-gray",leftIcon:"wand-magic-sparkles",onClick:()=>{h(!0)},children:t("_diter_les_accr_41957")}),e.showAccreditationsEdit&&(0,i.jsx)(zl,{color:"invisible-gray",leftIcon:"wand-magic-sparkles",onClick:()=>{g(!0)},children:t("_diter_les_accr_86042")}),v&&(0,i.jsxs)(Wd,{children:[(0,i.jsx)(Xd,{children:(0,i.jsx)(zl,{color:"invisible-gray",rightIcon:"chevron-down",children:t("plus_77692")})}),(0,i.jsxs)(Zd,{placement:"bottom-end",children:[e.showAccreditationsValidate&&(0,i.jsx)(Kd,{icon:"check",onClick:async()=>{await a({eventId:s,delegationId:o,usersInfosIds:I.ids}),e.onMassEditSuccess()},children:t("valider_les_acc_80801")}),so(e.campaigns)&&(0,i.jsx)(Kd,{icon:"paper-plane",onClick:()=>{f(!0)},children:t("SendCampaign")}),e.showDelete&&(0,i.jsx)(Kd,{color:"red",icon:"user-xmark",onClick:()=>x(!0),children:t("retirer_de_la_d_64963")})]})]}),d&&(0,i.jsx)(bA,{customFields:e.customFields,mutate:e=>r({organizationId:n,eventId:s,delegationId:o,massEdit:e}),selecteds:I,onClose:()=>{c(!1)},onSuccess:e.onMassEditSuccess}),u&&(0,i.jsx)(LA,{delegationId:o,eventId:s,numberOfSelected:e.massActions.numberOfSelected,organizationId:n,selecteds:I,onClose:()=>{h(!1)},onSuccess:e.onMassEditSuccess}),m&&(0,i.jsx)(FA,{eventId:s,numberOfSelected:e.massActions.numberOfSelected,selecteds:I,onClose:()=>{g(!1)},onSuccess:e.onMassEditSuccess}),p&&(0,i.jsx)(MA,{campaigns:e.campaigns,canCreate:!1,delegationId:o,eventId:s,organizationId:n,selecteds:I,onClose:()=>{f(!1)},onSuccess:e.onMassEditSuccess}),_&&(0,i.jsx)(cA,{buttonText:t("supprimer_43083"),subtext:t("_tes_vous_sur_d_29974"),text:t("suppression_de_57689",I.ids?.length??0),onClose:()=>x(!1),onDelete:async()=>{await l({organizationId:n,eventId:s,delegationId:o,selecteds:I,deleteFromEvent:e.deleteFromEvent}),e.onMassEditSuccess()}})]})};function VA(e){return(0,uc.A)((0,xh.A)(e,e=>e.accreditation.id).map(t=>({...t.accreditation,accreditationCategory:t.accreditationCategory,slots:Nh(e.filter(e=>e.accreditation.id===t.accreditation.id))})),e=>[e.accreditationCategory.name.toLowerCase(),$C(e.index),e.name.toLowerCase()])}function UA(e,t){return e.flatMap(e=>{const n=e.slots.map(e=>e.id),i=oo(t)?e.slots.length:(0,fh.A)(n,t).length;return 0===i?[]:[{...e,numberOfSlots:i}]})}function WA(e,t){return e.flatMap(e=>e.slots.filter(e=>oo(t)||t.includes(e.id)))}const GA=e=>{const{translate:t}=vl(),n=L.useRef(null),s=Zn(Jc);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ba,{ref:n,css:{background:"white",border:"1px solid $gray200"},children:[(0,i.jsxs)(Ba,{css:{width:"calc(2 * $cellWidth)"},direction:"column",children:[(0,i.jsx)(Ba,{align:"center",css:{borderBottom:"1px solid $gray200",borderRight:"1px solid $gray200",height:"$cellHeightSm",px:"$4"},width:1,children:(0,i.jsx)(yc,{isSearchVisible:!0,isSelectAllVisible:!0,menuWidth:300,multiple:!0,triggerElem:(0,i.jsxs)(zl,{color:"white",leftIcon:"bars-filter",size:"sm",children:[t("accr_ditations_39450"),so(e.selectedSlotsIds)&&` (${e.selectedSlotsIds.length})`]}),values:e.selectedSlotsIds,onChange:e.setSelectedSlotsIds,children:e.allAccreditations.map(e=>(0,i.jsx)("optgroup",{label:e.name,children:e.slots.map(t=>(0,i.jsx)("option",{value:t.id,children:Dh(s,t,e.name,{accreditation:{includeNameAtEnd:!0}})},t.id))},e.id))})}),(0,i.jsx)(Ba,{css:{borderRight:"1px solid $gray200",height:"$cellHeightSm"},width:1,onClick:()=>{n.current?.requestFullscreen()}}),e.data.map(t=>e.renderLeftColumn(t))]}),(0,i.jsx)(Ba,{css:{flex:"1",overflowX:"auto"},children:(0,i.jsxs)(Ba,{direction:"column",children:[(0,i.jsx)(Ba,{css:{borderBottom:"1px solid $gray200",height:"$cellHeightSm"},children:e.filteredAccreditations.map(t=>{const n=m(t.acronym)?t.acronym:t.name;return(0,i.jsxs)(Ba,{align:"center",css:{borderRight:"1px solid $gray200",px:"$4",width:`calc(${t.numberOfSlots} * ${e.cellWidth}px)`},direction:"column",height:1,justify:"center",children:[(0,i.jsx)(Ar,{css:{ellipsis:!0},font:"gray800 textSm medium",textAlign:"center",title:n,width:1,children:n}),(0,i.jsx)(Ar,{color:"gray500",css:{ellipsis:!0},textAlign:"center",title:t.accreditationCategory.name,width:1,children:t.accreditationCategory.name})]},t.id)})}),(0,i.jsx)(Ba,{css:{height:"$cellHeightSm"},children:e.slots.map(t=>{const n=t.date?.isValid?s.toLocaleString(t.date,eo.DateOnly.Numeric):"-";return(0,i.jsxs)(Ba,{align:"center",css:{borderRight:"1px solid $gray200",px:"$4",width:`${e.cellWidth}px`},direction:"column",height:1,justify:"center",children:[(0,i.jsx)(Ar,{css:{ellipsis:!0},font:"gray800 textSm medium",textAlign:"center",title:t.name||"-",width:1,children:t.name||"-"}),(0,i.jsx)(Ar,{color:"gray500",css:{ellipsis:!0},textAlign:"center",title:n,width:1,children:n})]},t.id)})}),e.data.map(t=>e.renderRow(t))]})})]}),(0,i.jsx)(Nc,{children:(0,i.jsx)(Fc,{limit:e.limit,numberOfPages:e.numberOfPages,offset:e.offset,setLimit:e.setLimit,setOffset:e.setOffset,showLimits:!0,totalCount:e.totalCount})})]})},HA=e=>{const{translate:t}=vl(),n=(0,L.useMemo)(()=>(e.vr.matrixAuis||[]).flatMap(e=>e.isAutoAccredit?[e.accreditationSlotId]:[]),[e.vr]),s=(0,L.useMemo)(()=>(e.vr.matrixAuis||[]).flatMap(e=>e.isAutoAccredit?[]:[e.accreditationSlotId]),[e.vr]),o=(0,L.useMemo)(()=>(e.vr.matrixWishedSlots||[]).map(e=>e.id),[e.vr]);return(0,i.jsx)(Ba,{css:{borderTop:"1px solid $gray200",height:"$cellHeightSm"},children:e.slotsIds.map(r=>{const a=n.includes(r),l=s.includes(r),d=o.includes(r),c=e.isEditMode&&("assigned"===e.editMode&&(a||l)||"wished"===e.editMode&&d),u=e.isEditMode&&("assigned"===e.editMode&&!a&&!l||"wished"===e.editMode&&!d);return(0,i.jsxs)(Ba,{align:"center",css:{borderRight:"1px solid $gray200",padding:"$3 $4",width:"$cellWidth","& > .h-accreditations-matrix-cell":{display:"flex"},"&:hover > .h-accreditations-matrix-cell":{display:"none"},"& > .h-accreditations-matrix-edit-cell":{display:"none"},"&:hover > .h-accreditations-matrix-edit-cell":{display:"flex"}},height:1,children:[c&&(0,i.jsx)(Ba,{align:"center",className:"h-accreditations-matrix-edit-cell",css:{background:"$error200",bd:"error500 1",color:"$error700",cursor:"pointer"},height:1,justify:"center",width:1,onClick:async()=>{await e.deleteAccreditationSlot(e.vr.userInfo.id,r),e.reloadRow(e.vr.id)},children:(0,i.jsx)(nl,{icon:"trash-can"})}),u&&(0,i.jsx)(Ba,{align:"center",className:"h-accreditations-matrix-edit-cell",css:{background:"$primary100",bd:"primary500 1",color:"$primary500",cursor:"pointer"},height:1,justify:"center",width:1,onClick:async()=>{await e.addAccreditationSlot(e.vr.userInfo.id,r),e.reloadRow(e.vr.id)},children:(0,i.jsx)(nl,{icon:"plus"})}),a||l?(0,i.jsx)(Ba,{align:"center",className:e.isEditMode?"h-accreditations-matrix-cell":"",css:{background:"$success200",bd:"success500 1",color:"$success700",fontSize:"$textMd"},height:1,justify:"center",width:1,children:(0,i.jsx)(nl,{icon:n.includes(r)?"bolt-auto":"check"})}):d?(0,i.jsx)(Ba,{align:"center",className:e.isEditMode?"h-accreditations-matrix-cell":"",css:{background:"white",bd:"gray300 1",borderStyle:"dashed"},height:1,justify:"center",width:1,children:(0,i.jsx)(Ar,{font:"gray800 textXs medium",children:t("souhait_e_52100")})}):null]},r)})})},qA=e=>{const{translate:t}=vl(),n=(0,L.useMemo)(()=>VA(e.allAccreditationsSlots),[e.allAccreditationsSlots]),s=(0,L.useMemo)(()=>UA(n,e.selectedSlotsIds),[n,e.selectedSlotsIds]),o=(0,L.useMemo)(()=>WA(s,e.selectedSlotsIds),[s,e.selectedSlotsIds]),r=(0,L.useMemo)(()=>o.map(e=>e.id),[o]),a=(0,L.useCallback)(e=>(0,i.jsx)(Ba,{css:{borderRight:"1px solid $gray200",borderTop:"1px solid $gray200",height:"$cellHeightSm",px:"$4"},width:1,children:(0,i.jsx)(xj,{size:32,userInfo:e.userInfo})},e.userInfo.id),[]),l=(0,L.useCallback)(t=>e.isRowLoading(t.id)?(0,i.jsx)(Hc,{css:{border:"none",borderTop:"1px solid $gray200",height:"$cellHeightSm"}},t.userInfo.id):(0,i.jsx)(HA,{addAccreditationSlot:e.addAccreditationSlot,deleteAccreditationSlot:e.deleteAccreditationSlot,editMode:e.editMode,isEditMode:e.isEditMode,reloadRow:e.reloadRow,slotsIds:r,vr:t},t.userInfo.id),[e.addAccreditationSlot,e.deleteAccreditationSlot,e.editMode,e.isEditMode,e.isRowLoading,e.reloadRow,r]);return(0,i.jsx)(Ba,{direction:"column",width:1,children:e.isLoading?(0,i.jsx)(wl,{}):oo(e.members)||oo(s)?(0,i.jsx)(Ba,{css:{background:"white",border:"1px solid $gray200"},height:400,children:oo(e.members)?(0,i.jsx)(Gk,{imageSrc:fd.Blanks.Member,title:t("aucun_membre_ne_07054")}):(0,i.jsx)(Gk,{imageSrc:fd.Blanks.Accreditation,title:t("aucune_accr_dit_97505")})}):(0,i.jsx)(GA,{allAccreditations:n,cellWidth:120,data:e.members,filteredAccreditations:s,limit:e.limit,numberOfPages:e.numberOfPages,offset:e.offset,renderLeftColumn:a,renderRow:l,selectedSlotsIds:e.selectedSlotsIds,setLimit:e.setLimit,setOffset:e.setOffset,setSelectedSlotsIds:e.setSelectedSlotsIds,slots:o,totalCount:e.totalCount})})},KA=e=>{const{params:{organizationId:t,eventId:n,delegationId:s}}=vl(),{data:o,idToLoading:r,isEditMode:a,isLoading:l,limit:d,numberOfPages:c,offset:u,reloadRow:h,setLimit:m,setOffset:g,totalCount:p}=cm(),{mutate:f}=dr(),{data:_,isLoading:x}=Qn("query DelegationMembersAccreditationsMatrix($eventId: EventId!, $delegationId: DelegationId!) {\n event(id: $eventId) {\n delegation(id: $delegationId) {\n accreditationsSlots(onlyVisible: true) {\n accreditationSlot {\n ...AccreditationSlotMatrix\n }\n }\n }\n }\n}\n",{eventId:n,delegationId:s},[Vs.AccreditationSlotMatrixFragment]),I=(0,L.useMemo)(()=>(_.event?.delegation.accreditationsSlots??[]).map(e=>e.accreditationSlot),[_]),v=(0,L.useCallback)(e=>r[e]??!1,[r]),b=(0,L.useCallback)((e,i)=>f({organizationId:t,eventId:n,delegationId:s,massAccredit:{accreditationsSlotsIds:[i],selecteds:{ids:[e]},strategy:it.Add}}),[t,n,s,f]),j=(0,L.useCallback)((e,i)=>f({organizationId:t,eventId:n,delegationId:s,massAccredit:{accreditationsSlotsIds:[i],selecteds:{ids:[e]},strategy:it.Delete}}),[t,n,s,f]);return(0,i.jsx)(qA,{addAccreditationSlot:b,allAccreditationsSlots:I,deleteAccreditationSlot:j,editMode:"wished",isEditMode:a,isLoading:l||x,isRowLoading:v,limit:d,members:o,numberOfPages:c,offset:u,reloadRow:h,selectedSlotsIds:e.selectedSlotsIds,setLimit:m,setOffset:g,setSelectedSlotsIds:e.setSelectedSlotsIds,totalCount:p})},YA=e=>{const{params:{organizationId:t,eventId:n,delegationId:s}}=vl(),o=Zn(Zh),r=si(),[a,l,d]=fy(t,"eventDelegationMembers.columns",e.columns),[c,u,h]=fy(t,"eventDelegationMembers.limit",Rc),[m,g,p]=fy(t,"eventDelegationMembers.predicates",[]),[f,_,x]=fy(t,"eventDelegationMembers.rendering",Gh.List),[I,v,b]=fy(t,"eventDelegationMembers.selectedSlotsIds",[]),[j,C,y]=fy(t,"eventDelegationMembers.sort",null),{data:k,isLoading:A}=Qn("query EventDelegationMembersInfos(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $delegationId: DelegationId!\n $privacy: CustomFieldPrivacy!\n) {\n organization(id: $organizationId) {\n weezeventOrganizationId\n\n customFields(variety: UserInfo, privacy: $privacy) {\n nodes {\n ...SegmentCustomField\n }\n }\n }\n\n event(id: $eventId) {\n startAt\n endAt\n isWeezeventConnected\n\n customDocuments {\n ...CustomDocumentPopulation\n }\n\n delegation(id: $delegationId) {\n numberOfDelegationsAccreditationsSlots\n\n accreditationsSlots(onlyDefault: true, onlyHidden: true) {\n accreditationSlotId\n }\n\n columnsCustomFields {\n ...SegmentCustomField\n }\n\n form {\n positionDisplay\n slotDisplay\n\n elements {\n customField {\n ...SegmentCustomField\n }\n }\n }\n }\n }\n}\n",{organizationId:t,eventId:n,delegationId:s,privacy:e.customFieldsPrivacy},[Vs.SegmentCustomFieldFragment,Vs.CustomDocumentPopulationFragment]);const w=d||h||p||x||b||y||A,S=(0,L.useMemo)(()=>e.customFieldsPrivacy===Ie.All?k.organization?.customFields.nodes??[]:(0,Za.A)((k.event?.delegation.form.elements.map(e=>e.customField)||[]).concat(k.event?.delegation.columnsCustomFields||[])),[e.customFieldsPrivacy,k.organization,k.event]),E=_y(S),T=(0,L.useMemo)(()=>k.event?o.getDelegationMembersFilters(t,n,S,k.event,k.event.delegation.form,k.event.isWeezeventConnected):[],[n,S,k.event]),z=(0,L.useMemo)(()=>k.event?o.getDelegationMembersPossibleColumns(S,{isWeezeventConnected:k.event.isWeezeventConnected,positionDisplay:k.event.delegation.form.positionDisplay,slotDisplay:k.event.delegation.form.slotDisplay}):[],[S,k.event]),O=(0,L.useMemo)(()=>(k.event?.delegation.accreditationsSlots??[]).map(e=>e.accreditationSlotId),[k.event]),R=(0,L.useMemo)(()=>"function"==typeof e.showEditMode?e.showEditMode(f):e.showEditMode,[e.showEditMode,f]),$=(k.event?.delegation.numberOfDelegationsAccreditationsSlots??0)>0;return(0,L.useEffect)(()=>{r.setItem(Ul.DELEGATIONS_SPACE_TAB,"members")},[]),w?(0,i.jsx)(wl,{}):(0,i.jsx)(_m,{columns:e.canEditColumns?a:e.columns,columnsSearch:[],columnsToIncludes:Yh,eventId:n,filters:T,getMassActionId:e=>e.userInfo.id,limit:c,loadDataList:ar,loadDataListParams:{delegationId:s,onlyVisibleAccreditationsSlots:e.onlyVisibleAccreditationsSlots,includeCanRegistrationStateUpdate:!1,includeIsEditable:!1},loadRow:or,loadRowParams:{delegationId:s,onlyVisibleAccreditationsSlots:e.onlyVisibleAccreditationsSlots,includeCanRegistrationStateUpdate:!1,includeIsEditable:!1},organizationId:t,possibleColumns:z,possibleRenderings:[Gh.List,Gh.AccreditationsMatrix],predicates:m,renderActions:(t,n,s)=>(0,i.jsx)(BA,{campaigns:e.campaigns,customFields:S,deleteFromEvent:e.deleteFromEvent,massActions:t,showAccreditationsEdit:e.showAccreditationsEdit,showAccreditationsValidate:e.showAccreditationsValidate,showDelete:e.canDeleteMembers,showWishedAccreditationsEdit:$,onMassEditSuccess:s}),rendering:f,setColumns:l,setLimit:u,setPredicates:g,setRendering:_,setSort:C,showEditColumns:f===Gh.List&&e.canEditColumns,showEditMode:R,showFilters:!0,showMassActions:e.canEditMembers,showRowDropdown:!0,showRowEdit:e.canEditMembers,showSearchColumns:!1,sort:j,children:f===Gh.AccreditationsMatrix?(0,i.jsx)(KA,{selectedSlotsIds:I,setSelectedSlotsIds:v}):(0,i.jsx)(Tm,{getEditPath:e.getEditPath,renderCell:(o,r,a)=>(0,i.jsx)(wk,{accreditationsPanelPath:hs.DELEGATION_MEMBER_ACCREDITATIONS({organizationId:t,eventId:n,delegationId:s,userInfoId:r.userInfo.id}),availabilitiesPanelPath:hs.DELEGATION_MEMBER_AVAILABILITIES({organizationId:t,eventId:n,delegationId:s,userInfoId:r.userInfo.id}),canAccredit:e.canAccredit,canAssign:!1,canChangeDelegation:!1,canClickMemberName:e.canClickMemberName,column:o,customField:E.get(o.slug),eventId:n,positionsPanelPath:hs.DELEGATION_MEMBER_POSITIONS({organizationId:t,eventId:n,delegationId:s,userInfoId:r.userInfo.id}),reloadRow:a,row:r}),renderRowDropdown:(t,n)=>(0,i.jsx)(uA,{accreditationState:t.accreditationState,allowedCustomDocuments:e.customBadges,canAccredit:e.canAccredit,canDelete:e.canDeleteMembers&&t.canDelete,customDocuments:k.event?.customDocuments??[],deleteFromEvent:e.deleteFromEvent,member:t.userInfo,reload:n,showDeleteFromEvent:e.showDeleteFromEvent,showDocumentsDownload:e.showDocumentsDownload,volunteerRegistrationId:t.id}),renderRowPanels:(o,r)=>(0,i.jsx)(lA,{accreditationsPanelPath:hs.DELEGATION_MEMBER_ACCREDITATIONS({organizationId:t,eventId:n,delegationId:s,userInfoId:o.userInfo.id}),availabilitiesPanelPath:hs.DELEGATION_MEMBER_AVAILABILITIES({organizationId:t,eventId:n,delegationId:s,userInfoId:o.userInfo.id}),canAccredit:e.canAccredit,canCheckIn:!1,canDeletePosition:()=>!1,canEditWishedAccreditations:!0,defaultHiddenAccreditationsSlotsIds:O,delegationId:s,eventId:n,organizationId:t,positionsPanelPath:hs.DELEGATION_MEMBER_POSITIONS({organizationId:t,eventId:n,delegationId:s,userInfoId:o.userInfo.id}),reloadRow:r,returnPathFallback:hs.DELEGATION_MEMBERS({organizationId:t,eventId:n,delegationId:s}),volunteerRegistration:o})})})};function ZA(e){return{includeDelegations:e.includes("delegations")||e.includes("delegations_categories"),includeEvents:e.includes("events")||e.includes("number_of_events"),includeForms:e.includes("forms")||e.includes("forms_inserted_at"),includeTags:e.includes("tags"),includeRoles:e.includes("roles")}}let XA=class extends _u{constructor(e,t,n){super(e,t,n)}getOrganizationUsersFilters(e,t,n){return[...this.getBaseFilters(n.customFields.nodes),...this.getEventsFilters(e),...this.getFormsFilters(e),...this.getPositionsFilters(),...this.getDelegationsFilters(e),...this.getEmailsFilters(e),...this.getCommentsFilters(),{slug:"tag",name:this.t("Tag"),category:this.t("autres_99130"),fieldType:He.Select,needLoading:!0,organizationId:e,tagContext:wt.UsersInfos},{slug:"sameEmail",name:this.t("nombre_de_profi_42316"),category:this.t("autres_99130"),fieldType:He.Number,hideEmpty:!0},{slug:"segments",name:this.t("fait_partie_de_44650"),category:this.t("autres_99130"),fieldType:He.Select,values:n.segmentsFolders.flatMap(e=>e.segments).filter(e=>e.id!==t),hideEmpty:!0},{slug:"isAdmin",name:this.t("est_administrat_15766"),category:this.t("autres_99130"),fieldType:He.Checkbox},{slug:"isLeader",name:this.t("est_responsable_27270"),category:this.t("autres_99130"),fieldType:He.Checkbox}]}getDelegationMembersFilters(e){return this.getBaseFilters(e)}getOrganizationUsersPossibleColumns(e){return[...this.getBaseColumns(),{slug:"events",name:this.t("_v_nements_53672"),minWidth:320},{slug:"number_of_events",name:this.t("nombre_d_v_nem_14214"),width:230},{slug:"forms",name:this.t("formulaires_rem_62495"),minWidth:320},{slug:"forms_inserted_at",name:this.t("dates_de_rempli_65075"),minWidth:320},{slug:"delegations",name:this.t("d_l_gations_78318"),isSearchable:!0,minWidth:320},{slug:"delegations_categories",name:this.t("cat_gories_de_d_45259"),minWidth:320},{slug:"inserted_at",name:this.t("date_d_inscript_31369"),isSortable:!0,sortAttribute:Dt.InsertedAt,width:230},{slug:"tags",name:this.t("tags_79499"),isSearchable:!0,minWidth:320},{slug:"roles",name:this.t("r_les_61679"),minWidth:320},...this.customFieldsToPossibleColumns(e)]}getDelegationMembersPossibleColumns(e){return[...this.getBaseColumns(),...this.customFieldsToPossibleColumns(e)]}getBaseColumns(){return[{slug:"name",name:this.t("full_name"),isSearchable:!0,isSortable:!0,sortAttribute:Dt.Name,minWidth:240},{slug:"email",name:this.t("e_mail_du_membr_69509"),isSearchable:!0,isSortable:!0,sortAttribute:Dt.Email,minWidth:180},{slug:"id",name:this.t("id_51738"),isSearchable:!0,isSortable:!0,sortAttribute:Dt.Id,width:100}]}getBaseFilters(e){return[{slug:"email",name:this.t("Email"),category:this.t("champs_de_formu_64126"),fieldType:He.Text},{slug:"registrationDate",name:this.t("date_d_inscript_31369"),category:this.t("champs_de_formu_64126"),fieldType:He.Date,hideEmpty:!0},{slug:"id",name:this.t("id_51738"),category:this.t("champs_de_formu_64126"),fieldType:He.Number,hideEmpty:!0},...this.customFieldsToFilters(e)]}getEventsFilters(e){return[{slug:"event",name:this.t("_v_nement_22345"),category:this.t("Event"),fieldType:He.Select,hideEmpty:!0,needLoading:!0,organizationId:e},{slug:"numberOfEvents",name:this.t("nombre_d_v_nem_14214"),category:this.t("Event"),fieldType:He.Number,hideEmpty:!0}]}getFormsFilters(e){return[{slug:"forms",name:this.t("formulaires_rem_62495"),category:this.t("Form_plural"),fieldType:He.Select,needLoading:!0,organizationId:e},{slug:"formsInsertedAt",name:this.t("dates_de_rempli_65075"),category:this.t("Form_plural"),fieldType:He.Date,hideEmpty:!0,needLoading:!0,organizationId:e}]}getPositionsFilters(){return[{slug:"positionName",name:this.t("nom_de_la_missi_80169"),category:this.t("missions_63972"),fieldType:He.Text,hideEmpty:!0},{slug:"positionCategoryName",name:this.t("nom_de_la_cat_g_57279"),category:this.t("missions_63972"),fieldType:He.Text,hideEmpty:!0},{slug:"numberOfAssignments",name:this.t("nombre_d_affect_31455"),category:this.t("missions_63972"),fieldType:He.Number,hideEmpty:!0}]}getDelegationsFilters(e){return[{slug:"delegation",name:this.t("fait_partie_de_32196"),category:this.t("d_l_gations_78318"),fieldType:He.Select,needLoading:!0,organizationId:e},{slug:"delegationCategory",name:this.t("inscrit_via_la_12241"),category:this.t("d_l_gations_78318"),fieldType:He.Select,needLoading:!0,organizationId:e},{slug:"isDelegationLeader",name:this.t("est_responsable_87662"),category:this.t("d_l_gations_78318"),fieldType:He.Checkbox}]}getEmailsFilters(e){return[{slug:"campaign",name:this.t("campagne_97871"),category:this.t("e_mails_09850"),fieldType:He.Campaign,needLoading:!0,organizationId:e},{slug:"emailBlacklist",name:this.t("ne_souhaite_plu_08853"),category:this.t("e_mails_09850"),fieldType:He.Checkbox,hideEmpty:!0}]}getCommentsFilters(){return[{slug:"comments",name:this.t("commentaires_96492"),category:this.t("commentaires_96492"),fieldType:He.Text},{slug:"lastCommentAt",name:this.t("date_du_dernier_73554"),category:this.t("commentaires_96492"),fieldType:He.Date,hideEmpty:!0}]}};XA=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[hu,Jc,qn])],XA);const JA=e=>{const t=(0,L.useMemo)(()=>(e.user.events||[]).map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[e.user]);return(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Py,{badges:t})})},QA=e=>{const{params:{organizationId:t}}=vl(),n=Zn(Jc),{mutate:s}=function(e={}){return ei("mutation UserInfoUpdateField(\n $organizationId: OrganizationId!\n $userInfoId: UsersInfoId!\n $slug: String!\n $value: JSON!\n) {\n userInfoUpdateField(\n organizationId: $organizationId\n userInfoId: $userInfoId\n slug: $slug\n value: $value\n ) {\n id\n }\n}\n",e)}(),o=(0,L.useCallback)((n,i)=>s({organizationId:t,userInfoId:e.row.id,slug:i,value:n}),[e.row,s]),r=(0,L.useMemo)(()=>(e.row.formsUsersInfos||[]).flatMap(e=>e.form?[{id:e.form.id,color:"gray",icon:null,text:e.form.name}]:[]),[e.row.formsUsersInfos]),a=(0,L.useMemo)(()=>(e.row.formsUsersInfos||[]).flatMap(e=>e.form?[`${e.form.name} : ${n.toLocaleString(e.insertedAt.toLocal(),eo.DateTime)}`]:[]).join(", "),[e.row.formsUsersInfos]),l=(0,L.useMemo)(()=>(e.row.delegations||[]).map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[e.row.delegations]),d=(0,L.useMemo)(()=>(0,xh.A)(e.row.delegations||[],e=>e.delegationCategory.id).map(e=>({id:e.delegationCategory.id,color:"gray",icon:null,text:e.delegationCategory.name})),[e.row.delegations]),c=(0,L.useMemo)(()=>(e.row.tags||[]).map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[e.row.tags]);return"name"===e.column.slug?(0,i.jsx)(Vy,{canClickMemberName:e.canClickMemberName,column:e.column,mutate:o,reload:e.reloadRow,updatable:e.updatable,userInfo:e.row}):"id"===e.column.slug?(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.id}):"picture"===e.column.slug?(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(sp,{email:e.row.email,image:e.row.picture?.url,name:e.row.name,size:32})}):"email"===e.column.slug?(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.email}):"events"===e.column.slug?(0,i.jsx)(JA,{column:e.column,user:e.row}):"number_of_events"===e.column.slug?(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.events?.length??0}):"forms"===e.column.slug?(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Py,{badges:r})}):"forms_inserted_at"===e.column.slug?(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Ar,{css:{ellipsis:!0},title:a,children:a})}):"delegations"===e.column.slug?(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Py,{badges:l})}):"delegations_categories"===e.column.slug?(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Py,{badges:d})}):"inserted_at"===e.column.slug?(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:n.toLocaleString(e.row.insertedAt.toLocal(),eo.DateTime)}):"tags"===e.column.slug?(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Py,{badges:c})}):"roles"===e.column.slug?(0,i.jsx)(Wy,{minWidth:e.column.minWidth,userPermissions:e.row,width:e.column.width}):(0,i.jsx)(By,{column:e.column,customField:e.customField,fields:e.row.fields,mutate:o,reload:e.reloadRow,updatable:e.updatable})},ew=e=>{const{params:{organizationId:t,delegationId:n}}=vl(),s=Zn(XA),o=si(),[r,a,l]=fy(t,"organizationDelegationMembers.columns",e.columns),[d,c,u]=fy(t,"organizationDelegationMembers.limit",Rc),[h,m,g]=fy(t,"organizationDelegationMembers.predicates",[]),[p,f,_]=fy(t,"organizationDelegationMembers.sort",null),{data:x,isLoading:I}=Qn("query OrganizationDelegationMembersInfos(\n $organizationId: OrganizationId!\n $delegationId: DelegationId!\n $privacy: CustomFieldPrivacy!\n) {\n organization(id: $organizationId) {\n customFields(variety: UserInfo, privacy: $privacy) {\n nodes {\n ...SegmentCustomField\n }\n }\n\n delegation(id: $delegationId) {\n columnsCustomFields {\n ...SegmentCustomField\n }\n\n form {\n elements {\n customField {\n ...SegmentCustomField\n }\n }\n }\n }\n }\n}\n",{organizationId:t,privacy:e.isOrganizationAdmin?Ie.All:Ie.Public,delegationId:n},[Vs.SegmentCustomFieldFragment]);const v=l||u||g||_||I,b=(0,L.useMemo)(()=>e.isOrganizationAdmin?x.organization?.customFields.nodes??[]:(0,Za.A)((x.organization?.delegation.form.elements.map(e=>e.customField)||[]).concat(x.organization?.delegation.columnsCustomFields??[])),[x.organization]),j=_y(b),C=(0,L.useMemo)(()=>s.getDelegationMembersFilters(b),[b]),y=(0,L.useMemo)(()=>s.getDelegationMembersPossibleColumns(b),[b]);return(0,L.useEffect)(()=>{o.setItem(Ul.DELEGATIONS_SPACE_TAB,"members")},[]),v?(0,i.jsx)(wl,{}):(0,i.jsx)(_m,{columns:e.canEditColumns?r:e.columns,columnsSearch:[],columnsToIncludes:ZA,eventId:null,filters:C,limit:d,loadDataList:Ho,loadDataListParams:{delegationId:n},loadRow:Go,organizationId:t,possibleColumns:y,predicates:h,renderActions:(t,n,s)=>(0,i.jsx)(BA,{campaigns:e.campaigns,customFields:b,deleteFromEvent:!1,massActions:t,showAccreditationsEdit:!1,showAccreditationsValidate:!1,showDelete:e.canDeleteMembers,showWishedAccreditationsEdit:!1,onMassEditSuccess:s}),rendering:Gh.List,setColumns:a,setLimit:c,setPredicates:m,setSort:f,showEditColumns:e.canEditColumns,showEditMode:e.isOrganizationAdmin,showFilters:!0,showMassActions:!0,showRowDropdown:!0,showRowEdit:e.canEditMembers,showSearchColumns:!1,sort:p,children:(0,i.jsx)(Tm,{getEditPath:e.getEditPath,renderCell:(t,n,s)=>(0,i.jsx)(QA,{canClickMemberName:e.canClickMemberName,column:t,customField:j.get(t.slug),reloadRow:s,row:n,updatable:e.canEditMembers}),renderRowDropdown:(t,n)=>(0,i.jsx)(uA,{accreditationState:null,allowedCustomDocuments:e.customBadges,canAccredit:!1,canDelete:e.canDeleteMembers,customDocuments:[],deleteFromEvent:!1,member:t,reload:n,showDeleteFromEvent:!1,showDocumentsDownload:e.showDocumentsDownload,volunteerRegistrationId:null})})})};function tw(){return Ec(pr.desktop)}const nw=e=>{const t=tw(),n=(0,L.useMemo)(()=>e.min.startOf("week").equals(e.value.startOf("week")),[e.min,e.value]),s=(0,L.useMemo)(()=>e.max.endOf("week").equals(e.value.endOf("week")),[e.max,e.value]);return(0,i.jsxs)(Ba,{gap:"2",children:[(0,i.jsx)(zl,{color:"white",disabled:n,leftIcon:"chevron-left",onClick:()=>{e.onChange(e.value.minus(t?{week:1}:{day:1}))}}),(0,i.jsx)(Ar,{width:160,children:(0,i.jsx)(Mu,{...e})}),(0,i.jsx)(zl,{color:"white",disabled:s,leftIcon:"chevron-right",onClick:()=>{e.onChange(e.value.plus(t?{week:1}:{day:1}))}})]})},iw=L.createContext({}),sw=e=>{const{days:t,interval:n}=L.useContext(iw),s=t[0],o=t[6]??t[0],r=L.useMemo(()=>(e.startAt??Gs.c9.max(s,n.start)).startOf("day"),[e.startAt,s,n]),a=L.useMemo(()=>(e.endAt??Gs.c9.min(o,n.end)).endOf("day"),[e.endAt,o,n]),l=L.useMemo(()=>"number"==typeof e.startHour&&e.startHour>0&&e.startAt?.isValid&&e.startAt.hour{const e=Math.max(r.diff(s,"days").days+1,1);return l?e-1:e},[l,r,s]),c=L.useMemo(()=>{const e=Math.min(Math.ceil(a.diff(s,"days").days)+1,8);return l?e-1:e},[l,a,s]);return r>o||a{const t=L.useMemo(()=>{if("week"===e.display){const t=e.date.startOf("week");return(0,Dc.A)(0,7).map(e=>t.plus({day:e}))}return[e.date]},[e.date]),n=L.useMemo(()=>Gs.IX.fromDateTimes(e.minDate.startOf("day"),e.maxDate.endOf("day")),[e.minDate,e.maxDate]),[s,o]=L.useState(300),r=L.useCallback(e=>{if(e){const t=Math.max(Math.ceil(e.getBoundingClientRect().height),300);o(t)}},[e.date,o]),a=e.showBorder?{bd:!0,overflow:"hidden"}:{};return(0,i.jsx)(iw.Provider,{value:{days:t,interval:n},children:(0,i.jsxs)(Ba,{css:{...a,...e.css},direction:"column",children:[(0,i.jsx)(Ba,{css:{borderBottom:"1px solid $gray200"},height:60,width:1,children:t.map(e=>(0,i.jsxs)(Ba,{align:"center",css:{background:"$gray50"},direction:"column",height:1,justify:"center",width:1,children:[(0,i.jsx)(Ar,{css:{textTransform:"capitalize"},font:"gray500 textXs medium",children:e.toLocaleString({weekday:"long"})}),(0,i.jsx)(Ar,{font:"gray800 textXl semiBold",children:e.day})]},e.toISO()))}),(0,i.jsxs)(Ba,{className:"h-calendar-events-container",css:{position:"relative"},direction:"column",height:s,width:1,children:[(0,i.jsx)(hd,{css:{flex:"1","& > div:last-child":{borderRight:"none"}},gridtemplatecolumns:"week"===e.display?"repeat(7, minmax(0, 1fr))":"1",gridtemplaterows:"1fr",width:1,children:t.map((e,t)=>(0,i.jsx)(Ba,{css:{background:n.contains(e)?"white":"$primary50",borderRight:"1px solid $gray200",gridColumn:`${t+1} / ${t+2}`,gridRow:"1 / 2"}},e.toISO()))}),(0,i.jsx)(hd,{ref:r,css:{gridAutoFlow:"column",rowGap:"$2",position:"absolute",top:"0",py:"$2"},gridtemplatecolumns:"week"===e.display?"repeat(7, minmax(0, 1fr))":"1",width:1,children:e.children})]})]})})},rw=e=>{const{translate:t}=vl(),n=e.member.accreditationsUsersInfos.some(t=>t.accreditationSlotId===e.accreditationSlotId);return(0,i.jsx)(Mc,{children:(0,i.jsxs)(Oc,{children:[(0,i.jsx)(Ar,{css:{flex:"1"},children:(0,i.jsx)(xj,{userInfo:e.member.userInfo})}),(0,i.jsx)(Ba,{align:"center",gap:"3",children:n?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ba,{align:"center",gap:"1",children:[(0,i.jsx)(Ar,{color:"success500",children:(0,i.jsx)(nl,{icon:"badge-check",iconStyle:"solid"})}),(0,i.jsx)(Ar,{font:"gray800 textXs medium",children:t("d_j_attribu_e_06450")})]}),(0,i.jsxs)(Wd,{children:[(0,i.jsx)(Xd,{children:(0,i.jsx)(zl,{color:"white",leftIcon:"ellipsis-vertical",size:"sm"})}),(0,i.jsx)(Zd,{placement:"bottom-end",children:(0,i.jsx)(Kd,{color:"red",icon:"trash-can",onClick:()=>e.deleteAccreditationSlot(e.member.userInfo.id,e.accreditationSlotId),children:t("retirer_l_accr_62187")})})]})]}):(0,i.jsx)(zl,{size:"sm",onClick:()=>e.addAccreditationSlot(e.member.userInfo.id,e.accreditationSlotId),children:t("ajouter_97327")})})]})})},aw=e=>{const t=Xn();return(0,i.jsx)(Ba,{css:{background:"white",bd:!0,padding:"$4 $6"},direction:"column",gap:"2",children:e.isLoading?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(lc,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(lc,{borderRadius:"$1",height:20,width:1}),e.isWeezeventConnected&&(0,i.jsx)(lc,{borderRadius:"$1",height:20,width:1})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ba,{align:"center",css:{color:"$gray700"},gap:"1",width:1,children:[(0,i.jsx)(Ar,{children:(0,i.jsx)(nl,{icon:"badge-check"})}),(0,i.jsx)(Ar,{css:{flex:"1"},children:t("attribu_es_48167")}),(0,i.jsx)(Ar,{children:e.stats.assignedResources})]}),(0,i.jsxs)(Ba,{align:"center",css:{color:"$gray700"},gap:"1",width:1,children:[(0,i.jsx)(Ar,{children:(0,i.jsx)(nl,{icon:"hand-holding-heart"})}),(0,i.jsx)(Ar,{css:{flex:"1"},children:t("souhait_es_78101")}),(0,i.jsx)(Ar,{children:e.stats.wishedResources})]}),e.isWeezeventConnected&&(0,i.jsxs)(Ba,{align:"center",css:{color:"$gray700"},gap:"1",width:1,children:[(0,i.jsx)(Ar,{children:(0,i.jsx)(nl,{icon:"scanner-gun"})}),(0,i.jsx)(Ar,{css:{flex:"1"},children:t("scann_es_13169")}),(0,i.jsx)(Ar,{children:e.stats.scannedResources})]})]})})},lw=e=>{const{params:{eventId:t,delegationId:n},translate:s}=vl(),{mutate:o}=yo(),r=(0,L.useMemo)(()=>`${e.das.accreditation.name}${m(e.das.accreditationSlot.name)?` - ${e.das.accreditationSlot.name}`:""}`,[e.das]),[a,l]=(0,L.useState)(!1),[d,c]=(0,L.useState)(e.das),[u,h]=(0,L.useState)((0,uc.A)(e.das.volunteersRegistrations,e=>e.userInfo.name)),[g,p]=(0,L.useState)({}),f=(0,L.useCallback)(async i=>{l(!0),p(e=>({...e,[i]:!0}));const{event:s}=await(o={eventId:t,delegationId:n,accreditationSlotId:e.accreditationSlotId,userInfoId:i},r=await Y(),go("query DelegationAccreditationSlotMember(\n $eventId: EventId!\n $delegationId: DelegationId!\n $accreditationSlotId: AccreditationsSlotId!\n $userInfoId: UsersInfoId!\n) {\n event(id: $eventId) {\n delegation(id: $delegationId) {\n accreditationSlot(id: $accreditationSlotId) {\n ...DelegationAccreditationSlotStats\n }\n }\n\n member: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n ...VolunteerRegistrationDelegationAccreditationSlot\n }\n }\n}\n",{variables:o,token:r||void 0,fragments:[Vs.DelegationAccreditationSlotStatsFragment,Vs.VolunteerRegistrationDelegationAccreditationSlotFragment]}));var o,r;h(t=>t.flatMap(t=>{if(t.userInfo.id===i){const t=s.member.accreditationsUsersInfos.some(t=>t.accreditationSlotId===e.accreditationSlotId),n=s.member.accreditationsSlots.some(t=>t.id===e.accreditationSlotId);return t||n?[s.member]:[]}return[t]})),c(s.delegation.accreditationSlot),p(e=>({...e,[i]:!1})),l(!1)},[e.accreditationSlotId,n,t,l,c,p,h]),_=(0,L.useCallback)(async(e,n)=>{p(t=>({...t,[e]:!0})),await o({eventId:t,massAccredit:{accreditationsSlotsIds:[n],selecteds:{ids:[e]},strategy:it.Add}}),await f(e)},[t,f,p]),x=(0,L.useCallback)(async(e,n)=>{p(t=>({...t,[e]:!0})),await o({eventId:t,massAccredit:{accreditationsSlotsIds:[n],selecteds:{ids:[e]},strategy:it.Delete}}),await f(e)},[t,f,p]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zj,{children:r}),(0,i.jsxs)(bu,{css:{background:"$gray50",gap:"$6",padding:"$6"},children:[(0,i.jsx)(aw,{isLoading:a,isWeezeventConnected:e.isWeezeventConnected,stats:d}),(0,i.jsxs)(Sc,{children:[(0,i.jsx)(kc,{children:(0,i.jsx)(Gc,{children:s("nom_du_membre_69353")})}),u.map(t=>g[t.userInfo.id]?(0,i.jsx)(Hc,{bx:!0},t.id):(0,i.jsx)(rw,{accreditationSlotId:e.accreditationSlotId,addAccreditationSlot:_,deleteAccreditationSlot:x,member:t},t.id))]})]})]})},dw=e=>{const{data:t,loader:n,isLoading:s}=Qn("query DelegationAccreditationSlotMembers(\n $eventId: EventId!\n $delegationId: DelegationId!\n $accreditationSlotId: AccreditationsSlotId!\n) {\n event(id: $eventId) {\n isWeezeventConnected\n\n delegation(id: $delegationId) {\n accreditationSlot(id: $accreditationSlotId) {\n ...DelegationAccreditationSlotStats\n\n accreditationSlot {\n date\n name\n }\n\n accreditation {\n name\n }\n\n volunteersRegistrations {\n ...VolunteerRegistrationDelegationAccreditationSlot\n }\n }\n }\n }\n}\n",{eventId:e.eventId,delegationId:e.delegationId,accreditationSlotId:e.accreditationSlotId},[Vs.DelegationAccreditationSlotStatsFragment,Vs.VolunteerRegistrationDelegationAccreditationSlotFragment]);return(0,i.jsx)(vu,{size:"md",onClose:e.onClose,children:s?n:(0,i.jsx)(lw,{accreditationSlotId:e.accreditationSlotId,das:t.event.delegation.accreditationSlot,isWeezeventConnected:t.event.isWeezeventConnected})})},cw=e=>(0,i.jsxs)(Ba,{align:"center",gap:"2",width:1,children:[(0,i.jsx)(Ar,{children:(0,i.jsx)(nl,{icon:e.icon})}),(0,i.jsx)(Ar,{css:{flex:"1"},fontSize:"textXs",children:e.text}),(0,i.jsx)(Ba,{align:"center",css:{background:e.background,borderRadius:"$1",fontSize:"$textXs",fontWeight:"$medium",padding:"2px 8px",minWidth:"30px"},justify:"center",children:e.count})]}),uw=e=>{const{translate:t,params:{eventId:n,delegationId:s}}=vl(),[o,r]=(0,L.useState)(e.das),a=(0,L.useMemo)(()=>ic(e.das.accreditation.color),[e.das]),l=(0,L.useMemo)(()=>({background:a[50],border:`1px solid ${a[500]}`,color:a[700]}),[a]),d=(0,L.useMemo)(()=>`${e.das.accreditation.name}${m(e.das.accreditationSlot.name)?` - ${e.das.accreditationSlot.name}`:""}`,[e.das]),c=(0,L.useCallback)(async()=>{const{event:{delegation:t}}=await Fo({eventId:n,delegationId:s,accreditationSlotId:e.das.accreditationSlot.id},await Y());r(t.accreditationSlot)},[e.das,r]),[u,h]=(0,L.useState)(!1),g=o.maxResources?`/${o.maxResources}`:"",p=`${o.assignedResources}${g}`;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ba,{align:"start",css:{...l,borderRadius:"$1",cursor:e.isEventAdmin?"pointer":"default",minHeight:"32px",px:"$2",py:"$2"},direction:"column",gap:"2",width:1,onClick:()=>{e.isEventAdmin&&h(!0)},children:[(0,i.jsx)(Ar,{css:{flex:"1"},fontSize:"textXs",fontWeight:"medium",children:d}),(0,i.jsx)(cw,{background:a[100],count:p,icon:"badge-check",text:t("attribu_es_48167")}),e.showWished&&(0,i.jsx)(cw,{background:a[100],count:o.wishedResources,icon:"hand-holding-heart",text:t("souhait_es_78101")}),(0,i.jsx)(cw,{background:a[100],count:o.scannedResources,icon:"scanner-gun",text:t("scann_es_13169")})]}),e.isEventAdmin&&u&&(0,i.jsx)(dw,{accreditationSlotId:e.das.accreditationSlot.id,delegationId:s,eventId:n,onClose:()=>(h(!1),c())})]})},hw=e=>{const t=tw(),n=(0,L.useMemo)(()=>(0,uc.A)(e.accreditationsSlots.filter(e=>!e.accreditationSlot.date?.isValid),e=>[e.accreditationCategory.name,$C(e.accreditation.index),e.accreditation.name.toLowerCase()]),[e.accreditationsSlots]),s=(0,L.useMemo)(()=>(0,uc.A)(e.accreditationsSlots.filter(e=>e.accreditationSlot.date?.isValid),e=>[e.accreditationCategory.name,$C(e.accreditation.index),e.accreditation.name.toLowerCase()]),[e.accreditationsSlots]),o=(0,L.useMemo)(()=>Object.fromEntries(e.accreditations.map(e=>[e.accreditationId,e.willAutoAccredit||e.accreditation.willAutoAccredit])),[e.accreditations]);return(0,i.jsxs)(ow,{css:{borderTop:"1px solid $gray200"},date:e.selectedDay,display:t?"week":"day",maxDate:e.event.endAt,minDate:e.event.startAt,children:[n.map(t=>(0,i.jsx)(sw,{children:(0,i.jsx)(uw,{das:t,isEventAdmin:e.isEventAdmin,showWished:!o[t.accreditationId]})},t.accreditationSlot.id)),s.map(t=>(0,i.jsx)(sw,{endAt:t.accreditationSlot.date,startAt:t.accreditationSlot.date,children:(0,i.jsx)(uw,{das:t,isEventAdmin:e.isEventAdmin,showWished:!o[t.accreditationId]})},t.accreditationSlot.id))]})},mw=e=>{const t=Zn(Vv),{delegationAccreditationsSlots:n,showWished:s}=xw(),o=n.find(t=>t.accreditationSlot.id===e.slot.id);return(0,i.jsxs)(Mc,{children:[(0,i.jsx)(Oc,{css:{paddingLeft:"76px",textTransform:"capitalize"},children:e.slot.name}),s&&(0,i.jsx)(Oc,{width:150,children:t.toNumberOrInfinity(o?.wishedResources??0)}),(0,i.jsx)(Oc,{width:150,children:t.toNumberOrInfinity(o?.assignedResources??0)}),(0,i.jsx)(Oc,{width:150,children:t.toNumberOrInfinity(o?.maxResources)}),(0,i.jsx)(Oc,{width:150,children:t.toNumberOrInfinity(o?.scannedResources??0)})]})},gw=e=>{const t=Zn(Vv),{delegationAccreditations:n,delegationAccreditationsSlots:s,accreditationIdToSlots:o,accreditationIdToOpen:r,setAccreditationIdToOpen:a,showWished:l}=xw(),d=r[e.accreditation.id]??!0,c=o[e.accreditation.id],u=(0,L.useMemo)(()=>{const t=n.find(t=>t.accreditationId===e.accreditation.id);if("number"==typeof t?.maxResources)return t.maxResources;{const t=s.filter(t=>t.accreditationId===e.accreditation.id&&"number"==typeof t.maxResources);return so(t)?(0,uv.A)(t,e=>e.maxResources):null}},[e.accreditation,n,s]),h=(0,L.useMemo)(()=>(0,uv.A)(s.filter(t=>t.accreditationId===e.accreditation.id),e=>e.wishedResources),[e.accreditation,s]),m=(0,L.useMemo)(()=>(0,uv.A)(s.filter(t=>t.accreditationId===e.accreditation.id),e=>e.assignedResources),[e.accreditation,s]),g=(0,L.useMemo)(()=>(0,uv.A)(s.filter(t=>t.accreditationId===e.accreditation.id),e=>e.scannedResources),[e.accreditation,s]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Mc,{children:[(0,i.jsxs)(Oc,{align:"center",css:{cursor:"pointer",paddingLeft:"44px",userSelect:"none"},gap:"2",onClick:()=>a({...r,[e.accreditation.id]:!d}),children:[e.accreditation.hasSlots&&(0,i.jsx)(Ba,{align:"center",css:{color:"$gray800"},height:32,justify:"center",width:32,children:(0,i.jsx)(nl,{icon:d?"chevron-up":"chevron-right"})}),(0,i.jsx)(WC,{color:e.accreditation.color,icon:e.accreditation.icon}),(0,i.jsx)(Ar,{children:e.accreditation.name})]}),l&&(0,i.jsx)(Oc,{width:150,children:t.toNumberOrInfinity(h)}),(0,i.jsx)(Oc,{width:150,children:t.toNumberOrInfinity(m)}),(0,i.jsx)(Oc,{width:150,children:t.toNumberOrInfinity(u)}),(0,i.jsx)(Oc,{width:150,children:t.toNumberOrInfinity(g)})]}),e.accreditation.hasSlots&&d&&c.map(e=>(0,i.jsx)(mw,{slot:e},`s-${e.id}`))]})},pw=e=>{const t=Zn(Vv),{delegationAccreditations:n,delegationAccreditationsSlots:s,categoryIdToOpen:o,categoryIdToAccreditations:r,setCategoryIdToOpen:a,showWished:l}=xw(),d=o[e.category.id]??!0,c=(0,L.useMemo)(()=>DC(r[e.category.id]),[r,e.category.id]),u=(0,L.useMemo)(()=>{const t=(0,Za.A)(n.filter(t=>t.accreditationCategoryId===e.category.id).map(e=>{if("number"==typeof e.maxResources)return e.maxResources;{const t=s.filter(t=>t.accreditationId===e.accreditationId&&"number"==typeof t.maxResources);return so(t)?(0,uv.A)(t,e=>e.maxResources):null}}));return so(t)?(0,np.A)(t):null},[e.category,n,s]),h=(0,L.useMemo)(()=>(0,uv.A)(s.filter(t=>t.accreditationCategory.id===e.category.id),e=>e.wishedResources),[e.category,s]),m=(0,L.useMemo)(()=>(0,uv.A)(s.filter(t=>t.accreditationCategory.id===e.category.id),e=>e.assignedResources),[e.category,s]),g=(0,L.useMemo)(()=>(0,uv.A)(s.filter(t=>t.accreditationCategory.id===e.category.id),e=>e.scannedResources),[e.category,s]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Mc,{css:{background:"$gray100"},children:[(0,i.jsxs)(Oc,{align:"center",css:{cursor:"pointer",userSelect:"none"},gap:"2",onClick:()=>a({...o,[e.category.id]:!d}),children:[(0,i.jsx)(Ba,{align:"center",css:{color:"$gray800"},height:32,justify:"center",width:32,children:(0,i.jsx)(nl,{icon:d?"chevron-up":"chevron-right"})}),(0,i.jsx)(Ar,{css:{textTransform:"uppercase"},fontSize:"textXs",fontWeight:"medium",children:e.category.name})]}),l&&(0,i.jsx)(Oc,{width:150,children:t.toNumberOrInfinity(h)}),(0,i.jsx)(Oc,{width:150,children:t.toNumberOrInfinity(m)}),(0,i.jsx)(Oc,{width:150,children:t.toNumberOrInfinity(u)}),(0,i.jsx)(Oc,{width:150,children:t.toNumberOrInfinity(g)})]}),d&&c.map(e=>(0,i.jsx)(gw,{accreditation:e},`a-${e.id}`))]})},fw=(0,L.createContext)({}),_w=e=>{const{translate:t,params:{organizationId:n}}=vl(),s=Zn(Jc),o=(0,L.useMemo)(()=>(0,uc.A)((0,xh.A)(e.accreditationsSlots.map(e=>e.accreditationCategory),e=>e.id),e=>e.name.toLowerCase()),[e.accreditationsSlots]),r=(0,L.useMemo)(()=>(0,dc.A)((0,cc.A)((0,xh.A)(e.accreditations.map(e=>e.accreditation),e=>e.id),e=>e.accreditationCategoryId),e=>(0,uc.A)(e,e=>e.name.toLowerCase())),[e.accreditations]),a=(0,L.useMemo)(()=>(0,dc.A)((0,cc.A)(e.accreditationsSlots.map(e=>({...e.accreditationSlot,name:Dh(s,e.accreditationSlot,"",{date:{localeFormat:eo.DateOnly.WeekdayLongMonthLong}})})),e=>e.accreditationId),e=>Nh(e)),[e.accreditationsSlots]),l=(0,L.useMemo)(()=>e.accreditations.some(e=>!e.willAutoAccredit&&!e.accreditation.willAutoAccredit),[e.accreditations]),[d,c]=fy(n,"eventDelegationAccreditations.categoryIdToOpen",{}),[u,h]=fy(n,"eventDelegationAccreditations.accreditationIdToOpen",{});return(0,i.jsx)(fw.Provider,{value:{accreditationIdToOpen:u,accreditationIdToSlots:a,categories:o,categoryIdToAccreditations:r,categoryIdToOpen:d,delegationAccreditations:e.accreditations,delegationAccreditationsSlots:e.accreditationsSlots,setAccreditationIdToOpen:h,setCategoryIdToOpen:c,showWished:l},children:(0,i.jsxs)(Sc,{hideBorder:!0,children:[(0,i.jsxs)(kc,{children:[(0,i.jsx)(Gc,{children:t("cat_gorie_accr_40335")}),l&&(0,i.jsx)(Gc,{width:150,children:t("souhait_es_78101")}),(0,i.jsx)(Gc,{width:150,children:t("affect_es_00048")}),(0,i.jsx)(Gc,{width:150,children:t("quota_00069")}),(0,i.jsx)(Gc,{width:150,children:t("scann_es_13169")})]}),o.map(e=>(0,i.jsx)(pw,{category:e},`c-${e.id}`))]})})};function xw(){return(0,L.useContext)(fw)}const Iw=e=>{const{translate:t,params:{organizationId:n}}=vl(),[s,o]=(0,L.useState)(""),[r,a]=fy(n,"eventDelegationAccreditations.rendering","calendar"),[l,d]=(0,L.useState)(e.event.delegation.minAccreditationSlotDate),c=(0,L.useMemo)(()=>l?.isValid?l:e.event.startAt,[e.event,l]),[u,h]=(0,L.useState)(null),g=(0,L.useMemo)(()=>e.event.delegation.accreditationsSlots.filter(e=>{const t=!m(s)||e.accreditation.name.toLowerCase().includes(s.toLowerCase())||e.accreditationSlot.name.toLowerCase().includes(s.toLowerCase())||"table"!==r||e.accreditationCategory.name.toLowerCase().includes(s.toLowerCase()),n=!u?.isValid||!!e.accreditationSlot.date?.isValid&&u.toSQLDate()===e.accreditationSlot.date.toSQLDate();return t&&n}),[e.event,s,r,u]);return(0,i.jsxs)(Ba,{css:{background:"white",bd:!0,overflow:"hidden"},direction:"column",children:[(0,i.jsxs)(Ba,{css:{background:"white",padding:"$5 $5"},gap:"3",children:[(0,i.jsx)(Ar,{width:320,children:(0,i.jsx)(Bl,{icon:"magnifying-glass",placeholder:t("rechercher_une_65646"),value:s,onChange:o})}),(0,i.jsx)(Ar,{css:{flex:"1"}}),"calendar"===r&&(0,i.jsx)(nw,{max:e.event.endAt,min:e.event.startAt,value:c,onChange:d}),"table"===r&&(0,i.jsx)(Ar,{width:160,children:(0,i.jsx)(Mu,{max:e.event.endAt,min:e.event.startAt,value:u,onChange:h})}),(0,i.jsxs)(Wd,{children:[(0,i.jsx)(Xd,{children:(0,i.jsx)(zl,{color:"white",leftIcon:"table"===r?"table":"calendar",children:t("table"===r?"vue_tableau_18026":"vue_calendrier_58086")})}),(0,i.jsxs)(Zd,{placement:"bottom-end",children:[(0,i.jsx)(Kd,{icon:"calendar",onClick:()=>a("calendar"),children:t("vue_calendrier_58086")}),(0,i.jsx)(Kd,{icon:"table",onClick:()=>a("table"),children:t("vue_tableau_18026")})]})]})]}),"table"===r?(0,i.jsx)(_w,{accreditations:e.event.delegation.accreditations,accreditationsSlots:g}):(0,i.jsx)(hw,{accreditations:e.event.delegation.accreditations,accreditationsSlots:g,event:e.event,isEventAdmin:e.isEventAdmin,selectedDay:c})]})},vw=()=>{const e=Xn();return(0,i.jsx)(Ba,{align:"center",css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs"},height:1,justify:"center",width:1,children:(0,i.jsx)(Ar,{height:250,width:1,children:(0,i.jsx)(Gk,{title:e("aucune_accr_dit_27643")})})})},bw=e=>{const{params:{eventId:t,delegationId:n}}=vl(),{data:s,loader:o}=Qn("query DelegationAccreditations(\n $eventId: EventId!\n $delegationId: DelegationId!\n $onlyVisible: Boolean!\n) {\n event(id: $eventId) {\n startAt\n endAt\n\n delegation(id: $delegationId) {\n minAccreditationSlotDate\n\n accreditations {\n accreditationId\n accreditationCategoryId\n willAutoAccredit\n maxResources\n\n accreditation {\n id\n accreditationCategoryId\n name\n color\n icon\n hasSlots\n index\n willAutoAccredit\n }\n }\n\n accreditationsSlots(onlyVisible: $onlyVisible) {\n ...DelegationAccreditationSlotStats\n\n accreditationSlot {\n id\n accreditationId\n date\n name\n }\n\n accreditation {\n name\n color\n index\n }\n\n accreditationCategory {\n id\n name\n }\n }\n }\n }\n}\n",{eventId:t,delegationId:n,onlyVisible:e.onlyVisible},[Vs.DelegationAccreditationSlotStatsFragment]);return o||(so(s.event?.delegation.accreditationsSlots)?(0,i.jsx)(Iw,{event:s.event,isEventAdmin:e.isEventAdmin}):(0,i.jsx)(vw,{}))},jw=e=>{const{params:{organizationId:t,eventId:n,delegationId:s},translate:o}=vl(),{mutate:r,isLoading:a}=Mo(),l=(0,L.useMemo)(()=>e.customDocuments.filter(t=>t.slug===e.slug),[e.customDocuments,e.slug]),d=(0,L.useMemo)(()=>so(l)?l.map(e=>e.name).join(", "):sn.includes(e.slug)?Vx(e.slug):null,[l,e.slug]),c=so(l);return d?(0,i.jsxs)(Ba,{align:"center",css:{borderBottom:"1px solid $gray200",padding:"$4 $6","&:last-child":{borderBottom:"none"}},gap:"3",children:[(0,i.jsx)(Ba,{align:"center",css:{background:"$blueGray100",borderRadius:"12px",color:"$blueGray700"},height:40,justify:"center",width:40,children:(0,i.jsx)(nl,{icon:"file-lines"})}),(0,i.jsx)(Ar,{css:{flex:"1"},font:"gray900 textSm medium",children:d}),(0,i.jsxs)(km,{children:[(0,i.jsx)(Sm,{children:(0,i.jsx)(Ar,{children:(0,i.jsx)(zl,{color:"white",isLoading:a,leftIcon:"download",onClick:()=>r({organizationId:t,eventId:n,delegationId:s,documentsExport:{badgeType:c?null:e.slug,customDocumentSlug:c?e.slug:null,documentType:c?ze.UserCustomDocument:ze.CustomBadge,language:At.Fr,oneFile:!1,segmentsIds:[],strategy:Ee.OnePerPage}})})})}),(0,i.jsx)(wm,{placement:"top",children:o("recevoir_les_do_31669")})]})]}):null},Cw=e=>{const{translate:t}=vl();return(0,i.jsxs)(Ba,{direction:"column",gap:"2",children:[(0,i.jsx)(Ar,{font:"gray900 textMd medium",children:t("documents_dispo_46996")}),(0,i.jsx)(Ba,{css:{background:"white",border:"1px solid $gray200",borderRadius:"$2",flex:"1",overflow:"hidden"},direction:"column",children:e.delegationsSpaceCustomBadges.map(t=>(0,i.jsx)(jw,{customDocuments:e.customDocuments,slug:t},t))})]})},yw=_r(Ar,{overflow:"hidden",textOverflow:"ellipsis"}),kw=e=>{const t=Zn(mC);switch(e.field.fieldType){case We.File:{const n=t.getValue(e.field,e.fields);return n?(0,i.jsx)(Fv,{acl:"public-read",document:n}):(0,i.jsx)(yw,{color:"gray500",css:{fontSize:"$textMd","@tablet":{fontSize:"$textSm"}},children:"-"})}case We.Phone:{const n=t.getValueString(e.field,e.fields);return(0,i.jsx)(yw,{color:"gray500",css:{fontSize:"$textMd","@tablet":{fontSize:"$textSm"}},children:m(n)?(0,i.jsx)(Zc,{css:{display:"block",overflow:"hidden",textOverflow:"ellipsis"},hideIcon:!0,to:`tel:${n}`,children:n}):"-"})}default:{const n=t.getValueString(e.field,e.fields);return(0,i.jsx)(yw,{color:"gray500",css:{fontSize:"$textMd","@tablet":{fontSize:"$textSm"}},children:m(n)?URL.canParse(n)?(0,i.jsx)(Zc,{css:{display:"block",overflow:"hidden",textOverflow:"ellipsis"},hideIcon:!0,to:n,children:n}):n:"-"})}}},Aw=e=>(0,i.jsx)(Ba,{css:{background:"white",bd:!0,...e.css},direction:"column",width:1,children:(0,i.jsxs)(Ba,{direction:"column",width:1,children:[(0,i.jsxs)(Ba,{css:{borderBottom:e.hideTitleBorder?void 0:"1px solid $gray200",paddingBottom:e.hideTitleBorder?"0":"$5",paddingTop:"$5",px:"$6"},gap:"3",width:1,children:[(0,i.jsx)(Ar,{color:"gray900",css:{flex:"1",alignContent:"center"},fontSize:"textMd",fontWeight:"semiBold",children:e.title}),e.rightIcon&&(0,i.jsx)(Ar,{color:"gray900",css:{cursor:"pointer"},fontSize:"textMd",fontWeight:"semiBold",textAlign:"center",width:20,onClick:t=>{e.rightIconClick?.(t)},children:(0,i.jsx)(nl,{icon:e.rightIcon})}),e.select]}),(0,i.jsx)(Ar,{className:"h-detail-box-content",css:{flex:"1",padding:"$6"},width:1,children:e.children})]})}),ww=({css:e,title:t,children:n})=>(0,i.jsxs)(Ba,{direction:"column",gap:"3",children:[(0,i.jsx)(Ar,{color:"gray900",fontSize:"textLg",fontWeight:"semiBold",children:t}),(0,i.jsx)(Ba,{css:{bd:!0,padding:"$4",...e},direction:"column",children:n})]}),Sw=({children:e,...t})=>Tc()?(0,i.jsx)(ww,{...t,children:e}):(0,i.jsx)(Aw,{...t,children:e});var Ew=n(6502),Tw=n(2716);function zw(e){return e<=.2?xr.colors.error500.value:e<.7?xr.colors.warning500.value:e<=1?xr.colors.success500.value:xr.colors.blueGray500.value}const Ow=({percent:e,prospectivePercent:t})=>(0,i.jsxs)(Ar,{css:{background:"$gray100",borderRadius:"$1",position:"relative"},height:8,width:1,children:[(0,i.jsx)(Ar,{css:{background:zw(e),borderRadius:"$1",left:0,maxWidth:"100%",position:"absolute",top:0,width:100*e+"%"},height:1}),void 0!==t&&(0,i.jsx)(Ar,{css:{background:zw(t),borderRadius:"$1",left:0,opacity:.4,maxWidth:"100%",position:"absolute",top:0,width:100*t+"%"},height:1})]}),Rw=e=>{const t=(0,L.useMemo)(()=>(0,Tw.A)().innerRadius(70).outerRadius(90).cornerRadius(20).startAngle(-Math.PI/2).endAngle(Math.PI/2),[]),n=(0,L.useMemo)(()=>e.total===1/0?1:0===e.total?1/0:e.count/e.total,[e.count,e.total]),s=(0,L.useMemo)(()=>{const e=(0,Ew.A)().domain([0,1]).range([-Math.PI/2,Math.PI/2]);return(0,Tw.A)().innerRadius(70).outerRadius(90).cornerRadius(20).startAngle(-Math.PI/2).endAngle(e(n<=1?n:1))},[n]);return(0,i.jsxs)(Ar,{css:{position:"relative","& svg":{height:"100%",width:"100%"}},height:90,width:180,children:[(0,i.jsx)("svg",{children:(0,i.jsxs)("g",{transform:"translate(90, 90)",children:[(0,i.jsx)("path",{d:t(void 0),fill:xr.colors.gray100.value}),(0,i.jsx)("path",{d:s(void 0),fill:zw(n)})]})}),(0,i.jsxs)(Ba,{align:"baseline",css:{bottom:"0",left:"0",position:"absolute"},gap:"2",justify:"center",width:1,children:[(0,i.jsx)(Ar,{color:"gray900",fontSize:"displaySm",fontWeight:"semiBold",children:e.count}),(0,i.jsxs)(Ar,{color:"gray900",fontSize:"textLg",fontWeight:"medium",children:["/",e.total===1/0?"∞":e.total]})]})]})};var $w=n(2262);const Dw=(e,t=null,n={})=>(Object.entries(e).forEach(([e,i])=>{const s=t?`${t}.${e}`:e;"object"!=typeof i||null===i||Array.isArray(i)?n[s]=i:Dw(i,s,n)}),n);const Pw=/(\{([\w\.]+)\})/g;let Fw=class{fieldService;constructor(e){this.fieldService=e}renderText(e,t={},n="HTML"){const i={organization:t.organization||void 0,event:t.event?this.getEvent(t.event,t):void 0,delegation:t.delegation||void 0,invitedBy:t?.invitedBy?this.getUser(t.invitedBy,t):void 0,recipient:t?.recipient?this.getUser(t.recipient,t):void 0,user:t.userInfo?this.getUser(t.userInfo,t):void 0,...t.extraInfos};var s;const o=("HTML"===n?Object.entries((s=i,Dw(s))).reduce((e,[t,n])=>e.replaceAll(`{${t}}`,n),e):(0,$w.A)(e,{interpolate:/{([\s\S]+?)}/g})(i)).replace(Pw,(e,n,i)=>{const[s,o,r,a]=i.split("."),l=t?.userInfo?{lang:this.getLanguage(t.userInfo)}:{};if(8===a?.length?l.date=a:16===a?.length&&(l.date=a.substring(0,8),l.endDate=a.substring(8)),t.userInfo?.links){const e=t.userInfo.links;return i.includes("planningDays")?_g(e.userPlanningDaysLink,"pdf",l):i.includes("planningList")?_g(e.userPlanningListLink,"pdf",l):i.includes("planning")?_g(e.userPlanningLink,"pdf",l):i.includes("assignments")?_g(e.userAssignmentsLink,"pdf",l):i.includes("paris20kmassignment")&&e?.userCustomBadgeLinks[xe.Paris20kmassignment]?_g(e.userCustomBadgeLinks[xe.Paris20kmassignment],"pdf",l):""}return""});return o}getEvent(e,t){const n=t.customFields||[],i=this.getFields(e.fields,n);return{id:e.id,name:e.name,...i}}getUser(e,t){const n=t.customFields||[],i=this.getFields(e.fields,n),s=this.getLanguage(e),o=s?{lang:s.toString()}:{},r=e.links?_g(e.links.userAssignmentsLink,"pdf",o):"",a=e.links?_g(e.links.userPlanningLink,"pdf",o):"",l=e.links?_g(e.links.userPlanningListLink,"pdf",o):"",d=e.links?_g(e.links.userPlanningDaysLink,"pdf",o):"",c=e.links?{assignments:r,badge:_g(e.links.userBadgeLink,"pdf",o),certificate:_g(e.links.userCertificateLink,"pdf",o),planning:a,planningList:l,planningDays:d,...Object.fromEntries(Object.entries(e.links.userCustomBadgeLinks).map(([e,t])=>[e.toLowerCase(),_g(t,"pdf",o)])),...Object.fromEntries(Object.entries(e.links.userCustomDocumentLinks).map(([e,t])=>[e,_g(t,"pdf",o)]))}:{},u=t.volunteerRegistration?.ticketId??"",h=(e.fields.isExpanded?e.fields?.firstName?.value:e.fields.firstName)||"",m=(e.fields.isExpanded?e.fields?.lastName?.value:e.fields.lastName)||"",g=`\n
\n
`;return{id:e.id,localId:t.volunteerRegistration?.localId||"",email:e.email,...i,firstName:h,lastName:m,ticketId:u,qrcode:g,memberCode:t.volunteerRegistration?.weezevent?.memberCode||"",name:Og({firstName:h,lastName:m}),registrationDate:e.registrationDate?.toFormat(t.organization?.datetimeFormat??"yyyy-MM-dd HH:mm")??"",assignmentSheet:t.event?r:"",documents:c,delegation:{name:t.volunteerRegistration?.delegation?.name??"",leader:{firstName:t.volunteerRegistration?.delegation?.leaders?.[0]?.firstName??"",lastName:t.volunteerRegistration?.delegation?.leaders?.[0]?.lastName??"",phone:t.volunteerRegistration?.delegation?.leaders?.[0]?.phone?.internationalFormat??""}},weezevent:{barcode:u,qrcode:g,identificationNumber:""}}}getFields(e,t){return e.isExpanded?Object.fromEntries(Object.entries(e).flatMap(([e,{label:t,value:n}])=>{const i=so(n)?n.join(", "):m(n)?n:"";return(0,Za.A)([[e,i],m(t)?[h(t),i]:null])})):Object.fromEntries(t.flatMap(t=>{const n=this.fieldService.getValueString(t,e);return(0,Za.A)([[t.slug,n],m(t.label)?[h(t.label),n]:null])}))}getLanguage(e){return e.fields.isExpanded?e.fields?.language?.rawValue:e.fields?.language}};Fw=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[mC])],Fw);const Mw=({description:e})=>{const t=Xn();return(0,i.jsx)(Sw,{title:t("description_58935"),children:m(e)?(0,i.jsx)(Cg,{text:e}):(0,i.jsx)(Ar,{color:"gray500",textAlign:"center",width:1,children:t("aucune_descript_25737")})})},Nw=({privateNote:e})=>{const t=Xn();return(0,i.jsx)(Sw,{title:(0,i.jsxs)(Ba,{align:"center",gap:"2",children:[(0,i.jsx)(nl,{icon:"lock"}),(0,i.jsx)(Ar,{children:t("note_priv_e_06303")})]}),children:m(e)?(0,i.jsx)(Cg,{text:e}):(0,i.jsx)(Ar,{color:"gray500",textAlign:"center",width:1,children:t("aucune_note_pri_86832")})})};let Lw=class extends Gl{constructor(e){super(e)}associateTagsIdsSchema(){return d.Ik().shape({tagsIds:d.YO().of(d.ai())})}};Lw=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[qn])],Lw);const Bw=e=>{const t=Xn(),n=Zn(Lw),[s,o]=(0,L.useState)(e.tags),[r,a]=(0,L.useState)(!1);return(0,i.jsx)(oC,{buttonText:t("enregistrer_06519"),icon:"tag",initialValues:{tagsIds:e.tagsIds},schema:n.associateTagsIdsSchema(),size:"md",subtitle:e.subtitle,title:t("ajout_d_un_ou_p_17767"),onClose:e.onClose,onSubmit:async t=>{e.onSave(t.tagsIds)},children:({form:t,values:n})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ym,{isCreateVisible:!0,isSearchVisible:!0,multiple:!0,name:"tagsIds",onCreateClick:()=>{a(!0)},children:s.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.name))}),r&&(0,i.jsx)(rC,{organizationId:e.organizationId,onClose:()=>{a(!1)},onSuccess:e=>{o([...s,e]),t.change("tagsIds",[...n.tagsIds,e.id])}})]})})},Vw=e=>{const{data:t,loader:n}=(s={organizationId:e.organizationId},Qn(Io,s,[]));var s;return n?null:(0,i.jsx)(Bw,{organizationId:e.organizationId,subtitle:e.subtitle,tags:t.organization.tags.nodes,tagsIds:e.tagsIds,onClose:e.onClose,onSave:e.onSave})},Uw=e=>{const t=Xn(),{organizationId:n}=ti(),[s,o]=(0,L.useState)(!1);return"associateTags"in e?(0,i.jsxs)(Sw,{rightIcon:"pen",rightIconClick:()=>{o(!0)},title:t("tags_79499"),children:[so(e.tags)?(0,i.jsx)(Ba,{gap:"2",wrap:"wrap",children:e.tags.map(e=>(0,i.jsx)(rc,{children:e.name},e.id))}):(0,i.jsx)(Ar,{color:"gray500",textAlign:"center",width:1,children:t("aucun_tag_ajout_63348")}),s&&(0,i.jsx)(Vw,{organizationId:n,subtitle:e.modalSubtitle,tagsIds:e.tags.map(({id:e})=>e),onClose:()=>{o(!1)},onSave:async t=>{await e.associateTags(t),e.reload(),o(!1)}})]}):(0,i.jsx)(Sw,{title:t("tags_79499"),children:so(e.tags)?(0,i.jsx)(Ba,{gap:"2",wrap:"wrap",children:e.tags.map(e=>(0,i.jsx)(rc,{children:e.name},e.id))}):(0,i.jsx)(Ar,{color:"gray500",textAlign:"center",width:1,children:t("aucun_tag_ajout_63348")})})},Ww=e=>{const{translate:t,params:{organizationId:n,eventId:s,delegationId:o}}=vl(),{hasFeature:r}=TI(),a=Zn(Jc),l=Zn(Fw),{isOrganizationAdmin:d}=TI(),{mutate:c}=Oo(),u=(0,L.useMemo)(()=>mg({organizationId:n,eventId:s,delegationId:o,formId:e.delegation?.form.id}),[e.delegation]),h=(0,L.useMemo)(()=>hg(n,hs.DELEGATION({organizationId:n,eventId:s,delegationId:o})),[e.delegation]),g=(0,L.useMemo)(()=>m(e.delegation.description)?l.renderText(e.delegation.description,{delegation:{...e.delegation,formLink:u}}):"",[e.delegation]),p=(0,L.useMemo)(()=>e.delegation.usedCustomFields.concat(e.customFields),[e.customFields,e.delegation]),f=(e,t)=>(0,i.jsxs)(Ba,{children:[(0,i.jsx)(Ar,{textAlign:"start",children:e}),(0,i.jsx)(Ar,{css:{borderBlockEnd:"2px dotted $gray500",flex:"1",marginBlockEnd:"$1"}}),(0,i.jsx)(Ar,{color:"gray900",css:{fontSize:"$textMd"},textAlign:"end",children:t})]});return(0,i.jsx)(aj,{children:(0,i.jsxs)(Ba,{direction:"column",gap:"4",width:1,children:[(0,i.jsxs)(Ba,{gap:"6",children:[(0,i.jsx)(Ba,{css:{flex:"3",height:"100%"},direction:"column",gap:"6",children:(0,i.jsx)(Sw,{css:{flex:"1 1"},title:t("limite_de_membr_42978"),children:(0,i.jsxs)(Ba,{css:{justifyContent:"space-between"},direction:"column",height:"100%",children:[(0,i.jsx)(Ar,{css:{margin:"auto"},children:(0,i.jsx)(Rw,{count:e.delegation.numberOfResources,total:e.delegation.maxResources??1/0})}),(0,i.jsx)(Ba,{direction:"column",gap:"4",children:r(Be.Accreditation)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ar,{color:"gray700",css:{fontSize:"$textXs",fontWeight:600,fontFamily:"Open Sans",lineHeight:"18px",textTransform:"uppercase"},children:t("dont_76603")}),(0,i.jsxs)(Ba,{color:"gray500",css:{fontSize:"$textSm",fontWeight:"$medium",lineHeight:"20px",justifyContent:"space-between"},direction:"column",gap:"2",children:[f(t("membres_accr_di_73664"),e.delegation.numberOfMembersAccredited),f(t("membres_en_atte_57336"),e.delegation.numberOfMembersWaitingAccreditation),f(t("membres_refus_31757"),e.delegation.numberOfMembersRefusedAccreditation)]})]})})]})})}),(0,i.jsx)(Ba,{css:{flex:"6"},direction:"column",gap:"6",children:(0,i.jsx)(Sw,{title:t("param_tres_78420"),children:(0,i.jsxs)(Ba,{direction:"column",gap:"4",width:1,children:[(0,i.jsxs)(Ba,{gap:"3",justify:"between",children:[(0,i.jsx)(Ar,{color:"gray500",children:t("cat_gorie_00291")}),(0,i.jsx)(Ar,{children:(0,i.jsx)(Zc,{to:hs.DELEGATION_CATEGORY({organizationId:n,eventId:s,delegationCategoryId:e.delegation.delegationCategory.id}),children:e.delegation.delegationCategory.name})})]}),(0,i.jsx)(Xu,{direction:"horizontal"}),d&&e.delegation.parent&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ba,{gap:"3",justify:"between",children:[(0,i.jsx)(Ar,{color:"gray500",children:t("d_l_gation_pare_68507")}),(0,i.jsx)(Ba,{align:"center",css:{color:"$primary500",fontWeight:"$medium","&:hover":{textDecoration:"underline"}},gap:"2",children:(0,i.jsx)(el,{to:hs.DELEGATION({organizationId:n,delegationId:e.delegation.parent.id}),children:(0,i.jsx)(rc,{color:"white",cursor:"pointer",size:"md",children:e.delegation.parent.name},e.delegation.parent.id)})})]}),(0,i.jsx)(Xu,{direction:"horizontal"})]}),(0,i.jsxs)(Ba,{gap:"3",justify:"between",children:[(0,i.jsx)(Ar,{color:"gray500",children:t("status_06428")}),(0,i.jsx)(Ar,{color:"gray800",children:(0,i.jsx)(rc,{color:"success",children:t(e.delegation.state)})})]}),(0,i.jsx)(Xu,{direction:"horizontal"}),(0,i.jsxs)(Ba,{gap:"3",justify:"between",children:[(0,i.jsx)(Ar,{color:"gray500",children:t("date_limite_d_i_79779")}),(0,i.jsx)(Ar,{color:"gray800",children:e.delegation.deadlineDate?a.toLocaleString(e.delegation.deadlineDate,eo.DateOnly.MonthLong):"-"})]}),(0,i.jsx)(Xu,{direction:"horizontal"}),(0,i.jsxs)(Ba,{gap:"3",justify:"between",children:[(0,i.jsx)(Ar,{color:"gray500",children:t("Form")}),(0,i.jsx)(Zc,{css:{color:"$primary500"},to:u,children:e.delegation.form.name})]}),(0,i.jsx)(Xu,{direction:"horizontal"}),(0,i.jsxs)(Ba,{gap:"3",justify:"between",children:[(0,i.jsx)(Ar,{color:"gray500",children:t("DelegationSpaceLink")}),(0,i.jsx)(Zc,{css:{color:"$primary500"},to:h,children:t("portail_d_l_gat_06817")})]})]})})})]}),so(p)&&(0,i.jsx)(Sw,{title:t("champs_de_formu_64126"),children:(0,i.jsx)(Ba,{direction:"column",gap:"4",width:1,children:p.map((t,n)=>(0,i.jsxs)(L.Fragment,{children:[0!==n&&(0,i.jsx)(Xu,{direction:"horizontal"}),(0,i.jsxs)(Ba,{align:"center",gap:"3",justify:"between",children:[(0,i.jsx)(Ar,{color:"gray500",css:{flex:"1"},children:t.name}),(0,i.jsx)(Ba,{justify:"end",width:300,children:(0,i.jsx)(kw,{field:t,fields:e.delegation.fields})})]})]},t.slug))})}),(0,i.jsxs)(Ba,{gap:"6",children:[(0,i.jsxs)(Ba,{direction:"column",gap:"4",width:1,children:[(0,i.jsx)(Sw,{title:t("reponsable_82458_plural"),children:so(e.delegation.leaders)?e.delegation.leaders.map((e,t)=>(0,i.jsxs)(L.Fragment,{children:[0!==t&&(0,i.jsx)(Ju,{height:"4"}),(0,i.jsx)(xj,{userInfo:e})]},e.id)):(0,i.jsx)(Ar,{color:"gray500",textAlign:"center",width:1,children:t("aucun_reponsabl_38504")})}),(0,i.jsx)(Uw,{associateTags:e=>c({organizationId:n,eventId:s,massEdit:{reset:!1,selecteds:{ids:[o]},slug:Ce.Tag,strategy:it.Replace,value:e}}),modalSubtitle:t("ajouter_des_tag_35833"),reload:e.reload,tags:e.delegation.tags})]}),(0,i.jsxs)(Ba,{direction:"column",gap:"4",width:1,children:[(0,i.jsx)(Mw,{description:g}),(0,i.jsx)(Nw,{privateNote:e.delegation.privateNote})]})]})]})})},Gw=()=>{const{params:{organizationId:e,delegationId:t}}=vl(),{data:n,loader:s,reload:o}=Qn("query DelegationDashboard($organizationId: OrganizationId!, $delegationId: DelegationId!) {\n organization(id: $organizationId) {\n customFields(variety: Delegation, privacy: Private) {\n nodes {\n ...CustomFieldWithCondition\n }\n }\n\n delegation(id: $delegationId) {\n id\n name\n description\n deadlineDate\n privateNote\n state\n numberOfResources\n maxResources\n numberOfMembersAccredited\n numberOfMembersWaitingAccreditation\n numberOfMembersRefusedAccreditation\n fields\n\n delegationCategory {\n id\n name\n }\n\n parent {\n id\n name\n }\n\n form {\n id\n name\n }\n\n leaders {\n id\n email\n name\n\n picture {\n url\n }\n }\n\n tags {\n id\n name\n }\n\n usedCustomFields {\n ...CustomFieldWithCondition\n }\n }\n }\n}\n",{organizationId:e,delegationId:t},[Vs.CustomFieldWithConditionFragment]);return s||(0,i.jsx)(Ww,{customFields:n.organization.customFields.nodes,delegation:n.organization.delegation,reload:o})},Hw=e=>{switch(e){case qw.Event:return{color:"success",leftIcon:"calendar"};case qw.ParentDelegation:return{color:"pink",leftIcon:"people-group"};default:return ll()}};var qw;!function(e){e.Event="event",e.ParentDelegation="parent-delegation"}(qw||(qw={}));const Kw=({state:e,userInfo:t,onClick:n})=>{const s=Xn(),o=m(t.name);return(0,i.jsxs)(Ba,{align:"center",css:{borderBottom:"1px solid $gray200",cursor:"pointer",py:"$3",userSelect:"none",width:"100%","&:last-child":{border:"none"}},onClick:n,children:[(0,i.jsx)(fc,{shouldPreventDefault:!1,state:e,onClick:td.A}),(0,i.jsx)(Ya,{width:"3"}),(0,i.jsx)(sp,{email:t.email,image:t.picture?.url,name:t.name,size:40}),(0,i.jsx)(Ya,{width:"4"}),(0,i.jsxs)(Ba,{css:{flex:"1",overflow:"hidden"},direction:"column",children:[(0,i.jsx)(Ar,{ellipsis:!0,color:"gray700",children:o?t.name:t.email}),o&&(0,i.jsx)(Ar,{ellipsis:!0,color:"gray500",children:t.email})]}),t.source&&(0,i.jsx)(Ar,{children:(0,i.jsx)(rc,{...Hw(t.source),leftIconStyle:"solid",children:t.source===qw.Event?s("_v_nement_22345"):s("d_l_gation_pare_68507")})})]})},Yw=({availableMembers:e,select:t,usersInfosIds:n})=>(0,i.jsx)(i.Fragment,{children:e.map(e=>{const s=n.includes(e.id)?"checked":"unchecked";return(0,i.jsx)(Kw,{state:s,userInfo:e,onClick:()=>{t(e.id)}},e.id)})}),Zw=({delegationId:e,nameOrEmail:t,organizationId:n,usersInfosIds:s,select:o})=>{const{data:r,loader:a}=Ea({organizationId:n,excludedDelegationId:e,name:m(t)?t:null});return a||(0,i.jsx)(Yw,{availableMembers:r.organization.usersInfos.nodes,select:o,usersInfosIds:s})},Xw=({delegationId:e,eventId:t,nameOrEmail:n,usersInfosIds:s,select:o})=>{const{data:r,loader:a}=Qn("query EventUsersInfos($eventId: EventId!, $delegationId: DelegationId!, $name: String) {\n event(id: $eventId) {\n delegation(id: $delegationId) {\n parentUsersInfos(name: $name) {\n ...ExistingVolunteer\n }\n }\n\n volunteersRegistrations(excludeDelegationMembers: true, name: $name, limit: 25) {\n nodes {\n userInfo {\n ...ExistingVolunteer\n }\n }\n }\n }\n}\n",{eventId:t,delegationId:e,name:m(n)?n:null},[Vs.ExistingVolunteerFragment]);const l=(0,L.useMemo)(()=>{if(r.event){const e=r.event.volunteersRegistrations.nodes.map(e=>({...e.userInfo,source:qw.Event})),t=e.map(({id:e})=>e),n=r.event.delegation.parentUsersInfos.flatMap(e=>t.includes(e.id)?[]:[{...e,source:qw.ParentDelegation}]);return e.concat(n)}return[]},[r.event]);return a||(0,i.jsx)(Yw,{availableMembers:l,select:o,usersInfosIds:s})},Jw=({delegationId:e,eventId:t,organizationId:n,onClose:s,reload:o})=>{const r=Xn(),a=Zn(Vj),[l,d,c]=Wc(""),{mutate:u}=er(),{mutate:h}=Oa();return(0,i.jsx)(oC,{buttonText:r("ajouter_un_memb_33261"),icon:"sliders",initialValues:{usersInfosIds:[]},schema:a.adminAddSchema(),size:"md",subtitle:r(t?"ajouter_un_memb_95658":"ajouter_un_memb_89696"),title:r("add_member_to_delegation"),onClose:s,onSubmit:async i=>{t?await u({eventId:t,delegationId:e,selecteds:{ids:i.usersInfosIds}}):await h({organizationId:n,delegationId:e,selecteds:{ids:i.usersInfosIds}}),s(),o()},children:({form:s,values:o})=>{const a=e=>{s.change("usersInfosIds",ao(o.usersInfosIds,e))};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Bl,{icon:"magnifying-glass",placeholder:r("rechercher_un_m_05904"),value:l,onChange:c}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(jl,{}),(0,i.jsx)(Ba,{css:{flex:"1",overflowY:"auto"},direction:"column",children:t?(0,i.jsx)(Xw,{delegationId:e,eventId:t,nameOrEmail:d,select:a,usersInfosIds:o.usersInfosIds}):(0,i.jsx)(Zw,{delegationId:e,nameOrEmail:d,organizationId:n,select:a,usersInfosIds:o.usersInfosIds})})]})}})},Qw=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=vl(),{showNotification:o}=Ob(),{mutate:r}=sa();return(0,i.jsx)(cA,{buttonText:t("supprimer_43083"),subtext:t("_tes_vous_s_r_d_66412"),text:t("suppression_de_73669",e.delegation.name),onClose:e.onClose,onDelete:async()=>{await r({organizationId:n,eventId:s,selecteds:{ids:[e.delegation.id]}}),o(t("la_d_l_gation_31201",e.delegation.name)),e.onSuccess()}})},eS=({delegation:e,reload:t})=>{const{history:n,translate:s,params:{organizationId:o,eventId:r,delegationId:a}}=vl(),{isOrganizationAdmin:l}=TI(),{isEventAdmin:d,hasPermission:c}=wb(),{mutate:u}=na(),{mutate:h}=Xo(),{mutate:m}=Oo(),[g,p]=(0,L.useState)(!1),[f,_]=(0,L.useState)(!1),x=l||d,I=l||c?.(Hb.MEMBER_ACCREDIT),v=l||c?.(Hb.DELEGATION_EDIT),b=e.lockedAt?.isValid;return(0,i.jsxs)(lj,{align:"center",gap:"3",hideBorder:!0,children:[(0,i.jsx)(Sj,{returnPathFallback:hs.DELEGATIONS({organizationId:o,eventId:r})}),(0,i.jsxs)(Ba,{align:"center",css:{flex:"1"},gap:"2",children:[(0,i.jsx)(Ar,{font:"gray900 displayXs medium",children:e.name}),b&&(0,i.jsxs)(km,{children:[(0,i.jsx)(Sm,{children:(0,i.jsx)(Ar,{color:"error600",fontSize:"textMd",children:(0,i.jsx)(nl,{icon:"lock-keyhole"})})}),(0,i.jsx)(wm,{placement:"top",children:s("cette_d_l_gatio_29556")})]})]}),x&&(0,i.jsxs)(Wd,{children:[(0,i.jsx)(Xd,{children:(0,i.jsx)(zl,{color:"white",disabled:e.numberOfResources>=(e.maxResources??1/0),children:s("ajouter_un_memb_33261")})}),(0,i.jsxs)(Zd,{placement:"bottom-end",children:[(0,i.jsx)(Kd,{icon:"user-plus",onClick:()=>{n.push(QI.CREATE({organizationId:o,eventId:r,delegationId:a}))},children:s("ajouter_un_nouv_29283")}),(0,i.jsx)(Kd,{icon:"user-group",onClick:e=>{Vd(e.target),_(!0)},children:s("ajouter_des_mem_06922")})]})]}),v&&(0,i.jsx)(zl,{to:_i(hs.DELEGATION({organizationId:o,eventId:r,delegationId:e.id})),children:s("_diter_la_d_l_g_30300")}),(I||v)&&(0,i.jsxs)(Wd,{children:[(0,i.jsx)(Xd,{children:(0,i.jsx)(zl,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Zd,{placement:"bottom-end",children:[I&&r&&(0,i.jsx)(Kd,{icon:"check",onClick:async()=>{await h({eventId:r,delegationId:e.id}),t()},children:s("valider_les_acc_80801")}),v?b?(0,i.jsx)(Kd,{icon:"lock-keyhole-open",onClick:async()=>{await m({organizationId:o,eventId:r,massEdit:{reset:!1,selecteds:{ids:[e.id]},slug:Ce.IsLocked,strategy:it.Replace,value:!1}}),t()},children:s("d_verrouiller_67042")}):(0,i.jsx)(Kd,{icon:"lock-keyhole",onClick:async()=>{await m({organizationId:o,eventId:r,massEdit:{reset:!1,selecteds:{ids:[e.id]},slug:Ce.IsLocked,strategy:it.Replace,value:!0}}),t()},children:s("verrouiller_24528")}):null,v&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Kd,{icon:"clone",onClick:async()=>{const{delegationDuplicate:t}=await u({organizationId:o,eventId:r,delegationId:e.id});n.push(_i(hs.DELEGATION({organizationId:o,eventId:r,delegationId:t.id})))},children:s("dupliquer_28256")}),(0,i.jsx)(Xu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Kd,{color:"red",icon:"trash-can",onClick:()=>{p(!0)},children:s("supprimer_43083")})]})]})]}),g&&(0,i.jsx)(Qw,{delegation:e,onClose:()=>p(!1),onSuccess:()=>n.replace(r?hs.DELEGATIONS({organizationId:o,eventId:r}):Ps.COMMUNITY_DELEGATIONS(o))}),f&&(0,i.jsx)(Jw,{delegationId:e.id,eventId:r,organizationId:o,reload:t,onClose:()=>{_(!1)}})]})};var tS=n(6349);const nS=e=>({title:{display:!0,font:{weight:500},padding:{bottom:30},text:e}}),iS=()=>({border:{display:!1},grid:{color:xr.colors.gray100.value}}),sS=({datasets:e,labels:t,options:n})=>{const s=(0,L.useMemo)(()=>(0,Ha.A)("chart-"),[]),o=(0,L.useRef)(null),r={animation:!1,datasets:{bar:{borderRadius:8}},maintainAspectRatio:!1,plugins:{legend:{align:"end",labels:{useBorderRadius:!0,borderRadius:5,boxWidth:10,boxHeight:10}}},scales:{x:{grid:{display:!1}},y:iS()}};return(0,L.useEffect)(()=>{o.current&&o.current.destroy(),o.current=new tS.Ay(document.getElementById(s),{type:"bar",options:(0,Xa.A)(r,n),data:{labels:t,datasets:e}})},[e,t,n]),(0,i.jsx)(Ar,{height:1,width:1,children:(0,i.jsx)("canvas",{id:s})})},oS=e=>{const t=Xn(),n=Zn(Jc),s=(0,L.useMemo)(()=>Nh(e.slots),[e.slots]),o=(0,L.useMemo)(()=>e.accreditation.hasSlots?s.map(e=>Dh(n,e,"",{accreditation:{includeName:!1}})):[e.accreditation.name],[s,e.accreditation]),r=(0,L.useMemo)(()=>{const n=s.some(e=>"number"==typeof e.maxResources),i=s.some(e=>"number"==typeof e.delegationsTotalResources&&e.delegationsTotalResources>0);return(0,Za.A)([e.accreditation.willAutoAccredit?null:{label:t("souhait_es_78101"),data:s.map(e=>e.wishedResources),backgroundColor:n?s.map(e=>e.assignedResources+e.wishedResources<=(e.maxResources??1/0)?xr.colors.primary400.value:ec(xr.colors.primary400.value,.5)):xr.colors.primary400.value},{label:t("affect_es_00048"),data:s.map(e=>e.assignedResources),backgroundColor:n?s.map(e=>e.assignedResources<=(e.maxResources??1/0)?xr.colors.primary500.value:ec(xr.colors.error500.value,.7)):xr.colors.primary500.value},{label:t("scann_es_13169"),data:s.map(e=>e.scannedResources),backgroundColor:xr.colors.primary900.value},n?{label:t("maximum_56225"),data:s.map(e=>e.maxResources??1/0),backgroundColor:xr.colors.gray200.value}:null,i?{label:t("total_attribu_e_97130"),data:s.map(e=>e.delegationsTotalResources??0),backgroundColor:xr.colors.gray400.value}:null])},[s]);return(0,i.jsx)(sS,{datasets:r,labels:o,options:{scales:{y:{...iS(),ticks:{precision:0},...nS(t("nb_d_accr_dita_23359"))},x:{grid:{display:!1},...nS(t(e.accreditation.hasSlots?"slots_05517":"Accreditation"))}}}})},rS=e=>{const t=(0,L.useMemo)(()=>e.event.delegation.accreditationsSlots.filter(t=>t.accreditationId===e.accreditation.id).map(e=>({maxResources:e.maxResources,assignedResources:e.assignedResources,scannedResources:e.scannedResources,wishedResources:e.wishedResources,name:e.accreditationSlot.name,date:e.accreditationSlot.date})),[e.accreditation,e.event]);return(0,i.jsx)(Sw,{title:e.accreditation.name,children:(0,i.jsx)(Ar,{height:380,width:1,children:(0,i.jsx)(oS,{accreditation:e.accreditation,slots:t})})})},aS=e=>{const t=(0,L.useMemo)(()=>DC((0,xh.A)(e.event.delegation.accreditations.map(e=>{const t=e.willAutoAccredit||e.accreditation.willAutoAccredit;return{...e.accreditation,willAutoAccredit:t}}),e=>e.id)),[e.event]);return(0,i.jsx)(Ba,{direction:"column",gap:"4",children:so(t)?t.map(t=>(0,i.jsx)(rS,{accreditation:t,event:e.event},t.id)):(0,i.jsx)(vw,{})})},lS=()=>{const{params:{eventId:e,delegationId:t}}=vl(),{data:n,loader:s}=Qn("query DelegationReporting($eventId: EventId!, $delegationId: DelegationId!) {\n event(id: $eventId) {\n delegation(id: $delegationId) {\n accreditations {\n accreditationId\n willAutoAccredit\n\n accreditation {\n id\n name\n accreditationCategoryName\n hasSlots\n index\n willAutoAccredit\n }\n }\n\n accreditationsSlots {\n accreditationId\n maxResources\n assignedResources\n scannedResources\n wishedResources\n\n accreditationSlot {\n name\n date\n }\n }\n }\n }\n}\n",{eventId:e,delegationId:t},[]);return s||(0,i.jsx)(aS,{event:n.event})},dS=e=>{const{translate:t,params:{organizationId:n,eventId:s,delegationId:o}}=vl(),{hasFeature:r,isOrganizationAdmin:a}=TI(),{isEventAdmin:l,isEventReader:d}=wb(),c=a||l,u=(0,L.useMemo)(()=>e.organization.allowDelegationSpaceDownload||so(e.organization.delegation.customDocuments??[]),[e.organization]),h=(0,L.useMemo)(()=>(e.organization.delegationsSpaceCustomBadges??[]).concat(e.organization.delegation.customDocuments.map(e=>e.slug)??[]),[e.organization]),m=(0,L.useMemo)(()=>e.organization.delegation.event?.customDocuments??[],[e.organization]),g=e=>({organizationId:e?":organizationId":n,eventId:s?e?":eventId":s:void 0,delegationId:e?":delegationId":o});return Md(e.organization.delegation.name),(0,i.jsxs)(dj,{children:[(0,i.jsx)(eS,{delegation:e.organization.delegation,reload:e.reload}),(0,i.jsxs)(mj,{css:{flex:"1"},children:[(0,i.jsxs)(uj,{css:{px:"$7"},children:[(0,i.jsx)(cj,{path:hs.DELEGATION_DASHBOARD(g(!1)),children:t("tableau_de_bord_24627")}),(0,i.jsx)(cj,{path:hs.DELEGATION_MEMBERS(g(!1)),children:t("membres_125561",e.organization.delegation.numberOfResources)}),s&&r(Be.Accreditation)&&(0,i.jsx)(cj,{path:hs.DELEGATION_ACCREDITATIONS(g(!1)),children:t("accr_ditations_39450")}),s&&r(Be.Accreditation)&&(0,i.jsx)(cj,{path:hs.DELEGATION_REPORTING(g(!1)),children:"Reporting"}),s&&u&&(0,i.jsx)(cj,{path:hs.DELEGATION_DOCUMENTS(g(!1)),children:t("Documents")})]}),(0,i.jsx)(hj,{path:hs.DELEGATION_DASHBOARD(g(!0)),children:(0,i.jsx)(Gw,{})}),(0,i.jsx)(hj,{path:hs.DELEGATION_MEMBERS(g(!0)),children:s?(0,i.jsx)(aj,{children:(0,i.jsx)(YA,{campaigns:e.organization.delegation.campaigns,canAccredit:c,canClickMemberName:!0,canDeleteMembers:c,canEditColumns:!0,canEditMembers:c,columns:e.organization.delegation.columns,customBadges:e.organization.delegationsSpaceCustomBadges,customFieldsPrivacy:Ie.All,deleteFromEvent:!1,getEditPath:t=>Ps.EDIT_USER_DELEGATION_FORM(n,s,o,t.userInfo.id,e.organization.delegation.formId),onlyVisibleAccreditationsSlots:!d,showAccreditationsEdit:c,showAccreditationsValidate:c,showDeleteFromEvent:c,showDocumentsDownload:!0,showEditMode:c})}):(0,i.jsx)(aj,{children:(0,i.jsx)(ew,{campaigns:e.organization.delegation.campaigns,canClickMemberName:!0,canDeleteMembers:c,canEditColumns:!0,canEditMembers:c,columns:e.organization.delegation.columns,customBadges:e.organization.delegationsSpaceCustomBadges,getEditPath:e=>Ps.COMMUNITY_EDIT_USER_DELEGATION(n,o,e.id),isOrganizationAdmin:c,showDocumentsDownload:!0})})}),(0,i.jsx)(hj,{path:hs.DELEGATION_ACCREDITATIONS(g(!0)),children:(0,i.jsx)(aj,{children:(0,i.jsx)(bw,{isEventAdmin:l,onlyVisible:!d})})}),(0,i.jsx)(hj,{path:hs.DELEGATION_REPORTING(g(!0)),children:(0,i.jsx)(aj,{children:(0,i.jsx)(lS,{})})}),(0,i.jsx)(hj,{path:hs.DELEGATION_DOCUMENTS(g(!0)),children:(0,i.jsx)(aj,{children:(0,i.jsx)(Cw,{customDocuments:m,delegationsSpaceCustomBadges:h})})})]})]})},cS=()=>{const{params:{organizationId:e,eventId:t,delegationId:n}}=vl(),{data:s,loader:o,reload:r}=Qn("query Delegation($organizationId: OrganizationId!, $delegationId: DelegationId!) {\n organization(id: $organizationId) {\n ...OrganizationCustomFields\n\n allowDelegationSpaceDownload\n delegationsSpaceCustomBadges\n\n delegation(id: $delegationId) {\n id\n name\n formId\n numberOfResources\n maxResources\n columns\n parentId\n lockedAt\n\n campaigns {\n id\n name\n }\n\n customDocuments {\n slug\n name\n }\n\n event {\n customDocuments {\n slug\n name\n }\n }\n }\n }\n}\n",{organizationId:e,delegationId:n},[Vs.OrganizationCustomFieldsFragment]);return o||(0,i.jsxs)(Sr.dO,{children:[(0,i.jsx)(Sr.qh,{exact:!0,path:hs.DELEGATION({organizationId:":organizationId",eventId:t?":eventId":void 0,delegationId:":delegationId"}),children:(0,i.jsx)(oi,{path:hs.DELEGATION_DASHBOARD({organizationId:e,eventId:t,delegationId:n}),replace:!0})}),(0,i.jsx)(Sr.qh,{children:(0,i.jsx)(dS,{organization:s.organization,reload:r})})]})},uS=({backgroundColor:e,button:t,iconColor:n,value:s,icon:o,text:r})=>(0,i.jsxs)(Ba,{css:{backgroundColor:e??"$white",bd:!0,flex:"1",overflow:"hidden"},direction:"column",children:[(0,i.jsxs)(Ba,{css:{borderBottom:t?"1px solid $gray200":"none",padding:"$6"},direction:"column",children:[o&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(sC,{color:n??"primary",icon:o}),(0,i.jsx)(Ya,{height:"6"})]}),(0,i.jsx)(Ar,{color:"gray500",children:r}),(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(Ar,{color:"gray900",fontSize:"displayMd",fontWeight:"semiBold",children:s})]}),t&&(0,i.jsx)(Ba,{css:{background:"$gray50",padding:"$4 $6"},gap:"4",justify:"end",children:t})]}),hS=e=>{const t=Xn(),[n,s,o]=Wc(""),{data:r,loader:a}=Qn("query CollaboratorsVolunteers($organizationId: OrganizationId!, $eventId: EventId!, $name: String) {\n event(id: $eventId) {\n collaborators(name: $name) {\n userInfo(organizationId: $organizationId) {\n ...LeaderUserInfo\n }\n }\n\n volunteersRegistrations(name: $name, limit: 50) {\n nodes {\n userInfo {\n ...LeaderUserInfo\n }\n }\n }\n }\n}\n",{organizationId:e.organizationId,eventId:e.eventId,name:m(s)?s:void 0},[Vs.LeaderUserInfoFragment]);const[l,d]=(0,L.useState)(!1),[c,u]=(0,L.useState)(null),[h,g]=(0,L.useState)(null),{styles:p,attributes:f,update:_}=(0,Yd.E)(c,h,{placement:"bottom-start",modifiers:[{name:"offset",options:{offset:[0,8]}}]}),x=(0,L.useMemo)(()=>c?.getBoundingClientRect().width??100,[c]),I=(0,L.useMemo)(()=>{const t=t=>void 0!==e.currentLeaders.find(e=>e.userInfo.id===t),n=(r.event?.collaborators??[]).map(({userInfo:e})=>e.id);return(r.event?.collaborators??[]).map(({userInfo:e})=>({...e,isAdmin:!0,isDisabled:t(e.id)})).concat((r.event?.volunteersRegistrations.nodes??[]).filter(({userInfo:e})=>!n.includes(e.id)).map(({userInfo:e})=>({...e,isAdmin:!1,isDisabled:t(e.id)})))},[r.event,e.currentLeaders]);return(0,L.useEffect)(()=>{_?.()},[_,l,c,I]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{ref:u,onClick:e=>{Dl(e),d(!l)},children:(0,i.jsx)(Bl,{icon:"magnifying-glass",placeholder:t("rechercher_un_m_17775"),value:n,onChange:o})}),(0,i.jsx)(Ba,{ref:g,css:{background:"white",border:"1px solid $gray100",borderRadius:"$2",boxShadow:"$md",display:l?"flex":"none",maxHeight:"360px",overflowY:"auto",py:"$2",zIndex:1e3,...p.popper},direction:"column",width:x,onClick:e=>{Dl(e)},...f.poppeer,children:a||I.map(n=>(0,i.jsxs)(Ba,{align:"center",css:{cursor:n.isDisabled?"initial":"pointer",padding:"10px $4",userSelect:"none","&:hover":{background:n.isDisabled?"inherit":"$primary100"}},gap:"3",children:[(0,i.jsx)(xj,{badge:n.isAdmin&&(0,i.jsx)(rc,{color:"primary",children:t("administrateur_38490")}),disabled:n.isDisabled,userInfo:n}),!n.isDisabled&&(0,i.jsx)(zl,{color:"white",leftIcon:"plus",size:"sm",onClick:()=>{e.onAdd(n)}})]},n.id))})]})},mS=e=>{const t=Xn();return(0,i.jsxs)(Ba,{align:"center",gap:"5",children:[(0,i.jsx)(Ar,{css:{flex:1,maxWidth:"calc(50% - 32px)"},children:(0,i.jsx)(xj,{userInfo:e.leader.userInfo})}),(0,i.jsx)(Ar,{css:{flex:1,maxWidth:"calc(50% - 32px)"},children:(0,i.jsx)($u,{shouldParseAsInt:!0,value:e.leader.role.id,onChange:t=>{e.onRoleChange(t)},children:e.roles.map((e,n)=>(0,i.jsx)("option",{value:e.id,children:t(e.name)},n))})}),(0,i.jsx)(Ar,{color:"gray500",css:{cursor:"pointer",width:"$6",padding:"$1"},onClick:e.onDelete,children:(0,i.jsx)(nl,{icon:"trash-can"})})]})},gS=e=>{const t=Xn(),[n,s]=(0,L.useState)(e.currentLeaders),o=e.roles[0];return(0,i.jsxs)(au,{size:"lg",onClose:e.onClose,children:[(0,i.jsx)(Ba,{justify:"center",children:(0,i.jsx)(sC,{color:"primary",icon:"user-gear"})}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(Ar,{color:"gray900",fontSize:"textLg",fontWeight:"medium",textAlign:"center",children:t("modification_de_24714")}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ar,{color:"gray500",textAlign:"center",children:t("les_responsable_92946")}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(hS,{currentLeaders:n,eventId:e.eventId,organizationId:e.organizationId,onAdd:e=>{s(n.concat([{userInfo:e,role:o}]))}}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(Ba,{css:{flex:"1",overflowY:"auto"},direction:"column",gap:"4",children:n.map((t,o)=>(0,i.jsx)(mS,{leader:t,roles:e.roles,onDelete:()=>{s((0,hc.A)(n,t))},onRoleChange:t=>{s((0,xu.jM)(n=>{n[o].role=e.roles.find(e=>e.id===t)}))}},t.userInfo.id))}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsxs)(Ba,{gap:"3",justify:"end",children:[(0,i.jsx)(zl,{onClick:()=>{e.onSave(n.map(e=>({userInfoId:e.userInfo.id,roleId:e.role.id})))},children:t("enregistrer_06519")}),(0,i.jsx)(zl,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},pS=({leaders:e})=>{const t=Xn();return so(e)?(0,i.jsx)(i.Fragment,{children:e.map((e,n)=>(0,i.jsxs)(L.Fragment,{children:[0!==n&&(0,i.jsx)(Ju,{height:"4"}),(0,i.jsx)(xj,{badge:(0,i.jsx)(rc,{color:"gray",children:t(e.role.name)}),userInfo:e.userInfo})]},e.userInfo.id))}):(0,i.jsx)(Ar,{color:"gray500",textAlign:"center",width:1,children:t("aucun_reponsabl_38504")})},fS=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=vl(),{isEventAdmin:o}=wb(),[r,a]=(0,L.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Sw,{rightIcon:o?"pen":void 0,rightIconClick:()=>{a(!0)},title:t("reponsable_82458_plural"),children:(0,i.jsx)(pS,{leaders:e.leaders})}),o&&r&&(0,i.jsx)(gS,{currentLeaders:e.leaders,eventId:s,organizationId:n,roles:e.roles,onClose:()=>{a(!1)},onSave:async t=>{await e.onSave(t),e.reload()}})]})},_S=e=>{const t=Xn();return"onSave"in e?(0,i.jsx)(fS,{...e}):(0,i.jsx)(Sw,{title:t("reponsable_82458_plural"),children:(0,i.jsx)(pS,{leaders:e.leaders})})},xS=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:s,delegationCategoryId:o}}=vl(),[r,a,l]=Wc(""),[d,c]=(0,L.useState)(0),{data:u,isLoading:h}=Qn("query DelegationCategoryDelegations(\n $organizationId: OrganizationId!\n $level: OrganizationEventLevel!\n $eventId: EventId\n $delegationCategoryId: DelegationsCategoryId!\n $name: String\n $offset: Int\n) {\n organization(id: $organizationId) {\n delegations(\n level: $level\n eventId: $eventId\n name: $name\n delegationsCategoriesIds: [$delegationCategoryId]\n limit: 25\n offset: $offset\n ) {\n nodes {\n id\n name\n state\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{organizationId:n,eventId:s,level:s?ot.Event:ot.Organization,delegationCategoryId:o,name:m(a)?a:void 0,offset:d},[]);const{numberOfPages:g,totalCount:p}=Su(u.organization?.delegations);return(0,i.jsx)(Lc,{filters:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Ar,{width:320,children:(0,i.jsx)(Bl,{icon:"magnifying-glass",placeholder:t("rechercher_une_31213"),value:r,onChange:l})})}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Gc,{children:t("nom_de_la_d_l_g_28087")}),(0,i.jsx)(Gc,{children:t("status_06428")})]}),numberOfPages:g,offset:d,rows:h?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Hc,{bx:!0}),(0,i.jsx)(Hc,{bx:!0}),(0,i.jsx)(Hc,{bx:!0})]}):u.organization.delegations.nodes.map(o=>(0,i.jsxs)(Mc,{css:{cursor:"pointer"},onClick:()=>{e.push(hs.DELEGATION({organizationId:n,eventId:s,delegationId:o.id}))},children:[(0,i.jsx)(Oc,{children:(0,i.jsx)(Ar,{font:"gray900 textSm medium",children:o.name})}),(0,i.jsx)(Oc,{children:(0,i.jsx)(rc,{...Bj(o.state),children:t(o.state)})})]},o.id)),setOffset:c,title:t("liste_des_d_l_g_86270"),totalCount:p})},IS=e=>{const{translate:t,params:{organizationId:n,eventId:s,delegationCategoryId:o}}=vl(),{roles:r}=TI(),{mutate:a}=function(e={}){return ei("mutation DelegationsCategoriesMassLeadersEdit(\n $organizationId: OrganizationId!\n $eventId: EventId\n $massLeaders: MassLeadersInput!\n) {\n delegationsCategoriesMassLeadersEdit(\n organizationId: $organizationId\n eventId: $eventId\n massLeaders: $massLeaders\n )\n}\n",e)}();return(0,i.jsx)(aj,{children:(0,i.jsxs)(Ba,{direction:"column",gap:"6",children:[(0,i.jsxs)(Ba,{gap:"6",width:1,children:[(0,i.jsx)(uS,{text:t("nombre_de_d_l_g_45708"),value:e.delegationCategory.numberOfDelegations}),(0,i.jsx)(uS,{text:t("number_of_membe_24698"),value:e.delegationCategory.numberOfResources})]}),(0,i.jsx)(Ba,{children:(0,i.jsx)(Ar,{css:{flex:"1"},children:(0,i.jsx)(xS,{})})}),(0,i.jsx)(Ba,{children:(0,i.jsx)(_S,{leaders:e.delegationCategory.leaders,reload:e.reload,roles:r.delegationCategoryRoles,onSave:e=>a({organizationId:n,eventId:s,massLeaders:{leaders:e,selecteds:{ids:[o]},strategy:it.Replace}})})})]})})},vS=e=>{const t=Xn(),{mutate:n}=function(e={}){return ei("mutation DelegationCategoryDelete(\n $organizationId: OrganizationId!\n $eventId: EventId\n $delegationCategoryId: DelegationsCategoryId!\n) {\n delegationCategoryDelete(\n organizationId: $organizationId\n eventId: $eventId\n delegationCategoryId: $delegationCategoryId\n ) {\n id\n }\n}\n",e)}();return(0,i.jsx)(cA,{buttonText:t("supprimer_43083"),subtext:[t("_tes_vous_s_r_d_50954"),t("cela_supprimera_35330")],text:t("suppression_de_73669",e.delegationCategory.name),onClose:e.onClose,onDelete:async()=>{await n({organizationId:e.organizationId,eventId:e.eventId,delegationCategoryId:e.delegationCategory.id}),e.onSuccess()}})},bS=e=>{const{history:t,translate:n,params:{organizationId:s,eventId:o}}=vl(),{isOrganizationAdmin:r}=TI(),{hasPermission:a}=wb(),{mutate:l}=function(e={}){return ei("mutation DelegationCategoryDuplicate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $delegationCategoryId: DelegationsCategoryId!\n) {\n delegationCategoryDuplicate(\n organizationId: $organizationId\n eventId: $eventId\n delegationCategoryId: $delegationCategoryId\n ) {\n id\n }\n}\n",e)}(),d=r||a(Hb.DELEGATION_EDIT),[c,u]=(0,L.useState)(!1);return(0,i.jsxs)(lj,{align:"center",gap:"3",hideBorder:!0,children:[(0,i.jsx)(Sj,{returnPathFallback:hs.DELEGATIONS({organizationId:s,eventId:o})}),(0,i.jsx)(Ar,{css:{flex:"1"},font:"gray900 displayXs medium",children:e.category.name}),d&&(0,i.jsx)(zl,{color:"white",onClick:()=>t.push(hs.DELEGATION_CATEGORY_UPDATE({organizationId:s,eventId:o,delegationCategoryId:e.category.id})),children:n("_diter_62574")}),d&&(0,i.jsx)(zl,{onClick:()=>{t.push(o?Ps.CREATE_DELEGATION(s,o,e.category.id):Ps.COMMUNITY_CREATE_DELEGATION(s,e.category.id))},children:n("ajouter_une_d_l_79133")}),d&&(0,i.jsxs)(Wd,{children:[(0,i.jsx)(Xd,{children:(0,i.jsx)(zl,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Zd,{placement:"bottom-end",children:[(0,i.jsx)(Kd,{icon:"copy",onClick:async()=>{const{delegationCategoryDuplicate:{id:n}}=await l({organizationId:s,eventId:o,delegationCategoryId:e.category.id});t.push(hs.DELEGATION_CATEGORY({organizationId:s,eventId:o,delegationCategoryId:n}))},children:n("dupliquer_28256")}),(0,i.jsx)(Xu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Kd,{color:"red",icon:"trash-can",onClick:()=>{u(!0)},children:n("supprimer_43083")})]})]}),c&&(0,i.jsx)(vS,{delegationCategory:e.category,eventId:o,organizationId:s,onClose:()=>{u(!1)},onSuccess:()=>{t.replace(hs.DELEGATIONS({organizationId:s,eventId:o}))}})]})},jS=()=>{const{params:{organizationId:e,eventId:t,delegationCategoryId:n}}=vl(),s=Zn(Zh),o=Zn(XA),{isOrganizationAdmin:r}=TI(),{isEventAdmin:a}=wb(),l=r||a,[d,c,u]=fy(e,"delegationCategoryMembers.columns",["name","delegations"]),[h,m,g]=fy(e,"delegationCategoryMembers.limit",Rc),[p,f,_]=fy(e,"delegationCategoryMembers.predicates",[]),[x,I,v]=fy(e,"delegationCategoryMembers.sort",null),{data:b,isLoading:j}=Qn("query DelegationCategoryMembersInfos($organizationId: OrganizationId!, $eventId: EventId) {\n organization(id: $organizationId) {\n customFields(variety: UserInfo, privacy: All) {\n nodes {\n ...SegmentCustomField\n }\n }\n\n event: eventMaybe(id: $eventId) {\n startAt\n endAt\n isWeezeventConnected\n }\n }\n}\n",{organizationId:e,eventId:t},[Vs.SegmentCustomFieldFragment]),C=u||g||_||v||j,y=(0,L.useMemo)(()=>b.organization?.customFields.nodes??[],[b.organization]),k=_y(y),A=(0,L.useMemo)(()=>b.organization?t?s.getDelegationCategoryMembersFilters(e,t,y,b.organization.event,b.organization?.event?.isWeezeventConnected??!1):o.getDelegationMembersFilters(y):[],[t,y]),w=(0,L.useMemo)(()=>t?s.getDelegationCategoryMembersPossibleColumns(e,y,b.organization?.event?.isWeezeventConnected??!1):o.getDelegationMembersPossibleColumns(y),[e,t,y,b]);return C?(0,i.jsx)(wl,{}):(0,i.jsx)(aj,{children:(0,i.jsx)(_m,{columns:d,columnsSearch:[],columnsToIncludes:t?Yh:ZA,eventId:t,filters:A,getMassActionId:e=>t?e.userInfo.id:e.id,limit:h,loadDataList:t?ar:Ho,loadDataListParams:{delegationCategoryId:n,includeCanRegistrationStateUpdate:!1,includeIsEditable:!1},loadRow:t?or:Go,loadRowParams:{includeCanRegistrationStateUpdate:!1,includeIsEditable:!1},organizationId:e,possibleColumns:w,predicates:p,renderActions:(e,t,n)=>(0,i.jsx)(BA,{campaigns:[],customFields:y,deleteFromEvent:!1,massActions:e,showAccreditationsEdit:!1,showAccreditationsValidate:!1,showDelete:!1,showWishedAccreditationsEdit:!1,onMassEditSuccess:n}),rendering:Gh.List,setColumns:c,setLimit:m,setPredicates:f,setSort:I,showEditColumns:!0,showEditMode:l,showFilters:!0,showMassActions:l,showRowDropdown:!1,showRowEdit:!1,showSearchColumns:!1,sort:x,children:(0,i.jsx)(Tm,{renderCell:(e,n,s)=>t?(0,i.jsx)(wk,{canAccredit:!0,canAssign:!1,canChangeDelegation:!0,canClickMemberName:!0,column:e,customField:k.get(e.slug),eventId:t,reloadRow:s,row:n}):(0,i.jsx)(QA,{canClickMemberName:!0,column:e,customField:k.get(e.slug),reloadRow:s,row:n,updatable:!0})})})})},CS=e=>{const{translate:t,params:{organizationId:n,eventId:s,delegationCategoryId:o}}=vl(),r=e=>({organizationId:e?":organizationId":n,eventId:s?e?":eventId":s:void 0,delegationCategoryId:e?":delegationCategoryId":o}),a=e.organization.delegationCategory;return(0,i.jsxs)(dj,{children:[(0,i.jsx)(bS,{category:a,reload:e.reload}),(0,i.jsxs)(mj,{css:{flex:"1"},children:[(0,i.jsxs)(uj,{css:{px:"$7"},children:[(0,i.jsx)(cj,{path:hs.DELEGATION_CATEGORY_DASHBOARD(r(!1)),children:t("tableau_de_bord_24627")}),(0,i.jsx)(cj,{path:hs.DELEGATION_CATEGORY_MEMBERS(r(!1)),children:t("membres_125561",a.numberOfResources)})]}),(0,i.jsx)(hj,{path:hs.DELEGATION_CATEGORY_DASHBOARD(r(!0)),children:(0,i.jsx)(IS,{delegationCategory:a,reload:e.reload})}),(0,i.jsx)(hj,{path:hs.DELEGATION_CATEGORY_MEMBERS(r(!0)),children:(0,i.jsx)(jS,{})})]})]})},yS=e=>{const{params:{organizationId:t,eventId:n,delegationCategoryId:s}}=vl(),{data:o,loader:r,reload:a}=Qn("query DelegationCategory(\n $organizationId: OrganizationId!\n $delegationCategoryId: DelegationsCategoryId!\n) {\n organization(id: $organizationId) {\n delegationsSpaceCustomBadges\n\n delegationCategory(id: $delegationCategoryId) {\n id\n name\n numberOfDelegations\n numberOfResources\n\n leaders {\n ...LeaderInfos\n }\n }\n }\n}\n",{organizationId:t,delegationCategoryId:s},[Vs.LeaderInfosFragment]);return r||(0,i.jsxs)(Sr.dO,{children:[(0,i.jsx)(Sr.qh,{exact:!0,path:hs.DELEGATION_CATEGORY({organizationId:":organizationId",eventId:e.isEvent?":eventId":void 0,delegationCategoryId:":delegationCategoryId"}),children:(0,i.jsx)(oi,{path:hs.DELEGATION_CATEGORY_DASHBOARD({organizationId:t,eventId:n,delegationCategoryId:s}),replace:!0})}),(0,i.jsx)(Sr.qh,{children:(0,i.jsx)(CS,{organization:o.organization,reload:a})})]})},kS=()=>{const e=Xn();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(rl,{color:"primary",leftIcon:"clock",children:e("votre_import_es_05273")}),(0,i.jsx)(Ya,{height:"6"})]})};let AS=class extends Gl{documentInputService;archiveInputService;constructor(e,t,n){super(n),this.documentInputService=e,this.archiveInputService=t}default(){return{input:{archive:this.documentInputService.documentInputDefault(),fieldId:-1}}}schema(){return d.Ik().shape({input:d.Ik().shape({archive:this.archiveInputService.schema(),fieldId:d.Yj().required(this.t("le_champ_person_80074")).typeError(this.t("le_champ_person_80074"))})})}};AS=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Gj,cv,qn])],AS);const wS=()=>{const{translate:e,params:{organizationId:t}}=vl();return(0,i.jsx)(Vm,{hideToggle:!0,initialIsOpen:!0,subtitle:e("s_lectionnez_vo_27155",Vv.bytesToGigabytes(dv),Vv.bytesToMegabytes(2e7)),heading:e("votre_fichier_d_51776"),children:(0,i.jsx)(Yj,{accept:yv.Archives,acl:"private",organizationId:t,prefix:"input.archive.",withFileField:!0})})},SS=({customFields:e})=>{const t=Xn();return(0,i.jsx)(Vm,{hideToggle:!0,initialIsOpen:!0,subtitle:t("_ditez_la_corre_24969"),heading:t("correspondance_10480"),children:(0,i.jsxs)(Qj,{label:t("sur_quel_champ_17516"),name:"input.fieldId",children:[(0,i.jsx)("option",{disabled:!0,hidden:!0,value:-1,children:t("s_lectionnez_un_82446")}),e.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))]})})},ES=({customFileFields:e})=>(0,i.jsx)(SS,{customFields:e}),TS=e=>!!e.getFieldState("input.archive.key")?.valid&&!!e.getFieldState("input.archive.file")?.valid,zS=()=>{const{translate:e,params:{organizationId:t,eventId:n}}=vl(),s=Zn(AS),o=Zn(Ua),r=(0,L.useRef)(null),{data:a,loader:l}=Qn("query FilesImportCustomFields($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n customFileFields: customFields(variety: UserInfo, fieldTypes: [File]) {\n nodes {\n id\n name\n slug\n customFieldCategoryId\n customFieldCategoryName\n fieldType\n fieldProperty\n canSelectMultiple\n\n values {\n id\n value\n }\n }\n }\n }\n}\n",{organizationId:t},[]),{mutate:d}=function(e={}){return ei("mutation FilesImport(\n $organizationId: OrganizationId!\n $eventId: EventId\n $input: FilesImportInput!\n) {\n jobId: filesImport(organizationId: $organizationId, eventId: $eventId, input: $input)\n}\n",e)}(),{checkFilesImport:c}=Ob();return l||(0,i.jsx)(kl,{customErrorRef:r,height:1,initialValues:{input:s.default().input},render:({form:s,handleSubmit:o,submitting:l,values:d})=>(0,i.jsx)(Lm,{button:(0,i.jsx)(zl,{isLoading:l,onClick:o,children:e("importer_la_lis_12866")}),category:e("importe_des_fic_85041"),color:"dark",fallbackClosePath:n?Ps.VOLUNTEERS(t,n):wi.COMMUNITY_USERS({organizationId:t}),heading:e("nouvel_import_48306"),children:(0,i.jsxs)(Mm,{ref:r,children:[s.getState().submitSucceeded&&(0,i.jsx)(kS,{}),(0,i.jsx)(jl,{}),(0,i.jsxs)(Ba,{direction:"column",gap:"5",children:[(0,i.jsx)(wS,{}),d.input.archive?.file&&TS(s)&&(0,i.jsx)(ES,{customFileFields:a.organization.customFileFields.nodes})]})]})}),validate:o.validateForForm(s.schema()),onSubmit:async({input:e})=>{const i=(e=>{const t={...e.archive};return delete t.file,{...e,archive:t}})(e);try{const{jobId:e}=await d({organizationId:t,eventId:n,input:i});r.current&&(r.current.scrollTop=0),c(e,t,n)}catch{}}})},OS=e=>{const t=Xn(),{mutate:n}=aa(),{data:s}=oa({organizationId:e.organizationId}),o=(0,L.useMemo)(()=>(s.organization?.events.nodes??[]).filter(t=>t.id!==e.eventId),[s.organization,e.eventId]),r=(0,L.useMemo)(()=>d.Ik().shape({eventId:d.ai().required(t("l_v_nement_est_88155")).oneOf(o.map(e=>e.id),t("l_v_nement_est_88155"))}),[o]);return(0,i.jsxs)(oC,{buttonText:t("dupliquer_ce_fo_10581"),icon:"sliders",initialValues:{eventId:-1},schema:r,size:"md",subtitle:t("dupliquer_votre_17703"),title:t("dupliquer_vers_48809"),onClose:e.onClose,onSubmit:async t=>{await n({organizationId:e.organizationId,eventId:e.eventId,formId:e.formId,newEventId:t.eventId}),e.onClose()},children:[(0,i.jsxs)(rl,{color:"warning",leftIcon:"triangle-exclamation",children:[t("toutes_les_info_60876"),(0,i.jsx)("br",{}),t("certains_param_05954")]}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(Ym,{isSearchVisible:!0,label:t("sur_quel_v_nem_94155"),multiple:!1,name:"eventId",children:o.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})]})},RS=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=vl(),{isOrganizationAdmin:o}=TI(),{showNotification:r}=Ob(),{mutate:a}=aa(),{mutate:l}=function(e={}){return ei("mutation FormDelete($organizationId: OrganizationId!, $eventId: EventId, $formId: FormId!) {\n formDelete(organizationId: $organizationId, eventId: $eventId, formId: $formId) {\n id\n }\n}\n",e)}(),[d,c]=(0,L.useState)(!1),[u,h]=(0,L.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ba,{align:"center",css:{background:"white",bd:!0,padding:"$4 $6"},gap:"6",width:1,children:[(0,i.jsx)(Ar,{css:{flex:"1"},children:(0,i.jsx)(Zc,{to:Vi.FORM_ELEMENTS({organizationId:n,eventId:s,formId:e.form.id}),children:e.form.name})}),(0,i.jsxs)(Ar,{color:"gray500",children:[t("nombre_de_champ_91879")," ",(0,i.jsx)(ng,{color:"gray800",children:e.form.numberOfCustomFields})]}),(0,i.jsx)(Kb,{permissions:Hb.FORM_EDIT,children:(0,i.jsxs)(Wd,{children:[(0,i.jsx)(Xd,{children:(0,i.jsx)(zl,{color:"white",leftIcon:"ellipsis-vertical",size:"sm"})}),(0,i.jsxs)(Zd,{placement:"bottom-end",children:[e.canDuplicate&&(0,i.jsx)(Kd,{icon:"clone",onClick:async t=>{Dl(t),await a({organizationId:n,eventId:s,formId:e.form.id}),e.reload()},children:t("dupliquer_28256")}),o&&s&&e.canDuplicate&&(0,i.jsx)(Kd,{icon:"clone",onClick:()=>{c(!0)},children:t("dupliquer_sur_u_11076")}),e.canDuplicate&&(0,i.jsx)(Xu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Kd,{color:"red",icon:"trash-can",onClick:e=>{Dl(e),h(!0)},children:t("supprimer_43083")})]})]})})]}),d&&(0,i.jsx)(OS,{eventId:s,formId:e.form.id,organizationId:n,onClose:()=>{c(!1)}}),u&&(0,i.jsx)(cA,{buttonText:t("supprimer_43083"),subtext:t("_tes_vous_s_r_d_75358"),text:t("suppression_de_73669",e.form.name),onClose:()=>{h(!1)},onDelete:async()=>{await l({organizationId:n,eventId:s,formId:e.form.id}),r(t("le_formulaire_76783",e.form.name)),e.reload()}})]})};function $S(){const{hasFeature:e,hasPermission:t}=TI(),{event:n,hasPermission:i}=wb();return(0,L.useMemo)(()=>{const s=e=>t(e)||(i?.(e)??!1),o=e(Be.Accreditation)&&(n?.useAccreditations??!1),r=n?.useCampaigns??!0,a=e(Be.Delegation)&&(n?.useDelegations??!0),l=(e(Be.Documents)||e(Be.CustomDocument))&&(n?.useDocuments??!1),d=n?.useForms??!0,c=n?.usePositions??!1,u=n?.useWorkflows??!0;return{canAccreditationEdit:o&&s(Hb.ACCREDITATION_EDIT),canAccreditationRead:o&&s(Hb.ACCREDITATION_READ),canCampaignRead:r&&s(Hb.CAMPAIGN_READ),canCampaignSend:r&&s(Hb.CAMPAIGN_SEND),canCommentAdd:s(Hb.COMMENT_ADD),canCommentRead:s(Hb.COMMENT_READ),canCustomFieldEdit:s(Hb.CUSTOM_FIELD_EDIT),canCustomFieldRead:s(Hb.CUSTOM_FIELD_READ),canDelegationEdit:a&&s(Hb.DELEGATION_EDIT),canDelegationRead:a&&s(Hb.DELEGATION_READ),canDocumentEdit:l&&s(Hb.DOCUMENT_EDIT),canDocumentRead:l&&s(Hb.DOCUMENT_READ),canEmailEdit:s(Hb.EMAIL_EDIT),canEventEdit:s(Hb.EVENT_EDIT),canFormEdit:d&&s(Hb.FORM_EDIT),canFormRead:d&&s(Hb.FORM_READ),canMemberAccredit:o&&s(Hb.MEMBER_ACCREDIT),canMemberAssign:c&&s(Hb.MEMBER_ASSIGN),canMemberAssignmentStateEdit:c&&s(Hb.MEMBER_ASSIGNMENT_STATE_EDIT),canMemberAvailabilitiesEdit:s(Hb.MEMBER_AVAILABILITIES_EDIT),canMemberCreate:s(Hb.MEMBER_CREATE),canMemberDelete:s(Hb.MEMBER_DELETE),canMemberEdit:s(Hb.MEMBER_EDIT),canOrganizationParamEdit:s(Hb.ORGANIZATION_PARAM_EDIT),canOrganizationParamRead:s(Hb.ORGANIZATION_PARAM_READ),canOrganizationUserEdit:s(Hb.ORGANIZATION_USER_EDIT),canOrganizationUserRead:s(Hb.ORGANIZATION_USER_READ),canPositionEdit:c&&s(Hb.POSITION_EDIT),canPositionRead:c&&s(Hb.POSITION_READ),canSegmentEdit:s(Hb.SEGMENT_EDIT),canWorkflowEdit:u&&s(Hb.WORKFLOW_EDIT),canWorkflowRead:u&&s(Hb.WORKFLOW_READ)}},[e,n,t,i])}function DS(){const{hasFeature:e,hasPermission:t}=TI();return(0,L.useMemo)(()=>{const n=e(Be.Accreditation),i=e(Be.Delegation),s=e(Be.CustomDocument);return{canAccreditationEdit:n&&t(Hb.ACCREDITATION_EDIT),canAccreditationRead:n&&t(Hb.ACCREDITATION_READ),canCampaignRead:t(Hb.CAMPAIGN_READ),canCampaignSend:t(Hb.CAMPAIGN_SEND),canCommentAdd:t(Hb.COMMENT_ADD),canCommentRead:t(Hb.COMMENT_READ),canCustomFieldEdit:t(Hb.CUSTOM_FIELD_EDIT),canCustomFieldRead:t(Hb.CUSTOM_FIELD_READ),canDelegationEdit:i&&t(Hb.DELEGATION_EDIT),canDelegationRead:i&&t(Hb.DELEGATION_READ),canDocumentEdit:s&&t(Hb.DOCUMENT_EDIT),canDocumentRead:s&&t(Hb.DOCUMENT_READ),canEmailEdit:t(Hb.EMAIL_EDIT),canEventEdit:t(Hb.EVENT_EDIT),canFormEdit:t(Hb.FORM_EDIT),canFormRead:t(Hb.FORM_READ),canMemberAccredit:t(Hb.MEMBER_ACCREDIT),canMemberAssign:t(Hb.MEMBER_ASSIGN),canMemberAssignmentStateEdit:t(Hb.MEMBER_ASSIGNMENT_STATE_EDIT),canMemberAvailabilitiesEdit:t(Hb.MEMBER_AVAILABILITIES_EDIT),canMemberCreate:t(Hb.MEMBER_CREATE),canMemberDelete:t(Hb.MEMBER_DELETE),canMemberEdit:t(Hb.MEMBER_EDIT),canOrganizationParamEdit:t(Hb.ORGANIZATION_PARAM_EDIT),canOrganizationParamRead:t(Hb.ORGANIZATION_PARAM_READ),canOrganizationUserEdit:t(Hb.ORGANIZATION_USER_EDIT),canOrganizationUserRead:t(Hb.ORGANIZATION_USER_READ),canPositionEdit:t(Hb.POSITION_EDIT),canPositionRead:t(Hb.POSITION_READ),canSegmentEdit:t(Hb.SEGMENT_EDIT),canWorkflowEdit:t(Hb.WORKFLOW_EDIT),canWorkflowRead:t(Hb.WORKFLOW_READ)}},[e,t])}let PS=class extends Gl{constructor(e){super(e)}formInputDefault(){return{name:""}}formInputSchema(){return d.Ik().shape({name:d.Yj().required(this.t("le_nom_est_requ_61536"))})}createFormSchema(){return d.Ik().shape({form:this.formInputSchema()})}};PS=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[qn])],PS);const FS=e=>{const t=Xn(),n=Zn(PS),{mutate:s}=function(e={}){return ei("mutation FormCreate($organizationId: OrganizationId!, $eventId: EventId, $form: FormInput!) {\n formCreate(organizationId: $organizationId, eventId: $eventId, form: $form) {\n id\n }\n}\n",e)}();return(0,i.jsx)(oC,{buttonText:t("cr_er_le_formul_42369"),icon:"sliders",initialValues:{form:n.formInputDefault()},schema:n.createFormSchema(),size:"md",title:t("nouveau_formula_44488"),onClose:e.onClose,onSubmit:async t=>{const{formCreate:n}=await s({organizationId:e.organizationId,eventId:e.eventId,form:t.form});e.onSuccess(n.id)},children:(0,i.jsx)(Vl,{label:t("nom_du_formulai_14952"),name:"form.name"})})},MS=e=>{const{history:t,translate:n,params:{organizationId:s,eventId:o}}=vl(),{canFormEdit:r}=$S(),[a,l]=(0,L.useState)(e.isCreateOpen);return(0,i.jsxs)(lj,{gap:"4",children:[(0,i.jsx)(Ar,{css:{flex:"1"},font:"gray900 displayXs semiBold",children:n("Form_plural")}),e.isSearchVisible&&(0,i.jsx)(Ar,{width:320,children:(0,i.jsx)(Bl,{icon:"magnifying-glass",placeholder:n("rechercher_un_f_28561"),value:e.name,onChange:e.setName})}),r&&e.canCreateNewForm&&(0,i.jsx)(zl,{onClick:()=>{l(!0)},children:n("cr_er_un_formul_78352")}),a&&(0,i.jsx)(FS,{eventId:o,organizationId:s,onClose:()=>{l(!1)},onSuccess:e=>{t.push(Vi.FORM_ELEMENTS({organizationId:s,eventId:o,formId:e}))}})]})},NS=()=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(lc,{borderRadius:"$2",height:72,width:1}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(lc,{borderRadius:"$2",height:72,width:1}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(lc,{borderRadius:"$2",height:72,width:1})]}),LS=e=>{const{translate:t}=vl(),{event:n}=wb(),{hasFeature:s}=TI();Md(`${n?.name??t("communaut_20896")} ${t("Form_plural")}`);const[o,r]=(0,L.useState)(""),a=(0,L.useMemo)(()=>m(o)?e.forms.filter(e=>e.name.toLowerCase().includes(o.toLowerCase())||e.id.toString(10)===o):e.forms,[e.forms,o]),l=(0,L.useMemo)(()=>0===e.forms.length||s(Be.Multiform),[e.forms]);return(0,i.jsxs)(dj,{children:[(0,i.jsx)(MS,{canCreateNewForm:l,isCreateOpen:e.isCreateOpen,isSearchVisible:so(e.forms),name:o,setName:r}),(0,i.jsx)(aj,{children:e.isLoading?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(NS,{})]}):0===e.forms.length?(0,i.jsx)(Ar,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(Gk,{subtitle:t("cr_er_vos_formu_26049"),title:t("aucun_formulair_74743")})}):(0,i.jsxs)(i.Fragment,{children:[!l&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(rl,{color:"warning",leftIcon:"circle-info",children:(0,i.jsxs)(Ba,{direction:"column",children:[(0,i.jsx)(Ar,{fontWeight:"semiBold",children:t("vous_avez_attei_23858")}),(0,i.jsx)(Ar,{children:t("votre_abonnemen_18069")})]})}),(0,i.jsx)(Ya,{height:"7"})]}),a.map(t=>(0,i.jsxs)(L.Fragment,{children:[(0,i.jsx)(RS,{canDuplicate:l,form:t,reload:e.reload}),(0,i.jsx)(Ya,{height:"3"})]},t.id))]})})]})},BS=e=>{const{organizationId:t,eventId:n}=ti(),{data:s,isLoading:o,reload:r}=la({organizationId:t,level:ot.Event,eventId:n}),a=(0,L.useMemo)(()=>(0,uc.A)(s.organization?.forms.nodes??[],e=>e.name.toLowerCase()),[s.organization]);return(0,i.jsx)(LS,{forms:a,isCreateOpen:e.isCreateOpen,isLoading:o,reload:r})},VS=e=>{const{organizationId:t}=ti(),{data:n,isLoading:s,reload:o}=la({organizationId:t,level:ot.Organization}),r=(0,L.useMemo)(()=>(0,uc.A)(n.organization?.forms.nodes??[],e=>e.name.toLowerCase()),[n.organization]);return(0,i.jsx)(LS,{forms:r,isCreateOpen:e.isCreateOpen,isLoading:s,reload:o})};function US(e){navigator.clipboard.writeText(e)}function WS(){const[e,t]=(0,L.useState)(!1);return{isLoading:e,copy:(0,L.useCallback)(e=>{t(!0),US(e),setTimeout(()=>t(!1),500)},[])}}var GS=n(5848);const HS=e=>{const{translate:t}=vl(),{isLoading:n,copy:s}=WS(),o=()=>(0,i.jsx)("iframe",{height:"100%",src:e.link,style:{border:"none"},width:"100%"});return(0,i.jsxs)(Ba,{direction:"column",gap:"7",children:[e.alert,(0,i.jsxs)(Ba,{direction:"column",gap:"2",children:[(0,i.jsxs)(Ba,{direction:"column",gap:"1",children:[(0,i.jsx)(ml,{css:{fontWeight:"$medium"},textStyle:"bodyText",children:e.iframeLabel}),(0,i.jsx)(Ar,{css:{bd:!0,borderRadius:"$1",padding:"$2 $3"},children:(0,i.jsx)("code",{children:(0,GS.renderToStaticMarkup)((0,i.jsx)(o,{}))})})]}),(0,i.jsx)(Ba,{children:(0,i.jsx)(zl,{isLoading:n,leftIcon:"copy",onClick:()=>s((0,GS.renderToStaticMarkup)((0,i.jsx)(o,{}))),children:t("copier_75889")})})]})]})},qS=e=>{const{translate:t}=vl(),{isLoading:n,copy:s}=WS();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ba,{align:"end",gap:"5",children:[(0,i.jsxs)(Ba,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(ml,{css:{fontWeight:"$medium"},textStyle:"bodyText",children:e.heading}),(0,i.jsx)(Ar,{css:{bd:!0,borderRadius:"$1",padding:"$2 $3"},children:(0,i.jsx)(Zc,{css:{inlineSize:"max-content",fontWeight:"normal",textDecoration:"underline"},hideIcon:!0,to:e.link,children:e.link})})]}),(0,i.jsx)(zl,{isLoading:n,leftIcon:"copy",onClick:()=>s(e.link),children:t("copier_75889")})]}),(0,i.jsxs)(Ba,{align:"center",css:{bd:!0,borderRadius:"$1",padding:"$6 $8"},direction:"column",gap:"6",children:[(0,i.jsxs)(Ba,{align:"center",direction:"column",children:[(0,i.jsx)(ml,{children:t("qr_code_60722")}),(0,i.jsx)(hl,{textStyle:"subtitle",children:e.qrCodeDescription})]}),(0,i.jsx)(Ar,{height:120,width:120,children:(0,i.jsx)("img",{height:"100%",src:pg(e.link,{height:120,width:120}),width:"100%"})}),(0,i.jsx)(zl,{download:"qr-code",to:pg(e.link,{height:120,width:120}),children:t("t_l_charger_le_18439")})]})]})},KS=({children:e,isActive:t,onClick:n,replace:s=!0,to:o})=>{const r=ii(),a=t?.(r.pathname)??r.pathname===o;return(0,i.jsx)(Ba,{align:"center",css:{borderBottom:a?"2px solid $primary500":"2px solid transparent",borderTop:"2px solid transparent",color:a?"$primary500":"$gray500",fontWeight:"$medium",px:"$3",userSelect:"none"},height:1,children:(0,i.jsx)(el,{height:1,replace:s,to:o,width:1,onClick:async()=>{n&&await n()},children:e})})},YS=e=>(0,i.jsx)(Ba,{as:Ma.Nav,css:{borderBottom:"1px solid $gray200"},gap:"2",height:e.height,justify:"center",role:"menubar",width:e.width,children:e.children}),ZS=()=>{const{translate:e,params:t}=vl();return(0,i.jsxs)(YS,{height:1,width:1,children:[(0,i.jsx)(KS,{to:Vi.FORM_ELEMENTS(t),children:e("champs_91671")}),(0,i.jsx)(KS,{isActive:e=>null!==e.match(/\/form\/\d+\/parameters/),to:Vi.FORM_PARAMETERS_GENERAL(t),children:e("param_tres_78420")}),(0,i.jsx)(KS,{to:Vi.FORM_INTEGRATION(t),children:e("int_gration_10662")}),(0,i.jsx)(KS,{to:Vi.FORM_EMAILS(t),children:e("mod_les_e_mail_91257")}),(0,i.jsx)(KS,{to:Vi.FORM_PREVIEW(t),children:e("aper_u_25595")})]})},XS=e=>{const{translate:t}=vl(),{canFormEdit:n}=$S();return(0,i.jsx)(Lm,{button:n&&e.button,category:t("cr_ation_d_un_f_67278"),color:"dark",heading:e.title,onClose:e.onClose,children:(0,i.jsxs)(hd,{gridtemplatecolumns:"1fr",gridtemplaterows:"55px 1fr",height:1,width:1,children:[(0,i.jsx)(ZS,{}),(0,i.jsx)(Ar,{css:{overflowY:"auto"},children:e.children})]})})},JS=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:s,formId:o}}=vl(),{data:r}=da({organizationId:n,formId:o});Md(r.organization?.form.name??"");const a=mg({organizationId:n,eventId:s,formId:o});return(0,i.jsx)(XS,{title:r.organization?.form.name??"-",onClose:()=>{e.push(Vi.FORMS({organizationId:n,eventId:s}))},children:(0,i.jsx)(Ba,{justify:"center",width:1,children:(0,i.jsxs)(Ba,{css:{paddingBlockStart:"$8"},gap:"8",width:"$container",children:[(0,i.jsx)(Ba,{direction:"column",gap:"6",children:(0,i.jsx)(qS,{heading:t("FormLink"),link:a,qrCodeDescription:t("facilitez_la_co_59826")})}),(0,i.jsx)(Ba,{direction:"column",gap:"6",children:(0,i.jsx)(HS,{alert:(0,i.jsxs)(gl,{alertStyle:"warning",children:[(0,i.jsx)(pl,{children:t("comment_marche_73229")}),(0,i.jsx)(fl,{children:t("ce_code_va_vous_31197")})]}),heading:t("iframe_27513"),iframeLabel:t("code_html_pour_12471"),link:a})})]})})})},QS=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:s,formId:o}}=vl(),{data:r}=da({organizationId:n,formId:o});Md(r.organization?.form.name??"");const[a,l]=(0,L.useState)("opened"),d=mg({organizationId:n,eventId:s,formId:o,query:{preview:!0,previewState:a}});return(0,i.jsx)(XS,{title:r.organization?.form.name??"-",onClose:()=>{e.push(Vi.FORMS({organizationId:n,eventId:s}))},children:(0,i.jsxs)(Ba,{align:"center",direction:"column",height:1,width:1,children:[(0,i.jsxs)(Ba,{direction:"column",width:"$container",children:[(0,i.jsx)(Ya,{height:"8"}),(0,i.jsxs)(Ba,{align:"center",gap:"4",children:[(0,i.jsxs)(Ba,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(Ar,{font:"gray900 textLg semiBold",children:t("aper_u_du_formu_51076")}),(0,i.jsx)(Ar,{color:"gray500",children:t("pr_visualiser_v_58073")})]}),(0,i.jsx)(Ar,{width:200,children:(0,i.jsxs)($u,{value:a,onChange:e=>{l(e)},children:[(0,i.jsx)("option",{value:"opened",children:t("Opened")}),(0,i.jsx)("option",{value:"closed",children:t("cl_tur_79063")}),(0,i.jsx)("option",{value:"blocked",children:t("acc_s_r_fus_68875")})]})})]})]}),(0,i.jsx)(Ya,{height:"5"}),(0,i.jsx)(Ar,{css:{flex:"1",overflow:"hidden"},width:1,children:(0,i.jsx)("iframe",{height:"100%",src:d,style:{border:"none"},width:"100%"})})]})})},eE=e=>{const{history:t,translate:n}=vl();return(0,i.jsx)(Lb,{isOpen:e.isOpen,onClose:e.onClose,children:(0,i.jsxs)(Nb,{children:[(0,i.jsx)(Mb,{icon:"triangle-exclamation",children:n("changements_non_17558")}),(0,i.jsx)(Fb,{children:(0,i.jsxs)(Ba,{align:"center",direction:"column",gap:"1",width:1,children:[(0,i.jsx)(Ar,{font:"gray900 textLg medium",children:n("voulez_vous_qui_84408")}),(0,i.jsx)(Ar,{color:"gray500",children:n("des_donn_es_ne_27178")})]})}),(0,i.jsx)(Pb,{children:(0,i.jsx)(zl,{color:"error",onClick:()=>t.goBack(e.fallbackPath),children:n("quitter_sans_sa_28486")})})]})})},tE=_r("div",{alignItems:"center",borderRadius:"$1",cursor:"pointer",display:"flex",fontWeight:"$semiBold",overflow:"hidden",userSelect:"none",variants:{color:{primary:{background:"$primary500",color:"white","& > .h-button-dropdown-content":{border:"1px solid $primary500",borderRadius:"$1",borderBottomRightRadius:"0",borderTopRightRadius:"0",borderRight:"none"},"& > .h-button-dropdown-icon":{border:"1px solid $primary500",borderRadius:"$1",borderBottomLeftRadius:"0",borderTopLeftRadius:"0",borderLeft:"1px solid $primary600"},"& > .h-button-dropdown-content:hover":{background:"$primary600",border:"1px solid $primary600",borderRight:"none"},"& > .h-button-dropdown-icon:hover":{background:"$primary600",border:"1px solid $primary600"}},white:{background:"white",color:"$gray700","& > .h-button-dropdown-content":{border:"1px solid $gray300",borderRadius:"$1",borderBottomRightRadius:"0",borderTopRightRadius:"0",borderRight:"none"},"& > .h-button-dropdown-icon":{border:"1px solid $gray300",borderRadius:"$1",borderBottomLeftRadius:"0",borderTopLeftRadius:"0"},"& > .h-button-dropdown-content:hover":{background:"$gray50",color:"$gray800"},"& > .h-button-dropdown-icon:hover":{background:"$gray50",color:"$gray800"}}},size:{sm:{height:"32px",fontSize:"$textSm"},md:{height:"40px",fontSize:"$textSm"},lg:{height:"44px",fontSize:"$textMd"},xl:{height:"48px",fontSize:"$textMd"},"2xl":{height:"60px",fontSize:"$textLg"}}},defaultVariants:{color:"primary",size:"md"}}),nE=L.forwardRef((e,t)=>{const{history:n}=vl();return(0,i.jsxs)(tE,{color:e.color,size:e.size,children:[(0,i.jsx)(Ba,{ref:t,align:"center",className:"h-button-dropdown-content",css:{flex:"1",px:"$4"},height:1,onClick:t=>{e.onClick&&e.onClick(t),m(e.path)&&n.push(e.path)},children:e.children}),(0,i.jsxs)(Wd,{children:[(0,i.jsx)(Xd,{children:(0,i.jsx)(Ba,{align:"center",className:"h-button-dropdown-icon",height:40,justify:"center",width:40,children:(0,i.jsx)(nl,{icon:"chevron-down"})})}),(0,i.jsx)(Zd,{placement:"bottom-end",renderOnPortal:!0,children:e.menu})]})]})});nE.displayName="ButtonDropdown";const iE=({returnPathFallback:e})=>(0,i.jsx)(vu,{returnToFallback:e,size:"md",children:(0,i.jsx)(bu,{children:(0,i.jsx)(wl,{})})});let sE=class extends Gl{documentInputService;constructor(e,t){super(t),this.documentInputService=e}customFieldInputDefault(e,t){return{name:e?.name??"",label:e?.label??"",customFieldCategoryId:e?.customFieldCategoryId??t[0].id,description:e?.description??"",variety:e?.variety??je.UserInfo,fieldType:e?.fieldType??We.Text,fieldSubtype:e?.fieldSubtype??Ue.Freeform,isPrivate:e?.isPrivate??!1,values:so(e?.values)?e.values:[],hasCondition:e?.hasCondition??!1,conditionCustomFieldId:e?.conditionCustomFieldId??null,conditionValue:e?.conditionValue??!1,canSelectMultiple:e?.canSelectMultiple??!1,document:e?.document||this.documentInputService.documentInputDefault(),isEncrypted:e?.isEncrypted??!1}}customFieldInputSchema(){return d.Ik().shape({name:d.Yj().required(this.t("le_nom_du_champ_17959")),label:d.Yj(),customFieldCategoryId:d.ai().required(this.t("la_cat_gorie_es_14008")).typeError(this.t("la_cat_gorie_es_14008")).min(1,this.t("la_cat_gorie_es_14008")),fieldType:d.Yj().required(this.t("le_type_est_req_41180")).oneOf(pn,this.t("le_type_est_req_41180")),isPrivate:d.zM().nullable(),hasCondition:d.zM().nullable(),values:d.YO().when("fieldType",{is:We.Select,then:e=>e.of(d.Ik().shape({id:d.ai(),value:d.Yj().required(this.t("la_valeur_est_r_70136"))})).required(this.t("vous_devez_s_le_95641")).min(1,this.t("vous_devez_s_le_95641"))}),conditionCustomFieldId:d.ai().when("hasCondition",{is:!0,then:e=>e.required(),otherwise:e=>e.nullable()}),conditionValue:d.gl(),canSelectMultiple:d.zM().nullable(),document:this.documentInputService.documentInputSchemaNotRequired(),isEncrypted:d.zM().required()})}createUpdateCustomFieldSchema(){return d.Ik().shape({customField:this.customFieldInputSchema()})}};sE=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Gj,qn])],sE);const oE=e=>{const t=Xn(),n=(0,L.useCallback)(({reason:t,source:n,destination:i})=>{"DROP"===t&&i&&n.index!==i.index&&e.change("customField.values",lo(e.values,n.index,i.index))},[e.values,e.change]),s=!e.isEdit||e.isSelectV2;return(0,i.jsxs)(Ba,{direction:"column",gap:"1",children:[(0,i.jsx)(Ar,{font:"gray700 textSm medium",children:t("valeurs_de_la_l_43599")}),(0,i.jsxs)(Ba,{css:{background:"$gray100",borderRadius:"$1",padding:"$4"},direction:"column",gap:"3",children:[s?(0,i.jsx)(Iu.JY,{onDragEnd:n,children:(0,i.jsx)(Iu.gL,{droppableId:"1",children:t=>(0,i.jsxs)(Ba,{direction:"column",gap:"3",...t.droppableProps,ref:t.innerRef,children:[e.values.map((t,n)=>(0,i.jsx)(Iu.sx,{draggableId:n.toString(),index:n,children:t=>(0,i.jsxs)(Ba,{align:"center",gap:"4",...t.draggableProps,ref:t.innerRef,children:[(0,i.jsx)(Ar,{color:"gray300",css:{cursor:"grab"},fontSize:"textMd",...t.dragHandleProps,children:(0,i.jsx)(nl,{icon:"grip-vertical",iconStyle:"solid"})}),(0,i.jsx)(Ar,{css:{flex:"1"},children:(0,i.jsx)(Vl,{name:`customField.values[${n}].value`})}),(0,i.jsx)(Ar,{color:"gray500",css:{cursor:"pointer"},onClick:()=>{e.change("customField.values",co(e.values,n))},children:(0,i.jsx)(nl,{icon:"trash-can"})})]})},n)),t.placeholder]})})}):e.values.map((e,t)=>(0,i.jsx)(Ar,{css:{flex:"1"},children:(0,i.jsx)(Vl,{name:`customField.values[${t}].value`})},t)),(0,i.jsxs)(Ar,{css:{cursor:"pointer"},font:"primary500 textSm medium",onClick:()=>{e.change("customField.values",e.values.concat([{value:""}]))},children:["+ ",t("ajouter_une_nou_98358")]})]})]})},rE=e=>{const{translate:t}=vl(),{showNotification:n}=Ob(),s=Zn(sE),o=Bc(),r=Zn(Ua),{mutate:a}=function(e={}){return ei("mutation CustomFieldCategoryCreate(\n $organizationId: OrganizationId!\n $category: CustomFieldsCategoryInput!\n) {\n customFieldCategoryCreate(organizationId: $organizationId, customFieldCategory: $category) {\n id\n name\n }\n}\n",e)}(),l=(0,L.useRef)(null),d=(0,L.useMemo)(()=>e.isEdit?t("mise_jour_de_17055",e.initialValues.customField.name):t("nouveau_champ_p_27686"),[e.isEdit,e.initialValues]);Md(d);const c=(0,L.useMemo)(()=>(0,uc.A)(e.organization.customFields.nodes.filter(t=>t.id!==e.customFieldId),e=>e.name.toLowerCase()),[e.customFieldId,e.organization]),[u,h]=(0,L.useState)(ty(e.organization.customFieldsCategories.nodes)),[m,g]=(0,L.useState)(e.initialValues.customField.fieldType),[p,f]=(0,L.useState)(e.initialValues.customField.hasCondition),[_,x]=(0,L.useState)(c.find(t=>t.id===e.initialValues.customField.conditionCustomFieldId)),[I,v]=(0,L.useState)(!1),b=!e.isFromForm,j=_?.fieldType===We.Checkbox,C=zy(_);return(0,i.jsx)(kl,{customErrorRef:l,initialValues:e.initialValues,render:({form:n,handleSubmit:s,submitting:r,values:y})=>{const k=(y.customField.variety===je.Delegation||y.customField.variety===je.UserInfo)&&m===We.Text,A=e.isEdit||y.customField.fieldSubtype!==Ue.Freeform,w=(y.customField.variety===je.Delegation||y.customField.variety===je.UserInfo)&&m!==We.Validation&&!0!==e.isFromForm,S=y.customField.variety===je.UserInfo&&so(c);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(vu,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(zj,{children:d}),(0,i.jsxs)(bu,{ref:l,children:[(0,i.jsx)(Nr.Yr,{name:"customField.fieldType",children:e=>{g(e),e===We.Validation&&n.change("customField.isPrivate",!1)}}),(0,i.jsx)(Nr.Yr,{name:"customField.fieldSubtype",children:e=>{n.change("customField.isEncrypted",e!==Ue.Freeform)}}),(0,i.jsx)(Nr.Yr,{name:"customField.hasCondition",children:e=>{n.change("customField.conditionCustomFieldId",c[0].id),f(e)}}),(0,i.jsx)(Nr.Yr,{name:"customField.conditionCustomFieldId",children:e=>{const t=c.find(t=>t.id===e);t&&(n.change("customField.conditionValue",t.fieldType===We.Checkbox||[]),x(t))}}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(jl,{}),(0,i.jsxs)(Ba,{direction:"column",gap:"6",width:1,children:[b&&(0,i.jsxs)(Qj,{label:t("typologie_34041"),name:"customField.variety",state:e.isEdit?"disabled":"active",children:[(0,i.jsx)("option",{value:je.Accreditation,children:t("accr_ditations_39450")}),(0,i.jsx)("option",{value:je.Delegation,children:t("d_l_gations_78318")}),(0,i.jsx)("option",{value:je.Event,children:t("Event")}),(0,i.jsx)("option",{value:je.Position,children:t("missions_63972")}),(0,i.jsx)("option",{value:je.UserInfo,children:t("membres_11310")})]}),(0,i.jsx)(Vl,{hint:t("titre_de_la_que_69079"),label:t("nom_du_champ_48329"),name:"customField.name"}),(0,i.jsx)(Vl,{hint:t("nom_technique_u_74183"),label:(0,i.jsx)(Zv,{children:t("label_08243")}),name:"customField.label"}),(0,i.jsx)(Vl,{hint:t("sous_titre_de_l_90967"),label:(0,i.jsx)(Zv,{children:t("sous_titre_97472")}),name:"customField.description"}),(0,i.jsx)(Qj,{label:t("type_35427"),name:"customField.fieldType",state:e.isEdit?"disabled":"active",children:o(pn)}),y.customField.fieldType===We.Text&&(0,i.jsx)(Qj,{label:t("sous_type_de_ch_73883"),name:"customField.fieldSubtype",state:e.isEdit?"disabled":"active",children:o(gn)}),(0,i.jsx)(Ym,{isCreateVisible:!0,isSearchVisible:!0,label:t("cat_gorie_00291"),name:"customField.customFieldCategoryId",placeholder:t("rechercher_ou_c_16469"),onCreateClick:()=>{v(!0)},children:u.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),m===We.Select&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(oE,{change:n.change,isEdit:e.isEdit,isSelectV2:e.isSelectV2,values:y.customField.values}),(0,i.jsxs)(Ba,{direction:"column",gap:"2",children:[(0,i.jsx)(Ar,{color:"gray800",fontWeight:"semiBold",children:t("est_ce_qu_il_es_10680")}),(0,i.jsx)(Gm,{disabled:e.isEdit,name:"customField.canSelectMultiple",children:t("oui_il_est_pos_25233")})]})]}),m===We.Validation&&(0,i.jsx)(Yj,{accept:[yv.Images,yv.Pdf],acl:"public-read",label:(0,i.jsx)(Zv,{children:t("document_87149")}),organizationId:e.organizationId,prefix:"customField.document."}),k&&(0,i.jsxs)(Ba,{direction:"column",gap:"2",children:[(0,i.jsx)(Ar,{font:"gray800 textSm medium",children:t("chiffrement_des_84602")}),(0,i.jsx)(Jm,{disabled:A,name:"customField.isEncrypted",subtext:t("seuls_les_4_der_85542"),children:t("les_donn_es_son_85588")})]}),w&&(0,i.jsxs)(Ba,{direction:"column",gap:"2",children:[(0,i.jsx)(Ar,{color:"gray800",fontWeight:"semiBold",children:t("ce_champ_est_il_98722")}),(0,i.jsx)(Gm,{name:"customField.isPrivate",children:t("oui_le_champ_n_99925")})]}),S&&(0,i.jsxs)(Ba,{direction:"column",gap:"4",children:[(0,i.jsxs)(Ba,{direction:"column",gap:"2",children:[(0,i.jsx)(Ar,{color:"gray800",fontWeight:"semiBold",children:t("l_affichage_de_99189")}),(0,i.jsx)(Gm,{name:"customField.hasCondition",children:t("oui_le_champ_d_00513")})]}),p&&(0,i.jsxs)(Ba,{css:{paddingLeft:"$6"},direction:"column",gap:"4",children:[(0,i.jsx)(Ym,{isSearchVisible:!0,label:t("nom_du_champ_do_17104"),name:"customField.conditionCustomFieldId",children:c.map(e=>(0,i.jsx)("option",{value:e.id,children:mA(e)},e.id))}),_&&(0,i.jsx)(i.Fragment,{children:j?(0,i.jsxs)(Qj,{label:t("pour_quelle_val_60529",_.name),name:"customField.conditionValue",shouldParseAsBoolean:!0,children:[(0,i.jsx)("option",{value:"true",children:t("true")}),(0,i.jsx)("option",{value:"false",children:t("false")})]}):(0,i.jsx)(Ym,{isSearchVisible:!0,label:t("pour_quelle_val_60529",_.name),multiple:!0,name:"customField.conditionValue",children:C},_.id)})]})]})]}),(0,i.jsx)(Ya,{height:"7"})]}),(0,i.jsx)(ju,{children:(0,i.jsxs)(Ba,{gap:"3",justify:"end",children:[(0,i.jsx)(zl,{isLoading:r,onClick:s,children:e.isEdit?t("mettre_jour_l_31784"):t("cr_er_le_champ_05516")}),(0,i.jsx)(zl,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})})]}),I&&(0,i.jsx)(ny,{initialName:"",isEdit:!1,mutate:async t=>{const{customFieldCategoryCreate:n}=await a({organizationId:e.organizationId,category:{name:t}});return n},onClose:()=>{v(!1)},onSuccess:e=>{h(ty([...u,e])),n.change("customField.customFieldCategoryId",e.id)}})]})},validate:r.validateForForm(s.createUpdateCustomFieldSchema()),onSubmit:async i=>{const{customField:s}=await e.mutate({organizationId:e.organizationId,customField:{...i.customField,description:i.customField.description||""}});n(e.isEdit?t("le_champ_person_31517"):t("le_champ_person_90348")),e.onClose(),e.onSuccess(s)}})},aE=e=>{const{organizationId:t}=ti(),n=Zn(sE),{data:s,loader:o}=Qn("query OrganizationInfos($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n ...CreateCustomFieldInfos\n }\n}\n",{organizationId:e.organizationId},[Vs.CreateCustomFieldInfosFragment]);const{mutate:r}=function(e={}){return ei("mutation CustomFieldCreate($organizationId: OrganizationId!, $customField: CustomFieldInput!) {\n customField: customFieldCreate(organizationId: $organizationId, customField: $customField) {\n id\n name\n label\n fieldType\n fieldProperty\n\n category {\n id\n name\n }\n\n conditionCustomField {\n id\n name\n }\n\n values {\n id\n value\n }\n }\n}\n",e)}({redirectOnSuccess:!0});return o?(0,i.jsx)(iE,{returnPathFallback:Ps.CUSTOM_FIELDS(t)}):(0,i.jsx)(rE,{customFieldId:null,initialValues:{customField:n.customFieldInputDefault(null,s.organization.customFieldsCategories.nodes)},isEdit:!1,isFromForm:e.isFromForm,isSelectV2:!0,mutate:r,organization:s.organization,organizationId:e.organizationId,onClose:e.onClose,onSuccess:e.onSuccess})},lE=e=>{const{organizationId:t}=ti(),n=Zn(sE),{data:s,loader:o}=Qn("query CustomFieldToEdit($organizationId: OrganizationId!, $customFieldId: CustomFieldId!) {\n organization(id: $organizationId) {\n ...CreateCustomFieldInfos\n\n customField(id: $customFieldId) {\n name\n label\n customFieldCategoryId\n description\n variety\n fieldType\n fieldSubtype\n isPrivate\n hasCondition\n conditionCustomFieldId\n canSelectMultiple\n conditionValue\n isSelectV2\n isEncrypted\n\n document {\n acl\n name\n key\n }\n\n values {\n id\n value\n }\n }\n }\n}\n",{organizationId:e.organizationId,customFieldId:e.customFieldId},[Vs.CreateCustomFieldInfosFragment]);const{mutate:r}=function(e={}){return ei("mutation CustomFieldUpdate(\n $organizationId: OrganizationId!\n $customFieldId: CustomFieldId!\n $customField: CustomFieldInput!\n) {\n customField: customFieldUpdate(\n organizationId: $organizationId\n customFieldId: $customFieldId\n customField: $customField\n ) {\n id\n name\n label\n fieldType\n fieldProperty\n\n category {\n id\n name\n }\n\n conditionCustomField {\n id\n name\n }\n\n values {\n id\n value\n }\n }\n}\n",e)}({redirectOnSuccess:!0});return o?(0,i.jsx)(iE,{returnPathFallback:Ps.CUSTOM_FIELDS(t)}):(0,i.jsx)(rE,{customFieldId:e.customFieldId,initialValues:{customField:n.customFieldInputDefault(s.organization.customField,s.organization.customFieldsCategories.nodes)},isEdit:!0,isSelectV2:s.organization.customField.isSelectV2,mutate:t=>r({...t,customFieldId:e.customFieldId}),organization:s.organization,organizationId:e.organizationId,onClose:e.onClose,onSuccess:e.onSuccess})},dE=e=>{const{params:{organizationId:t,customFieldId:n}}=vl();return(0,i.jsx)(lE,{customFieldId:n,organizationId:t,...e})},cE=e=>{const t=Xn(),[n,s]=(0,L.useState)(e.initialName);return(0,i.jsxs)(au,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Ba,{justify:"center",children:(0,i.jsx)(sC,{color:"primary",icon:"sliders"})}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(Ar,{color:"gray900",fontSize:"textLg",fontWeight:"medium",textAlign:"center",children:t("nouvelle_sectio_88105")}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ar,{color:"gray500",textAlign:"center",children:t("ajouter_des_sec_58545")}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(Bl,{label:t("nom_de_la_secti_38728"),value:n,onChange:s}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsxs)(Ba,{gap:"3",justify:"end",children:[(0,i.jsx)(zl,{onClick:()=>{e.onAdd(n),e.onClose()},children:m(e.initialName)?t("renommer_la_sec_00650"):t("cr_er_la_sectio_96175")}),(0,i.jsx)(zl,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},uE=e=>{const t=Xn(),[n,s]=(0,L.useState)(e.initialText);return(0,i.jsxs)(au,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Ba,{justify:"center",children:(0,i.jsx)(sC,{color:"primary",icon:"sliders"})}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(Ar,{color:"gray900",fontSize:"textLg",fontWeight:"medium",textAlign:"center",children:t("champ_texte_lib_91587")}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ar,{color:"gray500",textAlign:"center",children:t("ajouter_des_cha_68672")}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(Ar,{css:{overflow:"hidden auto"},width:1,children:(0,i.jsx)(ob,{initialValue:n,onChange:s})}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsxs)(Ba,{gap:"3",justify:"end",children:[(0,i.jsx)(zl,{onClick:()=>{e.onAdd(n),e.onClose()},children:m(e.initialText)?t("mettre_jour_l_69246"):t("ajouter_le_cham_74670")}),(0,i.jsx)(zl,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},hE=e=>{const{translate:t,params:{organizationId:n}}=vl(),{canCustomFieldEdit:s}=$S(),[o,r]=(0,L.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Iu.sx,{draggableId:e.elementId,index:e.index,children:n=>(0,i.jsxs)(Ba,{align:"center",css:{bd:!0,padding:"$4 $6",...e.css},gap:"5",...n.draggableProps,ref:n.innerRef,children:[(0,i.jsx)(Kb,{permissions:Hb.FORM_EDIT,children:(0,i.jsx)(Ar,{color:"gray300",css:{cursor:"grab"},fontSize:"textMd",...n.dragHandleProps,children:(0,i.jsx)(nl,{icon:"grip-vertical",iconStyle:"solid"})})}),(0,i.jsxs)(Ba,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsxs)(Ba,{gap:"2",children:[(0,i.jsx)(Ar,{color:"gray800",fontWeight:"semiBold",children:e.field.name}),e.field.conditionCustomField&&(0,i.jsxs)(km,{children:[(0,i.jsx)(Sm,{children:(0,i.jsx)(Ar,{color:"gray800",css:{cursor:"pointer"},fontWeight:"semiBold",children:(0,i.jsx)(nl,{icon:"split"})})}),(0,i.jsx)(wm,{placement:"top",children:t("ce_champ_d_pend_31209",e.field.conditionCustomField?.name)})]})]}),(0,i.jsx)(Ar,{color:"gray500",children:t(e.field.fieldType)})]}),(0,i.jsxs)(Kb,{permissions:Hb.FORM_EDIT,children:[(0,i.jsx)(ku,{value:e.isMandatory,onChange:t=>{e.toggleIsMandatory(e.index,t)},children:t("obligatoire_35326")}),(0,i.jsxs)(Ba,{gap:"2",children:[(0,i.jsxs)(km,{children:[(0,i.jsx)(Sm,{children:(0,i.jsx)(Ar,{children:(0,i.jsx)(zl,{color:"white",leftIcon:"trash-can",size:"sm",onClick:()=>{e.onDelete(e.index)}})})}),(0,i.jsx)(wm,{placement:"top",children:t("supprimer_le_ch_99740")})]}),e.showEdit&&s&&(0,i.jsxs)(km,{children:[(0,i.jsx)(Sm,{children:(0,i.jsx)(Ar,{children:(0,i.jsx)(zl,{color:"white",leftIcon:"pen",size:"sm",onClick:()=>{r(!0)}})})}),(0,i.jsx)(wm,{placement:"top",children:t("_diter_le_champ_78018")})]})]})]})]})}),o&&(0,i.jsx)(lE,{customFieldId:e.field.id,organizationId:n,onClose:()=>{r(!1)},onSuccess:e.updateCustomField})]})},mE=e=>{const{translate:t}=vl(),n=(0,L.useMemo)(()=>e.conditionCustomFields.map(e=>(0,i.jsx)("option",{value:e.id,children:mA(e)},e.id)),[e.conditionCustomFields]),s=e.conditionCustomFields.find(t=>t.id===e.conditionCustomFieldId),o=zy(s);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yc,{isSearchVisible:!0,label:t("champ_sur_leque_68198"),renderOnPortal:!0,values:e.conditionCustomFieldId?[e.conditionCustomFieldId]:[],onChange:t=>{so(t)?e.setConditionCustomFieldId(t[0]):e.setConditionCustomFieldId(null)},children:n}),s&&(0,i.jsx)(i.Fragment,{children:s.fieldType===We.Checkbox?(0,i.jsxs)($u,{label:t("pour_quelle_val_60529",s.name),shouldParseAsBoolean:!0,value:e.conditionValue,onChange:e.setConditionValue,children:[(0,i.jsx)("option",{value:"true",children:t("true")}),(0,i.jsx)("option",{value:"false",children:t("false")})]}):(0,i.jsx)(yc,{isSearchVisible:!0,label:t("pour_quelle_val_60529",s.name),multiple:!0,renderOnPortal:!0,values:e.conditionValue,onChange:e.setConditionValue,children:o},s.id)})]})},gE=e=>{const{translate:t}=vl(),[n,s]=L.useState(e.element.conditionCustomFieldId),[o,r]=L.useState(e.element.conditionValue),a=null!==n&&("boolean"==typeof o||so(o));return(0,i.jsx)(Lb,{isOpen:e.isOpen,onClose:e.onClose,children:(0,i.jsxs)(Nb,{children:[(0,i.jsx)(Mb,{icon:"split",children:t("ajouter_une_con_66324")}),(0,i.jsx)(Fb,{gap:"4",children:(0,i.jsx)(mE,{conditionCustomFieldId:n,conditionCustomFields:e.conditionCustomFields,conditionValue:o,setConditionCustomFieldId:t=>{const n=e.conditionCustomFields.find(e=>e.id===t);n&&(r(n.fieldType===We.Checkbox||[]),s(t))},setConditionValue:r})}),(0,i.jsxs)(Pb,{hideCancelButton:!0,children:[(0,i.jsx)(zl,{disabled:!a,onClick:()=>{e.onConditionAdd(e.index,n,o),e.onClose()},children:t("ajouter_une_con_66324")}),(0,i.jsx)(zl,{color:"white",onClick:()=>{e.onConditionDelete(e.index),e.onClose()},children:t("supprimer_la_co_57888")})]})]})})},pE=e=>{const t=Xn(),[n,s]=(0,L.useState)(!1),[o,r]=(0,L.useState)(!1),a=(0,L.useMemo)(()=>e.conditionCustomFields.find(t=>t.id===e.element.conditionCustomFieldId),[e.element.conditionCustomFieldId,e.conditionCustomFields]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Iu.sx,{draggableId:e.element.id,index:e.index,children:n=>(0,i.jsxs)(Ba,{align:"center",css:{background:"$gray900",bd:"gray900 2",color:"white",marginBottom:"$2",marginTop:"$5",padding:"$4 $6"},gap:"5",...n.draggableProps,ref:n.innerRef,children:[(0,i.jsx)(Kb,{permissions:Hb.FORM_EDIT,children:(0,i.jsx)(Ar,{color:"gray300",css:{cursor:"grab"},fontSize:"textMd",...n.dragHandleProps,children:(0,i.jsx)(nl,{icon:"grip-vertical",iconStyle:"solid"})})}),(0,i.jsxs)(Ba,{css:{flex:"1"},gap:"2",children:[(0,i.jsx)(Ar,{fontWeight:"semiBold",children:e.element.section||""}),a&&(0,i.jsxs)(km,{children:[(0,i.jsx)(Sm,{children:(0,i.jsx)(Ar,{color:"white",css:{cursor:"pointer"},fontWeight:"semiBold",children:(0,i.jsx)(nl,{icon:"split"})})}),(0,i.jsx)(wm,{placement:"top",children:t("cette_section_d_50768",a.name)})]})]}),(0,i.jsx)(Kb,{permissions:Hb.FORM_EDIT,children:(0,i.jsxs)(Ba,{gap:"2",children:[(0,i.jsxs)(km,{children:[(0,i.jsx)(Sm,{children:(0,i.jsx)(Ar,{children:(0,i.jsx)(zl,{color:"white",leftIcon:"split",size:"sm",onClick:()=>r(!0)})})}),(0,i.jsx)(wm,{placement:"top",children:t("ajouter_une_con_66324")})]}),(0,i.jsxs)(km,{children:[(0,i.jsx)(Sm,{children:(0,i.jsx)(Ar,{children:(0,i.jsx)(zl,{color:"white",leftIcon:"trash-can",size:"sm",onClick:()=>e.onDelete(e.index)})})}),(0,i.jsx)(wm,{placement:"top",children:t("supprimer_43083")})]}),(0,i.jsxs)(km,{children:[(0,i.jsx)(Sm,{children:(0,i.jsx)(Ar,{children:(0,i.jsx)(zl,{color:"white",leftIcon:"pen",size:"sm",onClick:()=>s(!0)})})}),(0,i.jsx)(wm,{placement:"top",children:t("renommer_42135")})]})]})})]})}),n&&(0,i.jsx)(cE,{initialName:e.element.section||"",onAdd:t=>{e.onRename(e.index,t)},onClose:()=>{s(!1)}}),o&&(0,i.jsx)(gE,{conditionCustomFields:e.conditionCustomFields,element:e.element,index:e.index,isOpen:o,onClose:()=>r(!1),onConditionAdd:e.onConditionAdd,onConditionDelete:e.onConditionDelete})]})},fE=e=>{const t=Xn(),[n,s]=(0,L.useState)(!1),[o,r]=(0,L.useState)(!1),a=(0,L.useMemo)(()=>e.conditionCustomFields.find(t=>t.id===e.element.conditionCustomFieldId),[e.element.conditionCustomFieldId,e.conditionCustomFields]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Iu.sx,{draggableId:e.element.id,index:e.index,children:n=>(0,i.jsxs)(Ba,{align:"center",css:{bd:!0,padding:"$4 $6"},gap:"5",...n.draggableProps,ref:n.innerRef,children:[(0,i.jsx)(Kb,{permissions:Hb.FORM_EDIT,children:(0,i.jsx)(Ar,{color:"gray300",css:{cursor:"grab"},fontSize:"textMd",...n.dragHandleProps,children:(0,i.jsx)(nl,{icon:"grip-vertical",iconStyle:"solid"})})}),(0,i.jsxs)(Ba,{align:"center",css:{flex:"1"},gap:"2",children:[(0,i.jsx)(Ar,{children:(0,i.jsx)(Cg,{text:e.element.text||""})}),a&&(0,i.jsxs)(km,{children:[(0,i.jsx)(Sm,{children:(0,i.jsx)(Ar,{color:"gray800",css:{cursor:"pointer"},fontWeight:"semiBold",children:(0,i.jsx)(nl,{icon:"split"})})}),(0,i.jsx)(wm,{placement:"top",children:t("ce_texte_d_pend_87251",a.name)})]})]}),(0,i.jsx)(Kb,{permissions:Hb.FORM_EDIT,children:(0,i.jsxs)(Ba,{gap:"2",children:[(0,i.jsxs)(km,{children:[(0,i.jsx)(Sm,{children:(0,i.jsx)(Ar,{children:(0,i.jsx)(zl,{color:"white",leftIcon:"split",size:"sm",onClick:()=>r(!0)})})}),(0,i.jsx)(wm,{placement:"top",children:t("ajouter_une_con_66324")})]}),(0,i.jsxs)(km,{children:[(0,i.jsx)(Sm,{children:(0,i.jsx)(Ar,{children:(0,i.jsx)(zl,{color:"white",leftIcon:"trash-can",size:"sm",onClick:()=>e.onDelete(e.index)})})}),(0,i.jsx)(wm,{placement:"top",children:t("supprimer_43083")})]}),(0,i.jsxs)(km,{children:[(0,i.jsx)(Sm,{children:(0,i.jsx)(Ar,{children:(0,i.jsx)(zl,{color:"white",leftIcon:"pen",size:"sm",onClick:()=>s(!0)})})}),(0,i.jsx)(wm,{placement:"top",children:t("_diter_62574")})]})]})})]})}),n&&(0,i.jsx)(uE,{initialText:e.element.text||"",onAdd:t=>{e.onEdit(e.index,t)},onClose:()=>s(!1)}),o&&(0,i.jsx)(gE,{conditionCustomFields:e.conditionCustomFields,element:e.element,index:e.index,isOpen:o,onClose:()=>r(!1),onConditionAdd:e.onConditionAdd,onConditionDelete:e.onConditionDelete})]})},_E=e=>{const t=(0,L.useMemo)(()=>Object.fromEntries(e.customFields.map(e=>[e.id,e])),[e.customFields]),n=(0,L.useMemo)(()=>e.customFields.filter(e=>[We.Checkbox,We.Country,We.Language,We.Nationality,We.Select].includes(e.fieldType)),[e.customFields]);return(0,i.jsx)(Iu.JY,{onDragEnd:e.onDragEnd,children:(0,i.jsx)(Iu.gL,{droppableId:"1",children:s=>(0,i.jsxs)(Ba,{direction:"column",gap:"3",width:1,...s.droppableProps,ref:s.innerRef,children:[e.elements.map((s,o)=>{switch(s.elementType){case qe.Field:return(0,i.jsx)(hE,{elementId:s.id,field:t[s.customFieldId],index:o,isMandatory:s.isMandatory,showEdit:!0,toggleIsMandatory:e.fieldsToggleMandatory,updateCustomField:e.updateCustomField,onDelete:e.onDelete},s.id);case qe.Section:return(0,i.jsx)(pE,{conditionCustomFields:n,element:s,index:o,onConditionAdd:e.onConditionAdd,onConditionDelete:e.onConditionDelete,onDelete:e.onDelete,onRename:e.sectionOnRename},s.id);case qe.Text:return(0,i.jsx)(fE,{conditionCustomFields:n,element:s,index:o,onConditionAdd:e.onConditionAdd,onConditionDelete:e.onConditionDelete,onDelete:e.onDelete,onEdit:e.textOnEdit},s.id);default:return ll(s.elementType)}}),s.placeholder]})})})},xE=e=>{const{translate:t,params:{organizationId:n}}=vl(),{isOrganizationAdmin:s}=TI(),[o,r]=L.useState(!1),[a,l]=L.useState(!1),[d,c]=L.useState(!1),[u,h]=L.useState(e.customFields),m=L.useMemo(()=>new Set(e.elements.flatMap(e=>e.elementType===qe.Field?[e.customFieldId]:[])),[e.elements]),g=L.useCallback(({reason:t,source:n,destination:i})=>{"DROP"===t&&i&&n.index!==i.index&&e.setElements(lo(e.elements,n.index,i.index))},[e.elements,e.setElements]),p=L.useCallback(t=>{m.has(t.id)?e.setElements(e.elements.filter(e=>!e.customFieldId||e.customFieldId!==t.id)):e.setElements([...e.elements,{id:V(),elementType:qe.Field,customFieldId:t.id,isMandatory:!0,hasCondition:!1,conditionCustomFieldId:null,conditionValue:!1}])},[e.elements,e.setElements,m]),f=L.useCallback((t,n)=>{e.setElements((0,xu.jM)(e=>{e[t].isMandatory=n}))},[e.setElements]),_=L.useCallback(t=>{e.setElements([...e.elements,{id:V(),elementType:qe.Section,section:t,hasCondition:!1,conditionCustomFieldId:null,conditionValue:!1}])},[e.elements,e.setElements]),x=L.useCallback((t,n)=>{e.setElements((0,xu.jM)(e=>{e[t].section=n}))},[e.setElements]),I=L.useCallback(t=>{e.setElements([...e.elements,{id:V(),elementType:qe.Text,text:t,hasCondition:!1,conditionCustomFieldId:null,conditionValue:!1}])},[e.elements,e.setElements]),v=L.useCallback((t,n)=>{e.setElements((0,xu.jM)(e=>{e[t].text=n}))},[e.setElements]),b=L.useCallback(t=>{e.setElements((0,xu.jM)(e=>{e.splice(t,1)}))},[e.setElements]),j=L.useCallback(e=>{h(u.map(t=>t.id===e.id?e:t))},[u]),C=L.useCallback((t,n,i)=>{e.setElements((0,xu.jM)(e=>{e[t].hasCondition=!0,e[t].conditionCustomFieldId=n,e[t].conditionValue=i}))},[e.setElements]),y=L.useCallback(t=>{e.setElements((0,xu.jM)(e=>{e[t].hasCondition=!1,e[t].conditionCustomFieldId=null,e[t].conditionValue=!1}))},[e.setElements]);return(0,i.jsxs)(i.Fragment,{children:[0===e.elements.length?(0,i.jsx)(Ar,{height:.5,width:1,children:(0,i.jsx)(Gk,{subtitle:t("ajouter_des_cha_37944"),title:t("aucun_champ_ou_18338")})}):(0,i.jsx)(_E,{customFields:u,elements:e.elements,fieldsToggleMandatory:f,sectionOnRename:x,textOnEdit:v,updateCustomField:j,onConditionAdd:C,onConditionDelete:y,onDelete:b,onDragEnd:g}),(0,i.jsxs)(Kb,{permissions:Hb.FORM_EDIT,children:[(0,i.jsx)(Ya,{height:"6"}),(0,i.jsxs)(Ba,{gap:"4",justify:0===e.elements.length?"center":"start",width:1,children:[(0,i.jsxs)(Wd,{children:[(0,i.jsx)(Xd,{children:s?(0,i.jsx)(nE,{menu:(0,i.jsx)(Kd,{icon:"pen-field",onClick:()=>{c(!0)},children:t("cr_eer_un_champ_08883")}),children:t("ajouter_des_cha_35843")}):(0,i.jsx)(zl,{children:t("ajouter_des_cha_35843")})}),(0,i.jsx)(Zd,{css:{padding:"0"},placement:"top-start",width:400,children:(0,i.jsx)(kC,{customFields:u,selectedCustomFieldsIds:m,toggle:p})})]}),(0,i.jsx)(zl,{color:"white",onClick:()=>{r(!0)},children:t("ajouter_une_sec_90063")}),(0,i.jsx)(zl,{color:"white",onClick:()=>{l(!0)},children:t("ajouter_un_cham_31151")})]})]}),o&&(0,i.jsx)(cE,{initialName:"",onAdd:_,onClose:()=>{r(!1)}}),a&&(0,i.jsx)(uE,{initialText:"",onAdd:I,onClose:()=>{l(!1)}}),d&&(0,i.jsx)(aE,{isFromForm:!0,organizationId:n,onClose:()=>{c(!1)},onSuccess:async t=>{h([...u,t]),setTimeout(()=>{p(t),e.onSave()}),c(!1)}})]})},IE=()=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(lc,{borderRadius:"$2",height:76,width:1}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(lc,{borderRadius:"$2",height:76,width:1}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(lc,{borderRadius:"$2",height:76,width:1})]}),vE=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:s,formId:o}}=vl(),{data:r,isLoading:a}=Qn("query FormElements($organizationId: OrganizationId!, $formId: FormId!) {\n organization(id: $organizationId) {\n ...FormCustomFields\n\n form(id: $formId) {\n name\n\n elements {\n ...FormElementsElement\n }\n }\n }\n}\n",{organizationId:n,formId:o},[Vs.FormCustomFieldsFragment,Vs.FormElementsElementFragment]);Md(r.organization?.form.name??"");const{mutate:l,isLoading:d}=function(e={}){return ei("mutation FormElementsUpdate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $formId: FormId!\n $elements: [FormsElementInput!]!\n) {\n formElementsUpdate(\n organizationId: $organizationId\n eventId: $eventId\n formId: $formId\n elements: $elements\n ) {\n id\n }\n}\n",e)}(),[c,u]=(0,L.useState)([]),[h,m]=(0,L.useState)(""),g=(0,L.useCallback)(async()=>{await l({organizationId:n,eventId:s,formId:o,elements:c.map((e,t)=>({id:e.id,elementType:e.elementType,customFieldId:e.customFieldId,section:e.section,text:e.text,isMandatory:e.isMandatory,hasCondition:e.hasCondition,conditionCustomFieldId:e.conditionCustomFieldId,conditionValue:e.conditionValue,index:t}))}),m(JSON.stringify(c))},[l,c]),[p,f]=(0,L.useState)(!1),_=(0,L.useCallback)(()=>{JSON.stringify(c)===h?e.push(Vi.FORMS({organizationId:n,eventId:s})):f(!0)},[c,h]);return(0,L.useEffect)(()=>{u(r.organization?.form.elements??[]),m(JSON.stringify(r.organization?.form.elements??[]))},[r.organization]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(XS,{button:(0,i.jsx)(zl,{isLoading:d,onClick:g,children:t("enregistrer_06519")}),title:r.organization?.form.name??"-",onClose:_,children:(0,i.jsx)(Ba,{justify:"center",width:1,children:(0,i.jsxs)(Ba,{direction:"column",width:"$container",children:[(0,i.jsx)(Ya,{height:"8"}),a?(0,i.jsx)(IE,{}):(0,i.jsx)(xE,{customFields:r.organization.formCustomFields.nodes,elements:c,setElements:u,onSave:g}),(0,i.jsx)(Ya,{height:"8"})]})})}),(0,i.jsx)(eE,{fallbackPath:Vi.FORMS({organizationId:n,eventId:s}),isOpen:p,onClose:()=>{f(!1)}})]})},bE=e=>(0,i.jsx)(Mc,{css:{background:e.isSelected?"$primary50":"white",cursor:"pointer","&:hover":{background:"$gray100"}},onClick:e.onClick,children:(0,i.jsxs)(Oc,{align:"start",direction:"column",justify:"center",children:[(0,i.jsx)(Ar,{color:"gray900",fontWeight:"medium",children:e.title}),(0,i.jsx)(Ar,{color:"gray500",children:e.subtitle})]})});let jE=class extends Gl{constructor(e){super(e)}emailTemplateDefault(e,t,n,i,s){const o=this.emailTypeToDefault(e,t,i,s);return n&&(o.subject=n.subject,o.content=n.content),{useDefault:n?.useDefault??!0,emailType:e,emailSenderId:n?.emailSenderId,attachments:n?.attachments??[],hasCalendarInvite:n?.hasCalendarInvite??!1,calendarInviteName:n?.calendarInviteName??null,calendarInviteStartDate:n?.calendarInviteStartDate??null,calendarInviteStartTime:n?.calendarInviteStartTime??null,calendarInviteEndDate:n?.calendarInviteEndDate??null,calendarInviteEndTime:n?.calendarInviteEndTime??null,...o}}emailTemplateSchema(){return d.Ik().shape({useDefault:d.zM().required(""),emailType:d.Yj().required(this.t("le_type_d_e_mai_84281")).oneOf(un,this.t("le_type_d_e_mai_84281")),subject:d.Yj().when("useDefault",{is:!1,then:e=>e.required(this.t("le_sujet_est_re_18923"))}),content:d.Yj().when("useDefault",{is:!1,then:e=>e.required(this.t("le_contenu_est_45048")).test("contains-code",this.t("le_contenu_doit_64437"),function(){return!(!this.parent.useDefault&&this.parent.emailType===$e.Code)||this.parent.content.includes("{code}")})}),attachments:d.YO().of(d.Yj()),hasCalendarInvite:d.zM().required(),calendarInviteName:d.Yj().when("hasCalendarInvite",{is:!0,then:e=>e.required(this.t("nom_de_l_v_nem_58512")),otherwise:e=>e.nullable()}),calendarInviteStartDate:Qm.when("hasCalendarInvite",{is:!0,then:e=>e.required(this.t("la_date_de_d_bu_05030")).typeError(this.t("la_date_de_d_bu_05030")),otherwise:e=>e.nullable()}),calendarInviteStartTime:d.Yj().when("hasCalendarInvite",{is:!0,then:e=>e.required(this.t("heure_de_d_but_90785")),otherwise:e=>e.nullable()}),calendarInviteEndDate:Qm.when("hasCalendarInvite",{is:!0,then:e=>e.required(this.t("la_date_de_fin_32246")).typeError(this.t("la_date_de_fin_32246")),otherwise:e=>e.nullable()}),calendarInviteEndTime:d.Yj().when("hasCalendarInvite",{is:!0,then:e=>e.required(this.t("l_heure_de_fin_78626")),otherwise:e=>e.nullable()})})}updateEmailTemplateSchema(){return d.Ik().shape({emailTemplate:this.emailTemplateSchema()})}emailTypeToDefault(e,t,n,i){switch(e){case $e.Accreditations:return this.accreditationsDefault();case $e.AccreditationsRefused:return this.accreditationsRefusedDefault();case $e.Assignments:return this.assignmentsDefault();case $e.Code:return this.codeDefault(n,i);case $e.FormInvite:return this.formInviteDefault();case $e.FormSubmit:return this.formSubmitDefault(n);case $e.NotifyLeaders:return this.notifyLeadersDefault(t);case $e.DelegationCategoryLeaderAssign:return this.delegationCategoryLeaderAssign(t);case $e.DelegationFormInvite:return this.delegationFormInviteDefault();case $e.DelegationLeaderAssign:return this.delegationLeaderAssign();case $e.PositionCategoryLeaderAssign:return this.positionCategoryLeaderAssignDefault(t);case $e.PositionLeaderAssign:return this.positionLeaderAssign(t);case $e.Refused:return this.refusedDefault();case $e.VolunteerRegistration:return this.volunteerRegistrationDefault();case $e.Campaign:case $e.DelegationsImport:case $e.EventsImport:case $e.FilesImport:case $e.Documents:case $e.EventInvite:case $e.Export:case $e.MembersImport:case $e.NewMember:case $e.OrganizationInvite:case $e.PositionsImport:throw new Error("Impossible to change this email");default:return ll()}}accreditationsDefault(){return{subject:this.t("_event_name_49280"),content:this.t("accreditations_default")}}accreditationsRefusedDefault(){return{subject:this.t("_event_name_01805"),content:this.t("accreditations_refused_default")}}assignmentsDefault(){return{subject:this.t("_event_name_72063"),content:this.t("assignments_default")}}codeDefault(e,t){return{subject:e&&!t?this.t("code_de_v_rific_41117"):this.t("code_de_connexi_57121"),content:this.t("code_default")}}formInviteDefault(){return{subject:this.t("form_invite_subject"),content:this.t("form_invite_content")}}formSubmitDefault(e){return e?{subject:this.t("_event_name_12686"),content:this.t("form_submit_event_default")}:{subject:this.t("_organization_n_21926"),content:this.t("form_submit_organization_default")}}notifyLeadersDefault(e){return{subject:this.t("_event_name_95901"),content:this.t("notify_leaders_default_1",e.href,Cd)}}delegationCategoryLeaderAssign(e){return{subject:this.t("_event_name_69973"),content:this.t("_p_bonjour_use_97817",Cd,e.href,Cd)}}delegationLeaderAssign(){return{subject:this.t("_event_name_92886"),content:this.t("_p_bonjour_use_96380")}}delegationFormInviteDefault(){return{subject:this.t("invitation_re_29033"),content:this.t("_p_bonjour_use_29618")}}positionCategoryLeaderAssignDefault(e){return{subject:this.t("_event_name_63708"),content:this.t("category_leader_assign_default_1",Cd,e.href,Cd)}}positionLeaderAssign(e){return{subject:this.t("_event_name_60486"),content:this.t("leader_assign_default_1",Cd,e.href,Cd)}}refusedDefault(){return{subject:this.t("_event_name_59248"),content:this.t("refused_default")}}volunteerRegistrationDefault(){return{subject:this.t("_event_name_12686"),content:this.t("volunteer_registration_default")}}};jE=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[qn])],jE);const CE=e=>{const{history:t,translate:n}=vl(),{organization:s}=TI(),{event:o}=wb(),{data:r,loader:a}=Qn("query EmailTemplate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $formId: FormId\n $source: LoginCodeSource\n $emailType: EmailType!\n) {\n organization(id: $organizationId) {\n emailsSenders(isValidToSendEmail: true) {\n id\n name\n }\n\n event: eventMaybe(id: $eventId) {\n customDocuments {\n slug\n name\n }\n }\n\n emailTemplate(emailType: $emailType, eventId: $eventId, formId: $formId, source: $source) {\n emailType\n useDefault\n subject\n content\n emailSenderId\n attachments\n hasCalendarInvite\n calendarInviteName\n calendarInviteStartDate\n calendarInviteStartTime\n calendarInviteEndDate\n calendarInviteEndTime\n }\n }\n}\n",{organizationId:e.organizationId,eventId:e.eventId,formId:e.formId,source:e.source,emailType:e.emailType},[]);const{mutate:l,isLoading:d}=function(e={}){return ei("mutation EmailTemplateUpdate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $formId: FormId\n $source: LoginCodeSource\n $emailTemplate: EmailsTemplateInput!\n) {\n emailTemplateUpdate(\n organizationId: $organizationId\n eventId: $eventId\n formId: $formId\n source: $source\n emailTemplate: $emailTemplate\n ) {\n id\n }\n}\n",e)}(),c=Zn(jE),u=Zn(Ua),h=o?.useDocuments&&(e.emailType===$e.Accreditations||e.emailType===$e.Assignments||e.emailType===$e.FormSubmit&&e.eventId),m=e.emailType===$e.Accreditations||e.emailType===$e.Assignments||e.emailType===$e.FormSubmit||e.emailType===$e.VolunteerRegistration;return a||(0,i.jsx)(kl,{direction:"column",initialValues:{emailTemplate:c.emailTemplateDefault(e.emailType,P.HEAVENT_APP_URL,r.organization.emailTemplate,e.eventId,e.formId)},render:({handleSubmit:o,values:a})=>(0,i.jsxs)(Ba,{direction:"column",gap:"6",children:[(0,i.jsx)(ml,{children:n("contenu_de_l_e_19848")}),(0,i.jsx)(Gm,{name:"emailTemplate.useDefault",children:n("utiliser_le_mod_93521")}),!a.emailTemplate.useDefault&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Vl,{label:n("sujet_de_l_e_ma_66809"),name:"emailTemplate.subject"}),(0,i.jsx)(Ym,{hint:n("cet_metteur_se_80394"),isCreateVisible:!0,isSearchVisible:!0,label:(0,i.jsx)(Zv,{children:n("_metteur_de_l_e_51616")}),name:"emailTemplate.emailSenderId",onCreateClick:()=>{t.push(Ps.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(e.organizationId))},children:(r.organization?.emailsSenders??[]).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(rb,{hint:(0,i.jsx)(Ar,{css:{"& a":{color:"$primary500"}},dangerouslySetInnerHTML:{__html:n("vous_pouvez_ajo_23408")}}),label:n("contenu_de_l_e_19848"),name:"emailTemplate.content"}),h&&(0,i.jsxs)(Ym,{isSearchVisible:!0,label:n("pi_ce_s_jointe_82370"),multiple:!0,name:"emailTemplate.attachments",children:[(r.organization?.event?.customDocuments??[]).map(e=>(0,i.jsx)("option",{value:e.slug,children:e.name},e.slug)),s.customBadges.map(e=>(0,i.jsx)("option",{value:e,children:Vx(e)},e)),sv.map(e=>(0,i.jsx)("option",{value:e,children:n(e)},e))]}),m&&(0,i.jsx)(db,{hasCalendarInvite:a.emailTemplate.hasCalendarInvite,prefix:"emailTemplate."})]}),(0,i.jsx)(Kb,{permissions:Hb.EMAIL_EDIT,children:(0,i.jsx)(Ba,{children:(0,i.jsx)(zl,{isLoading:d,onClick:o,children:n("enregistrer_le_77369")})})})]}),validate:u.validateForForm(c.updateEmailTemplateSchema()),width:1,onSubmit:async t=>{await l({organizationId:e.organizationId,eventId:e.eventId,formId:e.formId,source:e.source,emailTemplate:t.emailTemplate})}})},yE=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:s,formId:o}}=vl(),{data:r}=da({organizationId:n,formId:o});Md(r.organization?.form.name??"");const[a,l]=(0,L.useState)($e.FormSubmit);return(0,i.jsx)(XS,{title:r.organization?.form.name??"-",onClose:()=>{e.push(Vi.FORMS({organizationId:n,eventId:s}))},children:(0,i.jsx)(Ba,{justify:"center",width:1,children:(0,i.jsxs)(Ba,{direction:"column",width:"$container",children:[(0,i.jsx)(Ya,{height:"8"}),(0,i.jsxs)(Ba,{gap:"7",children:[(0,i.jsxs)(Ba,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(Ar,{color:"gray900",fontSize:"textLg",fontWeight:"medium",children:t("liste_des_e_mai_73508")}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsxs)(Sc,{children:[(0,i.jsx)(kc,{children:(0,i.jsx)(Gc,{children:t("type_d_e_mail_06577")})}),(0,i.jsx)(bE,{isSelected:a===$e.FormSubmit,subtitle:t("cet_e_mail_est_29404"),title:t("remplissage_du_09925"),onClick:()=>l($e.FormSubmit)}),(0,i.jsx)(bE,{isSelected:a===$e.Code,subtitle:t("cet_e_mail_est_49525"),title:t("code_20843"),onClick:()=>l($e.Code)}),s&&(0,i.jsx)(bE,{isSelected:a===$e.FormInvite,subtitle:t("cet_email_est_e_46197"),title:t("invitation_d_un_88753"),onClick:()=>l($e.FormInvite)})]})]}),(0,i.jsx)(Ar,{css:{borderRight:"1px solid $gray200",width:"1px"}}),(0,i.jsx)(Ba,{css:{flex:"1",py:"$3"},children:(0,i.jsx)(CE,{emailType:a,eventId:s,formId:o,organizationId:n,source:null})})]}),(0,i.jsx)(Ya,{height:"8"})]})})})};let kE=class extends Gl{constructor(e){super(e)}formParametersBroadcastInputDefault(e){return{segmentsIds:(e?.segments??[]).map(e=>e.segmentId),noAccessTitle:e?.noAccessTitle||"",noAccessMessage:e?.noAccessMessage||""}}formParametersBroadcastInputSchema(){return d.Ik().shape({segmentsIds:d.YO().of(d.ai())})}updateFormParametersBroadcastSchema(){return d.Ik().shape({form:this.formParametersBroadcastInputSchema()})}};kE=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[qn])],kE);const AE=({children:e,isActive:t,replace:n=!0,to:s})=>{const o=ii(),r=t?.(o.pathname)??o.pathname===s;return(0,i.jsx)(Ar,{css:{background:r?"$primary50":"transparent",borderRadius:"6px",color:r?"$primary500":"$gray500",cursor:r?"default":"pointer",padding:"$2 $3"},children:(0,i.jsx)(el,{replace:n,to:s,children:e})})},wE=e=>(0,i.jsx)(Ba,{"aria-orientation":"vertical",as:Ma.Nav,direction:"column",gap:"2",role:"menubar",width:1,children:e.children}),SE=e=>{const{translate:t,params:n}=vl(),{hasFeature:s}=TI(),{event:o}=wb();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(hd,{css:{py:"$8"},gridtemplatecolumns:"1fr 210px 80px 880px 1fr",gridtemplaterows:"1fr",width:1,children:[(0,i.jsx)(Ar,{css:{gridColumn:"2 / 3"},children:(0,i.jsxs)(wE,{children:[(0,i.jsx)(AE,{to:Vi.FORM_PARAMETERS_GENERAL(n),children:t("g_n_ral_64953")}),(0,i.jsx)(AE,{to:Vi.FORM_PARAMETERS_DESIGN(n),children:t("design_15043")}),n.eventId&&(0,i.jsx)(AE,{to:Vi.FORM_PARAMETERS_AVAILABILITIES(n),children:t("disponibilit_s_49923")}),n.eventId&&o.usePositions&&(0,i.jsx)(AE,{to:Vi.FORM_PARAMETERS_MISSIONS(n),children:t("missions_63972")}),n.eventId&&o.useAccreditations&&s(Be.Accreditation)&&(0,i.jsx)(AE,{to:Vi.FORM_PARAMETERS_ACCREDITATIONS(n),children:t("accr_ditations_39450")}),(0,i.jsx)(AE,{to:Vi.FORM_PARAMETERS_BROADCAST(n),children:t("diffusion_56689")}),(0,i.jsx)(AE,{to:Vi.FORM_PARAMETERS_STATE(n),children:t("cl_turer_88223")})]})}),(0,i.jsx)(Ar,{css:{gridColumn:"4 / 5"},width:1,children:e.children})]}),(0,i.jsx)(eE,{fallbackPath:Vi.FORMS({organizationId:n.organizationId,eventId:n.eventId}),isOpen:e.isNotSavedOpen,onClose:e.onNotSavedClose})]})};function EE(e,t,n){const{history:i,params:{organizationId:s,eventId:o}}=vl(),[r,a]=(0,L.useState)(!1),[l,d]=(0,L.useState)(JSON.stringify(e)),c=(0,L.useCallback)(()=>{const e=JSON.stringify(t);l===e?i.push(Vi.FORMS({organizationId:s,eventId:o})):a(!0)},[l,t]),u=(0,L.useCallback)(()=>{a(!1)},[a]),h=(0,L.useCallback)(()=>{n(),d(JSON.stringify(t))},[n,t]);return(0,L.useEffect)(()=>{d(JSON.stringify(e))},[e]),{isNotSavedModalOpen:r,onClose:c,onNotSavedClose:u,onSave:h}}const TE=e=>{const t=Xn(),{isNotSavedModalOpen:n,onClose:s,onNotSavedClose:o,onSave:r}=EE(e.initialValues,e.values,e.handleSubmit),[a,l]=L.useState(so(e.initialValues.form.segmentsIds)),d=L.useMemo(()=>so(e.eventSegments)&&so(e.organizationSegments)?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("optgroup",{label:t("vues_de_l_v_ne_57031"),children:e.eventSegments.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)("optgroup",{label:t("vues_de_l_organ_32624"),children:e.organizationSegments.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})]}):so(e.eventSegments)?(0,i.jsx)(i.Fragment,{children:e.eventSegments.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}):so(e.organizationSegments)?(0,i.jsx)(i.Fragment,{children:e.organizationSegments.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}):(0,i.jsx)(i.Fragment,{}),[e.eventSegments,e.organizationSegments]);return L.useEffect(()=>{l(so(e.initialValues.form.segmentsIds))},[e.initialValues.form.segmentsIds]),(0,i.jsx)(XS,{button:(0,i.jsx)(zl,{isLoading:e.isMutateLoading,onClick:r,children:t("enregistrer_06519")}),title:e.name,onClose:s,children:(0,i.jsx)(SE,{isNotSavedOpen:n,onNotSavedClose:o,children:e.loader||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ar,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("diffusion_du_fo_47764")}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ar,{color:"gray500",children:t("personnalisez_l_57514")}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(Ar,{color:"gray800",fontWeight:"medium",children:t("_qui_s_adresse_82507")}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:a?"unchecked":"checked",onClick:()=>{l(!1),e.change("form.segmentsIds",[])},children:t("_tout_le_monde_35921")}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:a?"checked":"unchecked",onClick:()=>{l(!0)},children:t("_certaines_vue_55512")}),a&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"2"}),(0,i.jsxs)(Ba,{children:[(0,i.jsx)(Ya,{width:"6"}),(0,i.jsx)(Ym,{isSearchVisible:!0,multiple:!0,name:"form.segmentsIds",children:d})]}),(0,i.jsx)(Ju,{height:"6"}),(0,i.jsx)(Ar,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("personnalisatio_15893")}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(Vl,{label:t("nom_de_l_tape_85862"),name:"form.noAccessTitle"}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(rb,{label:t("message_affich_57692"),name:"form.noAccessMessage"})]})]})})})},zE=e=>{const{params:{organizationId:t,eventId:n,formId:s}}=vl(),o=Zn(Ua),r=Zn(kE),{mutate:a,isLoading:l}=function(e={}){return ei("mutation FormParametersBroadcastUpdate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $formId: FormId!\n $form: FormParametersBroadcastInput!\n) {\n formParametersBroadcastUpdate(\n organizationId: $organizationId\n eventId: $eventId\n formId: $formId\n form: $form\n ) {\n id\n }\n}\n",e)}(),d=L.useMemo(()=>({form:r.formParametersBroadcastInputDefault(e.form)}),[e.form]);return(0,i.jsx)(kl,{direction:"column",height:1,initialValues:d,render:({form:t,handleSubmit:n,values:s})=>(0,i.jsx)(TE,{change:t.change,eventSegments:e.eventSegments,handleSubmit:n,initialValues:d,isMutateLoading:l,loader:e.loader,name:e.form?.name??"",organizationSegments:e.organizationSegments,values:s}),validate:o.validateForForm(r.updateFormParametersBroadcastSchema()),width:1,onSubmit:e=>a({organizationId:t,eventId:n,formId:s,form:e.form})})},OE=()=>{const{params:{organizationId:e,formId:t}}=vl(),{data:n,loader:s}=Qn("query FormParametersBroadcastOrganization($organizationId: OrganizationId!, $formId: FormId!) {\n organization(id: $organizationId) {\n segments(segmentType: Volunteers) {\n id\n name\n }\n\n form(id: $formId) {\n name\n noAccessMessage\n noAccessTitle\n\n segments {\n segmentId\n }\n }\n }\n}\n",{organizationId:e,formId:t},[]);return Md(n.organization?.form.name??""),(0,i.jsx)(zE,{eventSegments:[],form:n.organization?.form,loader:s,organizationSegments:n.organization?.segments??[]})},RE=()=>{const{params:{organizationId:e,eventId:t,formId:n}}=vl(),{data:s,loader:o}=Qn("query FormParametersBroadcastEvent(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $formId: FormId!\n) {\n organization(id: $organizationId) {\n form(id: $formId) {\n name\n noAccessMessage\n noAccessTitle\n\n segments {\n segmentId\n }\n }\n\n segments(segmentType: Volunteers) {\n id\n name\n }\n }\n\n event(id: $eventId) {\n segments(segmentType: Volunteers) {\n id\n name\n }\n }\n}\n",{organizationId:e,eventId:t,formId:n},[]);return Md(s.organization?.form.name??""),(0,i.jsx)(zE,{eventSegments:s.event?.segments??[],form:s.organization?.form,loader:o,organizationSegments:s.organization?.segments??[]})};function $E(e){return{gray50:e?.gray50??xr.colors.gray50.value,gray500:e?.gray500??xr.colors.gray500.value,gray700:e?.gray700??xr.colors.gray700.value,gray800:e?.gray800??xr.colors.gray800.value,gray900:e?.gray900??xr.colors.gray900.value,primary500:e?.primary500??xr.colors.primary500.value,primary600:e?.primary600??xr.colors.primary600.value}}let DE=class extends Gl{documentInputService;constructor(e,t){super(t),this.documentInputService=e}organizationDesignInputDefault(e){return{banner:e?.banner??this.documentInputService.documentInputDefault(),logo:e?.logo??this.documentInputService.documentInputDefault(),colors:$E(e?.colors)}}formParametersDesignInputDefault(e){return{banner:e?.banner??this.documentInputService.documentInputDefault(),colors:$E(e?.colors)}}};DE=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Gj,qn])],DE);const PE=e=>{const t=(0,L.useRef)(null);return(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)("details",{ref:t,open:e.showSection,onToggle:t=>e.setShowSection(t.currentTarget.open),children:[(0,i.jsx)("summary",{style:{cursor:"pointer"},children:(0,i.jsxs)(Ba,{align:"center",gap:"2",children:[(0,i.jsx)(yu,{tabIndex:-1,value:e.showSection,onChange:td.A}),(0,i.jsx)(hl,{css:{fontWeight:"$medium"},children:e.toggle})]})}),(0,i.jsx)(Ba,{css:{marginBlockStart:"$5",borderBlockStart:"1px solid $gray200",paddingBlockStart:"$6"},direction:"column",gap:"3",children:e.children})]})})},FE=({css:e,disabled:t,hideHeading:n,isOpen:s,isOpenToggleLabel:o,...r})=>{const{descId:a}=qa(),[l,d]=L.useState(s??!1);return(0,i.jsx)(Um.Provider,{value:{isDisabled:t},children:(0,i.jsxs)(Ba,{"aria-describedby":a,as:"fieldset",className:"fieldset--column",css:{border:"unset",padding:"unset",margin:"unset","&:disabled :is(input, select, textarea, datalist, button)":{cursor:"not-allowed !important"},...e},direction:"column",disabled:o?!l:void 0,gap:o?"5":"6",...r,children:[(0,i.jsx)(pb,{heading:r.heading}),!n&&(0,i.jsxs)(Ba,{as:Ma.Header,css:{paddingBlockEnd:o?void 0:"$5",borderBlockEnd:o?void 0:"1px solid $gray200"},direction:"column",gap:"1",children:[(0,i.jsx)(ml,{"aria-hidden":"true",color:"gray800",textStyle:"heading",children:r.heading}),(0,i.jsx)(hl,{id:a,textStyle:"subtitle",children:r.subtitle})]}),o?(0,i.jsx)(PE,{setShowSection:d,showSection:l,toggle:o,children:r.children}):(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Ba,{css:{gap:"$4","&:has(> fieldset.fieldset--column)":{gap:"$9"},"&:has(> fieldset.fieldset--row)":{gap:"unset"}},direction:"column",children:r.children})})]})})},ME=({disabled:e,...t})=>{const{descId:n}=qa();return(0,i.jsx)(Um.Provider,{value:{isDisabled:e},children:(0,i.jsxs)(Ba,{"aria-describedby":n,as:"fieldset",className:"fieldset--row",css:{border:"unset",padding:"unset",margin:"unset","&:disabled :is(input, select, button)":{cursor:"not-allowed !important"},"&:not(:first-of-type)":{paddingBlockStart:"$5"},"&:not(:last-of-type)":{paddingBlockEnd:"$5",borderBlockEnd:"1px solid $gray200"},"& fieldset.fieldset--column":{gap:"$2","& header":{paddingBlockEnd:"unset",borderBlockEnd:"unset !important","& > :is(h1, h2, h3, h4, h5, h6)":{fontSize:"$textSm !important",fontWeight:"$medium !important"}}}},direction:"row",gap:"7",...t,children:[(0,i.jsx)(pb,{heading:t.heading}),(0,i.jsxs)(Ba,{as:Ma.Header,direction:"row",gap:"1",width:280,children:[(0,i.jsx)(ml,{"aria-hidden":"true",color:"gray800",css:{fontSize:"$textSm"},textStyle:"subheading",children:t.heading}),(0,i.jsx)(hl,{id:n,textStyle:"subtitle",children:t.subtitle})]}),(0,i.jsx)(Ba,{css:{flex:"1"},direction:"column",gap:"4",children:t.children})]})})},NE=e=>{const{translate:t}=vl();return(0,i.jsxs)(FE,{heading:t("charte_graphiqu_02725"),children:[e.showBackground&&(0,i.jsx)(ME,{heading:t("couleur_de_fond_75677"),children:(0,i.jsx)(qj,{initialValue:xr.colors.gray50.value,label:t("couleur_de_fond_75677"),name:"design.colors.gray50"})}),(0,i.jsx)(ME,{heading:t("textes_07935"),children:(0,i.jsxs)(Ba,{css:{flex:"1"},direction:"column",gap:"4",children:[(0,i.jsx)(qj,{initialValue:xr.colors.gray800.value,label:t("couleur_du_text_32021"),name:"design.colors.gray800"}),(0,i.jsx)(qj,{initialValue:xr.colors.gray900.value,label:t("couleur_des_tit_58918"),name:"design.colors.gray900"}),(0,i.jsx)(qj,{initialValue:xr.colors.gray500.value,label:t("couleur_des_sou_18968"),name:"design.colors.gray500"}),(0,i.jsx)(qj,{initialValue:xr.colors.gray700.value,label:t("couleur_des_lab_38397"),name:"design.colors.gray700"})]})}),(0,i.jsx)(ME,{heading:t("boutons_35604"),children:(0,i.jsxs)(Ba,{css:{flex:"1"},direction:"column",gap:"4",children:[(0,i.jsx)(qj,{initialValue:xr.colors.primary500.value,label:t("couleur_des_bou_24410"),name:"design.colors.primary500"}),(0,i.jsx)(qj,{initialValue:xr.colors.primary600.value,label:t("couleur_des_bou_16515"),name:"design.colors.primary600"})]})})]})},LE=e=>{const{params:{organizationId:t},translate:n}=vl();return(0,i.jsxs)(FE,{heading:e.heading,hideHeading:e.hideHeading,children:[e.showLogo&&(0,i.jsx)(ME,{heading:n("logo_18191"),children:(0,i.jsx)(CC,{hint:n("nous_recommando_20904"),label:n("s_lectionnez_un_82734"),organizationId:t,prefix:"design.logo."})}),(0,i.jsx)(ME,{heading:n("banni_re_86634"),children:(0,i.jsx)(CC,{hint:n("taille_de_l_ima_84109"),label:n("s_lectionnez_un_82734"),organizationId:t,prefix:"design.banner."})})]})},BE=()=>{const{translate:e}=vl();return(0,i.jsxs)(FE,{heading:e("design_du_formu_57145"),subtitle:e("personnalisez_l_27035"),children:[(0,i.jsx)(LE,{heading:e("banni_re_du_for_40749"),hideHeading:!0,showLogo:!1}),(0,i.jsx)(NE,{showBackground:!0})]})},VE=e=>{const t=Xn(),{isNotSavedModalOpen:n,onClose:s,onNotSavedClose:o,onSave:r}=EE(e.initialValues,e.values,e.handleSubmit);return(0,i.jsx)(XS,{button:(0,i.jsx)(zl,{isLoading:e.isMutateLoading,onClick:r,children:t("enregistrer_06519")}),title:e.name,onClose:s,children:(0,i.jsx)(SE,{isNotSavedOpen:n,onNotSavedClose:o,children:e.loader||(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(BE,{})})})})},UE=()=>{const{params:{organizationId:e,eventId:t,formId:n}}=vl(),{data:s,loader:o}=Qn("query FormParametersDesign($organizationId: OrganizationId!, $formId: FormId!) {\n organization(id: $organizationId) {\n form(id: $formId) {\n name\n\n design {\n banner {\n acl\n name\n key\n }\n\n colors\n }\n }\n }\n}\n",{organizationId:e,formId:n},[]);Md(s.organization?.form.name??"");const r=Zn(DE),{mutate:a,isLoading:l}=function(e={}){return ei("mutation FormParametersDesignUpdate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $formId: FormId!\n $design: DesignInput!\n) {\n formParametersDesignUpdate(\n organizationId: $organizationId\n eventId: $eventId\n formId: $formId\n design: $design\n ) {\n id\n }\n}\n",e)}(),d=L.useMemo(()=>({design:r.formParametersDesignInputDefault(s.organization?.form.design)}),[s.organization]);return(0,i.jsx)(kl,{direction:"column",height:1,initialValues:d,render:({handleSubmit:t,values:n})=>(0,i.jsx)(VE,{handleSubmit:t,initialValues:d,isMutateLoading:l,loader:o,name:s.organization?.form.name??"",organizationId:e,values:n}),width:1,onSubmit:i=>a({organizationId:e,eventId:t,formId:n,design:i.design})})};let WE=class extends Gl{constructor(e){super(e)}formParametersGeneralInputDefault(e){return{name:e?.name??"",setAssignmentStateToWaiting:e?.setAssignmentStateToWaiting??!1,setAccreditationStateToWaiting:e?.setAccreditationStateToWaiting??!1,allowMultiProfiles:e?.allowMultiProfiles??!1,canRefill:e?.canRefill??!1,description:e?.description||"",successMessage:e?.successMessage||"",customFields:e?.customFields||[],areTeamsAllowed:e?.areTeamsAllowed??!1,maxTeamMembers:e?.maxTeamMembers,teamMemberFillFullForm:e?.teamMemberFillFullForm??!0,emailTitle:e?.emailTitle||"",informationTitle:e?.informationTitle||"",registerButtonText:e?.registerButtonText||"",isEditableInMemberSpace:e?.isEditableInMemberSpace??!0,ticketUrl:e?.ticketUrl||""}}formParametersGeneralInputSchema(){return d.Ik().shape({name:d.Yj().required(this.t("le_nom_est_requ_61536")),allowMultiProfiles:d.zM().required(),setAssignmentStateToWaiting:d.zM().required(),setAccreditationStateToWaiting:d.zM().required(),description:d.Yj(),successMessage:d.Yj(),areTeamsAllowed:d.zM().required(),maxTeamMembers:d.ai().nullable(),teamMemberFillFullForm:d.zM().required(),informationTitle:d.Yj(),registerButtonText:d.Yj()})}updateFormParametersGeneralSchema(){return d.Ik().shape({form:this.formParametersGeneralInputSchema()})}};WE=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[qn])],WE);const GE=e=>{const t=Xn(),[n,s]=L.useState(so(e.values)),o=L.useCallback(t=>{s(t),t||e.change(e.name,[])},[e.name,e.change,s]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ar,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("d_finir_la_vale_27863")}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ar,{color:"gray500",children:t("choisissez_une_24029")}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(ku,{value:n,onChange:o,children:t("je_souhaite_d_f_72912")}),n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(iC,{...e})]})]})},HE=e=>{const{translate:t,params:{eventId:n}}=vl(),{isNotSavedModalOpen:s,onClose:o,onNotSavedClose:r,onSave:a}=EE(e.initialValues,e.values,e.handleSubmit);return(0,i.jsx)(XS,{button:(0,i.jsx)(zl,{isLoading:e.isMutateLoading,onClick:a,children:t("enregistrer_06519")}),title:e.name,onClose:o,children:(0,i.jsx)(SE,{isNotSavedOpen:s,onNotSavedClose:r,children:e.loader||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Nr.Yr,{name:"hasWeezTicketForm",children:t=>{t||e.change("form.ticketUrl","")}}),(0,i.jsx)(Ar,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("initialisation_29288")}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ar,{color:"gray500",children:t("personnaliser_l_27381")}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(Vl,{label:t("nom_du_formulai_14952"),name:"form.name"}),n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(Ar,{color:"gray800",fontWeight:"semiBold",children:t("affectation_des_81808")}),(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(Gm,{name:"form.setAssignmentStateToWaiting",children:t("les_membres_ser_52180")}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(Ar,{color:"gray800",fontWeight:"semiBold",children:t("accr_ditation_d_48426")}),(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(Gm,{name:"form.setAccreditationStateToWaiting",children:t("les_membres_ser_34727")})]}),(0,i.jsx)(Ju,{height:"7"}),(0,i.jsx)(Ar,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("param_trage_de_41992")}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ar,{color:"gray500",children:t("donner_la_possi_56694")}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(Ar,{font:"gray800 textSm semiBold",children:t("inscriptions_mu_35073")}),(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(Jm,{name:"form.allowMultiProfiles",children:t("autoriser_les_i_26880")}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(Ar,{font:"gray800 textSm semiBold",children:t("remplissages_mu_72343")}),(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(Jm,{name:"form.canRefill",subtext:t("permet_aux_memb_26701"),children:t("autoriser_les_m_44818")}),n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(Ar,{font:"gray800 textSm semiBold",children:t("inscriptions_en_77739")}),(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(Jm,{name:"form.areTeamsAllowed",children:t("permettre_aux_m_56083")}),e.values.form.areTeamsAllowed&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(Jm,{name:"form.teamMemberFillFullForm",children:t("tous_les_membre_59937")}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(Vl,{label:t("nombre_maximum_14615"),name:"form.maxTeamMembers",shouldParseAsInt:!0})]})]}),(0,i.jsx)(Ju,{height:"7"}),(0,i.jsx)(GE,{change:e.change,customFields:e.customFields,name:"form.customFields",values:e.values.form.customFields}),(0,i.jsx)(Ju,{height:"7"}),(0,i.jsx)(Ar,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("texte_de_l_tap_00197")}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ar,{color:"gray500",children:t("personnaliser_l_68212")}),(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(Vl,{name:"form.emailTitle"}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(Ar,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("description_de_80800")}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ar,{color:"gray500",children:t("la_description_13257")}),(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(rb,{name:"form.description"}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(Ar,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("texte_de_l_tap_92536")}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ar,{color:"gray500",children:t("personnaliser_l_66470")}),(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(Vl,{name:"form.informationTitle"}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(Ar,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("texte_du_bouton_05866")}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ar,{color:"gray500",children:t("personnaliser_l_02611")}),(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(Vl,{name:"form.registerButtonText"}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(Ar,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("message_de_succ_99510")}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ar,{color:"gray500",children:t("personnaliser_l_55334")}),(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(rb,{name:"form.successMessage"}),e.isWeezeventConnected&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ju,{height:"7"}),(0,i.jsx)(Ar,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("int_gration_10662")}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsxs)(rl,{color:"primary",leftIcon:"circle-exclamation",children:[t("comment_l_int_g_52949"),(0,i.jsx)(Ar,{fontWeight:"regular",children:t("le_widget_sera_08013")})]}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(Jm,{name:"hasWeezTicketForm",children:t("ajouter_un_widg_55295")}),e.values.hasWeezTicketForm&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(Vl,{label:t("lien_vers_le_wi_55308"),name:"form.ticketUrl"})]})]}),(0,i.jsx)(Ju,{height:"7"}),(0,i.jsx)(Ar,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("_dition_des_inf_90758")}),(0,i.jsx)(Ar,{color:"gray500",children:t("donner_la_possi_56683")}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(Ar,{color:"gray800",fontWeight:"semiBold",children:t("espace_membre_06532")}),(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(Jm,{name:"form.isEditableInMemberSpace",children:t("permettre_aux_m_40630")})]})})})},qE=()=>{const{params:{organizationId:e,eventId:t,formId:n}}=vl(),{data:s,loader:o}=Qn("query FormParametersGeneral($organizationId: OrganizationId!, $eventId: EventId, $formId: FormId!) {\n organization(id: $organizationId) {\n customFields(variety: UserInfo, sort: { attribute: Name, direction: Asc }) {\n nodes {\n ...MassEditCustomField\n }\n }\n\n event: eventMaybe(id: $eventId) {\n isWeezeventConnected\n }\n\n form(id: $formId) {\n name\n setAssignmentStateToWaiting\n setAccreditationStateToWaiting\n allowMultiProfiles\n canRefill\n description\n successMessage\n areTeamsAllowed\n maxTeamMembers\n teamMemberFillFullForm\n emailTitle\n informationTitle\n registerButtonText\n isEditableInMemberSpace\n ticketUrl\n\n customFields {\n addValues\n customFieldId\n value\n }\n }\n }\n}\n",{organizationId:e,eventId:t,formId:n},[Vs.MassEditCustomFieldFragment]);Md(s.organization?.form.name??"");const r=Zn(Ua),a=Zn(WE),{mutate:l,isLoading:d}=function(e={}){return ei("mutation FormParametersGeneralUpdate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $formId: FormId!\n $form: FormParametersGeneralInput!\n) {\n formParametersGeneralUpdate(\n organizationId: $organizationId\n eventId: $eventId\n formId: $formId\n form: $form\n ) {\n id\n }\n}\n",e)}(),c=L.useMemo(()=>{const e=a.formParametersGeneralInputDefault(s.organization?.form);return{form:e,hasWeezTicketForm:m(e.ticketUrl)}},[s.organization]);return(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(kl,{direction:"column",height:1,initialValues:c,render:({form:e,handleSubmit:t,values:n})=>(0,i.jsx)(HE,{change:e.change,customFields:s.organization?.customFields.nodes??[],handleSubmit:t,initialValues:c,isMutateLoading:d,isWeezeventConnected:s.organization?.event?.isWeezeventConnected??!1,loader:o,name:s.organization?.form.name??"",values:n}),validate:r.validateForForm(a.updateFormParametersGeneralSchema()),width:1,onSubmit:i=>l({organizationId:e,eventId:t,formId:n,form:{...i.form,description:i.form.description||"",successMessage:i.form.successMessage||""}})})})};let KE=class extends Gl{constructor(e){super(e)}formParametersStateInputDefault(e){return{state:e?.state||Ze.Open,closedTitle:e?.closedTitle||"",closedMessage:e?.closedMessage||"",closedAt:e?.closedAt||null}}formParametersStateInputSchema(){return d.Ik().shape({state:d.Yj().required(this.t("cl_turer_le_for_10541")).oneOf(_n,this.t("cl_turer_le_for_10541")),closedMessage:d.Yj(),closedAt:Qm.when("state",{is:Ze.ClosedAt,then:e=>e.required(this.t("la_date_de_cl_t_63358")).typeError(this.t("la_date_de_cl_t_63358")),otherwise:e=>e.nullable()})})}updateFormParametersStateSchema(){return d.Ik().shape({form:this.formParametersStateInputSchema()})}};KE=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[qn])],KE);const YE=e=>{const{translate:t,params:{eventId:n}}=vl(),{isNotSavedModalOpen:s,onClose:o,onNotSavedClose:r,onSave:a}=EE(e.initialValues,e.values,e.handleSubmit);return(0,i.jsx)(XS,{button:(0,i.jsx)(zl,{isLoading:e.isMutateLoading,onClick:a,children:t("enregistrer_06519")}),title:e.name,onClose:o,children:(0,i.jsx)(SE,{isNotSavedOpen:s,onNotSavedClose:r,children:e.loader||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Nr.Yr,{name:"form.state",children:t=>{t!==Ze.ClosedAt&&e.change("form.closedAt",null)}}),(0,i.jsx)(Ar,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("cl_turer_le_for_46483")}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ar,{color:"gray500",children:t("choisir_si_le_f_14519")}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(ub,{name:"form.state",value:Ze.Open,children:t("ne_pas_cl_turer_46870")}),(0,i.jsx)(Ya,{height:"3"}),n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ub,{name:"form.state",value:Ze.CloseWhenEventDone,children:t("cl_turer_le_for_61719")}),(0,i.jsx)(Ya,{height:"3"})]}),(0,i.jsx)(ub,{name:"form.state",value:Ze.Closed,children:t("cl_turer_le_for_10120")}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(ub,{name:"form.state",value:Ze.ClosedAt,children:t("cl_turer_le_for_19176")}),e.values.form.state===Ze.ClosedAt&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"2"}),(0,i.jsxs)(Ba,{children:[(0,i.jsx)(Ya,{width:"6"}),(0,i.jsx)(Kj,{name:"form.closedAt"})]})]}),e.values.form.state!==Ze.Open&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ju,{height:"6"}),(0,i.jsx)(Ar,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("personnalisatio_15893")}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(Vl,{label:t("nom_de_l_tape_85862"),name:"form.closedTitle"}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(rb,{hint:t("ce_message_sera_03472"),label:t("message_de_cl_t_95276"),name:"form.closedMessage"})]})]})})})},ZE=()=>{const{params:{organizationId:e,eventId:t,formId:n}}=vl(),{data:s,loader:o}=Qn("query FormParametersState($organizationId: OrganizationId!, $formId: FormId!) {\n organization(id: $organizationId) {\n form(id: $formId) {\n name\n state\n closedTitle\n closedMessage\n closedAt\n }\n }\n}\n",{organizationId:e,formId:n},[]);Md(s.organization?.form.name??"");const r=Zn(Ua),a=Zn(KE),{mutate:l,isLoading:d}=function(e={}){return ei("mutation FormParametersStateUpdate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $formId: FormId!\n $form: FormParametersStateInput!\n) {\n formParametersStateUpdate(\n organizationId: $organizationId\n eventId: $eventId\n formId: $formId\n form: $form\n ) {\n id\n }\n}\n",e)}(),c=L.useMemo(()=>({form:a.formParametersStateInputDefault(s.organization?.form)}),[s.organization]);return(0,i.jsx)(kl,{direction:"column",height:1,initialValues:c,render:({form:e,handleSubmit:t,values:n})=>(0,i.jsx)(YE,{change:e.change,handleSubmit:t,initialValues:c,isMutateLoading:d,loader:o,name:s.organization?.form.name??"",values:n}),validate:r.validateForForm(a.updateFormParametersStateSchema()),width:1,onSubmit:i=>l({organizationId:e,eventId:t,formId:n,form:i.form})})};function XE(e,t,n,i){return(0,Za.A)([i.canMemberEdit?{icon:"user-plus",text:e("cr_er_un_membre_38547"),link:QI.CREATE({organizationId:t})}:null,{icon:"user-group",text:e("voir_les_membre_27923"),link:wi.COMMUNITY_USERS({organizationId:t})},i.canEventEdit?{icon:"cake-candles",text:e("cr_er_un_v_nem_28126"),link:Ps.CREATE_EVENT(t)}:null,{icon:"cake-candles",text:e("voir_les_v_nem_52491"),link:`${yi.ORGANIZATION({organizationId:t})}/events`},i.canCustomFieldEdit&&-1!==n?{icon:"text",text:e("cr_eer_un_champ_08883"),link:Ps.CREATE_CUSTOM_FIELD(t,n)}:null,i.canCustomFieldRead?{icon:"text",text:e("voir_les_champs_59185"),link:Ps.CUSTOM_FIELDS(t)}:null,i.canFormEdit?{icon:"file-lines",text:e("cr_er_un_formul_78352"),link:Vi.CREATE({organizationId:t})}:null,i.canFormEdit?{icon:"file-lines",text:e("voir_les_formul_55824"),link:Vi.FORMS({organizationId:t})}:null,i.canDelegationEdit?{icon:"users",text:e("cr_er_une_d_l_g_23035"),link:Ps.COMMUNITY_CREATE_DELEGATION(t)}:null,i.canDelegationRead?{icon:"users",text:e("voir_les_d_l_ga_71959"),link:hs.DELEGATIONS({organizationId:t})}:null,i.canCampaignSend?{icon:"paper-plane",text:e("cr_er_une_campa_96023"),link:$I.CREATE({organizationId:t})}:null,i.canCampaignRead?{icon:"paper-plane",text:e("voir_les_campag_02148"),link:$I.CAMPAIGNS({organizationId:t})}:null,i.canWorkflowEdit?{icon:"hand-sparkles",text:e("cr_er_une_autom_91246"),link:nv.CREATE({organizationId:t})}:null,i.canWorkflowRead?{icon:"hand-sparkles",text:e("voir_les_automa_58340"),link:nv.WORKFLOWS({organizationId:t})}:null])}function JE(e,t,n,i,s){return(0,Za.A)([s.canMemberEdit?{icon:"user-plus",text:e("cr_er_un_membre_38547"),link:QI.CREATE({organizationId:t,eventId:n})}:null,{icon:"user-group",text:e("voir_les_membre_27923"),link:Ps.VOLUNTEERS(t,n)},s.canEventEdit?{icon:"cake-candles",text:e("cr_er_un_v_nem_28126"),link:Ps.CREATE_EVENT(t)}:null,{icon:"cake-candles",text:e("voir_les_v_nem_52491"),link:`${yi.ORGANIZATION({organizationId:t})}/events`},s.canCustomFieldEdit&&-1!==i?{icon:"text",text:e("cr_eer_un_champ_08883"),link:Ps.CREATE_CUSTOM_FIELD(t,i)}:null,s.canCustomFieldRead?{icon:"text",text:e("voir_les_champs_59185"),link:Ps.CUSTOM_FIELDS(t)}:null,s.canPositionEdit?{icon:"sitemap",text:e("cr_er_une_missi_66818"),link:Ps.CREATE_POSITION(t,n)}:null,s.canPositionRead?{icon:"sitemap",text:e("voir_les_missio_71964"),link:xs.POSITIONS({organizationId:t,eventId:n})}:null,s.canFormEdit?{icon:"file-lines",text:e("cr_er_un_formul_78352"),link:Vi.CREATE({organizationId:t,eventId:n})}:null,s.canFormRead?{icon:"file-lines",text:e("voir_les_formul_55824"),link:Vi.FORMS({organizationId:t,eventId:n})}:null,s.canAccreditationEdit?{icon:"badge-check",text:e("cr_er_une_accr_33475"),link:Ps.CREATE_ACCREDITATION(t,n)}:null,s.canAccreditationRead?{icon:"badge-check",text:e("voir_les_accr_d_34867"),link:is.ACCREDITATIONS({organizationId:t,eventId:n})}:null,s.canDelegationEdit?{icon:"users",text:e("cr_er_une_d_l_g_23035"),link:Ps.CREATE_DELEGATION(t,n)}:null,s.canDelegationRead?{icon:"users",text:e("voir_les_d_l_ga_71959"),link:hs.DELEGATIONS({organizationId:t,eventId:n})}:null,s.canCampaignSend?{icon:"paper-plane",text:e("cr_er_une_campa_96023"),link:$I.CREATE({organizationId:t,eventId:n})}:null,s.canCampaignRead?{icon:"paper-plane",text:e("voir_les_campag_02148"),link:$I.CAMPAIGNS({organizationId:t,eventId:n})}:null,s.canWorkflowEdit?{icon:"hand-sparkles",text:e("cr_er_une_autom_91246"),link:nv.CREATE({organizationId:t,eventId:n})}:null,s.canWorkflowRead?{icon:"hand-sparkles",text:e("voir_les_automa_58340"),link:nv.WORKFLOWS({organizationId:t,eventId:n})}:null])}function QE(e){switch(e.segmentType){case jt.Accreditations:return e.eventId?Ps.ACCREDITATIONS_SEGMENT(e.organizationId,e.eventId,e.id):"";case jt.Campaigns:return $I.CAMPAIGNS_SEGMENT({organizationId:e.organizationId,segmentId:e.id});case jt.CustomFields:return Ps.CUSTOM_FIELDS_SEGMENT(e.organizationId,e.id);case jt.Delegations:return e.eventId?Ps.DELEGATIONS_SEGMENT(e.organizationId,e.eventId,e.id):Ps.COMMUNITY_DELEGATIONS_SEGMENT(e.organizationId,e.id);case jt.Events:return Ps.EVENTS_SEGMENT(e.organizationId,e.id);case jt.Positions:return e.eventId?Ps.POSITIONS_SEGMENT(e.organizationId,e.eventId,e.id):"";case jt.Volunteers:return e.eventId?Ps.VOLUNTEERS_SEGMENT(e.organizationId,e.eventId,e.id):Ps.COMMUNITY_USERS_SEGMENT(e.organizationId,e.id);default:return ll(e.segmentType)}}const eT=e=>(0,i.jsx)(Zc,{css:{"&:hover":{textDecoration:"none"}},hideIcon:!0,to:e.link,width:1,onClick:()=>{e.onClose()},children:(0,i.jsxs)(Ba,{align:"center",css:{cursor:"pointer",px:"$4","&:hover":{background:"$gray100"}},gap:"2",height:40,width:1,children:[e.avatar,e.icon&&(0,i.jsx)(Ar,{color:"gray500",fontSize:"textXs",children:(0,i.jsx)(nl,{icon:e.icon})}),(0,i.jsx)(Ar,{font:"gray800 textSm medium",children:e.children})]})}),tT=e=>(0,i.jsx)(Ba,{css:{px:"$4"},children:(0,i.jsx)(Ar,{font:"gray500 textSm medium",children:e.children})}),nT=e=>(0,i.jsxs)(Ba,{direction:"column",children:[(0,i.jsx)(tT,{children:e.title}),e.children]}),iT="h-open-omnibar",sT=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=vl(),o=DS(),r=$S(),[a,l]=(0,L.useState)(!1),[d,c]=(0,L.useState)(!1),[h,g,p]=Wc(""),[f,_]=(0,L.useState)([]),[x,I]=(0,L.useState)([]),[v,b]=(0,L.useState)([]),[j,C]=(0,L.useState)(-1),[y,k]=(0,L.useState)([]),[A,w]=(0,L.useState)([]),[S,E]=(0,L.useState)([]),[T,z]=(0,L.useState)([]),[O,R]=(0,L.useState)([]),[$,D]=(0,L.useState)([]),[P,F]=(0,L.useState)([]),[M,N]=(0,L.useState)([]),[B,V]=(0,L.useState)(s?JE(t,n,s,j,r):XE(t,n,j,o)),U=(0,L.useMemo)(()=>oo(B)&&oo(f)&&oo(x)&&oo(v)&&oo(y)&&oo(A)&&oo(S)&&oo(T)&&oo(O)&&oo($)&&oo(P)&&oo(M),[B,f,x,v,y,A,S,T,O,$,P,M]),W=(0,L.useCallback)(()=>{V(s?JE(t,n,s,j,r):XE(t,n,j,o)),_([]),I([]),b([]),k([]),w([]),E([]),z([]),R([]),D([]),F([]),N([])},[n,s,o,r,V,_,I,b,k,w,E,z,R,D,F,N]),G=(0,L.useCallback)(e=>{Dl(e),c(!1),p(""),W(),l(e=>!e)},[l,c,p,W]),H=(0,L.useCallback)(()=>{l(!1)},[l]);return mm("k",G),Ld(H),Nd(H),(0,L.useEffect)(()=>(document.addEventListener(iT,G),()=>{document.removeEventListener(iT,G)}),[G]),(0,L.useEffect)(()=>{(async()=>{if(m(g)){if(c(!0),s){const{organization:o,event:a}=await(e={organizationId:n,eventId:s,name:g},i=await Y(),go('query EventOmnibar($organizationId: OrganizationId!, $eventId: EventId!, $name: String) {\n organization(id: $organizationId) {\n customFields(name: $name, limit: 5) {\n nodes {\n id\n name\n }\n }\n\n events(name: $name, limit: 5) {\n nodes {\n id\n name\n }\n }\n\n customFieldsSegment: segments(segmentType: CustomFields) {\n id\n }\n }\n\n event(id: $eventId) {\n accreditations(columnsSearch: ["id", "name", "acronym"], name: $name, limit: 5) {\n nodes {\n id\n name\n }\n }\n\n campaigns(name: $name, limit: 5) {\n nodes {\n id\n name\n }\n }\n\n delegations(name: $name, limit: 5) {\n nodes {\n id\n name\n }\n }\n\n forms(name: $name, limit: 5) {\n nodes {\n id\n name\n }\n }\n\n positions(columnsSearch: ["id", "name", "acronym"], name: $name, limit: 5) {\n nodes {\n id\n name\n }\n }\n\n segments(name: $name) {\n id\n organizationId\n eventId\n name\n segmentType\n }\n\n teams(name: $name, limit: 5) {\n nodes {\n teamCode\n }\n }\n\n volunteersRegistrations(\n columnsSearch: [\n "email"\n "id"\n "name"\n "phone"\n "teamCode"\n "weezevent_barcode_id"\n "weezevent_short_tag"\n ]\n name: $name\n limit: 5\n ) {\n nodes {\n userInfo {\n id\n email\n name\n\n picture {\n url\n }\n }\n }\n }\n\n workflows(name: $name, limit: 5) {\n nodes {\n id\n name\n }\n }\n }\n}\n',{variables:e,token:i||void 0,fragments:[]}));V(JE(t,n,s,o.customFieldsSegment[0].id,r).filter(e=>u(e.text).includes(u(g)))),_(a.volunteersRegistrations.nodes.map(e=>e.userInfo)),I(r.canEventEdit?o.events.nodes:[]),b(r.canCustomFieldEdit?o.customFields.nodes:[]),C(o.customFieldsSegment[0].id),k(r.canPositionRead?a.positions.nodes:[]),w(r.canFormRead?a.forms.nodes:[]),E(r.canAccreditationRead?a.accreditations.nodes:[]),z(r.canDelegationRead?a.delegations.nodes:[]),R(r.canCampaignRead?a.campaigns.nodes:[]),D(r.canWorkflowRead?a.workflows.nodes:[]),F(a.segments),N(r.canMemberAssign?a.teams.nodes:[])}else{const{organization:e}=await function(e,t){return go("query OrganizationOmnibar($organizationId: OrganizationId!, $name: String) {\n organization(id: $organizationId) {\n accreditations(name: $name, limit: 5) {\n nodes {\n id\n name\n }\n }\n\n campaigns(level: Both, name: $name, limit: 5) {\n nodes {\n id\n name\n }\n }\n\n customFields(name: $name, limit: 5) {\n nodes {\n id\n name\n }\n }\n\n customFieldsSegment: segments(segmentType: CustomFields) {\n id\n }\n\n delegations(level: Both, name: $name, limit: 5) {\n nodes {\n id\n name\n }\n }\n\n events(name: $name, limit: 5) {\n nodes {\n id\n name\n }\n }\n\n forms(level: Both, name: $name, limit: 5) {\n nodes {\n id\n name\n }\n }\n\n positions(name: $name, limit: 5) {\n nodes {\n id\n name\n }\n }\n\n segments(name: $name) {\n id\n organizationId\n eventId\n name\n segmentType\n }\n\n usersInfos(name: $name, limit: 5) {\n nodes {\n id\n email\n name\n\n picture {\n url\n }\n }\n }\n\n workflows(level: Both, name: $name, limit: 5) {\n nodes {\n id\n name\n }\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({organizationId:n,name:g},await Y());V(XE(t,n,j,o).filter(e=>u(e.text).includes(u(g)))),_(e.usersInfos.nodes),I(e.events.nodes),b(o.canCustomFieldRead?e.customFields.nodes:[]),C(e.customFieldsSegment[0].id),k(o.canPositionRead?e.positions.nodes:[]),w(o.canFormRead?e.forms.nodes:[]),E(o.canAccreditationRead?e.accreditations.nodes:[]),z(o.canDelegationRead?e.delegations.nodes:[]),R(o.canCampaignRead?e.campaigns.nodes:[]),D(o.canWorkflowRead?e.workflows.nodes:[]),F(e.segments)}c(!1)}else W();var e,i})()},[n,s,o,r,g,c,V,_,I,b,C,k,w,E,z,R,D,F,N,W]),a&&("organization"===e.level&&!s||"event"===e.level&&s)?(0,Kt.createPortal)((0,i.jsx)(Ba,{align:"center",css:{background:"rgba(52, 64, 84, 0.7)",height:"100%",left:0,position:"absolute",top:0,width:"100%",zIndex:"300"},justify:"center",children:(0,i.jsxs)(Ba,{css:{background:"white",borderRadius:"$3",overflow:"hidden"},direction:"column",width:640,onClick:e=>Dl(e),children:[(0,i.jsx)(Ar,{css:{"& .h-styled-input-container":{height:"48px"}},height:48,children:(0,i.jsx)(Bl,{autoFocus:!0,css:{borderBottom:"1px solid $gray200","& .h-styled-input-container":{border:"none"}},height:"fluid",icon:"magnifying-glass",placeholder:t("rechercher_un_m_45772"),value:h,onChange:p})}),(0,i.jsx)(Ba,{css:{overflowY:"auto",py:"$4"},direction:"column",height:350,children:d?(0,i.jsxs)(Ba,{direction:"column",gap:"2",children:[(0,i.jsx)(lc,{borderRadius:"$1",height:36}),(0,i.jsx)(lc,{borderRadius:"$1",height:36}),(0,i.jsx)(lc,{borderRadius:"$1",height:36})]}):U?(0,i.jsxs)(Ba,{align:"center",direction:"column",gap:"4",height:1,justify:"center",children:[(0,i.jsx)(Ba,{align:"center",css:{bd:!0,fontSize:"$textMd"},height:48,justify:"center",width:48,children:(0,i.jsx)(nl,{icon:"magnifying-glass"})}),(0,i.jsx)(Ar,{font:"gray900 textSm semiBold",children:t("aucun_r_sultat_73664",g)})]}):(0,i.jsxs)(Ba,{direction:"column",gap:"6",children:[so(B)&&(0,i.jsx)(nT,{title:t("actions_rapides_42479"),children:B.map((e,t)=>(0,i.jsx)(eT,{icon:e.icon,link:e.link,onClose:H,children:e.text},t))}),so(f)&&(0,i.jsx)(nT,{title:t("membres_11310"),children:f.map(e=>(0,i.jsx)(eT,{avatar:(0,i.jsx)(sp,{email:e.email,image:e.picture?.url,name:e.name,size:24}),link:QI.MEMBER_INFORMATION({organizationId:n,eventId:s,userInfoId:e.id}),onClose:H,children:e.name},e.id))}),so(x)&&(0,i.jsx)(nT,{title:t("Event"),children:x.map(e=>(0,i.jsx)(eT,{icon:"cake-candles",link:Hi.EVENT({organizationId:n,eventId:e.id}),onClose:H,children:e.name},e.id))}),so(v)&&(0,i.jsx)(nT,{title:t("champs_de_formu_64126"),children:v.map(e=>(0,i.jsx)(eT,{icon:"text",link:Ps.EDIT_CUSTOM_FIELD(n,j,e.id),onClose:H,children:e.name},e.id))}),so(y)&&(0,i.jsx)(nT,{title:t("missions_63972"),children:y.map(e=>(0,i.jsx)(eT,{icon:"sitemap",link:xs.POSITION({organizationId:n,eventId:s,positionId:e.id}),onClose:H,children:e.name},e.id))}),so(A)&&(0,i.jsx)(nT,{title:t("Form_plural"),children:A.map(e=>(0,i.jsx)(eT,{icon:"file-lines",link:Vi.FORM_ELEMENTS({organizationId:n,eventId:s,formId:e.id}),onClose:H,children:e.name},e.id))}),so(S)&&(0,i.jsx)(nT,{title:t("accr_ditations_39450"),children:S.map(e=>(0,i.jsx)(eT,{icon:"badge-check",link:is.ACCREDITATION({organizationId:n,eventId:s,accreditationId:e.id}),onClose:H,children:e.name},e.id))}),so(T)&&(0,i.jsx)(nT,{title:t("d_l_gations_78318"),children:T.map(e=>(0,i.jsx)(eT,{icon:"users",link:hs.DELEGATION({organizationId:n,eventId:s,delegationId:e.id}),onClose:H,children:e.name},e.id))}),so(O)&&(0,i.jsx)(nT,{title:t("Campaigns"),children:O.map(e=>(0,i.jsx)(eT,{icon:"paper-plane",link:$I.CAMPAIGN_DASHBOARD({organizationId:n,eventId:s,campaignId:e.id}),onClose:H,children:e.name},e.id))}),so($)&&(0,i.jsx)(nT,{title:t("automatisations_60045"),children:$.map(e=>(0,i.jsx)(eT,{icon:"hand-sparkles",link:nv.UPDATE({organizationId:n,eventId:s,workflowId:e.id}),onClose:H,children:e.name},e.id))}),so(P)&&(0,i.jsx)(nT,{title:t("vues_personnali_80652"),children:P.map(e=>(0,i.jsx)(eT,{link:QE(e),onClose:H,children:e.name},e.id))}),so(M)&&(0,i.jsx)(nT,{title:t("_quipes_18817"),children:M.map(e=>(0,i.jsx)(eT,{link:Ps.TEAM_ASSIGNMENT(n,s,e.teamCode),onClose:H,children:e.teamCode},e.teamCode))})]})})]})}),document.body):null},oT=(0,L.memo)(function(){const{translate:e}=vl(),{pathname:t}=ii(),{organization:n,selectedEventId:s}=TI(),[o,r]=(0,L.useState)(!1),a=t===Hi.EVENTS({organizationId:n.id})||null!==t.match(/\/events/)||null!==t.match(/\/event\/\d+/),l=(0,uc.A)(n.events.nodes.filter(e=>e.state===Me.Ongoing||e.state===Me.Upcoming),e=>e.name),d=n.events.nodes.find(e=>e.id===s);return(0,i.jsxs)(Wd,{onStateChange:r,children:[(0,i.jsx)(Xd,{children:(0,i.jsxs)(Ba,{align:"center","aria-expanded":o,"aria-label":e("ouvrir_la_liste_52670"),"aria-selected":o,css:{blockSize:"100%",color:"white",opacity:a?"1":"0.6",px:"$4","&:hover":{opacity:"1"}},gap:"2",role:"button",onClick:e=>{e.nativeEvent.stopImmediatePropagation(),document.getElementById("events-menu")?.focus()},children:[d?d.name:e("_v_nements_53672"),o?(0,i.jsx)(nl,{icon:"angle-up"}):(0,i.jsx)(nl,{icon:"angle-down"})]})}),(0,i.jsxs)(Zd,{"aria-orientation":"vertical",id:"events-menu",maxHeight:300,offset:-10,placement:"bottom-start",children:[(0,i.jsx)(Ba,{css:{flex:"1",overflowY:"auto"},direction:"column",children:l.map(e=>(0,i.jsx)(qd,{to:Hi.EVENT({organizationId:n.id,eventId:e.id}),onClick:e=>{Vd(e.target),document.getElementById("main")?.focus()},children:e.name},e.id))}),(0,i.jsx)(Xu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(qd,{to:Hi.EVENTS({organizationId:n.id}),onClick:e=>{Vd(e.target),document.getElementById("main")?.focus()},children:e("tous_les_v_nem_16033")})]})]})});var rT,aT;function lT(){return lT=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const{translate:t,params:{eventId:n}}=vl(),{organization:s}=TI(),o=(0,L.useMemo)(()=>{let t=`https://admin.${P.WEEZEVENT_DOMAIN}/ticket/O${e.weezeventOrganizationId}`;if(n){const e=s.events.nodes.find(e=>e.id===n);"number"==typeof e?.weezeventEventId&&(t+=`/E${e.weezeventEventId}`)}return t},[n,s]),r=`https://admin.${P.WEEZEVENT_DOMAIN}/access/O${e.weezeventOrganizationId}`,a=`https://admin.${P.WEEZEVENT_DOMAIN}/pay/#!/${e.weezeventOrganizationId}`;return(0,i.jsxs)(Wd,{children:[(0,i.jsx)(Xd,{children:(0,i.jsx)(Ba,{align:"center",css:{borderRadius:"$2",padding:"$2","&:hover":{background:"$gray700"}},justify:"center",children:(0,i.jsx)(Ba,{align:"center",css:{fontSize:"$textMd"},children:(0,i.jsx)(nl,{icon:"grid",iconStyle:"solid"})})})}),(0,i.jsx)(Zd,{css:{padding:"0"},placement:"bottom-end",children:(0,i.jsxs)(Ba,{css:{padding:"$3 $4"},direction:"column",gap:"3",children:[(0,i.jsx)(Ar,{color:"gray800",fontWeight:"medium",children:t("passer_75488")}),(0,i.jsxs)(Ba,{direction:"column",gap:"4",children:[(0,i.jsx)(el,{to:o,children:(0,i.jsxs)(Ba,{align:"center",gap:"3",children:[(0,i.jsx)(Ar,{css:{"& svg":{height:"100%"}},height:30,width:30,children:(0,i.jsx)(_T,{})}),(0,i.jsxs)(Ba,{direction:"column",children:[(0,i.jsx)(Ar,{color:"gray800",fontWeight:"medium",children:"WeezTicket"}),(0,i.jsx)(Ar,{color:"gray500",fontWeight:"medium",children:t("billetterie_53780")})]})]})}),(0,i.jsx)(el,{to:r,children:(0,i.jsxs)(Ba,{align:"center",gap:"3",children:[(0,i.jsx)(Ar,{css:{"& svg":{height:"100%"}},height:30,width:30,children:(0,i.jsx)(dT,{})}),(0,i.jsxs)(Ba,{direction:"column",children:[(0,i.jsx)(Ar,{color:"gray800",fontWeight:"medium",children:"WeezAccess"}),(0,i.jsx)(Ar,{color:"gray500",fontWeight:"medium",children:t("contr_le_d_acc_03854")})]})]})}),(0,i.jsx)(el,{to:a,children:(0,i.jsxs)(Ba,{align:"center",gap:"3",children:[(0,i.jsx)(Ar,{css:{"& svg":{height:"100%"}},height:30,width:30,children:(0,i.jsx)(mT,{})}),(0,i.jsxs)(Ba,{direction:"column",children:[(0,i.jsx)(Ar,{color:"gray800",fontWeight:"medium",children:"WeezPay"}),(0,i.jsx)(Ar,{color:"gray500",fontWeight:"medium",children:"Cashless"})]})]})})]})]})})]})},IT=({to:e,children:t,isActive:n,onClick:s})=>{const{pathname:o}=ii(),r=n?n(o):e===o;return(0,i.jsx)(Ba,{"aria-selected":r,css:{alignItems:"center",blockSize:"100%",color:"white",cursor:"pointer",opacity:r?"1":"0.6",px:"$4","&:hover":{opacity:"1"}},height:1,role:"menuitem",children:(0,i.jsx)(el,{height:1,to:e,width:1,onClick:s,children:t})})},vT=L.memo(function(){const{translate:e,params:{organizationId:t}}=vl(),{organization:n,user:s,updateLocalOrganization:o,isOrganizationReader:r}=TI(),{data:a}=ua({}),[l,d]=L.useState(!1),c=L.useMemo(()=>{const e=(0,cc.A)(a.user?.roles??[],e=>e.organizationId);return(0,uc.A)((a.organizations||[]).filter(t=>so(e[t.id])),e=>e.name)},[a.organizations,a.user]);return(0,i.jsxs)(Ba,{align:"center",css:{background:xr.colors.blueGray900.value,color:"white",cursor:"pointer",position:"relative",px:"$6"},height:1,justify:"between",width:1,children:[(0,i.jsx)(Ba,{align:"center","aria-label":e("page_d_accueil_12532"),css:{"& svg":{height:"50%"}},height:1,width:300,children:(0,i.jsx)(el,{height:1,to:Hi.EVENTS({organizationId:t}),children:(0,i.jsx)(id,{})})}),(0,i.jsx)(Ba,{"aria-label":e("menu_de_l_organ_58508"),as:Ma.Nav,height:1,children:(0,i.jsxs)(Ba,{align:"center",justify:"center",role:"menubar",children:[(0,i.jsx)(oT,{}),(0,i.jsx)(Kb,{permissions:Hb.CUSTOM_FIELD_READ,children:(0,i.jsx)(IT,{isActive:e=>e.startsWith(Ps.CUSTOM_FIELDS(t)),to:Ps.CUSTOM_FIELDS(t),onClick:async()=>await o({customFieldsSegmentId:null}),children:e("champs_de_formu_64126")})}),r&&(0,i.jsx)(IT,{isActive:e=>e.startsWith(wi.COMMUNITY({organizationId:t})),to:wi.COMMUNITY_USERS({organizationId:t}),children:e("communaut_20896")}),(0,i.jsx)(IT,{isActive:e=>e.startsWith(Ps.ORGANIZATION_PARAMETERS(t)),to:Ps.ORGANIZATION_PARAMETERS_PROFILE(t),children:e("param_tres_78420")})]})}),(0,i.jsxs)(Ba,{align:"center",gap:"6",justify:"end",width:300,children:["number"==typeof n.weezeventOrganizationId&&(0,i.jsx)(xT,{weezeventOrganizationId:n.weezeventOrganizationId}),(0,i.jsxs)(Wd,{"aria-label":e("menu_utilisateu_40033"),"aria-orientation":"vertical",isOpen:l,onStateChange:d,children:[(0,i.jsx)(Xd,{children:(0,i.jsxs)(Ba,{align:"center","aria-expanded":l,"aria-label":e("ouvrir_le_menu_47803"),css:{color:"white",cursor:"default"},gap:"3",role:"button",onClick:()=>document.getElementById("user-menu")?.focus(),children:[(0,i.jsx)(sp,{email:s.email,image:s.userInfo.picture?.url,name:s.userInfo.name,size:32}),(0,i.jsxs)(Ar,{css:{maxWidth:"calc(100% - 66px)"},children:[(0,i.jsx)(Ar,{css:{ellipsis:!0},fontWeight:"semiBold",children:s.userInfo.firstName||s.email}),(0,i.jsx)(Ar,{css:{ellipsis:!0},fontSize:"textXs",children:n.name})]}),(0,i.jsx)("div",{children:l?(0,i.jsx)("i",{className:"far fa-angle-up"}):(0,i.jsx)("i",{className:"far fa-angle-down"})})]})}),(0,i.jsxs)(Zd,{"aria-orientation":"vertical",id:"user-menu",maxHeight:500,placement:"bottom-end",width:300,children:[(0,i.jsx)(qd,{children:(0,i.jsxs)(Ba,{align:"center",gap:"3",width:1,children:[(0,i.jsx)(sp,{email:s.email,image:s.userInfo.picture?.url,name:s.userInfo.name,size:32}),(0,i.jsxs)(Ar,{css:{width:"calc(100% - 44px)"},children:[(0,i.jsx)(Ar,{css:{ellipsis:!0},fontWeight:"semiBold",children:s.userInfo.name||s.email}),m(s.userInfo.name)&&(0,i.jsx)(Ar,{color:"gray500",css:{ellipsis:!0},children:s.email})]})]})}),(0,i.jsx)(Xu,{color:"gray100",direction:"horizontal"}),(0,i.jsxs)(Ba,{as:Ma.Nav,direction:"column",role:"menubar",children:[c.map(({id:e,name:t})=>(0,i.jsx)(qd,{onClick:async()=>{await o({eventsSegmentId:null}),location.href=`${P.HEAVENT_APP_URL.pathname}${Hi.EVENTS({organizationId:e})}`,document.getElementById("main")?.focus()},children:t},e)),(0,i.jsx)(Xu,{color:"gray100",direction:"horizontal"}),(0,i.jsxs)(Kb,{rolesTypes:CI,children:[(0,i.jsx)(qd,{to:Ps.ORGANIZATION_PARAMETERS_PROFILE(t),onClick:()=>{d(!1),document.getElementById("main")?.focus()},children:e("mon_profil_48224")}),(0,i.jsx)(qd,{to:Ps.ORGANIZATION_PARAMETERS_INFOS(t),onClick:()=>{d(!1),document.getElementById("main")?.focus()},children:e("organisation_71863")}),(0,i.jsx)(qd,{to:Ps.ORGANIZATION_PARAMETERS_TEAM(t),onClick:()=>{d(!1),document.getElementById("main")?.focus()},children:e("utilisateurs_04975")}),(0,i.jsx)(Xu,{color:"gray100",direction:"horizontal"})]}),qc(s.email)&&(0,i.jsx)(qd,{to:Ps.BACKOFFICE,onClick:()=>{document.getElementById("main")?.focus()},children:e("back_office_83072")}),(0,i.jsx)(qd,{color:"red",onClick:X,children:e("se_d_connecter_74151")})]})]})]})]})]})}),bT=[1033,1538,1787,2574,2954,3059],jT=e=>{const t=Xn(),{organizationId:n}=ti(),s=ii(),{organization:o}=TI(),[r,a]=L.useState(!1),l=function(e){return Math.ceil(e.periodEndAt.diff(Gs.c9.utc(),"days").days)}(o),d=(c=l)>0&&c<=15;var c;const u=o.invoices.length>0,h=L.useCallback(()=>{a(!0)},[a]);if(L.useEffect(()=>(document.addEventListener(mo,h),()=>{document.removeEventListener(mo,h)}),[]),o.isBlocked&&!s.pathname.endsWith(bi))return(0,i.jsx)(oi,{path:yi.IS_BLOCKED(yi.ORGANIZATION({organizationId:n}))});if(!o.isBlocked&&s.pathname.endsWith(bi))return(0,i.jsx)(oi,{path:yi.ORGANIZATION({organizationId:n})});if(l<=0&&!s.pathname.endsWith(ji))return(0,i.jsx)(oi,{path:yi.IS_EXPIRED(yi.ORGANIZATION({organizationId:n}))});if(l>0&&s.pathname.endsWith(ji))return(0,i.jsx)(oi,{path:yi.ORGANIZATION({organizationId:n})});{const s=u&&!bT.includes(n),c=64+(r?40:0)+(d||s?64:0);return(0,i.jsxs)(Ba,{css:{overflow:"hidden"},direction:"column",height:1,role:"presentation",width:1,children:[r&&(0,i.jsxs)(Ba,{align:"center",css:{background:"$primary100",px:"$6"},gap:"1",height:40,justify:"between",role:"alert",width:1,children:[(0,i.jsx)(Ar,{}),(0,i.jsxs)(Ba,{gap:"1",children:[(0,i.jsx)(Ar,{color:"gray800",children:t("une_nouvelle_ve_69718")}),(0,i.jsx)(zl,{color:"invisible",css:{height:"auto",padding:0},type:"button",onClick:()=>{window.location.reload()},children:t("cliquez_pour_re_36838")})]}),(0,i.jsx)(Ar,{color:"white",css:{cursor:"pointer"},fontSize:"textMd",onClick:()=>{a(!1)},children:(0,i.jsx)(nl,{icon:"xmark"})})]}),d&&!s&&(0,i.jsx)(Ba,{align:"center",css:{background:"$primary500",color:"white"},dangerouslySetInnerHTML:{__html:`${t("trial_remaining_days",l,`${P.EMAIL_FROM} `,Cd)}
`},height:64,justify:"center",width:1}),s&&(0,i.jsx)(Ba,{align:"center",css:{background:"$primary500",color:"white","& > a":{color:"white",textDecoration:"underline"}},dangerouslySetInnerHTML:{__html:t("sauf_erreur_de_03325",o.invoices[0].url,o.invoices[0].invoiceNumber)},height:64,justify:"center",width:1}),(0,i.jsx)(Ar,{as:Ma.Header,height:64,width:1,children:(0,i.jsx)(vT,{})}),(0,i.jsx)(Ar,{as:Ma.Main,css:{height:`calc(100% - ${c}px)`},id:"main",tabIndex:-1,width:1,children:e.children}),(0,i.jsx)(sT,{level:"organization"})]})}};let CT=class extends Gl{countriesService;documentInputService;fieldInputService;phoneInputService;constructor(e,t,n,i,s){super(e),this.countriesService=t,this.documentInputService=n,this.fieldInputService=i,this.phoneInputService=s}userInfoUpdateInputDefault(e,t,n={}){const i=this.countriesService.getDefaultCountryValues(n.countryCode);return{id:e?.id??null,fields:this.fieldInputService.fieldsUpdateInputDefault(e?.fields||{},t,i,n.checkboxDefaultEmpty)}}formUserInfoInputSchema(e){return d.Ik().shape({fields:d.Ik().shape(Object.fromEntries(e.map(({isMandatory:e,customField:t})=>[t.slug,this.fieldInputService.fieldSchema(t,e)])))})}userInfoInputSchema(e,t){const n={};return e.forEach(e=>{const t=e.field,i=this.fieldInputService.fieldSchema(e.field,e.isMandatory);n[t.slug]=i}),t&&t.forEach(e=>{n[e.slug]=this.fieldInputService.fieldSchema(e,!1)}),d.Ik().shape({fields:d.Ik().shape({...n})})}userInfoProfileInputDefault(e){const t=this.countriesService.getDefaultCountryValues();return{email:e.email,fields:{firstName:e.userInfo?.fields?.firstName??"",lastName:e.userInfo?.fields?.lastName??"",language:e.userInfo?.fields?.language??e.language??t.user.language??At.En,picture:e.userInfo.fields.picture?(0,Er.A)(e.userInfo.fields.picture,Wj):this.documentInputService.documentInputDefault(),phone:e.userInfo.fields.phone?(0,Er.A)(e.userInfo.fields.phone,nI):this.phoneInputService.phoneInputDefault(t)}}}userInfoFields(){return{fields:d.Ik().shape({firstName:d.Yj().nullable(),lastName:d.Yj().nullable(),picture:this.documentInputService.documentInputSchemaNotRequired(),language:d.Yj().required(this.t("les_langues_doi_27712")).oneOf(Id,this.t("les_langues_doi_27712")),phone:this.phoneInputService.phoneInputSchemaNotRequired()})}}userInfoProfileInputSchema(){return d.Ik().shape({email:d.Yj().email(this.t("l_e_mail_est_re_04856")).required(this.t("l_e_mail_est_re_04856")),...this.userInfoFields()})}updateUserInfoSchema(e){return d.Ik().shape({userInfo:this.formUserInfoInputSchema(e)})}updateProfileSchema(){return d.Ik().shape({userInfo:this.userInfoProfileInputSchema()})}userInfoAndTermsInputDefault(e){return{...(0,ur.A)(e.userInfo,["id"]),termsAccepted:!1}}userInfoAndTermsInputSchema(){return d.Ik().shape({firstName:d.Yj().nullable(),lastName:d.Yj().nullable(),phone:this.phoneInputService.phoneInputSchemaNotRequired(),termsAccepted:d.zM().oneOf([!0],this.t("il_est_n_cessai_83896")).required(this.t("il_est_n_cessai_83896"))})}updateUserInfoAndTermsSchema(){return d.Ik().shape({userInfoAndTerms:this.userInfoAndTermsInputSchema()})}};CT=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[qn,hu,Gj,_C,iI])],CT);let yT=class extends Gl{constructor(e){super(e)}volunteersRegistrationsSlotInputDefault(e){return{startDate:e||Gs.c9.invalid("Invalid"),startTime:"",endDate:e||Gs.c9.invalid("Invalid"),endTime:""}}volunteersRegistrationsSlotInputSchema(e,t){const n=t.plus({day:1}).endOf("day");return d.Ik().shape({startDate:Qm.required(this.t("la_date_de_d_bu_05030")).typeError(this.t("la_date_de_d_bu_05030")).test("after-event-start-date",this.t("la_date_de_d_bu_68630",e.toLocaleString()),t=>t>=e),startTime:d.Yj().required(this.t("heure_de_d_but_90785")),endDate:Qm.required(this.t("la_date_de_fin_32246")).typeError(this.t("la_date_de_fin_32246")).test("after-start-date",this.t("la_date_de_fin_00429"),(e,t)=>Gs.c9.isDateTime(t.parent.startDate)&&t.parent.startDate.isValid&&Gs.c9.isDateTime(t.parent.endDate)&&t.parent.endDate.isValid&&t.parent.endDate>=t.parent.startDate).test("before-event-end-date",this.t("la_date_de_fin_49125",t.toLocaleString()),e=>e<=n),endTime:d.Yj().required(this.t("l_heure_de_fin_78626"))})}};yT=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[qn])],yT);let kT=class extends Gl{translationService;userInfoInputService;volunteerRegistrationSlotInputService;constructor(e,t,n){super(e),this.translationService=e,this.userInfoInputService=t,this.volunteerRegistrationSlotInputService=n}slotsFields(e,t,n){switch(e){case It.Display:case It.DisplayDays:case It.Calendar:case It.Custom:return{slots:d.YO().of(this.volunteerRegistrationSlotInputService.volunteersRegistrationsSlotInputSchema(t,n)).min(1,this.t("vous_devez_ajou_68961"))};case It.Hide:return{};default:return ll()}}volunteersRegistrationsSlotsUpdateInputDefault(e){return so(e)?e.map(e=>({startDate:e.startDate,startTime:e.startTime,endDate:e.endDate,endTime:e.endTime})):[]}userInfoSlotsSchema(e,t,n){return d.Ik().shape({userInfo:d.Ik().shape({slots:d.YO().of(d.Ik().shape({formId:d.ai().required(),...this.slotsFields(e,t,n)}))})})}volunteersRegistrationsWishedPositionsInputDefault(){return{positionsCategoriesIds:[],positionsIds:[],positionsSlotsIds:[]}}volunteersRegistrationsWishedPositionsUpdateInputDefault(e){return e?{positionsCategoriesIds:e?.positionsCategoriesIds,positionsIds:e?.positionsIds,positionsSlotsIds:e?.positionsSlotsIds}:this.volunteersRegistrationsWishedPositionsInputDefault()}wishedPositionsFields(e,t){if(e===Ke.Ranked){if(t===_t.Category)return{positionsCategoriesIds:d.YO().of(d.ai().typeError(this.t("s_lectionner_un_26253"))).min(1,this.t("vous_devez_s_le_32044")).test("different",this.t("les_missions_so_04441"),e=>{const t=(0,Za.A)((e||[]).filter(e=>-1!==e));return so(t)&&(0,Bs.A)(t).length===t.length})};if(t===_t.Position)return{positionsIds:d.YO().of(d.ai().typeError(this.t("s_lectionner_un_26253"))).min(1,this.t("vous_devez_s_le_89603")).test("different",this.t("les_missions_so_04441"),e=>{const t=(0,Za.A)((e||[]).filter(e=>-1!==e));return so(t)&&(0,Bs.A)(t).length===t.length})};throw new Error("Should not happen")}switch(t){case _t.Category:return{positionsCategoriesIds:d.YO().of(d.ai().typeError(this.t("s_lectionner_un_26253"))).min(1,this.t("vous_devez_s_le_32044"))};case _t.Position:return{positionsIds:d.YO().of(d.ai().typeError(this.t("s_lectionner_un_26253"))).min(1,this.t("vous_devez_s_le_89603"))};case _t.Slot:return{positionsSlotsIds:d.YO().of(d.ai()).min(1,this.t("vous_devez_s_le_89603"))};case _t.None:return{};default:return ll()}}volunteerRegistrationWishedPositionsSchema(e,t){return d.Ik().shape({volunteerRegistration:d.Ik().shape({...this.wishedPositionsFields(e,t)})})}userInfoWishedPositionsSchema(e,t){return d.Ik().shape({userInfo:d.Ik().shape({missions:d.YO().of(d.Ik().shape({formId:d.ai().required(),...this.wishedPositionsFields(e,t)}))})})}volunteersRegistrationsWishedAccreditationsInputDefault(){return{accreditationsSlotsIds:[]}}volunteersRegistrationsWishedAccreditationsUpdateInputDefault(e){return e?{accreditationsSlotsIds:e.accreditationsSlotsIds}:this.volunteersRegistrationsWishedAccreditationsInputDefault()}accreditationsFields(e,t){if(t)return{};switch(e){case pt.Accreditation:return{accreditationsSlotsIds:d.YO().of(d.ai().typeError(this.t("s_lectionner_un_96571"))).min(1,this.t("vous_devez_s_le_72138"))};case pt.None:return{};default:return ll()}}volunteerRegistrationAccreditationsSchema(e){return d.Ik().shape({volunteerRegistration:d.Ik().shape({...this.accreditationsFields(e,null)})})}userInfoAccreditationsSchema(e){return d.Ik().shape({userInfo:d.Ik().shape({accreditations:d.YO().of(d.Ik().shape({formId:d.ai().required(),...this.accreditationsFields(e,null)}))})})}updateVolunteerRegistrationSchema(e,t,n,i,s,o,r){let a={userInfo:this.userInfoInputService.userInfoInputSchema(e,t)};return a={...a,...this.slotsFields(n,o,r),...this.wishedPositionsFields(i,s)},d.Ik().shape({email:d.Yj().required(this.t("l_e_mail_est_re_04856")).email(this.t("l_e_mail_est_re_04856")),volunteerRegistration:d.Ik().shape({...a})})}adminCreateSchema(){return d.Ik().shape({email:d.Yj().email(this.t("l_e_mail_n_est_57882")).required(this.t("l_e_mail_n_est_57882")),sendVolunteerRegistrationEmail:d.zM().required(),firstName:d.Yj(),lastName:d.Yj()})}adminAddSchema(){return d.Ik().shape({usersInfosIds:d.YO().of(d.ai()).min(1,this.t("vous_devez_s_le_83608")),sendVolunteerRegistrationEmail:d.zM().required()})}};kT=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[qn,CT,yT])],kT);let AT=class extends Gl{fieldInputService;userInfoInputService;volunteerRegistrationInputService;volunteerRegistrationSlotInputService;constructor(e,t,n,i,s){super(e),this.fieldInputService=t,this.userInfoInputService=n,this.volunteerRegistrationInputService=i,this.volunteerRegistrationSlotInputService=s}formRegisterInputDefault(e,t,n,i){return{autoAccredit:!1,forOther:i.forOther,positionsSlotsIds:i.team?.positionsSlotsIds??[],positionsIds:i.team?.positionsIds??[],positionsCategoriesIds:i.team?.positionsCategoriesIds??[],accreditationsSlotsIds:(i.delegationAccreditations??[]).filter(e=>e.isDefault).map(e=>e.accreditationSlotId),userInfo:this.userInfoInputService.userInfoUpdateInputDefault(t,n,{countryCode:i.countryCode}),sendNotificationEmail:i.sendNotificationEmail,slots:i.slotDisplay===It.Display?[this.volunteerRegistrationSlotInputService.volunteersRegistrationsSlotInputDefault(i.eventStartDate)]:i.team?.slots??[],source:e}}formRegisterInformationsSchema(e){return d.Ik().shape({formRegister:d.Ik().shape({userInfo:this.userInfoInputService.formUserInfoInputSchema(e)})})}formRegisterSlotsSchema(e,t,n){return d.Ik().shape({formRegister:d.Ik().shape({...this.volunteerRegistrationInputService.slotsFields(e,t,n)})})}formRegisterPositionsSchema(e,t){return d.Ik().shape({formRegister:d.Ik().shape({...this.volunteerRegistrationInputService.wishedPositionsFields(e,t)})})}formRegisterAccreditationsSchema(e,t,n,i){const s=function(e){return Object.values(e.reduce((e,t)=>{if(e[t.customField.slug]){const n=e[t.customField.slug];return{...e,[t.customField.slug]:{accreditationsSlotsIds:n.accreditationsSlotsIds.concat(t.accreditationsSlotsIds),customField:t.customField,isMandatory:n.isMandatory||t.isMandatory}}}return{...e,[t.customField.slug]:{accreditationsSlotsIds:t.accreditationsSlotsIds,customField:t.customField,isMandatory:t.isMandatory}}},{}))}(n);return d.Ik().shape({formRegister:d.Ik().shape({...this.volunteerRegistrationInputService.accreditationsFields(e,i),userInfo:d.Ik().shape({fields:d.Ik().shape(Object.fromEntries(s.map(e=>{const n=e.isMandatory&&so((0,fh.A)(e.accreditationsSlotsIds,t));return[e.customField.slug,this.fieldInputService.fieldSchema(e.customField,n)]})))})})})}formRegisterSchema(e,t,n,i,s,o,r,a){return d.Ik().shape({email:d.Yj().required(this.t("l_e_mail_est_re_04856")).email(this.t("l_e_mail_est_re_04856")),formRegister:d.Ik().shape({userInfo:this.userInfoInputService.formUserInfoInputSchema(e),...this.volunteerRegistrationInputService.slotsFields(t,n,i),...this.volunteerRegistrationInputService.wishedPositionsFields(s,o),...this.volunteerRegistrationInputService.accreditationsFields(r,a)})})}};AT=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[qn,_C,CT,kT,yT])],AT);const wT=e=>{const t=Zn(hu);return(0,i.jsx)(Nr.Yr,{name:e.name,children:n=>{e.change(`${e.prefix}street`,n.name);const i=n.geometry?.location?.lat(),s=n.geometry?.location?.lng(),o=n.address_components?.find(({types:e})=>e.includes("locality")),r=n.address_components?.find(({types:e})=>e.includes("postal_code")),a=n.address_components?.find(({types:e})=>e.includes("country"))?.short_name;"number"==typeof i&&"number"==typeof s&&e.changeLatLng&&(e.change(`${e.prefix}latitude`,i),e.change(`${e.prefix}longitude`,s)),o&&e.changeCity&&e.change(`${e.prefix}city`,o.long_name),r&&e.changePostalCode&&e.change(`${e.prefix}postalCode`,r.long_name),t.countryCodeExists(a)&&e.changeCountry&&e.change(`${e.prefix}country`,a)}})},ST=e=>{const t=L.useMemo(()=>e.elements.flatMap(e=>e.elementType===qe.Field?(0,Za.A)([e.customField,e.conditionCustomField]):e.hasCondition&&e.conditionCustomField?[e.conditionCustomField]:[]),[e.elements]);return(0,i.jsx)(Ar,{children:e.elements.map((n,s)=>{switch(n.elementType){case qe.Field:{const o=n.customField,r=pC(o,e.values,t);return(0,i.jsxs)(L.Fragment,{children:[o.fieldProperty===Ve.Street&&(0,i.jsx)(wT,{change:e.change,changeCity:!0,changeCountry:!0,changeLatLng:!0,changePostalCode:!0,name:"place",prefix:e.prefix}),r&&0!==s&&(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(yC,{change:e.change,countryCode:e.countryCode,display:r,field:o,isMandatory:!0===n.isMandatory,organizationId:e.organizationId,prefix:e.prefix},s)]},s)}case qe.Section:return pC(n,e.values,t)?(0,i.jsx)(L.Fragment,{children:"function"==typeof e.renderSection?e.renderSection(n.section,s):(0,i.jsxs)(i.Fragment,{children:[e.featureFlags?.isV4?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"5"}),(0,i.jsx)(Xu,{direction:"horizontal"}),(0,i.jsx)(Ya,{height:"5"})]}):0!==s&&(0,i.jsx)(Ya,{height:"8"}),(0,i.jsx)(Ar,{font:"gray800 textMd semiBold",children:"function"==typeof e.renderText?e.renderText(n.section):n.section})]})},s):null;case qe.Text:return pC(n,e.values,t)?(0,i.jsx)(L.Fragment,{children:(0,i.jsxs)(i.Fragment,{children:[0!==s&&(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(Cg,{text:"function"==typeof e.renderText?e.renderText(n.text):n.text})]})},s):null;default:return ll(n.elementType)}})})},ET=e=>{const t=Xn();return(0,i.jsxs)(au,{buttons:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(zl,{onClick:e.onClose,children:t("fermer_62479")})}),size:"md",onClose:e.onClose,children:[(0,i.jsx)(Ba,{justify:"center",width:1,children:(0,i.jsx)(sC,{color:"primary",icon:"circle-info"})}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(Ar,{font:"gray900 textLg medium",textAlign:"center",width:1,children:t("informations_su_86120",e.name)}),(0,i.jsx)(Ya,{height:"7"}),m(e.description)&&(0,i.jsxs)(Ba,{css:{overflowY:"auto"},direction:"column",gap:"2",children:[(0,i.jsx)(Ar,{font:"gray900 textMd semiBold",children:t("description_58935")}),(0,i.jsx)(Cg,{text:e.description})]}),(0,i.jsx)(Ya,{height:"4"})]})},TT=e=>{const{translate:t}=vl(),n=Zn(Jc);return(0,i.jsx)(i.Fragment,{children:so(e.slots)?e.slots.map(t=>(0,i.jsx)(_c,{state:e.accreditationsSlotsIds.includes(t.id)?"checked":"unchecked",onClick:n=>{e.change(`${e.prefix}accreditationsSlotsIds`,ro(e.accreditationsSlotsIds,t.id,"checked"===n))},children:(0,i.jsx)(Ar,{css:{textTransform:"capitalize"},children:Dh(n,t,e.accreditation.name,{date:{localeFormat:eo.DateOnly.WeekdayLongMonthLong}})})},t.id)):(0,i.jsx)(Gk,{imageSrc:_d.WeezeventBlankPerson,subtitle:t("this_may_be_bec_43194"),title:t("no_items_are_cu_47996")})})},zT=e=>{const{translate:t}=vl(),n=Zn(Jc),s=(0,L.useMemo)(()=>e.slots.map(e=>e.id),[e.slots]);return(0,i.jsx)(i.Fragment,{children:so(e.slots)?e.slots.map(t=>(0,i.jsx)(vc,{state:e.accreditationsSlotsIds.includes(t.id)?"checked":"unchecked",onClick:n=>{const i=[...e.accreditationsSlotsIds.filter(e=>!s.includes(e)),..."checked"===n?[t.id]:[]];e.change(`${e.prefix}accreditationsSlotsIds`,i)},children:(0,i.jsx)(Ar,{css:{textTransform:"capitalize"},children:Dh(n,t,e.accreditation.name,{date:{localeFormat:eo.DateOnly.WeekdayLongMonthLong}})})},t.id)):(0,i.jsx)(Gk,{imageSrc:_d.WeezeventBlankPerson,subtitle:t("this_may_be_bec_43194"),title:t("no_items_are_cu_47996")})})},OT=e=>{const{params:{organizationId:t},translate:n}=vl(),[s,o]=(0,L.useState)(!1),r=(0,L.useMemo)(()=>(0,uc.A)(e.accreditation.slots.filter(t=>Ph(t,e.slots,e.options,e.delegationAccreditations)),e=>(0,Za.A)([e.date?.toMillis(),e.name.toLowerCase()])),[e.accreditation.slots,e.delegationAccreditations,e.slots,e.options]),a=(0,L.useMemo)(()=>m(e.accreditation.description)&&e.options.showAccreditationDescription,[e.accreditation,e.options]),l=(0,L.useMemo)(()=>{const t=e.accreditation.hasSlots?r.map(e=>e.id):[e.accreditation.hiddenSlotId];return e.displayFormCustomFields&&so(e.accreditation.formCustomFields)&&so((0,fh.A)(t,e.accreditationsSlotsIds))},[e.accreditation,e.accreditationsSlotsIds,e.displayFormCustomFields,r]),d=e.accreditationsSlotsIds.includes(e.accreditation.hiddenSlotId)?"checked":"unchecked";return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(GC,{accreditation:e.accreditation,displayFormCustomFields:l,displayNumberOfSlots:!1,displaySlots:e.accreditation.hasSlots,numberOfSlots:0,renderActions:()=>a&&(0,i.jsx)(zl,{color:"white",onClick:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),o(!0)},children:n("voir_la_descrip_62304")}),renderCheckbox:()=>!e.accreditation.hasSlots&&(0,i.jsx)(fc,{shouldPreventDefault:!1,state:d,onClick:td.A}),onClick:()=>{e.accreditation.hasSlots||e.change(`${e.prefix}accreditationsSlotsIds`,ro(e.accreditationsSlotsIds,e.accreditation.hiddenSlotId,"unchecked"===d))},children:(0,i.jsxs)(Ba,{css:{background:"white",padding:"$4"},direction:"column",gap:"3",children:[e.accreditation.hasSlots?e.accreditation.accreditationDisplay===ie.Calendar?(0,i.jsx)(TA,{accreditationsSlotsIds:e.accreditationsSlotsIds,change:e.change,prefix:e.prefix,slots:r}):(0,i.jsx)(Ba,{css:{background:"white",bd:!0,padding:"$4"},direction:"column",gap:"3",width:1,children:e.accreditation.accreditationDisplay===ie.Radio?(0,i.jsx)(zT,{accreditation:e.accreditation,accreditationsSlotsIds:e.accreditationsSlotsIds,change:e.change,prefix:e.prefix,slots:r}):(0,i.jsx)(TT,{accreditation:e.accreditation,accreditationsSlotsIds:e.accreditationsSlotsIds,change:e.change,prefix:e.prefix,slots:r})}):null,l&&(0,i.jsx)(Ba,{css:{background:"white",bd:!0,padding:"$4"},direction:"column",gap:"3",width:1,children:e.accreditation.formCustomFields.map(({customField:n,isMandatory:s})=>(0,i.jsx)(yC,{change:e.change,display:!0,field:n,isMandatory:s,organizationId:t,prefix:`${e.prefix}userInfo.fields.`},n.id))})]})}),s&&(0,i.jsx)(ET,{description:e.accreditation.description,name:e.accreditation.name,onClose:()=>{o(!1)}})]})},RT=e=>{const{translate:t}=vl(),n=(0,L.useMemo)(()=>DC(e.category.accreditations.filter(t=>zC(t,e.slots,e.userInfoFields,e.options,e.delegationAccreditations))),[e.category,e.delegationAccreditations,e.slots,e.userInfoFields,e.options]);return(0,i.jsx)(VC,{category:e.category,children:so(n)?n.map(t=>(0,i.jsx)(OT,{accreditation:t,accreditationsSlotsIds:e.accreditationsSlotsIds,change:e.change,delegationAccreditations:e.delegationAccreditations,displayFormCustomFields:e.displayFormCustomFields,options:e.options,prefix:e.prefix,slots:e.slots},t.id)):(0,i.jsx)(Gk,{imageSrc:_d.WeezeventBlankPerson,subtitle:t("this_may_be_bec_43194"),title:t("no_items_are_cu_47996")})})},$T=e=>{const{translate:t}=vl(),n=(0,L.useMemo)(()=>(0,uc.A)(e.categories,e=>e.name.toLowerCase()),[e.categories]);return(0,i.jsx)(BC,{css:{background:"transparent",padding:"0"},children:so(n)?(0,i.jsxs)(i.Fragment,{children:[n.map(t=>(0,i.jsx)(RT,{accreditationsSlotsIds:e.accreditationsSlotsIds,category:t,change:e.change,delegationAccreditations:e.delegationAccreditations,displayFormCustomFields:e.displayFormCustomFields,options:e.options,prefix:e.prefix,slots:e.slots,userInfoFields:e.userInfoFields},t.id)),e.showAutoAccredit&&(0,i.jsxs)(Ba,{direction:"column",gap:"1",children:[(0,i.jsx)(Ar,{font:"gray900 textSm medium",children:t("attribution_des_59896")}),(0,i.jsx)(Jm,{name:`${e.prefix}autoAccredit`,children:t("attribuer_les_a_75431")})]})]}):(0,i.jsx)(Gk,{imageSrc:_d.WeezeventBlankPerson,subtitle:t("this_may_be_bec_43194"),title:t("no_items_are_cu_47996")})})},DT=e=>{const t=(0,L.useMemo)(()=>e.event.accreditationsCategories.filter(t=>{return n=t,i=e.slots,s=e.userInfosFields,o=e.options,r=e.delegationAccreditations,o.accreditationDisplay!==pt.None&&!o.hiddenAccreditationsCategoriesIds.includes(n.id)&&(0===o.displayedAccreditationsCategoriesIds.length||o.displayedAccreditationsCategoriesIds.includes(n.id))&&n.accreditations.some(e=>zC(e,i,s,o,r))||r.some(e=>e.accreditationCategoryId===n.id&&n.accreditations.some(e=>zC(e,i,s,o,r)));var n,i,s,o,r}),[e.event.accreditationsCategories,e.slots,e.userInfosFields,e.options]);return so(e.delegationAccreditations)||e.options.accreditationDisplay===pt.Accreditation?(0,i.jsx)($T,{accreditationsSlotsIds:e.accreditationsSlotsIds,categories:t,change:e.change,delegationAccreditations:e.delegationAccreditations,displayFormCustomFields:e.displayFormCustomFields,options:e.options,prefix:e.prefix,showAutoAccredit:e.showAutoAccredit,slots:e.slots,userInfoFields:e.userInfosFields}):null},PT=e=>{const[t,n]=(0,L.useState)(!1),s=m(e.category.description)&&e.options.showPositionCategoryDescription;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(_c,{css:{alignItems:"center"},state:e.positionsCategoriesIds.includes(e.category.id)?"checked":"unchecked",onClick:t=>{e.change(`${e.prefix}positionsCategoriesIds`,ro(e.positionsCategoriesIds,e.category.id,"checked"===t))},children:(0,i.jsxs)(Ba,{align:"center",gap:"2",children:[(0,i.jsx)(Ar,{children:e.category.name}),s&&(0,i.jsx)(Ar,{onClick:e=>{Dl(e),n(!0)},children:(0,i.jsx)(nl,{icon:"circle-info"})})]})}),t&&(0,i.jsx)(ET,{description:e.category.description,name:e.category.name,onClose:()=>{n(!1)}})]})},FT=e=>{const{translate:t}=vl(),n=(0,L.useMemo)(()=>(0,uc.A)(e.categories,e=>e.name),[e.categories]);return(0,i.jsx)(i.Fragment,{children:so(n)?n.map((t,n)=>(0,i.jsxs)(L.Fragment,{children:[0!==n&&(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(PT,{category:t,change:e.change,options:e.options,positionsCategoriesIds:e.positionsCategoriesIds,prefix:e.prefix})]},t.id)):(0,i.jsx)(Gk,{imageSrc:_d.WeezeventBlankPerson,subtitle:t("this_may_be_bec_43194"),title:t("no_items_are_cu_47996")})})},MT=e=>{const[t,n]=(0,L.useState)(!1),s=m(e.position.description)&&e.options.showPositionDescription;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(_c,{css:{alignItems:"center"},state:e.positionsIds.includes(e.position.id)?"checked":"unchecked",onClick:t=>{e.change(`${e.prefix}positionsIds`,ro(e.positionsIds,e.position.id,"checked"===t))},children:(0,i.jsxs)(Ba,{align:"center",gap:"2",children:[(0,i.jsx)(Ar,{children:e.position.name}),s&&(0,i.jsx)(Ar,{onClick:e=>{Dl(e),n(!0)},children:(0,i.jsx)(nl,{icon:"circle-info"})})]})}),t&&(0,i.jsx)(ET,{description:e.position.description,name:e.position.name,onClose:()=>{n(!1)}})]})},NT=e=>{const{translate:t}=vl(),n=(0,L.useMemo)(()=>(0,uc.A)(e.category.positions.filter(t=>Th(t,e.userInfoFields,e.slots,e.options)),e=>e.name),[e.category,e.userInfoFields,e.slots,e.options]),[s,o]=(0,L.useState)(!1),r=m(e.category.description)&&e.options.showPositionCategoryDescription;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ba,{align:"center",gap:"2",children:[(0,i.jsx)(Ar,{color:"gray900",fontWeight:"semiBold",children:e.category.name}),r&&(0,i.jsx)(Ar,{color:"gray700",onClick:()=>{o(!0)},children:(0,i.jsx)(nl,{icon:"circle-info"})})]}),(0,i.jsx)(Ya,{height:"2"}),so(n)?n.map((t,n)=>(0,i.jsxs)(L.Fragment,{children:[0!==n&&(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(MT,{change:e.change,options:e.options,position:t,positionsIds:e.positionsIds,prefix:e.prefix})]},t.id)):(0,i.jsx)(Gk,{imageSrc:_d.WeezeventBlankPerson,subtitle:t("this_may_be_bec_43194"),title:t("no_items_are_cu_47996")}),s&&(0,i.jsx)(ET,{description:e.category.description,name:e.category.name,onClose:()=>{o(!1)}})]})},LT=e=>{const{translate:t}=vl(),n=(0,L.useMemo)(()=>(0,uc.A)(e.categories,e=>e.name),[e.categories]);return(0,i.jsx)(i.Fragment,{children:so(n)?n.map((t,n)=>(0,i.jsxs)(L.Fragment,{children:[0!==n&&(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(NT,{category:t,change:e.change,options:e.options,positionsIds:e.positionsIds,prefix:e.prefix,slots:e.slots,userInfoFields:e.userInfoFields})]},t.id)):(0,i.jsx)(Gk,{imageSrc:_d.WeezeventBlankPerson,subtitle:t("this_may_be_bec_43194"),title:t("no_items_are_cu_47996")})})},BT=e=>{const t=Xn(),n=tw(),s=(0,L.useMemo)(()=>(0,uc.A)(e.categories,e=>u(e.name)).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id)),[e.categories]);return(0,i.jsxs)(i.Fragment,{children:[so(s)?n?(0,i.jsxs)(yc,{isSearchVisible:!0,label:t("souhait_n_1_47211",e.index+1),values:[e.positionsCategoriesIds?.[e.index]??-1],onChange:t=>{so(t)&&e.change(`${e.prefix}positionsCategoriesIds[${e.index}]`,t[0])},children:[(0,i.jsx)("option",{value:-1,children:t("choisir_une_mis_90627")}),s]}):(0,i.jsxs)($u,{label:t("souhait_n_1_47211",e.index+1),shouldParseAsInt:!0,value:e.positionsCategoriesIds?.[e.index]??-1,onChange:t=>{e.change(`${e.prefix}positionsCategoriesIds[${e.index}]`,t)},children:[(0,i.jsx)("option",{value:-1,children:t("choisir_une_mis_90627")}),s]}):(0,i.jsx)(Gk,{imageSrc:_d.WeezeventBlankPerson,subtitle:t("this_may_be_bec_43194"),title:t("no_items_are_cu_47996")}),e.index!==e.options.positionLimit-1&&(0,i.jsx)(Ya,{height:"4"})]})},VT=e=>{const t=Xn(),n=tw(),s=(0,L.useMemo)(()=>(0,uc.A)(e.categories,e=>u(e.name)).map(t=>(0,i.jsx)("optgroup",{label:t.name,children:(0,uc.A)(t.positions,e=>u(e.name)).filter(t=>Th(t,e.userInfoFields,e.slots,e.options)).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},t.id)),[e.categories]);return(0,i.jsxs)(i.Fragment,{children:[so(s)?n?(0,i.jsxs)(yc,{isSearchVisible:!0,label:t("souhait_n_1_47211",e.index+1),values:[e.positionsIds?.[e.index]??-1],onChange:t=>{so(t)&&e.change(`${e.prefix}positionsIds[${e.index}]`,t[0])},children:[(0,i.jsx)("option",{value:-1,children:t("choisir_une_mis_90627")}),s]}):(0,i.jsxs)($u,{label:t("souhait_n_1_47211",e.index+1),shouldParseAsInt:!0,value:e.positionsIds?.[e.index]??-1,onChange:t=>{e.change(`${e.prefix}positionsIds[${e.index}]`,t)},children:[(0,i.jsx)("option",{value:-1,children:t("choisir_une_mis_90627")}),s]}):(0,i.jsx)(Gk,{imageSrc:_d.WeezeventBlankPerson,subtitle:t("this_may_be_bec_43194"),title:t("no_items_are_cu_47996")}),e.index!==e.options.positionLimit-1&&(0,i.jsx)(Ya,{height:"4"})]})},UT=e=>{const{translate:t}=vl();return(0,i.jsx)(i.Fragment,{children:so(e.categories)?(0,Dc.A)(0,e.options.positionLimit).map(t=>e.options.positionDisplay===_t.Category?(0,i.jsx)(BT,{categories:e.categories,change:e.change,index:t,options:e.options,positionsCategoriesIds:e.positionsCategoriesIds,prefix:e.prefix},t):(0,i.jsx)(VT,{categories:e.categories,change:e.change,index:t,options:e.options,positionsIds:e.positionsIds,prefix:e.prefix,slots:e.slots,userInfoFields:e.userInfoFields},t)):(0,i.jsx)(Gk,{imageSrc:_d.WeezeventBlankPerson,subtitle:t("this_may_be_bec_43194"),title:t("no_items_are_cu_47996")})})};function WT(e){const t=Zn(ph),n=(0,L.useMemo)(()=>t.toDisplayString(e.range,{formats:{displayWeekday:!0}}),[e]),i=m(e.name);return{isRenamed:i,finalName:i?e.name:n,rangeString:n}}const GT=e=>{const{translate:t}=vl(),{rangeString:n,finalName:s,isRenamed:o}=WT(e.slot),r=(0,L.useMemo)(()=>{if(e.options.willAutoAssign){const t=e.allSlots.filter(t=>e.positionsSlotsIds.includes(t.id));return yh(e.slot,t)}return!1},[e.options.willAutoAssign,e.allSlots,e.positionsSlotsIds]);return(0,i.jsxs)(L.Fragment,{children:[0!==e.index&&(0,i.jsx)(Ya,{height:"3"}),r?(0,i.jsxs)(km,{children:[(0,i.jsx)(Sm,{children:(0,i.jsx)(Ar,{children:(0,i.jsx)(_c,{disabled:!0,shouldPreventDefault:!1,state:e.positionsSlotsIds.includes(e.slot.id)?"checked":"unchecked",subtext:o?n:void 0,onClick:td.A,children:s})})}),(0,i.jsx)(wm,{placement:"top-start",children:t("ce_cr_neau_en_c_55775")})]}):(0,i.jsx)(_c,{state:e.positionsSlotsIds.includes(e.slot.id)?"checked":"unchecked",subtext:o?n:void 0,onClick:t=>{e.change(`${e.prefix}positionsSlotsIds`,ro(e.positionsSlotsIds,e.slot.id,"checked"===t))},children:s})]},e.slot.id)},HT=e=>{const{translate:t}=vl(),n=(0,L.useMemo)(()=>(0,uc.A)(e.position.slots.filter(t=>Ah(t,e.slots,e.options)),[e=>e.range.start.toMillis(),e=>e.nameOrRange]),[e.position,e.slots,e.options]),[s,o]=(0,L.useState)(!1),r=m(e.position.description)&&e.options.showPositionDescription;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"2"}),(0,i.jsxs)(Ba,{align:"center",gap:"2",children:[(0,i.jsx)(Ar,{color:"gray900",fontWeight:"semiBold",children:e.position.name}),r&&(0,i.jsx)(Ar,{color:"gray700",onClick:()=>{o(!0)},children:(0,i.jsx)(nl,{icon:"circle-info"})})]}),(0,i.jsx)(Ya,{height:"2"}),so(n)?n.map((t,n)=>(0,i.jsx)(GT,{allSlots:e.allSlots,change:e.change,index:n,options:e.options,positionsSlotsIds:e.positionsSlotsIds,prefix:e.prefix,slot:t},t.id)):(0,i.jsx)(Gk,{imageSrc:_d.WeezeventBlankPerson,subtitle:t("this_may_be_bec_43194"),title:t("no_items_are_cu_47996")}),s&&(0,i.jsx)(ET,{description:e.position.description,name:e.position.name,onClose:()=>{o(!1)}})]})},qT=e=>{const{translate:t}=vl(),n=(0,L.useMemo)(()=>(0,uc.A)(e.category.positions.filter(t=>Th(t,e.userInfoFields,e.slots,e.options)),e=>e.name),[e.category,e.userInfoFields,e.slots,e.options]),[s,o]=(0,L.useState)(!1),r=m(e.category.description)&&e.options.showPositionCategoryDescription;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ba,{align:"center",gap:"2",children:[(0,i.jsx)(Ar,{color:"gray500",css:{textTransform:"uppercase"},fontSize:"textXs",fontWeight:"semiBold",children:e.category.name}),r&&(0,i.jsx)(Ar,{color:"gray700",onClick:()=>{o(!0)},children:(0,i.jsx)(nl,{icon:"circle-info"})})]}),so(n)?n.map(t=>(0,i.jsx)(HT,{allSlots:e.allSlots,change:e.change,options:e.options,position:t,positionsSlotsIds:e.positionsSlotsIds,prefix:e.prefix,slots:e.slots},t.id)):(0,i.jsx)(Gk,{imageSrc:_d.WeezeventBlankPerson,subtitle:t("this_may_be_bec_43194"),title:t("no_items_are_cu_47996")}),s&&(0,i.jsx)(ET,{description:e.category.description,name:e.category.name,onClose:()=>{o(!1)}})]})},KT=e=>{const{translate:t}=vl(),n=(0,L.useMemo)(()=>(0,uc.A)(e.categories,e=>e.name),[e.categories]),s=(0,L.useMemo)(()=>e.categories.flatMap(e=>e.positions.flatMap(e=>e.slots)),[e.categories]);return(0,i.jsx)(i.Fragment,{children:so(n)?n.map((t,n)=>(0,i.jsxs)(L.Fragment,{children:[0!==n&&(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(qT,{allSlots:s,category:t,change:e.change,options:e.options,positionsSlotsIds:e.positionsSlotsIds,prefix:e.prefix,slots:e.slots,userInfoFields:e.userInfoFields},t.id)]},t.id)):(0,i.jsx)(Gk,{imageSrc:_d.WeezeventBlankPerson,subtitle:t("this_may_be_bec_43194"),title:t("no_items_are_cu_47996")})})},YT=e=>{const t=(0,L.useMemo)(()=>(0,uc.A)(e.event.positionsCategories.filter(t=>{return n=t,i=e.slots,s=e.userInfoFields,!(o=e.options).hiddenPositionsCategoriesIds.includes(n.id)&&(0===o.displayedPositionsCategoriesIds.length||o.displayedPositionsCategoriesIds.includes(n.id))&&n.positions.some(e=>Th(e,s,i,o));var n,i,s,o}),e=>(0,_h.A)(e.positions.flatMap(e=>e.slots.flatMap(e=>e.range.start.toMillis())))),[e.event.positionsCategories,e.slots,e.userInfoFields,e.options]);if(e.options.positionRanking===Ke.Ranked)return(0,i.jsx)(UT,{categories:t,change:e.change,options:e.options,positionsCategoriesIds:e.positionsCategoriesIds,positionsIds:e.positionsIds,prefix:e.prefix,slots:e.slots,userInfoFields:e.userInfoFields});switch(e.options.positionDisplay){case _t.Category:return(0,i.jsx)(FT,{categories:t,change:e.change,options:e.options,positionsCategoriesIds:e.positionsCategoriesIds,prefix:e.prefix});case _t.Position:return(0,i.jsx)(LT,{categories:t,change:e.change,options:e.options,positionsIds:e.positionsIds,prefix:e.prefix,slots:e.slots,userInfoFields:e.userInfoFields});case _t.Slot:return(0,i.jsx)(KT,{categories:t,change:e.change,options:e.options,positionsSlotsIds:e.positionsSlotsIds,prefix:e.prefix,slots:e.slots,userInfoFields:e.userInfoFields});case _t.None:return null;default:return ll(e.options.positionDisplay)}},ZT=e=>{const t=(0,L.useMemo)(()=>jh(e.dayStartTime)?.[0]??0,[e.dayStartTime]),n=(0,L.useMemo)(()=>Xh(e.startAt,e.endAt,e.ranges,e.daysDisplay,t),[e.startAt,e.endAt,e.ranges,e.daysDisplay,t]),s=(0,L.useMemo)(()=>(0,rh.A)(n,e=>e.toMillis()),[n]),o=(0,L.useMemo)(()=>(0,ah.A)(n,e=>e.toMillis()),[n]),r=(0,L.useMemo)(()=>Math.ceil(o.endOf("month").diff(s.startOf("month"),"months").months),[s,o]),a=(0,L.useCallback)((t,n)=>{const i=e.currentSlots.filter(e=>e.startDate.year!==t.year||e.startDate.month!==t.month).concat(n.map(e=>Js(Gs.IX.fromDateTimes(e,e.plus({day:1})))));e.change(`${e.prefix}slots`,i)},[e.currentSlots,e.prefix,e.change]);return(0,i.jsx)(Ba,{gap:"6",wrap:"wrap",children:(0,Dc.A)(0,r).map(n=>{const l=s.plus({month:n}).startOf("month"),d=0===n?s:l,c=n===r-1?o:l.endOf("month"),u=e.currentSlots.flatMap(e=>e.startDate.year===l.year&&e.startDate.month===l.month?[e.startDate.startOf("day").set({hour:t||0})]:[]);return(0,i.jsx)(SA,{firstDayOfMonth:l,max:c,min:d,startHour:t,values:u,onChange:e=>{a(l,e)}},n)})})},XT=e=>{const{intervals:t,minDate:n,maxDate:s,numberOfMonths:o}=(0,L.useMemo)(()=>{const t=e.intervalsGrouped.flatMap(([e,t])=>t.map(({interval:e})=>e)),n=(0,rh.A)(t,e=>e.start.toMillis()).start.startOf("day"),i=(0,ah.A)(t,e=>e.end.toMillis()).end.endOf("day"),s=Math.ceil(i.endOf("month").diff(n.startOf("month"),"months").months);return{intervals:t,minDate:n,maxDate:i,numberOfMonths:s}},[e.intervalsGrouped]),r=t.flatMap(t=>e.isSelected(t)?[t.start.startOf("day")]:[]);return(0,i.jsx)(Ba,{gap:"6",wrap:"wrap",children:(0,Dc.A)(0,o).map(a=>{const l=n.plus({month:a}).startOf("month"),d=0===a?n:l,c=a===o-1?s:l.endOf("month"),u=r.filter(e=>e.month===l.month&&e.year===l.year);return(0,i.jsx)(SA,{firstDayOfMonth:l,max:c,min:d,values:u,onChange:n=>{((n,i)=>{e.setSelectedBatch(t.flatMap(e=>{if(e.start.startOf("month").equals(n)){const t=i.some(t=>t.equals(e.start.startOf("day")));return[{interval:e,isSelected:t}]}return[]}))})(l,n)}},a)})})},JT=e=>{const[t,n]=(0,L.useState)(e.intervals.some(({interval:t})=>e.isSelected(t))?"checked":"unchecked"),s=(0,L.useCallback)(()=>{const i="checked"===t?"unchecked":"checked";n(i),"unchecked"===i&&e.intervals.forEach(({interval:t})=>{e.setSelected(t,!1)})},[e.intervals,t,n,e.setSelected]);return(0,i.jsxs)(Ba,{css:{border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs"},direction:"column",children:[(0,i.jsxs)(Ba,{align:"center",css:{cursor:"pointer",padding:"$4 $5"},gap:"2",onClick:s,children:[(0,i.jsx)(Ar,{color:"gray900",fontSize:"textXs",children:(0,i.jsx)(nl,{icon:"checked"===t?"chevron-down":"chevron-right"})}),(0,i.jsx)(Ar,{font:"gray800 textSm medium",children:e.day})]}),"checked"===t&&(0,i.jsx)(Ba,{css:{borderTop:"1px solid $gray200",padding:"$4 $5"},direction:"column",gap:"3",children:e.intervals.map(({name:t,interval:n},s)=>(0,i.jsx)(_c,{state:e.isSelected(n)?"checked":"unchecked",onClick:t=>{e.setSelected(n,"checked"===t)},children:Qh(t,n)},s))})]})},QT=e=>(0,i.jsx)(Ba,{css:{border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",padding:"$4 $5"},direction:"column",gap:"3",children:e.intervalsGrouped.map(([t,[{name:n,interval:s}]],o)=>{const r=`${n} ${s.toFormat("HH:mm")}`.trim(),a=`${t} ${e.hideNameDates?"":`(${r})`}`.trim();return(0,i.jsx)(_c,{state:e.isSelected(s)?"checked":"unchecked",onClick:t=>{e.setSelected(s,"checked"===t)},children:a},o)})}),ez=({customSlotPeriod:e,daysDisplay:t,event:n,isSelected:s,setSelected:o,setSelectedBatch:r})=>{const a=Zn(Jc),l=(0,L.useMemo)(()=>Jh(e.startDate??n.startAt,e.endDate??n.endAt,e.customSlots,n.ranges,t),[e,n,t]),d=(0,L.useMemo)(()=>(0,uc.A)(Object.entries((0,cc.A)(l,({interval:e})=>a.toLocaleString(e.start.startOf("day"),eo.DateOnly.WeekdayLongMonthLong))),([e,[{interval:t}]])=>t.start.startOf("day").toMillis()),[l]);return(0,i.jsxs)(Ba,{direction:"column",gap:"2",width:1,children:[m(e.name)&&(0,i.jsx)(Ar,{font:"gray900 textSm semiBold",children:e.name}),1===e.customSlots.length?0===d.length?null:e.displayAsCalendar?(0,i.jsx)(XT,{intervalsGrouped:d,isSelected:s,setSelectedBatch:r}):(0,i.jsx)(QT,{hideNameDates:e.hideNameDates,intervalsGrouped:d,isSelected:s,setSelected:o}):d.map(([e,t],n)=>(0,i.jsx)(JT,{day:e,intervals:t,isSelected:s,setSelected:o},n))]})},tz=e=>{const t=(0,L.useMemo)(()=>e.customSlotsPeriods.flatMap(t=>Jh(t.startDate??e.event.startAt,t.endDate??e.event.endAt,t.customSlots,e.event.ranges,e.daysDisplay)).map(({interval:e})=>e),[e.customSlotsPeriods,e.event,e.daysDisplay]),[n,s]=(0,L.useState)(Object.fromEntries(t.map(t=>{const n=e.currentSlots.some(e=>Zs(e).equals(t));return[t.toISO(),n]}))),o=(0,L.useCallback)(e=>n[e.toISO()],[n]),r=(0,L.useCallback)((t,n)=>{const i=t.toISO();s(e=>({...e,[i]:n})),e.change(`${e.prefix}slots`,em(e.currentSlots,t,n))},[e.currentSlots,s]),a=(0,L.useCallback)(t=>{const n=t.reduce((e,{interval:t,isSelected:n})=>{const i=t.toISO();return s(e=>({...e,[i]:n})),em(e,t,n)},e.currentSlots);e.change(`${e.prefix}slots`,n)},[e.currentSlots,s]),l=(0,L.useMemo)(()=>e.customSlotsPeriods.flatMap(e=>e.hasCondition&&e.conditionCustomField?[e.conditionCustomField]:[]),[e.customSlotsPeriods]);return(0,i.jsx)(Ba,{direction:"column",gap:"6",children:e.customSlotsPeriods.map(t=>pC(t,e.userInfoFields,l)?(0,i.jsx)(ez,{customSlotPeriod:t,daysDisplay:e.daysDisplay,event:e.event,isSelected:o,setSelected:r,setSelectedBatch:a},t.id):null)})},nz=e=>{const{translate:t}=vl(),n=(0,L.useMemo)(()=>Xh(e.startAt,e.endAt,e.ranges,e.daysDisplay,jh(e.dayStartTime)?.[0]??0),[e.startAt,e.endAt,e.ranges,e.daysDisplay,e.dayStartTime]),s=(0,L.useMemo)(()=>n.filter(t=>(e.blockedSlots??[]).some(e=>Qs(e,t))),[e.blockedSlots,n]),o=Zn(Jc),[r,a]=(0,L.useState)(Object.fromEntries(n.map((t,n)=>{const i=Gs.IX.fromDateTimes(t,t.plus({day:1}));return[`day${n}`,void 0!==e.currentSlots.find(e=>Zs(e).equals(i))]})));return(0,i.jsx)(i.Fragment,{children:n.map((n,l)=>{const d=s.includes(n);return(0,i.jsxs)(L.Fragment,{children:[0!==l&&(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(_c,{disabled:d,state:r[`day${l}`]?"checked":"unchecked",onClick:t=>{a({...r,[`day${l}`]:"checked"===t}),e.change(`${e.prefix}slots`,em(e.currentSlots,Gs.IX.fromDateTimes(n,n.plus({day:1})),"checked"===t))},children:d?(0,i.jsxs)(km,{children:[(0,i.jsx)(Sm,{children:(0,i.jsx)(hl,{children:o.toLocaleString(n,eo.DateOnly.WeekdayLongMonthLong)})}),(0,i.jsx)(wm,{placement:"right",children:t("vous_avez_d_j_92810")})]}):o.toLocaleString(n,eo.DateOnly.WeekdayLongMonthLong)})]},l)})})};var iz=n(3088);const sz=e=>{const t=Xn();return(0,i.jsx)(tC,{buttons:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Ar,{children:(0,i.jsx)(zl,{color:"white",leftIcon:"trash-can",size:"sm",onClick:e.remove})})}),title:t("disponibilit_n_50484",e.index+1),children:(0,i.jsxs)(Ba,{direction:{"@initial":"column","@desktop":"row"},gap:"4",children:[(0,i.jsx)(Hm,{label:t("date_de_d_but_43380"),max:e.max,min:e.min,name:`${e.prefix}startDate`}),(0,i.jsx)(lb,{label:t("heure_de_d_but_27566"),name:`${e.prefix}startTime`}),(0,i.jsx)(Hm,{label:t("date_de_fin_86920"),max:e.max,min:e.min,name:`${e.prefix}endDate`}),(0,i.jsx)(lb,{label:t("heure_de_fin_95071"),name:`${e.prefix}endTime`})]})})},oz=e=>{const t=Xn(),n=Zn(yT),s=(0,L.useMemo)(()=>e.max.endOf("day"),[e.max]);return(0,i.jsx)(iz.ED,{name:`${e.prefix}slots`,children:({fields:o})=>(0,i.jsxs)(i.Fragment,{children:[o.map((t,n)=>(0,i.jsxs)(L.Fragment,{children:[0!==n&&(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(sz,{index:n,max:s,min:e.min,prefix:`${t}.`,remove:()=>{o.remove(n)}})]},n)),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(zl,{color:"invisible",leftIcon:"plus",onClick:()=>{o.push(n.volunteersRegistrationsSlotInputDefault(e.min))},children:t("ajouter_une_dis_96540")})]})})},rz=e=>{switch(e.slotDisplay){case It.Display:return(0,i.jsx)(oz,{max:e.event.endAt,min:e.event.startAt,prefix:e.prefix});case It.DisplayDays:return(0,i.jsx)(nz,{blockedSlots:e.blockedSlots,change:e.change,currentSlots:e.currentSlots,dayStartTime:e.event.dayStartTime,daysDisplay:e.daysDisplay,endAt:e.event.endAt,prefix:e.prefix,ranges:e.event.ranges,startAt:e.event.startAt});case It.Calendar:return(0,i.jsx)(ZT,{change:e.change,currentSlots:e.currentSlots,dayStartTime:e.event.dayStartTime,daysDisplay:e.daysDisplay,endAt:e.event.endAt,prefix:e.prefix,ranges:e.event.ranges,startAt:e.event.startAt});case It.Custom:return(0,i.jsx)(tz,{change:e.change,currentSlots:e.currentSlots,customSlotsPeriods:e.customSlotsPeriods,daysDisplay:e.daysDisplay,event:e.event,prefix:e.prefix,userInfoFields:e.userInfoFields});case It.Hide:return null;default:return ll(e.slotDisplay)}},az=e=>(0,i.jsx)(_b,{disabled:e.disabled,heading:e.heading,hideHeader:e.hideHeader,children:(0,i.jsx)(Ba,{direction:"column",children:e.children})}),lz=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=vl(),o=(0,L.useMemo)(()=>s&&e.form.slotDisplay!==It.Hide,[e.form,s]),r=(0,L.useMemo)(()=>s&&e.form.positionDisplay!==_t.None,[e.form,s]),a=(0,L.useMemo)(()=>s&&(e.form.accreditationDisplay!==pt.None||so(e.delegationAccreditations)),[e.delegationAccreditations,e.form,s]);return(0,i.jsxs)(i.Fragment,{children:[e.showEmail&&(0,i.jsxs)(az,{hideHeader:!0,children:[m(e.form.description)&&(0,i.jsx)(Cg,{text:e.form.description}),(0,i.jsx)(Vl,{isEmail:!0,label:t("Email"),name:"email"})]}),(0,i.jsx)(az,{disabled:e.disabled,heading:m(e.form.informationTitle)?e.form.informationTitle:t("informations_pe_37892"),children:(0,i.jsx)(ST,{change:e.change,elements:e.form.elements,organizationId:n,prefix:"formRegister.userInfo.fields.",values:e.values.formRegister.userInfo.fields})}),o&&e.event&&(0,i.jsxs)(az,{heading:m(e.form.slotTitle)?e.form.slotTitle:t("disponibilit_s_49923"),children:[m(e.form.slotSubtitle)&&(0,i.jsx)(Cg,{text:e.form.slotSubtitle}),(0,i.jsx)(rz,{blockedSlots:e.blockedSlots,change:e.change,currentSlots:e.values.formRegister.slots,customSlotsPeriods:e.form.customSlotsPeriods,daysDisplay:e.form.daysDisplay,event:e.event,prefix:"formRegister.",slotDisplay:e.form.slotDisplay,userInfoFields:e.values.formRegister.userInfo.fields})]}),r&&e.event&&(0,i.jsxs)(az,{heading:m(e.form.positionTitle)?e.form.positionTitle:t("missions_souhai_23225"),children:[m(e.form.positionSubtitle)&&(0,i.jsx)(Cg,{text:e.form.positionSubtitle}),(0,i.jsx)(YT,{change:e.change,event:e.event,options:e.form,positionsCategoriesIds:e.values.formRegister.positionsCategoriesIds,positionsIds:e.values.formRegister.positionsIds,positionsSlotsIds:e.values.formRegister.positionsSlotsIds,prefix:"formRegister.",slots:e.values.formRegister.slots,userInfoFields:e.values.formRegister.userInfo.fields})]}),a&&e.event&&(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(az,{heading:m(e.form.accreditationTitle)?e.form.accreditationTitle:t("accr_ditations_74375"),children:[m(e.form.accreditationSubtitle)&&(0,i.jsx)(Cg,{text:e.form.accreditationSubtitle}),(0,i.jsx)(DT,{accreditationsSlotsIds:e.values.formRegister.accreditationsSlotsIds,change:e.change,delegationAccreditations:e.delegationAccreditations??[],displayFormCustomFields:!0,event:e.event,options:e.form,prefix:"formRegister.",showAutoAccredit:e.showAutoAccredit,slots:e.values.formRegister.slots,userInfosFields:e.values.formRegister.userInfo.fields})]})})]})},dz=e=>{const t=Zn(AT),n=(0,L.useMemo)(()=>(e.organization.form.elements??[]).flatMap(e=>e.elementType===qe.Field?[e.customField]:[]),[e.organization]);return(0,L.useEffect)(()=>{const i=t.formRegisterInputDefault(Ye.Admin,null,n,{countryCode:e.organization?.event?.country??e.organization?.country,delegationAccreditations:e.organization.delegation?.accreditationsSlots??[],eventStartDate:e.organization?.event?.startAt,forOther:!0,sendNotificationEmail:!1,slotDisplay:e.organization.form.slotDisplay,team:null});e.setInitialValues({email:e.values.email||"",formRegister:{...i,userInfo:{...i.userInfo,...e.values.formRegister.userInfo}}})},[e.organization]),(0,i.jsx)(Bm,{css:{gap:"$6"},children:(0,i.jsx)(lz,{change:e.change,delegationAccreditations:e.organization.delegation?.accreditationsSlots??[],event:e.organization.event,form:e.organization.form,showAutoAccredit:!0,showEmail:!1,values:e.values})})},cz=e=>{const{translate:t,params:{delegationId:n}}=vl();return(0,i.jsxs)(Ba,{direction:"column",gap:"6",width:1,children:[(0,i.jsxs)(Ba,{direction:"column",gap:"4",children:[(0,i.jsx)(Vl,{isEmail:!0,label:t("Email"),name:"email"}),(0,i.jsxs)(Ba,{gap:"4",children:[(0,i.jsx)(Vl,{label:(0,i.jsx)(Zv,{children:t("pr_nom_66988")}),name:"formRegister.userInfo.fields.firstName"}),(0,i.jsx)(Vl,{label:(0,i.jsx)(Zv,{children:t("Name")}),name:"formRegister.userInfo.fields.lastName"})]})]}),!n&&(0,i.jsxs)(Ba,{direction:"column",gap:"4",children:[(0,i.jsxs)(Ba,{direction:"column",children:[(0,i.jsx)(Ar,{font:"gray800 textMd medium",children:t("param_tres_du_m_69378")}),(0,i.jsx)(Ar,{color:"gray500",children:t("s_lectionnez_le_16209")})]}),(0,i.jsx)(Ym,{isSearchVisible:!0,label:(0,i.jsx)(Zv,{children:t("population_38615")}),name:"formRegister.userInfo.fields.population",children:e.population.values.map(({id:e,value:t})=>(0,i.jsx)("option",{value:e,children:t},e))}),(0,i.jsx)(yc,{isSearchVisible:!0,label:(0,i.jsx)(Zv,{children:t("Delegation")}),values:e.delegationsIds,onChange:e.setDelegationsIds,children:e.delegations.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(yc,{isSearchVisible:!0,label:(0,i.jsx)(Zv,{children:t("Form")}),state:so(e.delegationsIds)?"disabled":"active",values:e.formsIds,onChange:e.setFormsIds,children:e.forms.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})]})]})},uz=e=>{const{history:t,translate:n,params:{organizationId:s,eventId:o,delegationId:r}}=vl(),a=Zn(AT),l=Zn(Ua),d=(0,L.useRef)(null),{mutate:c,isLoading:u}=function(e={}){return ei("mutation UserInfoAdminCreate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $email: UserEmail!\n $userInfo: UsersInfoInput!\n $sendNotificationEmail: Boolean!\n) {\n userInfoAdminCreate(\n organizationId: $organizationId\n eventId: $eventId\n email: $email\n userInfo: $userInfo\n sendNotificationEmail: $sendNotificationEmail\n ) {\n id\n }\n}\n",e)}(),{mutate:h}=function(e={}){return ei("mutation FormRegister(\n $organizationId: OrganizationId!\n $eventId: EventId\n $delegationId: DelegationId\n $formId: FormId!\n $email: UserEmail!\n $formRegister: FormRegisterInput!\n) {\n formRegister(\n organizationId: $organizationId\n eventId: $eventId\n delegationId: $delegationId\n formId: $formId\n email: $email\n formRegister: $formRegister\n ) {\n teamCode\n }\n}\n",e)}(),[m,g]=(0,L.useState)(null),p=(0,L.useMemo)(()=>m?.form.elements.filter(e=>e.elementType===qe.Field)??[],[m]),[f,_]=(0,L.useState)({email:"",formRegister:a.formRegisterInputDefault(Ye.Admin,null,[],{countryCode:e.organization?.event?.country??e.organization?.country,delegationAccreditations:[],eventStartDate:e.organization?.event?.startAt,forOther:!0,sendNotificationEmail:!1,slotDisplay:It.Hide,team:null})}),x=(0,L.useCallback)(e=>l.validateForForm(a.formRegisterSchema(p,m?.form.slotDisplay??It.Hide,m?.event?.startAt??Gs.c9.now(),m?.event?.endAt??Gs.c9.now(),m?.form.positionRanking??Ke.Unranked,m?.form.positionDisplay??_t.None,m?.form.accreditationDisplay??pt.None,m?.delegation?.id))(e),[p,a,m,l]),I=(0,L.useCallback)(async n=>{m?await h({organizationId:s,eventId:o,delegationId:m.delegation?.id,formId:m.form.id,email:n.email,formRegister:n.formRegister}):await c({organizationId:s,eventId:o,email:n.email,userInfo:n.formRegister.userInfo,sendNotificationEmail:n.formRegister.sendNotificationEmail}),t.push(e.closePath)},[e.closePath,m]),v=e.organization.delegations.nodes,b=e.organization.forms.nodes,[j,C]=(0,L.useState)(!1),[y,k]=(0,L.useState)([]),[A,w]=(0,L.useState)([]),S=(0,L.useCallback)(async e=>{if(w(e),so(e)){C(!0);const{organization:t}=await Aa({organizationId:s,eventId:o,formId:e[0]},await Y());g(t),C(!1)}else g(null)},[o,s]),E=(0,L.useCallback)(async e=>{if(k(e),so(e)){const t=v.find(t=>t.id===e[0]);w([t.formId]),C(!0);const{organization:n}=await Aa({organizationId:s,delegationId:e[0],eventId:o,formId:t.formId},await Y());g(n),C(!1)}else g(null)},[v,s,o]);return Md(n("cr_ation_d_un_m_98624")),(0,L.useEffect)(()=>{r&&E([r])},[r,E]),(0,i.jsx)(kl,{customErrorRef:d,height:1,hideDefaultErrors:!0,initialValues:f,render:({form:t,handleSubmit:s,values:r})=>(0,i.jsx)(Lm,{category:n("cr_ation_d_un_m_98624"),color:"dark",fallbackClosePath:e.closePath,heading:n("nouveau_membre_94535"),children:(0,i.jsx)(Mm,{ref:d,children:(0,i.jsxs)(Ba,{direction:"column",gap:"6",width:1,children:[(0,i.jsx)(jl,{hideSpacer:!0}),(0,i.jsx)(Vm,{heading:n("informations_su_05921"),hideToggle:!0,initialIsOpen:!0,children:(0,i.jsx)(cz,{delegations:v,delegationsIds:y,forms:b,formsIds:A,population:e.organization.population,setDelegationsIds:E,setFormsIds:S})}),j&&(0,i.jsx)(Bm,{css:{minHeight:"200px"},children:(0,i.jsx)(wl,{})}),!j&&m&&(0,i.jsx)(dz,{change:t.change,organization:m,setInitialValues:_,values:r}),(0,i.jsx)(Bm,{children:(0,i.jsxs)(Ba,{direction:"column",gap:"4",children:[o&&(0,i.jsx)(Gm,{name:"formRegister.sendNotificationEmail",children:n("envoyer_l_email_75574")}),(0,i.jsx)(zl,{isLoading:u,textAlign:"center",onClick:s,children:n("ajouter_le_memb_57505")})]})})]})})}),validate:x,width:1,onSubmit:I})},hz=()=>{const{params:{organizationId:e,eventId:t,delegationId:n}}=vl(),{data:s,loader:o}=Qn('query CreateUserInfos(\n $organizationId: OrganizationId!\n $eventId: EventId\n $level: OrganizationEventLevel!\n) {\n organization(id: $organizationId) {\n country\n\n population: customFieldBySlug(slug: "population") {\n values {\n id\n value\n }\n }\n\n forms(level: $level, eventId: $eventId) {\n nodes {\n id\n name\n }\n }\n\n delegations(level: $level, eventId: $eventId) {\n nodes {\n id\n name\n formId\n }\n }\n\n event: eventMaybe(id: $eventId) {\n startAt\n endAt\n country\n }\n }\n}\n',{organizationId:e,eventId:t,level:t?ot.Event:ot.Organization},[]);return o||(0,i.jsx)(uz,{closePath:n?hs.DELEGATION_MEMBERS({organizationId:e,eventId:t,delegationId:n}):t?Ps.VOLUNTEERS(e,t):wi.COMMUNITY_USERS({organizationId:e}),organization:s.organization})};let mz=class extends Gl{constructor(e){super(e)}commentInputDefault(){return{content:""}}commentInputSchema(){return d.Ik().shape({content:d.Yj().required(this.t("le_commentaire_33393"))})}createCommentSchema(){return d.Ik().shape({comment:this.commentInputSchema()})}};function gz(e){return e.replace(/\*\*(.+?)\*\*/g,"$1 ").replace(/\+\+(.+?)\+\+/g,"$1 ").replace(/_(.+?)_/g,"$1 ").replace(/~~(.+?)~~/g,"$1 ")}mz=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[qn])],mz);const pz=e=>{const t=Xn(),{mutate:n}=function(e={}){return ei("mutation CommentDelete(\n $organizationId: OrganizationId!\n $eventId: EventId\n $commentId: CommentId!\n) {\n commentDelete(organizationId: $organizationId, eventId: $eventId, commentId: $commentId) {\n id\n }\n}\n",e)}();return(0,i.jsx)(cA,{buttonText:t("supprimer_43083"),subtext:t("_tes_vous_s_r_d_55928"),text:t("suppression_d_u_90124"),onClose:e.onClose,onDelete:async()=>{await n({organizationId:e.organizationId,eventId:e.eventId,commentId:e.commentId}),e.onSuccess()}})},fz=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=vl(),{mutate:o}=function(e={}){return ei("mutation CommentUpdate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $commentId: CommentId!\n $comment: CommentInput!\n) {\n commentUpdate(\n organizationId: $organizationId\n eventId: $eventId\n commentId: $commentId\n comment: $comment\n ) {\n id\n }\n}\n",e)}(),[r,a]=(0,L.useState)(e.comment.content),[l,d]=(0,L.useState)(!1),c=m(r);return(0,i.jsxs)(Lb,{children:[(0,i.jsx)(Bb,{children:(0,i.jsx)(Ar,{color:"gray500",css:{cursor:"pointer"},children:(0,i.jsx)(nl,{icon:"pen"})})}),(0,i.jsxs)(Nb,{children:[(0,i.jsx)(Mb,{icon:"message",children:t("mise_jour_du_59845")}),(0,i.jsx)(Fb,{children:(0,i.jsx)(Zm,{label:t("commentaire_08754"),value:r,onChange:a})}),(0,i.jsx)(Pb,{children:(0,i.jsx)(zl,{disabled:!c,isLoading:l,onClick:async()=>{d(!0),await o({organizationId:n,eventId:s,commentId:e.comment.id,comment:{content:r}}),e.reload()},children:t("mettre_jour_85141")})})]})]})},_z=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=vl(),o=Zn(Jc),{user:r}=ai(),[a,l]=(0,L.useState)(!1),d=e.comment.event,c=e.comment.writtenBy;return(0,i.jsxs)(Ba,{gap:"3",children:[(0,i.jsx)(sp,{email:c.email,image:c.userInfo.picture?.url,name:c.userInfo.name,size:40}),(0,i.jsxs)(Ba,{css:{flex:"1"},direction:"column",gap:"2",children:[(0,i.jsxs)(Ba,{gap:"2",children:[(0,i.jsx)(Ar,{color:"gray800",css:{flex:"1"},fontWeight:"medium",children:c.userInfo.nameOrEmail}),(0,i.jsx)(Ar,{color:"gray500",children:o.toLocaleString(e.comment.insertedAt.toLocal(),eo.DateTime)}),e.showEvent&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ar,{color:"gray500",children:"•"}),(0,i.jsx)(Ar,{color:"gray500",children:d?.name??t("communaut_20896")})]}),c.id===r?.id&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ar,{color:"gray500",children:"•"}),(0,i.jsx)(fz,{comment:e.comment,reload:e.reload})]}),(0,i.jsxs)(Kb,{permissions:Hb.COMMENT_ADD,children:[(0,i.jsx)(Ar,{color:"gray500",children:"•"}),(0,i.jsx)(Ar,{color:"gray500",css:{cursor:"pointer"},onClick:()=>{l(!0)},children:(0,i.jsx)(nl,{icon:"trash-can"})})]})]}),(0,i.jsx)(Ar,{color:"gray800",css:{background:"$gray100",borderRadius:"0 $2 $2 $2",boxShadow:"$sm",padding:"$3",whiteSpace:"pre-line"},dangerouslySetInnerHTML:{__html:gz(e.comment.content)}})]}),a&&(0,i.jsx)(pz,{commentId:e.comment.id,eventId:s,organizationId:n,onClose:()=>{l(!1)},onSuccess:e.reload})]})},xz=e=>{const{params:{organizationId:t,eventId:n,userInfoId:s},translate:o}=vl(),r=Zn(mz),a=Zn(Ua),{data:l,loader:d,reload:c}=Sa({organizationId:t,userInfoId:s}),{mutate:u,isLoading:h}=wa(),[m,g]=(0,L.useState)(1),p=(0,L.useCallback)(()=>{g(m+1),c()},[m,g,c]);return(0,i.jsx)(kl,{direction:"column",hideDefaultErrors:!0,initialValues:{comment:r.commentInputDefault()},render:({handleSubmit:t})=>(0,i.jsxs)(i.Fragment,{children:[d||(l.organization?.userInfo.comments??[]).map((t,n)=>(0,i.jsxs)(L.Fragment,{children:[(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(_z,{comment:t,reload:p,showEvent:e.showEvent})]},n)),(0,i.jsxs)(Kb,{permissions:Hb.COMMENT_ADD,children:[(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(jl,{}),(0,i.jsx)(Xm,{label:o("commentaire_08754"),name:"comment.content"}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(zl,{isLoading:h,onClick:t,children:(0,i.jsx)(Ar,{textAlign:"center",width:1,children:o("ajouter_un_nouv_86295")})})]}),(0,i.jsx)(Ya,{height:"8"})]}),validate:a.validateForForm(r.createCommentSchema()),width:1,onSubmit:async e=>{await u({organizationId:t,eventId:n,userInfoId:s,comment:e.comment}),p()}},m)},Iz=({canEdit:e,editFormPath:t,editPath:n,formsUsersInfos:s,isEditDisabled:o=!1})=>{const{params:{organizationId:r,eventId:a,userInfoId:l},translate:d}=vl(),c=Zn(Jc),u=(0,L.useMemo)(()=>(0,uc.A)(s.filter(e=>so(e.accreditationsSlots)).map(e=>({...e,accreditationsSlots:(0,uc.A)(e.accreditationsSlots,e=>[e.accreditationCategory.name.toLowerCase(),$C(e.accreditation.index),e.accreditation.name.toLowerCase(),e.date?.toMillis()??1,e.name.toLowerCase()])})),e=>e.form.name.toLowerCase()),[s]),h=Tc();return(0,i.jsxs)(Ba,{direction:"column",gap:"6",children:[o&&(0,i.jsx)(qk,{message:d("you_are_already_assigned_to_accreditations"),title:d("wished_accreds_can_no_longer_be_changed")}),(0,i.jsx)(Lc,{filters:e&&(0,i.jsx)(zl,{color:"white",disabled:o,size:"sm",to:n,children:d("_diter_62574")}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Gc,{children:d("nom_de_l_accr_d_11908")}),!h&&(0,i.jsx)(Gc,{children:d("cr_neau_11117")}),!h&&(0,i.jsx)(Gc,{children:d("Form")})]}),numberOfPages:0,offset:0,rows:(0,i.jsx)(i.Fragment,{children:so(u)?u.flatMap((e,n)=>e.accreditationsSlots.map((s,d)=>(0,i.jsxs)(Mc,{children:[(0,i.jsx)(Oc,{children:s.accreditation.name}),!h&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Oc,{children:Dh(c,s,"")}),(0,i.jsx)(Oc,{children:(0,i.jsx)(Kk,{editDisabled:o,editPath:t,eventId:a,form:e.form,organizationId:r,userInfoId:l})})]})]},`${n}-${d}`))):(0,i.jsx)(Mc,{css:{height:"200px"},children:(0,i.jsx)(Oc,{children:(0,i.jsx)(Gk,{title:d("aucune_accr_dit_56501")})})})}),setOffset:td.A,title:d("accr_ditations_74375"),totalCount:0})]})},vz=e=>{const t=Zn(Jc),n=L.useMemo(()=>{const t=ic(e.aui.accreditation.color);return{background:t[50],color:t[700]}},[e.aui]);return(0,i.jsx)(i.Fragment,{children:e.renderAccreditation((0,i.jsxs)(Ba,{css:{...n,borderRadius:"$1",padding:"$1 $2"},direction:"column",gap:"1",justify:"center",width:1,children:[(0,i.jsxs)(Ba,{align:"center",css:{fontSize:"10px"},gap:"1",children:[(0,i.jsx)(Ar,{children:Dh(t,e.aui.accreditationSlot,"")}),e.aui.isAutoAccredit&&(0,i.jsx)(Ar,{fontSize:"textXs",children:(0,i.jsx)(nl,{icon:"bolt-auto"})})]}),(0,i.jsx)(Ar,{fontSize:"textXs",fontWeight:"medium",children:e.aui.accreditation.name})]}),e.aui.accreditation.id)})},bz=e=>{const t=tw(),n=L.useMemo(()=>(0,uc.A)(e.event.volunteerRegistration.accreditationsUsersInfos.filter(e=>!e.accreditationSlot.date?.isValid),e=>[e.accreditationCategory.name.toLowerCase(),$C(e.accreditation.index),e.accreditation.name.toLowerCase(),e.accreditationSlot.name.toLowerCase()]),[e.event]),s=L.useMemo(()=>(0,uc.A)(e.event.volunteerRegistration.accreditationsUsersInfos.filter(e=>e.accreditationSlot.date?.isValid),e=>[e.accreditationCategory.name.toLowerCase(),$C(e.accreditation.index),e.accreditation.name.toLowerCase(),e.accreditationSlot.name.toLowerCase()]),[e.event]);return(0,i.jsxs)(ow,{css:e.featureFlags?.isV4?{bd:!0,overflow:"auto"}:{borderTop:"1px solid $gray200"},date:e.selectedDay,display:t?"week":"day",maxDate:e.event.endAt,minDate:e.event.startAt,children:[n.map(t=>(0,i.jsx)(sw,{children:(0,i.jsx)(vz,{aui:t,renderAccreditation:e.renderAccreditation})},t.id)),s.map(t=>(0,i.jsx)(sw,{endAt:t.accreditationSlot.date,startAt:t.accreditationSlot.date,children:(0,i.jsx)(vz,{aui:t,renderAccreditation:e.renderAccreditation})},t.id))]})},jz=e=>{const{translate:t,params:{organizationId:n,eventId:s,userInfoId:o}}=vl(),r=Zn(Jc),{mutate:a}=yo(),{mutate:l}=function(e={}){return ei("mutation AccreditationsSlotsUsersInfosCheckIn(\n $eventId: EventId!\n $checkIn: AccreditationSlotCheckInInput!\n) {\n accreditationsSlotsUsersInfosCheckIn(eventId: $eventId, checkIn: $checkIn)\n}\n",e)}(),d=(0,L.useMemo)(()=>Dh(r,e.aui.accreditationSlot,e.aui.accreditation.name),[e.aui]);return(0,i.jsxs)(Mc,{children:[(0,i.jsxs)(Oc,{align:"center",gap:"3",children:[(0,i.jsx)(WC,{color:e.aui.accreditation.color,icon:e.aui.accreditation.icon}),(0,i.jsxs)(Ba,{css:{overflow:"hidden"},direction:"column",width:1,children:[(0,i.jsx)(Zc,{css:{overflow:"hidden",width:"100%","& > a":{width:"100%"}},to:is.ACCREDITATION({organizationId:n,eventId:s,accreditationId:e.aui.accreditation.id}),children:(0,i.jsx)(Ar,{css:{ellipsis:!0},title:e.aui.accreditation.name,width:1,children:e.aui.accreditation.name})}),(0,i.jsx)(Ar,{color:"gray500",css:{ellipsis:!0},title:d,width:1,children:d})]})]}),(0,i.jsxs)(Oc,{align:"start",direction:"column",justify:"center",children:[e.aui.state===pe.Waiting&&(0,i.jsxs)(Ba,{align:"center",gap:"1",children:[(0,i.jsx)(Ar,{color:"warning500",children:(0,i.jsx)(nl,{icon:"hourglass-empty",iconStyle:"solid"})}),(0,i.jsx)(Ar,{font:"gray800 textXs medium",children:t("pas_encore_scan_88057")})]}),e.aui.state===pe.CheckedIn&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ba,{align:"center",gap:"1",children:[(0,i.jsx)(Ar,{color:"success500",children:(0,i.jsx)(nl,{icon:"badge-check",iconStyle:"solid"})}),(0,i.jsx)(Ar,{font:"gray800 textXs medium",children:t("scann_e_01567")})]}),(0,i.jsx)(Ar,{font:"gray500 textXs regular",children:e.aui.checkInAt?.isValid?r.toLocaleString(e.aui.checkInAt.toLocal(),eo.DateTime):""})]})]}),(0,i.jsx)(Oc,{children:e.aui.isAutoAccredit&&(0,i.jsx)(Ar,{color:"success700",fontSize:"textMd",children:(0,i.jsx)(nl,{icon:"check"})})}),(0,i.jsx)(Oc,{children:e.aui.isWorkflow&&(0,i.jsx)(Ar,{color:"success700",fontSize:"textMd",children:(0,i.jsx)(nl,{icon:"check"})})}),(0,i.jsxs)(Oc,{align:"start",direction:"column",justify:"center",children:[(0,i.jsx)(Ar,{children:e.aui.createdBy?.name??"-"}),(0,i.jsx)(Ar,{color:"gray500",children:r.toLocaleString(e.aui.insertedAt.toLocal(),eo.DateTime)})]}),(0,i.jsxs)(Xc,{justify:"end",width:200,children:[e.aui.state===pe.Waiting&&(0,i.jsx)(zl,{color:"white",size:"sm",onClick:async()=>{await l({eventId:e.aui.eventId,checkIn:{strategy:fe.CheckIn,accreditationsSlotsUsersInfosIds:[e.aui.id]}}),e.reload()},children:"Scanner"}),(0,i.jsx)(Yc,{children:(0,i.jsx)(Kd,{color:"red",icon:"trash-can",onClick:async()=>{await a({eventId:s,massAccredit:{accreditationsSlotsIds:[e.aui.accreditationSlot.id],selecteds:{ids:[o]},strategy:it.Delete}}),e.reload()},children:t("d_saffecter_du_47122")})})]})]})},Cz=e=>{const{translate:t}=vl(),n=(0,L.useMemo)(()=>(0,uc.A)(e.event.volunteerRegistration.accreditationsUsersInfos.filter(t=>!e.selectedDay?.isValid||!!t.accreditationSlot.date?.isValid&&t.accreditationSlot.date.startOf("day").toMillis()===e.selectedDay.startOf("day").toMillis()),e=>[e.accreditationCategory.name.toLowerCase(),$C(e.accreditation.index),e.accreditation.name.toLowerCase(),e.accreditationSlot.date?.toMillis()??1,e.accreditationSlot.name.toLowerCase()]),[e.event,e.selectedDay]);return(0,i.jsxs)(Sc,{css:{borderTop:"1px solid $gray200"},hideBorder:!0,children:[(0,i.jsxs)(kc,{children:[(0,i.jsx)(Gc,{children:t("Accreditation")}),(0,i.jsx)(Gc,{children:t("scann_e_le_27812")}),(0,i.jsx)(Gc,{children:t("affect_e_automa_74071")}),(0,i.jsx)(Gc,{children:t("ajout_via_une_69544")}),(0,i.jsx)(Gc,{children:t("ajout_e_par_71330")}),(0,i.jsx)(Gc,{width:200})]}),n.map(t=>(0,i.jsx)(jz,{aui:t,reload:e.reload},t.id))]})},yz=e=>{const{translate:t}=vl(),[n,s]=L.useState(Hx(e.event.startAt,e.event.endAt)),[o,r]=L.useState(null);return(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(Ba,{as:"section",css:{background:"white",bd:!0,overflow:"hidden",padding:e.featureFlags?.isV4?"$6 $7 $7 $7":void 0},direction:"column",gap:e.featureFlags?.isV4?"6":void 0,justify:"center",children:[(0,i.jsxs)(Ba,{align:"center",as:"header",css:{padding:e.featureFlags?.isV4?void 0:"$5 $6"},gap:"4",children:[(0,i.jsxs)(Ar,{as:"hgroup",css:{flex:"1"},children:[(0,i.jsx)(ml,{children:e.title}),e.subtitle&&(0,i.jsx)(hl,{textStyle:"subtitle",children:e.subtitle})]}),(0,i.jsxs)(Ba,{as:"nav",gap:"3",children:["calendar"===e.accreditationsDisplay&&(0,i.jsx)(nw,{max:e.event.endAt,min:e.event.startAt,value:n,onChange:s}),"list"===e.accreditationsDisplay&&!e.hideListView&&(0,i.jsx)(Ar,{width:160,children:(0,i.jsx)(Mu,{rightIcon:"xmark",value:o,onChange:r,onRightIconClick:()=>r(null)})}),!e.hideListView&&e.setAccreditationsDisplay&&(0,i.jsx)(Ar,{width:200,children:(0,i.jsxs)($u,{value:e.accreditationsDisplay,onChange:e.setAccreditationsDisplay,children:[(0,i.jsx)("option",{value:"calendar",children:t("Calendar")}),(0,i.jsx)("option",{value:"list",children:t("List")})]})}),e.actions]})]}),"calendar"===e.accreditationsDisplay?(0,i.jsx)(bz,{event:e.event,featureFlags:e.featureFlags,renderAccreditation:e.renderAccreditation,selectedDay:n}):(0,i.jsx)(Cz,{event:e.event,reload:e.reload,selectedDay:o})]})})};function kz(e,t,n={}){const{localEvent:i,updateLocalEvent:s}=wb(),[o,r]=L.useState("function"==typeof n.deserialize?n.deserialize(i?.[e])||t:i?.[e]??t);return[o,L.useCallback(async t=>{r(t),await s({[e]:"function"==typeof n.serialize?n.serialize(t):t})},[e,r,s])]}const Az=e=>{const{params:{organizationId:t,eventId:n,userInfoId:s},translate:o}=vl(),[r,a]=kz("user.accreditations.display","calendar");return(0,i.jsx)(yz,{...e,accreditationsDisplay:r,actions:(0,i.jsx)(Kb,{rolesTypes:jI,children:(0,i.jsx)(zl,{to:Ps.EDIT_ACCREDIT(t,n,s),children:o("_diter_les_accr_86042")})}),setAccreditationsDisplay:a})},wz=e=>{const{params:{organizationId:t,eventId:n,userInfoId:s},translate:o}=vl(),{isEventAdmin:r}=wb(),a=(0,L.useMemo)(()=>so(e.organization.userInfo.formsUsersInfos.filter(e=>so(e.accreditationsSlots)))||(e.event?.hasFormWithAccreditationDisplay??!1),[e.organization,e.event]);return(0,i.jsxs)(Ba,{direction:"column",gap:"6",width:1,children:[so(e.event.volunteerRegistration.accreditationsUsersInfos)&&(0,i.jsx)(Az,{event:e.event,reload:e.reload,renderAccreditation:(e,s)=>(0,i.jsx)(el,{style:{width:"100%"},to:is.ACCREDITATION({organizationId:t,eventId:n,accreditationId:s}),children:e}),subtitle:o("visualisez_tout_53227"),title:o("accr_ditations_33155")}),a&&(0,i.jsx)(Iz,{canEdit:r,editPath:Ps.EDIT_USER_ACCREDITATIONS(t,n,s),formsUsersInfos:e.organization.userInfo.formsUsersInfos}),(0,i.jsx)(Ya,{height:"8"})]})},Sz=()=>{const{organizationId:e,eventId:t,userInfoId:n}=ti(),{data:s,loader:o,reload:r}=Qn("query UserProfileAccreditations(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $userInfoId: UsersInfoId!\n $excludeAccreditations: [AccreditationId!]\n) {\n organization(id: $organizationId) {\n hideAccreditationsUntilConfirmationEmailSent\n\n userInfo(id: $userInfoId) {\n formsUsersInfos(eventId: $eventId, level: Event) {\n accreditationsSlots {\n name\n date\n\n accreditation {\n id\n name\n index\n }\n\n accreditationCategory {\n name\n }\n }\n\n form {\n id\n name\n }\n }\n }\n }\n\n event(id: $eventId) {\n name\n dayStartTime\n startAt\n endAt\n hasFormWithAccreditationDisplay\n\n volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n isAccreditationsEmailSent\n\n accreditationsUsersInfos(excludeAccreditations: $excludeAccreditations) {\n ...UserPanelAccreditationSlotUserInfo\n }\n }\n }\n}\n",{organizationId:e,eventId:t,userInfoId:n},[Vs.UserPanelAccreditationSlotUserInfoFragment]);return o||(0,i.jsx)(wz,{event:s.event,organization:s.organization,reload:r})},Ez=e=>{const{history:t,params:{organizationId:n,eventId:s},translate:o}=vl(),{organization:r,hasFeature:a}=TI(),{event:l,isEventAdmin:d}=wb(),{canDocumentRead:c,canMemberAccredit:u,canMemberAssignmentStateEdit:h,canMemberDelete:m}=$S(),{mutate:g,isLoading:p}=Yo(),{mutate:f,isLoading:_}=tr(),{mutate:x,isLoading:I}=tr(),{mutate:v,isLoading:b}=tr(),{mutate:j}=No(),{mutate:C}=Wo(),{mutate:y,isLoading:k}=Jo(),{mutate:A,isLoading:w}=Jo(),[S,E]=(0,L.useState)(!1),[T,z]=(0,L.useState)(!1),O=(0,L.useMemo)(()=>(0,uc.A)(e.customDocuments.filter(t=>dA(t.populationsIds,e.userInfo.fields.population)),e=>e.name),[e.customDocuments,e.userInfo]),{permissions:[R]}=fk(((...e)=>({name:"canUserInfoAssignFn",args:e}))(e.userInfo.id)),$=c&&(e.links&&(e.state===Pt.Assigned||so(r.customBadges))||so(O)),D=d&&l.useDelegations&&a(Be.Delegation)&&e.delegation,P={lang:e.userInfo.language};return(0,i.jsxs)(Ba,{direction:"column",gap:"6",children:[(R||h)&&(0,i.jsxs)(Ba,{direction:"column",gap:"3",children:[(0,i.jsx)(Ar,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:o("affectation")}),h&&(e.state===Pt.Assigned||e.state===Pt.Refused||e.state===Pt.NotApplicable||e.state===Pt.PreAssigned)&&(0,i.jsx)(zl,{color:"white",isLoading:_,leftIcon:"arrow-right-arrow-left",rightIcon:"arrow-right",onClick:async()=>{await f({eventId:s,massStateUpdate:{selecteds:{ids:[e.userInfo.id]},state:Pt.WaitingAssignment}}),e.reload()},children:o("changer_le_stat_90266")}),h&&(e.state===Pt.Assigned||e.state===Pt.WaitingAssignment||e.state===Pt.NotApplicable||e.state===Pt.PreAssigned)&&(0,i.jsx)(zl,{color:"white",isLoading:I,leftIcon:"arrow-right-arrow-left",rightIcon:"arrow-right",onClick:async()=>{await x({eventId:s,massStateUpdate:{selecteds:{ids:[e.userInfo.id]},state:Pt.Refused}}),e.reload()},children:o("changer_le_stat_68392")}),h&&(e.state===Pt.WaitingAssignment||e.state===Pt.Assigned)&&(0,i.jsx)(zl,{color:"white",isLoading:b,leftIcon:"arrow-right-arrow-left",rightIcon:"arrow-right",onClick:async()=>{await v({eventId:s,massStateUpdate:{selecteds:{ids:[e.userInfo.id]},state:Pt.NotApplicable}}),e.reload()},children:o("changer_le_stat_62507")}),R&&e.state===Pt.Assigned&&(0,i.jsx)(zl,{color:"white",leftIcon:"pen",rightIcon:"arrow-right",to:Ps.EDIT_ASSIGNMENT(n,s,e.userInfo.id),children:o("_diter_les_affe_42283")}),R&&(e.state===Pt.WaitingAssignment||e.state===Pt.PreAssigned)&&(0,i.jsx)(zl,{color:"white",leftIcon:"wand-magic-sparkles",rightIcon:"arrow-right",to:Ps.ASSIGNMENT(n,s,e.userInfo.id),children:o("affecter_94255")}),R&&e.teams.map(e=>e.state===Pt.WaitingAssignment?(0,i.jsx)(zl,{color:"white",leftIcon:"wand-magic-sparkles",rightIcon:"arrow-right",to:Ps.TEAM_ASSIGNMENT(n,s,e.teamCode),children:o("affecter_l_qui_12468",e.teamCode)},e.teamCode):null),R&&e.state===Pt.Assigned&&(0,i.jsx)(zl,{color:"white",isLoading:p,leftIcon:"paper-plane",rightIcon:"arrow-right",onClick:async()=>{await g({organizationId:n,eventId:s,userInfoId:e.userInfo.id,emailType:$e.Assignments})},children:o("r_envoyer_l_e_65315")}),d&&e.state===Pt.Refused&&(0,i.jsx)(zl,{color:"white",isLoading:p,leftIcon:"paper-plane",rightIcon:"arrow-right",onClick:async()=>{await g({organizationId:n,eventId:s,userInfoId:e.userInfo.id,emailType:$e.Refused})},children:o("r_envoyer_l_e_06733")})]}),u&&(0,i.jsxs)(Ba,{direction:"column",gap:"3",children:[(0,i.jsx)(Ar,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:o("Accreditation")}),(e.accreditationState===le.NotApplicable||e.accreditationState===le.Refused||e.accreditationState===le.Accredited||e.accreditationState===le.AutoAccredited)&&(0,i.jsx)(zl,{color:"white",isLoading:w,leftIcon:"arrow-right-arrow-left",rightIcon:"arrow-right",onClick:async()=>{await A({eventId:s,massStateUpdate:{selecteds:{ids:[e.userInfo.id]},state:le.WaitingAccreditation}}),e.reload()},children:o("changer_le_stat_20528")}),(e.accreditationState===le.Accredited||e.accreditationState===le.AutoAccredited||e.accreditationState===le.WaitingAccreditation||e.accreditationState===le.NotApplicable)&&(0,i.jsx)(zl,{color:"white",isLoading:w,leftIcon:"arrow-right-arrow-left",rightIcon:"arrow-right",onClick:async()=>{await A({eventId:s,massStateUpdate:{selecteds:{ids:[e.userInfo.id]},state:le.Refused}}),e.reload()},children:o("changer_le_stat_68392")}),(e.accreditationState===le.WaitingAccreditation||e.accreditationState===le.Accredited||e.accreditationState===le.AutoAccredited)&&(0,i.jsx)(zl,{color:"white",isLoading:k,leftIcon:"arrow-right-arrow-left",rightIcon:"arrow-right",onClick:async()=>{await y({eventId:s,massStateUpdate:{selecteds:{ids:[e.userInfo.id]},state:le.NotApplicable}}),e.reload()},children:o("changer_le_stat_62507")}),e.accreditationState===le.Accredited&&(0,i.jsx)(zl,{color:"white",leftIcon:"pen",rightIcon:"arrow-right",to:Ps.EDIT_ACCREDIT(n,s,e.userInfo.id),children:o("_diter_les_accr_86042")}),(e.accreditationState===le.AutoAccredited||e.accreditationState===le.WaitingAccreditation)&&(0,i.jsx)(zl,{color:"white",leftIcon:"badge-check",rightIcon:"arrow-right",to:Ps.ACCREDIT(n,s,e.userInfo.id),children:o("accr_diter_70543")}),(e.accreditationState===le.Accredited||e.accreditationState===le.AutoAccredited)&&(0,i.jsx)(zl,{color:"white",isLoading:p,leftIcon:"paper-plane",rightIcon:"arrow-right",onClick:async()=>{await g({organizationId:n,eventId:s,userInfoId:e.userInfo.id,emailType:$e.Accreditations})},children:o("r_envoyer_l_e_24677")})]}),$&&(0,i.jsxs)(Ba,{direction:"column",gap:"3",children:[(0,i.jsx)(Ar,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:o("Documents")}),$&&e.state===Pt.Assigned&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zl,{color:"white",download:`${e.userInfo.nameOrEmail}-assignments`,leftIcon:"arrow-down-to-bracket",rightIcon:"arrow-right",to:_g(e.links.userAssignmentsLink,"pdf",P),children:o("t_l_charger_la_82882")}),(0,i.jsx)(zl,{color:"white",download:`${e.userInfo.nameOrEmail}-planning`,leftIcon:"arrow-down-to-bracket",rightIcon:"arrow-right",to:_g(e.links.userPlanningLink,"pdf",P),children:o("t_l_charger_le_74660")}),(0,i.jsx)(zl,{color:"white",download:`${e.userInfo.nameOrEmail}-planning-days`,leftIcon:"arrow-down-to-bracket",rightIcon:"arrow-right",to:_g(e.links.userPlanningDaysLink,"pdf",P),children:o("t_l_charger_le_43587")}),(0,i.jsx)(zl,{color:"white",download:`${e.userInfo.nameOrEmail}-planning-list`,leftIcon:"arrow-down-to-bracket",rightIcon:"arrow-right",to:_g(e.links.userPlanningListLink,"pdf",P),children:o("t_l_charger_le_58518")}),(0,i.jsx)(zl,{color:"white",download:`${e.userInfo.nameOrEmail}-user-hours`,leftIcon:"arrow-down-to-bracket",rightIcon:"arrow-right",to:_g(e.links.userHoursLink,"pdf",P),children:o("t_l_charger_les_98537")}),a(Be.Documents)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zl,{color:"white",download:`${e.userInfo.nameOrEmail}-badge`,leftIcon:"arrow-down-to-bracket",rightIcon:"arrow-right",to:_g(e.links.userBadgeLink,"pdf",P),children:o("t_l_charger_le_53240")}),(0,i.jsx)(zl,{color:"white",download:`${e.userInfo.nameOrEmail}-certificate`,leftIcon:"arrow-down-to-bracket",rightIcon:"arrow-right",to:_g(e.links.userCertificateLink,"pdf",P),children:o("t_l_charger_l_a_02386")})]})]}),r.customBadges.map(t=>(0,i.jsx)(zl,{color:"white",download:`${e.userInfo.nameOrEmail}-custom-badge`,leftIcon:"arrow-down-to-bracket",rightIcon:"arrow-right",to:_g(e.links.userCustomBadgeLinks[t],"pdf",P),children:o("t_l_charger_1_80752",Vx(t))},t)),O.map((t,n)=>(0,i.jsx)(zl,{color:"white",download:`${e.userInfo.name}-custom-document`,leftIcon:"arrow-down-to-bracket",rightIcon:"arrow-right",to:_g(e.links.userCustomDocumentLinks[t.slug],"pdf",P),children:o("t_l_charger_1_80752",t.name)},n))]}),m&&(0,i.jsxs)(Ba,{direction:"column",gap:"3",children:[(0,i.jsx)(Ar,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:o("g_n_ral_64953")}),D&&(0,i.jsx)(zl,{color:"white",leftIcon:"minus",rightIcon:"arrow-right",onClick:()=>E(!0),children:o("retirer_de_la_d_64963")}),(0,i.jsx)(zl,{color:"white",leftIcon:"trash-can",rightIcon:"arrow-right",onClick:()=>z(!0),children:o("d_sinscrire_de_06416")})]}),D&&S&&(0,i.jsx)(cA,{buttonText:o("retirer_de_la_d_64963"),subtext:[o("_tes_vous_sur_d_34901",e.delegation.name)],text:o("suppression_de_73669",e.userInfo.name),onClose:()=>E(!1),onDelete:async()=>{await j({organizationId:r.id,eventId:s,delegationId:e.delegation.id,selecteds:{ids:[e.userInfo.id]}}),t.push(Ps.VOLUNTEERS(n,s))}}),T&&(0,i.jsx)(cA,{buttonText:o("d_sinscrire_27046"),subtext:[o("_tes_vous_s_r_d_29576"),o("_1_sera_toujou_13334",e.userInfo.nameOrEmail)],text:o("d_sinscription_69522",e.userInfo.nameOrEmail),onClose:()=>z(!1),onDelete:async()=>{await C({eventId:s,selecteds:{ids:[e.userInfo.id]}}),t.push(Ps.VOLUNTEERS(n,s))}}),(0,i.jsx)(Ya,{height:"8"})]})},Tz=()=>{const{params:{eventId:e,userInfoId:t}}=vl(),{data:n,loader:s,reload:o}=Qn("query UserOverlayActionsEvent($eventId: EventId!, $userInfoId: UsersInfoId!) {\n event(id: $eventId) {\n customDocuments {\n ...CustomDocumentPopulation\n }\n\n volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n accreditationState\n state\n\n delegation {\n id\n name\n }\n\n teams {\n teamCode\n state\n }\n\n userInfo {\n ...UserInfoOverlay\n\n links(eventId: $eventId) {\n ...UserInfoLinks\n }\n }\n }\n }\n}\n",{eventId:e,userInfoId:t},[Vs.CustomDocumentPopulationFragment,Vs.UserInfoOverlayFragment,Vs.UserInfoLinksFragment]);if(s)return s;{const e=n.event.volunteerRegistration;return(0,i.jsx)(Ez,{accreditationState:e.accreditationState,customDocuments:n.event.customDocuments,delegation:e.delegation,links:e.userInfo.links,reload:o,state:e.state,teams:e.teams,userInfo:e.userInfo})}},zz=e=>{const{history:t,params:{organizationId:n},translate:s}=vl(),{mutate:o}=function(e={}){return ei("mutation UserInfoAdminDelete($organizationId: OrganizationId!, $userInfoId: UsersInfoId!) {\n userInfoAdminDelete(organizationId: $organizationId, userInfoId: $userInfoId) {\n id\n }\n}\n",e)}(),[r,a]=(0,L.useState)(!1);return(0,i.jsxs)(Ba,{direction:"column",gap:"3",children:[(0,i.jsx)(Ar,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:s("g_n_ral_64953")}),(0,i.jsx)(zl,{color:"white",leftIcon:"trash-can",rightIcon:"arrow-right",onClick:()=>a(!0),children:s("supprimer_43083")}),r&&(0,i.jsx)(cA,{buttonText:s("supprimer_43083"),subtext:[s("_tes_vous_s_r_d_53083"),s("cette_action_es_08212")],text:s("suppression_de_04261",e.userInfo.nameOrEmail),onClose:()=>a(!1),onDelete:async()=>{await o({organizationId:n,userInfoId:e.userInfo.id}),t.push(wi.COMMUNITY_USERS({organizationId:n}))}})]})},Oz=()=>{const{params:{organizationId:e,userInfoId:t}}=vl(),{data:n,loader:s}=Qn("query UserOverlayActionsOrganization($organizationId: OrganizationId!, $userInfoId: UsersInfoId!) {\n organization(id: $organizationId) {\n userInfo(id: $userInfoId) {\n ...UserInfoOverlay\n }\n }\n}\n",{organizationId:e,userInfoId:t},[Vs.UserInfoOverlayFragment]);return s||(0,i.jsx)(zz,{userInfo:n.organization.userInfo})},Rz=e=>{const{translate:t,params:{organizationId:n,eventId:s,userInfoId:o}}=vl(),r=Zn(Iv),a=Zn(Jc),{mutate:l}=ko(),{data:d}=wo({organizationId:n,eventId:s,userInfoId:o}),c=(0,L.useMemo)(()=>{const n=r.createUpdateCampaignValuesDefault(!1,d.organization?.event?.emailSender?.id??d.organization?.emailSenderId,null,null),i=d.organization?.userInfo?.name||"",s=a.toLocaleString(Gs.c9.now(),eo.FullDateTime);return{...n,campaign:{...n.campaign,name:e.campaignType===me.Sms?t("sms_1_le_2_25252",i,s):t("e_mail_1_le_21805",i,s),campaignType:e.campaignType,state:he.InProgress,sendToEveryone:!1,usersInfosIds:[o]}}},[e.campaignType,d.organization]);return(0,i.jsx)(kl,{initialValues:c,render:n=>(0,i.jsxs)(vu,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(zj,{children:e.campaignType===me.Sms?t("envoi_d_un_sms_22148"):t("envoi_d_un_emai_99336")}),(0,i.jsx)(bu,{css:{padding:"$6"},children:e.campaignType===me.Email?(0,i.jsx)(cb,{canCustomDocuments:e.canCustomDocuments,customDocuments:d.organization?.event?.customDocuments??[],emailSenderId:d.organization?.event?.emailSender?.id??d.organization?.emailSenderId,emailsSenders:d.organization?.emailsSenders??[],form:n.form,values:n.values}):(0,i.jsx)(hb,{formRenderProps:n})}),(0,i.jsx)(ju,{children:(0,i.jsxs)(Ba,{gap:"3",justify:"end",children:[(0,i.jsx)(zl,{color:"white",onClick:e.onClose,children:t("annuler_48254")}),(0,i.jsx)(zl,{isLoading:n.submitting,onClick:n.handleSubmit,children:t("envoyer_26609")})]})})]}),onSubmit:async t=>{await l({organizationId:n,eventId:s,campaign:t.campaign}),e.onClose()}})},$z=e=>{const t=Xn(),n=Zn(Zl),{mutate:s}=function(e={}){return ei("mutation EmailUpdate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $delegationId: DelegationId\n $userInfoId: UsersInfoId!\n $email: UserEmail!\n) {\n emailUpdate(\n organizationId: $organizationId\n eventId: $eventId\n delegationId: $delegationId\n userInfoId: $userInfoId\n email: $email\n )\n}\n",e)}();return(0,i.jsx)(oC,{buttonText:t("modifier_l_adre_94026"),icon:"pen",initialValues:{email:e.email},schema:n.emailSchema(),title:t("modification_de_69462"),onClose:e.onClose,onSubmit:async t=>{await s({email:t.email,eventId:e.eventId,organizationId:e.organizationId,userInfoId:e.userInfoId}),e.onClose(),e.onSuccess()},children:(0,i.jsx)(Vl,{label:t("adresse_e_mail_60930"),name:"email"})})},Dz=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=vl(),{hasFeature:o}=TI(),{event:r}=wb(),[a,l]=(0,L.useState)(!1),[d,c]=(0,L.useState)(!1),[u,h]=(0,L.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ba,{align:"center",gap:"4",width:1,children:[(0,i.jsx)(sp,{email:e.userInfo.email,image:e.userInfo.picture?.url,name:e.userInfo.name,size:88}),(0,i.jsxs)(Ba,{css:{flex:"1"},direction:"column",gap:"3",children:[(0,i.jsx)(Ar,{font:"gray800 textXl medium",children:e.userInfo.name}),(0,i.jsxs)(Ba,{gap:"7",children:[(0,i.jsxs)(Ba,{direction:"column",gap:"1",children:[(0,i.jsx)(Ar,{font:"gray800 textSm medium",children:t("Email")}),(0,i.jsxs)(Wd,{children:[(0,i.jsx)(Xd,{children:(0,i.jsx)(rc,{color:"white",cursor:"pointer",leftIcon:"at",rightIcon:"chevron-down",size:"md",children:e.userInfo.email})}),(0,i.jsxs)(Zd,{placement:"bottom-start",children:[(0,i.jsx)(Kd,{icon:"copy",onClick:()=>{US(e.userInfo.email)},children:t("copier_1_59210",e.userInfo.email)}),e.canEditEmail&&(0,i.jsx)(Kd,{icon:"pen",onClick:()=>{l(!0)},children:t("modifier_1_38587",e.userInfo.email)}),(0,i.jsx)(Kd,{icon:"at",onClick:()=>c(!0),children:t("_crire_1_90053",e.userInfo.email)})]})]})]}),(0,i.jsxs)(Ba,{direction:"column",gap:"1",children:[(0,i.jsx)(Ar,{font:"gray800 textSm medium",children:t("t_l_phone_31755")}),m(e.userInfo.phone?.internationalFormat)?(0,i.jsxs)(Wd,{children:[(0,i.jsx)(Xd,{children:(0,i.jsx)(rc,{color:"white",cursor:"pointer",leftIcon:"phone",rightIcon:"chevron-down",size:"md",children:e.userInfo.phone?.internationalFormat??"-"})}),(0,i.jsxs)(Zd,{placement:"bottom-start",children:[(0,i.jsx)(Kd,{color:"default",icon:"copy",onClick:()=>US(e.userInfo.phone.internationalFormat),children:t("copier_1_59210",e.userInfo.phone?.internationalFormat??"-")}),(0,i.jsx)(el,{to:{pathname:`tel:${e.userInfo.phone.internationalFormat.replaceAll(" ","")}`},children:(0,i.jsx)(Kd,{color:"default",icon:"phone",children:t("appeler_1_57163",e.userInfo.phone?.internationalFormat??"-")})}),o(Be.Sms)&&(0,i.jsx)(Kd,{icon:"phone",onClick:()=>h(!0),children:t("_crire_1_90053",e.userInfo.phone?.internationalFormat??"-")})]})]}):(0,i.jsx)(Ar,{color:"gray500",children:"-"})]}),(0,i.jsxs)(Ba,{direction:"column",gap:"1",children:[(0,i.jsx)(Ar,{font:"gray800 textSm medium",children:e.populationFieldName}),(0,i.jsx)(Ar,{color:"gray500",children:m(e.userInfo.population)?e.userInfo.population:"-"})]}),e.assignmentState&&(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(Ba,{direction:"column",gap:"1",children:[(0,i.jsx)(Ar,{font:"gray800 textSm medium",children:t("status_d_affect_75769")}),(0,i.jsx)(Ba,{children:(0,i.jsx)(rc,{...Cj(e.assignmentState),children:t(e.assignmentState)})})]})}),e.accreditationState&&(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(Ba,{direction:"column",gap:"1",children:[(0,i.jsx)(Ar,{font:"gray800 textSm medium",children:t("statut_d_accr_d_75527")}),(0,i.jsx)(Ba,{children:(0,i.jsx)(rc,{...yj(e.accreditationState),children:t(e.accreditationState)})})]})})]})]})]}),a&&(0,i.jsx)($z,{email:e.userInfo.email,eventId:s,organizationId:n,userInfoId:e.userInfo.id,onClose:()=>{l(!1)},onSuccess:e.reload}),d&&(0,i.jsx)(Rz,{campaignType:me.Email,canCustomDocuments:!!s&&r?.useDocuments,onClose:()=>c(!1)}),u&&(0,i.jsx)(Rz,{campaignType:me.Sms,canCustomDocuments:!1,onClose:()=>h(!1)})]})},Pz=()=>(0,i.jsxs)(Ba,{gap:"4",width:1,children:[(0,i.jsx)(lc,{size:88,variant:"circular"}),(0,i.jsxs)(Ba,{css:{flex:"1"},direction:"column",gap:"3",children:[(0,i.jsx)(lc,{borderRadius:"$1",height:28,width:200}),(0,i.jsx)(lc,{borderRadius:"$1",height:48,width:1})]})]}),Fz=e=>{const{history:t,translate:n,params:{organizationId:s,eventId:o,userInfoId:r}}=vl(),a=Zn(Jc),{mutate:l}=lr(),d=e.campaign.sentAt?.setZone(Gs.c9.local().zone),c=(0,L.useMemo)(()=>e.campaign.campaignType===me.Email&&e.campaign.email?e.campaign.email.state:null,[e.campaign]),u=(0,L.useMemo)(()=>e.campaign.campaignType===me.Sms&&e.campaign.textMessage?e.campaign.textMessage.state:null,[e.campaign]);return(0,i.jsxs)(Mc,{css:{cursor:"pointer","&:hover":{background:"$gray100"}},onClick:()=>{t.push($I.CAMPAIGN({organizationId:e.campaign.organizationId,eventId:e.campaign.eventId||void 0,campaignId:e.campaign.id}))},children:[(0,i.jsx)(Oc,{children:(0,i.jsxs)(Ba,{direction:"column",width:1,children:[(0,i.jsx)(Ar,{color:"gray800",children:e.campaign.name}),d&&(0,i.jsx)(Ar,{color:"gray500",children:n("envoy_e_le_1_31494",a.toLocaleString(d,eo.DateOnly.MonthLong),a.toLocaleString(d,eo.TimeOnly))})]})}),(0,i.jsxs)(Oc,{width:150,children:[(0,i.jsx)(Ar,{width:22,children:e.campaign.campaignType===me.Email?(0,i.jsx)(nl,{icon:"at"}):(0,i.jsx)(nl,{icon:"message"})}),e.campaign.campaignType]}),(0,i.jsxs)(Oc,{width:200,children:[c&&(0,i.jsx)(rc,{...Ij(c),children:n(c)}),u&&(0,i.jsx)(rc,{...Tj(u),children:n(u)})]}),(0,i.jsx)(Oc,{children:(0,i.jsx)(Ar,{css:{ellipsis:!0},children:e.campaign.event?.name??n("communaut_20896")})}),(0,i.jsx)(Xc,{justify:"end",children:(0,i.jsx)(Yc,{children:(0,i.jsx)(Kd,{icon:"paper-plane",onClick:async()=>{await l({organizationId:s,eventId:o,campaignId:e.campaign.id,selecteds:{ids:[r]}})},children:n("r_envoyer_90741")})})})]})},Mz=()=>{const{translate:e,params:{organizationId:t,userInfoId:n}}=vl(),{data:s,isLoading:o,reload:r}=Qn("query UserHistoryCampaigns($organizationId: OrganizationId!, $userInfoId: UsersInfoId!) {\n organization(id: $organizationId) {\n userInfo(id: $userInfoId) {\n campaigns {\n nodes {\n id\n organizationId\n eventId\n name\n campaignType\n sentAt\n\n event {\n name\n }\n\n email(userInfoId: $userInfoId) {\n state\n }\n\n textMessage(userInfoId: $userInfoId) {\n state\n }\n }\n }\n }\n }\n}\n",{organizationId:t,userInfoId:n},[]);return(0,i.jsxs)(Sc,{hideBorder:!0,children:[(0,i.jsxs)(kc,{children:[(0,i.jsx)(Gc,{children:e("nom_de_la_campa_45063")}),(0,i.jsx)(Gc,{width:150,children:e("type_35427")}),(0,i.jsx)(Gc,{width:200,children:e("status_06428")}),(0,i.jsx)(Gc,{children:e("_v_nement_22345")}),(0,i.jsx)(Gc,{width:100})]}),o?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Hc,{}),(0,i.jsx)(Hc,{}),(0,i.jsx)(Hc,{})]}):s.organization.userInfo.campaigns.nodes.map(e=>(0,i.jsx)(Fz,{campaign:e,reload:r},e.id))]})},Nz=e=>{const{translate:t}=vl(),n=Zn(Jc),s=(0,L.useMemo)(()=>Object.values((0,cc.A)(e.vr.positionsSlotsUsersInfos,e=>e.position.id)).map(e=>{const t=e[0].position;return{id:t.id,text:m(t.acronym)?t.acronym:t.name,color:t.color,count:e.length,icon:t.icon}}),[e.vr]),o=(0,L.useMemo)(()=>Object.values((0,cc.A)(e.vr.accreditationsUsersInfos,e=>e.accreditation.id)).map(e=>{const t=e[0].accreditation;return{id:t.id,text:m(t.acronym)?t.acronym:t.name,color:t.color,count:e.length,icon:t.icon}}),[e.vr]);return(0,i.jsxs)(Mc,{children:[(0,i.jsxs)(Oc,{align:"start",direction:"column",justify:"center",children:[(0,i.jsx)(Ar,{children:e.vr.event.name}),(0,i.jsx)(Ar,{color:"gray500",children:t("inscrit_le_1_12018",n.toLocaleString(e.vr.insertedAt.toLocal(),eo.DateTime))})]}),(0,i.jsx)(Oc,{children:(0,i.jsx)(Py,{badges:s})}),(0,i.jsx)(Oc,{children:(0,i.jsx)(Py,{badges:o})}),(0,i.jsx)(Oc,{children:e.vr.delegation&&(0,i.jsx)(rc,{ellipsis:!0,children:e.vr.delegation.name})})]})},Lz=()=>{const{translate:e,params:{organizationId:t,userInfoId:n}}=vl(),{data:s,isLoading:o}=Qn("query UserHistoryEvents($organizationId: OrganizationId!, $userInfoId: UsersInfoId!) {\n organization(id: $organizationId) {\n userInfo(id: $userInfoId) {\n volunteersRegistrations {\n id\n insertedAt\n\n delegation {\n name\n }\n\n event {\n id\n name\n }\n\n accreditationsUsersInfos {\n accreditation {\n id\n acronym\n color\n icon\n name\n }\n }\n\n positionsSlotsUsersInfos {\n position {\n id\n acronym\n color\n icon\n name\n }\n }\n }\n }\n }\n}\n",{organizationId:t,userInfoId:n},[]);return(0,i.jsxs)(Sc,{hideBorder:!0,children:[(0,i.jsxs)(kc,{children:[(0,i.jsx)(Gc,{children:e("nom_de_l_v_nem_08711")}),(0,i.jsx)(Gc,{children:e("missions_63972")}),(0,i.jsx)(Gc,{children:e("accr_ditations_39450")}),(0,i.jsx)(Gc,{children:e("Delegation")})]}),o?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Hc,{}),(0,i.jsx)(Hc,{}),(0,i.jsx)(Hc,{})]}):s.organization.userInfo.volunteersRegistrations.map(e=>(0,i.jsx)(Nz,{vr:e},e.id))]})},Bz=e=>{const{translate:t}=vl(),n=Zn(Jc);return(0,i.jsxs)(Mc,{children:[(0,i.jsxs)(Oc,{align:"start",direction:"column",justify:"center",children:[(0,i.jsx)(Ar,{children:e.fui.form.name}),(0,i.jsx)(Ar,{color:"gray500",children:t("rempli_le_1_29292",n.toLocaleString(e.fui.insertedAt.toLocal(),eo.DateTime))})]}),(0,i.jsx)(Oc,{children:(0,i.jsx)(Ar,{css:{ellipsis:!0},children:e.fui.event?.name??t("communaut_20896")})})]})},Vz=()=>{const{translate:e,params:{organizationId:t,userInfoId:n}}=vl(),{data:s,isLoading:o}=Qn("query UserHistoryForms($organizationId: OrganizationId!, $userInfoId: UsersInfoId!) {\n organization(id: $organizationId) {\n userInfo(id: $userInfoId) {\n formsUsersInfos {\n id\n insertedAt\n\n form {\n name\n }\n\n event {\n name\n }\n }\n }\n }\n}\n",{organizationId:t,userInfoId:n},[]);return(0,i.jsxs)(Sc,{hideBorder:!0,children:[(0,i.jsxs)(kc,{children:[(0,i.jsx)(Gc,{children:"Nom du formulaire"}),(0,i.jsx)(Gc,{children:e("_v_nement_22345")})]}),o?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Hc,{}),(0,i.jsx)(Hc,{}),(0,i.jsx)(Hc,{})]}):s.organization.userInfo.formsUsersInfos.map(e=>(0,i.jsx)(Bz,{fui:e},e.id))]})},Uz=e=>{const t=Zn(Jc),{organization:n}=TI(),s=(0,L.useMemo)(()=>Gs.c9.fromISO(e.weezeventWebhook.data?.values?.validated)?.isValid?Gs.c9.fromISO(e.weezeventWebhook.data?.values?.validated):e.weezeventWebhook.insertedAt,[e.weezeventWebhook]),o=e.weezeventWebhook.checklist?xg(n.weezeventOrganizationId,e.weezeventWebhook.checklist.id):"";return(0,i.jsxs)(Mc,{children:[(0,i.jsx)(Oc,{children:(0,i.jsx)(Zc,{to:o,children:(0,i.jsx)(Ar,{css:{ellipsis:!0},title:e.weezeventWebhook.checklist?.name??"-",width:1,children:e.weezeventWebhook.checklist?.name??"-"})})}),(0,i.jsx)(Oc,{children:t.toLocaleString(s,{...eo.DateTime,weekday:"long"})}),(0,i.jsx)(Oc,{children:e.weezeventWebhook.data?.values?.partner_name??"-"})]})},Wz=()=>{const{translate:e,params:{eventId:t,userInfoId:n}}=vl(),{data:s,isLoading:o}=Qn('query UserHistoryScans($eventId: EventId!, $userInfoId: UsersInfoId!) {\n event(id: $eventId) {\n volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n weezeventWebhooks(type: "scan") {\n nodes {\n id\n data\n insertedAt\n\n checklist {\n id\n name\n }\n }\n }\n }\n }\n}\n',{eventId:t,userInfoId:n},[]);return(0,i.jsxs)(Sc,{hideBorder:!0,children:[(0,i.jsxs)(kc,{children:[(0,i.jsx)(Gc,{children:e("liste_de_contr_79815")}),(0,i.jsx)(Gc,{children:e("Date")}),(0,i.jsx)(Gc,{children:e("op_rateur_30804")})]}),o?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Hc,{}),(0,i.jsx)(Hc,{}),(0,i.jsx)(Hc,{})]}):s.event.volunteerRegistration.weezeventWebhooks.nodes.map(e=>(0,i.jsx)(Uz,{weezeventWebhook:e},e.id))]})},Gz=e=>{const{translate:t,params:n}=vl(),{event:s}=wb(),o={organizationId:":organizationId",eventId:e.isEvent?":eventId":void 0,userInfoId:":userInfoId"},r=s?.useCampaigns??!0,a=s?.useForms??!0,l=e.isEvent&&e.isWeezeventConnected;return(0,i.jsxs)(Ba,{css:{background:"white",bd:!0,overflow:"hidden",paddingTop:"$5"},direction:"column",gap:"5",children:[(0,i.jsx)(Ar,{css:{px:"$6"},font:"gray900 textMd semiBold",children:"Historique"}),(0,i.jsxs)(mj,{css:{flex:"1"},children:[(0,i.jsxs)(uj,{css:{px:"$6"},children:[(0,i.jsx)(cj,{path:QI.MEMBER_HISTORY_EVENTS(n),children:t("Event")}),r&&(0,i.jsx)(cj,{path:QI.MEMBER_HISTORY_CAMPAIGNS(n),children:t("Campaigns")}),a&&(0,i.jsx)(cj,{path:QI.MEMBER_HISTORY_FORMS(n),children:t("Form_plural")}),l&&(0,i.jsx)(cj,{path:QI.MEMBER_HISTORY_SCANS(n),children:"Scans"})]}),(0,i.jsx)(hj,{path:QI.MEMBER_HISTORY_EVENTS(o),children:(0,i.jsx)(Lz,{})}),r&&(0,i.jsx)(hj,{path:QI.MEMBER_HISTORY_CAMPAIGNS(o),children:(0,i.jsx)(Mz,{})}),a&&(0,i.jsx)(hj,{path:QI.MEMBER_HISTORY_FORMS(o),children:(0,i.jsx)(Vz,{})}),l&&(0,i.jsx)(hj,{path:QI.MEMBER_HISTORY_SCANS(o),children:(0,i.jsx)(Wz,{})})]})]})},Hz=e=>(0,i.jsx)(Ar,{color:"gray800",css:{overflow:"hidden",textOverflow:"ellipsis",...e.css},fontSize:"textSm",fontWeight:"medium",children:e.children}),qz=e=>(0,i.jsxs)(Ba,{direction:"column",gap:"1",children:[(0,i.jsx)(Hz,{children:e.field.name}),(0,i.jsx)(kw,{field:e.field,fields:e.fields})]});function Kz(e,t){return{name:t("commentaire_r_12290"),slug:`form${e}`,fieldType:We.Textarea,values:[]}}const Yz=e=>{const{translate:t}=vl(),n=Zn(Jc),[s,o]=(0,L.useState)(!0),r=(0,L.useCallback)(async()=>{const t=!s;o(t),await xI.forms.put({id:e.form.id,isOpenInUserOverlay:t})},[s,o]),a=(0,L.useMemo)(()=>e.form.elements.flatMap(e=>e.elementType===qe.Field?[e.customField]:e.hasCondition&&e.conditionCustomField?[e.conditionCustomField]:[]),[e.form]),l=(0,L.useMemo)(()=>e.form.elements.filter(t=>t.elementType===qe.Field?pC(t.customField,e.userInfo.fields,a):t.elementType===qe.Section&&pC(t,e.userInfo.fields,a)),[a,e.form.elements,e.userInfo.fields]),d=e.canEdit&&!1!==e.form.isEditableInMemberSpace,c="all"!==e.form.id?Kz(e.form.id,t):null;return(0,L.useEffect)(()=>{(async()=>{o((await xI.forms.get(e.form.id))?.isOpenInUserOverlay??!0)})()},[]),(0,i.jsxs)(Ba,{css:{background:"white",border:"1px solid $gray200",borderRadius:"$2",boxShadow:"$xs"},direction:"column",width:1,children:[(0,i.jsxs)(Ba,{align:"center",css:{cursor:"pointer",padding:"$5 $6",userSelect:"none"},gap:"4",onClick:r,children:[(0,i.jsx)(Ar,{children:(0,i.jsx)(nl,{icon:s?"chevron-up":"chevron-down"})}),(0,i.jsxs)(Ba,{align:"start",css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(Ar,{children:e.form.name}),e.showIsFilled?e.filledAt?(0,i.jsx)(rc,{color:"success",size:"sm",children:t("rempli_le_1_29292",n.toLocaleString(e.filledAt.toLocal(),eo.DateTime))}):(0,i.jsx)(rc,{color:"error",size:"sm",children:t("non_rempli_80877")}):null]}),d&&(0,i.jsx)(zl,{color:"white",size:"sm",to:e.getEditUserFormPath(e.form.id),children:t("_diter_62574")})]}),s&&(0,i.jsxs)(Ba,{css:{borderTop:"1px solid $gray200",padding:"$6"},direction:"column",children:[l.map((t,n)=>{switch(t.elementType){case qe.Field:return(0,i.jsxs)(L.Fragment,{children:[(0,i.jsx)(qz,{field:t.customField,fields:e.userInfo.fields}),n!==l.length-1&&(0,i.jsx)(Ya,{height:"6"})]},t.id);case qe.Section:return(0,i.jsxs)(L.Fragment,{children:[0!==n&&(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(Ar,{color:"gray800",fontWeight:"semiBold",children:t.section}),n!==l.length-1&&(0,i.jsx)(Ya,{height:"4"})]},t.id);case qe.Text:return null;default:return ll(t.elementType)}}),c&&m(e.userInfo.fields[c.slug])&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(Ar,{color:"gray800",fontWeight:"semiBold",children:t("inscription_en_49989")}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(qz,{field:c,fields:e.userInfo.fields})]})]})]})};function Zz(e,t){switch(e){case We.Text:case We.Textarea:return"text";case We.Checkbox:return"square-check";case We.Validation:return"check";case We.Select:return"population"===t?"users":"list-ul";case We.Date:return"calendar";case We.Datetime:return"calendar-day";case We.Time:return"clock";case We.File:return"file";case We.Phone:return"phone";case We.Language:return"language";case We.Number:return"00";case We.Sex:return"venus-mars";case We.Nationality:case We.Country:return"flag";case We.Address:return"map-location";default:return ll()}}function Xz(e){return(0,uc.A)(Object.entries((0,cc.A)(e,e=>e.category.name)),([e])=>e).flatMap(([e,t])=>[{id:V(),elementType:qe.Section,section:e,hasCondition:!1,conditionValue:!1}].concat(t.map(e=>({id:V(),elementType:qe.Field,customField:e,hasCondition:!1,conditionValue:!1}))))}const Jz=e=>(0,i.jsxs)(Ba,{css:{background:"white",bd:!0,padding:"$5 $6"},direction:"column",gap:"3",children:[(0,i.jsxs)(Ba,{align:"center",gap:"2",children:[(0,i.jsx)(nl,{icon:e.icon}),(0,i.jsx)(Ar,{font:"gray900 textMd medium",children:e.title})]}),e.children]}),Qz=e=>{const{history:t,translate:n,params:{organizationId:s,eventId:o}}=vl();return(0,i.jsx)(Jz,{icon:"people-group",title:n("d_l_gations_78318"),children:(0,i.jsx)(Ba,{gap:"2",wrap:"wrap",children:e.delegations.map(e=>{const n=o?e.name:e.event?`${e.event.name} : ${e.name}`:e.name;return(0,i.jsx)(rc,{color:"white",cursor:"pointer",ellipsis:!0,size:"md",onClick:()=>{t.push(e.event?hs.DELEGATION({organizationId:s,eventId:e.event.id,delegationId:e.id}):Ps.COMMUNITY_DELEGATION(s,e.id))},children:n},e.id)})})})},eO=e=>{const{history:t,translate:n}=vl(),s=Zn(Jc),[o,r]=(0,L.useState)(!1),a=(0,L.useMemo)(()=>e.customFields.filter(e=>e.isPrivate),[e.customFields]),l=(0,L.useMemo)(()=>so(e.profilePrivateFields)?e.profilePrivateFields:a.map(e=>e.slug),[a,e.profilePrivateFields]),d=(0,L.useMemo)(()=>(0,uc.A)(a.filter(t=>l.includes(t.slug)&&pC(t,e.userInfo.fields,e.customFields)),({slug:e})=>l.indexOf(e)),[e.customFields,a,l]),c=(0,L.useCallback)(async t=>{await e.profilePrivateFieldsUpdate(t),e.reload()},[e.profilePrivateFieldsUpdate,e.reload]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Jz,{icon:"lock-keyhole",title:n("informations_pr_15873"),children:[d.map(t=>(0,i.jsx)(qz,{field:t,fields:e.userInfo.fields},t.slug)),(0,i.jsx)(Ar,{css:{textTransform:"uppercase"},font:"gray500 textXs regular",children:n("inscrit_le_1_12018",s.toLocaleString(e.insertedAt.toLocal(),eo.DateTime))}),(0,i.jsx)(Kb,{rolesTypes:jI,children:(0,i.jsx)(nE,{color:"white",menu:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Kd,{icon:"gear",onClick:()=>{r(!0)},children:n("g_rer_les_champ_00431")})}),onClick:()=>t.push(e.getEditUserFormPath("private")),children:n("_diter_62574")})})]}),o&&(0,i.jsx)(Au,{columns:a,css:{zIndex:"210"},initialSelectedColumns:l,saveButtonText:n("mettre_jour_85141"),searchPlaceholder:n("rechercher_un_c_86475"),subtitle:n("personnaliser_l_69296"),title:n("gestion_des_cha_66775"),onClose:()=>{r(!1)},onSave:c})]})},tO=e=>{const{translate:t}=vl();return(0,i.jsxs)(Ba,{css:{background:"white",bd:!0,padding:"$5 $6"},direction:"column",gap:"3",children:[(0,i.jsxs)(Ba,{align:"center",gap:"2",children:[(0,i.jsx)(nl,{icon:"users-viewfinder"}),(0,i.jsx)(Ar,{font:"gray900 textMd medium",children:t("profils_li_s_03417")})]}),e.usersInfos.map(e=>(0,i.jsxs)(Ba,{direction:"column",gap:"1",children:[(0,i.jsx)(xj,{size:32,userInfo:e}),so(e.delegations)&&(0,i.jsx)(Ba,{css:{paddingLeft:"44px"},gap:"2",wrap:"wrap",children:e.delegations.map(e=>(0,i.jsx)(rc,{color:"white",size:"md",children:e.name},e.id))})]},e.id))]})},nO=({team:{organizationId:e,eventId:t,formId:n,teamCode:s,teamMembers:o}})=>{const{history:r,translate:a}=vl(),l=mg({organizationId:e,eventId:t,formId:n,teamCode:s}),{isLoading:d,copy:c}=WS(),u=(0,L.useCallback)(()=>{c(mg({organizationId:e,eventId:t,formId:n,teamCode:s}))},[e,t,n,s]);return(0,i.jsxs)(Jz,{icon:"user-group",title:a("_quipe_76857"),children:[(0,i.jsx)(Ba,{gap:"2",children:(0,i.jsx)(rc,{color:"white",cursor:"pointer",ellipsis:!0,size:"md",onClick:()=>{r.push(Ps.TEAM_ASSIGNMENT(e,t,s))},children:s})}),o.map(e=>(0,i.jsx)(xj,{size:32,userInfo:e},e.id)),(0,i.jsxs)(Ba,{align:"center",gap:"3",justify:"end",children:[(0,i.jsx)(el,{to:l,children:a("lien_d_invitati_45319")}),(0,i.jsx)(zl,{color:"white",isLoading:d,rightIcon:"copy",size:"sm",onClick:u})]})]})},iO=e=>{const{translate:t,params:{eventId:n}}=vl(),{isEventAdmin:s}=wb(),o=Zn(Jc),{mutate:r}=function(e={}){return ei("mutation VolunteerRegistrationTicketIdRegenerate(\n $eventId: EventId!\n $volunteerRegistrationId: VolunteersRegistrationId!\n) {\n volunteerRegistrationTicketIdRegenerate(\n eventId: $eventId\n volunteerRegistrationId: $volunteerRegistrationId\n ) {\n id\n ticketId\n }\n}\n",e)}(),[a,l]=(0,L.useState)(!1),d=(0,L.useMemo)(()=>m(e.volunteerRegistration.weezevent.lastSynchronizedAt)&&Gs.c9.fromISO(e.volunteerRegistration.weezevent.lastSynchronizedAt)?.isValid?o.toLocaleString(Gs.c9.fromISO(e.volunteerRegistration.weezevent.lastSynchronizedAt).toLocal(),eo.DateTime):"-",[e.volunteerRegistration]),c=(0,L.useMemo)(()=>e.volunteerRegistration.weezeventPairedAt?.isValid?o.toLocaleString(e.volunteerRegistration.weezeventPairedAt.toLocal(),eo.DateTime):"-",[e.volunteerRegistration]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ba,{css:{background:"white",bd:!0,padding:"$5 $6"},direction:"column",gap:"4",width:1,children:[(0,i.jsxs)(Ba,{align:"center",gap:"2",children:[(0,i.jsx)(nl,{icon:"memo-circle-info"}),(0,i.jsx)(Ar,{font:"gray900 textMd medium",children:t("informations_22954")})]}),(0,i.jsxs)(Ba,{align:"center",gap:"5",children:[(0,i.jsx)(Zy,{nameOrEmail:e.nameOrEmail,size:64,ticketId:e.volunteerRegistration.ticketId}),(0,i.jsxs)(Ba,{direction:"column",gap:"1",children:[(0,i.jsx)(Ar,{color:"gray500",children:t("TicketId")}),(0,i.jsxs)(Wd,{children:[(0,i.jsx)(Xd,{children:(0,i.jsx)(rc,{color:"white",cursor:"pointer",leftIcon:"ticket",rightIcon:"chevron-down",size:"md",children:e.volunteerRegistration.ticketId})}),(0,i.jsxs)(Zd,{placement:"bottom-start",children:[(0,i.jsx)(Kd,{icon:"copy",onClick:()=>{US(e.volunteerRegistration.ticketId)},children:t("copier_75889")}),m(e.volunteerRegistration.weezeventTicketUrl)&&(0,i.jsx)(el,{to:e.volunteerRegistration.weezeventTicketUrl,children:(0,i.jsx)(Kd,{icon:"arrow-up-right-from-square",children:t("ouvrir_dans_wee_97529")})}),m(e.volunteerRegistration.weezeventPayUrl)&&(0,i.jsx)(el,{to:e.volunteerRegistration.weezeventPayUrl,children:(0,i.jsx)(Kd,{icon:"arrow-up-right-from-square",children:t("ouvrir_dans_wee_14636")})}),s&&(0,i.jsx)(Kd,{icon:"repeat",onClick:()=>l(!0),children:t("r_g_n_rer_le_co_81294")})]})]})]}),(0,i.jsxs)(Ba,{direction:"column",gap:"1",children:[(0,i.jsx)(Ar,{color:"gray500",children:t("num_ro_de_puce_50039")}),(0,i.jsx)(Ar,{font:"gray800 textSm medium",children:m(e.volunteerRegistration.shortTag)?e.volunteerRegistration.shortTag:"-"})]}),(0,i.jsxs)(Ba,{direction:"column",gap:"1",children:[(0,i.jsx)(Ar,{color:"gray500",children:t("derni_re_synchr_59823")}),(0,i.jsx)(Ar,{font:"gray800 textSm medium",children:d})]}),(0,i.jsxs)(Ba,{direction:"column",gap:"1",children:[(0,i.jsx)(Ar,{color:"gray500",children:t("appair_le_70213")}),(0,i.jsx)(Ar,{font:"gray800 textSm medium",children:c})]})]})]}),a&&(0,i.jsx)(cA,{buttonText:t("r_g_n_rer_37440"),subtext:[t("_tes_vous_s_r_d_57752"),t("cela_rendra_l_a_42228")],text:t("r_g_n_rer_le_co_81294"),onClose:()=>l(!1),onDelete:async()=>{await r({eventId:n,volunteerRegistrationId:e.volunteerRegistration.id}),e.reload()}})]})},sO=e=>{const{translate:t,params:{eventId:n,userInfoId:s}}=vl(),{isOrganizationAdmin:o,organization:r}=TI(),{event:a,hasPermission:l}=wb(),d=n?a?.useForms&&l(Hb.MEMBER_EDIT):o,[c,u]=(0,L.useState)(""),[h,g]=(0,L.useState)(e.initialShowNotFilled),p=(0,L.useCallback)(t=>{g(t),e.setShowNotFilled(t)},[e.setShowNotFilled,g]),f=(0,L.useMemo)(()=>Object.fromEntries(e.formsUsersInfos.map(e=>[e.formId,e.insertedAt])),[e.formsUsersInfos]),_=(0,L.useMemo)(()=>(0,uc.A)(e.forms.filter(e=>!(!h&&void 0===f[e.id])&&(!m(c)||e.name.toLowerCase().includes(c.toLowerCase().trim()))),[e=>void 0!==f[e.id]?1:2,e=>e.name]),[e.forms,f,c,h]),x=(0,L.useMemo)(()=>so(e.delegations)&&(!n||a?.useDelegations),[a,n,e.delegations]),I=(0,L.useMemo)(()=>e.formsUsersInfos.filter(e=>m(e.teamCode)),[e.formsUsersInfos]),v=(0,L.useMemo)(()=>!so(I)||!n||a?.useForms,[I,n,a]),b=(0,L.useMemo)(()=>e.usersInfos.filter(e=>e.id!==s),[e.usersInfos,s]),j=(0,L.useMemo)(()=>Uy(e.userPermissions,t),[e.userPermissions,r]);return(0,i.jsxs)(Ba,{gap:"6",width:1,children:[(0,i.jsxs)(Ba,{css:{flex:"1",overflow:"hidden"},direction:"column",gap:"4",children:[e.isWeezeventConnected&&e.volunteerRegistration&&(0,i.jsx)(iO,{nameOrEmail:e.userInfo.nameOrEmail,reload:e.reload,volunteerRegistration:e.volunteerRegistration}),(0,i.jsxs)(Ba,{align:"center",css:{background:"white",bd:!0,padding:"$4"},gap:"2",children:[(0,i.jsx)(Ar,{css:{flex:"1"},children:(0,i.jsx)(Bl,{icon:"magnifying-glass",placeholder:t("rechercher_un_f_28561"),value:c,onChange:u})}),(0,i.jsx)(_c,{state:h?"checked":"unchecked",onClick:e=>{p("checked"===e)},children:t("afficher_les_fo_84832")})]}),(0,i.jsx)(Ba,{direction:"column",gap:"3",children:0===_.length?(0,i.jsx)(Ba,{css:{background:"white",bd:!0},height:400,children:(0,i.jsx)(Gk,{button:(0,i.jsx)(Kb,{permissions:Hb.MEMBER_EDIT,children:(0,i.jsx)(zl,{to:e.getEditUserFormPath("all"),children:t("_diter_les_cham_66020")})}),title:t("aucun_formulair_41857")})}):_.map(t=>(0,i.jsx)(Yz,{canEdit:d,filledAt:f[t.id],form:t,getEditUserFormPath:e.getEditUserFormPath,showIsFilled:"all"!==t.id,userInfo:e.userInfo},t.id))})]}),(0,i.jsxs)(Ba,{direction:"column",gap:"4",width:348,children:[so(j)&&(0,i.jsx)(Jz,{icon:"shield",title:"Rôles",children:(0,i.jsx)(Ba,{gap:"2",wrap:"wrap",children:j.map(e=>(0,i.jsx)($y,{badge:e},e.id))})}),so(b)&&(0,i.jsx)(tO,{usersInfos:b}),x&&(0,i.jsx)(Qz,{delegations:e.delegations}),v&&I.map((e,t)=>(0,i.jsx)(nO,{team:e},t)),(0,i.jsx)(eO,{customFields:e.customFields,getEditUserFormPath:e.getEditUserFormPath,insertedAt:e.insertedAt,profilePrivateFields:e.profilePrivateFields,profilePrivateFieldsUpdate:e.profilePrivateFieldsUpdate,reload:e.reload,userInfo:e.userInfo})]})]})},oO=()=>{const{organizationId:e,eventId:t,userInfoId:n}=ti(),{localEvent:s,updateLocalEvent:o}=wb(),{mutate:r}=function(e={}){return ei("mutation EventProfilePrivateFieldsUpdate(\n $eventId: EventId!\n $profilePrivateFields: [CustomFieldSlug!]!\n) {\n eventProfilePrivateFieldsUpdate(\n eventId: $eventId\n profilePrivateFields: $profilePrivateFields\n ) {\n id\n }\n}\n",e)}(),{data:a,loader:l,reload:d}=Qn("query UserInformationsEvent(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $userInfoId: UsersInfoId!\n) {\n organization(id: $organizationId) {\n customFields(variety: UserInfo) {\n nodes {\n ...CustomFieldWithCondition\n }\n }\n\n userInfo(id: $userInfoId) {\n ...UserInfoOverlay\n ...UserAllPermissions\n\n formsUsersInfos(level: Event, eventId: $eventId) {\n ...FormUserInfoUserProfile\n }\n\n user {\n usersInfos(organizationId: $organizationId, eventId: $eventId) {\n id\n name\n email\n\n picture {\n url\n }\n\n delegations(level: Event) {\n id\n name\n }\n }\n }\n }\n }\n\n event(id: $eventId) {\n isWeezeventConnected\n profilePrivateFields\n\n forms {\n nodes {\n ...FormUserOverlay\n }\n }\n\n volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n id\n insertedAt\n shortTag\n ticketId\n weezevent\n weezeventPairedAt\n weezeventPayUrl\n weezeventTicketUrl\n\n delegation {\n ...DelegationUserProfile\n }\n }\n }\n}\n",{organizationId:e,eventId:t,userInfoId:n},[Vs.CustomFieldWithConditionFragment,Vs.UserInfoOverlayFragment,Vs.UserAllPermissionsFragment,Vs.FormUserInfoUserProfileFragment,Vs.FormUserOverlayFragment,Vs.DelegationUserProfileFragment]),c=(0,L.useMemo)(()=>(0,uc.A)(a.event?.forms.nodes??[],e=>e.name),[a.event]),u=(0,L.useMemo)(()=>(0,Za.A)([a.event?.volunteerRegistration.delegation]),[a.event]);return l||(0,i.jsx)(sO,{customFields:a.organization.customFields.nodes,delegations:u,forms:c,formsUsersInfos:a.organization?.userInfo.formsUsersInfos??[],getEditUserFormPath:i=>Ps.EDIT_USER_FORM(e,t,n,i),initialShowNotFilled:s?.showNotFilled??!1,insertedAt:a.event.volunteerRegistration.insertedAt,isWeezeventConnected:a.event.isWeezeventConnected,profilePrivateFields:a.event.profilePrivateFields,profilePrivateFieldsUpdate:e=>r({eventId:t,profilePrivateFields:e}),reload:d,setShowNotFilled:e=>{o({showNotFilled:e})},userInfo:a.organization.userInfo,userPermissions:a.organization.userInfo,usersInfos:a.organization.userInfo.user.usersInfos,volunteerRegistration:a.event?.volunteerRegistration})},rO=()=>{const{params:{organizationId:e,userInfoId:t},translate:n}=vl(),{localOrganization:s,updateLocalOrganization:o}=TI(),{mutate:r}=function(e={}){return ei("mutation OrganizationProfilePrivateFieldsUpdate(\n $organizationId: OrganizationId!\n $profilePrivateFields: [CustomFieldSlug!]!\n) {\n organizationProfilePrivateFieldsUpdate(\n organizationId: $organizationId\n profilePrivateFields: $profilePrivateFields\n ) {\n id\n }\n}\n",e)}(),{data:a,loader:l,reload:d}=Qn("query UserInformationsOrganization(\n $organizationId: OrganizationId!\n $eventId: EventId\n $userInfoId: UsersInfoId!\n) {\n organization(id: $organizationId) {\n profilePrivateFields\n\n customFields(variety: UserInfo) {\n nodes {\n ...CustomFieldWithCondition\n\n category {\n name\n }\n }\n }\n\n forms(level: Organization) {\n nodes {\n ...FormUserOverlay\n }\n }\n\n userInfo(id: $userInfoId) {\n ...UserInfoOverlay\n ...UserAllPermissions\n insertedAt\n\n delegations(level: Both) {\n ...DelegationUserProfile\n }\n\n formsUsersInfos(level: Organization) {\n ...FormUserInfoUserProfile\n }\n\n user {\n usersInfos(organizationId: $organizationId) {\n id\n name\n email\n\n picture {\n url\n }\n }\n }\n }\n }\n}\n",{organizationId:e,userInfoId:t},[Vs.CustomFieldWithConditionFragment,Vs.FormUserOverlayFragment,Vs.UserInfoOverlayFragment,Vs.UserAllPermissionsFragment,Vs.DelegationUserProfileFragment,Vs.FormUserInfoUserProfileFragment]),c=(0,L.useMemo)(()=>{if(a.organization){const e=Xz(a.organization.customFields.nodes),t={id:"all",name:n("tous_les_champs_57939"),elements:e};return(0,uc.A)(a.organization.forms.nodes,e=>e.name).concat([t])}return[]},[a.organization,n]);return l||(0,i.jsx)(sO,{customFields:a.organization.customFields.nodes,delegations:a.organization.userInfo.delegations,forms:c,formsUsersInfos:a.organization?.userInfo.formsUsersInfos??[],getEditUserFormPath:n=>Ps.COMMUNITY_EDIT_USER_FORM(e,t,n),initialShowNotFilled:s?.showNotFilled??!1,insertedAt:a.organization.userInfo.insertedAt,isWeezeventConnected:!1,profilePrivateFields:a.organization.profilePrivateFields,profilePrivateFieldsUpdate:t=>r({organizationId:e,profilePrivateFields:t}),reload:d,setShowNotFilled:e=>{o({showNotFilled:e})},userInfo:a.organization.userInfo,userPermissions:a.organization.userInfo,usersInfos:a.organization.userInfo.user.usersInfos,volunteerRegistration:null})},aO=e=>{const{translate:t,params:{eventId:n}}=vl(),s=Zn(ph),{mutate:o}=Bo(),r=(0,L.useMemo)(()=>to(),[]),[a,l]=(0,L.useState)(e.assignments.map(e=>({...e,checkInAt:e.checkInAt?.toLocal(),checkOutAt:e.checkOutAt?.toLocal()}))),d=(0,L.useMemo)(()=>a.every(e=>e.checkInAt?.isValid&&e.checkOutAt?.isValid&&e.checkOutAt>e.checkInAt||e.checkInAt?.isValid&&!e.checkOutAt?.isValid||!e.checkInAt?.isValid&&!e.checkOutAt?.isValid),[a]),c=(0,L.useCallback)((e,t,n)=>{l((0,xu.jM)(i=>{i.forEach(i=>{i.id===e&&(i[t]=n||void 0)})}))},[a,l]);return(0,i.jsx)(Lb,{isOpen:e.isOpen,onClose:e.onClose,children:(0,i.jsxs)(Nb,{children:[(0,i.jsx)(Mb,{icon:"sliders",children:t("mettre_jour_d_54198")}),(0,i.jsx)(Fb,{gap:"4",children:a.map(e=>(0,i.jsxs)(Ba,{direction:"column",gap:"1",children:[(0,i.jsxs)(Ar,{font:"gray800 textSm medium",children:[e.position.name," -"," ",(0,i.jsx)(ng,{fontWeight:"regular",children:Ch(s,e.positionSlot,"",{slot:{includeRange:!0}})})]}),(0,i.jsxs)(Ba,{gap:"6",children:[(0,i.jsx)(Vu,{rightIcon:"xmark",value:e.checkInAt,zone:r,onChange:t=>{c(e.id,"checkInAt",t)},onRightIconClick:()=>{c(e.id,"checkInAt",null)}}),(0,i.jsx)(Vu,{rightIcon:"xmark",value:e.checkOutAt,zone:r,onChange:t=>{c(e.id,"checkOutAt",t)},onRightIconClick:()=>{c(e.id,"checkOutAt",null)}}),(0,i.jsx)(Bl,{shouldParseAsInt:!0,value:e.breakTime,onChange:t=>{c(e.id,"breakTime",t)}})]})]},e.id))}),(0,i.jsx)(Pb,{children:(0,i.jsx)(zl,{disabled:!d,onClick:async()=>{await Promise.all(a.map(e=>o({eventId:n,checkIn:{strategy:fe.CheckInOut,breakTime:e.breakTime,checkInAt:e.checkInAt,checkOutAt:e.checkOutAt,positionsSlotsUsersInfosIds:[e.id]}}))),e.onClose(),e.onSuccess()},children:t("mettre_jour_85141")})})]})})},lO=e=>{const{translate:t}=vl(),n=Zn(ph),s=L.useMemo(()=>{const t=ic(e.psui.position.color);return{background:t[50],color:t[700]}},[e.psui]);return(0,i.jsx)(i.Fragment,{children:e.renderPosition((0,i.jsxs)(Ba,{css:{...s,borderRadius:"$1",padding:"$1 $2"},direction:"column",gap:"1",justify:"center",width:1,children:[(0,i.jsxs)(Ba,{align:"center",css:{fontSize:"10px"},gap:"1",children:[(0,i.jsxs)(Ba,{direction:"column",gap:"1",children:[e.psui.positionSlot.name&&(0,i.jsx)(Ar,{children:e.psui.positionSlot.name}),(0,i.jsx)(Ar,{children:n.toDisplayString(e.psui.positionSlot.range,{hideDate:!0})})]}),e.psui.state===pe.CheckedOut&&(0,i.jsx)(nl,{icon:"stopwatch",title:t("d_pointer_25328")}),e.psui.state===pe.CheckedIn&&(0,i.jsx)(nl,{icon:"timer",title:t("pointer_80927")})]}),(0,i.jsx)(Ar,{fontSize:"textXs",fontWeight:"medium",children:e.psui.position.name})]}),e.psui.position.id)})},dO=e=>{const t=tw(),[n]=jh(e.dayStartTime),s=L.useMemo(()=>hh(e.assignments.map(e=>({...e,range:e.positionSlot.range})),e.startAt,e.endAt,n),[e.assignments,e.startAt,e.endAt,n]);return(0,i.jsx)(ow,{css:e.featureFlags?.isV4?{bd:!0,overflow:"auto"}:{borderTop:"1px solid $gray200"},date:e.selectedDay,display:t?"week":"day",maxDate:e.endAt,minDate:e.startAt,children:s.map((t,s)=>(0,i.jsx)(sw,{endAt:t.range.start,startAt:t.range.start,startHour:n,children:(0,i.jsx)(lO,{psui:t,renderPosition:e.renderPosition,startHour:n})},s))})},cO=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=vl(),{hasPermission:o}=Cb(),r=Zn(Jc),a=Zn(rp),l=Zn(ph),{mutate:d}=Bo(),c=(0,L.useMemo)(()=>Ch(l,e.psui.positionSlot,"",{slot:{includeRange:!0}}),[e.psui]),u=o(Hb.MEMBER_ASSIGN),h=o(Hb.POSITION_READ,{positionCategoryId:e.psui.positionCategoryId,positionId:e.psui.position.id});return(0,i.jsxs)(Mc,{children:[(0,i.jsxs)(Oc,{align:"center",gap:"3",children:[(0,i.jsx)(WC,{color:e.psui.position.color,icon:e.psui.position.icon}),(0,i.jsxs)(Ba,{css:{overflow:"hidden"},direction:"column",width:1,children:[(0,i.jsx)(Zc,{css:{overflow:"hidden",width:"100%","& > a":{width:"100%"}},to:xs.POSITION({organizationId:n,eventId:s,positionId:e.psui.position.id}),children:(0,i.jsx)(Ar,{css:{ellipsis:!0},title:e.psui.position.name,width:1,children:e.psui.position.name})}),(0,i.jsx)(Ar,{color:"gray500",css:{ellipsis:!0},title:c,width:1,children:c})]})]}),(0,i.jsx)(Oc,{children:e.psui.state===pe.CheckedOut?(0,i.jsx)(rc,{leftIcon:"clock",children:t("temps_total_79448",a.minutesToHoursMinutesString(e.psui.timeDifferenceMinutes))}):e.psui.state===pe.CheckedIn?(0,i.jsx)(rc,{color:"success",leftIcon:"circle",leftIconStyle:"solid",children:t("point_le_1_63576",r.toLocaleString(e.psui.checkInAt.toLocal(),eo.DateTime))}):(0,i.jsx)(rc,{color:"warning",leftIcon:"circle",leftIconStyle:"solid",children:t("non_point_42145")})}),(0,i.jsx)(Oc,{children:e.psui.isAutoAssign&&(0,i.jsx)(Ar,{color:"success700",fontSize:"textMd",children:(0,i.jsx)(nl,{icon:"check"})})}),(0,i.jsxs)(Oc,{align:"start",direction:"column",justify:"center",children:[(0,i.jsx)(Ar,{children:e.psui.createdBy?.name??"-"}),(0,i.jsx)(Ar,{color:"gray500",children:r.toLocaleString(e.psui.insertedAt.toLocal(),eo.DateTime)})]}),(0,i.jsxs)(Xc,{justify:"end",width:200,children:[h&&(e.psui.state===pe.Waiting?(0,i.jsx)(zl,{color:"white",size:"sm",onClick:async()=>{await d({eventId:e.psui.eventId,checkIn:{strategy:fe.CheckIn,positionsSlotsUsersInfosIds:[e.psui.id]}}),e.reload()},children:t("pointer_80927")}):e.psui.state===pe.CheckedIn?(0,i.jsx)(zl,{color:"white",size:"sm",onClick:async()=>{await d({eventId:e.psui.eventId,checkIn:{strategy:fe.CheckOut,positionsSlotsUsersInfosIds:[e.psui.id]}}),e.reload()},children:t("d_pointer_25328")}):null),(0,i.jsx)(Nk,{canCheckIn:h,canDelete:u,psui:e.psui,reloadCheckIn:e.reload,onDelete:e.reload})]})]})},uO=e=>{const{translate:t}=vl(),{hasPermission:n}=Cb(),s=n(Hb.POSITION_READ),o=(0,L.useMemo)(()=>e.assignments.filter(t=>!e.selectedDay?.isValid||t.positionSlot.range.contains(e.selectedDay)||t.positionSlot.range.start.startOf("day").toMillis()===e.selectedDay.startOf("day").toMillis()||t.positionSlot.range.end.startOf("day").toMillis()===e.selectedDay.startOf("day").toMillis()),[e.assignments,e.selectedDay]);return(0,i.jsxs)(Sc,{css:{borderTop:"1px solid $gray200"},hideBorder:!0,children:[(0,i.jsxs)(kc,{children:[(0,i.jsx)(Gc,{children:t("Position")}),(0,i.jsx)(Gc,{children:t("statut_du_point_52451")}),(0,i.jsx)(Gc,{children:t("affect_e_automa_74071")}),(0,i.jsx)(Gc,{children:t("ajout_e_par_71330")}),s&&(0,i.jsx)(Gc,{width:200})]}),o.map(t=>(0,i.jsx)(cO,{psui:t,reload:e.reload},t.id))]})},hO=e=>{const{params:{organizationId:t,eventId:n,userInfoId:s},translate:o}=vl(),{isEventAdmin:r}=Cb(),[a,l]=L.useState(Hx(e.event.startAt,e.event.endAt)),[d,c]=L.useState(null),[u,h]=L.useState(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ba,{as:"section",css:{background:"white",bd:!0,overflow:"hidden",padding:e.featureFlags?.isV4?"$6 $7 $7 $7":void 0},direction:"column",gap:e.featureFlags?.isV4?"6":void 0,justify:"center",children:[(0,i.jsxs)(Ba,{align:"center",as:"header",css:{padding:e.featureFlags?.isV4?void 0:"$5 $6"},gap:"4",children:[(0,i.jsxs)(Ar,{as:"hgroup",css:{flex:"1"},children:[(0,i.jsx)(ml,{children:e.title}),e.subtitle&&(0,i.jsx)(hl,{textStyle:"subtitle",children:e.subtitle})]}),(0,i.jsxs)(Ba,{as:"nav",gap:"3",children:["calendar"===e.positionsDisplay&&(0,i.jsx)(nw,{max:e.event.endAt,min:e.event.startAt,value:a,onChange:l}),"list"===e.positionsDisplay&&!e.hideListView&&(0,i.jsx)(Ar,{width:160,children:(0,i.jsx)(Mu,{rightIcon:"xmark",value:d,onChange:c,onRightIconClick:()=>c(null)})}),!e.hideListView&&e.setPositionsDisplay&&(0,i.jsx)(Ar,{width:200,children:(0,i.jsxs)($u,{value:e.positionsDisplay,onChange:e.setPositionsDisplay,children:[(0,i.jsx)("option",{value:"calendar",children:o("Calendar")}),(0,i.jsx)("option",{value:"list",children:o("List")})]})}),r&&(0,i.jsx)(zl,{to:Ps.EDIT_ASSIGNMENT(t,n,s),children:o("_diter_les_affe_42283")}),r&&(0,i.jsxs)(Wd,{children:[(0,i.jsx)(Xd,{children:(0,i.jsx)(zl,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsx)(Zd,{placement:"bottom-end",children:(0,i.jsx)(Kd,{icon:"circle-check",onClick:()=>h(!0),children:o("mettre_jour_d_54198")})})]})]})]}),"calendar"===e.positionsDisplay?(0,i.jsx)(dO,{assignments:e.assignments,dayStartTime:e.event.dayStartTime,endAt:e.event.endAt,featureFlags:e.featureFlags,renderPosition:e.renderPosition,selectedDay:a,startAt:e.event.startAt}):!e.hideListView&&(0,i.jsx)(uO,{assignments:e.assignments,reload:e.reload,selectedDay:d})]}),aO&&(0,i.jsx)(aO,{assignments:e.assignments,isOpen:u,onClose:()=>h(!1),onSuccess:()=>e.reload()})]})},mO=e=>{const[t,n]=kz("user.positions.display","calendar");return(0,i.jsx)(hO,{...e,positionsDisplay:t,setPositionsDisplay:n})},gO=e=>{const t=Xn(),n=Zn(ph),{mutate:s,isLoading:o}=Qo(),r=m(e.slot.name)?`${e.slot.name} - ${n.toDisplayString(e.slot.range)}`:n.toDisplayString(e.slot.range);return(0,i.jsxs)(Mc,{children:[(0,i.jsx)(Oc,{children:e.slot.position.name}),(0,i.jsx)(Oc,{children:r}),(0,i.jsx)(Oc,{justify:"end",width:200,children:(0,i.jsx)(zl,{color:"white",isLoading:o,size:"sm",onClick:async()=>{await s({eventId:e.eventId,massAssign:{strategy:it.Add,selecteds:{ids:[e.userInfoId]},positionsSlotsIds:[e.slot.id]}}),e.reload()},children:t("affecter_94255")})})]})},pO=e=>{const{params:{eventId:t,userInfoId:n},translate:s}=vl(),[o,r,a]=Wc(""),[l,d]=(0,L.useState)(0),[c,u]=(0,L.useState)(null),h=(0,L.useCallback)(e=>{u(e),d(0)},[u,d]),{data:g,isLoading:p}=Qn("query UserPositionsAvailablePositionsSlots(\n $eventId: EventId!\n $userInfoId: UsersInfoId!\n $name: String\n $offset: Int\n $sort: PositionsSlotsSort\n) {\n event(id: $eventId) {\n volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n availablePositionsSlots(name: $name, limit: 25, offset: $offset, sort: $sort) {\n nodes {\n id\n name\n range\n\n position {\n name\n }\n }\n\n numberOfPages\n totalCount\n }\n }\n }\n}\n",{eventId:t,userInfoId:n,name:m(r)?r:void 0,offset:l,sort:c},[]);const{numberOfPages:f,totalCount:_}=Su(g.event?.volunteerRegistration.availablePositionsSlots),x=g.event?.volunteerRegistration.availablePositionsSlots.nodes??[];return(0,i.jsx)(Lc,{filters:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Ar,{width:320,children:(0,i.jsx)(Bl,{icon:"magnifying-glass",placeholder:s("rechercher_une_69998"),value:o,onChange:a})})}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(jm,{attribute:ut.Position,setSort:h,sort:c,children:s("nom_de_la_missi_64605")}),(0,i.jsx)(jm,{attribute:ut.Range,setSort:h,sort:c,children:s("cr_neau_11117")}),(0,i.jsx)(Gc,{width:200})]}),numberOfPages:f,offset:l,rows:p?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Hc,{bx:!0}),(0,i.jsx)(Hc,{bx:!0}),(0,i.jsx)(Hc,{bx:!0})]}):so(x)?x.map(n=>(0,i.jsx)(gO,{eventId:t,reload:e.reload,slot:n,userInfoId:e.userInfoId},n.id)):(0,i.jsx)(Mc,{css:{height:"200px"},children:(0,i.jsx)(Gk,{title:s("aucune_mission_03533")})}),setOffset:d,title:s("missions_dispon_68881"),totalCount:_})},fO=e=>{const{history:t,params:{organizationId:n,eventId:s},translate:o}=vl(),r=Zn(ph),a=(0,L.useMemo)(()=>{const t=e.volunteerRegistration.preassignPositions.map(e=>({name:e.name,range:e.range?r.toDisplayString(e.range):"-",path:xs.POSITION({organizationId:n,eventId:s,positionId:e.id})})),i=e.volunteerRegistration.preassignPositionsCategories.map(e=>({name:e.name,range:e.range?r.toDisplayString(e.range):"-",path:xs.POSITION_CATEGORY({organizationId:n,eventId:s,positionCategoryId:e.id})}));return t.concat(i)},[e.volunteerRegistration]);return so(a)?(0,i.jsx)(Lc,{filters:(0,i.jsx)(i.Fragment,{}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Gc,{children:o("nom_de_la_missi_64605")}),(0,i.jsx)(Gc,{children:o("Date")})]}),numberOfPages:0,offset:0,rows:(0,i.jsx)(i.Fragment,{children:a.map((e,n)=>(0,i.jsxs)(Mc,{children:[(0,i.jsx)(Oc,{children:(0,i.jsx)(Ar,{color:"gray900",css:{cursor:"pointer"},fontWeight:"medium",onClick:()=>{t.push(e.path)},children:e.name})}),(0,i.jsx)(Oc,{children:e.range})]},n))}),setOffset:td.A,title:o("pr_affectation_68999"),totalCount:0}):null},_O=e=>{const{translate:t}=vl(),n=Zn(rp);return(0,i.jsxs)(Ba,{gap:"4",children:[(0,i.jsxs)(Ba,{css:{background:"white",bd:!0,padding:"$6"},direction:"column",gap:"2",width:1,children:[(0,i.jsx)(Ar,{font:"gray500 textSm medium",children:t("nombre_d_heures_46954")}),(0,i.jsx)(Ar,{font:"gray900 displaySm semiBold",children:n.minutesToHoursMinutesString(e.volunteerRegistration.volunteerMinutes)})]}),(0,i.jsxs)(Ba,{css:{background:"white",bd:!0,padding:"$6"},direction:"column",gap:"2",width:1,children:[(0,i.jsx)(Ar,{font:"gray500 textSm medium",children:t("nombre_de_missi_80367")}),(0,i.jsx)(Ar,{font:"gray900 displaySm semiBold",children:e.numberOfAssignments})]})]})},xO=e=>{const{params:{organizationId:t,eventId:n,userInfoId:s},translate:o}=vl(),r=(0,L.useMemo)(()=>(0,uc.A)(e.event.volunteerRegistration.positionsSlotsUsersInfos,e=>e.positionSlot.range.start.toMillis()),[e.event]);return(0,i.jsxs)(Ba,{direction:"column",gap:"6",width:1,children:[so(r)&&(0,i.jsx)(mO,{assignments:r,event:e.event,reload:()=>{e.reload(),r.length<=1&&e.reloadHeader()},renderPosition:(e,s)=>(0,i.jsx)(el,{style:{width:"100%"},to:xs.POSITION({organizationId:t,eventId:n,positionId:s}),children:e}),subtitle:o("visualisez_tout_59046"),title:o("missions_affect_97811")}),(0,i.jsx)(fO,{volunteerRegistration:e.event.volunteerRegistration}),e.event.hasFormWithPositionDisplay&&(0,i.jsx)(Yk,{editPath:Ps.EDIT_USER_MISSIONS(t,n,s),formsUsersInfos:e.organization.userInfo.formsUsersInfos}),(0,i.jsx)(Kb,{permissions:Hb.MEMBER_ASSIGN,children:(0,i.jsx)(pO,{reload:e.reload,userInfoId:s})}),so(r)&&(0,i.jsx)(_O,{numberOfAssignments:r.length,volunteerRegistration:e.event.volunteerRegistration})]})},IO=e=>{const{params:{organizationId:t,eventId:n,userInfoId:s}}=vl(),{data:o,loader:r,reload:a}=Vo({organizationId:t,eventId:n,userInfoId:s});return r||(0,i.jsx)(xO,{event:o.event,organization:o.organization,reload:a,reloadHeader:e.reload})},vO=()=>{const{params:{organizationId:e,eventId:t,userInfoId:n}}=vl(),{data:s,loader:o}=Zo({organizationId:e,eventId:t,userInfoId:n}),{permissions:[r],isLoading:a}=fk(uk({eventId:t,userInfoId:n}));return o||a?o:(0,i.jsx)(i.Fragment,{children:s.event.hasFormWithSlotDisplay&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(rA,{editPath:Ps.EDIT_USER_SLOTS(e,t,n),eventId:t,formsUsersInfos:s.organization.userInfo.formsUsersInfos,organizationId:e,showEditButton:r,userInfoId:n})})})},bO=e=>{const{params:t,translate:n}=vl(),{data:s,isLoading:o,reload:r}=Qn('query UserOverlay($organizationId: OrganizationId!, $eventId: EventId, $userInfoId: UsersInfoId!) {\n organization(id: $organizationId) {\n populationField: customFieldBySlug(slug: "population") {\n name\n }\n\n event: eventMaybe(id: $eventId) {\n isWeezeventConnected\n }\n\n userInfo(id: $userInfoId) {\n ...UserInfoOverlay\n numberOfComments\n\n volunteerRegistration(eventId: $eventId) {\n state\n accreditationState\n }\n }\n }\n}\n',t,[Vs.UserInfoOverlayFragment]),a=(0,L.useMemo)(()=>s.organization?.userInfo.numberOfComments??0,[s.organization]),l={organizationId:":organizationId",eventId:e.isEvent?":eventId":void 0,userInfoId:":userInfoId"};Md(s.organization?.userInfo?.nameOrEmail||"");const{params:{eventId:d,delegationId:c,organizationId:u,userInfoId:h}}=vl(),{permissions:[m,g],isLoading:p}=fk(dk({eventId:d,organizationId:u,userInfoId:h}),((...e)=>({name:"canEmailUpdateFn",args:e}))({delegationId:c,eventId:d,organizationId:u,userInfoId:h})),f=o||p;return(0,i.jsxs)(dj,{children:[(0,i.jsx)(lj,{hideBorder:!0,children:f?(0,i.jsx)(Pz,{}):(0,i.jsx)(Dz,{accreditationState:s.organization?.userInfo.volunteerRegistration?.accreditationState,assignmentState:s.organization?.userInfo.volunteerRegistration?.state,canEditEmail:g,populationFieldName:s.organization?.populationField.name||"",reload:r,userInfo:s.organization.userInfo})}),(0,i.jsxs)(mj,{css:{flex:"1"},children:[(0,i.jsxs)(uj,{css:{px:"$7"},children:[(0,i.jsx)(cj,{path:QI.MEMBER_INFORMATION(t),children:n("informations_22954")}),e.showAvailabilities&&(0,i.jsx)(cj,{path:QI.MEMBER_AVAILABILITIES(t),children:n("disponibilit_s_49923")}),e.showPositions&&(0,i.jsx)(cj,{path:QI.MEMBER_POSITIONS(t),children:n("missions_63972")}),e.showAccreditations&&(0,i.jsx)(cj,{path:QI.MEMBER_ACCREDITATIONS(t),children:n("accr_ditations_39450")}),e.showActions&&(0,i.jsx)(cj,{path:QI.MEMBER_ACTIONS(t),children:n("actions_21689")}),m&&(0,i.jsx)(cj,{path:QI.MEMBER_COMMENTS(t),children:n("commentaires_97857",a)}),e.showHistory&&(0,i.jsx)(cj,{basePath:QI.MEMBER_HISTORY(t),path:QI.MEMBER_HISTORY_EVENTS(t),children:n("historique_06296")})]}),(0,i.jsx)(hj,{path:QI.MEMBER_INFORMATION(l),children:e.isEvent?(0,i.jsx)(aj,{children:(0,i.jsx)(oO,{})}):(0,i.jsx)(aj,{children:(0,i.jsx)(rO,{})})}),e.showAvailabilities&&(0,i.jsx)(hj,{path:QI.MEMBER_AVAILABILITIES(l),children:(0,i.jsx)(aj,{children:(0,i.jsx)(vO,{})})}),e.showPositions&&(0,i.jsx)(hj,{path:QI.MEMBER_POSITIONS(l),children:(0,i.jsx)(aj,{children:(0,i.jsx)(IO,{reload:r})})}),e.showAccreditations&&(0,i.jsx)(hj,{path:QI.MEMBER_ACCREDITATIONS(l),children:(0,i.jsx)(aj,{children:(0,i.jsx)(Sz,{})})}),e.showActions&&(0,i.jsx)(hj,{path:QI.MEMBER_ACTIONS(l),children:e.isEvent?(0,i.jsx)(aj,{children:(0,i.jsx)(Tz,{})}):(0,i.jsx)(aj,{children:(0,i.jsx)(Oz,{})})}),m&&(0,i.jsx)(hj,{path:QI.MEMBER_COMMENTS(l),children:(0,i.jsx)(aj,{children:(0,i.jsx)(xz,{showEvent:!0})})}),e.showHistory&&(0,i.jsx)(hj,{path:QI.MEMBER_HISTORY(l),children:(0,i.jsx)(aj,{children:(0,i.jsx)(Gz,{isEvent:e.isEvent,isWeezeventConnected:s.organization?.event?.isWeezeventConnected??!1})})})]})]})},jO=()=>{const{isEventReader:e}=wb(),{canAccreditationRead:t,canDocumentRead:n,canMemberAccredit:s,canMemberAssign:o,canMemberAssignmentStateEdit:r,canMemberAvailabilitiesEdit:a,canMemberDelete:l,canPositionRead:d}=$S(),c=n||s||o||r||l,u=t||d||a,h=e;return(0,i.jsx)(bO,{isEvent:!0,showAccreditations:s,showActions:c,showAvailabilities:u,showHistory:h,showPositions:d})},CO=()=>(0,i.jsx)(bO,{isEvent:!1,showAccreditations:!1,showActions:!0,showAvailabilities:!1,showHistory:!0,showPositions:!1});var yO=n(6301);function kO(e=[]){const t=String.fromCharCode(65+(0,yO.A)(25));return!1===e.includes(t)?t:kO(e)}function AO(e=[]){const t=(0,yO.A)(9);return!1===e.includes(t)?t:AO(e)}const wO=["Q","O","I","L"],SO=[0,1];function EO(e=10){const t=(0,Dc.A)(0,e-1).map(()=>{return e=wO,t=SO,0===(0,yO.A)(1)?kO(e):AO(t).toString();var e,t}).join("");return`${kO(wO)}${t}`}const TO=e=>{const t=Xn(),n=`formKeyToTeamCode.f${e.form.id}`;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ar,{font:"gray900 textLg medium",children:"Équipe"}),(0,i.jsx)(Ju,{height:"4"}),(0,i.jsx)(Vl,{hint:t("d_finissez_votr_19710"),label:t("code_quipe_14296"),name:n,rightIcon:"arrows-rotate",onRightIconClick:()=>{e.change(n,EO())}}),(0,i.jsx)(Ya,{height:"9"})]})},zO=e=>{const{history:t,params:{eventId:n},translate:s}=vl(),o=L.useMemo(()=>(0,uc.A)(e.forms,e=>e.name.toLowerCase()),[e.forms]);return(0,i.jsxs)(Ba,{css:{overflow:"hidden"},direction:"column",height:1,width:1,children:[(0,i.jsx)(Ar,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsxs)(Ba,{align:"center",css:{margin:"auto",overflowY:"auto"},direction:"column",height:1,width:1,children:[e.banner,(0,i.jsxs)(Ba,{css:{padding:"$6 $4",width:"100%","@tablet":{padding:"$6 $8"},"@desktop":{padding:"$7",width:n?"100%":"$container"}},direction:"column",children:[(0,i.jsx)(Ar,{font:"gray900 displayXs semiBold",children:e.title}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsxs)(mj,{children:[(0,i.jsxs)(uj,{children:[o.map(t=>(0,i.jsx)(cj,{path:e.getTabPath(t.id),children:t.name},t.id)),e.extraTabs]}),e.children]})]})]})}),(0,i.jsx)(Ba,{css:{boxShadow:"0px 0px 0px 1px rgba(0, 0, 0, 0.03), 0px 3px 6px rgba(0, 0, 0, 0.04), 0px 4px 16px rgba(0, 0, 0, 0.08)",padding:"$4 $7"},justify:"center",children:(0,i.jsxs)(Ba,{align:"center",css:{width:"100%","@desktop":{width:n?"100%":"$container"}},gap:"4",children:[(0,i.jsx)(zl,{isLoading:e.isLoading,onClick:e.handleSubmit,children:s("mettre_jour_85141")}),(0,i.jsx)(Ar,{color:"gray700",css:{cursor:"pointer"},fontWeight:"medium",onClick:()=>t.goBack(e.returnPathFallback),children:s("annuler_48254")})]})})]})},OO=({banner:e,change:t,customFields:n,formIdToInsertedAt:s,forms:o,getEditUserFormPath:r,handleSubmit:a,isLoading:l,returnPathFallback:d,showAllAndPrivate:c,showIsFilled:u,userInfo:h,values:m})=>{const{translate:g,params:{organizationId:p}}=vl(),f=Zn(Jc),_=L.useMemo(()=>n.filter(e=>e.isPrivate).map(e=>({id:V(),elementType:qe.Field,customField:e,hasCondition:!1,conditionValue:!1})),[n]),x=L.useMemo(()=>Xz(n),[n]),I=L.useCallback((e,t)=>(0,i.jsxs)(i.Fragment,{children:[0!==t&&(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(Ar,{font:"gray900 textLg medium",children:e}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(Xu,{direction:"horizontal"})]}),[]);return(0,i.jsxs)(zO,{banner:e,extraTabs:c?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(cj,{path:r("all"),children:g("tous_les_champs_57939")}),(0,i.jsx)(cj,{path:r("private"),children:g("champs_priv_s_84670")})]}):void 0,forms:o,getTabPath:r,handleSubmit:a,isLoading:l,returnPathFallback:d,title:g("mise_jour_de_17055",h.nameOrEmail),children:[o.map(e=>{const n=s[e.id];return(0,i.jsxs)(hj,{path:r(e.id),children:[(0,i.jsx)(Ya,{height:"7"}),u&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ba,{align:"center",css:{background:"$gray100",borderRadius:"$2",padding:"$4"},gap:"4",children:[(0,i.jsx)(Ar,{css:{flex:"1"},font:"gray800 textMd semiBold",children:g("statut_du_formu_08195")}),(0,i.jsx)(Ar,{width:320,children:(0,i.jsxs)($u,{shouldParseAsBoolean:!0,state:n?"disabled":"active",value:m.filledFormsIds.includes(e.id),onChange:n=>{t("filledFormsIds",ro(m.filledFormsIds,e.id,n))},children:[(0,i.jsx)("option",{value:"true",children:n?g("rempli_le_1_29292",f.toLocaleString(n,eo.DateTime)):g("rempli_78674")}),(0,i.jsx)("option",{value:"false",children:g("non_rempli_80877")})]})})]}),(0,i.jsx)(Ya,{height:"6"}),e.areTeamsAllowed&&(0,i.jsx)(TO,{change:t,form:e})]}),(0,i.jsx)(ST,{change:t,elements:e.elements,organizationId:p,prefix:"userInfo.fields.",renderSection:I,values:m.userInfo.fields})]},e.id)}),c&&(0,i.jsxs)(hj,{path:r("all"),children:[(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(ST,{change:t,elements:x,organizationId:p,prefix:"userInfo.fields.",renderSection:I,values:m.userInfo.fields})]}),c&&(0,i.jsxs)(hj,{path:r("private"),children:[(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(ST,{change:t,elements:_,organizationId:p,prefix:"userInfo.fields.",renderSection:I,values:m.userInfo.fields})]})]})},RO=[We.Address,We.Text,We.Textarea,We.Time],$O=({banner:e,customFields:t,country:n,formIdToInsertedAt:s,formIdToTeamCode:o,forms:r,from:a,getEditUserFormPath:l,showAllAndPrivate:d,showIsFilled:c,userInfo:u})=>{const{organizationId:h,eventId:m,delegationId:g}=ti(),p=ni(),f=Zn(CT),{mutate:_,isLoading:x}=function(e={}){return ei("mutation UserInfoUpdate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $delegationId: DelegationId\n $userId: UserId!\n $userInfo: UsersInfoInput!\n $filledFormsIds: [FormId!]\n $memberSpaceFormId: FormId\n $formKeyToTeamCode: JSON\n) {\n userInfoUpdate(\n organizationId: $organizationId\n eventId: $eventId\n delegationId: $delegationId\n userId: $userId\n userInfo: $userInfo\n filledFormsIds: $filledFormsIds\n formKeyToTeamCode: $formKeyToTeamCode\n memberSpaceFormId: $memberSpaceFormId\n ) {\n id\n }\n}\n",e)}(),I=L.useMemo(()=>Object.keys(s).map(e=>parseInt(e,10)),[s]),v=L.useMemo(()=>Object.fromEntries(Object.entries(o).map(([e,t])=>[`f${e}`,t])),[o]);return(0,i.jsx)(kl,{direction:"column",height:1,initialValues:{filledFormsIds:I,formKeyToTeamCode:v,userInfo:f.userInfoUpdateInputDefault(u,t,{checkboxDefaultEmpty:!0,countryCode:n})},render:({form:n,handleSubmit:o,values:p})=>(0,i.jsx)(OO,{banner:e,change:n.change,customFields:t,formIdToInsertedAt:s,forms:r,getEditUserFormPath:l,handleSubmit:o,isLoading:x,returnPathFallback:"app"===a?m?Ps.VOLUNTEERS(h,m):wi.COMMUNITY_USERS({organizationId:h}):g?hs.DELEGATION_MEMBERS({organizationId:h,eventId:m,delegationId:g}):QI.MEMBER({organizationId:h,eventId:m,userInfoId:u.id}),showAllAndPrivate:d,showIsFilled:c,userInfo:u,values:p}),width:1,onSubmit:async e=>{const n=e.userInfo.fields;t.forEach(e=>{RO.includes(e.fieldType)&&!n[e.slug]?n[e.slug]="":e.fieldType!==We.File||n[e.slug]||(n[e.slug]=null)}),await _({organizationId:h,eventId:m,userId:u.userId,userInfo:{id:u.id,fields:e.userInfo.fields},filledFormsIds:c?e.filledFormsIds:void 0,formKeyToTeamCode:e.formKeyToTeamCode}),p.goBack("app"===a?Ps.VOLUNTEERS(h,m):QI.MEMBER({organizationId:h,eventId:m,userInfoId:u.id}))}})},DO=({country:e,data:t,forms:n,getEditFormPath:s})=>{const{params:{organizationId:o,eventId:r,delegationId:a,userInfoId:l}}=vl(),d=(0,L.useMemo)(()=>t.organization?.userInfo.formsUsersInfos??[],[t.organization]),c=(0,L.useMemo)(()=>d.map(e=>e.formId),[d]),u=(0,L.useMemo)(()=>Object.fromEntries(d.map(e=>[e.formId,e.insertedAt])),[d]),h=(0,L.useMemo)(()=>r?Object.fromEntries(d.map(e=>[e.formId,e.teamCode])):{},[r,d]);return(0,i.jsxs)(Sr.dO,{children:[(0,i.jsx)(Sr.qh,{path:[Ps.EDIT_USER_FORM(":organizationId",":eventId",":userInfoId",":formId"),Ps.EDIT_USER_DELEGATION_FORM(":organizationId",":eventId",":delegationId",":userInfoId",":formId"),Ps.COMMUNITY_EDIT_USER_FORM(":organizationId",":userInfoId",":formId"),Ps.COMMUNITY_EDIT_USER_DELEGATION_FORM(":organizationId",":delegationId",":userInfoId",":formId")],children:(0,i.jsx)($O,{country:e,customFields:t.organization.customFields.nodes,formIdToInsertedAt:u,formIdToTeamCode:h,forms:n,from:"app",getEditUserFormPath:s,showAllAndPrivate:!0,showIsFilled:!0,userInfo:t.organization.userInfo})}),(0,i.jsx)(Sr.qh,{children:(0,i.jsx)(oi,{path:r?a?Ps.EDIT_USER_DELEGATION_FORM(o,r,a,l,n.length>0?n[0].id:"all"):Ps.EDIT_USER_FORM(o,r,l,c?.[0]??"all"):a?Ps.COMMUNITY_EDIT_USER_DELEGATION_FORM(o,a,l,n.length>0?n[0].id:"all"):Ps.COMMUNITY_EDIT_USER_FORM(o,l,c?.[0]??"all"),replace:!0})})]})},PO=()=>{const{params:{organizationId:e,eventId:t,delegationId:n,userInfoId:s}}=vl(),o=ni(),{data:r,loader:a}=Qn("query UpdateUserInfosEvent(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $userInfoId: UsersInfoId!\n) {\n organization(id: $organizationId) {\n customFields(variety: UserInfo) {\n nodes {\n ...CustomFieldWithCondition\n\n category {\n name\n }\n }\n }\n\n userInfo(id: $userInfoId) {\n id\n isEditable\n userId\n email\n nameOrEmail\n fields\n\n formsUsersInfos(level: Event, eventId: $eventId) {\n formId\n insertedAt\n teamCode\n }\n }\n }\n\n event(id: $eventId) {\n country\n\n forms {\n nodes {\n ...UpdateUserForm\n }\n }\n }\n}\n",{organizationId:e,eventId:t,userInfoId:s},[Vs.CustomFieldWithConditionFragment,Vs.UpdateUserFormFragment]);return a||(r.organization.userInfo.isEditable??1)||o.push(Ps.DASHBOARD(e,t)),a||(0,i.jsx)(DO,{country:r.event.country,data:r,forms:n?r.event.forms.nodes.filter(e=>so(e.delegationsIds)&&e.delegationsIds.includes(n)):r.event.forms.nodes,getEditFormPath:i=>n?Ps.EDIT_USER_DELEGATION_FORM(e,t,n,s,i):Ps.EDIT_USER_FORM(e,t,s,i)})},FO=()=>{const{organizationId:e,delegationId:t,userInfoId:n}=ti(),{data:s,loader:o}=Qn("query UpdateUserInfosOrganization($organizationId: OrganizationId!, $userInfoId: UsersInfoId!) {\n organization(id: $organizationId) {\n country\n\n customFields(variety: UserInfo) {\n nodes {\n ...CustomFieldWithCondition\n\n category {\n name\n }\n }\n }\n\n forms(level: Organization) {\n nodes {\n ...UpdateUserForm\n }\n }\n\n userInfo(id: $userInfoId) {\n id\n userId\n email\n nameOrEmail\n fields\n\n formsUsersInfos(level: Organization) {\n formId\n insertedAt\n teamCode\n }\n }\n }\n}\n",{organizationId:e,userInfoId:n},[Vs.CustomFieldWithConditionFragment,Vs.UpdateUserFormFragment]);return o||(0,i.jsx)(DO,{country:s.organization.country,data:s,forms:t?s.organization.forms.nodes.filter(e=>so(e.delegationsIds)&&e.delegationsIds.includes(t)):s.organization.forms.nodes,getEditFormPath:i=>t?Ps.COMMUNITY_EDIT_USER_DELEGATION_FORM(e,t,n,i):Ps.COMMUNITY_EDIT_USER_FORM(e,n,i)})};var MO;let NO=class extends Gl{static{MO=this}csvInputService;static IMPORT_COLUMNS_DEFAULT={Id:"id"};static IMPORT_COLUMNS_REQUIRED=e=>e===Je.Update?[MO.IMPORT_COLUMNS_DEFAULT.Id]:[];constructor(e,t){super(t),this.csvInputService=e}default(e){return{input:{csv:this.csvInputService.csvDocumentInputDefault(e),mode:Je.Upsert}}}schema(){return d.Ik().shape({input:d.Ik().shape({csv:this.csvInputService.schema(),mode:d.Yj().oneOf(In,this.t("le_mode_d_impor_75706"))})})}};NO=MO=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Cv,qn])],NO);let LO=class extends NO{csvInputService;default(e){return{input:{csv:this.csvInputService.csvDocumentInputDefault(e),mappings:[],presets:[],mode:Je.Upsert,tag:""}}}schema(){return d.Ik().shape({input:d.Ik().shape({csv:this.csvInputService.schema(),mappings:d.YO().of(d.Yj().nullable()),presets:d.YO().of(d.Ik().shape({customFieldId:d.ai().positive(this.t("le_choix_du_typ_07079")),value:d.gl().when("customFieldId",{is:e=>e>-1,then:e=>e.required(this.t("la_valeur_du_ch_65599"))})})),mode:d.Yj().oneOf(In,this.t("le_mode_d_impor_75706")),tag:d.Yj().required("a_tag_must_be_s_23274")})})}settingsStepSchema(){return d.Ik().shape({input:d.Ik().shape({csv:this.csvInputService.schema()})})}mappingStepSchema(){return d.Ik().shape({input:d.Ik().shape({mappings:d.YO().of(d.Yj().nullable()),presets:d.YO().of(d.Ik().shape({customFieldId:d.ai().positive(this.t("le_choix_du_typ_07079")),value:d.gl().when("customFieldId",{is:e=>e>-1,then:e=>e.required(this.t("la_valeur_du_ch_65599"))})})),mode:d.Yj().oneOf(In,this.t("le_mode_d_impor_75706")),tag:d.Yj().required("a_tag_must_be_s_23274")})})}constructor(e,t){super(e,t),this.csvInputService=e}};LO=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Cv,qn])],LO);var BO=n(6632);const VO=e=>{const{params:{organizationId:t},translate:n}=vl(),{data:s,loader:o}=Lo({organizationId:t}),r=qa(),a=(0,L.useMemo)(()=>e.formRenderProps.values.input.csv.file,[e.formRenderProps.values.input.csv]),l=(0,L.useMemo)(()=>{const t=localStorage.getItem(Ul[`${e.localStorageKeyPrefix}_FORMATS`]);return t?JSON.parse(t):t},[e.localStorageKeyPrefix]),d=(0,L.useMemo)(()=>{const t=t=>e.formRenderProps.values.input.csv.formats?.[t]===s.organization?.[t]?(0,i.jsx)(rc,{css:{textTransform:"uppercase"},children:n("from_organisati_25675")}):l?.[t]===e.formRenderProps.values.input.csv.formats?.[t]&&(0,i.jsx)(rc,{css:{textTransform:"uppercase"},children:n("from_saved_22150")});return{datetime:t("datetimeFormat"),date:t("dateFormat"),timeBadge:t("timeFormat")}},[s.organization,l,e.formRenderProps.values.input.csv.formats]),c=Jn(),u="data:text/csv;charset=utf-8,"+[Object.values(e.ImportInputService.IMPORT_COLUMNS_DEFAULT).filter(t=>t!==e.ImportInputService.IMPORT_COLUMNS_DEFAULT.Id),new Array(Object.values(e.ImportInputService.IMPORT_COLUMNS_DEFAULT).length-1)].map(e=>e.join(",")).join("\n");return o||(0,i.jsxs)(Ba,{direction:"column",gap:"8",children:[(0,i.jsx)(FE,{css:{"& header":{borderBlockEnd:"unset",paddingBlockEnd:"unset"}},heading:n("choix_du_fichie_30517"),subtitle:[...c(n("s_lectionnez_vo_53506","{1}"),(0,i.jsx)(Zc,{css:{color:"$primary600"},download:"export-sample-file.csv",to:encodeURI(u),children:n("t_l_charger_un_46976")}))],children:(0,i.jsx)(Yj,{...r,accept:yv.Csv,acl:"private",organizationId:t,prefix:"input.csv.",withFileField:!0,onChange:t=>e.onChange(t,e.formRenderProps)})}),(0,i.jsxs)(FE,{heading:n("param_tres_du_f_01675"),isOpenToggleLabel:n("afficher_les_pa_96893"),subtitle:n("personnaliser_s_29361"),children:[(0,i.jsxs)(ME,{heading:n("type_de_carat_r_62356"),children:[(0,i.jsx)(Vl,{hint:n("laissez_ce_cham_07837"),label:n("d_limitateur_77701"),name:"input.csv.delimiter",state:a?"disabled":void 0}),(0,i.jsx)(Vl,{hint:n("leave_blank_if_02058"),label:n("caract_re_d_ch_56847"),name:"input.csv.quoteChar",state:a?"disabled":void 0}),(0,i.jsxs)(Qj,{hint:n("leave_blank_if_02058"),label:n("caract_re_de_re_71491"),name:"input.csv.newline",state:a?"disabled":void 0,children:[(0,i.jsx)("option",{value:void 0,children:"Auto-detect"}),(0,i.jsx)("option",{value:"\r",children:"\\r"}),(0,i.jsx)("option",{value:"\n",children:"\\n"}),(0,i.jsx)("option",{value:"\r\n",children:"\\r\\n"})]})]}),(0,i.jsxs)(ME,{heading:n("type_de_format_68432"),children:[(0,i.jsx)(Vl,{label:(0,i.jsxs)(Ba,{align:"center",gap:"2",children:[n("format_d_heure_46798"),d.timeBadge]}),name:"input.csv.formats.timeFormat",state:a?"disabled":void 0}),(0,i.jsx)(Vl,{label:(0,i.jsxs)(Ba,{align:"center",gap:"2",children:[n("format_de_date_82059"),d.date]}),name:"input.csv.formats.dateFormat",state:a?"disabled":void 0}),(0,i.jsx)(Vl,{label:(0,i.jsxs)(Ba,{align:"center",gap:"2",children:[n("format_de_date_24474"),d.datetime]}),name:"input.csv.formats.datetimeFormat",state:a?"disabled":void 0})]})]})]})},UO=_r("input",{blockSize:"fit-content",inlineSize:"fit-content"}),WO=(0,L.forwardRef)((e,t)=>(0,i.jsx)(UO,{ref:t,type:"radio",...e}));WO.displayName="Radio";const GO=({children:e,css:t,icon:n,subtext:s,...o})=>{const{inputId:r,descId:a,labelId:l}=qa(),d=(0,L.useRef)(null);return(0,i.jsx)(Ba,{css:{bd:!0,flexGrow:"1",margin:"-1px",cursor:"pointer",'&:has( input[type="radio"]:checked)':{border:"2px solid $primary500"},...t},onClick:()=>d.current?.click(),children:(0,i.jsx)(Ba,{css:{border:"1px solid transparent",padding:"$4",'&:has( input[type="radio"]:checked)':{border:"none"}},children:(0,i.jsxs)(Ba,{gap:"1",children:[(0,i.jsxs)(Ba,{direction:"column",gap:"3",children:[(0,i.jsx)(Ba,{css:{bd:!0,border:"1px solid $gray200",inlineSize:"fit-content"},justify:"start",children:(0,i.jsx)(WC,{css:{color:"$gray800",background:"unset"},icon:n})}),(0,i.jsxs)(Ba,{direction:"column",children:[(0,i.jsx)(Ml,{htmlFor:r,id:l,children:(0,i.jsx)(hl,{css:{fontSize:"$textSm",fontWeight:"$medium"},children:e})}),s&&(0,i.jsx)(hl,{id:a,children:s})]}),(0,i.jsx)(Ba,{css:{flex:"1"}})]}),(0,i.jsx)(WO,{ref:d,"aria-describedby":a,"aria-labelledby":l,id:r,...o})]})})})},HO=({name:e,value:t,...n})=>(0,i.jsx)(Ga.D0,{name:e,render:({input:e})=>(0,i.jsx)(GO,{checked:e.checked,name:e.name,value:t,onChange:e.onChange,...n,children:n.children}),type:"radio",value:t}),qO=e=>{const t=Xn(),n=(0,L.useMemo)(()=>[{id:-1,name:t("default_fields_04920"),fields:Object.entries(e.defaultFields).map(([e,n])=>({name:m(t(e))?t(e):e,slug:n,id:Math.random()}))},...e.categories].map(t=>({...t,fields:(0,uc.A)(t.fields,t=>{const n=t.name.toLowerCase(),i=t.slug.toLowerCase(),s=e.column.name.toLowerCase(),o=Math.min(x(n,s),x(i,s));return o{const s=Object.values(e.defaultFields).find(e=>e===t);return s&&e.requiredFieldSlugs.includes(s)?(0,i.jsx)("strong",{children:n}):n},[e.defaultFields,e.requiredFieldSlugs]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Bl,{state:"disabled",value:e.column.name,onChange:()=>{}}),(0,i.jsx)(nl,{icon:"arrow-right"}),(0,i.jsx)(Ym,{isSearchVisible:!0,multiple:!1,name:`input.mappings.${e.column.index}`,placeholder:t("s_lectionnez_un_12007"),renderValue:s,children:n.map(t=>(0,i.jsx)("optgroup",{label:t.name,children:t.fields.map(t=>(0,i.jsx)("option",{style:{fontWeight:e.requiredFieldSlugs.includes(t.slug)?"bold":"inherit",opacity:e.values.includes(t.slug)?.5:1},value:t.slug,children:t.name},t.id))},t.id))})]})},KO=_r("div",{display:"grid",gridTemplateColumns:"[column] 1fr auto [field] 1fr",gap:"$4 $5",alignItems:"center"}),YO=_r("div",{color:"$gray800",gridColumn:"column",fontWeight:"$medium"}),ZO=_r("div",{color:"$gray800",gridColumn:"field",fontWeight:"$medium"}),XO=({categories:e,columns:t,defaultFields:n,requiredFieldSlugs:s,values:o})=>{const r=Xn();return(0,i.jsxs)(KO,{children:[(0,i.jsx)(YO,{children:r("titres_de_vos_c_31388")}),(0,i.jsx)(ZO,{children:r("champs_de_formu_64126")}),t.map((t,r)=>(0,i.jsx)(qO,{categories:e,column:{name:t,index:r},defaultFields:n,requiredFieldSlugs:s,values:o},r))]})},JO=e=>{const{translate:t}=vl(),{formRenderProps:{values:{input:{mappings:n}}}}=(0,L.useContext)(Ka),s=(0,L.useMemo)(()=>Object.entries(e.defaultFields).filter(([t,i])=>e.requiredFieldSlugs.includes(i)&&!n.includes(i)).map(([e,n])=>m(t(e))?t(e):e),[e.defaultFields,e.requiredFieldSlugs,n]),o=Jn();return(0,i.jsxs)(FE,{css:{"& > header":{borderBlockEnd:"unset",paddingBlockEnd:"unset"}},gap:"5",heading:t("donn_es_de_mapp_98874"),subtitle:t("s_lectionnez_le_13978"),children:[so(s)&&(0,i.jsxs)(gl,{alertStyle:"warning",children:[(0,i.jsx)(pl,{children:t("champ_obligatoi_11498",s.length)}),(0,i.jsx)(fl,{children:[...o(t("to_add_a_1_t_07022",e.itemName?.singular,"{2}"),(0,i.jsx)("ul",{style:{margin:"0",paddingInlineStart:"var(--space-4)"},children:s.map(e=>(0,i.jsx)("li",{children:e},e))}))]})]}),(0,i.jsx)(XO,{...e})]})},QO=({file:e,onToggle:t,...n})=>{const s=Xn();return(0,i.jsx)(FE,{heading:s("attribution_d_u_50979"),isOpen:so(n.values)??!1,isOpenToggleLabel:s("attribuer_autom_74319"),subtitle:s("d_finissez_dire_31742"),children:(0,i.jsx)(ME,{heading:s("liste_des_champ_94862"),children:(0,i.jsx)(iC,{name:"input.presets",...n})})})},eR=(e,t)=>{switch(t.type){case"LOADING":return{isLoading:!0,columns:void 0,errors:void 0};case"SUCCESS":return{isLoading:!1,columns:t.columns,errors:void 0};case"ERROR":return{isLoading:!1,columns:void 0,errors:t.errors}}};function tR(e){const{translate:t}=vl(),{isLoading:n,columns:s,errors:o}=((e,t)=>{const[n,i]=(0,L.useReducer)(eR,{isLoading:!0,columns:void 0,errors:void 0});return(0,L.useEffect)(()=>{i({type:"LOADING"}),(0,vv.parse)(e,{preview:1,...t,complete:({data:e,errors:t})=>{t.filter(e=>"UndetectableDelimiter"!==e.code).length?i({type:"ERROR",errors:t}):i({type:"SUCCESS",columns:e[0]})}})},[e]),n})(e.file,{delimiter:e.values.input.csv.delimiter??void 0,quoteChar:e.values.input.csv.quoteChar??void 0,newline:e.values.input.csv.newline??void 0}),r=(0,L.useMemo)(()=>{const t=Object.entries((0,cc.A)(e.customFields,e=>e.customFieldCategoryId)).map(([e,t])=>{const n=t[0];return{id:n.customFieldCategoryId,name:n.customFieldCategoryName,fields:t}});return e.additionalCategories?t.concat(e.additionalCategories):t},[e.additionalCategories,e.customFields]);return n||o?null:(0,i.jsxs)(i.Fragment,{children:[e.additionalOptions&&(0,i.jsx)(FE,{heading:t("param_tres_d_im_18876"),children:e.additionalOptions}),(0,i.jsx)(JO,{categories:r,columns:s,defaultFields:e.defaultFields,itemName:e.itemName,modeSelection:e.modeSelection,requiredFieldSlugs:e.requiredFieldSlugs,values:e.values.input.mappings}),so(e.customFields)&&(0,i.jsx)(QO,{change:e.form.change,customFields:e.customFields,file:e.file,values:e.values.input.presets,onToggle:e.onToggle})]})}const nR=({showModeSelection:e=!0,...t})=>{const{params:{organizationId:n},translate:s}=vl(),o=(0,L.useRef)(null),r=()=>Gs.c9.now().toFormat(Ks),a=()=>(t.formRenderProps.form.change("input.tag",`${t.importTagPrefix}-csv-${r()}`),setInterval(()=>t.formRenderProps.form.change("input.tag",`${t.importTagPrefix}-csv-${r()}`),1e3)),l=()=>clearInterval(o.current);return(0,L.useEffect)(()=>(o.current=a(),()=>l()),[o]),(0,i.jsxs)(Ba,{direction:"column",gap:"8",children:[e&&(0,i.jsx)(FE,{css:{"& header":{borderBlockEnd:"unset",paddingBlockEnd:"unset"}},gap:"4",heading:s("type_d_action_d_35533"),name:"input.mode",role:"radiogroup",subtitle:s("s_lectionnez_la_32551"),children:(0,i.jsxs)(Ba,{gap:"4",justify:"evenly",children:[(0,i.jsx)(Ba,{css:{flex:"1"},direction:"column",children:(0,i.jsx)(HO,{icon:"user-plus",name:"input.mode",subtext:s("si_plusieurs_1_76274",t.itemName?.plural,t.createUpdateKey?.name,t.itemName?.plural),value:Je.Create,children:s("ajoutez_1_36449",t.itemName?.singular)})}),(0,i.jsx)(Ba,{css:{flex:"1"},direction:"column",children:(0,i.jsx)(HO,{icon:"user-pen",name:"input.mode",subtext:s("si_plusieurs_1_92471",t.itemName?.plural,t.createUpdateKey?.name),value:Je.Upsert,children:s("ajouter_et_mett_05008",t.itemName?.singular)})}),(0,i.jsx)(Ba,{css:{flex:"1"},direction:"column",children:(0,i.jsx)(HO,{icon:"arrows-rotate",name:"input.mode",subtext:s("aucun_1_sera_42731",t.itemName?.singular,t.itemName?.singular),value:Je.Update,children:s("mettre_jour_d_10088",t.itemName?.singular)})})]})}),t.formRenderProps.values.input.csv?.file&&sR(t.formRenderProps.form)&&(0,i.jsx)(tR,{additionalCategories:t.additionalCategories,additionalOptions:t.additionalOptions,customFields:t.customFields,defaultFields:t.ImportInputService.IMPORT_COLUMNS_DEFAULT,file:t.formRenderProps.values.input.csv.file,form:t.formRenderProps.form,itemName:t.itemName,requiredFieldSlugs:t.ImportInputService.IMPORT_COLUMNS_REQUIRED(t.formRenderProps.values.input.mode),values:t.formRenderProps.values,onToggle:e=>{if(!t.formRenderProps.values.input.csv.file)throw new Error("No file in input!");try{e?t.formRenderProps.form.change("input.presets",JSON.parse(localStorage.getItem(Ul[`${t.localStorageKeyPrefix}_PRESETS`](n))??"[]")):t.formRenderProps.form.change("input.presets",[])}catch(e){console.debug(`LocalStorage not available: ${e.toString()}`)}}}),(0,i.jsxs)(FE,{heading:s("identify_your_i_87636"),subtitle:s("by_default_you_75833"),children:[(0,i.jsx)(Vl,{label:s("your_import_tag_41852"),name:"input.tag",state:"disabled"}),!t.isTagInputDisabled&&(0,i.jsx)(Bl,{label:s("specify_an_impo_41868"),onChange:e=>{m(e)?(o.current&&l(),t.formRenderProps.form.change("input.tag",`${t.importTagPrefix}-csv-${e}`)):(t.formRenderProps.form.change("input.tag",`${t.importTagPrefix}-csv-${r()}`),o.current=a())}})]})]})},iR=e=>{const{translate:t}=vl();return(0,i.jsxs)(Ba,{align:"center",css:{alignSelf:"center",maxInlineSize:"640px"},direction:"column",gap:"8",children:[(0,i.jsxs)(Ba,{align:"center",direction:"column",gap:"4",children:[(0,i.jsx)(Ba,{css:{bd:!0,border:"1px solid $gray200",inlineSize:"fit-content"},justify:"start",children:(0,i.jsx)(WC,{css:{color:"$gray800",background:"unset"},icon:"party-horn"})}),(0,i.jsxs)(Ba,{css:{textAlign:"center"},direction:"column",gap:"1",children:[(0,i.jsx)(ml,{children:t("l_importation_e_12369")}),(0,i.jsx)(hl,{textStyle:"subtitle",children:t("_la_fin_du_pro_00757")})]})]}),(0,i.jsxs)(Ba,{gap:"3",children:[(0,i.jsx)(zl,{onClick:()=>window.location.reload(),children:t("nouvel_import_48306")}),e.returnLink]})]})},sR=e=>!!e.getFieldState("input.csv.key")?.valid&&!!e.getFieldState("input.csv.file")?.valid,oR=(0,BO.A)(({ImportInputService:e,columns:t,customFields:n})=>t.map(t=>Object.keys(e.IMPORT_COLUMNS_DEFAULT).map(e=>e.toLowerCase()).includes(t.toLowerCase())?e.IMPORT_COLUMNS_DEFAULT[Object.keys(e.IMPORT_COLUMNS_DEFAULT).find(e=>e.toLowerCase()===t.toLowerCase())]:n.find(e=>e.slug.toLowerCase()===t.toLowerCase()||e.name.toLowerCase()===t.toLowerCase())?.slug??null)),rR=(e,t,n)=>t.formatListValues(e.IMPORT_COLUMNS_REQUIRED(n.mode).filter(e=>!n.mappings.includes(e)),"conjunction"),aR=e=>{const{params:{organizationId:t,eventId:n,delegationId:s},translate:o}=vl();Md(e.heading);const r=Zn(qn),{data:a,loader:l}=Lo({organizationId:t}),d=si(),c=Zn(e.ImportInputService),u=(0,L.useRef)(null),h=(0,L.useMemo)(()=>{try{const t={dateFormat:a.organization.dateFormat,datetimeFormat:a.organization.datetimeFormat,timeFormat:a.organization.timeFormat},n=JSON.parse(d.getItem(Ul[`${e.localStorageKeyPrefix}_FORMATS`])??"{}");return{...t,...n}}catch{return null}},[a.organization]),g=(0,L.useMemo)(()=>{const t=d.getItem(Ul[`${e.localStorageKeyPrefix}_FORMATS`]);return t?JSON.parse(t):t},[e.localStorageKeyPrefix]),p=Zn(LO),f=(0,L.useCallback)((n,i)=>{i.form.change("input.tag",`${e.importTagPrefix}-csv-${Gs.c9.now().toFormat(Ks)}`),(0,vv.parse)(n,{delimiter:i.values.input.csv.delimiter,preview:1,newline:i.values.input.csv.newline,quoteChar:i.values.input.csv.quoteChar,complete:({data:t,errors:n})=>{let s;if(!n.length||1===n.length&&"UndetectableDelimiter"===n[0].code){const n=t[0],o=oR({ImportInputService:e.ImportInputService,columns:n,customFields:e.customFields});try{s=JSON.parse(d.getItem(Ul[`${e.localStorageKeyPrefix}_MAPPINGS`])??"{}")}catch(e){console.debug(`LocalStorage not available: ${e.toString()}`)}i.form.change("input.mappings",n.map((e,t)=>void 0!==s[e]?s[e]:o[t]))}}});try{i.form.change("input.presets",JSON.parse(d.getItem(Ul[`${e.localStorageKeyPrefix}_PRESETS`](t))??"[]")),e.showModeSelection&&i.form.change("input.mode",d.getItem(Ul[`${e.localStorageKeyPrefix}_MODE`])??Je.Upsert)}catch(e){console.debug(`LocalStorage not available: ${e.toString()}`)}},[e.customFields]);return(0,i.jsx)(xl.Provider,{value:{designSystem:"new2025"},children:(0,i.jsx)(Lm,{category:o("nouvel_import_48306"),color:"dark",fallbackClosePath:e.closePath,heading:e.heading,children:(0,i.jsx)(Mm,{ref:u,children:(0,i.jsxs)(vb,{containerRef:u,initialValues:{input:c.default(h).input},isEdit:!1,summaryStep:(0,i.jsx)(iR,{returnLink:e.returnLink}),onSubmit:async({input:i})=>{if(!((e,t)=>e.IMPORT_COLUMNS_REQUIRED(t.mode).every(e=>t.mappings.includes(e)))(e.ImportInputService,i))return{[Va.Ym]:o("you_have_not_ma_46806",rR(e.ImportInputService,r,i))};(n=>{const i=n.csv.file;if(!i)throw new Error("No file in input!");(0,vv.parse)(i,{delimiter:n.csv.delimiter,preview:1,newline:n.csv.newline,quoteChar:n.csv.quoteChar,complete:({data:t,errors:i})=>{if(!i.length)try{const i=t[0],s=oR({ImportInputService:e.ImportInputService,columns:i,customFields:e.customFields}),o=JSON.parse(d.getItem(Ul[`${e.localStorageKeyPrefix}_MAPPINGS`])??"{}"),r={};for(const[e,t]of n.mappings.entries()){const n=i[e];t?r[n]=t:delete o[n],m(s[e])&&!r[n]&&(r[n]=null)}d.setItem(Ul[`${e.localStorageKeyPrefix}_MAPPINGS`],JSON.stringify({...o,...r}))}catch(e){console.debug(`LocalStorage not available: ${e.toString()}`)}}});try{const i=JSON.parse(d.getItem(Ul[`${e.localStorageKeyPrefix}_PRESETS`](t))??"[]");d.setItem(Ul[`${e.localStorageKeyPrefix}_PRESETS`](t),JSON.stringify([...new Map([...i,...n.presets].map(e=>[e.customFieldId,e])).values()])),d.setItem(Ul[`${e.localStorageKeyPrefix}_FORMATS`],JSON.stringify(n.csv.formats?Object.fromEntries(Object.entries(n.csv.formats).filter(([e,t])=>m(t))):{})),e.showModeSelection&&d.setItem(Ul[`${e.localStorageKeyPrefix}_MODE`],n.mode)}catch(e){console.debug(`LocalStorage not available: ${e.toString()}`)}})(i);const a=(e=>{const t={...e.csv};return delete t.file,{...e,csv:t}})(i);try{const{jobId:i}=await e.mutate({organizationId:t,eventId:n,delegationId:s,input:a});e.checkImport(i,t,n)}catch{}},children:[(0,i.jsx)(Ib,{actions:t=>(0,i.jsxs)(Ba,{gap:"3",children:[(0,i.jsx)(zl,{disabled:!sR(t.form),onClick:t.handleSubmit,children:o("suivant_donn_08625")}),g&&(0,i.jsx)(zl,{color:"invisible-gray",onClick:()=>{d.removeItem(Ul[`${e.localStorageKeyPrefix}_FORMATS`]),window.location.reload()},children:o("clear_saved_set_61259")})]}),heading:o("choix_du_fichie_30517"),render:t=>(0,i.jsx)(VO,{ImportInputService:e.ImportInputService,formRenderProps:t,localStorageKeyPrefix:e.localStorageKeyPrefix,onChange:f}),schema:p.settingsStepSchema()}),(0,i.jsx)(Ib,{actions:e=>(0,i.jsx)(zl,{type:"submit",onClick:e.handleSubmit,children:o("importer_90688")}),heading:o("donn_es_impor_12371"),render:t=>(0,i.jsx)(nR,{ImportInputService:e.ImportInputService,additionalCategories:e.additionalCategories,additionalOptions:e.additionalOptions,createUpdateKey:e.createUpdateKey,customFields:e.customFields,formRenderProps:t,importTagPrefix:e.importTagPrefix,isTagInputDisabled:e.isTagInputDisabled,itemName:e.itemName,localStorageKeyPrefix:e.localStorageKeyPrefix,showModeSelection:e.showModeSelection}),schema:c.mappingStepSchema()})]})})})})};var lR;let dR=class extends LO{static{lR=this}csvInputService;static IMPORT_COLUMNS_DEFAULT={...LO.IMPORT_COLUMNS_DEFAULT,Email:"email",TicketId:"ticketId"};static IMPORT_COLUMNS_REQUIRED=e=>e===Je.Update?[lR.IMPORT_COLUMNS_DEFAULT.Id]:[lR.IMPORT_COLUMNS_DEFAULT.Email];constructor(e,t){super(e,t),this.csvInputService=e}};dR=lR=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Cv,qn])],dR);const cR=({accreditations:e,closePath:t,customFields:n})=>{const{params:{organizationId:s,eventId:o},translate:r}=vl(),a=Zn(Jc),{mutate:l}=function(e={}){return ei("mutation VolunteersImport(\n $eventId: EventId\n $organizationId: OrganizationId!\n $delegationId: DelegationId\n $input: MappableImportInput!\n) {\n jobId: volunteersImport(\n eventId: $eventId\n organizationId: $organizationId\n delegationId: $delegationId\n input: $input\n )\n}\n",e)}(),{checkVolunteersImport:d}=Ob(),c=(0,L.useMemo)(()=>e.map(e=>({...e,fields:e.slots.map(t=>({id:t.id,slug:`accreditation_slot_${t.id}`,name:Dh(a,t,e.name,{accreditation:{includeNameAtEnd:!0}})}))})),[e]);return(0,i.jsx)(aR,{ImportInputService:dR,additionalCategories:c,checkImport:d,closePath:t,createUpdateKey:{slug:"email",name:r("email_address_53451")},customFields:n,heading:r("import_de_membr_48618"),importTagPrefix:"volunteers",itemName:{singular:r("membre_53723"),plural:r("membres_67337")},localStorageKeyPrefix:"VOLUNTEERS_IMPORT",mutate:l,returnLink:(0,i.jsx)(Zc,{to:o?Ps.VOLUNTEERS(s,o):wi.COMMUNITY_USERS({organizationId:s}),children:r("revenir_aux_mem_33379")})})},uR=()=>{const{params:{organizationId:e}}=vl(),{data:t,loader:n}=Xr({organizationId:e,variety:je.UserInfo});return n||(0,i.jsx)(cR,{accreditations:[],closePath:wi.COMMUNITY_USERS({organizationId:e}),customFields:t.organization.customFields.nodes})},hR=()=>{const{params:{organizationId:e,eventId:t}}=vl(),{data:n,loader:s}=Qn("query EventVolunteersImportInfos(\n $organizationId: OrganizationId!\n $variety: CustomFieldVariety!\n $eventId: EventId!\n) {\n organization(id: $organizationId) {\n customFields(\n variety: $variety\n fieldTypes: [\n Address\n Checkbox\n Country\n Date\n Datetime\n Language\n Nationality\n Number\n Phone\n Select\n Sex\n Text\n Textarea\n Time\n Validation\n ]\n ) {\n nodes {\n ...CustomFieldImport\n }\n }\n }\n\n event(id: $eventId) {\n accreditations {\n nodes {\n ...AccreditationImport\n }\n }\n }\n}\n",{organizationId:e,variety:je.UserInfo,eventId:t},[Vs.CustomFieldImportFragment,Vs.AccreditationImportFragment]);return s||(0,i.jsx)(cR,{accreditations:n.event.accreditations.nodes,closePath:Ps.VOLUNTEERS(e,t),customFields:n.organization.customFields.nodes})};let mR=class extends Gl{constructor(e){super(e)}workflowInputDefault(e){return{name:e?.name??"",state:e?.state??Ut.Active,frequency:e?.frequency??Lt.Every10Minutes,trigger:e?.trigger??Wt.VolunteersSegment,action:e?.action??Nt.SetCustomField,data:(0,yb.A)({recipients:Bt.View},e?.data??{})}}workflowInputSchema(){return d.Ik().shape({name:d.Yj().required(this.t("le_nom_est_requ_61536")),state:d.Yj().required(this.t("le_statut_est_r_13164")).oneOf(Bn,this.t("le_statut_est_r_13164")),action:d.Yj().required(this.t("l_action_est_re_08934")).oneOf(Nn,this.t("l_action_est_re_08934")),trigger:d.Yj().required(this.t("le_d_clencheur_32555")).oneOf(Vn,this.t("le_d_clencheur_32555")),data:d.gl().required().test("positions-valid",this.t("les_missions_so_67594"),function(){return this.parent.trigger!==Wt.Assigned||so(this.parent.data.positionsCategoriesIds)||so(this.parent.data.positionsIds)||so(this.parent.data.positionsSlotsIds)||so(this.parent.data.positionsSegmentsIds)}).test("volunteers-segment-id-valid",this.t("la_vue_est_requ_65480"),function(){return this.parent.trigger!==Wt.VolunteersSegment||Number.isInteger(this.parent.data.volunteersSegmentId)}).test("form-id-valid",this.t("le_formulaire_e_77404"),function(){return this.parent.trigger!==Wt.FormSubmit||Number.isInteger(this.parent.data.formId)}).test("campaign-id-valid",this.t("la_campagne_est_06708"),function(){return this.parent.trigger!==Wt.VolunteersSegment||this.parent.action!==Nt.SendCampaign||Number.isInteger(this.parent.data.campaignId)}).test("campaign-recipients-valid",this.t(this.t("les_destinatair_82420")),function(){return this.parent.trigger!==Wt.VolunteersSegment||this.parent.action!==Nt.SendCampaign||Ln.includes(this.parent.data.recipients)}).test("campaign-recipients-users-infos",this.t("la_liste_des_me_55886"),function(){return this.parent.trigger!==Wt.VolunteersSegment||this.parent.action!==Nt.SendCampaign||this.parent.data.recipients!==Bt.UsersInfosIds||so(this.parent.data.usersInfosIds)}).test("custom-field-id-valid",this.t("le_champ_person_80074"),function(){return this.parent.trigger===Wt.VolunteersSegment&&this.parent.action===Nt.SetCustomField?Number.isInteger(this.parent.data.customFieldId):this.parent.trigger!==Wt.FormSubmit||this.parent.action!==Nt.CreateDelegation||Number.isInteger(this.parent.data.customFieldId)}).test("accreditations-valid",this.t("les_accr_ditati_27943"),function(){return this.parent.trigger!==Wt.Assigned&&(this.parent.trigger!==Wt.VolunteersSegment||this.parent.action!==Nt.AddAccreditations&&this.parent.action!==Nt.DeleteAccreditations)||so(this.parent.data.accreditationsSlotsIds)}).test("delegation-id-valid",this.t("la_d_l_gation_c_71684"),function(){return this.parent.trigger!==Wt.FormSubmit||this.parent.action!==Nt.CreateDelegation||Number.isInteger(this.parent.data.delegationId)}).test("event-id-valid",this.t("l_v_nement_est_88155"),function(){return this.parent.trigger!==Wt.VolunteersSegment||this.parent.action!==Nt.AddEvent||Number.isInteger(this.parent.data.eventId)})})}};mR=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[qn])],mR);const gR=e=>(0,i.jsxs)(Ba,{css:{background:"white",bd:!0,padding:"$4",width:"min($container, 100%)"},direction:"column",gap:"5",children:[(0,i.jsxs)(Ba,{css:{borderBottom:"1px solid $gray200",paddingBottom:"$3"},gap:"3",width:1,children:[(0,i.jsx)(WC,{color:"gray",icon:e.icon}),(0,i.jsxs)(Ba,{direction:"column",children:[(0,i.jsx)(Ar,{font:"gray500 textXs regular",children:e.category}),(0,i.jsx)(Ar,{font:"gray800 textSm medium",children:e.title})]})]}),(0,i.jsx)(Ba,{direction:"column",gap:"4",width:1,children:e.children})]}),pR=e=>{const{translate:t,params:{eventId:n}}=vl(),{hasFeature:s}=TI(),{event:o}=wb(),r=(!o||o.useCampaigns)&&e.workflow.trigger===Wt.VolunteersSegment,a=e.workflow.trigger===Wt.VolunteersSegment,l=!!n&&s(Be.Accreditation)&&(o?.useAccreditations??!1)&&(e.workflow.trigger===Wt.Assigned||e.workflow.trigger===Wt.VolunteersSegment),d=!!n&&s(Be.Accreditation)&&(o?.useAccreditations??!1)&&e.workflow.trigger===Wt.VolunteersSegment,c=s(Be.Delegation)&&e.workflow.trigger===Wt.FormSubmit,u=!n&&e.workflow.trigger===Wt.VolunteersSegment,h=!!n&&e.workflow.trigger===Wt.VolunteersSegment;return(0,i.jsx)(gR,{category:t("action_s_lectio_18617"),icon:"lasso-sparkles",title:t("alors_automatiq_16268"),children:(0,i.jsxs)(Ym,{isSearchVisible:!0,name:"workflow.action",placeholder:t("choisir_une_act_51814"),state:e.isEdit?"disabled":"active",children:[r&&(0,i.jsx)("option",{value:Nt.SendCampaign,children:t("SendCampaign")}),a&&(0,i.jsx)("option",{value:Nt.SetCustomField,children:t("SetCustomField")}),l&&(0,i.jsx)("option",{value:Nt.AddAccreditations,children:t("AddAccreditations")}),d&&(0,i.jsx)("option",{value:Nt.DeleteAccreditations,children:t("DeleteAccreditations")}),c&&(0,i.jsx)("option",{value:Nt.CreateDelegation,children:t("cr_er_une_d_l_g_23035")}),u&&(0,i.jsx)("option",{value:Nt.AddEvent,children:t("ajouter_sur_un_56178")}),h&&(0,i.jsx)("option",{value:Nt.DuplicateMember,children:t("DuplicateMember")})]})})},fR=()=>{const{translate:e,params:{eventId:t}}=vl(),n=Zn(Jc),{data:s}=Qn("query WorkflowAccreditations($eventId: EventId!) {\n event(id: $eventId) {\n accreditations {\n nodes {\n id\n name\n\n slots(includeHidden: true) {\n id\n name\n date\n }\n }\n }\n }\n}\n",{eventId:t},[]),o=(0,L.useMemo)(()=>(s.event?.accreditations.nodes??[]).map(e=>(0,i.jsx)("optgroup",{label:e.name,children:Nh(e.slots).map(t=>{const s=Dh(n,t,e.name,{accreditation:{includeNameAtEnd:!0}});return(0,i.jsx)("option",{value:t.id,children:s},t.id)})},e.id)),[s.event]);return(0,i.jsx)(gR,{category:e("liste_des_accr_02647"),icon:"badge-check",title:e("les_accr_ditati_19289"),children:(0,i.jsx)(Ym,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"workflow.data.accreditationsSlotsIds",children:o})})},_R=()=>{const{translate:e,params:{organizationId:t}}=vl(),{data:n}=Qn("query WorkflowEvents($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n events {\n nodes {\n id\n name\n }\n }\n }\n}\n",{organizationId:t},[]);return(0,i.jsx)(gR,{category:e("liste_des_v_ne_29929"),icon:"plus",title:e("l_v_nement_sui_45117"),children:(0,i.jsx)(Ym,{isSearchVisible:!0,name:"workflow.data.eventId",placeholder:e("choisir_un_v_n_58535"),children:(n.organization?.events.nodes??[]).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})})},xR=e=>{const{translate:t,params:{organizationId:n}}=vl(),[s,o,r]=Wc(""),{usersInfosOptions:a,isLoading:l}=Xb({organizationId:n,eventId:null,hasSelected:so(e.workflow.data.usersInfosIds),nameDebounced:o,userInfoIds:e.workflow.data.usersInfosIds||[]});return(0,i.jsxs)(gR,{category:t("destinataires_19592"),icon:"users",title:t("aux_membres_sui_99877"),children:[(0,i.jsxs)(Ym,{name:"workflow.data.recipients",children:[(0,i.jsx)("option",{value:Bt.View,children:t("aux_membres_de_71046")}),(0,i.jsx)("option",{value:Bt.DelegationsLeaders,children:t("aux_responsable_38147")}),(0,i.jsx)("option",{value:Bt.PositionsLeaders,children:t("aux_responsable_85620")}),(0,i.jsx)("option",{value:Bt.UsersInfosIds,children:t("_certains_memb_91094")})]}),e.workflow.data.recipients===Bt.UsersInfosIds&&(0,i.jsx)(Ym,{isSearchLoading:l,isSearchVisible:!0,label:t("liste_des_membr_89037"),multiple:!0,name:"workflow.data.usersInfosIds",searchElement:(0,i.jsx)(Bl,{icon:"magnifying-glass",name:s,placeholder:t("rechercher_un_m_05904"),state:"search",onChange:r}),children:a})]})},IR=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=vl(),{data:o}=Qn("query WorkflowsDelegations(\n $organizationId: OrganizationId!\n $eventId: EventId\n $level: OrganizationEventLevel!\n $formId: FormId!\n) {\n organization(id: $organizationId) {\n delegations(level: $level, eventId: $eventId) {\n nodes {\n id\n name\n }\n }\n\n form(id: $formId) {\n elements {\n customField {\n id\n name\n fieldType\n }\n }\n }\n }\n}\n",{organizationId:n,eventId:s,level:s?ot.Event:ot.Organization,formId:e.workflow.data.formId},[]);const r=(0,L.useMemo)(()=>o.organization?.delegations.nodes??[],[o.organization]),a=(0,L.useMemo)(()=>(o.organization?.form.elements??[]).flatMap(e=>e.customField?.fieldType===We.Text?[e.customField]:[]),[o.organization]);return(0,i.jsxs)(gR,{category:t("liste_des_d_l_g_86270"),icon:"users",title:t("la_d_l_gation_s_46776"),children:[(0,i.jsx)(Ym,{isSearchVisible:!0,label:t("d_l_gation_ut_74409"),name:"workflow.data.delegationId",placeholder:t("choisir_une_d_l_57897"),children:r.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(Ym,{isSearchVisible:!0,label:t("champ_utilise_04526"),name:"workflow.data.customFieldId",placeholder:t("choisir_un_cham_05690"),children:a.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})]})},vR=e=>{const{translate:t,params:{organizationId:n}}=vl(),{data:s}=$a({organizationId:n});return(0,i.jsx)(gR,{category:t("param_tres_du_n_85818"),icon:"user",title:t("on_duplique_le_59761"),children:(0,i.jsx)(Ba,{direction:"column",children:(0,i.jsx)(iC,{change:e.change,customFields:s.organization?.customFields.nodes??[],name:"workflow.data.customFields",values:e.workflow.data.customFields||[]})})})},bR=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=vl(),{data:o}=Qn("query WorkflowForms(\n $organizationId: OrganizationId!\n $eventId: EventId\n $level: OrganizationEventLevel!\n) {\n organization(id: $organizationId) {\n forms(level: $level, eventId: $eventId) {\n nodes {\n id\n name\n }\n }\n }\n}\n",{organizationId:n,eventId:s,level:s?ot.Event:ot.Organization},[]);return(0,i.jsx)(gR,{category:t("liste_des_formu_69259"),icon:"file-lines",title:t("un_formulaire_p_61128"),children:(0,i.jsx)(Ym,{isSearchVisible:!0,name:"workflow.data.formId",placeholder:t("choisir_un_form_18905"),state:e.isEdit?"disabled":"active",children:(o.organization?.forms.nodes??[]).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})})},jR=e=>{const{translate:t,params:{eventId:n}}=vl(),s=Zn(ph),{data:o}=Qn("query WorkflowPositions($eventId: EventId!) {\n event(id: $eventId) {\n positionsCategories {\n id\n name\n\n positions {\n id\n name\n\n slots {\n id\n name\n range\n }\n }\n }\n\n segmentsFolders(segmentType: Positions) {\n id\n name\n\n segments {\n id\n name\n }\n }\n }\n}\n",{eventId:n},[]),r=(0,L.useMemo)(()=>(0,uc.A)(o.event?.positionsCategories??[],e=>e.name.toLowerCase()).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id)),[o.event]),a=(0,L.useMemo)(()=>(0,uc.A)(o.event?.positionsCategories??[],e=>e.name.toLowerCase()).map(e=>(0,i.jsx)("optgroup",{label:e.name,children:(0,uc.A)(e.positions,e=>e.name.toLowerCase()).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},e.id)),[o.event]),l=(0,L.useMemo)(()=>(o.event?.positionsCategories??[]).flatMap(e=>(0,uc.A)(e.positions,e=>e.name.toLowerCase()).map(e=>(0,i.jsx)("optgroup",{label:e.name,children:(0,uc.A)(e.slots,e=>e.range.start.toMillis()).map(t=>{const n=Ch(s,t,e.name,{position:{includeNameAtEnd:!0},slot:{includeRange:!0}});return(0,i.jsx)("option",{value:t.id,children:n},t.id)})},e.id))),[o.event]),d=(0,L.useMemo)(()=>(o.event?.segmentsFolders??[]).map(e=>(0,i.jsx)("optgroup",{label:e.name,children:e.segments.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},e.id)),[o.event]);return(0,i.jsxs)(gR,{category:t("liste_des_missi_82050"),icon:"sitemap",title:t("une_mission_par_94044"),children:[(0,i.jsx)(Ym,{isSearchVisible:!0,isSelectAllVisible:!0,label:t("est_affect_u_18005"),multiple:!0,name:"workflow.data.positionsCategoriesIds",placeholder:t("choisir_une_cat_82874"),state:e.isEdit?"disabled":"active",children:r}),(0,i.jsx)(Ym,{isSearchVisible:!0,isSelectAllVisible:!0,label:t("est_affect_u_40348"),multiple:!0,name:"workflow.data.positionsIds",placeholder:t("choisir_une_mis_90627"),state:e.isEdit?"disabled":"active",children:a}),(0,i.jsx)(Ym,{isSearchVisible:!0,isSelectAllVisible:!0,label:t("est_affect_u_82271"),multiple:!0,name:"workflow.data.positionsSlotsIds",placeholder:t("choisir_un_cr_n_50945"),state:e.isEdit?"disabled":"active",children:l}),(0,i.jsx)(Ym,{isSearchVisible:!0,isSelectAllVisible:!0,label:t("est_affect_u_31860"),multiple:!0,name:"workflow.data.positionsSegmentsIds",placeholder:t("choisir_une_vue_98781"),state:e.isEdit?"disabled":"active",children:d})]})},CR=()=>{const{translate:e,params:{organizationId:t,eventId:n}}=vl(),{data:s}=Qn("query WorkflowCampaigns(\n $organizationId: OrganizationId!\n $eventId: EventId\n $level: OrganizationEventLevel!\n) {\n organization(id: $organizationId) {\n campaigns(level: $level, eventId: $eventId, states: [Template]) {\n nodes {\n id\n name\n }\n }\n }\n}\n",{organizationId:t,eventId:n,level:n?ot.Event:ot.Organization},[]);return(0,i.jsx)(gR,{category:e("liste_des_campa_60034"),icon:"paper-plane",title:e("la_campagne_sui_83193"),children:(0,i.jsx)(Ym,{isSearchVisible:!0,name:"workflow.data.campaignId",placeholder:e("choisir_une_cam_60181"),children:(s.organization?.campaigns.nodes??[]).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})})},yR=e=>{const{translate:t,params:{organizationId:n}}=vl(),{data:s}=$a({organizationId:n}),o=(0,L.useMemo)(()=>s.organization?.customFields.nodes??[],[s.organization]),r=o.find(t=>t.id===e.workflow.data.customFieldId);return(0,i.jsxs)(gR,{category:t("liste_des_champ_94862"),icon:"text",title:t("le_champ_suivan_27303"),children:[(0,i.jsx)(Ym,{isSearchVisible:!0,label:t("CustomField"),name:"workflow.data.customFieldId",placeholder:t("choisir_un_cham_67587"),children:o.map(e=>(0,i.jsx)("option",{"data-subtext":e.label,value:e.id,children:e.name},e.id))}),r&&(0,i.jsxs)(Ba,{direction:"column",gap:"1",children:[(0,i.jsx)(Ar,{font:"gray700 textSm medium",children:t("nouvelle_valeur_39039",r.name)}),(0,i.jsx)(eC,{campaigns:[],categories:[],change:e.change,customDocuments:[],customField:r,forms:[],name:"workflow.data.customFieldValue",slug:r.slug,tags:[],traces:[],value:e.workflow.data?.customFieldValue})]})]})},kR=e=>{const{translate:t,params:{eventId:n}}=vl(),{hasFeature:s}=TI(),{event:o}=wb(),r=!!n&&(o?.usePositions??!1)&&(o?.useAccreditations??!1)&&s(Be.Accreditation),a=(o?.useForms??!0)&&(o?.useDelegations??!0)&&s(Be.Delegation);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Nr.Yr,{name:"workflow.trigger",children:t=>{t===Wt.Assigned?e.change("workflow.action",Nt.AddAccreditations):t===Wt.FormSubmit?e.change("workflow.action",Nt.CreateDelegation):e.change("workflow.action",Nt.SetCustomField)}}),(0,i.jsx)(gR,{category:t("initialisation_38640"),icon:"hand-sparkles",title:t("quand_le_membre_51578"),children:(0,i.jsxs)(Ym,{isSearchVisible:!0,name:"workflow.trigger",placeholder:t("choisir_un_d_cl_85012"),state:e.isEdit?"disabled":"active",children:[r&&(0,i.jsx)("option",{value:Wt.Assigned,children:t("est_affect_93543")}),a&&(0,i.jsx)("option",{value:Wt.FormSubmit,children:t("rempli_un_formu_11513")}),(0,i.jsx)("option",{value:Wt.VolunteersSegment,children:t("VolunteersSegment")})]})})]})},AR=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=vl(),{data:o}=Qn("query WorkflowVolunteersSegments(\n $organizationId: OrganizationId!\n $eventId: EventId\n $level: OrganizationEventLevel!\n) {\n organization(id: $organizationId) {\n segmentsFolders(level: $level, segmentType: Volunteers, eventId: $eventId) {\n id\n name\n\n segments {\n id\n name\n }\n }\n }\n}\n",{organizationId:n,eventId:s,level:s?ot.Event:ot.Organization},[]);return(0,i.jsx)(gR,{category:t("liste_des_membr_89037"),icon:"user-group",title:t("une_vue_parmi_l_98342"),children:(0,i.jsx)(Ym,{isSearchVisible:!0,name:"workflow.data.volunteersSegmentId",placeholder:t("choisir_une_vue_98781"),state:e.isEdit?"disabled":"active",children:(o.organization?.segmentsFolders??[]).map(e=>(0,i.jsx)("optgroup",{label:e.name,children:e.segments.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},e.id))})})},wR=()=>(0,i.jsx)(Ba,{height:32,justify:"center",width:1,children:(0,i.jsx)(Ar,{css:{borderRight:"1px solid $gray200"},height:1})}),SR=e=>{const{translate:t}=vl(),n=e.workflow.data,s=e.workflow.trigger===Wt.VolunteersSegment,o=e.workflow.trigger===Wt.Assigned,r=e.workflow.trigger===Wt.FormSubmit,a=e.workflow.trigger===Wt.VolunteersSegment&&"number"==typeof n.volunteersSegmentId||e.workflow.trigger===Wt.Assigned&&(so(n.positionsCategoriesIds)||so(n.positionsIds)||so(n.positionsSlotsIds)||so(n.positionsSegmentsIds))||e.workflow.trigger===Wt.FormSubmit&&"number"==typeof n.formId,l=a&&e.workflow.trigger===Wt.VolunteersSegment&&e.workflow.action===Nt.SendCampaign,d=l&&"number"==typeof e.workflow.data.campaignId,c=a&&e.workflow.trigger===Wt.VolunteersSegment&&e.workflow.action===Nt.SetCustomField,u=a&&e.workflow.action===Nt.AddAccreditations,h=a&&e.workflow.action===Nt.DeleteAccreditations,m=a&&e.workflow.action===Nt.CreateDelegation,g=a&&e.workflow.action===Nt.AddEvent,p=a&&e.workflow.action===Nt.DuplicateMember,f=l||c||u||m||g;return(0,i.jsxs)(Ba,{align:"center",direction:"column",children:[(0,i.jsx)(jl,{}),e.workflow.state===Ut.Error&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(rl,{color:"warning",leftIcon:"circle-exclamation",width:"min($container, 100%)",children:[(0,i.jsx)(Ar,{children:t("une_erreur_est_38715")}),(0,i.jsx)(Ar,{fontWeight:"regular",children:e.workflow.data.errorMessage})]}),(0,i.jsx)(Ya,{height:"6"})]}),(0,i.jsx)(Ba,{css:{background:"white",bd:!0,borderRadius:"50px",padding:"$2 $4"},children:(0,i.jsx)(Ar,{font:"gray800 textSm medium",children:t("d_but_41840")})}),(0,i.jsx)(wR,{}),(0,i.jsx)(kR,{change:e.change,isEdit:e.isEdit}),s&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(wR,{}),(0,i.jsx)(AR,{hasBeenExecuted:e.hasBeenExecuted,isEdit:e.isEdit})]}),o&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(wR,{}),(0,i.jsx)(jR,{isEdit:e.isEdit})]}),r&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(wR,{}),(0,i.jsx)(bR,{isEdit:e.isEdit})]}),a&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(wR,{}),(0,i.jsx)(pR,{isEdit:e.isEdit,workflow:e.workflow})]}),l&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(wR,{}),(0,i.jsx)(CR,{})]}),d&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(wR,{}),(0,i.jsx)(xR,{workflow:e.workflow})]}),c&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(wR,{}),(0,i.jsx)(yR,{change:e.change,workflow:e.workflow})]}),(u||h)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(wR,{}),(0,i.jsx)(fR,{})]}),m&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(wR,{}),(0,i.jsx)(IR,{workflow:e.workflow})]}),g&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(wR,{}),(0,i.jsx)(_R,{})]}),p&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(wR,{}),(0,i.jsx)(vR,{change:e.change,workflow:e.workflow})]}),f&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(wR,{}),(0,i.jsx)(Ba,{css:{background:"white",bd:!0,borderRadius:"50px",padding:"$2 $4"},children:(0,i.jsx)(Ar,{font:"gray800 textSm medium",children:t("fin_60104")})})]})]})},ER=L.forwardRef((e,t)=>{const{history:n,translate:s,params:{organizationId:o,eventId:r}}=vl(),{user:a}=ai(),l=Bc(),[d,c]=L.useState(!1),u=L.useCallback(()=>{JSON.stringify(e.workflow)===e.initialValuesString?n.goBack(nv.WORKFLOWS({organizationId:o,eventId:r})):c(!0)},[e.workflow,e.initialValuesString,c]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Lm,{button:(0,i.jsx)(Kb,{permissions:Hb.WORKFLOW_EDIT,children:(0,i.jsx)(zl,{isLoading:e.submitting,onClick:e.handleSubmit,children:e.isEdit?s("mettre_jour_l_18144"):s("cr_er_l_automat_04638")})}),category:e.category,color:"dark",heading:e.isEdit?e.name:s("nouvelle_automa_77863"),onClose:u,children:(0,i.jsxs)(Ba,{height:1,children:[(0,i.jsxs)(Ba,{css:{background:"white",padding:"$6"},direction:"column",gap:"7",width:420,children:[(0,i.jsx)(Ar,{font:"gray800 textMd medium",children:s("param_tres_de_l_25166")}),(0,i.jsxs)(Ba,{direction:"column",gap:"4",children:[(0,i.jsx)(Vl,{label:s("nom_de_l_automa_04883"),name:"workflow.name"}),(0,i.jsx)(Qj,{label:s("status_06428"),name:"workflow.state",children:l(Bn.filter(e=>e!==Ut.Error))}),qc(a.email)&&r&&(0,i.jsxs)(Qj,{label:s("fr_quence_43547"),name:"workflow.frequency",children:[(0,i.jsx)("option",{value:Lt.Every10Minutes,children:s(Lt.Every10Minutes)}),(0,i.jsx)("option",{value:Lt.Every5Minutes,children:s(Lt.Every5Minutes)}),(0,i.jsx)("option",{value:Lt.Every2Minutes,children:s(Lt.Every2Minutes)}),(0,i.jsx)("option",{value:Lt.EveryMinute,children:s(Lt.EveryMinute)})]})]})]}),(0,i.jsx)(Ba,{ref:t,css:{background:"$gray50",flex:"1",overflowY:"auto",padding:"$8"},direction:"column",height:1,children:(0,i.jsx)(SR,{change:e.change,hasBeenExecuted:e.hasBeenExecuted,isEdit:e.isEdit,workflow:e.workflow})})]})}),(0,i.jsx)(eE,{fallbackPath:nv.WORKFLOWS({organizationId:o,eventId:r}),isOpen:d,onClose:()=>c(!1)})]})});ER.displayName="UpdateWorkflowForm";const TR=e=>{const{history:t,translate:n,params:{organizationId:s,eventId:o}}=vl(),{showNotification:r}=Ob(),a=(0,L.useRef)(null),l=Zn(Ua),d=Zn(mR),[c,u]=(0,L.useState)(""),h=(0,L.useMemo)(()=>e.isEdit?n("mise_jour_de_17055",e.initialValues.name??""):n("cr_ation_d_une_01202"),[e.initialValues]);return Md(h),(0,L.useEffect)(()=>{u(JSON.stringify(e.initialValues))},[e.initialValues]),(0,i.jsx)(kl,{customErrorRef:a,height:1,initialValues:{workflow:e.initialValues},render:({form:t,handleSubmit:n,submitting:s,values:o})=>(0,i.jsx)(ER,{ref:a,category:h,change:t.change,handleSubmit:n,hasBeenExecuted:e.hasBeenExecuted,initialValuesString:c,isEdit:e.isEdit,name:e.initialValues.name,submitting:s,workflow:o.workflow}),validate:e=>l.validateForForm(d.workflowInputSchema())(e.workflow),width:1,onSubmit:async i=>{await e.mutate(i.workflow),r(e.isEdit?n("l_automatisatio_62036"):n("l_automatisatio_19124")),t.push(nv.WORKFLOWS({organizationId:s,eventId:o}))}})},zR=()=>{const{params:{organizationId:e,eventId:t}}=vl(),n=Zn(mR),{mutate:s}=function(e={}){return ei("mutation WorkflowCreate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $workflow: WorkflowInput!\n) {\n workflowCreate(organizationId: $organizationId, eventId: $eventId, workflow: $workflow) {\n id\n }\n}\n",e)}(),o=(0,L.useMemo)(()=>n.workflowInputDefault(),[]);return(0,i.jsx)(TR,{hasBeenExecuted:!1,initialValues:o,isEdit:!1,mutate:n=>s({organizationId:e,eventId:t,workflow:n})})},OR=()=>{const{params:{organizationId:e,eventId:t,workflowId:n}}=vl(),s=Zn(mR),{mutate:o}=function(e={}){return ei("mutation WorkflowUpdate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $workflowId: WorkflowId!\n $workflow: WorkflowInput!\n) {\n workflowUpdate(\n organizationId: $organizationId\n eventId: $eventId\n workflowId: $workflowId\n workflow: $workflow\n ) {\n id\n }\n}\n",e)}(),{data:r,loader:a}=Qn("query Workflow($organizationId: OrganizationId!, $workflowId: WorkflowId!) {\n organization(id: $organizationId) {\n workflow(id: $workflowId) {\n id\n name\n frequency\n state\n action\n trigger\n hasBeenExecuted\n\n data {\n accreditationsSlotsIds\n campaignId\n customFieldId\n customFieldValue\n customFields\n delegationId\n errorMessage\n eventId\n formId\n positionsCategoriesIds\n positionsIds\n positionsSegmentsIds\n positionsSlotsIds\n recipients\n usersInfosIds\n volunteersSegmentId\n }\n }\n }\n}\n",{organizationId:e,workflowId:n},[]),l=(0,L.useMemo)(()=>s.workflowInputDefault(r.organization?.workflow),[r.organization]);return a||(0,i.jsx)(TR,{hasBeenExecuted:r.organization?.workflow.hasBeenExecuted,initialValues:l,isEdit:!0,mutate:i=>o({organizationId:e,eventId:t,workflowId:n,workflow:i})})};var RR;function $R(e){return{includeAccreditations:e.includes(RR.Accreditations),includeCampaign:e.includes(RR.Campaign),includeCustomField:e.includes(RR.CustomField)}}!function(e){e.Accreditations="accreditations",e.Action="Action",e.Campaign="campaign",e.CreatedAt="createdAt",e.CreatedBy="createdBy",e.CustomField="customField",e.ExecutedAt="executedAt",e.Id="id",e.Name="name",e.State="state",e.Trigger="trigger",e.VolunteersSegment="volunteersSegment"}(RR||(RR={}));class DR extends _u{constructor(e,t,n){super(e,t,n)}getWorkflowsFilters(e,t){return[{slug:RR.State,name:this.t("status_06428"),category:this.t("automatisations_60045"),fieldType:He.Select,hideEmpty:!0,values:Bn.map(e=>({id:e,name:this.t(e)}))},{slug:RR.Trigger,name:this.t("d_clencheur_73493"),category:this.t("automatisations_60045"),fieldType:He.Select,hideEmpty:!0,values:Vn.map(e=>({id:e,name:this.t(e)}))},{slug:RR.Action,name:this.t("action_44224"),category:this.t("automatisations_60045"),fieldType:He.Select,hideEmpty:!0,values:Nn.map(e=>({id:e,name:this.t(e)}))},{slug:RR.CreatedBy,name:this.t("cr_e_par_30622"),category:this.t("automatisations_60045"),fieldType:He.Select,hideEmpty:!0,needLoading:!0,organizationId:e,eventId:t},{slug:RR.CreatedAt,name:this.t("cr_e_le_02658"),category:this.t("automatisations_60045"),fieldType:He.Datetime,hideEmpty:!0}]}getWorkflowsPossibleColumns(){return[{slug:RR.Id,name:this.t("id_51738"),isSearchable:!0,isSortable:!0,width:100,sortAttribute:Vt.Id},{slug:RR.Name,name:this.t("nom_de_l_automa_04883"),isSearchable:!0,isSortable:!0,sortAttribute:Vt.Name,minWidth:240},{slug:RR.State,name:this.t("status_06428"),minWidth:180},{slug:RR.Trigger,name:this.t("d_clencheur_73493"),minWidth:180},{slug:RR.Action,name:this.t("action_44224"),minWidth:180},{slug:RR.CreatedBy,name:this.t("cr_e_par_30622"),isSearchable:!0,minWidth:180},{slug:RR.CreatedAt,name:this.t("cr_e_le_02658"),isSortable:!0,sortAttribute:Vt.CreatedAt,minWidth:180},{slug:RR.VolunteersSegment,name:this.t("vue_s_lectionn_21556"),isSortable:!0,sortAttribute:Vt.VolunteersSegment,minWidth:320},{slug:RR.ExecutedAt,name:this.t("ex_cut_e_le_99019"),isSortable:!0,sortAttribute:Vt.ExecutedAt,minWidth:180},{slug:RR.Accreditations,name:this.t("accr_ditations_39450"),minWidth:320},{slug:RR.Campaign,name:this.t("campagne_97871"),minWidth:240},{slug:RR.CustomField,name:this.t("CustomField"),minWidth:240}]}}const PR=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=vl(),{showNotification:o}=Ob(),{mutate:r}=function(e={}){return ei("mutation WorkflowssMassDelete(\n $organizationId: OrganizationId!\n $eventId: EventId\n $selecteds: MassActionSelectedsInput!\n) {\n workflowssMassDelete(organizationId: $organizationId, eventId: $eventId, selecteds: $selecteds)\n}\n",e)}();return(0,i.jsx)(cA,{buttonText:t("supprimer_43083"),subtext:(0,Za.A)([t("_tes_vous_s_r_d_94890"),e.workflow.trigger===Wt.Assigned?t("cela_supprimera_60220"):null]),text:t("suppression_de_73669",e.workflow.name),onClose:e.onClose,onDelete:async()=>{await r({organizationId:n,eventId:s,selecteds:{ids:[e.workflow.id]}}),o(t("l_automatisatio_64405",e.workflow.name)),e.onSuccess()}})},FR=e=>{const{history:t,translate:n,params:{organizationId:s,eventId:o}}=vl(),{mutate:r}=function(e={}){return ei("mutation WorkflowDuplicate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $workflowId: WorkflowId!\n) {\n workflowDuplicate(organizationId: $organizationId, eventId: $eventId, workflowId: $workflowId) {\n id\n }\n}\n",e)}(),{mutate:a}=function(e={}){return ei("mutation WorkflowExecute(\n $organizationId: OrganizationId!\n $eventId: EventId\n $workflowId: WorkflowId!\n) {\n workflowExecute(organizationId: $organizationId, eventId: $eventId, workflowId: $workflowId)\n}\n",e)}(),[l,d]=(0,L.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Yc,{children:[(0,i.jsx)(Kd,{icon:"play",isDisabled:e.workflow.state===Ut.Paused,onClick:async()=>{await a({organizationId:s,eventId:o,workflowId:e.workflow.id}),e.reload()},children:n("ex_cuter_54158")}),(0,i.jsx)(Kd,{icon:"pen",to:nv.UPDATE({organizationId:s,eventId:o,workflowId:e.workflow.id}),children:n("_diter_62574")}),(0,i.jsx)(Kd,{icon:"clone",onClick:async()=>{const{workflowDuplicate:{id:n}}=await r({organizationId:s,eventId:o,workflowId:e.workflow.id});t.push(nv.UPDATE({organizationId:s,eventId:o,workflowId:n}))},children:n("dupliquer_28256")}),(0,i.jsx)(Xu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Kd,{color:"red",icon:"trash-can",onClick:e=>{d(!0),Vd(e.target)},children:n("supprimer_43083")})]}),l&&(0,i.jsx)(PR,{workflow:e.workflow,onClose:()=>{d(!1)},onSuccess:e.reload})]})},MR=e=>{const t=Zn(Jc);return(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:t.toLocaleString(e.insertedAt.toLocal(),eo.DateTime)})},NR=e=>{const t=m(e.createdBy?.name),n=(t?e.createdBy?.name:e.createdBy?.email)||"";return(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsxs)(Ba,{direction:"column",width:1,children:[(0,i.jsx)(Ar,{css:{ellipsis:!0},font:"gray900 textSm medium",title:n,width:1,children:n}),t&&(0,i.jsx)(Ar,{color:"gray500",css:{ellipsis:!0},title:e.createdBy?.email||"",width:1,children:e.createdBy?.email||""})]})})};function LR(e){switch(e){case Ut.Active:return{color:"success",leftIcon:"play"};case Ut.Error:return{color:"error",leftIcon:"triangle-exclamation"};case Ut.Paused:return{color:"warning",leftIcon:"pause"};default:return ll()}}const BR=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=vl(),o=Zn(Jc),r=(0,L.useMemo)(()=>so(e.row.accreditationsSlots)?RC(e.row.accreditationsSlots):[],[e.column]);return e.column.slug===RR.Id?(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.id}):e.column.slug===RR.Name?(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Zc,{to:nv.UPDATE({organizationId:n,eventId:s,workflowId:e.row.id}),children:e.row.name})}):e.column.slug===RR.State?(0,i.jsxs)(Oc,{align:"start",direction:"column",gap:"1",justify:"center",minWidth:e.column.minWidth,width:e.column.width,children:[(0,i.jsx)(rc,{...LR(e.row.state),children:t(e.row.state)}),"Error"===e.row.state&&(0,i.jsx)(Ar,{css:{ellipsis:!0},title:e.row.data.errorMessage||"",width:1,children:e.row.data.errorMessage||""})]}):e.column.slug===RR.Trigger?(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:t(e.row.trigger)}):e.column.slug===RR.Action?(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:t(e.row.action)}):e.column.slug===RR.CreatedBy?(0,i.jsx)(NR,{column:e.column,createdBy:e.row.createdBy}):e.column.slug===RR.CreatedAt?(0,i.jsx)(MR,{column:e.column,insertedAt:e.row.insertedAt}):e.column.slug===RR.VolunteersSegment?(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.volunteersSegment?(0,i.jsx)(Zc,{to:Ps.VOLUNTEERS_SEGMENT(n,s,e.row.volunteersSegment.id),children:e.row.volunteersSegment.name}):"-"}):e.column.slug===RR.ExecutedAt?(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.executedAt?.isValid?o.toLocaleString(e.row.executedAt.toLocal(),eo.DateTime):"-"}):e.column.slug===RR.Accreditations?(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Py,{badges:r,doNotSort:!0})}):e.column.slug===RR.Campaign?(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.campaign?(0,i.jsx)(Zc,{to:$I.CAMPAIGN({organizationId:n,eventId:s,campaignId:e.row.campaign.id}),children:e.row.campaign.name}):"-"}):e.column.slug===RR.CustomField?(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.customField?e.row.customField.name:"-"}):null},VR=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:s}}=vl();return(0,i.jsxs)(lj,{justify:"between",children:[(0,i.jsx)(Ar,{font:"gray900 displayXs medium",children:t("automatisations_60045")}),(0,i.jsx)(Kb,{permissions:Hb.WORKFLOW_EDIT,children:(0,i.jsx)(zl,{onClick:()=>{e.push(nv.CREATE({organizationId:n,eventId:s}))},children:t("cr_er_une_autom_91246")})})]})},UR=e=>{const{params:{organizationId:t,eventId:n}}=vl(),s=Zn(DR),[o,r,a]=fy(t,"workflows.columns",[RR.Name,RR.State,RR.CreatedBy]),[l,d,c]=fy(t,"workflows.limit",Rc),[u,h,m]=fy(t,"workflows.predicates",[]),[g,p,f]=fy(t,"workflows.sort",null),_=(0,L.useMemo)(()=>s.getWorkflowsFilters(t,n),[n,t,s]),x=(0,L.useMemo)(()=>s.getWorkflowsPossibleColumns(),[]),I=a||c||m||f;return(0,i.jsxs)(dj,{children:[(0,i.jsx)(VR,{}),(0,i.jsx)(aj,{children:I?(0,i.jsx)(wl,{}):(0,i.jsx)(_m,{columns:o,columnsSearch:[],columnsToIncludes:$R,eventId:n,filters:_,limit:l,loadDataList:Da,loadDataListParams:{level:n?ot.Event:ot.Organization},loadRow:Pa,organizationId:t,possibleColumns:x,predicates:u,rendering:Uh.List,setColumns:r,setLimit:d,setPredicates:h,setSort:p,showEditColumns:!0,showEditMode:!1,showFilters:!0,showMassActions:!1,showRowDropdown:e.showRowDropdown,showRowEdit:e.showRowEdit,showSearchColumns:!1,sort:g,children:(0,i.jsx)(Tm,{getEditPath:e=>nv.UPDATE({organizationId:t,eventId:n,workflowId:e.id}),renderCell:(e,t)=>(0,i.jsx)(BR,{column:e,row:t}),renderRowDropdown:(e,t)=>(0,i.jsx)(FR,{reload:t,workflow:e})})})})]})},WR=()=>{const{translate:e}=vl(),{event:{name:t}}=wb(),{canWorkflowEdit:n}=$S();return Md(`${t} ${e("automatisations_60045")}`),(0,i.jsx)(UR,{showRowDropdown:n,showRowEdit:n})},GR=()=>{const{translate:e}=vl(),{organization:t}=TI(),{canWorkflowEdit:n}=DS();return Md(`${t.name} ${e("automatisations_60045")}`),(0,i.jsx)(UR,{showRowDropdown:n,showRowEdit:n})};let HR=class extends Gl{translationService;constructor(e){super(e),this.translationService=e}segmentFolderInputDefault(e,t){return{name:t?.name??"",segmentType:e}}};HR=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[qn])],HR);const qR=e=>{const t=Xn(),{eventId:n,organizationId:s,segmentType:o,reload:r}=vy(),{mutate:a}=function(e={}){return ei("mutation SegmentFolderCreate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $segmentFolder: SegmentsFolderInput!\n) {\n segmentFolderCreate(\n organizationId: $organizationId\n eventId: $eventId\n segmentFolder: $segmentFolder\n ) {\n id\n }\n}\n",e)}(),{mutate:l}=function(e={}){return ei("mutation SegmentFolderUpdateName(\n $organizationId: OrganizationId!\n $eventId: EventId\n $segmentFolderId: SegmentsFolderId!\n $name: String!\n) {\n segmentFolderUpdateName(\n organizationId: $organizationId\n eventId: $eventId\n segmentFolderId: $segmentFolderId\n name: $name\n ) {\n id\n }\n}\n",e)}(),d=Zn(HR);return(0,i.jsx)(oC,{buttonText:e.isEdit?t("mettre_jour_l_05529"):t("cr_er_le_dossie_71150"),icon:"text",initialValues:{segmentFolder:d.segmentFolderInputDefault(o,e.segmentFolder)},size:"md",subtitle:t("classez_vos_vue_39895"),title:t("nom_du_dossier_95781"),onClose:e.onClose,onSubmit:async t=>{e.isEdit&&e.segmentFolder?await l({organizationId:s,eventId:n,segmentFolderId:e.segmentFolder.id,name:t.segmentFolder.name}):await a({organizationId:s,eventId:n,segmentFolder:t.segmentFolder}),r(),e.onClose()},children:(0,i.jsx)(Vl,{label:t("nom_du_dossier_95781"),name:"segmentFolder.name"})})},KR=e=>{const[t,n]=L.useState(!1),s=L.useCallback(t=>{e.setSegmentsFolders((0,xu.jM)(n=>{n[e.segmentFolderIndex].segments[e.index].name=t}))},[e.segmentFolderIndex,e.index,e.setSegmentsFolders]),o=L.useCallback(()=>e.setSegmentsFolders(t=>t.map(t=>({...t,segments:t.segments.filter(t=>t.id!==e.segment.id)}))),[e.segment,e.setSegmentsFolders]);return(0,i.jsx)(Iu.sx,{draggableId:`s-${e.segment.id}`,index:e.index,children:r=>(0,i.jsxs)(Ba,{css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",padding:"$3"},gap:"3",...r.draggableProps,ref:r.innerRef,align:"center",children:[(0,i.jsx)(Ar,{color:"gray300",css:{cursor:"pointer"},...r.dragHandleProps,children:(0,i.jsx)(nl,{icon:"grip-vertical",iconStyle:"solid"})}),t?(0,i.jsx)(Ar,{css:{flex:"1"},children:(0,i.jsx)(Bl,{value:e.segment.name,onChange:s})}):(0,i.jsx)(Ar,{css:{flex:"1"},font:"gray900 textSm medium",children:e.segment.name}),(0,i.jsx)(zl,{color:"white",leftIcon:t?"check":"pen",size:"sm",onClick:()=>n(!t)}),(0,i.jsx)(zl,{color:"white",disabled:!e.canDelete,leftIcon:"trash-can",size:"sm",onClick:o})]})})},YR=e=>{const[t,n]=L.useState(!1),s=L.useCallback(t=>{e.setSegmentsFolders((0,xu.jM)(n=>{n[e.index].name=t}))},[e.index,e.setSegmentsFolders]);return(0,i.jsx)(Iu.sx,{draggableId:`sf-${e.segmentFolder.id}`,index:e.index,children:o=>(0,i.jsxs)(Ba,{css:{background:"white",border:"1px solid $gray200",borderRadius:"$2",boxShadow:"$sm",overflow:"hidden"},direction:"column",...o.draggableProps,ref:o.innerRef,children:[(0,i.jsxs)(Ba,{align:"center",css:{padding:"$4"},gap:"3",children:[(0,i.jsx)(Ar,{color:"gray300",css:{cursor:"pointer"},fontSize:"textMd",...o.dragHandleProps,children:(0,i.jsx)(nl,{icon:"grip-vertical",iconStyle:"solid"})}),t?(0,i.jsx)(Ar,{css:{flex:"1"},children:(0,i.jsx)(Bl,{value:e.segmentFolder.name,onChange:s})}):(0,i.jsx)(Ar,{css:{flex:"1"},font:"gray800 textMd medium",children:e.segmentFolder.name}),(0,i.jsx)(zl,{color:"white",leftIcon:t?"check":"pen",size:"sm",onClick:()=>n(!t)}),(0,i.jsx)(zl,{color:"white",disabled:!e.canDelete,leftIcon:"trash-can",size:"sm",onClick:()=>{e.setSegmentsFolders(t=>t.filter(t=>t!==e.segmentFolder))}})]}),(0,i.jsx)(Iu.gL,{droppableId:`drop-sf-${e.segmentFolder.id}`,type:"segment",children:t=>(0,i.jsxs)(Ba,{css:{background:"$gray100",padding:"$4"},direction:"column",gap:"2",...t.droppableProps,ref:t.innerRef,children:[e.segmentFolder.segments.map((t,n)=>(0,i.jsx)(KR,{canDelete:e.segmentFolder.segments.length>1,index:n,segment:t,segmentFolderIndex:e.index,setSegmentsFolders:e.setSegmentsFolders},t.id)),t.placeholder]})})]})})},ZR=e=>{const t=Xn(),{segmentsFolders:n}=vy(),{mutate:s,isLoading:o}=function(e={}){return ei("mutation SegmentsFoldersReorder(\n $organizationId: OrganizationId!\n $eventId: EventId\n $segmentType: SegmentType!\n $segmentsFolders: [SegmentFolderReorderInput!]!\n) {\n segmentsFoldersReorder(\n organizationId: $organizationId\n eventId: $eventId\n segmentType: $segmentType\n segmentsFolders: $segmentsFolders\n )\n}\n",e)}(),[r,a]=(0,L.useState)(n.map(e=>({id:e.id,name:e.name,segments:e.segments.map(e=>({id:e.id,name:e.name}))}))),l=(0,L.useCallback)(async()=>{await s({organizationId:e.organizationId,eventId:e.eventId,segmentType:e.segmentType,segmentsFolders:r.map(e=>({...e,id:!e.id||e.id<0?void 0:e.id}))}),e.onClose(),e.onSuccess()},[e.organizationId,e.eventId,e.segmentType,r]),d=(0,L.useCallback)(({reason:e,source:t,destination:n})=>{if("DROP"===e&&n&&t.index!==n.index&&"main"===t.droppableId&&"main"===n.droppableId)a(lo(r,t.index,n.index));else if("DROP"===e&&n&&(t.droppableId!==n.droppableId||t.index!==n.index)&&t.droppableId.startsWith("drop-sf-")&&n.droppableId.startsWith("drop-sf-")){const e=parseInt(t.droppableId.substring(8),10),i=parseInt(n.droppableId.substring(8),10);a(e!==i?(0,xu.jM)(s=>{const o=s.find(t=>t.id===e),r=s.find(e=>e.id===i),a=o.segments.find((e,n)=>n===t.index);o.segments=(0,hc.A)(o.segments,a),r.segments.splice(n.index,0,a)}):(0,xu.jM)(i=>{const s=i.find(t=>t.id===e);s.segments=lo(s.segments,t.index,n.index)}))}},[r,a]);return(0,i.jsx)(Lm,{button:(0,i.jsx)(zl,{isLoading:o,onClick:l,children:t("enregistrer_06519")}),category:t("vues_personnali_80652"),heading:t("param_tres_de_v_66378"),onClose:e.onClose,children:(0,i.jsxs)(Mm,{css:{background:"white"},children:[(0,i.jsxs)(Ba,{align:"center",gap:"6",justify:"between",children:[(0,i.jsx)(Ar,{font:"gray900 textLg semiBold",children:t("organisation_de_95776")}),(0,i.jsx)(zl,{color:"white",leftIcon:"folder-plus",onClick:()=>{const e=Math.min((0,rh.A)(r,e=>e.id)?.id??0,0);a([...r,{id:e-1,name:t("nouveau_dossier_94479"),segments:[]}])},children:t("nouveau_dossier_94479")})]}),(0,i.jsx)(Ju,{height:"5"}),(0,i.jsx)(Iu.JY,{onDragEnd:d,children:(0,i.jsx)(Iu.gL,{droppableId:"main",type:"segmentFolder",children:e=>(0,i.jsxs)(Ba,{direction:"column",gap:"6",width:1,...e.droppableProps,ref:e.innerRef,children:[r.map((e,t)=>(0,i.jsx)(YR,{canDelete:r.length>1,index:t,segmentFolder:e,setSegmentsFolders:a},t)),e.placeholder]})})})]})})},XR=_r("div",{alignItems:"center",borderRadius:"$2",cursor:"pointer",display:"flex",gap:"$4",padding:"$4",userSelect:"none","&:hover":{boxShadow:"$xs"},"& .radio-row-text":{flex:1,fontWeight:"$medium"},"& .radio-row-button":{alignItems:"center",borderRadius:"16px",color:"white",display:"flex",fontSize:"10px",height:"16px",justifyContent:"center",width:"16px"},variants:{state:{unchecked:{background:"white",border:"1px solid $gray200","&:hover":{background:"$gray50"},"& .radio-row-text":{color:"$gray700"},"& .radio-row-button":{background:"white",border:"1px solid $gray300"}},checked:{background:"$primary50",border:"1px solid $primary500",boxShadow:"$xs","& .radio-row-text":{color:"$primary800"},"& .radio-row-button":{background:"$primary500",border:"1px solid $primary500"}}}},defaultVariants:{state:"unchecked"}}),JR=e=>(il("common-front/src/designSystem/components/radioRow.tsx","common-front/src/designSystem/components/radioCard.tsx for card-style radio buttons, or create a new component following that pattern for other styles of radio button"),(0,i.jsxs)(XR,{state:e.state,onClick:()=>{"unchecked"!==e.state&&e.state?e.onClick("unchecked"):e.onClick("checked")},children:[(0,i.jsx)("div",{className:"radio-row-text",children:e.children}),(0,i.jsx)("div",{"aria-describedby":e.descId,className:"radio-row-button",id:e.inputId,role:"radio",children:"checked"===e.state&&(0,i.jsx)(nl,{icon:"check"})})]})),QR=({description:e,label:t,name:n,value:s})=>{const{inputId:o,descId:r}=qa();return(0,i.jsx)(Ga.D0,{name:n,render:n=>{const a=n.input.checked?"checked":"unchecked";return(0,i.jsx)(JR,{descId:r,inputId:o,state:a,onClick:()=>{n.input.onChange(s)},children:(0,i.jsxs)(Ba,{direction:"column",children:[(0,i.jsx)(Ml,{htmlFor:o,children:(0,i.jsx)(Ar,{children:t})}),e&&(0,i.jsx)(Ar,{fontWeight:"regular",id:r,children:e})]})})},type:"radio",value:s})},e$=e=>{const t=Xn(),{eventId:n,organizationId:s,segmentsFolders:o,reload:r}=vy(),{mutate:a}=function(e={}){return ei("mutation SegmentMoveFolder(\n $organizationId: OrganizationId!\n $eventId: EventId\n $segmentId: SegmentId!\n $segmentFolderId: SegmentsFolderId!\n) {\n segmentMoveFolder(\n organizationId: $organizationId\n eventId: $eventId\n segmentId: $segmentId\n segmentFolderId: $segmentFolderId\n ) {\n id\n }\n}\n",e)}();return(0,i.jsxs)(oC,{buttonText:t("d_placer_la_vue_27440"),icon:"sliders",initialValues:{segmentFolderId:e.segment.segmentFolderId},size:"md",title:t("d_placer_la_vue_55115",e.segment.name),onClose:e.onClose,onSubmit:async t=>{await a({organizationId:s,eventId:n,segmentId:e.segment.id,segmentFolderId:t.segmentFolderId}),r(),e.onClose()},children:[(0,i.jsx)(Ar,{color:"gray900",fontWeight:"medium",children:t("vers_quel_dossi_86452")}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(Ba,{css:{overflowY:"auto"},direction:"column",gap:"3",children:o.map(e=>(0,i.jsx)(QR,{label:e.name,name:"segmentFolderId",value:e.id},e.id))})]})},t$=e=>{const{translate:t}=vl(),{eventId:n,organizationId:s,segmentsFolders:o,reload:r}=vy(),{mutate:a,isLoading:l}=function(e={}){return ei("mutation SegmentUpdateMetadata(\n $organizationId: OrganizationId!\n $eventId: EventId\n $description: String\n $segmentFolderId: SegmentsFolderId!\n $segmentId: SegmentId!\n $name: String!\n) {\n segmentUpdateMetadata(\n organizationId: $organizationId\n eventId: $eventId\n description: $description\n segmentFolderId: $segmentFolderId\n segmentId: $segmentId\n name: $name\n ) {\n id\n }\n}\n",e)}(),[d,c]=(0,L.useState)(e.segment.name),[u,h]=(0,L.useState)(e.segment.segmentFolderId),[g,p]=(0,L.useState)(e.segment.description||void 0),f=m(d);return(0,i.jsx)(Lb,{isOpen:!0,onClose:e.onClose,children:(0,i.jsxs)(Nb,{children:[(0,i.jsx)(Mb,{icon:"gear",subtitle:t("mettez_jour_l_55467"),children:t("mise_jour_de_80873")}),(0,i.jsxs)(Fb,{gap:"4",children:[(0,i.jsx)(Bl,{label:t("nom_de_la_vue_66415"),value:d,onChange:c}),(0,i.jsx)(yc,{isSearchVisible:!0,label:t("dossier_00726"),shouldParseAsInt:!0,values:[u],onChange:e=>{so(e)&&h(e[0])},children:o.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(Zm,{label:t("Description"),value:g,onChange:p})]}),(0,i.jsx)(Pb,{children:()=>(0,i.jsx)(zl,{disabled:!f,isLoading:l,onClick:async()=>{await a({organizationId:s,eventId:n,description:g,name:d,segmentFolderId:u,segmentId:e.segment.id}),r()},children:t("mettre_jour_85141")})})]})})},n$=_r("div",{alignItems:"center",color:"$gray700",cursor:"pointer",display:"flex",height:"32px",gap:"$space$2",px:"$3",width:"100%","&:hover":{"& .count":{background:"$primary500",color:"white"}},"& .name":{flex:"1",ellipsis:""},"& .count, & .count-admin":{borderRadius:"16px",fontSize:"$textXs",px:"8px",py:"2px"},"& .ellipsis":{display:"none"},"&:hover .count-admin":{display:"none"},"&:hover .ellipsis":{color:"$gray700",display:"block","& .trigger":{alignItems:"center",display:"flex",height:"32px",justifyContent:"end",px:"8px",width:"32px"}},variants:{selected:{true:{background:"$primary50",borderRadius:"$1",color:"$primary500","& .count":{background:"$primary500",color:"white"},"& .count, & .count-admin":{background:"$primary500",color:"white"}},false:{"&:hover":{background:"$gray100",borderRadius:"$1",color:"$gray800"},"& .count, & .count-admin":{background:"$primary50",color:"$primary500"}}}}}),i$=(0,L.memo)(function(e){const{history:t,translate:n}=vl(),{canEditSegments:s,eventId:o,organizationId:r,segmentId:a,getSegmentPath:l,onSegmentClick:d,reload:c}=vy(),{mutate:u}=function(e={}){return ei("mutation SegmentDelete(\n $organizationId: OrganizationId!\n $eventId: EventId\n $segmentId: SegmentId!\n) {\n segmentDelete(organizationId: $organizationId, eventId: $eventId, segmentId: $segmentId) {\n id\n }\n}\n",e)}(),{mutate:h}=function(e={}){return ei("mutation SegmentDuplicate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $segmentId: SegmentId!\n) {\n segmentDuplicate(organizationId: $organizationId, eventId: $eventId, segmentId: $segmentId) {\n id\n }\n}\n",e)}(),{mutate:m}=function(e={}){return ei("mutation SegmentMoveDown(\n $organizationId: OrganizationId!\n $eventId: EventId\n $segmentId: SegmentId!\n) {\n segmentMoveDown(organizationId: $organizationId, eventId: $eventId, segmentId: $segmentId) {\n id\n }\n}\n",e)}(),{mutate:g}=function(e={}){return ei("mutation SegmentMoveUp(\n $organizationId: OrganizationId!\n $eventId: EventId\n $segmentId: SegmentId!\n) {\n segmentMoveUp(organizationId: $organizationId, eventId: $eventId, segmentId: $segmentId) {\n id\n }\n}\n",e)}(),[p,f]=(0,L.useState)(!1),[_,x]=(0,L.useState)(!1),[I,v]=(0,L.useState)(!1);return(0,i.jsxs)(n$,{selected:e.segment.id===a,onClick:()=>{d(e.segment.id),t.push(l(e.segment.id))},onMouseLeave:e=>{Vd(e.target)},children:[(0,i.jsx)("div",{className:"name",title:e.segment.name,children:e.segment.name}),(0,i.jsx)("div",{className:s?"count-admin":"count",children:e.segment.count}),s&&(0,i.jsx)("div",{className:"ellipsis",onClick:Dl,children:(0,i.jsxs)(Wd,{children:[(0,i.jsx)(Xd,{children:(0,i.jsx)("div",{className:"trigger",children:(0,i.jsx)("i",{className:"fa-regular fa-ellipsis-vertical"})})}),(0,i.jsxs)(Zd,{offset:0,placement:"bottom-end",children:[(0,i.jsx)(Kd,{icon:"pen",onClick:()=>{f(!0)},children:n("mettre_jour_85141")}),e.canMoveUpDown&&(0,i.jsx)(Kd,{color:e.isFirst?"disabled":"default",icon:"arrow-up",onClick:async()=>{await g({organizationId:r,eventId:o,segmentId:e.segment.id}),c()},children:n("d_placer_vers_l_49863")}),e.canMoveUpDown&&(0,i.jsx)(Kd,{color:e.isLast?"disabled":"default",icon:"arrow-down",onClick:async()=>{await m({organizationId:r,eventId:o,segmentId:e.segment.id}),c()},children:n("d_placer_vers_l_52432")}),e.canMoveFolder&&(0,i.jsx)(Kd,{icon:"folder",onClick:()=>{x(!0)},children:n("d_placer_de_dos_65513")}),e.canDelete&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Kd,{icon:"clone",onClick:async()=>{await h({organizationId:r,eventId:o,segmentId:e.segment.id}),c()},children:n("dupliquer_28256")}),(0,i.jsx)(Xu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Kd,{color:"red",icon:"trash-can",onClick:()=>{v(!0)},children:n("supprimer_43083")})]})]})]})}),p&&(0,i.jsx)(t$,{segment:e.segment,onClose:()=>{f(!1)}}),_&&(0,i.jsx)(e$,{segment:e.segment,onClose:()=>{x(!1)}}),I&&(0,i.jsx)(cA,{buttonText:n("supprimer_43083"),subtext:n("_tes_vous_s_r_d_38950"),text:n("suppression_de_73669",e.segment.name),onClose:()=>{v(!1)},onDelete:async()=>{await u({organizationId:r,eventId:o,segmentId:e.segment.id}),c(),await e.onDelete()},children:e.segment.isUsedInWorkflow&&(0,i.jsx)(rl,{color:"warning",leftIcon:"circle-exclamation",children:n("cette_vue_est_u_58409")})})]})}),s$=e=>{const t=Xn(),{canEditSegments:n,eventId:s,organizationId:o,reload:r,segmentType:a}=vy(),{mutate:l}=function(e={}){return ei("mutation SegmentFolderDelete(\n $organizationId: OrganizationId!\n $eventId: EventId\n $segmentFolderId: SegmentsFolderId!\n) {\n segmentFolderDelete(\n organizationId: $organizationId\n eventId: $eventId\n segmentFolderId: $segmentFolderId\n ) {\n id\n }\n}\n",e)}(),{mutate:d}=function(e={}){return ei("mutation SegmentFolderMoveDown(\n $organizationId: OrganizationId!\n $eventId: EventId\n $segmentFolderId: SegmentsFolderId!\n) {\n segmentFolderMoveDown(\n organizationId: $organizationId\n eventId: $eventId\n segmentFolderId: $segmentFolderId\n ) {\n id\n }\n}\n",e)}(),{mutate:c}=function(e={}){return ei("mutation SegmentFolderMoveUp(\n $organizationId: OrganizationId!\n $eventId: EventId\n $segmentFolderId: SegmentsFolderId!\n) {\n segmentFolderMoveUp(\n organizationId: $organizationId\n eventId: $eventId\n segmentFolderId: $segmentFolderId\n ) {\n id\n }\n}\n",e)}(),[u,h]=(0,L.useState)(!1),[g,p]=(0,L.useState)(!1),[f,_]=(0,L.useState)(!1),[x,I]=(0,L.useState)(!1),v=(0,L.useCallback)(async()=>{const t=!f;_(t),await xI.segmentsFolders.put({id:e.segmentFolder.id,isOpen:t})},[f,e.segmentFolder.id]),b=(0,L.useMemo)(()=>m(e.search)?e.segmentFolder.segments.filter(t=>t.name.toLowerCase().includes(e.search.toLowerCase())):e.segmentFolder.segments,[e.segmentFolder.segments,e.search]);return(0,L.useEffect)(()=>{(async()=>{_((await xI.segmentsFolders.get(e.segmentFolder.id))?.isOpen??!0)})()},[]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ba,{direction:"column",children:[(0,i.jsxs)(Ba,{align:"center",css:{cursor:"pointer",userSelect:"none","& .ellipsis":{display:"none"},"&:hover .ellipsis":{display:"block"}},gap:"2",onClick:v,children:[(0,i.jsx)(Ar,{color:"gray500",fontSize:"textXs",children:(0,i.jsx)(nl,{icon:f?"chevron-down":"chevron-right"})}),(0,i.jsx)(Ar,{css:{flex:"1"},font:"gray900 textXs semiBold",children:e.segmentFolder.name}),n&&(0,i.jsx)(Ar,{className:"ellipsis",onClick:Dl,children:(0,i.jsxs)(Wd,{children:[(0,i.jsx)(Xd,{children:(0,i.jsx)(Ba,{align:"center",css:{color:"$gray500",px:"$2"},justify:"end",width:24,children:(0,i.jsx)(nl,{icon:"ellipsis-vertical"})})}),(0,i.jsxs)(Zd,{offset:0,placement:"bottom-end",children:[(0,i.jsx)(Kd,{icon:"pen",onClick:()=>{h(!0)},children:t("renommer_42135")}),(0,i.jsx)(Kd,{icon:"gear",onClick:()=>{I(!0)},children:t("r_ordonner_41823")}),e.canDeleteSegmentFolder&&(0,i.jsx)(Kd,{color:e.isLast?"disabled":"default",icon:"arrow-down",onClick:async()=>{await d({organizationId:o,eventId:s,segmentFolderId:e.segmentFolder.id}),r()},children:t("d_placer_vers_l_52432")}),e.canDeleteSegmentFolder&&(0,i.jsx)(Kd,{color:e.isFirst?"disabled":"default",icon:"arrow-up",onClick:async()=>{await c({organizationId:o,eventId:s,segmentFolderId:e.segmentFolder.id}),r()},children:t("d_placer_vers_l_49863")}),e.canDeleteSegmentFolder&&(0,i.jsx)(Kd,{color:"red",icon:"trash-can",onClick:()=>{p(!0)},children:t("supprimer_43083")})]})]})})]}),b.length>0&&f&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(Ba,{direction:"column",gap:"1",children:b.map((t,n)=>(0,i.jsx)(i$,{canDelete:e.canDeleteSegment,canMoveFolder:e.canDeleteSegmentFolder,canMoveUpDown:e.segmentFolder.segments.length>1,isFirst:0===n,isLast:n===e.segmentFolder.segments.length-1,segment:t,onDelete:e.onSegmentDelete},t.id))})]}),(0,i.jsx)(Ya,{height:"5"})]}),u&&(0,i.jsx)(qR,{isEdit:!0,segmentFolder:e.segmentFolder,onClose:()=>{h(!1)}}),g&&(0,i.jsx)(cA,{buttonText:t("supprimer_43083"),subtext:t("_tes_vous_s_r_d_13885"),text:t("suppression_de_73669",e.segmentFolder.name),onClose:()=>{p(!1)},onDelete:async()=>{await l({organizationId:o,eventId:s,segmentFolderId:e.segmentFolder.id}),r()}}),x&&(0,Kt.createPortal)((0,i.jsx)(Ar,{css:{background:"white",left:"0",position:"absolute",top:"0",zIndex:"200"},height:1,width:1,children:(0,i.jsx)(ZR,{eventId:s,organizationId:o,segmentType:a,onClose:()=>{I(!1)},onSuccess:()=>(r(),e.onSegmentDelete())})}),document.body)]})},o$=e=>{const t=Xn(),{canEditSegments:n,segmentsFolders:s}=vy(),[o,r]=(0,L.useState)(!1),a=(0,L.useMemo)(()=>s.flatMap(e=>e.segments).length>1,[s]),[l,d]=(0,L.useState)(""),c=(0,L.useMemo)(()=>m(l)?s.filter(e=>e.segments.some(e=>e.name.toLowerCase().includes(l.toLowerCase()))):s,[s,l]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(hd,{css:{background:"white",borderRight:"1px solid $gray200",overflow:"hidden"},gridtemplaterows:"1fr 48px",height:1,width:1,children:[(0,i.jsxs)(Ba,{css:{overflowY:"auto",padding:"$7 $4"},direction:"column",width:1,children:[(0,i.jsx)(Ba,{align:"center",children:(0,i.jsx)(Ar,{color:"gray900",css:{flex:"1"},fontSize:"textMd",fontWeight:"semiBold",children:t("vues_personnali_80652")})}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(Ar,{width:1,children:(0,i.jsx)(Bl,{icon:"magnifying-glass",placeholder:t("rechercher_50038"),state:"search",value:l,onChange:d})}),(0,i.jsx)(Ya,{height:"4"}),c.map((t,n)=>(0,i.jsx)(s$,{canDeleteSegment:a,canDeleteSegmentFolder:s.length>1,isFirst:0===n,isLast:n===s.length-1,search:l,segmentFolder:t,onSegmentDelete:e.onSegmentDelete},t.id))]}),n&&(0,i.jsxs)(Ba,{align:"center",css:{borderTop:"1px solid $gray200",cursor:"pointer",padding:"$3 $6"},gap:"4",width:1,onClick:()=>{r(!0)},children:[(0,i.jsx)(nl,{icon:"plus"}),(0,i.jsx)(Ar,{color:"gray700",fontWeight:"medium",children:t("nouveau_dossier_94479")})]})]}),o&&(0,i.jsx)(qR,{isEdit:!1,onClose:()=>{r(!1)}})]})},r$=()=>{const{history:e,translate:t}=vl(),{columns:n,columnsExport:s,columnsSearch:o,eventId:r,getSegmentPath:a,infos:l,organizationId:d,predicates:c,reload:u,rendering:h,segment:g,segmentId:p,segmentType:f,segmentsFolders:_,sort:x,setIsSaveSegmentVisible:I}=vy(),v=(0,L.useCallback)(()=>{I(!1)},[I]),{mutate:b,isLoading:j}=function(e={}){return ei("mutation SegmentUpdate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $segmentFolderId: SegmentsFolderId!\n $segmentId: SegmentId!\n $segment: SegmentInput!\n) {\n segmentUpdate(\n organizationId: $organizationId\n eventId: $eventId\n segmentFolderId: $segmentFolderId\n segmentId: $segmentId\n segment: $segment\n ) {\n id\n }\n}\n",e)}(),{mutate:C,isLoading:y}=function(e={}){return ei("mutation SegmentCreate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $segmentFolderId: SegmentsFolderId!\n $segment: SegmentInput!\n) {\n segmentCreate(\n organizationId: $organizationId\n eventId: $eventId\n segmentFolderId: $segmentFolderId\n segment: $segment\n ) {\n id\n }\n}\n",e)}(),[k,A]=(0,L.useState)(!1),[w,S]=(0,L.useState)(""),[E,T]=(0,L.useState)(_.find(e=>e.segments.find(e=>e.id===p))?.id??_[0].id),[z,O]=(0,L.useState)(g.description||void 0),R=!k||m(w);return(0,i.jsx)(Lb,{isOpen:!0,onClose:v,children:(0,i.jsxs)(Nb,{children:[(0,i.jsx)(Mb,{icon:"floppy-disk",subtitle:t("sauvegarder_vos_15289"),children:t("enregistrer_une_52986")}),(0,i.jsxs)(Fb,{children:[(0,i.jsx)(Ar,{color:"gray800",fontWeight:"medium",children:t("que_souhaitez_v_33936")}),(0,i.jsx)(Ya,{height:"2"}),(0,i.jsxs)(Ba,{direction:"column",gap:"3",children:[(0,i.jsx)(vc,{css:{"& label > div > div":{fontWeight:"$regular"}},state:k?"unchecked":"checked",onClick:()=>{A(!1)},children:t("enregistrer_les_31603").split("{1}").map((e,t)=>1===t?(0,i.jsxs)(L.Fragment,{children:[(0,i.jsx)(ng,{fontWeight:"medium",children:g.name}),e]},t):(0,i.jsx)(L.Fragment,{children:e},t))}),(0,i.jsxs)(Ba,{direction:"column",gap:"2",children:[(0,i.jsx)(vc,{css:{"& label > div > div":{fontWeight:"$regular"}},state:k?"checked":"unchecked",onClick:()=>{A(!0)},children:t("cr_er_une_nouve_37002")}),k&&(0,i.jsx)(Ar,{css:{marginLeft:"$6"},children:(0,i.jsx)(Bl,{hint:t("cette_vue_sera_83858"),placeholder:t("nom_de_votre_no_21748"),value:w,onChange:S})})]})]}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(yc,{isSearchVisible:!0,label:t("dans_quel_dossi_07643"),renderOnPortal:!0,shouldParseAsInt:!0,values:[E],onChange:e=>{so(e)&&T(e[0])},children:_.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(Zm,{label:t("Description"),placeholder:t("entrer_une_desc_74340"),value:z,onChange:O})]}),(0,i.jsx)(Pb,{children:()=>(0,i.jsx)(zl,{disabled:!R,isLoading:y||j,onClick:async()=>{const t={segmentType:f,name:w,description:z,predicates:c,columns:n,columnsExport:s,columnsSearch:o,sort:x,rendering:h,infos:l};if(k){const{segmentCreate:{id:n}}=await C({organizationId:d,eventId:r,segmentFolderId:E,segment:t});u(),e.push(a(n))}else await b({organizationId:d,eventId:r,segmentFolderId:E,segmentId:p,segment:t}),u()},children:t("enregistrer_06519")})})]})})},a$=e=>{const t=Xn(),{areColumnsOpen:n,areSegmentsOpen:s,clearNameCursors:o,columns:r,filters:a,hideSegments:l,isFilterOpen:d,isSaveSegmentVisible:c,possibleColumns:u,predicates:h,selectedFilterPredicate:m,setAreColumnsOpen:g,setColumns:p,setIsFilterOpen:f,setPredicates:_}=vy();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ba,{height:1,width:1,children:[!0!==l&&s&&(0,i.jsx)(Ar,{css:{overflow:"hidden"},height:1,width:260,children:(0,i.jsx)(o$,{onSegmentDelete:e.onSegmentDelete})}),(0,i.jsx)(Ba,{css:{flex:"1",overflowY:"auto"},direction:"column",height:1,children:e.children})]}),d&&(0,i.jsx)(lm,{buttonText:e.filtersButtonText,possibleFilters:a,predicates:h,selectedFilterPredicate:m,subtitle:e.filtersSubtitle,onClose:()=>{f(!1)},onFilter:e=>{o(),_(e)}}),n&&(0,i.jsx)(Au,{columns:u,initialSelectedColumns:r,saveButtonText:t("_diter_les_colo_39630"),searchPlaceholder:t("rechercher_un_c_86475"),subtitle:t("personnaliser_l_03763"),title:t("_dition_des_col_70300"),onClose:()=>{g(!1)},onSave:p}),c&&(0,i.jsx)(r$,{})]})},l$=e=>{const[t,n]=L.useState(e.segmentsFolders),s=L.useMemo(()=>t.flatMap(e=>e.segments),[t]),o=L.useMemo(()=>s.find(t=>t.id===e.segmentId),[e.segmentId,s]),[r,a]=L.useState(o.predicates),[l,d]=L.useState(o.columns),[c,u]=L.useState(o.columnsExport),[h,m]=L.useState(o.columnsSearch),[g,p]=L.useState(o.rendering),[f,_]=L.useState(o.sort),[x,I]=L.useState(o.infos),v=L.useMemo(()=>JSON.stringify(o.predicates),[o]),b=L.useMemo(()=>JSON.stringify(o.columns),[o]),j=L.useMemo(()=>JSON.stringify(o.columnsExport),[o]),C=L.useMemo(()=>JSON.stringify(o.columnsSearch),[o]),y=L.useMemo(()=>JSON.stringify(o.rendering),[o]),k=L.useMemo(()=>JSON.stringify(o.sort),[o]),A=L.useMemo(()=>JSON.stringify(o.infos),[o]),[w]=L.useMemo(()=>pu(r,e.filters),[r,e.filters]),[S,E]=L.useState(!1),[T,z]=L.useState(!1),[O,R]=L.useState(!1),[$,D]=L.useState(null),[P,F]=L.useState(!1),[M,N]=L.useState(e.initialSegmentsOpen??!0),B=L.useCallback(t=>{e.onSegmentsToggle?.(t),N(t)},[N]),V=L.useMemo(()=>JSON.stringify(r)!==v||JSON.stringify(l)!==b||JSON.stringify(g)!==y||JSON.stringify(c)!==j||JSON.stringify(h)!==C||JSON.stringify(f)!==k||JSON.stringify(x)!==A,[v,r,b,l,y,g,j,c,C,h,k,f,x,A]),[U,W]=L.useState(""),[G,H]=L.useState(""),[q,K]=L.useState(e.initialLimit),[Y,Z]=L.useState(0),X=Uc(e=>{H(e),ee()}),[J,Q]=L.useState(1),ee=L.useCallback(()=>{Z(0)},[Z]),te=L.useCallback(t=>{K(t),e.setLimit(t),ee()},[K,ee]),ne=L.useCallback(()=>{W(""),H(""),ee()},[W,H,ee]),ie=wu({}),se=L.useCallback(()=>{ie.toggleSelectAll("unchecked"),Q(J+1)},[ie,J]),oe=L.useMemo(()=>ie.isAllSelected?o.id:null,[ie,o]),re=L.useCallback(e=>{_(e),Z(0)},[_,Z]),ae=L.useCallback((e,i)=>{n((0,xu.jM)(t,t=>{t.forEach(t=>{t.segments.forEach(t=>{t.id===e&&(t.count=i)})})}))},[t,n]);return L.useEffect(()=>{a(o.predicates),d(o.columns),u(o.columnsExport),m(o.columnsSearch),p(o.rendering),_(o.sort),I(o.infos),W(""),H(""),ee(),Q(1)},[o]),L.useEffect(()=>{n(e.segmentsFolders)},[e.segmentsFolders]),(0,i.jsx)(Iy.Provider,{value:{areColumnsOpen:O,areSegmentsOpen:M,canEditSegments:e.canEditSegments,clearNameCursors:ne,columns:l,columnsExport:c,columnsSearch:h,eventId:e.eventId,filters:e.filters,filtersPredicates:w,getSegmentPath:e.getSegmentPath,hideSegments:e.hideSegments,infos:x,isEditMode:S,isFilterOpen:T,isSaveSegmentVisible:P,isSaveVisible:V,limit:q,massActions:ie,massEditSegmentId:oe,name:U,nameDebounced:G,offset:Y,onMassEditSuccess:se,onSegmentClick:e.onSegmentClick,organizationId:e.organizationId,possibleColumns:e.possibleColumns,possibleRenderings:e.possibleRenderings,predicates:r,reload:e.reload,reloadKey:J,rendering:g,segment:o,segmentId:e.segmentId,segmentType:e.segmentType,segmentsFolders:t,selectedFilterPredicate:$,setAreColumnsOpen:R,setAreSegmentsOpen:B,setColumns:d,setColumnsExport:u,setColumnsSearch:m,setInfos:I,setIsEditMode:E,setIsFilterOpen:z,setIsSaveSegmentVisible:F,setLimit:te,setName:W,setNameDebounced:X,setOffset:Z,setPredicates:a,setReloadKey:Q,setRendering:p,setSegmentCount:ae,setSelectedFilterPredicate:D,setSort:re,sort:f},children:(0,i.jsx)(a$,{filtersButtonText:e.filtersButtonText,filtersSubtitle:e.filtersSubtitle,onSegmentDelete:e.onSegmentDelete,children:e.children})})};let d$=class extends _u{constructor(e,t,n){super(e,t,n)}getCampaignsFilters(e){return[{slug:"state",name:this.t("status_06428"),category:this.t("Campaigns"),fieldType:He.Select,values:en.map(e=>({id:e,name:e})),hideEmpty:!0},{slug:"campaign_type",name:this.t("type_35427"),category:this.t("Campaigns"),fieldType:He.Select,values:tn.map(e=>({id:e,name:e})),hideEmpty:!0},{slug:"created_by",name:this.t("cr_e_par_30622"),category:this.t("Campaigns"),fieldType:He.Select,values:e.map(e=>({id:e.userId,name:e.nameOrEmail})),hideEmpty:!0},{slug:"sent_at",name:this.t("envoy_le_60398"),category:this.t("Campaigns"),fieldType:He.Date,hideEmpty:!0}]}};d$=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[hu,Jc,qn])],d$);const c$=e=>{const{translate:t}=vl(),{columnsSearch:n,setColumnsSearch:s}=vy(),[o,r]=(0,L.useState)(""),a=(0,L.useMemo)(()=>m(o)?e.searchableColumns.filter(e=>e.name.toLowerCase().trim().includes(o.toLowerCase().trim())):e.searchableColumns,[e.searchableColumns,o]);return(0,i.jsxs)(Wd,{children:[(0,i.jsx)(Xd,{children:(0,i.jsx)(zl,{color:"white",css:{borderLeft:"none",borderBottomLeftRadius:"0",borderTopLeftRadius:"0"},leftIcon:"bars-filter"})}),(0,i.jsx)(Zd,{css:{padding:"0"},maxHeight:350,placement:"bottom-end",width:320,children:(0,i.jsxs)(Ba,{css:{padding:"$4 $6"},direction:"column",gap:"3",children:[(0,i.jsx)(Ar,{font:"gray800 textMd medium",children:t("rechercher_sur_85243")}),(0,i.jsx)(Bl,{icon:"magnifying-glass",placeholder:t("filtrer_78031"),state:"search",value:o,onChange:r}),(0,i.jsx)(Ba,{direction:"column",gap:"3",children:a.map(({slug:e,name:t})=>(0,i.jsx)(_c,{state:n.includes(e)?"checked":"unchecked",onClick:t=>{s(ro(n,e,"checked"===t))},children:t},e))})]})})]})},u$=e=>{const t=Xn(),{canEditSegments:n,isEditMode:s,isSaveVisible:o,massActions:r,name:a,possibleColumns:l,possibleRenderings:d,rendering:c,setAreColumnsOpen:u,setIsEditMode:h,setIsFilterOpen:m,setIsSaveSegmentVisible:g,setName:p,setNameDebounced:f,setRendering:_,setSelectedFilterPredicate:x}=vy(),I=e.showActions&&e.actions&&r.numberOfSelected>0,v=L.useMemo(()=>(0,uc.A)(l.filter(e=>e.isSearchable),e=>e.name),[l]),b=L.useMemo(()=>e.showSearchColumns?{"& .h-styled-input-container":{borderBottomRightRadius:"0",borderTopRightRadius:"0"}}:{},[e.showSearchColumns]);return mm("e",L.useCallback(()=>{h(!s)},[s,h])),(0,i.jsxs)(Ba,{align:"center",gap:"4",children:[(0,i.jsxs)(Ba,{width:320,children:[(0,i.jsx)(Bl,{css:b,icon:"magnifying-glass",placeholder:e.searchPlaceholder,value:a,onChange:e=>{p(e),f(e)}}),e.showSearchColumns&&(0,i.jsx)(c$,{searchableColumns:v})]}),n&&(0,i.jsx)(zl,{color:"gray",leftIcon:"bars-filter",onClick:()=>{x(null),m(!0)},children:t("filtres_64574")}),(0,i.jsx)(Ar,{css:{flex:"1"},children:n&&o&&(0,i.jsx)(zl,{color:"invisible",onClick:()=>{g(!0)},children:t("enregistrer_la_22884")})}),!I&&e.showEditColumns&&(0,i.jsx)(zl,{color:"invisible",css:{color:"$gray800","&:hover":{color:"$gray800"}},leftIcon:"gear",onClick:()=>{u(!0)},children:t("_diter_les_colo_39630")}),!I&&e.showEditMode&&(0,i.jsx)(ku,{value:s,onChange:h,children:t("mode_dition_93778")}),!I&&so(d)&&(0,i.jsxs)(Wd,{children:[(0,i.jsx)(Xd,{children:(0,i.jsx)(zl,{color:"white",leftIcon:Hh(c),children:qh(t,c)})}),(0,i.jsx)(Zd,{placement:"bottom-end",children:d.map(e=>(0,i.jsx)(Kd,{icon:Hh(e),onClick:()=>_(e),children:qh(t,e)},e))})]}),I&&e.actions]})},h$=()=>{const e=Xn(),t=Zn(_u),{filtersPredicates:n,clearNameCursors:s,setPredicates:o,setIsFilterOpen:r,setSelectedFilterPredicate:a,predicates:l}=vy(),d=(0,L.useCallback)(()=>{s(),o([])},[s,o]),c=(0,L.useCallback)(e=>{a(e),r(!0)},[r,a]),u=(0,L.useCallback)(e=>{s(),o((0,hc.A)(l,e.predicate))},[l,s,o]);return sm(n),so(n)?(0,i.jsxs)(Ba,{align:"center",gap:"3",width:1,wrap:"wrap",children:[n.map((e,n)=>e.filter.needLoading?(0,i.jsx)(rc,{leftIcon:"loader"},n):(0,i.jsx)(rc,{cursor:"pointer",ellipsis:!0,rightIcon:"xmark",onContentClick:()=>{c(e)},onRightIconClick:()=>{u(e)},children:t.filterPredicateToText(e)},n)),(0,i.jsx)(Ar,{color:"gray700",css:{cursor:"pointer"},fontWeight:"medium",onClick:d,children:e("r_initialiser_l_66835")})]}):null},m$=e=>{const{canEditSegments:t,limit:n,massActions:s}=vy(),o=t&&s.numberOfSelected===n;return(0,i.jsxs)(Ba,{css:{background:"white",border:"1px solid $gray200",borderBottom:"none",borderTopLeftRadius:"$2",borderTopRightRadius:"$2",padding:"$3 $4"},direction:"column",gap:"4",width:1,children:[e.searchRow,(0,i.jsx)(h$,{}),o&&e.selectSegment]})},g$=e=>{const{translate:t,params:{organizationId:n,segmentId:s}}=vl(),{areSegmentsOpen:o,hideSegments:r,segment:a,setAreSegmentsOpen:l,setSegmentCount:d}=vy(),{data:c}=Qn("query SegmentHeader($organizationId: OrganizationId!, $segmentId: SegmentId!) {\n organization(id: $organizationId) {\n segment(id: $segmentId) {\n count(shouldCompute: true)\n }\n }\n}\n",{organizationId:n,segmentId:a.id},[]);return L.useEffect(()=>{a.id===s&&d(a.id,c.organization?.segment.count??a.count)},[s,a,c.organization,d]),(0,i.jsx)(lj,{children:(0,i.jsxs)(Ba,{align:"center",gap:"4",width:1,children:[!r&&(0,i.jsx)(Ba,{css:{cursor:"pointer",padding:"$2"},onClick:()=>l(!o),children:(0,i.jsxs)(km,{children:[(0,i.jsx)(Sm,{children:(0,i.jsx)(Ar,{children:(0,i.jsx)(nl,{icon:"sidebar"})})}),(0,i.jsx)(wm,{placement:"top",children:t(o?"masquer_la_list_94215":"afficher_la_lis_48771")})]})}),e.name||(0,i.jsxs)(Ar,{css:{flex:"1"},font:"gray900 displayXs medium",children:[(0,i.jsxs)(Ba,{align:"center",gap:"4",children:[(0,i.jsx)(Ar,{children:a.name}),a.isUsedInWorkflow&&(0,i.jsx)(rc,{color:"white",leftIcon:"bolt-auto",children:t("utilis_e_dans_u_46582")})]}),a.description&&(0,i.jsx)(Ar,{css:{whiteSpace:"pre-wrap"},font:"gray500 textXs medium",children:a.description})]}),e.children]})})},p$=()=>{const{translate:e,history:t,params:{organizationId:n}}=vl();return(0,i.jsx)(g$,{children:(0,i.jsx)(Kb,{permissions:Hb.CAMPAIGN_SEND,children:(0,i.jsx)(nE,{menu:(0,i.jsx)(Kd,{icon:"paper-plane",onClick:()=>{t.push($I.CREATE_TEMPLATE({organizationId:n}))},children:e("cr_er_un_mod_le_20298")}),onClick:()=>{t.push($I.CREATE({organizationId:n}))},children:e("cr_er_une_campa_96023")})})})};function f$(e){switch(e){case he.Draft:return{color:"gray",leftIcon:"pen-ruler"};case he.Done:return{color:"success",leftIcon:"check"};case he.InProgress:return{color:"warning",leftIcon:"hourglass-empty"};case he.Scheduled:return{color:"primary",leftIcon:"calendar"};case he.Template:return{color:"purple",leftIcon:"paper-plane"};default:return ll()}}const _$=e=>{const{history:t,translate:n}=vl(),{showNotification:s}=Ob(),{mutate:o}=function(e={}){return ei("mutation CampaignDuplicate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $campaignId: CampaignId!\n) {\n campaignDuplicate(organizationId: $organizationId, eventId: $eventId, campaignId: $campaignId) {\n id\n }\n}\n",e)}(),{mutate:r}=function(e={}){return ei("mutation CampaignSend(\n $organizationId: OrganizationId!\n $eventId: EventId\n $campaignId: CampaignId!\n) {\n campaignSend(organizationId: $organizationId, eventId: $eventId, campaignId: $campaignId) {\n id\n }\n}\n",e)}(),{mutate:a}=function(e={}){return ei("mutation CampaignDelete(\n $organizationId: OrganizationId!\n $eventId: EventId\n $campaignId: CampaignId!\n) {\n campaignDelete(organizationId: $organizationId, eventId: $eventId, campaignId: $campaignId) {\n id\n }\n}\n",e)}(),[l,d]=(0,L.useState)(!1),c=e.campaign.state===he.Draft||e.campaign.state===he.Scheduled;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Yc,{children:[(0,i.jsx)(Kd,{icon:"pen",onClick:()=>{t.push($I.UPDATE({organizationId:e.organizationId,eventId:e.eventId||void 0,campaignId:e.campaign.id}))},children:n("_diter_62574")}),c&&(0,i.jsx)(Kd,{icon:"paper-plane",onClick:async()=>{await r({organizationId:e.organizationId,eventId:e.eventId,campaignId:e.campaign.id}),e.reload()},children:n("envoyer_26609")}),(0,i.jsx)(Kd,{icon:"clone",onClick:async()=>{const{campaignDuplicate:{id:n}}=await o({organizationId:e.organizationId,eventId:e.eventId,campaignId:e.campaign.id});t.push($I.UPDATE({organizationId:e.organizationId,eventId:e.eventId||void 0,campaignId:n}))},children:n("dupliquer_28256")}),(0,i.jsx)(Xu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Kd,{color:"red",icon:"trash-can",onClick:e=>{Vd(e.target),d(!0)},children:n("supprimer_43083")})]}),l&&(0,i.jsx)(cA,{buttonText:n("supprimer_43083"),subtext:n("_tes_vous_s_r_d_58075"),text:n("suppression_de_73669",e.campaign.name),onClose:()=>{d(!1)},onDelete:async()=>{await a({organizationId:e.organizationId,eventId:e.eventId,campaignId:e.campaign.id}),s(n("la_campagne_1_92813",e.campaign.name)),e.reload()}})]})},x$=e=>{const{translate:t}=vl(),n=Zn(Jc),s=e.campaign.sentAt?.setZone(Gs.c9.local().zone);return(0,i.jsxs)(Mc,{css:{"&:hover":{background:"$gray100"}},onMouseLeave:e=>{Vd(e.target)},children:[(0,i.jsx)(Oc,{children:(0,i.jsxs)(Ba,{direction:"column",width:1,children:[(0,i.jsx)(Zc,{to:$I.CAMPAIGN_DASHBOARD({organizationId:e.organizationId,eventId:e.eventId||void 0,campaignId:e.campaign.id}),children:(0,i.jsx)(Ar,{css:{ellipsis:!0},title:e.campaign.name,children:e.campaign.name})}),e.campaign.state===he.Done&&s&&(0,i.jsx)(Ar,{color:"gray500",children:t("envoy_e_le_1_90336",n.toLocaleString(s,eo.DateTime),e.campaign.createdBy?.nameOrEmail??"")}),e.campaign.state===he.Scheduled&&e.campaign.scheduledAt?.isValid&&(0,i.jsx)(Ar,{color:"gray500",children:t("programm_e_le_58279",n.toLocaleString(e.campaign.scheduledAt,eo.DateOnly.MonthLong),n.toLocaleString(e.campaign.scheduledAt,eo.TimeOnly))})]})}),(0,i.jsxs)(Oc,{css:{flex:"0 150px"},children:[(0,i.jsx)(Ar,{width:22,children:e.campaign.campaignType===me.Email?(0,i.jsx)(nl,{icon:"at"}):(0,i.jsx)(nl,{icon:"message"})}),e.campaign.campaignType]}),(0,i.jsx)(Oc,{css:{flex:"0 200px",justifyContent:"flex-end"},children:e.campaign.numberOfRecipients}),(0,i.jsx)(Oc,{css:{flex:"0 150px",justifyContent:"flex-end"},children:e.campaign.campaignType===me.Email?t("gratuit_13712"):`${e.campaign.cost} €`}),(0,i.jsx)(Oc,{css:{flex:"0 150px"},children:(0,i.jsx)(rc,{...f$(e.campaign.state),children:t(e.campaign.state)})}),(0,i.jsx)(Xc,{justify:"end",children:e.canSendCampaigns&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(km,{children:[(0,i.jsx)(Sm,{children:(0,i.jsx)(Ar,{children:(0,i.jsx)(nl,{icon:"pen",to:$I.UPDATE({organizationId:e.organizationId,eventId:e.eventId||void 0,campaignId:e.campaign.id})})})}),(0,i.jsx)(wm,{placement:"top",children:t("_diter_62574")})]}),(0,i.jsx)(_$,{campaign:e.campaign,eventId:e.eventId,organizationId:e.organizationId,reload:e.reload})]})})]})};function I$(e,t){(0,L.useEffect)(()=>{let n=null;return e.some(e=>e.state===he.InProgress)&&(n=window.setInterval(t,3e4)),()=>{n&&clearInterval(n)}},[e])}const v$=()=>{const{translate:e,params:{organizationId:t}}=vl(),{canCampaignSend:n}=DS(),{limit:s,nameDebounced:o,offset:r,predicates:a,reloadKey:l,setLimit:d,setOffset:c,setSort:u,sort:h}=vy(),{data:g,isLoading:p,reload:f}=Qn("query CommunityCampaigns(\n $organizationId: OrganizationId!\n $predicates: [Predicate!]!\n $name: String\n $limit: Int\n $offset: Int\n $sort: CampaignsSort\n) {\n organization(id: $organizationId) {\n rows: campaigns(\n level: Organization\n predicates: $predicates\n name: $name\n limit: $limit\n offset: $offset\n sort: $sort\n ) {\n nodes {\n ...CampaignList\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{organizationId:t,predicates:a,name:m(o)?o:null,limit:s,offset:r,sort:h},[Vs.CampaignListFragment]);const{numberOfPages:_,totalCount:x}=Su(g.organization?.rows);return(0,L.useEffect)(()=>{l>1&&f()},[l]),I$(g.organization?.rows.nodes??[],f),(0,i.jsx)(Ba,{css:{flex:"1",overflow:"hidden"},width:1,children:(0,i.jsx)(Cm,{"aria-busy":p,headerRow:(0,i.jsxs)(kc,{children:[(0,i.jsx)(jm,{attribute:ue.Name,setSort:u,sort:h,children:e("nom_de_la_campa_45063")}),(0,i.jsx)(jm,{attribute:ue.Type,setSort:u,sort:h,width:150,children:e("type_35427")}),(0,i.jsx)(Gc,{width:200,children:e("nombre_de_desti_21374")}),(0,i.jsx)(Gc,{width:150,children:e("co_t_68998")}),(0,i.jsx)(jm,{attribute:ue.State,css:{flex:"0 150px"},setSort:u,sort:h,children:e("status_06428")}),(0,i.jsx)(Gc,{width:100})]}),paginationRow:(0,i.jsx)(Nc,{css:{borderTop:"1px solid $gray200"},children:(0,i.jsx)(Fc,{limit:s,numberOfPages:_,offset:r,setLimit:d,setOffset:c,showLimits:!0,totalCount:x})}),children:p?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Hc,{}),(0,i.jsx)(Hc,{}),(0,i.jsx)(Hc,{})]}):g.organization.rows.nodes.map(e=>(0,i.jsx)(x$,{campaign:e,canSendCampaigns:n,eventId:null,organizationId:t,reload:f},e.id))})})},b$=()=>{const e=Xn();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(p$,{}),(0,i.jsxs)(aj,{children:[(0,i.jsx)(m$,{searchRow:(0,i.jsx)(u$,{searchPlaceholder:e("rechercher_une_69554"),showActions:!1,showEditColumns:!1,showEditMode:!1,showSearchColumns:!1})}),(0,i.jsx)(v$,{})]})]})},j$=e=>{const{history:t,translate:n,params:{organizationId:s,segmentId:o}}=vl(),{isOrganizationAdmin:r,localOrganization:a,updateLocalOrganization:l}=TI(),d=Zn(d$);return(0,i.jsx)(l$,{canEditSegments:r,filters:d.getCampaignsFilters(e.organization.campaignsCreators),filtersButtonText:n("filtrer_les_cam_97457"),filtersSubtitle:n("appliquer_des_f_57442"),getSegmentPath:e=>$I.CAMPAIGNS_SEGMENT({organizationId:s,segmentId:e}),initialLimit:a?.campaignsLimit??Rc,initialSegmentsOpen:a?.areCampaignsSegmentsOpen??!0,organizationId:s,possibleColumns:[],possibleRenderings:[],reload:e.reload,segmentId:o,segmentType:jt.Campaigns,segmentsFolders:e.organization.segmentsFolders,setLimit:e=>{l({campaignsLimit:e})},onSegmentClick:e=>{l({campaignsSegmentId:e})},onSegmentDelete:async()=>{await l({campaignsSegmentId:null}),t.replace($I.CAMPAIGNS({organizationId:s}))},onSegmentsToggle:async e=>{await l({areCampaignsSegmentsOpen:e})},children:(0,i.jsx)(b$,{})})},C$=()=>{const{params:{organizationId:e},translate:t}=vl();Md(`${t("communaut_20896")} ${t("Campaigns")}`);const{localOrganization:n}=TI(),{data:s,loader:o,reload:r}=Qn("query CampaignsSegments($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n campaignsCreators {\n userId\n nameOrEmail\n }\n\n segmentsFolders(level: Organization, segmentType: Campaigns) {\n ...SegmentsFoldersSegments\n }\n }\n}\n",{organizationId:e},[Vs.SegmentsFoldersSegmentsFragment]),a=(0,L.useMemo)(()=>(s.organization?.segmentsFolders??[]).flatMap(e=>e.segments).map(e=>e.id),[s.organization]);return o||(0,i.jsxs)(Sr.dO,{children:[(0,i.jsx)(Sr.qh,{path:$I.CAMPAIGNS_SEGMENT({organizationId:":organizationId",segmentId:":segmentId"}),children:(0,i.jsx)(j$,{organization:s.organization,reload:r})}),(0,i.jsx)(Sr.qh,{children:(0,i.jsx)(oi,{path:$I.CAMPAIGNS_SEGMENT({organizationId:e,segmentId:n?.campaignsSegmentId&&a.includes(n.campaignsSegmentId)?n?.campaignsSegmentId:a[0]}),replace:!0})})]})},y$=()=>{const{translate:e,params:{organizationId:t}}=vl(),{updateLocalOrganization:n}=TI(),{canCampaignRead:s,canFormRead:o,canDelegationRead:r,canWorkflowRead:a}=DS();return(0,i.jsxs)(YS,{"aria-label":e("menu_communauta_47274"),children:[(0,i.jsx)(KS,{replace:!1,to:wi.COMMUNITY_DASHBOARD({organizationId:t}),children:e("tableau_de_bord_24627")}),(0,i.jsx)(KS,{isActive:e=>e.endsWith("/users")||null!==e.match(/\/users\/\d+/)||null!==e.match(/\/member\/\d+/),replace:!1,to:wi.COMMUNITY_USERS({organizationId:t}),onClick:()=>n({usersSegmentId:null}),children:e("vos_membres_38104")}),s&&(0,i.jsx)(KS,{isActive:e=>e.endsWith("/campaigns")&&!e.endsWith("/history/campaigns")||null!==e.match(/\/community\/campaigns\/\d+/)||null!==e.match(/\/community\/campaign\/\d+/),replace:!1,to:$I.CAMPAIGNS({organizationId:t}),onClick:()=>n({campaignsSegmentId:null}),children:e("Campaigns")}),o&&(0,i.jsx)(KS,{isActive:e=>e.endsWith("/forms")||e.endsWith("/forms/create"),replace:!1,to:Vi.FORMS({organizationId:t}),children:e("Form_plural")}),r&&(0,i.jsx)(KS,{isActive:e=>e.endsWith("/delegations")||null!==e.match(/\/community\/delegations\/\d+/)||null!==e.match(/\/community\/delegation\/\d+/)||null!==e.match(/\/community\/delegation-category\/\d+/),replace:!1,to:Ps.COMMUNITY_DELEGATIONS(t),children:e("d_l_gations_78318")}),a&&(0,i.jsx)(KS,{replace:!1,to:nv.WORKFLOWS({organizationId:t}),children:e("automatisations_60045")})]})},k$=e=>(0,i.jsx)(jT,{children:(0,i.jsxs)(hd,{gridtemplatecolumns:"auto",gridtemplaterows:"55px 1fr",height:1,width:1,children:[(0,i.jsx)(y$,{}),(0,i.jsx)(Ar,{css:{overflowY:"auto"},children:e.children})]})}),A$=()=>{const e=Xn(),{organizationId:t}=ti(),n=ni(),{data:s,loader:o}=Qn("query CommunityDashboard($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n events {\n nodes {\n id\n name\n range\n assignedResources\n resources\n numberOfPositions\n }\n }\n\n numberOfUsersInfos\n }\n}\n",{organizationId:t},[]),r=Zn(ph);return o||(0,i.jsxs)(Ba,{css:{margin:"auto"},direction:"column",height:1,width:"$container",children:[(0,i.jsx)(Ya,{height:"9"}),(0,i.jsx)(Ar,{color:"gray900",fontSize:"displayXs",fontWeight:"semiBold",children:e("tableau_de_bord_24627")}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ar,{color:"gray500",children:e("en_un_coup_d_oe_57288")}),(0,i.jsx)(Ya,{height:"9"}),(0,i.jsxs)(Ba,{gap:"6",width:1,children:[(0,i.jsx)(uS,{icon:"megaphone",iconColor:"primary",text:e("nombre_d_v_nem_14214"),value:s.organization.events.nodes.length}),(0,i.jsx)(uS,{icon:"user-group",iconColor:"purple",text:e("nombre_de_membr_08851"),value:s.organization.numberOfUsersInfos})]}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(Lc,{filters:(0,i.jsx)(i.Fragment,{}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Gc,{children:e("nom_de_l_v_nem_08711")}),(0,i.jsx)(Gc,{children:e("date_de_l_v_ne_69973")}),(0,i.jsx)(Gc,{width:200,children:e("nombre_de_missi_67304_plural")}),(0,i.jsx)(Gc,{children:e("taux_de_remplis_11913")})]}),numberOfPages:0,offset:0,rows:(0,i.jsx)(i.Fragment,{children:s.organization.events.nodes.map(e=>{const s=(0,Vb.A)(e.assignedResources/e.resources*100);return(0,i.jsxs)(Mc,{css:{cursor:"pointer","&:hover":{background:"$gray100"}},onClick:()=>{n.push(Hi.EVENT({organizationId:t,eventId:e.id}))},children:[(0,i.jsx)(Oc,{children:e.name}),(0,i.jsx)(Oc,{children:e.range?r.toDisplayString(e.range):"-"}),(0,i.jsx)(Oc,{width:200,children:e.numberOfPositions}),(0,i.jsx)(Oc,{children:e.resources>0?(0,i.jsxs)(Ba,{align:"center",gap:"3",height:1,width:1,children:[(0,i.jsx)(Ar,{css:{flex:"1"},children:(0,i.jsx)(Ow,{percent:e.assignedResources/e.resources})}),(0,i.jsxs)(Ar,{color:"gray700",width:40,children:[s," %"]})]}):"-"})]},e.id)})}),setOffset:td.A,title:e("liste_des_v_ne_29929"),totalCount:0}),(0,i.jsx)(Ya,{height:"9"})]})};var w$;function S$(e,t){return t===Vh.AccreditationsMatrix?{includeAccreditationsSlots:!0,includeCampaigns:!1,includeChildren:!1,includeCreatedBy:!1,includeDocuments:!1,includeLeaders:!1,includeResources:!1,includeTags:!1,includeUsedCustomFieldsFilled:!1}:{includeAccreditationsSlots:!1,includeCampaigns:e.includes(w$.Campaigns),includeChildren:e.includes(w$.Events),includeCreatedBy:e.includes(w$.CreatedBy),includeDocuments:e.includes(w$.Documents),includeLeaders:e.includes(w$.Leaders)||e.includes(w$.CategoryLeaders),includeResources:e.includes(w$.FillingRate)||e.includes(w$.AssignedResources),includeTags:e.includes(w$.Tags),includeUsedCustomFieldsFilled:e.includes(w$.UsedCustomFieldsFilled)}}!function(e){e.AssignedResources="resources",e.Campaigns="campaigns",e.CanLeadersAddMembers="canLeadersAddMembers",e.CanLeadersDeleteMembers="canLeadersDeleteMembers",e.CanLeadersEditColumns="canLeadersEditColumns",e.CanLeadersEditCustomFields="canLeadersEditCustomFields",e.CanLeadersEditMembers="canLeadersEditMembers",e.CanLeadersImportMembers="canLeadersImportMembers",e.CanLeadersSeeHiddenAccreditationsSlots="canLeadersSeeHiddenAccreditationsSlots",e.CategoryLeaders="categoryLeaders",e.CreatedAt="createdAt",e.CreatedBy="createdBy",e.DeadlineDate="deadlineDate",e.DelegationCategory="delegationCategory",e.DelegationSpaceLink="delegationSpaceLink",e.Description="description",e.Documents="documents",e.Events="events",e.FillingRate="fillingRate",e.Form="form",e.FormLink="formLink",e.Id="id",e.IsLocked="isLocked",e.Leaders="leaders",e.MaxResources="maxResources",e.Name="name",e.PrivateNote="privateNote",e.ShowFormLinkInDelegationSpace="showFormLinkInDelegationSpace",e.ShowInDelegation="showInDelegation",e.State="delegationState",e.Tags="tags",e.UsedCustomFieldsFilled="usedCustomFieldsFilled"}(w$||(w$={}));let E$=class extends _u{constructor(e,t,n){super(e,t,n)}getDelegationsFilters(e,t,n,i){return(0,Za.A)([{slug:w$.Name,name:this.t("nom_de_la_d_l_g_28087"),category:this.t("d_l_gations_78318"),fieldType:He.Text,hideEmpty:!0},{slug:w$.Description,name:this.t("Description"),category:this.t("d_l_gations_78318"),fieldType:He.Text},{slug:w$.PrivateNote,name:this.t("note_priv_e_06303"),category:this.t("d_l_gations_78318"),fieldType:He.Text},so(i)?{slug:w$.DelegationCategory,name:this.t("cat_gorie_00291"),category:this.t("d_l_gations_78318"),fieldType:He.Select,values:i,hideEmpty:!0}:null,{slug:"delegationState",name:this.t("status_06428"),category:this.t("d_l_gations_78318"),fieldType:He.Select,values:ln.map(e=>({id:e,name:e})),hideEmpty:!0},{slug:w$.CategoryLeaders,name:this.t("responsables_de_22220"),category:this.t("d_l_gations_78318"),fieldType:He.Select,needLoading:!0,organizationId:e,eventId:t},{slug:w$.Leaders,name:this.t("responsables_de_03381"),category:this.t("d_l_gations_78318"),fieldType:He.Select,needLoading:!0,organizationId:e,eventId:t},{slug:"form",name:this.t("Form"),category:this.t("d_l_gations_78318"),fieldType:He.Select,hideEmpty:!0,needLoading:!0,organizationId:e,eventId:t},{slug:"deadlineDate",name:this.t("date_limite_d_i_79779"),category:this.t("d_l_gations_78318"),fieldType:He.Date},{slug:"tag",name:this.t("Tag"),category:this.t("d_l_gations_78318"),fieldType:He.Select,needLoading:!0,organizationId:e,eventId:t,tagContext:wt.Delegations},{slug:"resources",name:this.t("nombre_de_membr_08851"),category:this.t("d_l_gations_78318"),fieldType:He.Number,hideEmpty:!0},{slug:"fillingRate",name:this.t("taux_de_remplis_11913"),category:this.t("d_l_gations_78318"),fieldType:He.Number,hideEmpty:!0},{slug:w$.ShowInDelegation,name:this.t("ShowInDelegationSpace"),category:this.t("d_l_gations_78318"),fieldType:He.Checkbox,hideEmpty:!0},{slug:w$.CanLeadersAddMembers,name:this.t("CanLeadersAddMembers"),category:this.t("d_l_gations_78318"),fieldType:He.Checkbox,hideEmpty:!0},{slug:w$.CanLeadersDeleteMembers,name:this.t("CanLeadersAddMembers"),category:this.t("d_l_gations_78318"),fieldType:He.Checkbox,hideEmpty:!0},{slug:w$.CanLeadersEditMembers,name:this.t("CanLeadersEditMembers"),category:this.t("d_l_gations_78318"),fieldType:He.Checkbox,hideEmpty:!0},{slug:w$.CanLeadersEditColumns,name:this.t("CanLeadersAddMembers"),category:this.t("d_l_gations_78318"),fieldType:He.Checkbox,hideEmpty:!0},{slug:w$.CanLeadersEditCustomFields,name:this.t("CanLeadersEditCustomFields"),category:this.t("d_l_gations_78318"),fieldType:He.Checkbox,hideEmpty:!0},{slug:w$.CanLeadersImportMembers,name:this.t("CanLeadersImportMembers"),category:this.t("d_l_gations_78318"),fieldType:He.Checkbox,hideEmpty:!0},{slug:w$.CanLeadersSeeHiddenAccreditationsSlots,name:this.t("CanLeadersSeeHiddenAccreditationsSlots"),category:this.t("d_l_gations_78318"),fieldType:He.Checkbox,hideEmpty:!0},{slug:w$.ShowFormLinkInDelegationSpace,name:this.t("afficher_le_lie_05841"),category:this.t("d_l_gations_78318"),fieldType:He.Checkbox,hideEmpty:!0},t?{slug:"accreditation",name:this.t("accr_ditations_39450"),category:this.t("d_l_gations_78318"),fieldType:He.Select,needLoading:!0,eventId:t}:null,{slug:w$.CreatedBy,name:this.t("cr_e_par_30622"),category:this.t("d_l_gations_78318"),fieldType:He.Select,hideEmpty:!0,needLoading:!0,organizationId:e,eventId:t},{slug:w$.CreatedAt,name:this.t("cr_e_le_02658"),category:this.t("d_l_gations_78318"),fieldType:He.Datetime,hideEmpty:!0},t?null:{slug:"event",name:this.t("_v_nement_22345"),category:this.t("d_l_gations_78318"),fieldType:He.Select,hideEmpty:!0,needLoading:!0,organizationId:e},{slug:w$.UsedCustomFieldsFilled,name:this.t("champs_personna_27238"),category:this.t("d_l_gations_78318"),fieldType:He.Checkbox,hideEmpty:!0},...this.customFieldsToFilters(n)])}getDelegationsPossibleColumns(e){return[{slug:w$.Id,name:this.t("id_51738"),isSearchable:!0,isSortable:!0,sortAttribute:Ae.Id,width:100},{slug:w$.Name,name:this.t("nom_de_la_d_l_g_28087"),isSearchable:!0,isSortable:!0,sortAttribute:Ae.Name,minWidth:240},{slug:w$.DelegationCategory,name:this.t("cat_gorie_00291"),isSearchable:!0,isSortable:!0,sortAttribute:Ae.Category,minWidth:240},{slug:w$.State,name:this.t("status_06428"),minWidth:180},{slug:w$.CategoryLeaders,name:this.t("responsables_de_22220"),isSearchable:!0,minWidth:320},{slug:w$.Leaders,name:this.t("responsables_de_03381"),isSearchable:!0,minWidth:320},{slug:w$.Form,name:this.t("Form"),isSearchable:!0,minWidth:180},{slug:w$.FormLink,name:this.t("FormLink"),minWidth:240},{slug:w$.DelegationSpaceLink,name:this.t("DelegationSpaceLink"),minWidth:240},{slug:w$.DeadlineDate,name:this.t("date_limite_d_i_79779"),minWidth:180},{slug:w$.MaxResources,name:this.t("MaxResources"),minWidth:180},{slug:w$.AssignedResources,name:this.t("membres_11310"),minWidth:240},{slug:w$.Tags,name:this.t("tags_79499"),isSearchable:!0,minWidth:240},{slug:w$.FillingRate,name:this.t("taux_de_remplis_11913"),minWidth:240},{slug:w$.CreatedBy,name:this.t("cr_e_par_30622"),isSearchable:!0,minWidth:180},{slug:w$.CreatedAt,name:this.t("cr_e_le_02658"),isSortable:!0,sortAttribute:Ae.CreatedAt,minWidth:180},{slug:w$.ShowInDelegation,name:this.t("ShowInDelegationSpace"),minWidth:180},{slug:w$.CanLeadersAddMembers,name:this.t("CanLeadersAddMembers"),minWidth:180},{slug:w$.CanLeadersEditMembers,name:this.t("CanLeadersEditMembers"),minWidth:180},{slug:w$.CanLeadersDeleteMembers,name:this.t("CanLeadersDeleteMembers"),minWidth:180},{slug:w$.CanLeadersEditColumns,name:this.t("CanLeadersEditColumns"),minWidth:180},{slug:w$.CanLeadersEditCustomFields,name:this.t("CanLeadersEditCustomFields"),minWidth:180},{slug:w$.CanLeadersImportMembers,name:this.t("CanLeadersImportMembers"),minWidth:180},{slug:w$.CanLeadersSeeHiddenAccreditationsSlots,name:this.t("CanLeadersSeeHiddenAccreditationsSlots"),minWidth:180},{slug:w$.ShowFormLinkInDelegationSpace,name:this.t("afficher_le_lie_05841"),minWidth:180},{slug:w$.IsLocked,name:this.t("IsLocked"),minWidth:180},{slug:w$.Events,name:this.t("_v_nements_53672"),minWidth:320},{slug:w$.Campaigns,name:this.t("campagnes_que_l_81468"),minWidth:320},{slug:w$.Documents,name:this.t("documents_que_l_18755"),minWidth:320},{slug:w$.UsedCustomFieldsFilled,name:this.t("champs_personna_27238"),minWidth:180},...this.customFieldsToPossibleColumns(e)]}};function T$(e,t,n){const[i,s]=(0,L.useState)(null);return(0,L.useCallback)(async()=>{if(i)return i;{const i=await e(t,await Y()),o=n(i);return s(o),o}},[i,e,t])}E$=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[hu,Jc,qn])],E$);const z$=L.createContext({}),O$=e=>{const t=T$(Ro,{organizationId:e.organizationId,eventId:e.eventId,level:e.eventId?ot.Event:ot.Organization},e=>e.organization.campaigns.nodes),n=T$(Ro,{organizationId:e.organizationId,eventId:e.eventId,level:e.eventId?ot.Event:ot.Organization},e=>e.organization.event?.customDocuments??[]),s=T$(Ro,{organizationId:e.organizationId,eventId:e.eventId,level:e.eventId?ot.Event:ot.Organization},e=>e.organization.delegationsCategories.nodes),o=T$(Ro,{organizationId:e.organizationId,eventId:e.eventId,level:e.eventId?ot.Event:ot.Organization},e=>e.organization.forms.nodes),r=T$(Ro,{organizationId:e.organizationId,eventId:e.eventId,level:e.eventId?ot.Event:ot.Organization},e=>e.organization.tags.nodes);return(0,i.jsx)(z$.Provider,{value:{getCampaigns:t,getCustomDocuments:n,getDelegationsCategories:s,getEditPath:e.getEditPath,getShowPath:e.getShowPath,getForms:o,getTags:r},children:e.children})};function R$(){return L.useContext(z$)}const $$=e=>{const t=Xn(),{massActions:n,segment:s}=vy(),o=(0,L.useCallback)(()=>{n.toggleSelectAll("unchecked"),n.setIsAllSelected(!1)},[n]),r=(0,L.useCallback)(()=>{n.setIsAllSelected(!0)},[n]);return(0,i.jsxs)(Ba,{align:"center",css:{background:"$gray50",borderRadius:"$1",padding:"$3 $4"},gap:"3",children:[(0,i.jsx)(Ar,{fontSize:"textMd",fontWeight:"medium",children:(0,i.jsx)(nl,{icon:"circle-exclamation"})}),n.isAllSelected?(0,i.jsx)(Ar,{color:"gray700",css:{flex:"1"},fontWeight:"medium",children:e.segmentSelectedText}):(0,i.jsx)(Ar,{color:"gray700",css:{flex:"1"},fontWeight:"medium",children:e.pageSelectedText}),n.isAllSelected?(0,i.jsx)(Ar,{color:"primary500",css:{cursor:"pointer"},fontWeight:"medium",onClick:o,children:t("effacer_la_s_le_85095")}):(0,i.jsx)(Ar,{color:"primary500",css:{cursor:"pointer"},fontWeight:"medium",onClick:r,children:t("s_lectionner_le_71777",s.count,s.name)})]})},D$=e=>{const{translate:t,params:{organizationId:n}}=vl(),[s,o]=(0,L.useState)(!1),[r,a]=(0,L.useState)(it.Add),[l,d]=(0,L.useState)([]),[c,u]=(0,L.useState)(e.roles[0]?.id??null),[h,m,g]=Wc(""),{usersInfosOptions:p,isLoading:f}=Xb({organizationId:n,eventId:null,hasSelected:so(l),nameDebounced:m,userInfoIds:l}),_=so(l);return(0,i.jsx)(Lb,{isOpen:!0,onClose:e.onClose,children:(0,i.jsxs)(Nb,{children:[(0,i.jsx)(Mb,{icon:"user-gear",children:t("_diter_les_resp_29588")}),(0,i.jsxs)(Fb,{gap:"6",children:[(0,i.jsxs)($u,{label:t("que_souhaitez_v_87607"),value:r,onChange:a,children:[(0,i.jsx)("option",{value:it.Add,children:t("ajouter_des_res_84773")}),(0,i.jsx)("option",{value:it.Replace,children:t("remplacer_les_r_60774")}),(0,i.jsx)("option",{value:it.Delete,children:t("supprimer_des_r_69379")})]}),(0,i.jsx)(yc,{isSearchLoading:f,isSearchVisible:!0,label:t("reponsable_82458_plural"),multiple:!0,renderOnPortal:!0,searchElement:(0,i.jsx)(Bl,{icon:"magnifying-glass",placeholder:t("rechercher_un_m_05904"),state:"search",value:h,onChange:g}),values:l,onChange:d,children:p}),e.showRoleSelect&&r!==it.Delete&&(0,i.jsx)($u,{label:t("r_le_59302"),shouldParseAsInt:!0,value:c,onChange:u,children:e.roles.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})]}),(0,i.jsx)(Pb,{children:(0,i.jsx)(zl,{disabled:!_,isLoading:s,onClick:async()=>{o(!0),await e.onSuccess(r,l.map(e=>({userInfoId:e,roleId:c}))),e.onClose(),o(!1)},children:t("_diter_62574")})})]})})},P$=e=>(0,i.jsx)(Iu.JY,{onDragEnd:({reason:t,source:n,destination:i})=>{"DROP"===t&&i&&n.index!==i.index&&e.setSelectedColumns(lo(e.selectedColumns,n.index,i.index))},children:(0,i.jsx)(Iu.gL,{droppableId:"1",children:t=>(0,i.jsxs)(Ba,{css:{background:"$gray50",bd:"gray200 1",padding:"$4"},direction:"column",...t.droppableProps,ref:t.innerRef,children:[e.selectedColumns.map((e,t)=>(0,i.jsx)(Iu.sx,{draggableId:e.slug,index:t,children:t=>(0,i.jsxs)(Ba,{align:"center",css:{background:"white",border:"1px solid $gray200",borderTop:"none",px:"$4","&:first-child":{borderTop:"1px solid $gray200",borderTopLeftRadius:"$1",borderTopRightRadius:"$1"},"&:last-child":{borderBottomLeftRadius:"$1",borderBottomRightRadius:"$1"}},gap:"3",height:40,...t.draggableProps,ref:t.innerRef,children:[(0,i.jsx)(Ar,{color:"gray300",css:{cursor:"grab"},...t.dragHandleProps,children:(0,i.jsx)(nl,{icon:"grip-vertical",iconStyle:"solid"})}),(0,i.jsx)(Ar,{color:"gray800",children:e.name})]})},e.slug)),t.placeholder]})})}),F$=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=vl(),o=Zn(Zh),{data:r}=Qn("query MassColumnsCustomFields($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n ...OrganizationCustomFields\n }\n}\n",{organizationId:n},[Vs.OrganizationCustomFieldsFragment]),{mutate:a,isLoading:l}=Oo(),d=(0,L.useMemo)(()=>o.getDelegationMembersPossibleColumns(r.organization?.customFields.nodes??[],{isWeezeventConnected:!0,positionDisplay:_t.Position,slotDisplay:It.Custom}),[o,r.organization]),[c,u]=(0,L.useState)(""),h=(0,L.useMemo)(()=>d.filter(e=>!m(c)||e.name.trim().toLowerCase().includes(c.trim().toLowerCase())),[d,c]),[g,p]=(0,L.useState)([]);return(0,i.jsx)(Lb,{isOpen:!0,onClose:e.onClose,children:(0,i.jsxs)(Nb,{children:[(0,i.jsx)(Mb,{icon:"line-columns",children:t("_diter_les_colo_38837")}),(0,i.jsxs)(Fb,{gap:"2",children:[(0,i.jsx)(Ar,{font:"gray800 textSm medium",children:t("quelles_colonne_05047")}),so(g)&&(0,i.jsx)(P$,{selectedColumns:g,setSelectedColumns:p}),(0,i.jsxs)(Wd,{children:[(0,i.jsx)(Xd,{children:(0,i.jsx)(zl,{color:"invisible",leftIcon:"plus",children:t("ajouter_des_col_04043")})}),(0,i.jsx)(Zd,{css:{padding:"0"},placement:"bottom-start",renderOnPortal:!0,width:400,children:(0,i.jsxs)(Ba,{css:{py:"$3"},direction:"column",gap:"3",width:1,children:[(0,i.jsx)(Ar,{css:{px:"$3"},children:(0,i.jsx)(Bl,{icon:"magnifying-glass",placeholder:t("rechercher_un_c_86475"),state:"search",value:c,onChange:u})}),(0,i.jsx)(Ar,{css:{maxHeight:"300px",overflowY:"auto",px:"$3"},children:h.map(e=>(0,i.jsx)(bc,{isCheckbox:!0,isRadio:!1,isSelected:g.includes(e),value:e.slug,onClick:()=>{p(t=>ro(t,e,!t.includes(e)))},children:e.name},e.slug))})]})})]})]}),(0,i.jsx)(Pb,{children:(0,i.jsx)(zl,{isLoading:l,onClick:async()=>{const i=(await a({organizationId:n,eventId:s,massEdit:{reset:!1,selecteds:e.selecteds,slug:Ce.Columns,strategy:it.Replace,value:g.map(e=>e.slug)}})).numberOfEdited;e.onSuccess(t("les_colonnes_de_83023",i)),e.onClose()},children:t("mettre_jour_85141")})})]})})},M$=e=>{const{translate:t}=vl(),{mutate:n,isLoading:s}=function(e={}){return ei("mutation DelegationsMassMove(\n $organizationId: OrganizationId!\n $eventId: EventId\n $massMove: MassDelegationsMove!\n) {\n numberOfDelegations: delegationsMassMove(\n organizationId: $organizationId\n eventId: $eventId\n massMove: $massMove\n )\n}\n",e)}(),[o,r]=(0,L.useState)([]),[a,l]=(0,L.useState)([]),{data:d}=Qn("query DelegationsMassMoveInfos(\n $organizationId: OrganizationId!\n $level: OrganizationEventLevel!\n $eventId: EventId\n) {\n organization(id: $organizationId) {\n events {\n nodes {\n id\n name\n }\n }\n\n forms(level: $level, eventId: $eventId) {\n nodes {\n id\n name\n }\n }\n }\n}\n",{organizationId:e.organizationId,level:e.eventId?ot.Organization:ot.Event,eventId:o[0]},[]);const c=(!!e.eventId||so(o))&&so(a);return(0,i.jsxs)(au,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Ba,{justify:"center",children:(0,i.jsx)(sC,{color:"primary",icon:"clone"})}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(Ar,{font:"gray900 textLg medium",textAlign:"center",children:t("copier_les_d_l_43406")}),e.eventId&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ar,{color:"gray500",textAlign:"center",children:t("cela_liera_vos_60643")})]}),(0,i.jsx)(Ya,{height:"7"}),!e.eventId&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yc,{isSearchVisible:!0,label:t("_v_nement_22345"),values:o,onChange:r,children:(d.organization?.events.nodes??[]).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(Ya,{height:"4"})]}),(e.eventId||so(o))&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(yc,{isSearchVisible:!0,label:t("formulaire_ut_59771"),values:a,onChange:l,children:(d.organization?.forms.nodes??[]).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsxs)(Ba,{gap:"3",justify:"end",children:[(0,i.jsx)(zl,{disabled:!c,isLoading:s,onClick:async()=>{const i=(await n({organizationId:e.organizationId,eventId:e.eventId,massMove:{eventId:e.eventId?null:o[0],formId:a[0],selecteds:e.selecteds}})).numberOfDelegations;e.onSuccess(t("_1_d_l_gations_15078",i)),e.onClose()},children:t("copier_75889")}),(0,i.jsx)(zl,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},N$=()=>{const e=Xn(),{isOrganizationAdmin:t}=TI(),{isEventAdmin:n}=wb(),{eventId:s,massActions:o,onMassEditSuccess:r,organizationId:a,predicates:l,segment:d}=vy(),{showNotification:c}=Ob(),{mutate:u}=Oo(),{mutate:h}=function(e={}){return ei("mutation DelegationsMassLeadersEdit(\n $organizationId: OrganizationId!\n $eventId: EventId\n $massLeaders: MassLeadersInput!\n) {\n numberOfDelegations: delegationsMassLeadersEdit(\n organizationId: $organizationId\n eventId: $eventId\n massLeaders: $massLeaders\n )\n}\n",e)}(),{mutate:g}=sa(),[p,f]=(0,L.useState)(!1),[_,x]=(0,L.useState)(!1),[I,v]=(0,L.useState)(!1),[b,j]=(0,L.useState)(!1),[C,y]=(0,L.useState)(!1),k=t||n,A=o.getSelectedsInput(l,null),w=o.isAllSelected?d.count:o.numberOfSelected,S=(0,L.useCallback)(e=>{m(e)&&c(e),r()},[r]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zl,{onClick:()=>{f(!0)},children:e("_diter_une_prop_26724")}),(0,i.jsxs)(Wd,{children:[(0,i.jsx)(Xd,{children:(0,i.jsx)(zl,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Zd,{placement:"bottom-end",children:[k&&(0,i.jsx)(Kd,{icon:"clone",onClick:()=>{x(!0)},children:e(s?"copier_dans_la_91936":"copier_dans_un_20230")}),k&&(0,i.jsx)(Kd,{icon:"user-gear",onClick:()=>v(!0),children:e("_diter_les_resp_29588")}),k&&(0,i.jsx)(Kd,{icon:"line-columns",onClick:()=>j(!0),children:e("_diter_les_colo_38837")}),k&&(0,i.jsx)(Xu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Kd,{color:"red",icon:"trash-can",onClick:()=>{y(!0)},children:e("supprimer_43083")})]})]}),p&&(0,i.jsx)(IA,{eventId:s,mutate:e=>u({organizationId:a,eventId:s,massEdit:e}),organizationId:a,selecteds:A,onClose:()=>{f(!1)},onSuccess:t=>{S(e("_1_d_l_gations_08105",t))}}),_&&(0,i.jsx)(M$,{eventId:s,organizationId:a,selecteds:A,onClose:()=>{x(!1)},onSuccess:r}),I&&(0,i.jsx)(D$,{roles:[],showRoleSelect:!1,onClose:()=>v(!1),onSuccess:async(t,n)=>{const i=(await h({organizationId:a,eventId:s,massLeaders:{leaders:n,strategy:t,selecteds:A}})).numberOfDelegations;S(e("les_responsable_32087",i))}}),b&&(0,i.jsx)(F$,{selecteds:A,onClose:()=>j(!1),onSuccess:S}),C&&(0,i.jsx)(cA,{buttonText:e("supprimer_43083"),subtext:[e("_tes_vous_s_r_d_34990")],text:e("suppression_de_99024",w),onClose:()=>{y(!1)},onDelete:async()=>{const t=(await g({organizationId:a,eventId:s,selecteds:A})).numberOfDelegations;S(e("_1_d_l_gations_40887",t))}})]})},L$=e=>{const t=Xn(),n=Zn(Vv);return(0,i.jsxs)(Ba,{align:"center",css:{"& > div":{width:"100%"}},gap:"2",width:1,children:[(0,i.jsx)(Ar,{children:t("_1_2_membres_04485",e.assignedResources,n.toNumberOrInfinity(e.resources))}),(0,i.jsx)(Ow,{percent:e.assignedResources/(e.resources||e.assignedResources)})]})},B$=e=>{const t=(0,L.useMemo)(()=>(e.delegation.children||[]).flatMap(e=>e.event?[{id:e.event.id,color:"gray",icon:null,text:e.event.name}]:[]),[e.delegation]);return(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Py,{badges:t})})},V$=(0,i.jsx)(wl,{});function U$(e){const[t,n]=(0,L.useState)(!0),[i,s]=(0,L.useState)(null);return(0,L.useEffect)(()=>{e().then(e=>{s(e),n(!1)},()=>{n(!1)})},[]),{isLoading:t,loader:t?V$:null,result:i}}const W$=e=>{const{translate:t}=vl(),{getCampaigns:n}=R$(),{result:s,isLoading:o}=U$(n);return o?(0,i.jsxs)(Ba,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(Ml,{children:t("tags_79499")}),(0,i.jsx)(lc,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(yc,{isSearchVisible:!0,label:t("Campaigns"),multiple:!0,renderOnPortal:!0,values:e.value,onChange:e.setValue,children:s.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})},G$=e=>{const{eventId:t,organizationId:n}=vy(),{mutate:s}=Oo();return(0,i.jsx)(yy,{column:e.column,initialValue:e.initialValue,mutate:async i=>s({organizationId:n,eventId:t,massEdit:{reset:!1,selecteds:{ids:[e.delegation.id]},slug:e.property,strategy:it.Replace,value:i}}),reload:e.reload,renderInput:e.renderInput,renderValue:e.renderValue,updatable:!0})},H$=e=>{const t=(0,L.useMemo)(()=>e.delegation.campaigns||[],[e.delegation]),n=(0,L.useMemo)(()=>t.map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[t]);return(0,i.jsx)(G$,{column:e.column,delegation:e.delegation,initialValue:t.map(e=>e.id),property:Ce.Campaigns,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(W$,{setValue:t,value:e}),renderValue:()=>(0,i.jsx)(Py,{badges:n})})},q$=({children:e,isEditMode:t,title:n,updatable:s})=>t&&s?(0,i.jsx)(Ar,{css:{ellipsis:!0},font:"gray900 textSm medium",title:n,width:1,children:n}):(0,i.jsx)(i.Fragment,{children:e}),K$=e=>{const{translate:t}=vl(),{getDelegationsCategories:n}=R$(),{result:s,isLoading:o}=U$(n);return o?(0,i.jsxs)(Ba,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(Ml,{children:t("Category")}),(0,i.jsx)(lc,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)($u,{label:t("Category"),shouldParseAsInt:!0,value:e.value,onChange:e.setValue,children:s.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})},Y$=e=>{const{params:{organizationId:t,eventId:n}}=vl(),{isEditMode:s}=vy();return(0,i.jsx)(G$,{column:e.column,delegation:e.delegation,initialValue:e.delegation.delegationCategory.id,property:Ce.Category,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(K$,{setValue:t,value:e}),renderValue:()=>(0,i.jsx)(q$,{isEditMode:s,title:e.delegation.delegationCategory.name,updatable:!0,children:(0,i.jsx)(Zc,{to:hs.DELEGATION_CATEGORY({organizationId:t,eventId:n,delegationCategoryId:e.delegation.delegationCategory.id}),children:e.delegation.delegationCategory.name})})})},Z$=e=>{const t=(0,L.useMemo)(()=>(0,uc.A)(e.delegation.delegationCategory.leaders,e=>u(e.userInfo.nameOrEmail)).map(e=>({id:e.userInfo.id,color:"gray",icon:null,text:e.userInfo.nameOrEmail})),[e.delegation]);return(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Py,{badges:t})})},X$=e=>{const t=Xn(),n=Zn(Jc);return(0,i.jsx)(G$,{column:e.column,delegation:e.delegation,initialValue:e.delegation.deadlineDate,property:Ce.DeadlineDate,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(Mu,{label:t("date_limite_d_i_79779"),value:e,onChange:n}),renderValue:e.delegation.deadlineDate?n.toLocaleString(e.delegation.deadlineDate,eo.DateOnly.MonthLong):"-"})},J$=e=>{const{translate:t}=vl(),{getCustomDocuments:n}=R$(),{result:s,isLoading:o}=U$(n);return o?(0,i.jsxs)(Ba,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(Ml,{children:t("tags_79499")}),(0,i.jsx)(lc,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(yc,{isSearchVisible:!0,label:t("Documents"),multiple:!0,renderOnPortal:!0,values:e.value,onChange:e.setValue,children:s.map(e=>(0,i.jsx)("option",{value:e.slug,children:e.name},e.slug))})},Q$=e=>{const t=(0,L.useMemo)(()=>e.delegation.customDocuments||[],[e.delegation]),n=(0,L.useMemo)(()=>t.map(e=>({id:e.slug,color:"gray",icon:null,text:e.name})),[t]);return(0,i.jsx)(G$,{column:e.column,delegation:e.delegation,initialValue:t.map(e=>e.slug),property:Ce.Documents,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(J$,{setValue:t,value:e}),renderValue:()=>(0,i.jsx)(Py,{badges:n})})},eD=e=>{const t=Xn(),{getForms:n}=R$(),{result:s,isLoading:o}=U$(n);return o?(0,i.jsxs)(Ba,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(Ml,{children:t("Form")}),(0,i.jsx)(lc,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)($u,{label:t("Form"),shouldParseAsInt:!0,value:e.value,onChange:e.setValue,children:s.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})},tD=e=>(0,i.jsx)(G$,{column:e.column,delegation:e.delegation,initialValue:e.delegation.form.id,property:Ce.Form,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(eD,{setValue:t,value:e}),renderValue:e.delegation.form.name}),nD=e=>{const t=Xn();return(0,i.jsx)(G$,{column:e.column,delegation:e.delegation,initialValue:e.delegation.lockedAt?.isValid??!1,property:Ce.IsLocked,reload:e.reload,renderInput:(e,n)=>(0,i.jsxs)($u,{label:t("IsLocked"),shouldParseAsBoolean:!0,value:e,onChange:n,children:[(0,i.jsx)("option",{value:"true",children:t("oui_54361")}),(0,i.jsx)("option",{value:"false",children:t("non_33516")})]}),renderValue:e.delegation.lockedAt?.isValid?t("oui_54361"):t("non_33516")})},iD=e=>{const t=(0,L.useMemo)(()=>(0,uc.A)(e.delegation.leaders,e=>u(e.nameOrEmail)).map(e=>({id:e.id,color:"gray",icon:null,text:e.nameOrEmail})),[e.delegation]);return(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Py,{badges:t})})},sD=e=>{const t=Xn(),n=Zn(Vv);return(0,i.jsx)(G$,{column:e.column,delegation:e.delegation,initialValue:e.delegation.maxResources||"",property:Ce.MaxResources,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(Bl,{label:t("MaxResources"),shouldParseAsInt:!0,value:e,onChange:n}),renderValue:n.toNumberOrInfinity(e.delegation.maxResources)})},oD=e=>{const{translate:t}=vl(),{isEditMode:n}=vy(),{getShowPath:s}=R$();return(0,i.jsx)(G$,{column:e.column,delegation:e.delegation,initialValue:e.delegation.name,property:Ce.Name,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(Bl,{label:t("nom_de_la_d_l_g_28087"),value:e,onChange:n}),renderValue:()=>(0,i.jsx)(q$,{isEditMode:n,title:e.delegation.name,updatable:!0,children:(0,i.jsx)(Zc,{to:s(e.delegation.id),children:e.delegation.name})})})},rD=e=>{const t=Xn();return(0,i.jsx)(G$,{column:e.column,delegation:e.delegation,initialValue:e.value,property:e.property,reload:e.reload,renderInput:(n,s)=>(0,i.jsxs)($u,{label:e.label,shouldParseAsBoolean:!0,value:n,onChange:s,children:[(0,i.jsx)("option",{value:"true",children:t("oui_54361")}),(0,i.jsx)("option",{value:"false",children:t("non_33516")})]}),renderValue:e.value?t("oui_54361"):t("non_33516")})},aD=e=>{const{translate:t}=vl(),{getTags:n}=R$(),{result:s,isLoading:o}=U$(n);return o?(0,i.jsxs)(Ba,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(Ml,{children:t("tags_79499")}),(0,i.jsx)(lc,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(yc,{isSearchVisible:!0,label:t("tags_79499"),multiple:!0,renderOnPortal:!0,values:e.value,onChange:e.setValue,children:s.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})},lD=e=>{const t=(0,L.useMemo)(()=>e.delegation.tags||[],[e.delegation]),n=(0,L.useMemo)(()=>t.map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[t]);return(0,i.jsx)(G$,{column:e.column,delegation:e.delegation,initialValue:t.map(e=>e.id),property:Ce.Tag,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(aD,{setValue:t,value:e}),renderValue:()=>(0,i.jsx)(Py,{badges:n})})},dD=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=vl(),{mutate:o}=Oo(),r=(0,L.useCallback)((t,n)=>o({organizationId:e.organizationId,eventId:e.eventId,massEdit:{reset:!1,selecteds:{ids:[e.row.id]},slug:n,strategy:it.Replace,value:t}}),[e.row,o]),a=(0,L.useMemo)(()=>mg({organizationId:n,eventId:s,delegationId:e.row.id,formId:e.row.form.id}),[e.row]),l=(0,L.useMemo)(()=>hg(n,hs.DELEGATION({organizationId:n,eventId:s,delegationId:e.row.id})),[e.row]);return e.column.slug===w$.Id?(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.id}):e.column.slug===w$.Name?(0,i.jsx)(oD,{column:e.column,delegation:e.row,reload:e.reloadRow}):e.column.slug===w$.DelegationCategory?(0,i.jsx)(Y$,{column:e.column,delegation:e.row,reload:e.reloadRow}):e.column.slug===w$.State?(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(rc,{...Bj(e.row.state),children:t(e.row.state)})}):e.column.slug===w$.Leaders?(0,i.jsx)(iD,{column:e.column,delegation:e.row}):e.column.slug===w$.CategoryLeaders?(0,i.jsx)(Z$,{column:e.column,delegation:e.row}):e.column.slug===w$.Form?(0,i.jsx)(tD,{column:e.column,delegation:e.row,reload:e.reloadRow}):e.column.slug===w$.FormLink?(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Zc,{to:a,children:a})}):e.column.slug===w$.DelegationSpaceLink?(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Zc,{to:l,children:l})}):e.column.slug===w$.DeadlineDate?(0,i.jsx)(X$,{column:e.column,delegation:e.row,reload:e.reloadRow}):e.column.slug===w$.MaxResources?(0,i.jsx)(sD,{column:e.column,delegation:e.row,reload:e.reloadRow}):e.column.slug===w$.AssignedResources?(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(L$,{assignedResources:e.row.numberOfResources,resources:e.row.maxResources})}):e.column.slug===w$.Tags?(0,i.jsx)(lD,{column:e.column,delegation:e.row,reload:e.reloadRow}):e.column.slug===w$.FillingRate?(0,i.jsxs)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:[e.row.fillingRate,"%"]}):e.column.slug===w$.CreatedBy?(0,i.jsx)(NR,{column:e.column,createdBy:e.row.createdBy}):e.column.slug===w$.ShowInDelegation?(0,i.jsx)(rD,{column:e.column,delegation:e.row,label:t("ShowInDelegationSpace"),property:Ce.ShowInDelegationSpace,reload:e.reloadRow,value:e.row.showInDelegationSpace}):e.column.slug===w$.CanLeadersAddMembers?(0,i.jsx)(rD,{column:e.column,delegation:e.row,label:t("CanLeadersAddMembers"),property:Ce.CanLeadersAddMembers,reload:e.reloadRow,value:e.row.canLeadersAddMembers}):e.column.slug===w$.CanLeadersDeleteMembers?(0,i.jsx)(rD,{column:e.column,delegation:e.row,label:t("CanLeadersDeleteMembers"),property:Ce.CanLeadersDeleteMembers,reload:e.reloadRow,value:e.row.canLeadersDeleteMembers}):e.column.slug===w$.CanLeadersEditColumns?(0,i.jsx)(rD,{column:e.column,delegation:e.row,label:t("CanLeadersEditColumns"),property:Ce.CanLeadersEditColumns,reload:e.reloadRow,value:e.row.canLeadersEditColumns}):e.column.slug===w$.CanLeadersEditMembers?(0,i.jsx)(rD,{column:e.column,delegation:e.row,label:t("CanLeadersEditMembers"),property:Ce.CanLeadersEditMembers,reload:e.reloadRow,value:e.row.canLeadersEditMembers}):e.column.slug===w$.CanLeadersEditCustomFields?(0,i.jsx)(rD,{column:e.column,delegation:e.row,label:t("CanLeadersEditCustomFields"),property:Ce.CanLeadersEditCustomFields,reload:e.reloadRow,value:e.row.canLeadersEditCustomFields}):e.column.slug===w$.CanLeadersImportMembers?(0,i.jsx)(rD,{column:e.column,delegation:e.row,label:t("CanLeadersImportMembers"),property:Ce.CanLeadersImportMembers,reload:e.reloadRow,value:e.row.canLeadersImportMembers}):e.column.slug===w$.CanLeadersSeeHiddenAccreditationsSlots?(0,i.jsx)(rD,{column:e.column,delegation:e.row,label:t("CanLeadersSeeHiddenAccreditationsSlots"),property:Ce.CanLeadersSeeHiddenAccreditationsSlots,reload:e.reloadRow,value:e.row.canLeadersSeeHiddenAccreditationsSlots}):e.column.slug===w$.ShowFormLinkInDelegationSpace?(0,i.jsx)(rD,{column:e.column,delegation:e.row,label:t("afficher_le_lie_05841"),property:Ce.ShowFormLinkInDelegationSpace,reload:e.reloadRow,value:e.row.showFormLinkInDelegationSpace}):e.column.slug===w$.IsLocked?(0,i.jsx)(nD,{column:e.column,delegation:e.row,reload:e.reloadRow}):e.column.slug===w$.CreatedAt?(0,i.jsx)(MR,{column:e.column,insertedAt:e.row.insertedAt}):e.column.slug===w$.Campaigns?(0,i.jsx)(H$,{column:e.column,delegation:e.row,reload:e.reloadRow}):e.column.slug===w$.Documents?(0,i.jsx)(Q$,{column:e.column,delegation:e.row,reload:e.reloadRow}):"events"===e.column.slug?(0,i.jsx)(B$,{column:e.column,delegation:e.row}):e.column.slug===w$.UsedCustomFieldsFilled?(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:t(e.row.usedCustomFieldsFilled?.toString()||"-")}):(0,i.jsx)(By,{column:e.column,customField:e.customField,fields:e.row.fields,mutate:r,reload:e.reloadRow,updatable:!0})},cD=e=>{const{history:t,translate:n}=vl(),{getEditPath:s}=R$(),{mutate:o}=na(),[r,a]=(0,L.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Yc,{children:[(0,i.jsx)(Kd,{icon:"pen",to:s(e.delegation.id),children:n("_diter_62574")}),(0,i.jsx)(Kd,{icon:"clone",onClick:async()=>{const{delegationDuplicate:n}=await o({organizationId:e.organizationId,eventId:e.eventId,delegationId:e.delegation.id});t.push(s(n.id))},children:n("dupliquer_28256")}),(0,i.jsx)(Xu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Kd,{color:"red",icon:"trash-can",onClick:async()=>{a(!0)},children:n("supprimer_43083")})]}),r&&(0,i.jsx)(Qw,{delegation:e.delegation,onClose:()=>{a(!1)},onSuccess:e.reload})]})},uD=({columns:e,customFields:t,delegation:n,eventId:s,organizationId:o,state:r,reload:a,reloadDelegation:l,toggleRow:d})=>{const{canDelegationEdit:c}=$S(),{getEditPath:u}=R$(),h=_y(t),m=(0,L.useCallback)(()=>{l(n.id)},[n,l]);return(0,i.jsxs)(Mc,{css:{background:"checked"===r?"$primary100":"white","&:hover":{background:"checked"===r?"$primary100":"$gray100"}},onMouseLeave:e=>{Vd(e.target)},children:[c&&(0,i.jsx)(Oc,{justify:"center",width:48,children:(0,i.jsx)(fc,{state:r,onClick:(e,t)=>{Dl(t),d(`d${n.id}`,e)}})}),e.map(e=>{const t=h.get(e.slug);return(0,i.jsx)(dD,{column:e,customField:t,eventId:s,organizationId:o,reloadRow:m,row:n},e.slug)}),c&&(0,i.jsxs)(Xc,{justify:"center",children:[(0,i.jsx)(km,{children:(0,i.jsx)(Sm,{children:(0,i.jsx)(Ar,{children:(0,i.jsx)(nl,{icon:"pen",to:u(n.id)})})})}),(0,i.jsx)(cD,{delegation:n,eventId:s,organizationId:o,reload:a})]})]})},hD=e=>{const{canDelegationEdit:t}=$S(),{columns:n,columnsSearch:s,limit:o,massActions:r,nameDebounced:a,offset:l,possibleColumns:d,predicates:c,reloadKey:u,rendering:h,setLimit:g,setOffset:p,setSort:f,sort:_}=vy(),x=(0,L.useMemo)(()=>S$(n,h),[n,h]),{data:I,isLoading:v,reload:b}=ia({...x,organizationId:e.organizationId,level:e.level,eventId:e.eventId,name:m(a)?a:null,columnsSearch:so(s)?s:null,predicates:c,limit:o,offset:l,sort:_}),j=(0,L.useMemo)(()=>n.flatMap(e=>(0,Za.A)([d.find(t=>t.slug===e)])),[d,n]),{numberOfPages:C,totalCount:y}=Su(I.data?.rows),[k,A]=(0,L.useState)([]),[w,S]=(0,L.useState)({}),E=(0,L.useCallback)(async t=>{S(e=>({...e,[t]:!0}));const{data:{row:n}}=await(i={...x,organizationId:e.organizationId,id:t},s=await Y(),go("query DelegationsDelegation(\n $organizationId: OrganizationId!\n $id: DelegationId!\n $includeAccreditationsSlots: Boolean!\n $includeCampaigns: Boolean!\n $includeChildren: Boolean!\n $includeCreatedBy: Boolean!\n $includeDocuments: Boolean!\n $includeLeaders: Boolean!\n $includeResources: Boolean!\n $includeTags: Boolean!\n $includeUsedCustomFieldsFilled: Boolean!\n) {\n data: organization(id: $organizationId) {\n row: delegation(id: $id) {\n ...DelegationsDelegation\n }\n }\n}\n",{variables:i,token:s||void 0,fragments:[Vs.DelegationsDelegationFragment]}));var i,s;A(e=>e.map(e=>e.id===t?n:e)),S(e=>({...e,[t]:!1}))},[x,S,A]);return(0,L.useEffect)(()=>{A(I.data?.rows.nodes??[])},[I.data]),(0,L.useEffect)(()=>{u>1&&b()},[u]),(0,L.useEffect)(()=>{r.setStates(Object.fromEntries((I.data?.rows.nodes??[]).map(e=>[`d${e.id}`,{id:e.id,state:"unchecked"}])))},[I.data,r.setStates]),(0,i.jsx)(Ba,{css:{flex:"1",overflow:"hidden"},width:1,children:(0,i.jsx)(Cm,{"aria-busy":v,headerRow:(0,i.jsxs)(kc,{children:[t&&(0,i.jsx)(Gc,{justify:"center",width:48,children:(0,i.jsx)(fc,{state:r.selectAllState,onClick:r.toggleSelectAll})}),j.map(e=>e.isSortable?(0,i.jsx)(jm,{attribute:e.sortAttribute||e.slug,minWidth:e.minWidth,setSort:f,sort:_,width:e.width,children:(0,i.jsx)(Ar,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug):(0,i.jsx)(Gc,{minWidth:e.minWidth,width:e.width,children:(0,i.jsx)(Ar,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug)),t&&(0,i.jsx)(Gc,{width:100})]}),paginationRow:(0,i.jsx)(Nc,{css:{borderTop:"1px solid $gray200"},children:(0,i.jsx)(Fc,{limit:o,numberOfPages:C,offset:l,setLimit:g,setOffset:p,showLimits:!0,totalCount:y})}),children:v?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Hc,{}),(0,i.jsx)(Hc,{}),(0,i.jsx)(Hc,{})]}):k.map(t=>w[t.id]?(0,i.jsx)(Hc,{},t.id):(0,i.jsx)(uD,{columns:j,customFields:e.customFields,delegation:t,eventId:e.eventId,organizationId:e.organizationId,reload:b,reloadDelegation:E,state:r.states[`d${t.id}`]?.state??"unchecked",toggleRow:r.toggleRow},t.id))})})},mD=()=>{const{history:e,translate:t,params:{organizationId:n}}=vl();return(0,i.jsx)(g$,{children:(0,i.jsx)(Kb,{permissions:Hb.DELEGATION_EDIT,children:(0,i.jsx)(zl,{onClick:()=>{e.push(Ps.COMMUNITY_CREATE_DELEGATION(n))},children:t("cr_er_une_d_l_g_23035")})})})},gD=e=>{const{translate:t,params:{organizationId:n}}=vl(),{canDelegationEdit:s,canSegmentEdit:o}=DS(),{limit:r,segment:a}=vy();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(mD,{}),0===e.numberOfDelegations?(0,i.jsx)(aj,{css:{overflow:"hidden"},children:(0,i.jsx)(Ba,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(Gk,{title:t("vous_n_avez_pas_32103")})})}):(0,i.jsxs)(aj,{children:[(0,i.jsx)(m$,{searchRow:(0,i.jsx)(u$,{actions:(0,i.jsx)(N$,{}),searchPlaceholder:t("rechercher_une_31213"),showActions:s,showEditColumns:o,showEditMode:s,showSearchColumns:o}),selectSegment:(0,i.jsx)($$,{pageSelectedText:t("les_1_d_l_gat_27248",r),segmentSelectedText:t("les_1_d_l_gat_04594",a.count,a.name)})}),(0,i.jsx)(hD,{customFields:e.customFields,eventId:null,level:ot.Organization,organizationId:n})]})]})},pD=e=>{const{history:t,params:{organizationId:n,segmentId:s},translate:o}=vl();Md(`${o("communaut_20896")} ${o("d_l_gations_78318")}`);const{localOrganization:r,updateLocalOrganization:a}=TI(),{canSegmentEdit:l}=DS(),d=Zn(E$),c=(0,L.useMemo)(()=>d.getDelegationsFilters(n,null,e.organization.customFields.nodes,e.organization.delegationsCategories.nodes),[e.organization,n]),u=(0,L.useMemo)(()=>d.getDelegationsPossibleColumns(e.organization.customFields.nodes),[e.organization]);return(0,i.jsx)(O$,{eventId:null,getEditPath:e=>_i(hs.DELEGATION({organizationId:n,delegationId:e})),getShowPath:e=>hs.DELEGATION({organizationId:n,delegationId:e}),organizationId:n,children:(0,i.jsx)(l$,{canEditSegments:l,filters:c,filtersButtonText:o("filtrer_les_d_l_04628"),filtersSubtitle:o("appliquer_des_f_65318"),getSegmentPath:e=>Ps.COMMUNITY_DELEGATIONS_SEGMENT(n,e),hideSegments:0===e.organization.numberOfDelegations,initialLimit:r?.delegationsLimit??Rc,initialSegmentsOpen:r?.areDelegationsSegmentsOpen??!0,organizationId:n,possibleColumns:u,possibleRenderings:[],reload:e.reload,segmentId:s,segmentType:jt.Delegations,segmentsFolders:e.organization.segmentsFolders,setLimit:e=>{a({delegationsLimit:e})},onSegmentClick:e=>{a({delegationsSegmentId:e})},onSegmentDelete:async()=>{await a({delegationsSegmentId:null}),t.replace(Ps.COMMUNITY_DELEGATIONS(n))},onSegmentsToggle:async e=>{await a({areDelegationsSegmentsOpen:e})},children:(0,i.jsx)(gD,{customFields:e.organization.customFields.nodes,numberOfDelegations:e.organization.numberOfDelegations})})})},fD=()=>{const{history:e,params:{organizationId:t}}=vl(),{localOrganization:n}=TI(),{data:s,loader:o,reload:r}=Qn("query CommunityDelegationsSegments($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n numberOfDelegations\n\n customFields(variety: Delegation) {\n nodes {\n ...SegmentCustomField\n }\n }\n\n delegationsCategories(level: Organization) {\n nodes {\n id\n name\n }\n }\n\n segmentsFolders(level: Organization, segmentType: Delegations) {\n ...SegmentsFoldersSegments\n }\n }\n}\n",{organizationId:t},[Vs.SegmentCustomFieldFragment,Vs.SegmentsFoldersSegmentsFragment]),a=(0,L.useMemo)(()=>(s.organization?.segmentsFolders??[]).flatMap(e=>e.segments).map(e=>e.id),[s.organization]);return o||(0,i.jsxs)(Sr.dO,{children:[(0,i.jsx)(Sr.qh,{path:Ps.COMMUNITY_DELEGATIONS_SEGMENT(":organizationId",":segmentId"),children:(0,i.jsx)(pD,{organization:s.organization,reload:r})}),(0,i.jsx)(Sr.qh,{children:(0,i.jsx)(oi,{onLoad:()=>{const i=n?.delegationsSegmentId&&a.includes(n.delegationsSegmentId)?n?.delegationsSegmentId:a[0];e.replace(Ps.COMMUNITY_DELEGATIONS_SEGMENT(t,i))}})})]})},_D=()=>{const{hasFeature:e}=TI();return e(Be.Delegation)?(0,i.jsx)(fD,{}):(0,i.jsx)(Ba,{align:"center",height:1,justify:"center",width:1,children:(0,i.jsx)(zI,{icon:"people-group"})})},xD=e=>{const t=Xn(),{isLoading:n,copy:s}=WS();return(0,i.jsxs)(Ar,{children:[(0,i.jsx)(Ar,{color:"gray700",css:e.css,children:e.title}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsxs)(Ba,{gap:"2",children:[(0,i.jsx)(Bl,{css:{"& .h-styled-input-container":{background:"white"}},hint:e.hint,state:"disabled",value:e.link,onChange:td.A}),(0,i.jsx)(zl,{color:e.buttonColor,isLoading:n,leftIcon:"copy",onClick:()=>s(e.link),children:t("copier_75889")})]})]})},ID=_r("dl",{margin:0,code:{border:"1px solid color-mix(in srgb, $warning50, $warning400 60%)",backgroundColor:"color-mix(in srgb, $warning50, $warning400 10%)",borderRadius:"$1",fontFamily:"inherit",padding:"1px 3px"},dd:{display:"list-item",listStyleType:"disc"},"dd ~ dt":{marginTop:"$3"}}),vD=({isOpen:e,onClose:t,link:n})=>{const s=Xn(),o=Jn();return(0,i.jsx)(Lb,{isOpen:e,onClose:t,children:(0,i.jsxs)(Nb,{children:[(0,i.jsx)(Mb,{icon:"plug-circle-bolt",subtitle:s("exporter_votre_81734"),onClose:t,children:s("export_de_votre_02014")}),(0,i.jsx)(Fb,{children:(0,i.jsxs)(Ba,{direction:"column",gap:"4",children:[(0,i.jsx)(Ar,{css:{marginBottom:"$5"},children:(0,i.jsx)(al.Root,{color:"warning",children:(0,i.jsxs)(al.Titled,{children:[(0,i.jsx)(al.Title,{icon:"circle-info",children:s("limites_des_exp_03687")}),(0,i.jsx)(al.Text,{children:(0,i.jsxs)(ID,{children:[(0,i.jsx)("dt",{children:s("limite_du_nombr_21498")}),(0,i.jsx)("dd",{children:[...o(s("au_del_de_1_41204",10,15,"{4}","{5}"),(0,i.jsx)("code",{children:"Too many requests, please try again later."}))]}),(0,i.jsx)("dt",{children:s("dans_google_she_53260")}),(0,i.jsx)("dd",{children:[...o(s("la_limite_de_1_47408",10,15,"{3}"),(0,i.jsx)("code",{children:"#N/A"}))]}),(0,i.jsx)("dd",{children:[...o(s("_1_appelle_le_11127"),(0,i.jsx)("code",{children:"IMPORTDATA"}))]}),(0,i.jsx)("dd",{children:[...o(s("_1_ne_fonction_68410"),(0,i.jsx)("code",{children:"IMPORTDATA"}),(0,i.jsx)("code",{children:"#N/A"}))]}),(0,i.jsx)("dd",{children:[...o(s("si_l_export_est_28345"),(0,i.jsx)("code",{children:"#N/A"}))]})]})})]})})}),(0,i.jsx)(xD,{buttonColor:"primary",css:{fontWeight:500},link:n,title:s("lien_d_api_pour_98778")}),(0,i.jsx)(xD,{buttonColor:"primary",css:{fontWeight:500},link:`=IMPORTDATA("${n}")`,title:s("import_de_la_vu_17175")})]})})]})})},bD=e=>{const t=Xn(),[n,s]=(0,L.useState)(Ne.Excel),[o,r]=(0,L.useState)("unchecked");return(0,i.jsx)(Lb,{isOpen:e.isOpen,onClose:e.onClose,children:(0,i.jsxs)(Nb,{children:[(0,i.jsx)(Mb,{icon:"file-xls",subtitle:t("exporter_votre_28801"),children:t("exporter_vos_me_10045")}),(0,i.jsxs)(Fb,{gap:"3",children:[(0,i.jsx)(Ar,{font:"gray800 textMd medium",children:t("parameters_de_votre_export")}),(0,i.jsxs)(Ba,{direction:"column",gap:"5",children:[(0,i.jsxs)($u,{label:t("format_de_lexport"),value:n,onChange:s,children:[(0,i.jsx)("option",{value:Ne.Excel,children:"Excel (.xslx)"}),(0,i.jsx)("option",{value:Ne.Csv,children:"CSV (.csv)"})]}),e.showIncludeFiles&&(0,i.jsx)(_c,{state:o,onClick:r,children:t("inclure_dans_l_65554")})]})]}),(0,i.jsx)(Pb,{children:()=>(0,i.jsx)(zl,{onClick:()=>{e.requestExport(n,"checked"===o),e.onClose()},children:t("recevoir_l_expo_53392")})})]})})},jD=({organizationKey:e})=>{const{history:t,translate:n,params:{organizationId:s,segmentId:o}}=vl(),{user:r}=ai(),{segment:a,columns:l}=vy(),{mutate:d}=function(e={}){return ei("mutation UsersInfosExport(\n $organizationId: OrganizationId!\n $segmentId: SegmentId!\n $format: ExportFormat!\n $includeFiles: Boolean!\n $columns: [String!]!\n) {\n jobId: usersInfosExport(\n organizationId: $organizationId\n segmentId: $segmentId\n format: $format\n includeFiles: $includeFiles\n columns: $columns\n )\n}\n",e)}(),[c,u]=(0,L.useState)(!1),[h,m]=(0,L.useState)(!1),{checkExport:g}=Ob();return(0,i.jsxs)(g$,{children:[(0,i.jsx)(Kb,{permissions:Hb.MEMBER_CREATE,children:(0,i.jsx)(nE,{menu:(0,i.jsx)(Kd,{icon:"file-import",onClick:()=>{t.push(Ps.COMMUNITY_VOLUNTEERS_IMPORT(s))},children:n("importer_via_un_61623")}),path:QI.CREATE({organizationId:s}),children:n("ajouter_un_memb_33261")})}),(0,i.jsx)(Kb,{rolesTypes:bI,children:(0,i.jsxs)(Wd,{children:[(0,i.jsx)(Xd,{children:(0,i.jsx)(zl,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Zd,{placement:"bottom-end",children:[(0,i.jsx)(Kd,{icon:"merge",onClick:()=>{t.push(Ps.COMMUNITY_USERS_DUPLICATES(s))},children:n("g_rer_les_doubl_39469")}),(0,i.jsx)(Kd,{icon:"plug-circle-bolt",onClick:e=>{Vd(e.target),u(!0)},children:n("exporter_via_l_09843")}),(0,i.jsx)(Kd,{icon:"file-xls",onClick:e=>{Vd(e.target),m(!0)},children:n("exporter_en_exc_51862")}),(0,i.jsx)(Kd,{icon:"file-import",onClick:()=>{t.push(Ps.COMMUNITY_FILES_IMPORT(s))},children:n("importer_des_do_55420")})]})]})}),(0,i.jsx)(vD,{isOpen:c,link:fg({organizationId:s,eventId:void 0,lang:r?.language,pathComponent:`members/${o}`,key:e}),onClose:()=>{u(!1)}}),(0,i.jsx)(bD,{isOpen:h,requestExport:async(e,t)=>{const{jobId:n}=await d({organizationId:s,segmentId:a.id,format:e,includeFiles:t,columns:l});g(n,s)},showIncludeFiles:!0,onClose:()=>{m(!1)}})]})},CD=e=>{const{translate:t,params:{organizationId:n}}=vl(),{isOrganizationAdmin:s}=TI(),{canMemberEdit:o}=DS(),r=(0,L.useMemo)(()=>new Map(e.customFields.map(e=>[e.slug,e])),[e.customFields]),a=(0,L.useCallback)(()=>{e.reloadUserInfo(e.userInfo.id)},[e.userInfo,e.reloadUserInfo]);return(0,i.jsxs)(Mc,{css:{background:"checked"===e.state?"$primary100":"white","&:hover":{background:"checked"===e.state?"$primary100":"$gray100"}},children:[s&&(0,i.jsx)(Oc,{css:{paddingRight:0},width:48,children:(0,i.jsx)(fc,{state:e.state,onClick:(t,n)=>{Dl(n),e.toggleRow(`ui${e.userInfo.id}`,t)}})}),e.columns.map(t=>{const n=r.get(t.slug);return(0,i.jsx)(QA,{canClickMemberName:!0,column:t,customField:n,reloadRow:a,row:e.userInfo,updatable:!0},t.slug)}),o&&(0,i.jsx)(Xc,{justify:"center",children:(0,i.jsxs)(km,{children:[(0,i.jsx)(Sm,{children:(0,i.jsx)(Ar,{children:(0,i.jsx)(nl,{icon:"pen",to:Ps.COMMUNITY_EDIT_USER(n,e.userInfo.id)})})}),(0,i.jsx)(wm,{placement:"top",children:t("_diter_62574")})]})})]})},yD=e=>{const{organizationId:t}=ti(),{isOrganizationAdmin:n}=TI(),{canMemberEdit:s}=DS(),{columns:o,columnsSearch:r,massActions:a,nameDebounced:l,limit:d,offset:c,possibleColumns:u,predicates:h,reloadKey:g,setLimit:p,setOffset:f,setSort:_,sort:x}=vy(),I=(0,L.useMemo)(()=>ZA(o),[o]),{data:v,isLoading:b,reload:j}=(C={...I,organizationId:t,predicates:h,name:m(l)?l:null,columnsSearch:so(r)?r:null,limit:d,offset:c,sort:x},Qn(vo,C,[Vs.UserInfoCommunityFragment]));var C;const{numberOfPages:y,totalCount:k}=Su(v.data?.rows);(0,L.useEffect)(()=>{g>1&&j()},[g]);const A=(0,L.useMemo)(()=>o.flatMap(e=>(0,Za.A)([u.find(t=>t.slug===e)])),[u,o]),[w,S]=(0,L.useState)([]),[E,T]=(0,L.useState)({}),z=(0,L.useCallback)(async e=>{T(t=>({...t,[e]:!0}));const{data:{row:n}}=await Go({...I,organizationId:t,id:e},await Y());S(t=>t.map(t=>t.id===e?n:t)),T(t=>({...t,[e]:!1}))},[I,T,S]);return(0,L.useEffect)(()=>{S(v.data?.rows.nodes??[])},[v.data]),(0,L.useEffect)(()=>{a.setStates(Object.fromEntries((v.data?.rows.nodes??[]).map(({id:e})=>[`ui${e}`,{id:e,state:"unchecked"}])))},[v.data,a.setStates]),(0,i.jsx)(Ba,{css:{flex:"1",overflow:"hidden"},width:1,children:(0,i.jsx)(Cm,{"aria-busy":b,headerRow:(0,i.jsxs)(kc,{children:[n&&(0,i.jsx)(Gc,{css:{paddingRight:0},width:48,children:(0,i.jsx)(fc,{state:a.selectAllState,onClick:a.toggleSelectAll})}),A.map(e=>e.isSortable?(0,i.jsx)(jm,{attribute:e.sortAttribute||e.slug,minWidth:e.minWidth,setSort:_,sort:x,width:e.width,children:(0,i.jsx)(Ar,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug):(0,i.jsx)(Gc,{minWidth:e.minWidth,width:e.width,children:(0,i.jsx)(Ar,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug)),s&&(0,i.jsx)(Gc,{width:100})]}),paginationRow:(0,i.jsx)(Nc,{css:{borderTop:"1px solid $gray200"},children:(0,i.jsx)(Fc,{limit:d,numberOfPages:y,offset:c,setLimit:p,setOffset:f,showLimits:!0,totalCount:k})}),children:b?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Hc,{}),(0,i.jsx)(Hc,{}),(0,i.jsx)(Hc,{})]}):w.map(t=>E[t.id]?(0,i.jsx)(Hc,{},t.id):(0,i.jsx)(CD,{columns:A,customFields:e.customFields,reloadUserInfo:z,state:a.states[`ui${t.id}`]?.state??"unchecked",toggleRow:a.toggleRow,userInfo:t},t.id))})})},kD=e=>(0,i.jsx)(Ar,{css:{padding:"$2 $3"},font:"gray500 textXs semiBold",children:e.children}),AD=e=>{const t=Xn(),{mutate:n,isLoading:s}=er(),{mutate:o,isLoading:r}=Oa(),[a,l]=(0,L.useState)([]),[d,c]=(0,L.useState)([]);return(0,L.useEffect)(()=>{(async()=>{if(e.eventId){const t=await ir({eventId:e.eventId},await Y());l(t.event.delegations.nodes)}else{const i=await(t={organizationId:e.organizationId},n=await Y(),go("query MassDelegationAddOrganizationDelegations($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n delegations(level: Organization) {\n nodes {\n id\n name\n }\n }\n }\n}\n",{variables:t,token:n||void 0,fragments:[]}));l(i.organization.delegations.nodes)}var t,n})()},[e.organizationId,e.eventId]),(0,i.jsxs)(au,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Ba,{justify:"center",children:(0,i.jsx)(sC,{color:"primary",icon:"people-group"})}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(Ar,{font:"gray900 textLg medium",textAlign:"center",children:t("ajouter_des_mem_60880")}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(yc,{isSearchVisible:!0,label:t("Delegation"),values:d,onChange:c,children:a.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsxs)(Ba,{gap:"3",justify:"end",children:[(0,i.jsx)(zl,{isLoading:s||r,onClick:async()=>{if(so(d)){let i=0;const s=a.find(e=>e.id===d[0]);i=e.eventId?(await n({eventId:e.eventId,selecteds:e.selecteds,delegationId:d[0]})).numberOfMembers:(await o({organizationId:e.organizationId,selecteds:e.selecteds,delegationId:d[0]})).numberOfMembers,e.onSuccess(t("_1_membres_ont_51715",i,s.name)),e.onClose()}},children:t("ajouter_97327")}),(0,i.jsx)(zl,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},wD=e=>{const t=Xn(),{mutate:n,isLoading:s}=function(e={}){return ei("mutation VolunteersRegistrationsMassFormAdd(\n $eventId: EventId!\n $formId: FormId!\n $selecteds: MassActionSelectedsInput!\n) {\n numberOfMembers: volunteersRegistrationsMassFormAdd(\n eventId: $eventId\n formId: $formId\n selecteds: $selecteds\n )\n}\n",e)}(),{mutate:o,isLoading:r}=function(e={}){return ei("mutation UsersInfosMassFormAdd(\n $organizationId: OrganizationId!\n $formId: FormId!\n $selecteds: MassActionSelectedsInput!\n) {\n numberOfMembers: usersInfosMassFormAdd(\n organizationId: $organizationId\n formId: $formId\n selecteds: $selecteds\n )\n}\n",e)}(),{data:a}=la({organizationId:e.organizationId,level:e.eventId?ot.Event:ot.Organization,eventId:e.eventId}),l=(0,L.useMemo)(()=>a.organization?.forms.nodes??[],[a.organization]),[d,c]=(0,L.useState)([]),u=so(d);return(0,i.jsxs)(au,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Ba,{justify:"center",children:(0,i.jsx)(sC,{color:"primary",icon:"people-group"})}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(Ar,{font:"gray900 textLg medium",textAlign:"center",children:t("ajouter_des_mem_81812")}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(yc,{isSearchVisible:!0,label:t("Form"),values:d,onChange:c,children:l.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsxs)(Ba,{gap:"3",justify:"end",children:[(0,i.jsx)(zl,{disabled:!u,isLoading:s||r,onClick:async()=>{if(so(d)){let i=0;const s=l.find(e=>e.id===d[0]);i=e.eventId?(await n({eventId:e.eventId,selecteds:e.selecteds,formId:d[0]})).numberOfMembers:(await o({organizationId:e.organizationId,selecteds:e.selecteds,formId:d[0]})).numberOfMembers,e.onSuccess(t("le_formulaire_11679",s.name,i)),e.onClose()}},children:t("ajouter_97327")}),(0,i.jsx)(zl,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},SD=e=>{const t=Xn(),{mutate:n,isLoading:s}=function(e={}){return ei("mutation VolunteersRegistrationsMassFormRemove(\n $eventId: EventId!\n $formId: FormId!\n $selecteds: MassActionSelectedsInput!\n) {\n numberOfMembers: volunteersRegistrationsMassFormRemove(\n eventId: $eventId\n formId: $formId\n selecteds: $selecteds\n )\n}\n",e)}(),{mutate:o,isLoading:r}=function(e={}){return ei("mutation UsersInfosMassFormRemove(\n $organizationId: OrganizationId!\n $formId: FormId!\n $selecteds: MassActionSelectedsInput!\n) {\n numberOfMembers: usersInfosMassFormRemove(\n organizationId: $organizationId\n formId: $formId\n selecteds: $selecteds\n )\n}\n",e)}(),{data:a}=la({organizationId:e.organizationId,level:e.eventId?ot.Event:ot.Organization,eventId:e.eventId}),l=(0,L.useMemo)(()=>a.organization?.forms.nodes??[],[a.organization]),[d,c]=(0,L.useState)([]),u=so(d);return(0,i.jsxs)(au,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Ba,{justify:"center",children:(0,i.jsx)(sC,{color:"primary",icon:"file-lines"})}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(Ar,{font:"gray900 textLg medium",textAlign:"center",children:t("marquer_un_form_10633")}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(yc,{isSearchVisible:!0,label:t("Form"),values:d,onChange:c,children:l.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(rl,{color:"error",leftIcon:"triangle-exclamation",children:e.eventId?t("cette_action_su_82938"):t("cette_action_su_88097")}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsxs)(Ba,{gap:"3",justify:"end",children:[(0,i.jsx)(zl,{color:"error",disabled:!u,isLoading:s||r,onClick:async()=>{if(so(d)){let i=0;const s=l.find(e=>e.id===d[0]);i=e.eventId?(await n({eventId:e.eventId,selecteds:e.selecteds,formId:d[0]})).numberOfMembers:(await o({organizationId:e.organizationId,selecteds:e.selecteds,formId:d[0]})).numberOfMembers,e.onSuccess(t("le_formulaire_87510",s.name,i)),e.onClose()}},children:t("marquer_comme_n_20227")}),(0,i.jsx)(zl,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})};let ED=class extends Gl{constructor(e){super(e)}massAddEventInputSchema(){return d.Ik().shape({massAddEvent:d.Ik().shape({eventId:d.ai().required(this.t("l_v_nement_est_88155")).typeError(this.t("l_v_nement_est_88155"))})})}massAddEventSchema(){return d.Ik().shape({eventId:d.ai().required(this.t("l_v_nement_est_88155")).typeError(this.t("l_v_nement_est_88155"))})}};ED=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[qn])],ED);const TD=e=>{const t=Xn(),n=Zn(ED),{mutate:s}=function(e={}){return ei("mutation UsersInfosMassAddEvent(\n $organizationId: OrganizationId!\n $massAddEvent: MassAddEventInput!\n) {\n numberOfMembers: usersInfosMassAddEvent(\n organizationId: $organizationId\n massAddEvent: $massAddEvent\n )\n}\n",e)}(),{data:o,isLoading:r}=oa({organizationId:e.organizationId}),[a,l]=(0,L.useState)(""),d=(0,L.useMemo)(()=>m(a)?(o.organization?.events.nodes??[]).filter(e=>e.name.trim().toLowerCase().includes(a.trim().toLowerCase())):o.organization?.events.nodes??[],[o.organization,a]);return(0,i.jsxs)(oC,{buttonText:t("ajouter_le_memb_03343",e.numberOfSelected),icon:"sliders",initialValues:{massAddEvent:{eventId:null,selecteds:e.selecteds}},schema:n.massAddEventInputSchema(),size:"md",title:t("ajouter_les_mem_13940"),onClose:e.onClose,onSubmit:async n=>{const i=d.find(e=>e.id===n.massAddEvent.eventId),o=(await s({organizationId:e.organizationId,massAddEvent:n.massAddEvent})).numberOfMembers;e.onSuccess(t("_1_membres_ont_83814",o,i.name)),e.onClose()},children:[(0,i.jsx)(Bl,{icon:"magnifying-glass",placeholder:t("rechercher_un_40024"),value:a,onChange:l}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(Ar,{color:"gray900",fontWeight:"medium",children:t("sur_quel_v_nem_31606")}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(Ba,{css:{overflowY:"auto"},direction:"column",gap:"3",children:r?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(lc,{borderRadius:"$2",height:54}),(0,i.jsx)(lc,{borderRadius:"$2",height:54})]}):d.map(e=>(0,i.jsx)(QR,{label:e.name,name:"massAddEvent.eventId",value:e.id},e.id))})]})},zD=e=>{const t=Xn(),{data:n,loader:s}=Qn("query MergeMembers($organizationId: OrganizationId!, $usersInfosIds: [UsersInfoId!]!) {\n organization(id: $organizationId) {\n weezeventOrganizationId\n\n usersInfos(ids: $usersInfosIds) {\n nodes {\n id\n name\n email\n picture {\n url\n }\n\n volunteersRegistrations {\n eventId\n event {\n name\n }\n\n accreditationsUsersInfos {\n id\n }\n\n positionsSlotsUsersInfos {\n id\n }\n }\n }\n }\n }\n}\n",{organizationId:e.organizationId,usersInfosIds:e.usersInfosIds},[]);const{mutate:o}=Jr(),[r,a]=(0,L.useState)(null);return(0,i.jsxs)(oC,{buttonText:t("fusionner_les_92573",e.numbersOfSelected),icon:"sliders",initialValues:{},size:"md",title:t("fusion_de_membr_34256"),onClose:e.onClose,onSubmit:async()=>{null!==r&&(await o({organizationId:e.organizationId,mainUserInfoId:r,toMergeUsersInfosIds:e.usersInfosIds.filter(e=>e!==r)}),e.onSuccess(t("_1_membres_ont_74574",e.usersInfosIds.length)),e.onClose())},children:[(0,i.jsx)(rl,{color:"gray",leftIcon:"circle-exclamation",children:t("toutes_les_info_39932",e.numbersOfSelected)}),"number"==typeof n.organization?.weezeventOrganizationId&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(rl,{color:"warning",leftIcon:"circle-exclamation",children:t("if_you_merge_me_62641")})]}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(Ar,{font:"gray700 textSm medium",children:t("quel_membre_sou_80665")}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(Ba,{css:{flex:"1"},direction:"column",gap:"4",children:s||n.organization.usersInfos.nodes.map((e,n)=>{const s=e.volunteersRegistrations.flatMap(e=>e.accreditationsUsersInfos.length>0||e.positionsSlotsUsersInfos.length>0?{eventId:e.eventId,eventName:e.event.name,numberOfAccreditations:e.accreditationsUsersInfos.length,numberOfAssignments:e.positionsSlotsUsersInfos.length}:[]);return(0,i.jsxs)(L.Fragment,{children:[0!==n&&(0,i.jsx)(Xu,{direction:"horizontal"}),(0,i.jsxs)(Ba,{align:"center",css:{cursor:"pointer"},gap:"3",onClick:()=>{a(e.id)},children:[(0,i.jsx)(Ic,{shouldPreventDefault:!1,state:r===e.id?"checked":"unchecked",onClick:td.A}),(0,i.jsx)(sp,{email:e.email,image:e.picture?.url,name:e.name,size:48}),(0,i.jsxs)(Ba,{direction:"column",gap:"1",children:[(0,i.jsx)(Ar,{font:"gray800 textSm medium",children:m(e.name)?e.name:"-"}),(0,i.jsx)(Ar,{color:"gray500",children:e.email}),(0,i.jsx)(Ba,{gap:"2",children:s.map(e=>(0,i.jsxs)(L.Fragment,{children:[e.numberOfAccreditations>0&&(0,i.jsx)(rc,{css:{height:"fit-content"},leftIcon:"badge-check",children:t("_1_2_accred_26410",e.eventName,e.numberOfAccreditations)}),e.numberOfAssignments>0&&(0,i.jsx)(rc,{css:{height:"fit-content"},leftIcon:"location-dot",children:t("_1_2_assign_03225",e.eventName,e.numberOfAssignments)})]},e.eventId))})]})]})]},e.id)})})]})},OD=e=>{const{translate:t,params:{organizationId:n}}=vl(),{showNotification:s}=Ob(),{mutate:o}=Po(),{mutate:r}=function(e={}){return ei("mutation UsersInfosMassDelete(\n $organizationId: OrganizationId!\n $selecteds: MassActionSelectedsInput!\n) {\n numberOfMembers: usersInfosMassDelete(organizationId: $organizationId, selecteds: $selecteds)\n}\n",e)}(),{hasFeature:a}=TI(),{data:l}=Qn("query UsersActions($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n hasDelegations\n hasEvents\n hasForms\n }\n}\n",{organizationId:n},[]),[d,c]=(0,L.useState)(!1),[u,h]=(0,L.useState)(!1),[g,p]=(0,L.useState)(!1),[f,_]=(0,L.useState)(!1),[x,I]=(0,L.useState)(!1),[v,b]=(0,L.useState)(!1),[j,C]=(0,L.useState)(!1),[y,k]=(0,L.useState)(!1),A=e.massActions.getSelectedsInput(e.predicates,null),w=e.massActions.isAllSelected?e.totalNumberOfMembers:e.massActions.numberOfSelected,S=(0,L.useCallback)(t=>{m(t)&&s(t),e.onMassEditSuccess()},[e.onMassEditSuccess]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zl,{onClick:()=>{c(!0)},children:t("_diter_un_champ_64621")}),!e.showOnlyMassEdit&&(0,i.jsxs)(Wd,{children:[(0,i.jsx)(Xd,{children:(0,i.jsx)(zl,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Zd,{placement:"bottom-end",children:[(0,i.jsx)(kD,{children:t("gestion_des_mem_51660")}),(0,i.jsx)(Kd,{icon:"plus",isDisabled:!l.organization?.hasEvents,onClick:()=>{h(!0)},children:t("ajouter_1_membr_25541",w)}),(0,i.jsx)(Kd,{icon:"merge",onClick:()=>{p(!0)},children:t("fusionner_les_m_37150")}),(0,i.jsx)(Xu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(kD,{children:t("accr_ditations_39450")}),a(Be.Delegation)&&(0,i.jsx)(Kd,{icon:"people-group",isDisabled:!l.organization?.hasDelegations,onClick:()=>{I(!0)},children:l.organization?.hasDelegations?t("ajouter_1_mem_86218",w):t("cette_organisat_48937")}),(0,i.jsx)(Xu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(kD,{children:t("communication_05277")}),(0,i.jsx)(Kd,{icon:"file-lines",isDisabled:!l.organization?.hasForms,onClick:()=>{b(!0)},children:t("ajouter_1_mem_52947",w)}),(0,i.jsx)(Kd,{icon:"file-lines",isDisabled:!l.organization?.hasForms,onClick:()=>{C(!0)},children:t("marquer_un_form_10633")}),(0,i.jsx)(Kd,{icon:"paper-plane",onClick:()=>{k(!0)},children:t("SendCampaign")}),(0,i.jsx)(Xu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Kd,{color:"red",icon:"trash-can",onClick:()=>{_(!0)},children:t("supprimer_43083")})]})]}),d&&(0,i.jsx)(vA,{mutate:e=>o({organizationId:n,massEdit:e}),organizationId:n,selecteds:A,onClose:()=>{c(!1)},onSuccess:e=>{S(t("_1_membres_ont_07596",e))}}),u&&(0,i.jsx)(TD,{numberOfSelected:w,organizationId:n,selecteds:A,onClose:()=>{h(!1)},onSuccess:S}),g&&(0,i.jsx)(zD,{numbersOfSelected:w,organizationId:n,usersInfosIds:e.massActions.selectedsIds,onClose:()=>{p(!1)},onSuccess:S}),f&&(0,i.jsx)(cA,{buttonText:t("supprimer_43083"),subtext:[t("_tes_vous_s_r_d_65177"),t("cette_action_es_45424")],text:t("suppression_de_57689",w),onClose:()=>{_(!1)},onDelete:async()=>{const e=(await r({organizationId:n,selecteds:A})).numberOfMembers;S(t("_1_membres_ont_13170",e))}}),v&&(0,i.jsx)(wD,{eventId:null,organizationId:n,selecteds:A,onClose:()=>{b(!1)},onSuccess:S}),j&&(0,i.jsx)(SD,{eventId:null,organizationId:n,selecteds:A,onClose:()=>{C(!1)},onSuccess:S}),x&&(0,i.jsx)(AD,{eventId:null,organizationId:n,selecteds:A,onClose:()=>{I(!1)},onSuccess:S}),y&&(0,i.jsx)(NA,{eventId:null,organizationId:n,selecteds:A,onClose:()=>{k(!1)},onSuccess:S})]})},RD=({customFields:e,organizationKey:t})=>{const n=Xn(),{isOrganizationAdmin:s}=TI(),{limit:o,massActions:r,onMassEditSuccess:a,predicates:l,reloadKey:d,segment:c,setReloadKey:u}=vy();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(jD,{organizationKey:t,reload:()=>{u(d+1)}}),(0,i.jsxs)(aj,{children:[(0,i.jsx)(m$,{searchRow:(0,i.jsx)(u$,{actions:(0,i.jsx)(OD,{massActions:r,predicates:l,showOnlyMassEdit:!1,totalNumberOfMembers:c.count,onMassEditSuccess:a}),searchPlaceholder:n("rechercher_un_m_05904"),showActions:s,showEditColumns:s,showEditMode:s,showSearchColumns:s}),selectSegment:(0,i.jsx)($$,{pageSelectedText:n("les_1_membres_00895",o),segmentSelectedText:n("les_1_membres_56748",c.count,c.name)})}),(0,i.jsx)(yD,{customFields:e})]})]})},$D=e=>{const{history:t,translate:n,params:{organizationId:s,segmentId:o}}=vl(),{isOrganizationAdmin:r,localOrganization:a,updateLocalOrganization:l}=TI(),d=Zn(XA),c=(0,L.useMemo)(()=>d.getOrganizationUsersFilters(s,o,e.organization),[e.organization]),u=(0,L.useMemo)(()=>d.getOrganizationUsersPossibleColumns(e.organization.customFields.nodes),[e.organization]);return(0,i.jsx)(l$,{canEditSegments:r,filters:c,filtersButtonText:n("filtrer_les_mem_49255"),filtersSubtitle:n("appliquer_des_f_48814"),getSegmentPath:e=>Ps.COMMUNITY_USERS_SEGMENT(s,e),initialLimit:a?.usersLimit??Rc,initialSegmentsOpen:a?.areUsersSegmentsOpen??!0,organizationId:s,possibleColumns:u,possibleRenderings:[],reload:e.reload,segmentId:o,segmentType:jt.Volunteers,segmentsFolders:e.organization.segmentsFolders,setLimit:e=>{l({usersLimit:e})},onSegmentClick:e=>{l({usersSegmentId:e})},onSegmentDelete:async()=>{await l({usersSegmentId:null}),t.replace(wi.COMMUNITY_USERS({organizationId:s}))},onSegmentsToggle:async e=>{await l({areUsersSegmentsOpen:e})},children:(0,i.jsx)(RD,{customFields:e.organization.customFields.nodes,organizationKey:e.organization.key})})},DD=()=>{const{params:{organizationId:e},translate:t}=vl();Md(`${t("communaut_20896")} ${t("membres_11310")}`);const{localOrganization:n}=TI(),{data:s,loader:o,reload:r}=Qn("query UsersSegments($organizationId: OrganizationId!, $privacy: CustomFieldPrivacy!) {\n organization(id: $organizationId) {\n key\n\n customFields(variety: UserInfo, privacy: $privacy) {\n nodes {\n ...SegmentCustomField\n }\n }\n\n segmentsFolders(level: Organization, segmentType: Volunteers) {\n ...SegmentsFoldersSegments\n }\n }\n}\n",{organizationId:e,privacy:Ie.All},[Vs.SegmentCustomFieldFragment,Vs.SegmentsFoldersSegmentsFragment]);const a=(0,L.useMemo)(()=>(s.organization?.segmentsFolders??[]).flatMap(e=>e.segments).map(e=>e.id),[s.organization]);return o||(0,i.jsxs)(Sr.dO,{children:[(0,i.jsx)(Sr.qh,{path:Ps.COMMUNITY_USERS_SEGMENT(":organizationId",":segmentId"),children:(0,i.jsx)($D,{organization:s.organization,reload:r})}),(0,i.jsx)(Sr.qh,{children:(0,i.jsx)(oi,{path:Ps.COMMUNITY_USERS_SEGMENT(e,n?.usersSegmentId&&a.includes(n.usersSegmentId)?n?.usersSegmentId:a[0]),replace:!0})})]})},PD=e=>{const{translate:t,params:{organizationId:n}}=vl(),s=Zn(mC),{mutate:o,isLoading:r}=Jr(),a=(0,L.useMemo)(()=>Object.fromEntries(e.displayColumns.flatMap(t=>{const n=e.customFields.find(e=>e.slug===t);return n?[[t,n]]:[]})),[e.customFields,e.displayColumns]);return(0,i.jsx)(Lc,{filters:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(zl,{color:"primary",isLoading:r,size:"sm",onClick:async()=>{await o({organizationId:n,mainUserInfoId:e.selectedId,toMergeUsersInfosIds:e.usersInfos.map(({id:e})=>e).filter(t=>t!==e.selectedId)}),e.onSuccess()},children:t("fusionner_04498")})}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Gc,{children:t("nom_du_membre_69353")}),e.displayColumns.map(e=>{const n=a[e];return"delegations"===e?(0,i.jsx)(Gc,{children:t("d_l_gations_78318")},e):n?(0,i.jsx)(Gc,{children:n.name},e):null}),(0,i.jsx)(Gc,{children:t("membre_principa_09597")})]}),numberOfPages:0,offset:0,rows:e.usersInfos.map(t=>(0,i.jsxs)(Mc,{css:{cursor:"pointer"},onClick:()=>{e.onSelect(t.id)},children:[(0,i.jsx)(Oc,{children:(0,i.jsx)(xj,{userInfo:t})}),e.displayColumns.map(e=>{const n=a[e];return"delegations"===e?(0,i.jsx)(Oc,{gap:"2",wrap:"wrap",children:t.delegations.map(e=>{const t=e.event?`${e.event.name}`:e.name;return(0,i.jsx)(rc,{children:t},e.id)})},e):n?(0,i.jsx)(Oc,{children:s.getValueString(n,t.fields,{fileReturnValue:"name"})},e):null}),(0,i.jsx)(Oc,{children:(0,i.jsx)(Ic,{shouldPreventDefault:!1,state:e.selectedId===t.id?"checked":"unchecked",onClick:td.A})})]},t.id)),setOffset:td.A,title:e.usersInfos[0].name,totalCount:0})},FD=e=>{const{translate:t,params:{organizationId:n}}=vl(),{localOrganization:s,updateLocalOrganization:o}=TI(),r=e.organization.customFields.nodes,[a,l]=(0,L.useState)(e.organization.possibleDuplicates),[d,c]=(0,L.useState)(Object.fromEntries(a.map(({id:e,usersInfos:t})=>[e,t[0].id]))),[u,h]=(0,L.useState)(!1),g=a.length??0,[p,f]=(0,L.useState)(s?.duplicatesColumns||[]),_=(0,L.useMemo)(()=>(0,uc.A)(r.map(e=>({name:e.name,slug:e.slug})).concat([{name:t("d_l_gations_78318"),slug:"delegations"}]),e=>e.name),[r]),x=(0,L.useCallback)(async e=>{f(e),await o({duplicatesColumns:e})},[f]),[I,v]=(0,L.useState)(""),b=(0,L.useMemo)(()=>m(I)?a.filter(e=>e.usersInfos.some(e=>e.name.toLowerCase().includes(I.toLowerCase()))):a,[a,I]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Lm,{fallbackClosePath:wi.COMMUNITY_USERS({organizationId:n}),heading:t("gestion_des_mem_14016"),children:(0,i.jsxs)(Mm,{children:[(0,i.jsx)(Ba,{align:"center",justify:"between",children:(0,i.jsxs)(Ba,{direction:"column",gap:"1",children:[(0,i.jsxs)(Ba,{align:"center",gap:"2",children:[(0,i.jsx)(Ar,{font:"gray900 textMd medium",children:t("liste_des_membr_20115")}),g>0&&(0,i.jsx)(rc,{color:"warning",size:"sm",children:t("_1_doublon_pot_74382",g)})]}),(0,i.jsx)(Ar,{color:"gray500",children:t("s_lectionner_le_91896")})]})}),(0,i.jsx)(Ya,{height:"6"}),0===g?(0,i.jsxs)(Sc,{children:[(0,i.jsxs)(kc,{children:[(0,i.jsx)(Gc,{children:t("nom_du_membre_69353")}),(0,i.jsx)(Gc,{children:t("membre_principa_09597")})]}),(0,i.jsx)(Mc,{css:{height:"400px"},children:(0,i.jsx)(Oc,{css:{height:"100%"},children:(0,i.jsx)(Gk,{subtitle:"",title:t("il_n_y_a_pas_de_78722")})})})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ba,{align:"center",justify:"between",children:[(0,i.jsx)(Ar,{width:320,children:(0,i.jsx)(Bl,{placeholder:t("rechercher_un_m_05904"),value:I,onChange:v})}),(0,i.jsx)(zl,{color:"white",leftIcon:"gear",onClick:()=>{h(!0)},children:t("_diter_les_colo_39630")})]}),(0,i.jsx)(Ya,{height:"6"}),b.map(({id:e,usersInfos:t})=>(0,i.jsxs)(L.Fragment,{children:[(0,i.jsx)(PD,{customFields:r,displayColumns:p,selectedId:d[e],usersInfos:t,onSelect:t=>{c(n=>({...n,[e]:t}))},onSuccess:()=>{l(t=>t.filter(t=>t.id!==e))}}),(0,i.jsx)(Ya,{height:"4"})]},e))]})]})}),u&&(0,i.jsx)(Au,{columns:_,initialSelectedColumns:p,saveButtonText:t("_diter_62574"),searchPlaceholder:t("rechercher_un_c_86475"),subtitle:t("personnaliser_l_96096"),title:t("_dition_des_col_70300"),onClose:()=>{h(!1)},onSave:x})]})},MD=()=>{const{params:{organizationId:e}}=vl(),{data:t,loader:n}=Qn("query PossibleDuplicates($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n customFields(variety: UserInfo) {\n nodes {\n ...CustomFieldWithCondition\n }\n }\n\n possibleDuplicates {\n id\n\n usersInfos {\n id\n email\n name\n fields\n\n picture {\n url\n }\n\n delegations(level: Both) {\n id\n name\n\n event {\n name\n }\n }\n }\n }\n }\n}\n",{organizationId:e},[Vs.CustomFieldWithConditionFragment]);return n||(0,i.jsx)(FD,{organization:t.organization})},ND=()=>{const{translate:e,params:{organizationId:t}}=vl();Md(e("communaut_20896"));const{hasFeature:n}=TI(),{canDelegationEdit:s,canDelegationRead:o,canFormRead:r,canWorkflowEdit:a,canWorkflowRead:l}=DS();return n(Be.Community)?(0,i.jsxs)(Sr.dO,{children:[(0,i.jsx)(Sr.qh,{path:wi.COMMUNITY_DASHBOARD({organizationId:":organizationId"}),children:(0,i.jsx)(k$,{children:(0,i.jsx)(A$,{})})}),(0,i.jsx)(Sr.qh,{path:Ps.COMMUNITY_USERS_DUPLICATES(":organizationId"),children:(0,i.jsx)(MD,{})}),(0,i.jsx)(Sr.qh,{path:[QI.CREATE({organizationId:":organizationId",delegationId:":delegationId"}),QI.CREATE({organizationId:":organizationId"})],children:(0,i.jsx)(hz,{})}),(0,i.jsx)(Sr.qh,{path:wi.COMMUNITY_USERS({organizationId:":organizationId"}),children:(0,i.jsx)(k$,{children:(0,i.jsx)(DD,{})})}),(0,i.jsx)(Sr.qh,{path:[Ps.COMMUNITY_EDIT_USER(":organizationId",":userInfoId"),Ps.COMMUNITY_EDIT_USER_DELEGATION(":organizationId",":delegationId",":userInfoId")],children:(0,i.jsx)(jT,{children:(0,i.jsx)(FO,{})})}),(0,i.jsx)(Sr.qh,{exact:!0,path:$I.CREATE_TEMPLATE({organizationId:":organizationId"}),children:(0,i.jsx)(sj,{isTemplate:!0})}),(0,i.jsx)(Sr.qh,{exact:!0,path:$I.CREATE({organizationId:":organizationId",options:":options?"}),children:(0,i.jsx)(sj,{isTemplate:!1})}),(0,i.jsx)(Sr.qh,{path:$I.UPDATE({organizationId:":organizationId",campaignId:":campaignId"}),children:(0,i.jsx)(rj,{})}),(0,i.jsx)(Sr.qh,{path:$I.CAMPAIGNS({organizationId:":organizationId"}),children:(0,i.jsx)(k$,{children:(0,i.jsx)(C$,{})})}),(0,i.jsx)(Sr.qh,{path:$I.CAMPAIGN({organizationId:":organizationId",campaignId:":campaignId"}),children:(0,i.jsx)(k$,{children:(0,i.jsx)(Lj,{})})}),r&&(0,i.jsx)(Sr.qh,{path:Vi.CREATE({organizationId:":organizationId"}),children:(0,i.jsx)(k$,{children:(0,i.jsx)(VS,{isCreateOpen:!0})})}),r&&(0,i.jsx)(Sr.qh,{path:Vi.FORMS({organizationId:":organizationId"}),children:(0,i.jsx)(k$,{children:(0,i.jsx)(VS,{isCreateOpen:!1})})}),r&&(0,i.jsx)(Sr.qh,{path:Vi.FORM_ELEMENTS({organizationId:":organizationId",formId:":formId"}),children:(0,i.jsx)(vE,{})}),r&&(0,i.jsx)(Sr.qh,{path:Vi.FORM_PARAMETERS_GENERAL({organizationId:":organizationId",formId:":formId"}),children:(0,i.jsx)(qE,{})}),r&&(0,i.jsx)(Sr.qh,{path:Vi.FORM_PARAMETERS_DESIGN({organizationId:":organizationId",formId:":formId"}),children:(0,i.jsx)(UE,{})}),r&&(0,i.jsx)(Sr.qh,{path:Vi.FORM_PARAMETERS_BROADCAST({organizationId:":organizationId",formId:":formId"}),children:(0,i.jsx)(OE,{})}),r&&(0,i.jsx)(Sr.qh,{path:Vi.FORM_PARAMETERS_STATE({organizationId:":organizationId",formId:":formId"}),children:(0,i.jsx)(ZE,{})}),r&&(0,i.jsx)(Sr.qh,{path:Vi.FORM_INTEGRATION({organizationId:":organizationId",formId:":formId"}),children:(0,i.jsx)(JS,{})}),r&&(0,i.jsx)(Sr.qh,{path:Vi.FORM_EMAILS({organizationId:":organizationId",formId:":formId"}),children:(0,i.jsx)(yE,{})}),r&&(0,i.jsx)(Sr.qh,{path:Vi.FORM_PREVIEW({organizationId:":organizationId",formId:":formId"}),children:(0,i.jsx)(QS,{})}),(0,i.jsx)(Sr.qh,{path:Ps.COMMUNITY_VOLUNTEERS_IMPORT(":organizationId"),children:(0,i.jsx)(uR,{})}),(0,i.jsx)(Sr.qh,{path:Ps.COMMUNITY_FILES_IMPORT(":organizationId"),children:(0,i.jsx)(zS,{})}),(0,i.jsx)(Sr.qh,{path:QI.MEMBER({organizationId:":organizationId",userInfoId:":userInfoId"}),children:(0,i.jsx)(k$,{children:(0,i.jsx)(CO,{})})}),s&&(0,i.jsx)(Sr.qh,{path:Ps.COMMUNITY_CREATE_DELEGATION(":organizationId",":options?"),children:(0,i.jsx)(my,{})}),s&&(0,i.jsx)(Sr.qh,{path:Ps.COMMUNITY_EDIT_DELEGATION(":organizationId",":delegationId"),children:(0,i.jsx)(py,{})}),o&&(0,i.jsx)(Sr.qh,{path:Ps.COMMUNITY_DELEGATIONS(":organizationId"),children:(0,i.jsx)(k$,{children:(0,i.jsx)(_D,{})})}),o&&(0,i.jsx)(Sr.qh,{path:hs.DELEGATION_CATEGORY({organizationId:":organizationId",delegationCategoryId:":delegationCategoryId"}),children:(0,i.jsx)(k$,{children:(0,i.jsx)(yS,{isEvent:!1})})}),o&&(0,i.jsx)(Sr.qh,{path:Ps.COMMUNITY_DELEGATION(":organizationId",":delegationId"),children:(0,i.jsx)(k$,{children:(0,i.jsx)(cS,{})})}),a&&(0,i.jsx)(Sr.qh,{path:nv.CREATE({organizationId:":organizationId"}),children:(0,i.jsx)(zR,{})}),l&&(0,i.jsx)(Sr.qh,{path:nv.UPDATE({organizationId:":organizationId",workflowId:":workflowId"}),children:(0,i.jsx)(OR,{})}),l&&(0,i.jsx)(Sr.qh,{path:nv.WORKFLOWS({organizationId:":organizationId"}),children:(0,i.jsx)(k$,{children:(0,i.jsx)(GR,{})})}),(0,i.jsx)(Sr.qh,{children:(0,i.jsx)(oi,{path:wi.COMMUNITY_USERS({organizationId:t}),replace:!0})})]}):(0,i.jsx)(k$,{children:(0,i.jsx)(Ba,{align:"center",height:1,justify:"center",width:1,children:(0,i.jsx)(zI,{icon:"crown",subtitle:e("contactez_nous_69860"),title:e("pour_en_profite_62789")})})})};let LD=class extends _u{constructor(e,t,n){super(e,t,n)}getCustomFieldsFilters(e,t){return[{slug:"name",name:this.t("nom_du_champ_48329"),category:this.t("champs_de_formu_64126"),fieldType:He.Text,hideEmpty:!0},{slug:"label",name:this.t("label_08243"),category:this.t("champs_de_formu_64126"),fieldType:He.Text},{slug:"customFieldCategory",name:this.t("cat_gorie_00291"),category:this.t("champs_de_formu_64126"),fieldType:He.Select,values:t.customFieldsCategories.nodes,hideEmpty:!0},{slug:"fieldType",name:this.t("type_35427"),category:this.t("champs_de_formu_64126"),fieldType:He.Select,values:pn.map(e=>({id:e,name:e})),hideEmpty:!0},{slug:"variety",name:this.t("typologie_34041"),category:this.t("champs_de_formu_64126"),fieldType:He.Select,values:(0,uc.A)(rn.map(e=>({id:e,name:hA(this.t.bind(this),e)})),({name:e})=>e),hideEmpty:!0},{slug:"privacy",name:this.t("Privacy"),category:this.t("champs_de_formu_64126"),fieldType:He.Checkbox,hideEmpty:!0},{slug:"condition",name:this.t("condition_61066"),category:this.t("champs_de_formu_64126"),fieldType:He.Select,values:t.customFields.nodes},{slug:"isEncrypted",name:this.t("est_chiffr_99072"),category:this.t("champs_de_formu_64126"),fieldType:He.Checkbox,hideEmpty:!0},{slug:"createdBy",name:this.t("cr_e_par_30622"),category:this.t("champs_de_formu_64126"),fieldType:He.Select,hideEmpty:!0,needLoading:!0,organizationId:e},{slug:"createdAt",name:this.t("cr_e_le_02658"),category:this.t("champs_de_formu_64126"),fieldType:He.Datetime,hideEmpty:!0}]}getCustomFieldsPossibleColumns(){return[{slug:"id",name:this.t("id_51738"),isSortable:!0,sortAttribute:be.Id,width:100},{slug:"name",name:this.t("nom_du_champ_48329"),isSortable:!0,sortAttribute:be.Name,minWidth:240},{slug:"label",name:this.t("label_08243"),isSortable:!0,sortAttribute:be.Label,minWidth:180},{slug:"category",name:this.t("Category"),isSortable:!0,sortAttribute:be.Category,minWidth:240},{slug:"variety",name:this.t("typologie_34041"),minWidth:180},{slug:"fieldType",name:this.t("type_35427"),isSortable:!0,sortAttribute:be.Type,width:250},{slug:"numberOfTimesUsed",name:this.t("nombre_d_utilis_58389"),width:200},{slug:"state",name:this.t("Privacy"),isSortable:!0,sortAttribute:be.Status,width:200},{slug:"values",name:this.t("valeurs_34314"),minWidth:240},{slug:"variable",name:this.t("variable_pour_l_45711"),minWidth:180},{slug:"isEncrypted",name:this.t("est_chiffr_99072"),width:200},{slug:"createdBy",name:this.t("cr_par_41994"),minWidth:180},{slug:"createdAt",name:this.t("cr_le_85046"),isSortable:!0,sortAttribute:be.CreatedAt,minWidth:180}]}};LD=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[hu,Jc,qn])],LD);const BD=()=>{const{translate:e}=vl(),{massActions:t,onMassEditSuccess:n,organizationId:s,predicates:o,segment:r}=vy(),{showNotification:a}=Ob(),{mutate:l}=To(),{mutate:d}=Qr(),[c,u]=(0,L.useState)(!1),[h,g]=(0,L.useState)(!1),p=t.getSelectedsInput(o,null),f=t.isAllSelected?r.count:t.numberOfSelected,_=(0,L.useCallback)(e=>{m(e)&&a(e),n()},[n]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zl,{onClick:()=>{u(!0)},children:e("_diter_une_prop_26724")}),(0,i.jsxs)(Wd,{children:[(0,i.jsx)(Xd,{children:(0,i.jsx)(zl,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsx)(Zd,{placement:"bottom-end",children:(0,i.jsx)(Kd,{color:"red",icon:"trash-can",onClick:()=>{g(!0)},children:e("supprimer_43083")})})]}),c&&(0,i.jsx)(xA,{mutate:e=>l({organizationId:s,massEdit:e}),organizationId:s,selecteds:p,onClose:()=>{u(!1)},onSuccess:t=>{_(e("_1_champs_pers_55120",t))}}),h&&(0,i.jsx)(cA,{buttonText:e("supprimer_43083"),subtext:[e("_tes_vous_s_r_d_63402")],text:e("suppression_de_98457",f),onClose:()=>{g(!1)},onDelete:async()=>{const t=(await d({organizationId:s,selecteds:p})).numberOfCustomFields;_(e("_1_champs_pers_68086",t))}})]})},VD=()=>{const{history:e,translate:t,params:{organizationId:n}}=vl(),{segment:s}=vy();return(0,i.jsx)(g$,{children:(0,i.jsx)(Kb,{permissions:Hb.CUSTOM_FIELD_EDIT,children:(0,i.jsx)(zl,{onClick:()=>{e.push(Ps.CREATE_CUSTOM_FIELD(n,s.id))},children:t("cr_er_un_champ_31226")})})})},UD=L.createContext({}),WD=e=>{const t=T$(zo,{organizationId:e.organizationId},e=>e.organization.customFieldsCategories.nodes);return(0,i.jsx)(UD.Provider,{value:{getCustomFieldsCategories:t},children:e.children})},GD=e=>{const{translate:t}=vl(),{getCustomFieldsCategories:n}=L.useContext(UD),{result:s,isLoading:o}=U$(n);return o?(0,i.jsxs)(Ba,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(Ml,{children:t("Category")}),(0,i.jsx)(lc,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)($u,{label:t("Category"),shouldParseAsInt:!0,value:e.value,onChange:e.setValue,children:s.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})},HD=e=>{const{params:{organizationId:t}}=vl(),{mutate:n}=To();return(0,i.jsx)(yy,{column:e.column,initialValue:e.initialValue,mutate:async i=>n({organizationId:t,massEdit:{reset:!1,selecteds:{ids:[e.customFieldId]},slug:e.property,strategy:it.Replace,value:i}}),reload:e.reload,renderInput:e.renderInput,renderValue:e.renderValue,updatable:!0})},qD=e=>(0,i.jsx)(HD,{column:e.column,customFieldId:e.customField.id,initialValue:e.customField.category.id,property:ve.Category,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(GD,{setValue:t,value:e}),renderValue:e.customField.category.name}),KD=e=>{const{translate:t}=vl();return(0,i.jsx)(HD,{column:e.column,customFieldId:e.customField.id,initialValue:e.customField.label||"",property:ve.Label,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(Bl,{name:t("label_08243"),value:e,onChange:n}),renderValue:e.customField.label||""})},YD=e=>{const{translate:t}=vl();return(0,i.jsx)(HD,{column:e.column,customFieldId:e.customField.id,initialValue:e.customField.name,property:ve.Name,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(Bl,{name:t("nom_du_champ_48329"),value:e,onChange:n}),renderValue:()=>(0,i.jsxs)(Ba,{direction:"column",width:1,children:[(0,i.jsx)(Ar,{color:"gray800",css:{ellipsis:!0,width:"100%"},title:e.customField.name,children:e.customField.name}),e.customField.conditionCustomField&&(0,i.jsx)(Ar,{color:"gray500",css:{ellipsis:!0,width:"100%"},title:e.customField.conditionCustomField.name,children:t("d_pend_de_1_52961",e.customField.conditionCustomField.name)})]})})},ZD=e=>{const{translate:t}=vl();return(0,i.jsx)(HD,{column:e.column,customFieldId:e.customField.id,initialValue:e.customField.isPrivate,property:ve.Privacy,reload:e.reload,renderInput:(e,n)=>(0,i.jsxs)($u,{label:t("Privacy"),shouldParseAsBoolean:!0,value:e,onChange:n,children:[(0,i.jsx)("option",{value:"true",children:t("Private")}),(0,i.jsx)("option",{value:"false",children:t("Public")})]}),renderValue:()=>e.customField.isPrivate?(0,i.jsx)(rc,{color:"gray",leftIcon:"lock",children:t("Private")}):(0,i.jsx)(rc,{color:"primary",leftIcon:"globe",children:t("Public")})})},XD=e=>{const{history:t,translate:n}=vl();return"id"===e.column.slug?(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.id}):"name"===e.column.slug?(0,i.jsx)(YD,{column:e.column,customField:e.row,reload:e.reloadRow}):"label"===e.column.slug?(0,i.jsx)(KD,{column:e.column,customField:e.row,reload:e.reloadRow}):"category"===e.column.slug?(0,i.jsx)(qD,{column:e.column,customField:e.row,reload:e.reloadRow}):"fieldType"===e.column.slug?(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsxs)(Ba,{children:[(0,i.jsx)(Ar,{color:"gray800",css:{width:"18px"},children:(0,i.jsx)(nl,{icon:Zz(e.row.fieldType,e.row.fieldProperty)})}),(0,i.jsx)(Ya,{width:"2"}),(0,i.jsx)(Ar,{color:"gray800",children:n(e.row.fieldType)})]})}):"numberOfTimesUsed"===e.column.slug?(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:0===e.row.numberOfTimesUsed?e.row.numberOfTimesUsed:(0,i.jsx)(Ar,{color:"primary500",css:{cursor:"pointer",textDecoration:"underline"},onClick:()=>{t.push(Ps.CUSTOM_FIELD_USAGE(e.organizationId,e.segmentId,e.row.id))},children:e.row.numberOfTimesUsed})}):"state"===e.column.slug?(0,i.jsx)(ZD,{column:e.column,customField:e.row,reload:e.reloadRow}):"values"===e.column.slug?(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.values.map(({value:e})=>e).join(", ")}):"variable"===e.column.slug?(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.variety===je.UserInfo?`{user.${e.row.slug}}`:e.row.variety===je.Event?`{event.${e.row.slug}}`:""}):"variety"===e.column.slug?(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:hA(n,e.row.variety)}):"isEncrypted"===e.column.slug?(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.isEncrypted?n("oui_54361"):n("non_33516")}):"createdBy"===e.column.slug?(0,i.jsx)(NR,{column:e.column,createdBy:e.row.createdBy}):"createdAt"===e.column.slug?(0,i.jsx)(MR,{column:e.column,insertedAt:e.row.insertedAt}):(0,i.jsx)(Oc,{})},JD=e=>{const{history:t,translate:n}=vl(),{showNotification:s}=Ob(),[o,r]=(0,L.useState)(!1),{mutate:a}=function(e={}){return ei("mutation CustomFieldDuplicate($organizationId: OrganizationId!, $customFieldId: CustomFieldId!) {\n customFieldDuplicate(organizationId: $organizationId, customFieldId: $customFieldId) {\n id\n }\n}\n",e)}(),{mutate:l}=Qr(),[d,c]=(0,L.useState)(!1),u=e.customField.canDelete&&(e.customField.fieldType!==We.Select||e.customField.isSelectV2);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Yc,{isOpen:o,onStateChange:r,children:[(0,i.jsx)(qd,{onClick:n=>{Vd(n.target),t.push(Ps.EDIT_CUSTOM_FIELD(e.organizationId,e.segmentId,e.customField.id))},children:(0,i.jsxs)(Ba,{align:"center",gap:"3",children:[(0,i.jsx)(nl,{icon:"pen"}),n("_diter_62574")]})}),u&&(0,i.jsx)(qd,{onClick:async n=>{Vd(n.target);const{customFieldDuplicate:{id:i}}=await a({organizationId:e.organizationId,customFieldId:e.customField.id});e.reload(),t.push(Ps.EDIT_CUSTOM_FIELD(e.organizationId,e.segmentId,i))},children:(0,i.jsxs)(Ba,{align:"center",gap:"3",children:[(0,i.jsx)(nl,{icon:"clone"}),n("dupliquer_28256")]})}),e.customField.canDelete&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Xu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(qd,{color:"red",onClick:()=>{r(!1),c(!0)},children:(0,i.jsxs)(Ba,{align:"center",gap:"3",children:[(0,i.jsx)(nl,{icon:"trash-can"}),n("supprimer_43083")]})})]})]}),d&&(0,i.jsx)(cA,{buttonText:n("supprimer_43083"),subtext:n("_tes_vous_s_r_d_96670"),text:n("suppression_de_73669",e.customField.name),onClose:()=>{c(!1)},onDelete:async()=>{await l({organizationId:e.organizationId,selecteds:{ids:[e.customField.id]}}),s(n("le_champ_1_43589",e.customField.name)),e.reload()}})]})},QD=e=>{const{history:t,translate:n}=vl(),{canCustomFieldEdit:s}=DS(),o=(0,L.useCallback)(()=>{e.reloadCustomField(e.customField.id)},[e.customField,e.reloadCustomField]);return(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(Mc,{css:{"&:hover":{background:"$gray100"}},onMouseLeave:e=>{Vd(e.target)},children:[s&&(0,i.jsx)(Oc,{justify:"center",width:48,children:(0,i.jsx)(fc,{state:e.state,onClick:(t,n)=>{Dl(n),e.toggleRow(`cf${e.customField.id}`,t)}})}),e.columns.map(t=>(0,i.jsx)(XD,{column:t,organizationId:e.organizationId,reloadRow:o,row:e.customField,segmentId:e.segmentId},t.slug)),s&&(0,i.jsxs)(Xc,{justify:"end",children:[(0,i.jsxs)(km,{children:[(0,i.jsx)(Sm,{children:(0,i.jsx)(Ar,{children:(0,i.jsx)(nl,{icon:"pen",onClick:()=>{t.push(Ps.EDIT_CUSTOM_FIELD(e.organizationId,e.segmentId,e.customField.id))}})})}),(0,i.jsx)(wm,{placement:"top",children:n("_diter_62574")})]}),(0,i.jsx)(JD,{customField:e.customField,organizationId:e.organizationId,reload:e.reload,segmentId:e.segmentId})]})]})})},eP=()=>{const{params:{organizationId:e}}=vl(),{canCustomFieldEdit:t}=DS(),{columns:n,limit:s,massActions:o,nameDebounced:r,offset:a,possibleColumns:l,predicates:d,reloadKey:c,segmentId:u,setLimit:h,setOffset:g,setSort:p,sort:f}=vy(),{data:_,isLoading:x,reload:I}=Qn("query CustomFields(\n $organizationId: OrganizationId!\n $name: String\n $predicates: [Predicate!]!\n $limit: Int\n $offset: Int\n $sort: CustomFieldsSort\n) {\n data: organization(id: $organizationId) {\n rows: customFields(\n predicates: $predicates\n name: $name\n limit: $limit\n offset: $offset\n sort: $sort\n ) {\n nodes {\n ...CustomField\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{organizationId:e,predicates:d,name:m(r)?r:null,limit:s,offset:a,sort:f},[Vs.CustomFieldFragment]);const{numberOfPages:v,totalCount:b}=Su(_.data?.rows),j=(0,L.useMemo)(()=>n.flatMap(e=>(0,Za.A)([l.find(t=>t.slug===e)])),[l,n]),[C,y]=(0,L.useState)([]),[k,A]=(0,L.useState)({}),w=(0,L.useCallback)(async t=>{A(e=>({...e,[t]:!0}));const{data:{row:n}}=await function(e,t){return go("query CustomField($organizationId: OrganizationId!, $id: CustomFieldId!) {\n data: organization(id: $organizationId) {\n row: customField(id: $id) {\n ...CustomField\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[Vs.CustomFieldFragment]})}({organizationId:e,id:t},await Y());y(e=>e.map(e=>e.id===t?n:e)),A(e=>({...e,[t]:!1}))},[A,y]);return(0,L.useEffect)(()=>{y(_.data?.rows.nodes??[])},[_.data]),(0,L.useEffect)(()=>{c>1&&I()},[c]),(0,L.useEffect)(()=>{o.setStates(Object.fromEntries((_.data?.rows.nodes??[]).map(e=>[`cf${e.id}`,{id:e.id,state:"unchecked"}])))},[_.data,o.setStates]),(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Ba,{css:{flex:"1",overflow:"hidden"},width:1,children:(0,i.jsx)(Cm,{"aria-busy":x,headerRow:(0,i.jsxs)(kc,{children:[t&&(0,i.jsx)(Gc,{justify:"center",width:48,children:(0,i.jsx)(fc,{state:o.selectAllState,onClick:o.toggleSelectAll})}),j.map(e=>e.isSortable?(0,i.jsx)(jm,{attribute:e.sortAttribute||e.slug,minWidth:e.minWidth,setSort:p,sort:f,width:e.width,children:(0,i.jsx)(Ar,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug):(0,i.jsx)(Gc,{minWidth:e.minWidth,width:e.width,children:(0,i.jsx)(Ar,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug)),t&&(0,i.jsx)(Gc,{width:100})]}),paginationRow:(0,i.jsx)(Nc,{css:{borderTop:"1px solid $gray200"},children:(0,i.jsx)(Fc,{limit:s,numberOfPages:v,offset:a,setLimit:h,setOffset:g,showLimits:!0,totalCount:b})}),children:x?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Hc,{}),(0,i.jsx)(Hc,{}),(0,i.jsx)(Hc,{})]}):C.map(t=>k[t.id]?(0,i.jsx)(Hc,{},t.id):(0,i.jsx)(QD,{columns:j,customField:t,organizationId:e,reload:I,reloadCustomField:w,segmentId:u,state:o.states[`cf${t.id}`]?.state??"unchecked",toggleRow:o.toggleRow},t.id))})})})},tP=()=>{const{history:e,translate:t,params:{organizationId:n,customFieldId:s}}=vl(),{data:o,loader:r}=Qn("query CustomFieldUsage($organizationId: OrganizationId!, $customFieldId: CustomFieldId!) {\n organization(id: $organizationId) {\n customField(id: $customFieldId) {\n name\n fieldProperty\n fieldType\n\n positions {\n id\n name\n\n event {\n id\n name\n }\n }\n\n forms {\n id\n name\n\n event {\n id\n name\n }\n\n organization {\n id\n name\n }\n }\n }\n }\n}\n",{organizationId:n,customFieldId:s},[]),a=o.organization?.customField;return(0,i.jsx)(vu,{returnToFallback:Ps.CUSTOM_FIELDS(n),size:"sm",children:r?(0,i.jsx)(bu,{children:r}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zj,{children:t("nombre_d_utilis_58389")}),(0,i.jsxs)(bu,{children:[(0,i.jsx)(Ya,{height:"9"}),(0,i.jsxs)(Ba,{align:"center",direction:"column",children:[(0,i.jsx)(Ba,{align:"center",css:{background:"$purple100",borderRadius:"24px",color:"$purple700",fontSize:"$textXl"},height:64,justify:"center",width:64,children:(0,i.jsx)(nl,{icon:Zz(a.fieldType,a.fieldProperty)})}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(Ar,{color:"gray900",fontSize:"textLg",fontWeight:"semiBold",children:a.name})]}),(0,i.jsx)(Ya,{height:"9"}),a.positions.length>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ar,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("liste_de_missio_27210",a.positions.length)}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(Ba,{direction:"column",gap:"6",children:a.positions.map(t=>(0,i.jsxs)(Ar,{css:{cursor:"pointer"},onClick:()=>{e.push(xs.POSITION({organizationId:n,eventId:t.event.id,positionId:t.id}))},children:[(0,i.jsx)(Ar,{color:"gray800",children:t.event.name}),(0,i.jsx)(Ar,{color:"gray500",children:t.name})]},t.id))}),(0,i.jsx)(Ar,{css:{borderTop:"1px solid $gray200",height:"1px",marginBottom:"$6",marginTop:"$6",width:"100%"}})]}),(0,i.jsx)(Ar,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("liste_des_formu_84836",a.forms.length)}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(Ba,{direction:"column",gap:"6",children:a.forms.map(n=>{const s=n.event?n.event.name:t("communaut_20896");return(0,i.jsxs)(Ar,{css:{cursor:"pointer"},onClick:()=>{e.push(Vi.FORM({organizationId:n.organization.id,eventId:n.event?.id,formId:n.id}))},children:[(0,i.jsx)(Ar,{color:"gray800",children:s}),(0,i.jsx)(Ar,{color:"gray500",children:n.name})]},n.id)})}),(0,i.jsx)(Ya,{height:"9"})]})]})})},nP=()=>{const{history:e,translate:t,params:{organizationId:n}}=vl(),{canCustomFieldEdit:s,canSegmentEdit:o}=DS(),{reloadKey:r,segmentId:a,setReloadKey:l}=vy();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(VD,{}),(0,i.jsxs)(aj,{children:[(0,i.jsx)(m$,{searchRow:(0,i.jsx)(u$,{actions:(0,i.jsx)(BD,{}),searchPlaceholder:t("rechercher_un_c_49598"),showActions:s,showEditColumns:o,showEditMode:s,showSearchColumns:!1})}),(0,i.jsx)(eP,{}),(0,i.jsxs)(Sr.dO,{children:[(0,i.jsx)(Sr.qh,{path:Ps.CUSTOM_FIELD_USAGE(":organizationId",":segmentId",":customFieldId"),children:(0,i.jsx)(tP,{})}),(0,i.jsx)(Sr.qh,{path:Ps.CREATE_CUSTOM_FIELD(":organizationId",":segmentId"),children:(0,i.jsx)(aE,{organizationId:n,onClose:()=>{e.goBack(Ps.CUSTOM_FIELDS_SEGMENT(n,a))},onSuccess:()=>{l(r+1)}})}),(0,i.jsx)(Sr.qh,{path:Ps.EDIT_CUSTOM_FIELD(":organizationId",":segmentId",":customFieldId"),children:(0,i.jsx)(dE,{onClose:()=>{e.goBack(Ps.CUSTOM_FIELDS_SEGMENT(n,a))},onSuccess:()=>{l(r+1)}})})]})]})]})},iP=e=>{const{history:t,translate:n,params:{organizationId:s,segmentId:o}}=vl();Md(n("champs_de_formu_64126"));const{isOrganizationAdmin:r,localOrganization:a,updateLocalOrganization:l}=TI(),d=Zn(LD),c=(0,L.useMemo)(()=>d.getCustomFieldsFilters(s,e.organization),[e.organization,s]),u=(0,L.useMemo)(()=>d.getCustomFieldsPossibleColumns(),[]);return(0,i.jsx)(WD,{organizationId:s,children:(0,i.jsx)(l$,{canEditSegments:r,filters:c,filtersButtonText:n("filtrer_les_cha_91574"),filtersSubtitle:n("appliquer_des_f_27562"),getSegmentPath:e=>Ps.CUSTOM_FIELDS_SEGMENT(s,e),initialLimit:a?.customFieldsLimit??Rc,initialSegmentsOpen:a?.areCustomFieldsSegmentsOpen??!0,organizationId:s,possibleColumns:u,possibleRenderings:[],reload:e.reload,segmentId:o,segmentType:jt.CustomFields,segmentsFolders:e.organization.segmentsFolders,setLimit:e=>{l({customFieldsLimit:e})},onSegmentClick:e=>{l({customFieldsSegmentId:e})},onSegmentDelete:async()=>{await l({customFieldsSegmentId:null}),t.replace(Ps.CUSTOM_FIELDS(s))},onSegmentsToggle:async e=>{await l({areCustomFieldsSegmentsOpen:e})},children:(0,i.jsx)(nP,{})})})},sP=()=>{const{params:{organizationId:e}}=vl(),{localOrganization:t}=TI(),{data:n,loader:s,reload:o}=Qn("query CustomFieldsSegments($organizationId: OrganizationId!, $predicates: [Predicate!]!) {\n organization(id: $organizationId) {\n customFields(predicates: $predicates) {\n nodes {\n id\n name\n }\n }\n\n customFieldsCategories {\n nodes {\n id\n name\n }\n }\n\n segmentsFolders(level: Organization, segmentType: CustomFields) {\n ...SegmentsFoldersSegments\n }\n }\n}\n",{organizationId:e,predicates:[{operator:gt.Is,slug:"condition",value:[]}]},[Vs.SegmentsFoldersSegmentsFragment]);const r=(0,L.useMemo)(()=>(n.organization?.segmentsFolders??[]).flatMap(e=>e.segments).map(e=>e.id),[n.organization]);return s||(0,i.jsxs)(Sr.dO,{children:[(0,i.jsx)(Sr.qh,{path:Ps.CUSTOM_FIELDS_SEGMENT(":organizationId",":segmentId"),children:(0,i.jsx)(iP,{organization:n.organization,reload:o})}),(0,i.jsx)(Sr.qh,{children:(0,i.jsx)(oi,{path:Ps.CUSTOM_FIELDS_SEGMENT(e,t?.customFieldsSegmentId&&r.includes(t.customFieldsSegmentId)?t.customFieldsSegmentId:r[0]),replace:!0})})]})},oP=e=>{const{translate:t}=vl();return(0,i.jsxs)(Wd,{children:[(0,i.jsx)(Xd,{children:(0,i.jsx)(zl,{color:"invisible",leftIcon:"plus",children:t("lier_un_champ_p_01331")})}),(0,i.jsx)(Zd,{css:{padding:"0"},placement:"top-start",width:400,children:(0,i.jsx)(kC,{customFields:e.formCustomFields,selectedCustomFieldsIds:e.selectedCustomFieldsIds,toggle:e.toggle})})]})},rP=e=>{const{translate:t}=vl();return(0,i.jsxs)(Ba,{align:"center",css:{background:"$gray50",bd:"gray200 2",padding:"$6"},direction:"column",gap:"2",width:1,children:[(0,i.jsx)(Ar,{font:"gray800 textSm medium",children:t("aucun_champ_per_72101")}),(0,i.jsx)(oP,{formCustomFields:e.formCustomFields,selectedCustomFieldsIds:e.selectedCustomFieldsIds,toggle:e.toggle})]})},aP=e=>{const t=(0,L.useMemo)(()=>Object.fromEntries(e.formCustomFields.map(e=>[e.id,e])),[e.formCustomFields]);return(0,i.jsx)(Iu.JY,{onDragEnd:e.onDragEnd,children:(0,i.jsx)(Iu.gL,{droppableId:"1",children:n=>(0,i.jsxs)(Ba,{css:{bd:!0},direction:"column",width:1,...n.droppableProps,ref:n.innerRef,children:[e.formCustomFieldsValues.map((n,s)=>(0,i.jsx)(hE,{css:{border:"none",borderBottom:"1px solid $gray200",borderRadius:"0",boxShadow:"none","&:last-child":{borderBottom:"none"}},elementId:n.id,field:t[n.customFieldId],index:s,isMandatory:n.isMandatory,showEdit:!1,toggleIsMandatory:e.toggleMandatory,updateCustomField:td.A,onDelete:e.onDelete},n.id)),n.placeholder]})})})},lP=e=>{const{translate:t}=vl(),n=(0,L.useMemo)(()=>new Set(e.formCustomFieldsValues.map(({customFieldId:e})=>e)),[e.formCustomFieldsValues]),s=(0,L.useCallback)(t=>{e.change(`${e.prefix}formCustomFields`,t)},[e.prefix,e.change]),o=(0,L.useCallback)(t=>{n.has(t.id)?s(e.formCustomFieldsValues.filter(({customFieldId:e})=>e!==t.id)):s([...e.formCustomFieldsValues,{id:V(),customFieldId:t.id,isMandatory:!0}])},[e.formCustomFieldsValues,n,s]),r=(0,L.useCallback)(({reason:t,source:n,destination:i})=>{"DROP"===t&&i&&n.index!==i.index&&s(lo(e.formCustomFieldsValues,n.index,i.index))},[e.formCustomFieldsValues,s]),a=(0,L.useCallback)((t,n)=>{s((0,xu.jM)(e.formCustomFieldsValues,e=>{e[t].isMandatory=n}))},[e.formCustomFieldsValues,s]),l=(0,L.useCallback)(t=>{s((0,xu.jM)(e.formCustomFieldsValues,e=>{e.splice(t,1)}))},[e.formCustomFieldsValues,s]);return(0,i.jsxs)(Ba,{gap:"7",children:[(0,i.jsx)(Ba,{width:280,children:(0,i.jsx)(Ar,{font:"gray800 textSm medium",children:t("champs_personna_17489")})}),(0,i.jsx)(Ba,{css:{flex:"1"},children:so(e.formCustomFieldsValues)?(0,i.jsxs)(Ba,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(aP,{formCustomFields:e.formCustomFields,formCustomFieldsValues:e.formCustomFieldsValues,toggleMandatory:a,onDelete:l,onDragEnd:r}),(0,i.jsx)(oP,{formCustomFields:e.formCustomFields,selectedCustomFieldsIds:n,toggle:o})]}):(0,i.jsx)(rP,{formCustomFields:e.formCustomFields,selectedCustomFieldsIds:n,toggle:o})})]})},dP=e=>{const{params:{organizationId:t}}=vl(),n=(0,L.useMemo)(()=>(0,uc.A)((0,xh.A)(e.customFields.map(e=>e.category),e=>e.id),e=>e.name.toLowerCase()),[e.customFields]),s=(0,L.useMemo)(()=>(0,cc.A)(e.customFields,e=>e.category.id),[e.customFields]);return(0,i.jsxs)(Ba,{direction:"column",children:[n.map((n,o)=>{const r=s[n.id];return(0,i.jsxs)(L.Fragment,{children:[0!==o&&(0,i.jsx)(Ju,{height:"5"}),(0,i.jsxs)(Ba,{gap:"7",children:[(0,i.jsx)(Ba,{width:280,children:(0,i.jsx)(Ar,{font:"gray800 textSm medium",children:n.name})}),(0,i.jsx)(Ba,{css:{flex:"1"},direction:"column",gap:"4",children:r.map(n=>(0,i.jsx)(yC,{change:e.change,display:!0,field:n,fileAcl:"public-read",isMandatory:!1,organizationId:t,prefix:`${e.prefix}fields.`},n.id))})]})]},n.id)}),so(e.customFields)&&e.showFormCustomFields&&(0,i.jsx)(Ju,{height:"5"}),e.showFormCustomFields&&(0,i.jsx)(lP,{change:e.change,formCustomFields:e.formCustomFields,formCustomFieldsValues:e.formCustomFieldsValues,prefix:e.prefix})]})},cP=e=>{const{history:t,translate:n,params:{organizationId:s}}=vl(),o=Zn(hu),r=(0,L.useMemo)(()=>eI.map((e,t)=>(0,i.jsx)("option",{value:e,children:e},t)),[]);return(0,i.jsxs)(i.Fragment,{children:[e.showEmailSender&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ym,{isCreateVisible:!0,isSearchVisible:!0,label:n("_metteur_des_e_27849"),name:"event.emailSenderId",onCreateClick:()=>{t.push(Ps.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(s))},children:e.emailsSenders.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(Ya,{height:"4"})]}),(0,i.jsx)(Nr.Yr,{name:"event.languages",children:t=>{!e.hasLanguagesFeature&&t.length>1&&e.change("event.languages",[(0,lu.A)(t)])}}),(0,i.jsx)(Ym,{label:n("langues_de_l_v_94191"),multiple:!0,name:"event.languages",children:Id.map(e=>(0,i.jsx)("option",{value:e,children:n(e)},e))}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(Ym,{isSearchVisible:!0,label:n("fuseau_horaire_14654"),name:"event.timeZone",children:r}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(lb,{label:n("heure_laquell_13491"),name:"event.dayStartTime"}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(Ym,{isSearchVisible:!0,label:n("Country"),name:"event.country",children:o.getCountriesIdName().map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsxs)(Qj,{label:n("fond_de_carte_43822"),name:"event.layer",children:[(0,i.jsx)("option",{value:nt.Google,children:n("plan_24242")}),(0,i.jsx)("option",{value:nt.GoogleSatellite,children:n("satellite_64364")}),(0,i.jsx)("option",{value:nt.IgnPlan,children:n("plan_ign_03240")})]}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsxs)(Ba,{gap:"6",children:[(0,i.jsx)(Km,{label:(0,i.jsx)(Zv,{children:n("latitude_par_d_01620")}),name:"event.latitude"}),(0,i.jsx)(Km,{label:(0,i.jsx)(Zv,{children:n("longitude_par_d_28326")}),name:"event.longitude"})]}),e.weezeventOrganizationId&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(Jm,{name:"event.isWeezeventSynchronized",children:n("synchroniser_av_82451")})]}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsxs)(Ba,{direction:"column",gap:"3",children:[(0,i.jsx)(Ar,{color:"gray800",fontWeight:"medium",children:n("modules_activ_s_07626")}),(0,i.jsx)(Jm,{name:"event.usePositions",children:n("missions_63972")}),(0,i.jsx)(Jm,{name:"event.useAccreditations",children:n("accr_ditations_39450")}),(0,i.jsx)(Jm,{name:"event.useDelegations",children:n("d_l_gations_78318")}),(0,i.jsx)(Jm,{name:"event.useForms",children:n("Form_plural")}),(0,i.jsx)(Jm,{name:"event.useCampaigns",children:n("Campaigns")}),(0,i.jsx)(Jm,{name:"event.useDocuments",children:n("Documents")}),(0,i.jsx)(Jm,{name:"event.useWorkflows",children:n("automatisations_60045")})]})]})},uP=e=>{const{history:t,translate:n,params:{organizationId:s}}=vl(),o=Zn(oI),r=Zn(Ua),{hasFeature:a,reload:l}=TI(),d=(0,L.useRef)(null),c=(0,L.useMemo)(()=>({event:e.initialValues}),[e.initialValues]),u=(0,L.useMemo)(()=>!(!(e.initialValues.languages.length>1||"number"==typeof e.initialValues.emailSenderId)&&e.initialValues.dayStartTime.startsWith("00:00")&&e.initialValues.usePositions&&e.initialValues.useAccreditations&&e.initialValues.useDelegations&&e.initialValues.useForms&&e.initialValues.useCampaigns&&e.initialValues.useDocuments&&e.initialValues.useWorkflows),[e.initialValues]),h=(0,L.useMemo)(()=>e.isEdit&&so(Object.keys(e.initialValues.fields)),[e.isEdit,e.initialValues]),g=(0,L.useMemo)(()=>m(e.initialValues.description),[e.initialValues]),p=(0,L.useMemo)(()=>!!e.isEdit&&so(e.initialValues.tagsIds),[e.isEdit,e.initialValues]);return(0,i.jsx)(kl,{customErrorRef:d,height:1,initialValues:c,initialValuesEqual:()=>!0,render:({form:t,handleSubmit:o,values:r})=>(0,i.jsx)(Lm,{button:e.isEdit&&(0,i.jsx)(zl,{isLoading:e.isMutateLoading,onClick:o,children:n("mettre_jour_l_28846")}),category:e.organization.name,color:"dark",fallbackClosePath:Hi.EVENTS({organizationId:s}),heading:e.isEdit?n("mise_jour_de_17055",e.initialValues.name):n("cr_ation_d_un_94106"),children:(0,i.jsxs)(Mm,{ref:d,children:[(0,i.jsx)(jl,{}),(0,i.jsx)(Vm,{hideToggle:!0,initialIsOpen:!0,subtitle:n("param_trer_votr_94121"),heading:n("dites_en_nous_u_13238"),children:(0,i.jsx)(uI,{form:t,values:r})}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(Vm,{initialIsOpen:u,subtitle:n("param_trer_l_m_66748"),heading:n("options_avanc_e_12396"),children:(0,i.jsx)(cP,{change:t.change,emailsSenders:e.organization.emailsSenders,hasLanguagesFeature:a(Be.Languages),showEmailSender:!0,weezeventOrganizationId:e.organization.weezeventOrganizationId})}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(Vm,{initialIsOpen:h,subtitle:n("ajouter_des_inf_87361"),heading:n("champs_de_formu_64126"),onToggle:e=>{e||t.change("event.fields",{})},children:(0,i.jsx)(dP,{change:t.change,customFields:e.eventCustomFields,formCustomFields:[],formCustomFieldsValues:[],prefix:"event.",showFormCustomFields:!1})}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(Vm,{initialIsOpen:g,subtitle:n("ajouter_une_des_44242"),heading:n("Description"),onToggle:e=>{e||t.change("event.description","")},children:(0,i.jsx)(rb,{label:(0,i.jsx)(Zv,{children:n("description_58935")}),name:"event.description"})}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(Vm,{initialIsOpen:p,subtitle:n("ajouter_des_tag_23887"),heading:n("tags_79499"),onToggle:e=>{e||t.change("event.tagsIds",[])},children:(0,i.jsx)(aC,{change:t.change,name:"event.",organizationId:s,tags:e.organization.tags.nodes,tagsIds:r.event.tagsIds})}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(Bm,{children:(0,i.jsx)(zl,{isLoading:e.isMutateLoading,textAlign:"center",onClick:o,children:e.isEdit?n("mettre_jour_l_28846"):n("cr_er_l_v_neme_16731")})})]})}),validate:r.validateForForm(o.createUpdateEventSchema()),width:1,onSubmit:async n=>{const i=await e.mutate({organizationId:s,event:n.event});l(),e.isEdit?t.goBack(Hi.EVENT({organizationId:s,eventId:i})):t.replace(Hi.EVENT({organizationId:s,eventId:i}))}})},hP=()=>{const e=Zn(oI),{params:{organizationId:t},translate:n}=vl();Md(n("cr_er_l_v_neme_16731"));const{data:s,loader:o}=Qn("query EventCreateInfos($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n ...CreateUpdateEventInfos\n }\n}\n",{organizationId:t},[Vs.CreateUpdateEventInfosFragment]),{mutate:r,isLoading:a}=function(e={}){return ei("mutation CreateEvent($organizationId: OrganizationId!, $event: EventInput!) {\n eventCreate(organizationId: $organizationId, event: $event) {\n id\n }\n}\n",e)}({redirectOnSuccess:!0});return o||(0,i.jsx)(uP,{eventCustomFields:s.organization?.eventCustomFields.nodes??[],initialValues:e.eventInputDefault(),isEdit:!1,isMutateLoading:a,mutate:async e=>{const{eventCreate:{id:t}}=await r(e);return t},organization:s.organization})},mP=()=>{const e=Zn(oI),{params:{organizationId:t,eventId:n},translate:s}=vl(),{data:o,loader:r}=Qn("query EventUpdateInfos($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n ...CreateUpdateEventInfos\n }\n\n event(id: $eventId) {\n name\n description\n languages\n startAt\n endAt\n timeZone\n country\n layer\n latitude\n longitude\n emailSenderId\n dayStartTime\n tagsIds\n fields\n isWeezeventSynchronized\n usePositions\n useAccreditations\n useDelegations\n useForms\n useCampaigns\n useDocuments\n useWorkflows\n }\n}\n",{organizationId:t,eventId:n},[Vs.CreateUpdateEventInfosFragment]);Md(`${s("mettre_jour_l_28846")}: ${o.event?.name}`);const{mutate:a,isLoading:l}=function(e={}){return ei("mutation EventUpdate($organizationId: OrganizationId!, $eventId: EventId!, $event: EventInput!) {\n eventUpdate(organizationId: $organizationId, eventId: $eventId, event: $event) {\n id\n }\n}\n",e)}({redirectOnSuccess:!0});return r||(0,i.jsx)(uP,{eventCustomFields:o.organization?.eventCustomFields.nodes??[],initialValues:e.eventInputDefault(o.event),isEdit:!0,isMutateLoading:l,mutate:async e=>{const{eventUpdate:{id:t}}=await a({...e,eventId:n});return t},organization:o.organization})};var gP;let pP=class extends LO{static{gP=this}csvInputService;static IMPORT_COLUMNS_DEFAULT={...LO.IMPORT_COLUMNS_DEFAULT,Name:"name",StartAt:"startAt",EndAt:"endAt",Country:"country",DayStartTime:"dayStartTime",Description:"description",Languages:"languages",Latitude:"latitude",Layer:"layer",Longitude:"longitude",Tags:"tags",TimeZone:"timeZone",IsWeezeventSynchronized:"isWeezeventSynchronized",UseAccreditations:"useAccreditations",UseCampaigns:"useCampaigns",UseDelegations:"useDelegations",UseDocuments:"useDocuments",UseForms:"useForms",UsePositions:"usePositions",UseWorkflows:"useWorkflows"};static IMPORT_COLUMNS_REQUIRED=e=>[...e===Je.Update?[gP.IMPORT_COLUMNS_DEFAULT.Id]:[],gP.IMPORT_COLUMNS_DEFAULT.Name,gP.IMPORT_COLUMNS_DEFAULT.StartAt,gP.IMPORT_COLUMNS_DEFAULT.EndAt];constructor(e,t){super(e,t),this.csvInputService=e}};pP=gP=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Cv,qn])],pP);const fP=()=>{const{params:{organizationId:e},translate:t}=vl(),{mutate:n}=function(e={}){return ei("mutation EventsImport($organizationId: OrganizationId!, $input: MappableImportInput!) {\n jobId: eventsImport(organizationId: $organizationId, input: $input)\n}\n",e)}(),{checkEventsImport:s}=Ob(),o=(0,L.useCallback)((e,t)=>s(e,t),[s]),{data:r,loader:a}=Xr({organizationId:e,variety:je.Event});return a||(0,i.jsx)(aR,{ImportInputService:pP,checkImport:o,closePath:Hi.EVENTS({organizationId:e}),customFields:r.organization.customFields.nodes,heading:t("import_events_60816"),importTagPrefix:"events",itemName:{singular:t("_v_nement_22345"),plural:t("_v_nements_53672")},localStorageKeyPrefix:"EVENTS_IMPORT",mutate:n,returnLink:(0,i.jsx)(Zc,{to:Hi.EVENTS({organizationId:e}),children:t("revenir_aux_v_65215")}),showModeSelection:!1})};var _P;!function(e){e.CreatedAt="createdAt",e.CreatedBy="createdBy",e.Description="description",e.EndAt="endAt",e.Id="id",e.Name="name",e.NumberOfMembers="numberOfMembers",e.NumberOfMembersAccredited="numberOfMembersAccredited",e.NumberOfMembersAssigned="numberOfMembersAssigned",e.StartAt="startAt",e.State="state",e.Tags="tags"}(_P||(_P={}));let xP=class extends _u{constructor(e,t,n){super(e,t,n)}getEventsFilters(e,t){return[{slug:"name",name:this.t("nom_de_l_v_nem_08711"),category:this.t("Event"),fieldType:He.Text,hideEmpty:!0},{slug:_P.Description,name:this.t("Description"),category:this.t("Event"),fieldType:He.Text},{slug:"startAt",name:this.t("date_de_d_but_43380"),category:this.t("Event"),fieldType:He.Date,hideEmpty:!0},{slug:"endAt",name:this.t("date_de_fin_86920"),category:this.t("Event"),fieldType:He.Date,hideEmpty:!0},{slug:"state",name:this.t("status_06428"),category:this.t("Event"),fieldType:He.Select,values:[{id:Me.Ongoing,name:this.t(Me.Ongoing)},{id:Me.Upcoming,name:this.t(Me.Upcoming)},{id:Me.Done,name:this.t(Me.Done)}],hideEmpty:!0},{slug:"tag",name:this.t("Tag"),category:this.t("Event"),fieldType:He.Select,needLoading:!0,organizationId:e,tagContext:wt.Events},{slug:_P.CreatedBy,name:this.t("cr_e_par_30622"),category:this.t("Event"),fieldType:He.Select,hideEmpty:!0,needLoading:!0,organizationId:e},{slug:_P.CreatedAt,name:this.t("cr_e_le_02658"),category:this.t("Event"),fieldType:He.Datetime,hideEmpty:!0},...this.customFieldsToFilters(t)]}getEventPossibleColumns(e){return[{slug:_P.Id,name:this.t("id_51738"),isSearchable:!0,isSortable:!0,sortAttribute:Fe.Id,width:100},{slug:_P.Name,name:this.t("nom_de_l_v_nem_08711"),isSearchable:!0,isSortable:!0,sortAttribute:Fe.Name,minWidth:240},{slug:_P.StartAt,name:this.t("date_de_d_but_43380"),isSortable:!0,sortAttribute:Fe.StartAt,minWidth:180},{slug:_P.EndAt,name:this.t("date_de_fin_86920"),isSortable:!0,sortAttribute:Fe.EndAt,minWidth:180},{slug:_P.State,name:this.t("status_06428"),minWidth:180},{slug:_P.Tags,name:this.t("tags_79499"),minWidth:320},{slug:_P.NumberOfMembers,name:this.t("nombre_de_membr_08851"),minWidth:180},{slug:_P.NumberOfMembersAssigned,name:this.t("nombre_de_membr_87779_plural"),minWidth:180},{slug:_P.NumberOfMembersAccredited,name:this.t("nombre_de_membr_25913"),minWidth:180},{slug:_P.CreatedBy,name:this.t("cr_e_par_30622"),isSearchable:!0,minWidth:180},{slug:_P.CreatedAt,name:this.t("cr_e_le_02658"),isSortable:!0,sortAttribute:Fe.CreatedAt,minWidth:180}].concat(this.customFieldsToPossibleColumns(e))}};xP=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[hu,Jc,qn])],xP);const IP=e=>{const t=Xn(),n=Zn(Jc);return(0,i.jsxs)(Ba,{direction:"column",gap:"1",width:200,children:[(0,i.jsx)(Ar,{font:"gray500 textXs regular",children:t("date_de_l_v_ne_69973")}),(0,i.jsx)(Ar,{font:"gray800 textSm medium",children:Wx(n,e.event.startAt,e.event.endAt)})]})},vP=e=>{const t=Xn();return(0,i.jsxs)(Ba,{direction:"column",gap:"1",width:100,children:[(0,i.jsx)(Ar,{font:"gray500 textXs regular",children:t("status_06428")}),(0,i.jsx)(Ba,{children:(0,i.jsx)(rc,{color:Gx(e.event.state),children:t(e.event.state)})})]})},bP=e=>{const t=Xn(),{mutate:n}=function(e={}){return ei("mutation EventsMassArchive(\n $organizationId: OrganizationId!\n $selecteds: MassActionSelectedsInput!\n) {\n eventsMassArchive(organizationId: $organizationId, selecteds: $selecteds)\n}\n",e)}(),{reload:s}=TI();return(0,i.jsx)(cA,{buttonText:t("archiver_26131"),subtext:t("_tes_vous_s_r_d_76724"),text:t("archivage_de_31255",e.event.name),onClose:e.onClose,onDelete:async()=>{await n({organizationId:e.organizationId,selecteds:{ids:[e.event.id]}}),s(),e.onSuccess()}})};let jP=class extends Gl{constructor(e){super(e)}eventDuplicateInputDefault(e){return{name:this.t("copie_de_1_62900",e.name),startAt:e.startAt,endAt:e.endAt,eventId:null,includeAccreditations:!0,includeCustomDocuments:!0,includeDelegations:!0,includeForms:!0,includePositions:!0,includeSegments:!0,includeTemplates:!0,includeWorkflows:!0}}eventDuplicateSchema(){return d.Ik().shape({name:d.Yj().required(this.t("le_nom_est_requ_61536")),startAt:Qm.required(this.t("la_date_d_but_d_30022")).typeError(this.t("la_date_d_but_d_30022")),endAt:Qm.required(this.t("la_date_de_fin_45068")).typeError(this.t("la_date_de_fin_45068")).test("after-start-at",this.t("la_date_de_fin_00429"),function(){return Gs.c9.isDateTime(this.parent.startAt)&&this.parent.startAt.isValid&&Gs.c9.isDateTime(this.parent.endAt)&&this.parent.endAt.isValid&&this.parent.endAt>=this.parent.startAt}),includeAccreditations:d.zM(),includeCustomDocuments:d.zM(),includeDelegations:d.zM(),includeForms:d.zM(),includePositions:d.zM(),includeSegments:d.zM(),includeTemplates:d.zM(),includeWorkflows:d.zM()})}};jP=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[qn])],jP);const CP=e=>{const t=Xn(),n=Zn(jP),s=Zn(Ua),{mutate:o,isLoading:r}=function(e={}){return ei("mutation EventDuplicate($eventId: EventId!, $options: EventDuplicateInput!) {\n eventDuplicate(eventId: $eventId, options: $options) {\n id\n }\n}\n",e)}(),{organization:a,reload:l}=TI(),[d,c]=(0,L.useState)(!1),u=(0,L.useMemo)(()=>a.events.nodes.filter(t=>t.id!==e.event.id),[a.events.nodes]),h=e.event.endAt.diff(e.event.startAt,"days").days;return(0,i.jsx)(Ga.lV,{initialValues:{options:n.eventDuplicateInputDefault(e.event)},initialValuesEqual:Mr.A,render:({form:n,handleSubmit:s,invalid:o,values:a})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Nr.Yr,{name:"options.startAt",children:e=>{const t=e.plus({days:h});t.equals(a.options.endAt)||n.change("options.endAt",t)}}),(0,i.jsx)(Nr.Yr,{name:"options.endAt",children:e=>{const t=e.minus({days:h});t.equals(a.options.startAt)||n.change("options.startAt",t)}}),(0,i.jsx)(Mb,{icon:"clone",children:t("dupliquer_l_v_72541",e.event.name)}),(0,i.jsxs)(Fb,{css:{overflowY:"auto"},gap:"5",children:[(0,i.jsx)(ku,{value:d,onChange:e=>{c(e),e||n.change("options.eventId",null)},children:t("dupliquer_les_d_77458")}),d?(0,i.jsx)(Ym,{isSearchVisible:!0,label:t("_v_nement_22345"),name:"options.eventId",children:u.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Vl,{label:t("nom_du_nouvel_66511"),name:"options.name"}),(0,i.jsxs)(Ba,{gap:"5",children:[(0,i.jsx)(Hm,{label:t("nouvelle_date_d_75723"),min:Gs.c9.utc(),name:"options.startAt"}),(0,i.jsx)(Hm,{label:t("nouvelle_date_d_93958"),min:Gs.c9.utc(),name:"options.endAt"})]})]}),(0,i.jsxs)(Ba,{direction:"column",gap:"2",children:[(0,i.jsx)(Ar,{font:"gray700 textSm medium",children:t("que_souhaitez_v_40297")}),(0,i.jsxs)(Ba,{direction:"column",gap:"3",children:[(0,i.jsxs)(Ba,{gap:"5",children:[(0,i.jsx)(Ar,{width:1,children:(0,i.jsx)(Gm,{name:"options.includePositions",children:t("missions_63972")})}),(0,i.jsx)(Ar,{width:1,children:(0,i.jsx)(Gm,{name:"options.includeAccreditations",children:t("accr_ditations_39450")})})]}),(0,i.jsxs)(Ba,{gap:"5",children:[(0,i.jsx)(Ar,{width:1,children:(0,i.jsx)(Gm,{name:"options.includeForms",children:t("Form_plural")})}),(0,i.jsx)(Ar,{width:1,children:(0,i.jsx)(Gm,{name:"options.includeDelegations",children:t("d_l_gations_78318")})})]}),(0,i.jsxs)(Ba,{gap:"5",children:[(0,i.jsx)(Ar,{width:1,children:(0,i.jsx)(Gm,{name:"options.includeSegments",children:t("vues_personnali_80652")})}),(0,i.jsx)(Ar,{width:1,children:(0,i.jsx)(Gm,{name:"options.includeCustomDocuments",children:t("documents_perso_87374")})})]}),(0,i.jsxs)(Ba,{gap:"5",children:[(0,i.jsx)(Ar,{width:1,children:(0,i.jsx)(Gm,{name:"options.includeTemplates",children:t("mod_les_de_camp_58182")})}),(0,i.jsx)(Ar,{width:1,children:(0,i.jsx)(Gm,{name:"options.includeWorkflows",children:t("automatisations_60045")})})]})]})]})]}),(0,i.jsx)(Pb,{children:(0,i.jsx)(zl,{disabled:o,isLoading:r,onClick:s,children:t("dupliquer_28256")})})]}),validate:e=>s.validateForForm(n.eventDuplicateSchema())(e.options),onSubmit:async t=>{await o({eventId:e.event.id,options:t.options}),l(),e.reload(),e.onClose()}})},yP=e=>{const{params:{organizationId:t},translate:n}=vl(),{canEventEdit:s}=DS(),[o,r]=(0,L.useState)(!1),[a,l]=(0,L.useState)(!1),d=(0,L.useMemo)(()=>e.event.tags.map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[e.event.tags]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ba,{align:"center",css:{background:"white",bd:!0,padding:"$4 $6"},gap:"4",children:[(0,i.jsx)(Ba,{css:{flex:"1"},children:(0,i.jsx)(Zc,{to:Ps.VOLUNTEERS(t,e.event.id),children:e.event.name})}),(0,i.jsxs)(Ba,{css:{flex:"1",overflow:"hidden"},gap:"8",children:[(0,i.jsx)(IP,{event:e.event}),(0,i.jsx)(vP,{event:e.event}),(0,i.jsxs)(Ba,{css:{flex:"1",overflow:"hidden"},direction:"column",gap:"1",children:[(0,i.jsx)(Ar,{font:"gray500 textXs regular",children:n("tags_79499")}),(0,i.jsx)(Py,{badges:d})]})]}),(0,i.jsxs)(Ba,{gap:"3",children:[(0,i.jsx)(zl,{to:Ps.VOLUNTEERS(t,e.event.id),children:n("voir_l_v_nemen_72358")}),s&&(0,i.jsxs)(Wd,{children:[(0,i.jsx)(Xd,{children:(0,i.jsx)(zl,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Zd,{placement:"bottom-end",children:[(0,i.jsx)(Kd,{icon:"pen",to:Ps.EDIT_EVENT(t,e.event.id),children:n("_diter_62574")}),(0,i.jsx)(Kd,{icon:"clone",onClick:e=>{Vd(e.target),r(!0)},children:n("dupliquer_28256")}),(0,i.jsx)(Xu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Kd,{color:"red",icon:"trash-can",onClick:e=>{Vd(e.target),l(!0)},children:n("archiver_26131")})]})]})]})]}),(0,i.jsx)(Lb,{isOpen:o,onClose:()=>{r(!1)},children:(0,i.jsx)(Nb,{children:(0,i.jsx)(CP,{event:e.event,reload:e.reload,onClose:()=>{r(!1)}})})}),a&&(0,i.jsx)(bP,{event:e.event,organizationId:t,onClose:()=>l(!1),onSuccess:e.reload})]})},kP=()=>{const{translate:e}=vl();return(0,i.jsxs)(Ba,{align:"center",css:{background:"white",bd:!0,minHeight:"75px",padding:"$4 $6"},gap:"4",children:[(0,i.jsx)(Ba,{css:{flex:"1"},children:(0,i.jsx)(lc,{borderRadius:"$1",height:20,width:1})}),(0,i.jsxs)(Ba,{css:{flex:"1"},gap:"8",children:[(0,i.jsxs)(Ba,{direction:"column",gap:"1",width:200,children:[(0,i.jsx)(Ar,{font:"gray500 textXs regular",children:e("date_de_l_v_ne_69973")}),(0,i.jsx)(lc,{borderRadius:"$1",height:20,width:1})]}),(0,i.jsxs)(Ba,{direction:"column",gap:"1",width:70,children:[(0,i.jsx)(Ar,{font:"gray500 textXs regular",children:e("status_06428")}),(0,i.jsx)(lc,{borderRadius:"$1",height:20,width:1})]}),(0,i.jsxs)(Ba,{direction:"column",gap:"1",children:[(0,i.jsx)(Ar,{font:"gray500 textXs regular",children:e("tags_79499")}),(0,i.jsx)(lc,{borderRadius:"$1",height:20,width:1})]})]}),(0,i.jsx)(Ba,{width:200})]})},AP=()=>{const{params:{organizationId:e}}=vl(),{nameDebounced:t,predicates:n,limit:s,offset:o,setLimit:r,setOffset:a}=vy(),{data:l,isLoading:d,reload:c}=ra({organizationId:e,name:m(t)?t:null,predicates:n,limit:s,offset:o,sort:{attribute:Fe.StartAt,direction:yt.Desc},includeCreatedBy:!1,includeNumberOfMembers:!1}),{numberOfPages:u,totalCount:h}=Su(l.data?.rows);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{css:{background:"$gray100",borderLeft:"1px solid $gray200",borderRight:"1px solid $gray200",borderTop:"1px solid $gray200",flex:"1",overflowX:"hidden",overflowY:"auto",padding:"$4"},direction:"column",gap:"3",width:1,children:d?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(kP,{}),(0,i.jsx)(kP,{}),(0,i.jsx)(kP,{})]}):(l.data?.rows.nodes??[]).map(e=>(0,i.jsx)(yP,{event:e,reload:c},e.id))}),(0,i.jsx)(Nc,{css:{borderTop:"1px solid $gray200"},children:(0,i.jsx)(Fc,{limit:s,numberOfPages:u,offset:o,setLimit:r,setOffset:a,showLimits:!0,totalCount:h})})]})},wP=()=>{const{translate:e,params:{organizationId:t}}=vl(),{canEventEdit:n}=DS();return(0,i.jsx)(g$,{children:n&&(0,i.jsx)(nE,{menu:(0,i.jsx)(Kd,{icon:"file-import",to:Hi.EVENTS_IMPORT({organizationId:t}),onClick:e=>Vd(e.target),children:e("importer_via_un_61623")}),path:Ps.CREATE_EVENT(t),children:e("cr_er_un_v_nem_28126")})})},SP=e=>{const{params:{organizationId:t}}=vl(),{mutate:n}=$o();return(0,i.jsx)(yy,{column:e.column,initialValue:e.initialValue,mutate:i=>n({organizationId:t,massEdit:{reset:!1,selecteds:{ids:[e.eventId]},slug:e.property,strategy:it.Replace,value:i}}),reload:e.reload,renderInput:e.renderInput,renderValue:e.renderValue,updatable:e.updatable})},EP=e=>{const{translate:t}=vl(),n=Zn(Jc);return(0,i.jsx)(SP,{column:e.column,eventId:e.event.id,initialValue:e.event.endAt,property:De.EndAt,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(Mu,{label:t("date_de_fin_86920"),value:e,onChange:n}),renderValue:n.toLocaleString(e.event.endAt,eo.DateOnly.WeekdayLongMonthLong),updatable:!0})},TP=e=>{const{translate:t,params:{organizationId:n}}=vl(),{isEditMode:s}=vy();return(0,i.jsx)(SP,{column:e.column,eventId:e.event.id,initialValue:e.event.name,property:De.Name,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(Bl,{label:t("nom_de_l_v_nem_08711"),value:e,onChange:n}),renderValue:()=>(0,i.jsx)(q$,{isEditMode:s,title:e.event.name,updatable:!0,children:(0,i.jsx)(Zc,{to:Hi.EVENT({organizationId:n,eventId:e.event.id}),children:e.event.name})}),updatable:!0})},zP=e=>{const{translate:t}=vl(),n=Zn(Jc);return(0,i.jsx)(SP,{column:e.column,eventId:e.event.id,initialValue:e.event.startAt,property:De.StartAt,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(Mu,{label:t("date_de_d_but_43380"),value:e,onChange:n}),renderValue:n.toLocaleString(e.event.startAt,eo.DateOnly.WeekdayLongMonthLong),updatable:!0})},OP=L.createContext({}),RP=e=>{const t=T$(Uo,{organizationId:e.organizationId},e=>e.organization.tags.nodes);return(0,i.jsx)(OP.Provider,{value:{getTags:t},children:e.children})},$P=e=>{const{translate:t}=vl(),{getTags:n}=L.useContext(OP),{result:s,isLoading:o}=U$(n);return o?(0,i.jsxs)(Ba,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(Ml,{children:t("tags_79499")}),(0,i.jsx)(lc,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(yc,{isSearchVisible:!0,label:t("tags_79499"),multiple:!0,renderOnPortal:!0,values:e.value,onChange:e.setValue,children:s.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})},DP=e=>{const t=(0,L.useMemo)(()=>e.event.tags||[],[e.event]),n=(0,L.useMemo)(()=>t.map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[t]);return(0,i.jsx)(SP,{column:e.column,eventId:e.event.id,initialValue:t.map(e=>e.id),property:De.Tag,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)($P,{setValue:t,value:e}),renderValue:()=>(0,i.jsx)(Py,{badges:n}),updatable:!0})},PP=e=>{const{translate:t}=vl(),{mutate:n}=$o(),s=(0,L.useCallback)((t,i)=>n({organizationId:e.organizationId,massEdit:{reset:!1,selecteds:{ids:[e.row.id]},slug:i,strategy:it.Replace,value:t}}),[e.row,n]);return e.column.slug===_P.Id?(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.id}):e.column.slug===_P.Name?(0,i.jsx)(TP,{column:e.column,event:e.row,reload:e.reloadRow}):e.column.slug===_P.StartAt?(0,i.jsx)(zP,{column:e.column,event:e.row,reload:e.reloadRow}):e.column.slug===_P.EndAt?(0,i.jsx)(EP,{column:e.column,event:e.row,reload:e.reloadRow}):e.column.slug===_P.Tags?(0,i.jsx)(DP,{column:e.column,event:e.row,reload:e.reloadRow}):e.column.slug===_P.State?(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(rc,{color:Gx(e.row.state),children:t(e.row.state)})}):e.column.slug===_P.NumberOfMembers?(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.numberOfMembers}):e.column.slug===_P.NumberOfMembersAccredited?(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.numberOfMembersAccredited}):e.column.slug===_P.NumberOfMembersAssigned?(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.numberOfMembersAssigned}):e.column.slug===_P.CreatedBy?(0,i.jsx)(NR,{column:e.column,createdBy:e.row.createdBy}):e.column.slug===_P.CreatedAt?(0,i.jsx)(MR,{column:e.column,insertedAt:e.row.insertedAt}):(0,i.jsx)(By,{column:e.column,customField:e.customField,fields:e.row.fields,mutate:s,reload:e.reloadRow,updatable:!0})},FP=e=>{const{translate:t,params:{organizationId:n}}=vl(),[s,o]=(0,L.useState)(!1),[r,a]=(0,L.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Yc,{children:[(0,i.jsx)(Kd,{icon:"clone",onClick:e=>{Vd(e.target),o(!0)},children:t("dupliquer_28256")}),(0,i.jsx)(Kd,{color:"red",icon:"trash-can",onClick:e=>{Vd(e.target),a(!0)},children:t("archiver_26131")})]}),(0,i.jsx)(Lb,{isOpen:s,onClose:()=>{o(!1)},children:(0,i.jsx)(Nb,{children:(0,i.jsx)(CP,{event:e.event,reload:e.reload,onClose:()=>{o(!1)}})})}),r&&(0,i.jsx)(bP,{event:e.event,organizationId:n,onClose:()=>a(!1),onSuccess:e.reload})]})},MP=e=>{const{translate:t,params:{organizationId:n}}=vl(),{canEventEdit:s}=DS(),o=_y(e.customFields),r=(0,L.useCallback)(()=>{e.reloadEvent(e.event.id)},[e.event,e.reloadEvent]);return(0,i.jsxs)(Mc,{css:{background:"checked"===e.state?"$primary100":"white","&:hover":{background:"checked"===e.state?"$primary100":"$gray100"}},onMouseLeave:e=>{Vd(e.target)},children:[e.columns.map(t=>{const s=o.get(t.slug);return(0,i.jsx)(PP,{column:t,customField:s,organizationId:n,reloadRow:r,row:e.event},t.slug)}),s&&(0,i.jsxs)(Xc,{justify:"center",children:[(0,i.jsxs)(km,{children:[(0,i.jsx)(Sm,{children:(0,i.jsx)(Ar,{children:(0,i.jsx)(nl,{icon:"pen",to:Ps.EDIT_EVENT(n,e.event.id)})})}),(0,i.jsx)(wm,{placement:"top",children:t("_diter_62574")})]}),(0,i.jsx)(FP,{event:e.event,reload:e.reload})]})]})},NP=e=>{const{params:{organizationId:t}}=vl(),{canEventEdit:n}=DS(),{columns:s,limit:o,massActions:r,nameDebounced:a,offset:l,possibleColumns:d,predicates:c,setLimit:u,setOffset:h,setSort:g,sort:p}=vy(),f=(0,L.useMemo)(()=>function(e){return{includeCreatedBy:e.includes(_P.CreatedBy),includeNumberOfMembers:e.includes(_P.NumberOfMembers)||e.includes(_P.NumberOfMembersAccredited)||e.includes(_P.NumberOfMembersAssigned)}}(s),[s]),{data:_,isLoading:x,reload:I}=ra({...f,organizationId:t,name:m(a)?a:null,predicates:c,limit:o,offset:l,sort:p}),v=(0,L.useMemo)(()=>s.flatMap(e=>(0,Za.A)([d.find(t=>t.slug===e)])),[d,s]),{numberOfPages:b,totalCount:j}=Su(_.data?.rows),[C,y]=(0,L.useState)([]),[k,A]=(0,L.useState)({}),w=(0,L.useCallback)(async e=>{A(t=>({...t,[e]:!0}));const{data:{row:n}}=await(i={...f,organizationId:t,id:e},s=await Y(),go("query EventsEvent(\n $organizationId: OrganizationId!\n $id: EventId!\n $includeCreatedBy: Boolean!\n $includeNumberOfMembers: Boolean!\n) {\n data: organization(id: $organizationId) {\n row: event(id: $id) {\n ...EventsEvent\n }\n }\n}\n",{variables:i,token:s||void 0,fragments:[Vs.EventsEventFragment]}));var i,s;y(t=>t.map(t=>t.id===e?n:t)),A(t=>({...t,[e]:!1}))},[f,A,y]);return(0,L.useEffect)(()=>{y(_.data?.rows.nodes??[])},[_.data]),(0,L.useEffect)(()=>{r.setStates(Object.fromEntries((_.data?.rows.nodes??[]).map(e=>[`e${e.id}`,{id:e.id,state:"unchecked"}])))},[_.data,r.setStates]),(0,i.jsx)(Ba,{css:{flex:"1",overflow:"hidden"},width:1,children:(0,i.jsx)(Cm,{"aria-busy":x,headerRow:(0,i.jsxs)(kc,{children:[v.map(e=>e.isSortable?(0,i.jsx)(jm,{attribute:e.sortAttribute||e.slug,minWidth:e.minWidth,setSort:g,sort:p,width:e.width,children:(0,i.jsx)(Ar,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug):(0,i.jsx)(Gc,{minWidth:e.minWidth,width:e.width,children:(0,i.jsx)(Ar,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug)),n&&(0,i.jsx)(Gc,{width:100})]}),paginationRow:(0,i.jsx)(Nc,{css:{borderTop:"1px solid $gray200"},children:(0,i.jsx)(Fc,{limit:o,numberOfPages:b,offset:l,setLimit:u,setOffset:h,showLimits:!0,totalCount:j})}),children:x?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Hc,{}),(0,i.jsx)(Hc,{}),(0,i.jsx)(Hc,{})]}):C.map(t=>k[t.id]?(0,i.jsx)(Hc,{},t.id):(0,i.jsx)(MP,{columns:v,customFields:e.customFields,event:t,reload:I,reloadEvent:w,state:r.states[`e${t.id}`]?.state??"unchecked"},t.id))})})},LP=e=>{const{translate:t}=vl(),{canEventEdit:n}=DS(),{rendering:s}=vy(),o=n&&s===Uh.List,r=n&&s===Uh.List;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(wP,{}),(0,i.jsxs)(aj,{children:[(0,i.jsx)(m$,{searchRow:(0,i.jsx)(u$,{searchPlaceholder:t("rechercher_un_40024"),showActions:n,showEditColumns:o,showEditMode:r,showSearchColumns:!1})}),s===Uh.List?(0,i.jsx)(NP,{customFields:e.customFields}):(0,i.jsx)(AP,{})]})]})},BP=e=>{const{history:t,translate:n,params:{organizationId:s,segmentId:o}}=vl(),{localOrganization:r,updateLocalOrganization:a}=TI(),{canSegmentEdit:l}=DS(),d=Zn(xP),c=(0,L.useMemo)(()=>e.organization.customFields.nodes,[e.organization]),u=(0,L.useMemo)(()=>d.getEventsFilters(s,c),[s,c]),h=(0,L.useMemo)(()=>d.getEventPossibleColumns(c),[c]);return(0,i.jsx)(RP,{organizationId:s,children:(0,i.jsx)(l$,{canEditSegments:l,filters:u,filtersButtonText:n("filtrer_les_v_48869"),filtersSubtitle:n("appliquer_des_f_84816"),getSegmentPath:e=>Ps.EVENTS_SEGMENT(s,e),initialLimit:r?.eventsLimit??Rc,initialSegmentsOpen:r?.areEventsSegmentsOpen??!0,organizationId:s,possibleColumns:h,possibleRenderings:[Uh.Card,Uh.List],reload:e.reload,segmentId:o,segmentType:jt.Events,segmentsFolders:e.organization.segmentsFolders,setLimit:e=>{a({eventsLimit:e})},onSegmentClick:e=>{a({eventsSegmentId:e})},onSegmentDelete:async()=>{await a({eventsSegmentId:null}),t.replace(Hi.EVENTS({organizationId:s}))},onSegmentsToggle:async e=>{await a({areEventsSegmentsOpen:e})},children:(0,i.jsx)(LP,{customFields:c})})})},VP=()=>{const{params:{organizationId:e},translate:t}=vl();Md(t("events_23531"));const{localOrganization:n}=TI(),{data:s,loader:o,reload:r}=Qn("query EventsSegments($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n customFields(variety: Event) {\n nodes {\n ...SegmentCustomField\n }\n }\n\n segmentsFolders(level: Organization, segmentType: Events) {\n ...SegmentsFoldersSegments\n }\n }\n}\n",{organizationId:e},[Vs.SegmentCustomFieldFragment,Vs.SegmentsFoldersSegmentsFragment]),a=(0,L.useMemo)(()=>(s.organization?.segmentsFolders??[]).flatMap(e=>e.segments).map(e=>e.id),[s.organization]);return o||(0,i.jsxs)(Sr.dO,{children:[(0,i.jsx)(Sr.qh,{path:Ps.EVENTS_SEGMENT(":organizationId",":segmentId"),children:(0,i.jsx)(BP,{organization:s.organization,reload:r})}),(0,i.jsx)(Sr.qh,{children:(0,i.jsx)(oi,{path:Ps.EVENTS_SEGMENT(e,n?.eventsSegmentId&&a.includes(n.eventsSegmentId)?n.eventsSegmentId:a[0]),replace:!0})})]})},UP=()=>{const{params:{organizationId:e},translate:t}=vl(),{loader:n,data:s}=Qn("query EventsMobile($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n events {\n nodes {\n id\n }\n }\n }\n}\n",{organizationId:e},[]);return n||(so(s.organization.events.nodes)?(0,i.jsx)(oi,{path:Ps.DASHBOARD_EVENT_SWITCH(e,s.organization.events.nodes[0].id)}):(0,i.jsx)(Ar,{children:t("no_events_found_69870")}))};let WP=class extends Gl{constructor(e){super(e)}accreditationsCustomFieldInputSchema(){return d.Ik().shape({customFieldId:d.ai().required(this.t("le_champ_person_80074")),conditionValue:d.gl().required(this.t("la_condition_es_66568"))})}};WP=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[qn])],WP);let GP=class extends Gl{constructor(e){super(e)}accreditationsSlotInputDefault(){return{name:""}}createAccreditationSlotSchema(){return d.Ik().shape({slot:this.accreditationsSlotInputSchema()})}accreditationsSlotInputSchema(){return d.Ik().shape({name:d.Yj(),maxResources:d.ai().nullable(),date:Qm.typeError(this.t("la_date_est_inv_22002")).nullable()})}};GP=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[qn])],GP);let HP=class extends Gl{accreditationsCustomFieldInput;accreditationsSlotInput;constructor(e,t,n){super(e),this.accreditationsCustomFieldInput=t,this.accreditationsSlotInput=n}createUpdateAccreditationValuesDefault(e,t,n){const i=this.accreditationInputDefault(e,t,n);return{accreditation:i,hasNumberOfDaysLimit:"number"==typeof i.numberOfDaysLimit}}accreditationInputSchema(){return d.Ik().shape({name:d.Yj().required(this.t("le_nom_de_l_acc_82676")),accreditationCategoryId:d.ai().required(this.t("la_cat_gorie_es_14008")).typeError(this.t("la_cat_gorie_es_14008")).min(1,this.t("la_cat_gorie_es_14008")),description:d.Yj(),privateNote:d.Yj(),acronym:d.Yj(),color:d.Yj().required(this.t("la_couleur_est_95740")),icon:d.Yj().required(this.t("l_ic_ne_est_req_15843")).oneOf(xn,this.t("l_ic_ne_est_req_15843")),weezeventIsSynchronized:d.zM().required(),address:d.Yj().nullable(),latitude:d.ai().nullable().typeError(this.t("la_latitude_doi_43118")),longitude:d.ai().nullable().typeError(this.t("la_longitude_do_35170")),zoom:d.ai().required(this.t("le_niveau_de_zo_52687")).min(0,this.t("le_niveau_de_zo_38516")).max(23,this.t("le_niveau_de_zo_38516")),layer:d.Yj().required(this.t("le_fond_de_cart_48524")).oneOf(jn,this.t("le_fond_de_cart_48524")),slots:d.YO().of(this.accreditationsSlotInput.accreditationsSlotInputSchema()),accreditationDisplay:d.Yj().required(this.t("le_type_d_affic_60154")).oneOf(Zt,this.t("le_type_d_affic_60154")).test("calendar-slots",this.t("tous_les_cr_nea_42033"),(e,t)=>e!==ie.Calendar||so(t.parent.slots)&&t.parent.slots.every(e=>e.date?.isValid)),numberOfDaysLimit:d.ai().notRequired(),accreditationsCustomFields:d.YO().of(this.accreditationsCustomFieldInput.accreditationsCustomFieldInputSchema()),formCustomFields:d.YO(),tagsIds:d.YO().of(d.ai())})}createUpdateAccreditationSchema(){return d.Ik().shape({accreditation:this.accreditationInputSchema()})}accreditationInputDefault(e,t,n){let i=t?.accreditationCategoryId??n;return Number.isInteger(i)||(i=null),{accreditationCategoryId:i,name:t?.name??"",description:t?.description??"",privateNote:t?.privateNote??"",acronym:t?.acronym??"",color:t?.color??xr.colors.primary500.value,icon:t?.icon??Xe.BadgeCheck,weezeventIsSynchronized:t?.weezeventIsSynchronized??!0,willAutoAccredit:t?.willAutoAccredit??!1,address:t?.address??null,latitude:t?.latitude??null,longitude:t?.longitude??null,zoom:t?.zoom??$r,layer:t?.layer??e,accreditationDisplay:t?.accreditationDisplay??ie.List,numberOfDaysLimit:t?.numberOfDaysLimit??null,slots:(0,uc.A)(t?.slots??[],e=>(0,Za.A)([e.date?.toMillis(),e.name])),conditionsOperator:t?.conditionsOperator??_e.And,accreditationsCustomFields:t?.accreditationsCustomFields??[],tagsIds:t?.tagsIds??[],fields:t?.fields??{},formCustomFields:t?.formCustomFields??[]}}};HP=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[qn,WP,GP])],HP);const qP=e=>{const t=Xn(),n=e.customFields.find(t=>t.id===e.customFieldValue.customFieldId);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Nr.Yr,{name:`${e.field}customFieldId`,children:t=>{const n=e.customFields.find(e=>e.id===t);e.change(`${e.field}conditionValue`,n?.fieldType===We.Select?[]:"")}}),(0,i.jsxs)(Ba,{css:{background:"white",bd:!0,padding:"$3 $4"},direction:"column",gap:"4",children:[(0,i.jsx)(Ar,{css:{textTransform:"uppercase"},font:"gray800 textXs semiBold",children:t("condition_n_1_11603",e.index+1)}),(0,i.jsxs)(Ba,{align:"center",gap:"4",children:[(0,i.jsx)(Ar,{css:{flex:"1"},children:(0,i.jsxs)(Ym,{isSearchVisible:!0,label:t("CustomField"),name:`${e.field}customFieldId`,children:[(0,i.jsx)("option",{value:"-1",children:t("s_lectionnez_un_62064")}),e.customFields.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))]})}),(0,i.jsx)(Ar,{color:"gray500",css:{paddingTop:"$6"},fontSize:"textMd",children:(0,i.jsx)(nl,{icon:"arrow-right"})}),(0,i.jsxs)(Ar,{css:{flex:"1"},children:[n?.fieldType===We.Checkbox&&(0,i.jsxs)(Qj,{label:t("accessible_seul_31434"),name:`${e.field}conditionValue`,shouldParseAsBoolean:!0,children:[(0,i.jsx)("option",{value:"",children:t("s_lectionnez_un_44130")}),(0,i.jsx)("option",{value:"true",children:t("true")}),(0,i.jsx)("option",{value:"false",children:t("false")})]}),n?.fieldType===We.Select&&(0,i.jsx)(Ym,{isSearchVisible:!0,label:t("accessible_seul_31434"),multiple:!0,name:`${e.field}conditionValue`,children:n.values.map(({id:e,value:t})=>(0,i.jsx)("option",{value:e,children:t},e))})]}),(0,i.jsx)(Ar,{css:{paddingTop:"$6"},children:(0,i.jsx)(zl,{color:"white",leftIcon:"trash-can",size:"sm",onClick:e.onRemove})})]})]})]})},KP=e=>{const{history:t,translate:n,params:{organizationId:s}}=vl();return 0===e.customFields.length?(0,i.jsxs)(Ba,{align:"center",css:{background:"$gray50",borderRadius:"$1",padding:"$7"},direction:"column",children:[(0,i.jsx)(Ar,{color:"gray800",fontWeight:"medium",children:n("vous_n_avez_pas_62142")}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ar,{color:"gray500",children:n("pour_ajouter_de_74432")}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(zl,{color:"white",onClick:()=>{t.push(Ps.CUSTOM_FIELDS(s))},children:n("cr_eer_un_champ_08883")})]}):(0,i.jsxs)(Ba,{css:{background:"$gray50",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",padding:"$6 $4"},direction:"column",gap:"3",width:1,children:[e.customFieldsValues.map((t,s)=>{const o=s===e.customFieldsValues.length-1,r=`${e.name}[${s}].`;return(0,i.jsxs)(L.Fragment,{children:[(0,i.jsx)(qP,{change:e.change,customFieldValue:t,customFields:e.customFields,field:r,index:s,onRemove:()=>{e.change(e.name,e.customFieldsValues.filter((e,t)=>t!==s))}}),e.customFieldsValues.length>1&&!o?0===s?(0,i.jsx)(Ar,{css:{width:"fit-content"},children:(0,i.jsxs)(Qj,{name:`${e.prefix}conditionsOperator`,children:[(0,i.jsx)("option",{value:_e.And,children:n(_e.And)}),(0,i.jsx)("option",{value:_e.Or,children:n(_e.Or)})]})}):(0,i.jsx)(Ar,{font:"gray800 textSm medium",children:n(e.conditionsOperator)}):null]},s)}),(0,i.jsx)(Ba,{children:(0,i.jsx)(zl,{color:"invisible",leftIcon:"plus",onClick:()=>{e.change(e.name,[...e.customFieldsValues,{customFieldId:-1,conditionValue:""}])},children:n("ajouter_une_con_66324")})})]})},YP=()=>{const{translate:e}=vl();return(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Jm,{name:"accreditation.willAutoAccredit",subtext:e("si_la_case_est_44018"),children:e("autoriser_l_acc_50624")})})},ZP=e=>{const{mutate:t}=function(e={}){return ei("mutation AccreditationCategoryCreate(\n $eventId: EventId!\n $accreditationCategory: AccreditationsCategoryInput!\n) {\n accreditationCategoryCreate(eventId: $eventId, accreditationCategory: $accreditationCategory) {\n id\n name\n }\n}\n",e)}();return(0,i.jsx)(ny,{initialName:"",isEdit:!1,mutate:async n=>(await t({eventId:e.eventId,accreditationCategory:{name:n}})).accreditationCategoryCreate,onClose:e.onClose,onSuccess:e.onSuccess})},XP=e=>{const{mutate:t}=function(e={}){return ei("mutation AccreditationCategoryUpdate(\n $eventId: EventId!\n $accreditationCategoryId: AccreditationsCategoryId!\n $accreditationCategory: AccreditationsCategoryInput!\n) {\n accreditationCategoryUpdate(\n eventId: $eventId\n accreditationCategoryId: $accreditationCategoryId\n accreditationCategory: $accreditationCategory\n ) {\n id\n name\n }\n}\n",e)}();return(0,i.jsx)(ny,{initialName:e.accreditationCategory.name,isEdit:!0,mutate:async n=>(await t({eventId:e.eventId,accreditationCategoryId:e.accreditationCategory.id,accreditationCategory:{name:n}})).accreditationCategoryUpdate,onClose:e.onClose,onSuccess:e.onSuccess})},JP=e=>{const{translate:t,params:{eventId:n}}=vl(),[s,o]=(0,L.useState)(!1),[r,a]=(0,L.useState)(ty(e.event.accreditationsCategories));return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Vl,{label:t("nom_de_votre_ac_85997"),name:"accreditation.name"}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsxs)(Ba,{gap:"4",children:[(0,i.jsx)(Ym,{isCreateVisible:!0,isSearchVisible:!0,label:t("cat_gorie_00291"),name:"accreditation.accreditationCategoryId",onCreateClick:()=>{o(!0)},children:r.map(({id:e,name:t})=>(0,i.jsx)("option",{value:e,children:t},e))}),(0,i.jsx)(Vl,{label:(0,i.jsx)(Zv,{children:t("Acronym")}),name:"accreditation.acronym"})]}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsxs)(Ba,{gap:"4",children:[(0,i.jsx)(qj,{label:t("Color"),name:"accreditation.color"}),(0,i.jsx)(Jj,{label:t("ic_ne_55554"),name:"accreditation.icon"})]}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(rb,{label:(0,i.jsx)(Zv,{children:t("description_58935")}),name:"accreditation.description"}),e.event.isWeezeventConnected&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(Jm,{name:"accreditation.weezeventIsSynchronized",children:t("WeezeventIsSynchronized")})]}),s&&(0,i.jsx)(ZP,{eventId:n,onClose:()=>{o(!1)},onSuccess:t=>{a(ty([...r,t])),e.change("accreditation.accreditationCategoryId",t.id)}})]})},QP=e=>{const t=Xn(),[n,s]=L.useState(Gs.c9.invalid("Invalid")),[o,r]=L.useState(0),a=L.useMemo(()=>e.slots.map((e,t)=>({...e,index:t})),[e.slots]),l=L.useMemo(()=>{const t=Gs.IX.fromDateTimes(n.startOf("day"),n.endOf("day"));return n.isValid?a.filter(i=>e.matchDateFilter(i,n,t)):a},[n,a,e.matchDateFilter]),d=L.useMemo(()=>l.slice(o,10+o),[o,l]),c=L.useMemo(()=>Math.ceil(l.length/10),[l]),u=L.useMemo(()=>l.length,[l]);return(0,i.jsxs)(Ba,{direction:"column",gap:"4",children:[(0,i.jsxs)(Ba,{align:"center",gap:"3",width:1,children:[(0,i.jsx)(Ar,{css:{flex:"1"},font:"gray800 textMd medium",children:t("liste_de_vos_cr_37612")}),(0,i.jsx)(Ar,{width:200,children:(0,i.jsx)(Mu,{max:e.event.endAt,min:e.event.startAt,value:n,onChange:e=>{s(e),r(0)}})})]}),(0,i.jsxs)(Ba,{css:{background:"$gray100",bd:!0,padding:"$6"},direction:"column",gap:"3",children:[d.map(t=>e.renderSlot(t)),(0,i.jsx)(Fc,{limit:10,numberOfPages:c,offset:o,setOffset:r,totalCount:u})]}),(0,i.jsxs)(Ar,{css:{cursor:"pointer"},font:"primary500 textSm medium",onClick:e.onNewSlot,children:["+ ",t("ajouter_un_cr_n_63607")]})]})},eF=e=>{const t=Xn(),{user:n}=ai();return(0,i.jsx)(oC,{buttonText:t("r_p_ter_28960"),icon:"sliders",initialValues:{value:1,unit:e.showHours?"hour":"day"},size:"md",title:t("r_p_ter_le_cr_n_68038"),onClose:e.onClose,onSubmit:async t=>{e.onSubmit(t.value,t.unit),e.onClose()},children:(0,i.jsxs)(Ba,{align:"center",gap:"3",wrap:"wrap",children:[(0,i.jsxs)(Ar,{children:[t("r_p_ter_pour_le_06048"),At.Fr!==n?.language&&" "+t("prochain_e_s_04262")]}),(0,i.jsx)(Ar,{width:100,children:(0,i.jsx)(Qj,{name:"value",shouldParseAsInt:!0,children:(0,Dc.A)(1,31).map(e=>(0,i.jsx)("option",{value:e,children:e},e))})}),At.Fr===n?.language&&(0,i.jsx)(Ar,{children:t("prochain_e_s_04262")}),(0,i.jsx)(Ar,{width:120,children:(0,i.jsxs)(Qj,{name:"unit",children:[e.showHours&&(0,i.jsx)("option",{value:"hour",children:t("heures_17899")}),(0,i.jsx)("option",{value:"day",children:t("jours_43822")}),(0,i.jsx)("option",{value:"week",children:t("semaines_53228")})]})})]})})},tF=e=>{const t=Xn(),n=Zn(GP);return(0,i.jsx)(oC,{buttonText:t("mettre_jour_l_76289"),icon:"sliders",initialValues:{slot:e.slot},schema:n.createAccreditationSlotSchema(),size:"md",subtitle:t(""),title:t("mise_jour_d_u_86656"),onClose:e.onClose,onSubmit:async t=>{await e.onSuccess((0,Er.A)(t.slot,["id","name","date","maxResources"])),e.onClose()},children:({form:n})=>(0,i.jsxs)(Ba,{css:{flex:"1",overflowY:"auto"},direction:"column",width:1,children:[(0,i.jsx)(Vl,{label:t("nom_du_cr_neau_54351"),name:"slot.name"}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(Vl,{label:t("MaxResources"),name:"slot.maxResources",shouldParseAsInt:!0}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(Hm,{label:t("Date"),max:e.event.endAt,min:e.event.startAt,name:"slot.date",rightIcon:"xmark",onRightIconClick:()=>{n.change("slot.date",null)}})]})})},nF=e=>{const t=Xn(),n=Zn(Jc),s=(0,L.useMemo)(()=>m(e.slot.name)?e.slot.name:t("cr_neau_n_1_80362",e.index+1),[e.slot.name,e.index]),o=(0,L.useMemo)(()=>{const i=e.slot.date?.isValid?n.toLocaleString(e.slot.date,eo.DateOnly.WeekdayLongMonthLong):"",s=e.slot.maxResources?t("_1_membre_maxi_51489",e.slot.maxResources):"";return(0,Za.A)([s,i]).join(" - ")||"-"},[e.slot.maxResources,e.slot.date]),[r,a]=(0,L.useState)(e.initialIsEditOpen),[l,d]=(0,L.useState)(!1),c=!e.slot.date?.isValid,u=(e.slot.assignedResources??0)>0;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ba,{align:"center",css:{background:"white",bd:!0,padding:"$3 $4"},gap:"2",children:[(0,i.jsxs)(Ba,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(Ar,{font:"gray800 textSm semiBold",children:s}),(0,i.jsx)(Ar,{color:"gray500",children:o})]}),(0,i.jsxs)(km,{children:[(0,i.jsx)(Sm,{children:(0,i.jsx)(Ar,{children:(0,i.jsx)(zl,{color:"white",leftIcon:"pen",size:"sm",onClick:()=>{a(!0)}})})}),(0,i.jsx)(wm,{placement:"top",children:t("_diter_62574")})]}),(0,i.jsxs)(km,{children:[(0,i.jsx)(Sm,{children:(0,i.jsx)(Ar,{children:(0,i.jsx)(zl,{color:"white",leftIcon:"clone",size:"sm",onClick:()=>{e.onDuplicate(e.slot)}})})}),(0,i.jsx)(wm,{placement:"top",children:t("dupliquer_28256")})]}),(0,i.jsxs)(km,{children:[(0,i.jsx)(Sm,{children:(0,i.jsx)(Ar,{children:(0,i.jsx)(zl,{color:"white",disabled:c,leftIcon:"arrows-repeat",size:"sm",onClick:()=>{d(!0)}})})}),(0,i.jsx)(wm,{placement:"top",children:t("r_p_ter_le_cr_n_68038")})]}),(0,i.jsxs)(km,{children:[(0,i.jsx)(Sm,{children:(0,i.jsx)(Ar,{children:(0,i.jsx)(zl,{color:"white",disabled:u,leftIcon:"trash-can",size:"sm",onClick:()=>{e.remove(e.index)}})})}),(0,i.jsx)(wm,{placement:"top",children:t(u?"des_membres_son_92320":"supprimer_43083")})]})]}),r&&(0,i.jsx)(tF,{event:e.event,slot:e.slot,onClose:()=>{a(!1)},onSuccess:async t=>{e.updateSlots(t,e.index)}}),l&&(0,i.jsx)(eF,{showHours:!1,onClose:()=>{d(!1)},onSubmit:(t,n)=>{e.onRepeat(e.slot,t,n)}})]})},iF=e=>{const t=Xn(),n=Zn(GP),[s,o]=(0,L.useState)(-1),r=(0,L.useMemo)(()=>e.values.accreditation.slots.some(e=>e.date?.isValid),[e.values.accreditation]),a=(0,L.useCallback)((t,n)=>{const i=[...e.values.accreditation.slots];i[n]=t,e.change("accreditation.slots",i)},[e.values.accreditation.slots,e.change]),l=(0,L.useCallback)((e,t)=>!!e.date?.isValid&&e.date.startOf("day")===t.startOf("day"),[]),d=(0,L.useCallback)(()=>{e.change("accreditation.slots",e.values.accreditation.slots.concat([n.accreditationsSlotInputDefault()])),o(e.values.accreditation.slots.length)},[e.values.accreditation.slots,e.change]),c=(0,L.useCallback)(t=>{e.change("accreditation.slots",[...e.values.accreditation.slots,{name:t.name,date:t.date,maxResources:t.maxResources}])},[e.values.accreditation.slots,e.change]),u=(0,L.useCallback)((t,n,i)=>{const s=function(e,t,n){if(e.date?.isValid)return(0,Dc.A)(1,t+1).map(t=>{if("day"===n){const n=e.date.plus({day:t});return{name:e.name,date:n,maxResources:e.maxResources}}if("week"===n){const n=e.date.plus({week:t});return{name:e.name,date:n,maxResources:e.maxResources}}throw new Error("Wrong unit")});throw new Error("Can not repeat slot with wrong date")}(t,n,i);e.change("accreditation.slots",e.values.accreditation.slots.concat(s))},[e.values.accreditation.slots,e.change]),h=(0,L.useCallback)(t=>{e.change("accreditation.slots",co(e.values.accreditation.slots,t))},[e.values.accreditation.slots,e.change]);return(0,i.jsxs)(Ba,{direction:"column",children:[(0,i.jsx)(QP,{event:e.event,matchDateFilter:l,renderSlot:t=>(0,i.jsx)(nF,{event:e.event,index:t.index,initialIsEditOpen:t.index===s,remove:h,slot:t,updateSlots:a,onDuplicate:c,onRepeat:u},t.index),slots:e.values.accreditation.slots,onNewSlot:d}),(0,i.jsx)(Ju,{height:"5"}),(0,i.jsxs)(Ba,{direction:"column",children:[(0,i.jsx)(Ar,{font:"gray900 textMd medium",children:t("type_d_affichag_09962")}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(Ar,{font:"gray800 textSm medium",children:t("comment_souhait_62602")}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(ub,{name:"accreditation.accreditationDisplay",value:ie.List,children:t("afficher_sous_f_71276")}),(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(ub,{name:"accreditation.accreditationDisplay",value:ie.Radio,children:t("afficher_sous_f_61997")}),(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(ub,{name:"accreditation.accreditationDisplay",value:ie.Calendar,children:t("afficher_sous_f_15380")})]}),r&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ju,{height:"5"}),(0,i.jsxs)(Ba,{direction:"column",children:[(0,i.jsx)(Ar,{font:"gray900 textMd medium",children:t("blocage_de_l_ac_17590")}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(Ar,{font:"gray800 textSm medium",children:t("est_ce_qu_il_y_67585")}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(vc,{state:e.values.hasNumberOfDaysLimit?"unchecked":"checked",onClick:t=>{e.change("hasNumberOfDaysLimit","checked"!==t),e.change("accreditation.numberOfDaysLimit",null)},children:t("non_33516")}),(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(vc,{state:e.values.hasNumberOfDaysLimit?"checked":"unchecked",onClick:t=>{e.change("hasNumberOfDaysLimit","checked"===t)},children:t("oui_54361")}),e.values.hasNumberOfDaysLimit&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"2"}),(0,i.jsxs)(Ba,{align:"center",css:{paddingLeft:"$6"},gap:"2",children:[(0,i.jsx)(Ar,{width:80,children:(0,i.jsx)(Vl,{min:0,name:"accreditation.numberOfDaysLimit",shouldParseAsInt:!0})}),(0,i.jsx)(Ar,{children:t("jours_avant_la_74918")})]})]})]})]})]})},sF=e=>(0,i.jsx)(rI,{names:[`${e.prefix}latitude`,`${e.prefix}longitude`,`${e.prefix}zoom`],render:t=>(0,i.jsx)(Br,{center:e.center,coordinatesFieldsProps:{latitudeProps:t[`${e.prefix}latitude`],longitudeProps:t[`${e.prefix}longitude`],zoomProps:t[`${e.prefix}zoom`]},layer:e.layer,point:e.point,traces:e.traces})}),oF=e=>{const t=Xn();return(0,i.jsxs)(Ba,{gap:"7",children:[(0,i.jsxs)(Ba,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(Ar,{color:"gray800",fontWeight:"semiBold",children:t("apparence_75510")}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsxs)(Qj,{label:t("fond_de_carte_43822"),name:`${e.name}layer`,children:[(0,i.jsx)("option",{value:nt.Google,children:"Plan"}),(0,i.jsx)("option",{value:nt.GoogleSatellite,children:"Satellite"}),(0,i.jsx)("option",{value:nt.IgnPlan,children:"IGN Plan"})]}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(Qj,{label:(0,i.jsx)(Zv,{children:t("niveau_de_zoom_39369")}),name:`${e.name}zoom`,shouldParseAsInt:!0,children:(0,Dc.A)(0,23).map(e=>(0,i.jsx)("option",{value:e,children:e},e))}),e.traces.length>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(Ym,{isSearchVisible:!0,label:(0,i.jsx)(Zv,{children:t("trac_s_41454")}),multiple:!0,name:`${e.name}tracesIds`,children:e.traces.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})]}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(Ar,{color:"gray800",fontWeight:"semiBold",children:t("localisation_38416")}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(IC,{addressName:`${e.name}address`,label:(0,i.jsx)(Zv,{children:t("Address")}),latitudeName:`${e.name}latitude`,longitudeName:`${e.name}longitude`}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsxs)(Ba,{gap:"4",children:[(0,i.jsx)(Km,{label:(0,i.jsx)(Zv,{children:t("latitude_46176")}),name:`${e.name}latitude`}),(0,i.jsx)(Km,{label:(0,i.jsx)(Zv,{children:t("longitude_01695")}),name:`${e.name}longitude`})]})]}),(0,i.jsx)(Ar,{css:{flex:"1"},children:(0,i.jsx)(sF,{center:(n=e.center,"number"==typeof n?.latitude&&"number"==typeof n?.longitude?{latitude:n.latitude,longitude:n.longitude}:void 0),layer:e.layer,point:Pr(e.point),prefix:e.name,traces:e.traces.filter(t=>e.tracesIds.includes(t.id))})})]});var n},rF=e=>{const{history:t,params:{organizationId:n,eventId:s},translate:o}=vl(),{showNotification:r}=Ob(),a=Zn(HP),l=Zn(Ua),d=(0,L.useRef)(null),c=(0,L.useMemo)(()=>e.isEdit?o("mise_jour_de_17055",e.initialValues.accreditation.name):o("cr_ation_d_une_01473"),[e.isEdit,e.initialValues]);Md(c);const{areSlotsOpen:u,isLocalisationOpen:h,areConditionsOpen:g,areCustomFieldsOpen:p,isPrivateNoteOpen:f,areTagsOpen:_}=(0,L.useMemo)(()=>{const t=e.initialValues.accreditation;return{areSlotsOpen:e.isEdit&&so(t.slots),isLocalisationOpen:e.isEdit&&(m(t.address)||"number"==typeof t.latitude||"number"==typeof t.longitude),areConditionsOpen:e.isEdit&&so(t.accreditationsCustomFields),areCustomFieldsOpen:e.isEdit&&(so(Object.keys(t.fields))||so(t.formCustomFields)),isPrivateNoteOpen:e.isEdit&&m(t.privateNote),areTagsOpen:e.isEdit&&so(t.tagsIds)}},[e.initialValues,e.isEdit]);return(0,i.jsx)(kl,{customErrorRef:d,height:1,initialValues:e.initialValues,render:({form:t,handleSubmit:r,submitting:a,values:l})=>(0,i.jsx)(Lm,{button:e.isEdit?(0,i.jsx)(zl,{isLoading:a,onClick:r,children:o("mettre_jour_l_92576")}):null,category:c,color:"dark",fallbackClosePath:is.ACCREDITATIONS({organizationId:n,eventId:s}),heading:e.isEdit?e.initialValues.accreditation.name:o("nouvelle_accr_d_32707"),children:(0,i.jsxs)(Mm,{ref:d,children:[(0,i.jsx)(jl,{}),(0,i.jsx)(Vm,{heading:o("informations_su_35382"),hideToggle:!0,initialIsOpen:!0,children:(0,i.jsx)(JP,{change:t.change,event:e.event})}),(0,i.jsx)(Ya,{height:"5"}),(0,i.jsx)(Vm,{heading:o("automatisation_47772"),hideToggle:!0,initialIsOpen:!0,subtitle:o("attribuer_autom_55909"),children:(0,i.jsx)(YP,{})}),(0,i.jsx)(Ya,{height:"5"}),(0,i.jsx)(Vm,{heading:o("cr_neaux_33401"),initialIsOpen:u,subtitle:o("ajouter_les_dif_76832"),onToggle:e=>{e||t.change("accreditation.slots",[])},children:(0,i.jsx)(iF,{change:t.change,event:e.event,values:l})}),(0,i.jsx)(Ya,{height:"5"}),(0,i.jsx)(Vm,{heading:o("localisation_38416"),initialIsOpen:h,subtitle:o("indiquez_la_loc_61935"),onToggle:n=>{n||(t.change("accreditation.layer",e.event.layer),t.change("accreditation.zoom",$r),t.change("accreditation.address",null),t.change("accreditation.latitude",null),t.change("accreditation.longitude",null))},children:(0,i.jsx)(oF,{center:null,layer:l.accreditation.layer,name:"accreditation.",point:l.accreditation,traces:[],tracesIds:[]})}),(0,i.jsx)(Ya,{height:"5"}),(0,i.jsx)(Vm,{heading:o("conditions_77756"),initialIsOpen:g,subtitle:o("ajoutez_des_con_94296"),onToggle:e=>{e||t.change("accreditation.accreditationsCustomFields",[])},children:(0,i.jsx)(KP,{change:t.change,conditionsOperator:l.accreditation.conditionsOperator,customFields:e.conditionsCustomFields,customFieldsValues:l.accreditation.accreditationsCustomFields,name:"accreditation.accreditationsCustomFields",prefix:"accreditation."})}),(0,i.jsx)(Ya,{height:"5"}),(0,i.jsx)(Vm,{heading:o("champs_de_formu_64126"),initialIsOpen:p,subtitle:o("ajouter_des_inf_14221"),onToggle:e=>{e||(t.change("accreditation.formCustomFields",[]),t.change("accreditation.fields",{}))},children:(0,i.jsx)(dP,{change:t.change,customFields:e.accreditationCustomFields,formCustomFields:e.formCustomFields,formCustomFieldsValues:l.accreditation.formCustomFields,prefix:"accreditation.",showFormCustomFields:!0})}),(0,i.jsx)(Ya,{height:"5"}),(0,i.jsx)(Vm,{heading:o("note_priv_e_06303"),initialIsOpen:f,subtitle:o("ajoutez_une_not_89122"),onToggle:e=>{e||t.change("accreditation.privateNote","")},children:(0,i.jsx)(rb,{label:(0,i.jsx)(Zv,{children:o("note_priv_e_06303")}),name:"accreditation.privateNote"})}),(0,i.jsx)(Ya,{height:"5"}),(0,i.jsx)(Vm,{heading:o("tags_79499"),initialIsOpen:_,subtitle:o("ajouter_des_tag_77298"),onToggle:e=>{e||t.change("accreditation.tagsIds",[])},children:(0,i.jsx)(aC,{change:t.change,name:"accreditation.",organizationId:n,tags:e.tags,tagsIds:l.accreditation.tagsIds})}),(0,i.jsx)(Ya,{height:"5"}),(0,i.jsx)(Bm,{children:(0,i.jsx)(zl,{isLoading:a,onClick:r,children:(0,i.jsx)(Ar,{textAlign:"center",children:e.isEdit?o("mettre_jour_l_92576"):o("cr_er_l_accr_di_16123")})})})]})}),validate:l.validateForForm(a.createUpdateAccreditationSchema()),width:1,onSubmit:async i=>{const a=await e.mutate({eventId:s,accreditation:{...i.accreditation,slots:i.accreditation.slots.map(e=>(0,ur.A)(e,["index"]))}});r(e.isEdit?o("l_accr_ditation_24401"):o("l_accr_ditation_25694")),e.isEdit?t.goBack(is.ACCREDITATION({organizationId:n,eventId:s,accreditationId:a})):t.replace(is.ACCREDITATION({organizationId:n,eventId:s,accreditationId:a}))}})},aF=()=>{const{organizationId:e,eventId:t,options:n}=ti(),s=Zn(HP),{data:o,loader:r}=Qn("query AccreditationEventInfos($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n ...ConditionsCustomFields\n ...FormCustomFields\n ...CreatePositionTags\n\n accreditationCustomFields: customFields(variety: Accreditation, privacy: All) {\n nodes {\n ...AttachCustomField\n }\n }\n }\n\n event(id: $eventId) {\n ...CreateAccreditationEvent\n }\n}\n",{organizationId:e,eventId:t},[Vs.ConditionsCustomFieldsFragment,Vs.FormCustomFieldsFragment,Vs.CreatePositionTagsFragment,Vs.AttachCustomFieldFragment,Vs.CreateAccreditationEventFragment]),{mutate:a}=function(e={}){return ei("mutation AccreditationCreate($eventId: EventId!, $accreditation: AccreditationInput!) {\n accreditationCreate(eventId: $eventId, accreditation: $accreditation) {\n id\n }\n}\n",e)}(),l=m(n)?parseInt(n,10):null;return r||(0,i.jsx)(rF,{accreditationCustomFields:o.organization.accreditationCustomFields.nodes,conditionsCustomFields:o.organization.conditionsCustomFields.nodes,event:o.event,formCustomFields:o.organization.formCustomFields.nodes,initialValues:s.createUpdateAccreditationValuesDefault(o.event.layer,null,l),isEdit:!1,mutate:async e=>(await a(e)).accreditationCreate.id,tags:o.organization.tags.nodes})},lF=()=>{const{organizationId:e,eventId:t,accreditationId:n}=ti(),s=Zn(HP),{data:o,loader:r}=Qn("query AccreditationToEdit(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $accreditationId: AccreditationId!\n) {\n organization(id: $organizationId) {\n ...ConditionsCustomFields\n ...FormCustomFields\n ...CreatePositionTags\n\n accreditationCustomFields: customFields(variety: Accreditation, privacy: All) {\n nodes {\n ...AttachCustomField\n }\n }\n }\n\n event(id: $eventId) {\n ...CreateAccreditationEvent\n\n accreditation(id: $accreditationId) {\n name\n accreditationCategoryId\n description\n privateNote\n acronym\n color\n icon\n weezeventIsSynchronized\n willAutoAccredit\n address\n latitude\n longitude\n zoom\n layer\n tagsIds\n accreditationDisplay\n numberOfDaysLimit\n conditionsOperator\n fields\n\n accreditationsCustomFields {\n customFieldId\n conditionValue\n }\n\n formCustomFields {\n id\n customFieldId\n isMandatory\n }\n\n slots {\n id\n name\n date\n maxResources\n assignedResources\n }\n }\n }\n}\n",{organizationId:e,eventId:t,accreditationId:n},[Vs.ConditionsCustomFieldsFragment,Vs.FormCustomFieldsFragment,Vs.CreatePositionTagsFragment,Vs.AttachCustomFieldFragment,Vs.CreateAccreditationEventFragment]),{mutate:a}=function(e={}){return ei("mutation AccreditationUpdate(\n $eventId: EventId!\n $accreditationId: AccreditationId!\n $accreditation: AccreditationInput!\n) {\n accreditationUpdate(\n eventId: $eventId\n accreditationId: $accreditationId\n accreditation: $accreditation\n ) {\n id\n }\n}\n",e)}();return r||(0,i.jsx)(rF,{accreditationCustomFields:o.organization.accreditationCustomFields.nodes,conditionsCustomFields:o.organization.conditionsCustomFields.nodes,event:o.event,formCustomFields:o.organization.formCustomFields.nodes,initialValues:s.createUpdateAccreditationValuesDefault(o.event.layer,o.event.accreditation,null),isEdit:!0,mutate:async e=>(await a({...e,accreditationId:n})).accreditationUpdate.id,tags:o.organization.tags.nodes})};var dF;!function(e){e.Acronym="acronym",e.Address="address",e.AutoAccredit="autoAccredit",e.Category="category",e.Color="color",e.Conditions="conditions",e.CreatedAt="createdAt",e.CreatedBy="createdBy",e.Description="description",e.FillingRate="fillingRate",e.Icon="icon",e.IconColor="iconColor",e.Id="id",e.Index="index",e.Latitude="latitude",e.Longitude="longitude",e.Name="name",e.PrivateNote="privateNote",e.Resources="resources",e.SlotDate="slotDate",e.SlotName="slotName",e.Tags="tags",e.WeezeventChecklistId="weezeventChecklistId",e.WeezeventIsSynchronized="weezeventIsSynchronized"}(dF||(dF={}));let cF=class extends _u{constructor(e,t,n){super(e,t,n)}getAccreditationsFilters(e,t){return(0,Za.A)([{slug:"name",name:this.t("nom_de_l_accr_d_11908"),category:this.t("accr_ditations_39450"),fieldType:He.Text,hideEmpty:!0},{slug:"accreditation",name:this.t("Accreditation"),category:this.t("accr_ditations_39450"),fieldType:He.Select,hideEmpty:!0,needLoading:!0,eventId:e.id},{slug:dF.Description,name:this.t("Description"),category:this.t("accr_ditations_39450"),fieldType:He.Text},{slug:dF.PrivateNote,name:this.t("note_priv_e_06303"),category:this.t("accr_ditations_39450"),fieldType:He.Text},so(e.accreditationsCategories)?{slug:"accreditationCategory",name:this.t("cat_gorie_00291"),category:this.t("accr_ditations_39450"),fieldType:He.Select,values:e.accreditationsCategories,hideEmpty:!0}:null,{slug:"slotName",name:this.t("nom_du_cr_neau_54351"),category:this.t("accr_ditations_39450"),fieldType:He.Text},{slug:"slotDate",name:this.t("Date"),category:this.t("accr_ditations_39450"),fieldType:He.Date},{slug:"tag",name:"Tag",category:this.t("accr_ditations_39450"),fieldType:He.Select,needLoading:!0,organizationId:e.organizationId,eventId:e.id,tagContext:wt.Accreditations},{slug:"accreditationCustomField",name:this.t("condition_61066"),category:this.t("accr_ditations_39450"),fieldType:He.Select,needLoading:!0,organizationId:e.organizationId},{slug:"acronym",name:this.t("Acronym"),category:this.t("accr_ditations_39450"),fieldType:He.Text},{slug:"color",name:this.t("Color"),category:this.t("accr_ditations_39450"),fieldType:He.Text,hideEmpty:!0},{slug:"icon",name:this.t("ic_ne_55554"),category:this.t("accr_ditations_39450"),fieldType:He.Select,values:xn.map(e=>({id:e,name:this.t(e)})),hideEmpty:!0},{slug:"address",name:this.t("Address"),category:this.t("accr_ditations_39450"),fieldType:He.Text},{slug:"fillingRate",name:this.t("taux_de_remplis_11913"),category:this.t("accr_ditations_39450"),fieldType:He.Number,hideEmpty:!0},{slug:dF.CreatedBy,name:this.t("cr_e_par_30622"),category:this.t("accr_ditations_39450"),fieldType:He.Select,hideEmpty:!0,needLoading:!0,organizationId:e.organizationId,eventId:e.id},{slug:dF.CreatedAt,name:this.t("cr_e_le_02658"),category:this.t("accr_ditations_39450"),fieldType:He.Datetime,hideEmpty:!0},...this.customFieldsToFilters(t)])}getAccreditationsPossibleColumns(e,t){const n=[{slug:dF.Id,name:this.t("id_51738"),isSearchable:!0,isSortable:!0,sortAttribute:ae.Id,width:100},{slug:dF.Name,name:this.t("nom_de_l_accr_d_11908"),isSearchable:!0,isSortable:!0,sortAttribute:ae.Name,minWidth:240},{slug:dF.Category,name:this.t("nom_de_la_cat_g_03860"),isSearchable:!0,isSortable:!0,sortAttribute:ae.Category,minWidth:240},{slug:dF.SlotName,name:this.t("nom_du_cr_neau_54351"),isSearchable:!0,minWidth:240},{slug:dF.SlotDate,name:this.t("Date"),minWidth:180,isSortable:!0,sortAttribute:re.Date},{slug:dF.Resources,name:this.t("membres_11310"),minWidth:320},{slug:dF.Tags,name:this.t("tags_79499"),isSearchable:!0,minWidth:240},{slug:dF.Conditions,name:this.t("conditions_77756"),minWidth:320},{slug:dF.Address,name:this.t("Address"),isSearchable:!0,minWidth:240},{slug:dF.Latitude,name:this.t("latitude_46176"),isSearchable:!0,minWidth:180},{slug:dF.Longitude,name:this.t("longitude_01695"),isSearchable:!0,minWidth:180},{slug:dF.Acronym,name:this.t("Acronym"),isSearchable:!0,isSortable:!0,sortAttribute:ae.Acronym,minWidth:180},{slug:dF.Color,name:this.t("Color"),isSearchable:!0,width:80},{slug:dF.Icon,name:this.t("ic_ne_55554"),width:80},{slug:dF.IconColor,name:this.t("ic_ne_et_couleu_54485"),width:80},{slug:dF.FillingRate,name:this.t("taux_de_remplis_11913"),minWidth:240},{slug:dF.CreatedBy,name:this.t("cr_e_par_30622"),isSearchable:!0,minWidth:180},{slug:dF.CreatedAt,name:this.t("cr_e_le_02658"),isSortable:!0,sortAttribute:ae.CreatedAt,minWidth:180},{slug:dF.AutoAccredit,name:this.t("AutoAccredit"),minWidth:180},{slug:dF.Index,name:this.t("Index"),isSortable:!0,sortAttribute:ae.Index,width:200}];return e&&n.push({slug:dF.WeezeventIsSynchronized,name:this.t("WeezeventIsSynchronized"),minWidth:180},{slug:dF.WeezeventChecklistId,name:this.t("WeezeventChecklistId"),minWidth:180}),n.concat(this.customFieldsToPossibleColumns(t))}};cF=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[hu,Jc,qn])],cF);const uF=e=>{const{params:{eventId:t}}=vl(),{mutate:n}=Eo(),s=L.useCallback(async i=>{const s=io(e.property);for(const o of s){const r=1===s.length?i:i[o];await n({eventId:t,massEdit:{reset:!1,selecteds:{ids:[e.accreditationId]},slug:o,strategy:it.Replace,value:r}})}return!0},[e.accreditationId,e.property,n]);return(0,i.jsx)(yy,{column:e.column,initialValue:e.initialValue,mutate:s,reload:e.reload,renderInput:e.renderInput,renderValue:e.renderValue,updatable:!0})},hF=e=>{const{translate:t}=vl();return(0,i.jsx)(uF,{accreditationId:e.accreditation.id,column:e.column,initialValue:e.accreditation.acronym||"",property:se.Acronym,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(Bl,{label:t("Acronym"),value:e,onChange:n}),renderValue:e.accreditation.acronym||""})},mF=L.createContext({}),gF=e=>{const t=T$(Wr,{eventId:e.eventId},e=>e.event.accreditationsCategories),n=T$(Uo,{organizationId:e.organizationId},e=>e.organization.tags.nodes);return(0,i.jsx)(mF.Provider,{value:{getAccreditationsCategories:t,getTags:n},children:e.children})};function pF(){return L.useContext(mF)}const fF=e=>{const t=Xn(),{getAccreditationsCategories:n}=pF(),{result:s,isLoading:o}=U$(n);return o?(0,i.jsxs)(Ba,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(Ml,{children:t("Category")}),(0,i.jsx)(lc,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)($u,{label:t("Category"),shouldParseAsInt:!0,value:e.value,onChange:e.setValue,children:s.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})},_F=e=>{const{organizationId:t,eventId:n}=ti(),{isEditMode:s}=vy(),o=e.accreditationCategory.name;return(0,i.jsx)(uF,{accreditationId:e.accreditationId,column:e.column,initialValue:e.accreditationCategory.id,property:se.Category,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(fF,{setValue:t,value:e}),renderValue:()=>(0,i.jsx)(q$,{isEditMode:s,title:o,updatable:!0,children:(0,i.jsx)(Zc,{to:is.ACCREDITATION_CATEGORY({organizationId:t,eventId:n,accreditationCategoryId:e.accreditationCategory.id}),children:o})})})},xF=e=>{const{translate:t}=vl();return(0,i.jsx)(uF,{accreditationId:e.accreditation.id,column:e.column,initialValue:e.accreditation.color,property:se.Color,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(Hj,{label:t("Color"),value:e,onChange:n}),renderValue:()=>(0,i.jsx)(Ba,{align:"center",gap:"3",width:1,children:(0,i.jsxs)(km,{children:[(0,i.jsx)(Sm,{children:(0,i.jsx)(Ar,{css:{background:e.accreditation.color,borderRadius:"2px",height:"24px",width:"24px"},onClick:()=>{US(e.accreditation.color)}})}),(0,i.jsx)(wm,{placement:"top",children:e.accreditation.color})]})})})};function IF(e,t,n){return t.fieldType===We.Select?so(n)?(0,Za.A)(n.map(e=>t.values.find(t=>t.id===e)?.value)).join(", "):"":e(!0===n?"true":"false")}const vF=e=>{const{translate:t}=vl(),n=(0,L.useMemo)(()=>e.accreditation.accreditationsCustomFields||[],[e.accreditation]),s=(0,L.useMemo)(()=>n.map((e,n)=>({id:n,color:"gray",icon:null,text:`${e.customField.name} : ${IF(t,e.customField,e.conditionValue)}`})),[n]);return(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Py,{badges:s})})},bF=e=>{const{translate:t}=vl();return(0,i.jsx)(uF,{accreditationId:e.accreditation.id,column:e.column,initialValue:e.accreditation.icon,property:se.Icon,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(Xj,{label:t("Icon"),renderOnPortal:!0,value:e,onChange:n}),renderValue:()=>(0,i.jsx)(nl,{icon:tl(e.accreditation.icon)})})},jF=e=>{const{translate:t}=vl(),n=(0,L.useMemo)(()=>({[se.Color]:e.accreditation.color,[se.Icon]:e.accreditation.icon}),[e.accreditation]);return(0,i.jsx)(uF,{accreditationId:e.accreditation.id,column:e.column,initialValue:n,property:[se.Color,se.Icon],reload:e.reload,renderInput:(e,n)=>(0,i.jsxs)(Ba,{direction:"column",gap:"2",width:1,children:[(0,i.jsx)(Hj,{label:t("Color"),value:e[se.Color],onChange:t=>{n({...e,[se.Color]:t})}}),(0,i.jsx)(Xj,{label:t("Icon"),renderOnPortal:!0,value:e[se.Icon],onChange:t=>{n({...e,[se.Icon]:t})}})]}),renderValue:()=>(0,i.jsx)(WC,{color:e.accreditation.color,icon:e.accreditation.icon})})},CF=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=vl(),{isEditMode:o}=vy(),r=e.accreditation.name;return(0,i.jsx)(uF,{accreditationId:e.accreditation.id,column:e.column,initialValue:e.accreditation.name,property:se.Name,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(Bl,{label:t("nom_de_l_accr_d_11908"),value:e,onChange:n}),renderValue:()=>(0,i.jsx)(q$,{isEditMode:o,title:r,updatable:!0,children:(0,i.jsx)(Zc,{to:is.ACCREDITATION({organizationId:n,eventId:s,accreditationId:e.accreditation.id}),children:r})})})},yF=e=>{const{translate:t}=vl(),{getTags:n}=pF(),{result:s,isLoading:o}=U$(n);return o?(0,i.jsxs)(Ba,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(Ml,{children:t("tags_79499")}),(0,i.jsx)(lc,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(yc,{isSearchVisible:!0,label:t("tags_79499"),multiple:!0,renderOnPortal:!0,values:e.value,onChange:e.setValue,children:s.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})},kF=e=>{const t=(0,L.useMemo)(()=>e.accreditation.tags||[],[e.accreditation]),n=(0,L.useMemo)(()=>t.map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[t]);return(0,i.jsx)(uF,{accreditationId:e.accreditation.id,column:e.column,initialValue:t.map(e=>e.id),property:se.Tag,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(yF,{setValue:t,value:e}),renderValue:()=>(0,i.jsx)(Py,{badges:n})})},AF=e=>{const{translate:t,params:{eventId:n}}=vl(),s=Zn(Jc),{mutate:o}=Hr(),r=(0,L.useMemo)(()=>e.accreditationSlot.date?s.toLocaleString(e.accreditationSlot.date,eo.DateOnly.WeekdayLongMonthLong):"-",[e.accreditationSlot]),a=(0,L.useMemo)(()=>e.accreditationSlot.date?.isValid?e.accreditationSlot.date:Gs.c9.invalid("Invalid"),[e.accreditationSlot]);return(0,i.jsx)(yy,{column:e.column,initialValue:a,mutate:async t=>o({eventId:n,accreditationSlotId:e.accreditationSlot.id,accreditationSlot:{...(0,Er.A)(e.accreditationSlot,["id","name","maxResources"]),date:t}}),reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(Mu,{label:t("Date"),value:e,onChange:n}),renderValue:()=>(0,i.jsx)(Ar,{color:"gray900",css:{ellipsis:!0,textTransform:"capitalize"},title:r,width:1,children:r}),updatable:!0})},wF=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=vl(),{isEditMode:o}=vy(),{mutate:r}=Hr(),a=(0,L.useMemo)(()=>m(e.accreditationSlot.name)?e.accreditationSlot.name:"-",[e.accreditationSlot]);return(0,i.jsx)(yy,{column:e.column,initialValue:e.accreditationSlot.name,mutate:async t=>r({eventId:s,accreditationSlotId:e.accreditationSlot.id,accreditationSlot:{...(0,Er.A)(e.accreditationSlot,["id","date","maxResources"]),name:t}}),reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(Bl,{label:t("nom_du_cr_neau_54351"),value:e,onChange:n}),renderValue:()=>(0,i.jsx)(q$,{isEditMode:o,title:a,updatable:!0,children:(0,i.jsx)(Zc,{to:is.ACCREDITATION_SLOT({organizationId:n,eventId:s,accreditationId:e.accreditationSlot.accreditation.id,accreditationSlotId:e.accreditationSlot.id}),children:a})}),updatable:!0})},SF=e=>{if("number"==typeof e.weezeventOrganizationId&&"number"==typeof e.accreditationSlot.weezeventChecklistId){const t=xg(e.weezeventOrganizationId,e.accreditationSlot.weezeventChecklistId);return(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Zc,{to:t,children:e.accreditationSlot.weezeventChecklistId})})}return(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:"-"})},EF=e=>{const{translate:t,params:{eventId:n}}=vl(),{isEventAdmin:s}=wb(),{mutate:o}=Hr(),r=Zn(mC),a=_y(e.customFields),l=(0,L.useCallback)(()=>{e.reloadAccreditationSlot(e.accreditationSlot.id)},[e.accreditationSlot,e.reloadAccreditationSlot]),[d,c]=(0,L.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Mc,{css:{"&:hover":{background:"$gray100"}},children:[e.columns.map(t=>{const n=a.get(t.slug);return t.slug===dF.Id?(0,i.jsx)(Oc,{minWidth:t.minWidth,width:t.width,children:e.accreditationSlot.id},t.slug):t.slug===dF.Category?(0,i.jsx)(_F,{accreditationCategory:e.accreditationSlot.accreditationCategory,accreditationId:e.accreditationSlot.accreditation.id,column:t,reload:l},t.slug):t.slug===dF.Name?(0,i.jsx)(CF,{accreditation:e.accreditationSlot.accreditation,column:t,reload:l},t.slug):t.slug===dF.SlotName?e.accreditationSlot.isHidden?(0,i.jsx)(Oc,{minWidth:t.minWidth,width:t.width,children:"-"},t.slug):(0,i.jsx)(wF,{accreditationSlot:e.accreditationSlot,column:t,reload:l},t.slug):t.slug===dF.SlotDate?e.accreditationSlot.isHidden?(0,i.jsx)(Oc,{minWidth:t.minWidth,width:t.width,children:"-"},t.slug):(0,i.jsx)(AF,{accreditationSlot:e.accreditationSlot,column:t,reload:l},t.slug):t.slug===dF.Resources?(0,i.jsx)(Oc,{minWidth:t.minWidth,width:t.width,children:(0,i.jsx)(L$,{assignedResources:e.accreditationSlot.assignedResources,resources:e.accreditationSlot.maxResources})},t.slug):t.slug===dF.Tags?(0,i.jsx)(kF,{accreditation:e.accreditationSlot.accreditation,column:t,reload:l},t.slug):t.slug===dF.Conditions?(0,i.jsx)(vF,{accreditation:e.accreditationSlot.accreditation,column:t},t.slug):t.slug===dF.Address?(0,i.jsx)(Oc,{minWidth:t.minWidth,width:t.width,children:e.accreditationSlot.accreditation.address},t.slug):t.slug===dF.Latitude?(0,i.jsx)(Oc,{minWidth:t.minWidth,width:t.width,children:e.accreditationSlot.accreditation.latitude},t.slug):t.slug===dF.Longitude?(0,i.jsx)(Oc,{minWidth:t.minWidth,width:t.width,children:e.accreditationSlot.accreditation.longitude},t.slug):t.slug===dF.Acronym?(0,i.jsx)(hF,{accreditation:e.accreditationSlot.accreditation,column:t,reload:l},t.slug):t.slug===dF.Color?(0,i.jsx)(xF,{accreditation:e.accreditationSlot.accreditation,column:t,reload:l},t.slug):t.slug===dF.Icon?(0,i.jsx)(bF,{accreditation:e.accreditationSlot.accreditation,column:t,reload:l},t.slug):t.slug===dF.IconColor?(0,i.jsx)(jF,{accreditation:e.accreditationSlot.accreditation,column:t,reload:l}):t.slug===dF.FillingRate?(0,i.jsxs)(Oc,{minWidth:t.minWidth,width:t.width,children:[e.accreditationSlot.fillingRate,"%"]},t.slug):t.slug===dF.CreatedBy?(0,i.jsx)(NR,{column:t,createdBy:e.accreditationSlot.accreditation.createdBy},t.slug):t.slug===dF.CreatedAt?(0,i.jsx)(MR,{column:t,insertedAt:e.accreditationSlot.insertedAt},t.slug):t.slug===dF.WeezeventChecklistId?(0,i.jsx)(SF,{accreditationSlot:e.accreditationSlot,column:t,weezeventOrganizationId:e.weezeventOrganizationId}):(0,i.jsx)(Oc,{minWidth:t.minWidth,width:t.width,children:n?r.getValueString(n,e.accreditationSlot.accreditation.fields,{fileReturnValue:"name"}):""},t.slug)}),s?e.accreditationSlot.isHidden?(0,i.jsx)(Oc,{width:100}):(0,i.jsx)(Xc,{justify:"center",children:(0,i.jsxs)(km,{children:[(0,i.jsx)(Sm,{children:(0,i.jsx)(Ar,{children:(0,i.jsx)(nl,{icon:"pen",onClick:()=>{c(!0)}})})}),(0,i.jsx)(wm,{placement:"top",children:t("_diter_62574")})]})}):null]}),d&&(0,i.jsx)(tF,{event:e.event,slot:e.accreditationSlot,onClose:()=>{c(!1)},onSuccess:async t=>{await o({eventId:n,accreditationSlotId:e.accreditationSlot.id,accreditationSlot:t}),l()}})]})},TF=e=>{const{params:{eventId:t}}=vl(),{isEventAdmin:n}=wb(),{columns:s,columnsSearch:o,limit:r,nameDebounced:a,offset:l,possibleColumns:d,predicates:c,reloadKey:u,setLimit:h,setOffset:g,setSort:p,sort:f}=vy(),_=(0,L.useMemo)(()=>({includeConditions:s.includes(dF.Conditions),includeCreatedBy:s.includes(dF.CreatedBy),includeTags:s.includes(dF.Tags)}),[s]),{data:x,isLoading:I,reload:v}=Qn("query AccreditationsSlotsList(\n $eventId: EventId!\n $name: String\n $predicates: [Predicate!]\n $columnsSearch: [String!]\n $limit: Int\n $offset: Int\n $sort: AccreditationsSlotsSort\n $includeConditions: Boolean!\n $includeCreatedBy: Boolean!\n $includeTags: Boolean!\n) {\n event(id: $eventId) {\n startAt\n endAt\n\n accreditationsSlots(\n name: $name\n predicates: $predicates\n includeHidden: true\n columnsSearch: $columnsSearch\n limit: $limit\n offset: $offset\n sort: $sort\n ) {\n nodes {\n ...AccreditationsAccreditationSlot\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{..._,eventId:t,name:m(a)?a:null,columnsSearch:so(o)?o:null,predicates:c,limit:r,offset:l,sort:f},[Vs.AccreditationsAccreditationSlotFragment]);const b=(0,L.useMemo)(()=>s.flatMap(e=>(0,Za.A)([d.find(t=>t.slug===e)])),[d,s]),{numberOfPages:j,totalCount:C}=Su(x.event?.accreditationsSlots),[y,k]=(0,L.useState)([]),[A,w]=(0,L.useState)({}),S=(0,L.useCallback)(async e=>{w(t=>({...t,[e]:!0}));const{event:{accreditationSlot:n}}=await function(e,t){return go("query AccreditationsAccreditationSlot(\n $eventId: EventId!\n $id: AccreditationsSlotId!\n $includeConditions: Boolean!\n $includeCreatedBy: Boolean!\n $includeTags: Boolean!\n) {\n event(id: $eventId) {\n accreditationSlot(id: $id) {\n ...AccreditationsAccreditationSlot\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[Vs.AccreditationsAccreditationSlotFragment]})}({..._,eventId:t,id:e},await Y());k(t=>t.map(t=>t.id===e?n:t)),w(t=>({...t,[e]:!1}))},[_,w,k]);return(0,L.useEffect)(()=>{k(x.event?.accreditationsSlots.nodes??[])},[x.event]),(0,L.useEffect)(()=>{u>1&&v()},[u]),(0,i.jsx)(Ba,{css:{flex:"1",overflow:"hidden"},width:1,children:(0,i.jsx)(Cm,{"aria-busy":I,headerRow:(0,i.jsxs)(kc,{children:[b.map(e=>e.isSortable?(0,i.jsx)(jm,{attribute:e.sortAttribute||e.slug,minWidth:e.minWidth,setSort:p,sort:f,width:e.width,children:(0,i.jsx)(Ar,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug):(0,i.jsx)(Gc,{minWidth:e.minWidth,width:e.width,children:(0,i.jsx)(Ar,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug)),n&&(0,i.jsx)(Gc,{width:100})]}),paginationRow:(0,i.jsx)(Nc,{css:{borderTop:"1px solid $gray200"},children:(0,i.jsx)(Fc,{limit:r,numberOfPages:j,offset:l,setLimit:h,setOffset:g,showLimits:!0,totalCount:C})}),children:I?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Hc,{}),(0,i.jsx)(Hc,{}),(0,i.jsx)(Hc,{})]}):y.map(t=>A[t.id]?(0,i.jsx)(Hc,{},t.id):(0,i.jsx)(EF,{accreditationSlot:t,columns:b,customFields:e.customFields,event:x.event,reloadAccreditationSlot:S,weezeventOrganizationId:e.weezeventOrganizationId},t.id))})})},zF=()=>{const e=Xn(),{eventId:t,massActions:n,onMassEditSuccess:s,organizationId:o,predicates:r,segment:a}=vy(),{showNotification:l}=Ob(),{mutate:d}=Eo(),{mutate:c}=Gr(),[u,h]=(0,L.useState)(!1),[g,p]=(0,L.useState)(!1),f=n.getSelectedsInput(r,null),_=n.isAllSelected?a.count:n.numberOfSelected,x=(0,L.useCallback)(e=>{m(e)&&l(e),s()},[s]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zl,{onClick:()=>{h(!0)},children:e("_diter_une_prop_26724")}),(0,i.jsxs)(Wd,{children:[(0,i.jsx)(Xd,{children:(0,i.jsx)(zl,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsx)(Zd,{placement:"bottom-end",children:(0,i.jsx)(Kd,{color:"red",icon:"trash-can",onClick:()=>{p(!0)},children:e("supprimer_43083")})})]}),u&&(0,i.jsx)(_A,{eventId:t,mutate:e=>d({eventId:t,massEdit:e}),organizationId:o,selecteds:f,onClose:()=>{h(!1)},onSuccess:t=>{x(e("_1_accr_ditati_22872",t))}}),g&&(0,i.jsx)(cA,{buttonText:e("supprimer_43083"),subtext:[e("_tes_vous_s_r_d_31111")],text:e("suppression_de_42723",_),onClose:()=>{p(!1)},onDelete:async()=>{const n=(await c({eventId:t,selecteds:f})).numberOfAccreditations;x(e("_1_accr_ditati_88237",n))}})]})},OF=e=>{const{params:{organizationId:t,eventId:n},translate:s}=vl(),{user:o}=ai(),{data:r,isLoading:a}=Qn("query AccreditationsHeader($eventId: EventId!) {\n event(id: $eventId) {\n key\n }\n}\n",{eventId:n},[]),[l,d]=(0,L.useState)(!1),[c,u]=(0,L.useState)(!1),[h,m]=(0,L.useState)(!1);return(0,i.jsxs)(g$,{children:[(0,i.jsx)(Kb,{permissions:Hb.ACCREDITATION_EDIT,children:(0,i.jsx)(zl,{to:Ps.CREATE_ACCREDITATION(t,n),children:s("cr_er_une_accr_33475")})}),(0,i.jsx)(Kb,{permissions:Hb.ACCREDITATION_EDIT,children:(0,i.jsxs)(Wd,{isOpen:l,onStateChange:d,children:[(0,i.jsx)(Xd,{children:(0,i.jsx)(zl,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Zd,{placement:"bottom-end",children:[(0,i.jsx)(Kd,{icon:"plus",onClick:()=>{d(!1),m(!0)},children:s("cr_er_une_cat_g_20051")}),(0,i.jsx)(Xu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Kd,{icon:"plug-circle-bolt",onClick:e=>{Vd(e.target),u(!0)},children:s("exporter_via_l_09843")})]})]})}),h&&(0,i.jsx)(ZP,{eventId:n,onClose:()=>{m(!1)},onSuccess:e.reload}),!a&&(0,i.jsx)(vD,{isOpen:c,link:fg({organizationId:t,eventId:n,lang:o?.language,pathComponent:"accreditations",key:r.event.key}),onClose:()=>{u(!1)}})]})};function RF(){const{history:e,params:{organizationId:t,eventId:n}}=vl(),{mutate:i}=function(e={}){return ei("mutation AccreditationDuplicate($eventId: EventId!, $accreditationId: AccreditationId!) {\n accreditationDuplicate(eventId: $eventId, accreditationId: $accreditationId) {\n id\n }\n}\n",e)}();return(0,L.useCallback)(async s=>{const{accreditationDuplicate:o}=await i({eventId:n,accreditationId:s});e.push(Ps.EDIT_ACCREDITATION(t,n,o.id))},[t,n,i])}const $F=e=>{const{translate:t,params:{eventId:n}}=vl(),{showNotification:s}=Ob(),{mutate:o}=Gr();return(0,i.jsx)(cA,{buttonText:t("supprimer_43083"),subtext:(0,Za.A)([t("_tes_vous_s_r_d_79068"),e.accreditation.assignedResources>0?t("_1_membre_est_95699",e.accreditation.assignedResources):null]),text:t("suppression_de_73669",e.accreditation.name),onClose:e.onClose,onDelete:async()=>{await o({eventId:n,selecteds:{ids:[e.accreditation.id]}}),s(t("l_accr_ditation_25253",e.accreditation.name)),e.onSuccess()}})},DF=e=>{const t=Xn(),n=RF(),[s,o]=(0,L.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Yc,{children:[(0,i.jsx)(Kd,{icon:"pen",to:Ps.EDIT_ACCREDITATION(e.organizationId,e.eventId,e.accreditation.id),children:t("_diter_62574")}),(0,i.jsx)(Kd,{icon:"clone",onClick:async()=>{await n(e.accreditation.id)},children:t("dupliquer_28256")}),(0,i.jsx)(Xu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Kd,{color:"red",icon:"trash-can",onClick:e=>{o(!0),Vd(e.target)},children:t("supprimer_43083")})]}),s&&(0,i.jsx)($F,{accreditation:e.accreditation,onClose:()=>{o(!1)},onSuccess:e.reload})]})},PF=e=>{const{translate:t}=vl();return(0,i.jsx)(uF,{accreditationId:e.accreditation.id,column:e.column,initialValue:e.accreditation.willAutoAccredit,property:se.AutoAccredit,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(_c,{state:e?"checked":"unchecked",onClick:e=>{n("checked"===e)},children:t("AutoAccredit")}),renderValue:e.accreditation.willAutoAccredit?t("oui_54361"):t("non_33516")})},FF=e=>(0,i.jsx)(uF,{accreditationId:e.accreditation.id,column:e.column,initialValue:e.accreditation.index??0,property:se.Index,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(Bl,{min:1,shouldParseAsInt:!0,value:e,onChange:t}),renderValue:e.accreditation.index?.toString(10)??"-"}),MF=e=>{const{translate:t}=vl();return(0,i.jsx)(uF,{accreditationId:e.accreditation.id,column:e.column,initialValue:e.accreditation.weezeventIsSynchronized,property:se.WeezeventIsSynchronized,reload:e.reload,renderInput:(e,n)=>(0,i.jsxs)($u,{label:t("WeezeventIsSynchronized"),shouldParseAsBoolean:!0,value:e,onChange:n,children:[(0,i.jsx)("option",{value:"true",children:t("oui_54361")}),(0,i.jsx)("option",{value:"false",children:t("non_33516")})]}),renderValue:e.accreditation.weezeventIsSynchronized?t("oui_54361"):t("non_33516")})},NF=e=>{const{mutate:t}=Eo(),n=(0,L.useCallback)((n,i)=>t({eventId:e.eventId,massEdit:{reset:!1,selecteds:{ids:[e.row.id]},slug:i,strategy:it.Replace,value:n}}),[e.row,t]);return e.column.slug===dF.Id?(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.id}):e.column.slug===dF.Category?(0,i.jsx)(_F,{accreditationCategory:e.row.accreditationCategory,accreditationId:e.row.id,column:e.column,reload:e.reloadRow}):e.column.slug===dF.Name?(0,i.jsx)(CF,{accreditation:e.row,column:e.column,reload:e.reloadRow}):e.column.slug===dF.SlotName||e.column.slug===dF.SlotDate?(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:"-"}):e.column.slug===dF.Resources?(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(L$,{assignedResources:e.row.assignedResources,resources:e.row.maxResources})}):e.column.slug===dF.Tags?(0,i.jsx)(kF,{accreditation:e.row,column:e.column,reload:e.reloadRow}):e.column.slug===dF.Conditions?(0,i.jsx)(vF,{accreditation:e.row,column:e.column}):e.column.slug===dF.Address?(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.address}):e.column.slug===dF.Latitude?(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.latitude}):e.column.slug===dF.Longitude?(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.longitude}):e.column.slug===dF.Acronym?(0,i.jsx)(hF,{accreditation:e.row,column:e.column,reload:e.reloadRow}):e.column.slug===dF.Color?(0,i.jsx)(xF,{accreditation:e.row,column:e.column,reload:e.reloadRow}):e.column.slug===dF.Icon?(0,i.jsx)(bF,{accreditation:e.row,column:e.column,reload:e.reloadRow}):e.column.slug===dF.IconColor?(0,i.jsx)(jF,{accreditation:e.row,column:e.column,reload:e.reloadRow}):e.column.slug===dF.FillingRate?(0,i.jsxs)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:[e.row.fillingRate,"%"]}):e.column.slug===dF.CreatedBy?(0,i.jsx)(NR,{column:e.column,createdBy:e.row.createdBy}):e.column.slug===dF.AutoAccredit?(0,i.jsx)(PF,{accreditation:e.row,column:e.column,reload:e.reloadRow}):e.column.slug===dF.WeezeventIsSynchronized?(0,i.jsx)(MF,{accreditation:e.row,column:e.column,reload:e.reloadRow}):e.column.slug===dF.WeezeventChecklistId?(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:"-"}):e.column.slug===dF.CreatedAt?(0,i.jsx)(MR,{column:e.column,insertedAt:e.row.insertedAt}):e.column.slug===dF.Index?(0,i.jsx)(FF,{accreditation:e.row,column:e.column,reload:e.reloadRow}):(0,i.jsx)(By,{column:e.column,customField:e.customField,fields:e.row.fields,mutate:n,reload:e.reloadRow,updatable:!0})},LF=e=>{const t=Xn(),{canAccreditationEdit:n}=$S(),s=_y(e.customFields),o=(0,L.useCallback)(()=>{e.reloadAccreditation(e.accreditation.id)},[e.accreditation,e.reloadAccreditation]);return(0,i.jsxs)(Mc,{css:{background:"checked"===e.state?"$primary100":"white","&:hover":{background:"checked"===e.state?"$primary100":"$gray100"}},onMouseLeave:e=>{Vd(e.target)},children:[n&&(0,i.jsx)(Oc,{justify:"center",width:48,children:(0,i.jsx)(fc,{state:e.state,onClick:t=>e.toggleRow(`a${e.accreditation.id}`,t)})}),e.columns.map(t=>{const n=s.get(t.slug);return(0,i.jsx)(NF,{column:t,customField:n,eventId:e.eventId,reloadRow:o,row:e.accreditation},t.slug)}),n&&(0,i.jsxs)(Xc,{justify:"center",children:[(0,i.jsxs)(km,{children:[(0,i.jsx)(Sm,{children:(0,i.jsx)(Ar,{children:(0,i.jsx)(nl,{icon:"pen",to:Ps.EDIT_ACCREDITATION(e.organizationId,e.eventId,e.accreditation.id)})})}),(0,i.jsx)(wm,{placement:"top",children:t("_diter_62574")})]}),(0,i.jsx)(DF,{accreditation:e.accreditation,eventId:e.eventId,organizationId:e.organizationId,reload:e.reload})]})]})},BF=e=>{const{params:{organizationId:t,eventId:n}}=vl(),{canAccreditationEdit:s}=$S(),{columns:o,columnsSearch:r,limit:a,massActions:l,nameDebounced:d,offset:c,possibleColumns:u,predicates:h,reloadKey:g,setLimit:p,setOffset:f,setSort:_,sort:x}=vy(),I=(0,L.useMemo)(()=>({includeConditions:o.includes(dF.Conditions),includeCreatedBy:o.includes(dF.CreatedBy),includeTags:o.includes(dF.Tags)}),[o]),{data:v,isLoading:b,reload:j}=Qn("query Accreditations(\n $eventId: EventId!\n $name: String\n $predicates: [Predicate!]\n $limit: Int\n $offset: Int\n $sort: AccreditationsSort\n $columnsSearch: [String!]\n $includeConditions: Boolean!\n $includeCreatedBy: Boolean!\n $includeTags: Boolean!\n) {\n data: event(id: $eventId) {\n rows: accreditations(\n name: $name\n predicates: $predicates\n columnsSearch: $columnsSearch\n limit: $limit\n offset: $offset\n sort: $sort\n ) {\n nodes {\n ...AccreditationsAccreditation\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{...I,eventId:n,name:m(d)?d:void 0,columnsSearch:so(r)?r:void 0,predicates:h,limit:a,offset:c,sort:x},[Vs.AccreditationsAccreditationFragment]);const C=(0,L.useMemo)(()=>o.flatMap(e=>(0,Za.A)([u.find(t=>t.slug===e)])),[u,o]),{numberOfPages:y,totalCount:k}=Su(v.data?.rows),[A,w]=(0,L.useState)([]),[S,E]=(0,L.useState)({}),T=(0,L.useCallback)(async e=>{E(t=>({...t,[e]:!0}));const{data:{row:t}}=await function(e,t){return go("query AccreditationsAccreditation(\n $eventId: EventId!\n $id: AccreditationId!\n $includeConditions: Boolean!\n $includeCreatedBy: Boolean!\n $includeTags: Boolean!\n) {\n data: event(id: $eventId) {\n row: accreditation(id: $id) {\n ...AccreditationsAccreditation\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[Vs.AccreditationsAccreditationFragment]})}({...I,eventId:n,id:e},await Y());w(n=>n.map(n=>n.id===e?t:n)),E(t=>({...t,[e]:!1}))},[I,E,w]);return(0,L.useEffect)(()=>{w(v.data?.rows.nodes??[])},[v.data]),(0,L.useEffect)(()=>{g>1&&j()},[g]),(0,L.useEffect)(()=>{l.setStates(Object.fromEntries((v.data?.rows.nodes??[]).map(e=>[`a${e.id}`,{id:e.id,state:"unchecked"}])))},[v.data,l.setStates]),(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Ba,{css:{flex:"1",overflow:"hidden"},width:1,children:(0,i.jsx)(Cm,{"aria-busy":b,headerRow:(0,i.jsxs)(kc,{children:[s&&(0,i.jsx)(Gc,{justify:"center",width:48,children:(0,i.jsx)(fc,{state:l.selectAllState,onClick:l.toggleSelectAll})}),C.map(e=>e.isSortable?(0,i.jsx)(jm,{attribute:e.sortAttribute||e.slug,minWidth:e.minWidth,setSort:_,sort:x,width:e.width,children:(0,i.jsx)(Ar,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug):(0,i.jsx)(Gc,{minWidth:e.minWidth,width:e.width,children:(0,i.jsx)(Ar,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug)),s&&(0,i.jsx)(Gc,{width:100})]}),paginationRow:(0,i.jsx)(Nc,{css:{borderTop:"1px solid $gray200"},children:(0,i.jsx)(Fc,{limit:a,numberOfPages:y,offset:c,setLimit:p,setOffset:f,showLimits:!0,totalCount:k})}),children:b?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Hc,{}),(0,i.jsx)(Hc,{}),(0,i.jsx)(Hc,{})]}):A.map(s=>S[s.id]?(0,i.jsx)(Hc,{},s.id):(0,i.jsx)(LF,{accreditation:s,columns:C,customFields:e.customFields,eventId:n,organizationId:t,reload:j,reloadAccreditation:T,state:l.states[`a${s.id}`]?.state??"unchecked",toggleRow:l.toggleRow},s.id))})})})},VF=e=>{const t=Xn(),{canAccreditationEdit:n,canSegmentEdit:s}=$S(),{limit:o,reloadKey:r,rendering:a,segment:l,setReloadKey:d}=vy();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(OF,{reload:()=>{d(r+1)}}),0===e.numberOfAccreditations?(0,i.jsx)(aj,{css:{overflow:"hidden"},children:(0,i.jsx)(Ar,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(Gk,{subtitle:"",title:t("vous_n_avez_pas_53408")})})}):(0,i.jsxs)(aj,{children:[(0,i.jsx)(m$,{searchRow:(0,i.jsx)(u$,{actions:(0,i.jsx)(zF,{}),searchPlaceholder:t("rechercher_une_65646"),showActions:n,showEditColumns:s,showEditMode:n,showSearchColumns:s}),selectSegment:(0,i.jsx)($$,{pageSelectedText:t("les_1_accr_di_60244",o),segmentSelectedText:t("les_1_accr_di_20650",l.count,l.name)})}),a===Bh.SlotsList?(0,i.jsx)(TF,{customFields:e.customFields,weezeventOrganizationId:e.weezeventOrganizationId}):(0,i.jsx)(BF,{customFields:e.customFields})]})]})},UF=e=>{const{history:t,translate:n,params:{organizationId:s,eventId:o,segmentId:r}}=vl(),{hasPermission:a,localEvent:l,updateLocalEvent:d}=wb(),c=Zn(cF),u=(0,L.useMemo)(()=>e.organization?.customFields.nodes??[],[e.organization]),h=(0,L.useMemo)(()=>c.getAccreditationsFilters(e.event,u),[u,e.event]),m=(0,L.useMemo)(()=>c.getAccreditationsPossibleColumns(e.event.isWeezeventConnected,u),[u,e.event]);return(0,i.jsx)(gF,{eventId:o,organizationId:s,children:(0,i.jsx)(l$,{canEditSegments:a(Hb.SEGMENT_EDIT),eventId:o,filters:h,filtersButtonText:n("filtrer_les_acc_57840"),filtersSubtitle:n("appliquer_des_f_18351"),getSegmentPath:e=>Ps.ACCREDITATIONS_SEGMENT(s,o,e),hideSegments:0===e.event.numberOfAccreditations,initialLimit:l?.accreditationsLimit??Rc,initialSegmentsOpen:l?.areAccreditationsSegmentsOpen??!0,organizationId:s,possibleColumns:m,possibleRenderings:[Bh.List,Bh.SlotsList],reload:e.reload,segmentId:r,segmentType:jt.Accreditations,segmentsFolders:e.event.segmentsFolders,setLimit:e=>{d({accreditationsLimit:e})},onSegmentClick:e=>{d({accreditationsSegmentId:e})},onSegmentDelete:async()=>{await d({accreditationsSegmentId:null}),t.replace(is.ACCREDITATIONS({organizationId:s,eventId:o}))},onSegmentsToggle:async e=>{await d({areAccreditationsSegmentsOpen:e})},children:(0,i.jsx)(VF,{customFields:u,numberOfAccreditations:e.event.numberOfAccreditations,weezeventOrganizationId:e.organization.weezeventOrganizationId})})})},WF=()=>{const{params:{organizationId:e,eventId:t},translate:n}=vl(),{event:{name:s},localEvent:o}=wb();Md(`${s} ${n("accr_ditations_39450")}`);const{data:r,loader:a,reload:l}=Qn("query AccreditationsSegments($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n weezeventOrganizationId\n\n customFields(variety: Accreditation) {\n nodes {\n ...SegmentCustomField\n }\n }\n }\n\n event(id: $eventId) {\n id\n organizationId\n numberOfAccreditations\n isWeezeventConnected\n\n accreditationsCategories {\n id\n name\n }\n\n segmentsFolders(segmentType: Accreditations) {\n ...SegmentsFoldersSegments\n }\n }\n}\n",{organizationId:e,eventId:t},[Vs.SegmentCustomFieldFragment,Vs.SegmentsFoldersSegmentsFragment]),d=(0,L.useMemo)(()=>(r.event?.segmentsFolders??[]).flatMap(e=>e.segments).map(e=>e.id),[r.event]);return a||(0,i.jsxs)(Sr.dO,{children:[(0,i.jsx)(Sr.qh,{path:Ps.ACCREDITATIONS_SEGMENT(":organizationId",":eventId",":segmentId"),children:(0,i.jsx)(UF,{event:r.event,organization:r.organization,reload:l})}),(0,i.jsx)(Sr.qh,{children:(0,i.jsx)(oi,{path:Ps.ACCREDITATIONS_SEGMENT(e,t,o?.accreditationsSegmentId&&d.includes(o.accreditationsSegmentId)?o?.accreditationsSegmentId:d[0]),replace:!0})})]})},GF=()=>{const{hasFeature:e}=TI();return e(Be.Accreditation)?(0,i.jsx)(WF,{}):(0,i.jsx)(Ba,{align:"center",height:1,justify:"center",width:1,children:(0,i.jsx)(zI,{icon:"badge-check"})})},HF=({accreditation:e})=>{const{history:t,params:{organizationId:n,eventId:s,accreditationId:o},translate:r}=vl(),a=RF(),[l,d]=(0,L.useState)(!1);return(0,i.jsxs)(lj,{align:"center",gap:"3",hideBorder:!0,children:[(0,i.jsx)(Sj,{returnPathFallback:is.ACCREDITATIONS({organizationId:n,eventId:s})}),(0,i.jsx)(Ar,{color:"gray900",css:{flex:"1"},fontSize:"displayXs",fontWeight:"medium",children:TC(e)}),(0,i.jsx)(Kb,{permissions:Hb.ACCREDITATION_EDIT,children:(0,i.jsx)(zl,{to:Ps.EDIT_ACCREDITATION(n,s,o),children:r("_diter_l_accr_d_26424")})}),(0,i.jsx)(Kb,{permissions:Hb.ACCREDITATION_EDIT,children:(0,i.jsxs)(Wd,{children:[(0,i.jsx)(Xd,{children:(0,i.jsx)(zl,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Zd,{placement:"bottom-end",children:[(0,i.jsx)(Kd,{icon:"clone",onClick:async()=>await a(e.id),children:r("dupliquer_28256")}),(0,i.jsx)(Xu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Kd,{color:"red",icon:"trash-can",onClick:e=>{Vd(e.target),d(!0)},children:r("supprimer_43083")})]})]})}),l&&(0,i.jsx)($F,{accreditation:e,onClose:()=>d(!1),onSuccess:()=>t.replace(is.ACCREDITATIONS({organizationId:n,eventId:s}))})]})},qF=e=>(0,i.jsx)(Xu,{color:e.color,css:{display:"none","@tablet":{display:"block"},...e.css},direction:e.direction}),KF=_r("dt",{color:"$gray800",fontSize:"$textSm",fontWeight:"$medium","@tablet":{color:"$gray500",fontWeight:"$regular",gridColumn:1}}),YF=({children:e,...t})=>(0,i.jsx)(KF,{...t,children:e}),ZF=_r("dd",{color:"$gray500",marginInline:0,"@tablet":{color:"$gray800",gridColumn:2}}),XF=({children:e,...t})=>(0,i.jsx)(ZF,{...t,children:e}),JF=_r("div",{display:"grid",gridTemplateColumns:"auto",rowGap:"$1","@tablet":{columnGap:"$3",gridTemplateColumns:"auto auto",justifyContent:"space-between"}}),QF=({children:e,...t})=>(0,i.jsx)(JF,{...t,children:e}),eM=_r("dl",{display:"flex",flexDirection:"column",gap:"$4",marginBlock:0,marginInline:0}),tM=({children:e,...t})=>(0,i.jsx)(eM,{...t,children:e}),nM=({accreditationCategoryId:e,accreditationCategoryName:t,accreditationName:n,color:s,customFields:o,fields:r,icon:a})=>{const{params:{organizationId:l,eventId:d,accreditationId:c},translate:u}=vl();return(0,i.jsx)(Sw,{css:{flex:"2 1"},title:u("param_tres_78420"),children:(0,i.jsx)(Ba,{direction:"column",gap:"4",width:1,children:(0,i.jsxs)(tM,{children:[(0,i.jsxs)(QF,{children:[(0,i.jsx)(YF,{children:u("cat_gorie_00291")}),(0,i.jsx)(XF,{children:(0,i.jsx)(Zc,{to:is.ACCREDITATION_CATEGORY({organizationId:l,eventId:d,accreditationCategoryId:e}),children:t})})]}),n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qF,{direction:"horizontal"}),(0,i.jsxs)(QF,{children:[(0,i.jsx)(YF,{children:u("Accreditation")}),(0,i.jsx)(XF,{children:(0,i.jsx)(Zc,{to:is.ACCREDITATION({organizationId:l,eventId:d,accreditationId:c}),children:n})})]})]}),(0,i.jsx)(qF,{direction:"horizontal"}),(0,i.jsxs)(QF,{children:[(0,i.jsx)(YF,{children:u("Color")}),(0,i.jsx)(XF,{children:(0,i.jsx)(Ar,{css:{background:s,borderRadius:"20px",height:"20px",width:"20px"}})})]}),(0,i.jsx)(qF,{direction:"horizontal"}),(0,i.jsxs)(QF,{children:[(0,i.jsx)(YF,{children:u("ic_ne_55554")}),(0,i.jsx)(XF,{children:(0,i.jsx)(nl,{icon:tl(a)})})]}),o.map(e=>(0,i.jsxs)(L.Fragment,{children:[(0,i.jsx)(Xu,{direction:"horizontal"}),(0,i.jsxs)(Ba,{align:"center",gap:"3",justify:"between",children:[(0,i.jsx)(Ar,{color:"gray500",css:{flex:"1"},children:e.name}),(0,i.jsx)(Ba,{justify:"end",width:300,children:(0,i.jsx)(kw,{field:e,fields:r})})]})]},e.slug))]})})})},iM=_r("div",{color:"$gray800",fontSize:"$textSm",fontWeight:"$medium","@tablet":{color:"$gray500",fontWeight:"$regular"}}),sM=_r("div",{color:"$gray500","@tablet":{color:"$gray800",fontWeight:"$medium"}}),oM=({customFields:e})=>{const t=Tc(),n=Xn();return(0,i.jsx)(Sw,{title:n("conditions_77756"),children:so(e)?e.map(({customField:e,conditionValue:s},o)=>(0,i.jsxs)(L.Fragment,{children:[0!==o&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"4"}),!t&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Xu,{direction:"horizontal"}),(0,i.jsx)(Ya,{height:"4"})]})]}),(0,i.jsx)(iM,{children:e.name}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(sM,{children:IF(n,e,s)})]},o)):(0,i.jsx)(Ar,{color:"gray500",textAlign:"center",width:1,children:n("aucune_conditio_36491")})})},rM=({assignedResources:e,maxResources:t})=>{const n=Xn();return(0,i.jsx)(Sw,{css:{flex:"1 1"},title:n("limite_de_membr_42978"),children:(0,i.jsx)(Ba,{css:{justifyContent:"space-between"},direction:"column",height:"100%",children:(0,i.jsx)(Ar,{css:{margin:"auto"},children:(0,i.jsx)(Rw,{count:e,total:t??1/0})})})})},aM=({location:e,location:{zoom:t,layer:n,traces:s,address:o}})=>{const r=Xn(),a=Rh(e);return(0,i.jsx)(Sw,{css:{border:a&&!zh?"none":"1px solid $gray200",overflow:"hidden",padding:a?0:"$4","@tablet":{border:"1px solid $gray200",padding:0,"& .h-detail-box-content":{padding:a?"0":"$6"}}},title:r("localisation_38416"),children:a?(0,i.jsxs)(i.Fragment,{children:[Oh(e)&&(0,i.jsx)(Ar,{height:380,width:1,children:(0,i.jsx)(Br,{initialZoom:t,layer:n,point:Pr(e),traces:s})}),zh(e)&&(0,i.jsx)(Ar,{color:"gray800",css:{padding:"$4","@tablet":{padding:"$7"}},children:o})]}):(0,i.jsx)(Ar,{color:"gray500",textAlign:"center",width:1,children:r("aucune_localisa_78216")})})},lM=()=>{const{params:{eventId:e,accreditationId:t}}=vl(),{data:n,loader:s}=Qn("query AccreditationChart($eventId: EventId!, $accreditationId: AccreditationId!) {\n event(id: $eventId) {\n accreditation(id: $accreditationId) {\n ...AccreditationChart\n }\n }\n}\n",{eventId:e,accreditationId:t},[Vs.AccreditationChartFragment]);return s||(0,i.jsx)(Sw,{title:"Reporting",children:(0,i.jsx)(Ar,{height:380,width:1,children:(0,i.jsx)(oS,{accreditation:n.event.accreditation,slots:n.event.accreditation.slots})})})},dM="both",cM="delegationAccreditation",uM="slot",hM=({limitSource:e})=>{const t=Xn();return e===cM?(0,i.jsx)(nl,{icon:"people-group",title:t("limite_fix_e_po_87265")}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(nl,{icon:"badge-check",title:t("limite_fix_e_po_40573")}),e===dM&&(0,i.jsxs)(i.Fragment,{children:[" + ",(0,i.jsx)(hM,{limitSource:cM})]})]})},mM=(e,t)=>{const n=t?.assignedResources??0,s=t?.wishedResources??0,o=t?.maxResources??1/0,r=e?.assignedResources??0,a=e?.wishedResources??0,l=e?.maxResources??1/0,d=r>=l||n>=o,c=o-n,u=o-s,h=l-r,m=l-a,g=c===h?dM:c{const{history:s,params:{organizationId:o,eventId:r,accreditationId:a},translate:l}=vl(),d=Zn(Jc),c=Zn(Vv),{assignedResources:u,maxResources:h,percent:g}=mM(void 0,t),{mutate:p}=Hr(),{mutate:f}=function(e={}){return ei("mutation AccreditationSlotDelete($eventId: EventId!, $accreditationSlotId: AccreditationsSlotId!) {\n accreditationSlotDelete(eventId: $eventId, accreditationSlotId: $accreditationSlotId) {\n id\n }\n}\n",e)}(),[_,x]=(0,L.useState)(!1),[I,v]=(0,L.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Mc,{css:{cursor:"pointer",userSelect:"none","&:hover":{background:"$gray100"}},onClick:()=>s.push(is.ACCREDITATION_SLOT({organizationId:o,eventId:r,accreditationId:a,accreditationSlotId:t.id})),children:[(0,i.jsx)(Oc,{children:(0,i.jsx)(Ar,{font:"gray900 textSm medium",children:m(t.name)?t.name:"-"})}),(0,i.jsx)(Oc,{children:t.date?d.toLocaleString(t.date,eo.DateOnly.WeekdayLongMonthLong):"-"}),(0,i.jsx)(Oc,{children:(0,i.jsxs)(Ba,{align:"center",css:{"& > div":{width:"100%"}},gap:"2",width:1,children:[(0,i.jsx)(Ar,{children:l("_1_2_membres_04485",u,c.toNumberOrInfinity(h))}),h&&(0,i.jsx)(Ow,{percent:g})]})}),(0,i.jsx)(Xc,{justify:"end",children:(0,i.jsxs)(Yc,{children:[(0,i.jsx)(Kd,{icon:"pen",onClick:()=>{x(!0)},children:l("_diter_62574")}),(0,i.jsx)(Kd,{color:t.assignedResources>0?"disabled":"red",icon:"trash-can",onClick:()=>{v(!0)},children:l("supprimer_43083")})]})})]}),_&&(0,i.jsx)(tF,{event:e,slot:t,onClose:()=>{x(!1)},onSuccess:async e=>{await p({eventId:r,accreditationSlotId:t.id,accreditationSlot:e}),n()}}),I&&(0,i.jsx)(cA,{buttonText:l("supprimer_43083"),subtext:[l("_tes_vous_s_r_d_48876")],text:l("suppression_de_73669",Dh(d,t,"")),onClose:()=>{v(!1)},onDelete:async()=>{await f({eventId:r,accreditationSlotId:t.id}),n()}})]})},pM=()=>{const{translate:e,params:{eventId:t,accreditationId:n}}=vl(),[s,o,r]=Wc(""),[a,l]=kz("accreditation.slots.date",Gs.c9.invalid("Invalid"),vm),[d,c]=(0,L.useState)(0),[u,h]=kz("accreditation.slots.sort",null),{data:g,isLoading:p,reload:f}=Qn("query AccreditationSlots(\n $eventId: EventId!\n $accreditationId: AccreditationId!\n $name: String\n $date: Date\n $offset: Int\n $sort: AccreditationsSlotsSort\n) {\n event(id: $eventId) {\n startAt\n endAt\n\n accreditationsSlots(\n accreditationsIds: [$accreditationId]\n name: $name\n date: $date\n limit: 25\n offset: $offset\n sort: $sort\n ) {\n nodes {\n id\n name\n isHidden\n date\n maxResources\n assignedResources\n wishedResources\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{eventId:t,accreditationId:n,name:m(o)?o:void 0,date:a?.isValid?a:void 0,offset:d,sort:u},[]);const{numberOfPages:_,totalCount:x}=Su(g.event?.accreditationsSlots),I=(0,L.useCallback)(e=>{h(e),c(0)},[h,c]);return(0,i.jsx)(Lc,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ar,{width:320,children:(0,i.jsx)(Bl,{icon:"magnifying-glass",placeholder:e("rechercher_un_c_70424"),value:s,onChange:r})}),(0,i.jsx)(Ar,{width:200,children:(0,i.jsx)(Mu,{max:g.event?.endAt,min:g.event?.startAt,value:a,onChange:l})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(jm,{attribute:re.Name,setSort:I,sort:u,children:e("nom_du_cr_neau_54351")}),(0,i.jsx)(jm,{attribute:re.Date,setSort:I,sort:u,children:e("Date")}),(0,i.jsx)(Gc,{children:e("remplissage_75916")}),(0,i.jsx)(Gc,{width:100})]}),numberOfPages:_,offset:d,rows:p?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Hc,{bx:!0}),(0,i.jsx)(Hc,{bx:!0}),(0,i.jsx)(Hc,{bx:!0})]}):g.event.accreditationsSlots.nodes.map(e=>(0,i.jsx)(gM,{event:g.event,reload:f,slot:e},e.id)),setOffset:c,title:e("liste_des_cr_ne_66393"),totalCount:x})},fM=()=>{const{organizationId:e,eventId:t,accreditationId:n}=ti(),{isEventAdmin:s}=wb(),{data:o,loader:r,reload:a}=Qn("query AccreditationDashboard(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $accreditationId: AccreditationId!\n) {\n organization(id: $organizationId) {\n customFields(variety: Accreditation) {\n nodes {\n ...CustomFieldWithCondition\n }\n }\n }\n\n event(id: $eventId) {\n accreditation(id: $accreditationId) {\n id\n name\n description\n privateNote\n acronym\n icon\n color\n address\n latitude\n longitude\n layer\n zoom\n assignedResources\n maxResources\n hasSlots\n hiddenSlotId\n fields\n\n accreditationCategory {\n id\n name\n }\n\n accreditationsCustomFields {\n customField {\n name\n fieldType\n\n values {\n id\n value\n }\n }\n\n conditionValue\n }\n\n tags {\n id\n name\n }\n }\n }\n}\n",{organizationId:e,eventId:t,accreditationId:n},[Vs.CustomFieldWithConditionFragment]),{mutate:l}=Eo();return r||(0,i.jsx)(aj,{children:(0,i.jsxs)(Ba,{direction:"column",gap:"6",children:[(0,i.jsx)(lM,{}),o.event.accreditation.hasSlots&&(0,i.jsx)(Ar,{css:{flex:"1"},children:(0,i.jsx)(pM,{})}),(0,i.jsxs)(Ba,{gap:"6",width:1,children:[!o.event.accreditation.hasSlots&&(0,i.jsx)(rM,{assignedResources:o.event.accreditation.assignedResources,maxResources:o.event.accreditation.maxResources}),(0,i.jsx)(nM,{accreditationCategoryId:o.event.accreditation.accreditationCategory.id,accreditationCategoryName:o.event.accreditation.accreditationCategory.name,color:o.event.accreditation.color,customFields:o.organization.customFields.nodes,fields:o.event.accreditation.fields,icon:o.event.accreditation.icon})]}),(0,i.jsxs)(Ba,{gap:"4",children:[(0,i.jsxs)(Ba,{direction:"column",gap:"4",width:1,children:[(0,i.jsx)(oM,{customFields:o.event.accreditation.accreditationsCustomFields}),(0,i.jsx)(Uw,{...s?{associateTags:e=>l({eventId:t,massEdit:{reset:!1,selecteds:{ids:[n]},slug:se.Tag,strategy:it.Replace,value:e}}),reload:a}:{},tags:o.event.accreditation.tags}),(0,i.jsx)(Nw,{privateNote:o.event.accreditation.privateNote})]}),(0,i.jsxs)(Ba,{direction:"column",gap:"4",width:1,children:[(0,i.jsx)(Mw,{description:o.event.accreditation.description}),(0,i.jsx)(aM,{location:o.event.accreditation})]})]})]})})},_M=e=>{const{translate:t}=vl(),n=Zn(ph),{data:s}=Qn("query MassCheckInPositionsSlots($eventId: EventId!) {\n event(id: $eventId) {\n positions {\n nodes {\n id\n name\n\n slots {\n id\n name\n range\n }\n }\n }\n }\n}\n",{eventId:e.eventId},[]);const o=(0,L.useMemo)(()=>(s.event?.positions.nodes??[]).map(e=>(0,i.jsx)("optgroup",{label:e.name,children:e.slots.map(t=>(0,i.jsx)("option",{value:t.id,children:Ch(n,t,e.name,{position:{includeNameAtEnd:!0}})},t.id))},e.id)),[s.event]),{mutate:r}=Bo(),[a,l]=(0,L.useState)([]),[d,c]=(0,L.useState)(fe.CheckInOut),[u,h]=(0,L.useState)(null),[m,g]=(0,L.useState)(null),[p,f]=(0,L.useState)(0),[_,x]=(0,L.useState)(!1),I=(0,L.useMemo)(()=>to(),[]),v=so(a)&&(d===fe.Reset||u?.isValid&&m?.isValid&&m>u||u?.isValid&&!m?.isValid);return(0,i.jsx)(Lb,{isOpen:!0,onClose:e.onClose,children:(0,i.jsxs)(Nb,{children:[(0,i.jsx)(Mb,{icon:"sliders",children:t("mise_jour_du_76261")}),(0,i.jsxs)(Fb,{gap:"5",children:[(0,i.jsx)(yc,{isSearchVisible:!0,label:t("pour_quel_cr_ne_94965"),multiple:!0,values:a,onChange:l,children:o}),(0,i.jsxs)(Ba,{direction:"column",gap:"2",children:[(0,i.jsx)(Ar,{font:"gray700 textSm medium",children:t("que_souhaitez_v_87607")}),(0,i.jsx)(vc,{state:d===fe.CheckInOut?"checked":"unchecked",onClick:()=>{c(fe.CheckInOut)},children:t("mettre_jour_l_00128")}),d===fe.CheckInOut&&(0,i.jsxs)(Ba,{css:{paddingBottom:"$3",paddingLeft:"$6"},gap:"6",children:[(0,i.jsx)(Vu,{hint:t("date_et_heure_d_93417"),rightIcon:"xmark",value:u,zone:I,onChange:h,onRightIconClick:()=>h(null)}),(0,i.jsx)(Vu,{hint:t("date_et_heure_d_65738"),rightIcon:"xmark",value:m,zone:I,onChange:g,onRightIconClick:()=>g(null)}),(0,i.jsx)(Bl,{css:{visibility:2723===e.organizationId?"hidden":"visible"},hint:t("temps_de_pause_00051"),shouldParseAsInt:!0,value:p,onChange:f})]}),(0,i.jsx)(vc,{state:d===fe.Reset?"checked":"unchecked",onClick:()=>{c(fe.Reset)},children:t("remettre_z_ro_11572")})]})]}),(0,i.jsx)(Pb,{children:(0,i.jsx)(zl,{disabled:!v,isLoading:_,onClick:async()=>{x(!0);const n=(await r({eventId:e.eventId,checkIn:{breakTime:p,checkInAt:u?.toUTC(),checkOutAt:m?.toUTC(),strategy:d,positionsSlotsIds:a,selecteds:e.selecteds}})).numberOfMembers;e.onSuccess(t("le_pointage_de_04632",n)),e.onClose()},children:t("mettre_jour_85141")})})]})})},xM=e=>{const{params:{organizationId:t,eventId:n},translate:s}=vl(),{user:o}=ai(),{data:r}=Qn("query MassDocumentExportCustomDocuments($eventId: EventId!) {\n event(id: $eventId) {\n customDocuments {\n name\n slug\n }\n }\n}\n",{eventId:n},[]),{mutate:a}=Mo(),[l,d]=(0,L.useState)(ze.Assignments),[c,u]=(0,L.useState)(Gs.c9.invalid("Invalid")),[h,m]=(0,L.useState)(!1),[g,p]=(0,L.useState)(!1),f=(0,L.useMemo)(()=>(0,xh.A)(r.event?.customDocuments??[],e=>e.slug),[r.event]),_=l===ze.Assignments||l===ze.UserHours||l===ze.UserPlanning||l===ze.UserPlanningList;return(0,i.jsx)(Lb,{isOpen:!0,onClose:e.onClose,children:(0,i.jsxs)(Nb,{children:[(0,i.jsx)(Mb,{icon:"file",children:s("exporter_un_doc_23130")}),(0,i.jsxs)(Fb,{gap:"5",children:[(0,i.jsx)(rl,{color:"gray",leftIcon:"circle-exclamation",children:s("l_e_mail_peut_m_13253")}),(0,i.jsxs)(yc,{isSearchVisible:!0,label:s("quel_document_v_81798"),renderOnPortal:!0,values:[l],onChange:e=>{so(e)&&d(e[0])},children:[f.map(e=>(0,i.jsx)("option",{value:e.slug,children:e.name},e.slug)),(0,i.jsx)("option",{value:ze.Assignments,children:s("fiche_d_affecta_91461")}),(0,i.jsx)("option",{value:ze.UserPlanning,children:s("UserPlanning")}),(0,i.jsx)("option",{value:ze.UserPlanningList,children:s("UserPlanningList")}),(0,i.jsx)("option",{value:ze.UserPlanningDays,children:s("UserPlanningDays")}),(0,i.jsx)("option",{value:ze.Certificate,children:s("Certificate")}),(0,i.jsx)("option",{value:ze.UserHours,children:s("UserHours")})]}),_&&(0,i.jsx)(Mu,{label:s("exportez_vos_do_87332"),value:c,onChange:u}),(0,i.jsx)(_c,{state:h?"checked":"unchecked",onClick:e=>{m("checked"===e)},children:s("fusionner_les_d_64130")})]}),(0,i.jsx)(Pb,{children:(0,i.jsx)(zl,{isLoading:g,onClick:async()=>{p(!0);const i=f.map(e=>e.slug),s=i.includes(l)?ze.UserCustomDocument:l,r=i.includes(l)?l:void 0;await a({organizationId:t,eventId:n,documentsExport:{documentType:s,customDocumentSlug:r,segmentsIds:e.selecteds.segmentId?[e.selecteds.segmentId]:[],ids:e.selecteds.ids,language:o.language,oneFile:h,date:c}}),e.onSuccess(),e.onClose()},children:s("exporter_59120")})})]})})},IM=e=>{const t=Xn(),{mutate:n,isLoading:s}=Jo(),[o,r]=(0,L.useState)(le.WaitingAccreditation);return(0,i.jsxs)(au,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Ba,{justify:"center",children:(0,i.jsx)(sC,{color:"primary",icon:"sliders"})}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(Ar,{font:"gray900 textLg medium",textAlign:"center",children:t("mettre_jour_l_44471")}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsxs)($u,{label:t("nouveau_statut_57871"),value:o,onChange:e=>{r(e)},children:[(0,i.jsx)("option",{value:le.NotApplicable,children:t(le.NotApplicable)}),(0,i.jsx)("option",{value:le.Refused,children:t(le.Refused)}),(0,i.jsx)("option",{value:le.WaitingAccreditation,children:t(le.WaitingAccreditation)})]}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsxs)(Ba,{gap:"3",justify:"end",children:[(0,i.jsx)(zl,{isLoading:s,onClick:async()=>{const i=(await n({eventId:e.eventId,massStateUpdate:{selecteds:e.selecteds,state:o}})).numberOfMembers;e.onSuccess(t("le_statut_d_acc_85658",i,t(o))),e.onClose()},children:t("modifier_le_sta_94473")}),(0,i.jsx)(zl,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})};let vM=class extends Gl{translationService;constructor(e){super(e),this.translationService=e}massAssignStep1Schema(){return d.Ik().shape({massAssign:d.Ik().shape({...this.massAssignStep1Fields()})})}massAssignStep2Schema(){return d.Ik().shape({massAssign:d.Ik().shape({...this.massAssignStep2Fields()})})}massAssignSchema(){return d.Ik().shape({...this.massAssignStep1Fields(),...this.massAssignStep2Fields()})}massAssignStep1Fields(){return{strategy:d.Yj().required(this.t("la_strat_gie_es_82287")).oneOf(Cn,this.t("la_strat_gie_es_82287"))}}massAssignStep2Fields(){return{positionsSlotsIds:d.YO().of(d.ai()).required(this.t("vous_devez_s_le_28976")).min(1,this.t("vous_devez_s_le_28976"))}}};vM=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[qn])],vM);const bM=e=>{const t=Xn();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ar,{font:"gray900 textSm medium",children:t("que_souhaitez_v_87607")}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(ub,{name:"massAssign.strategy",value:it.Add,children:t("ajouter_des_aff_57793")}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(ub,{name:"massAssign.strategy",value:it.Replace,children:t("remplacer_les_a_43030")}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(ub,{name:"massAssign.strategy",value:it.Delete,children:t("supprimer_des_a_59880")}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(Ba,{children:(0,i.jsx)(zl,{onClick:e.handleSubmit,children:t("suivant_affec_68075")})})]})},jM=e=>{const t=Xn(),n=Zn(ph),s=e.positionsSlotsIds.includes(e.slot.id)?"checked":"unchecked";return(0,i.jsxs)(Mc,{css:{cursor:"pointer"},onClick:()=>{e.change("massAssign.positionsSlotsIds",ro(e.positionsSlotsIds,e.slot.id,"unchecked"===s))},children:[(0,i.jsx)(Oc,{justify:"center",width:48,children:(0,i.jsx)(fc,{shouldPreventDefault:!1,state:s,onClick:td.A})}),(0,i.jsx)(Oc,{css:{textTransform:"capitalize"},children:n.toDisplayString(e.slot.range,{formats:{displayWeekday:!0}})}),(0,i.jsx)(Oc,{children:m(e.slot.name)?e.slot.name:"-"}),(0,i.jsx)(Oc,{children:(0,i.jsx)(rc,{color:e.slot.assignedResources>=e.slot.resources?"success":"warning",leftIcon:"user-group",children:t("_1_2_membres_04485",e.slot.assignedResources,e.slot.resources)})})]})},CM=e=>{const t=Xn(),n=(0,L.useMemo)(()=>(0,uc.A)(e.slots.filter(t=>t.position.id===e.position.id),e=>e.range.start.toMillis()),[e.slots,e.position]),s=(0,L.useMemo)(()=>n.map(e=>e.id),[n]),o=(0,L.useMemo)(()=>{const t=(0,fh.A)(e.positionsSlotsIds,s);return t.length===s.length?"checked":0===t.length?"unchecked":"indeterminate"},[s,e.positionsSlotsIds]);return(0,i.jsx)(GC,{accreditation:e.position,displayNumberOfSlots:!0,displaySlots:!0,numberOfSlots:n.length,children:(0,i.jsxs)(Sc,{hideBorder:!0,children:[(0,i.jsxs)(kc,{children:[(0,i.jsx)(Gc,{justify:"center",width:48,children:(0,i.jsx)(fc,{state:o,onClick:t=>{"checked"===t?e.change("massAssign.positionsSlotsIds",(0,Bs.A)(e.positionsSlotsIds.concat(s))):e.change("massAssign.positionsSlotsIds",(0,mc.A)(e.positionsSlotsIds,s))}})}),(0,i.jsx)(Gc,{children:t("date_du_cr_neau_82295")}),(0,i.jsx)(Gc,{children:t("nom_du_cr_neau_54351")}),(0,i.jsx)(Gc,{})]}),n.map(t=>(0,i.jsx)(jM,{change:e.change,positionsSlotsIds:e.positionsSlotsIds,slot:t},t.id))]})})},yM=e=>{const t=(0,L.useMemo)(()=>(0,uc.A)(e.positions.filter(t=>t.positionCategoryId===e.category.id),e=>e.name.toLowerCase()),[e.category,e.positions]);return(0,i.jsx)(VC,{category:e.category,children:t.map(t=>(0,i.jsx)(CM,{change:e.change,position:t,positionsSlotsIds:e.positionsSlotsIds,slots:e.slots},t.id))})},kM=e=>{const t=Xn(),[n,s]=(0,L.useState)(!1),[o,r]=(0,L.useState)(e.segmentId),[a,l]=(0,L.useState)(e.excludeFull?"checked":"unchecked"),[d,c]=(0,L.useState)(e.excludePast?"checked":"unchecked"),[u,h]=(0,L.useState)(e.filterAvailabilities?"checked":"unchecked"),[m,g]=(0,L.useState)(e.filterWished?"checked":"unchecked"),p=(e.excludeFull?1:0)+(e.excludePast?1:0)+(e.filterAvailabilities?1:0)+(e.filterWished?1:0)+(-1===e.segmentId?0:1);return(0,i.jsxs)(Ba,{css:{background:"$gray100",borderRadius:"$2",padding:"$4"},gap:"3",children:[(0,i.jsx)(Ar,{css:{flex:"1"},children:(0,i.jsx)(Bl,{icon:"magnifying-glass",placeholder:t("rechercher_une_69998"),value:e.name,onChange:t=>{e.setName(t)}})}),(0,i.jsxs)(EC,{apply:()=>{e.setExcludeFull("checked"===a),e.setExcludePast("checked"===d),e.setFilterAvailabilities("checked"===u),e.setFilterWished("checked"===m),e.setSegmentId(o),s(!1)},color:"white",isOpen:n,numberOfAppliedFilters:p,reinit:()=>{e.setExcludeFull(!1),l("unchecked"),e.setExcludePast(!1),c("unchecked"),e.setFilterAvailabilities(!1),h("unchecked"),e.setFilterWished(!1),g("unchecked"),e.setSegmentId(-1),r(-1),e.setName(""),s(!1)},showButtons:!0,onStateChange:s,children:[(0,i.jsxs)($u,{label:"Vues personnalisées",shouldParseAsInt:!0,value:o,onChange:e=>{r(e)},children:[(0,i.jsx)("option",{value:-1,children:t("vue_personnalis_97654")}),e.segments.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))]}),(0,i.jsx)(_c,{state:a,onClick:l,children:t("masquer_les_cr_14425")}),(0,i.jsx)(_c,{state:d,onClick:c,children:t("masquer_les_cr_05336")}),(0,i.jsx)(Xu,{direction:"horizontal"}),(0,i.jsx)(Ar,{font:"gray900 textSm medium",children:t("filtres_sur_les_73833")}),(0,i.jsx)(_c,{state:u,onClick:h,children:t("filtrer_selon_l_74774")}),(0,i.jsx)(_c,{state:m,onClick:g,children:t("filtrer_selon_l_76350")})]})]})},AM=e=>{const t=Xn(),[n,s,o]=Wc(""),[r,a]=kz("massAssign.filters.segmentId",-1),[l,d]=kz("massAssign.filters.excludeFull",!1),[c,u]=kz("massAssign.filters.excludePast",!1),[h,g]=kz("massAssign.filters.filterAvailabilities",!1),[p,f]=kz("massAssign.filters.filterWished",!1),{data:_,loader:x}=Qn("query MassAssignSlots(\n $eventId: EventId!\n $positionName: String\n $segmentId: SegmentId\n $excludeFull: Boolean\n $excludePast: Boolean\n $filterAvailabilities: Boolean\n $filterWished: Boolean\n $selecteds: MassActionSelectedsInput\n) {\n event(id: $eventId) {\n segments(segmentType: Positions) {\n id\n name\n }\n\n positionsSlots(\n positionName: $positionName\n segmentId: $segmentId\n excludeFull: $excludeFull\n excludePast: $excludePast\n filterAvailabilities: $filterAvailabilities\n filterWished: $filterWished\n selecteds: $selecteds\n ) {\n nodes {\n id\n name\n range\n assignedResources\n resources\n\n position {\n id\n positionCategoryId\n name\n color\n icon\n }\n\n positionCategory {\n id\n name\n }\n }\n }\n }\n}\n",{eventId:e.eventId,positionName:m(s)?s:void 0,segmentId:-1===r?void 0:r,excludeFull:l,excludePast:c,selecteds:e.selecteds,filterAvailabilities:h,filterWished:p},[]);const I=(0,L.useMemo)(()=>(0,uc.A)((0,xh.A)((_.event?.positionsSlots.nodes??[]).map(e=>e.positionCategory),e=>e.id),e=>e.name.toLowerCase()),[_.event]),v=(0,L.useMemo)(()=>(0,xh.A)((_.event?.positionsSlots.nodes??[]).map(e=>e.position),e=>e.id),[_.event]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(kM,{excludeFull:l,excludePast:c,filterAvailabilities:h,filterWished:p,name:n,segmentId:r,segments:_.event?.segments??[],setExcludeFull:e=>{d(e)},setExcludePast:u,setFilterAvailabilities:g,setFilterWished:f,setName:o,setSegmentId:e=>{a(e)}}),(0,i.jsx)(Ya,{height:"6"}),x||(0,i.jsx)(BC,{css:{border:"1px solid $gray100",borderRadius:"$1"},children:I.map(t=>(0,i.jsx)(yM,{category:t,change:e.change,positions:v,positionsSlotsIds:e.values.massAssign.positionsSlotsIds,slots:_.event?.positionsSlots.nodes??[]},t.id))}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(Ba,{children:(0,i.jsx)(zl,{isLoading:e.submitting,onClick:e.handleSubmit,children:t("affecter_les_1_56142",e.numberOfSelected)})})]})},wM=e=>{const t=Xn(),n=Zn(vM),{mutate:s}=Qo();return(0,i.jsx)(CA,{children:(0,i.jsx)(Lm,{category:t("affectation"),heading:t("affecter_les_me_77160"),onClose:e.onClose,children:(0,i.jsx)(Mm,{children:(0,i.jsxs)(vb,{initialValues:{massAssign:{selecteds:e.selecteds,strategy:it.Add,positionsSlotsIds:[]}},isEdit:!1,onSubmit:async n=>{const i=(await s({eventId:e.eventId,massAssign:n.massAssign})).numberOfMembers;e.onSuccess(t("_1_membres_ont_14333",i)),e.onClose()},children:[(0,i.jsx)(Ib,{heading:t("initialisation_38640"),render:({handleSubmit:e})=>(0,i.jsx)(bM,{handleSubmit:e}),schema:n.massAssignStep1Schema()}),(0,i.jsx)(Ib,{heading:t("affectation_plural"),render:t=>(0,i.jsx)(AM,{change:t.form.change,eventId:e.eventId,handleSubmit:t.handleSubmit,numberOfSelected:e.numberOfSelected,selecteds:e.selecteds,submitting:t.submitting,values:t.values}),schema:n.massAssignStep2Schema()})]})})})})};let SM=class extends Gl{translationService;constructor(e){super(e),this.translationService=e}massPreAssignStep1Schema(){return d.Ik().shape({massPreAssign:d.Ik().shape({...this.massPreAssignStep1Fields()})})}massPreAssignStep2Schema(){return d.Ik().shape({massPreAssign:d.Ik().shape({...this.massPreAssignStep2Fields()})})}massPreAssignSchema(){return d.Ik().shape({...this.massPreAssignStep1Fields(),...this.massPreAssignStep2Fields()})}massPreAssignStep1Fields(){return{strategy:d.Yj().required(this.t("la_strat_gie_es_82287")).oneOf(Cn,this.t("la_strat_gie_es_82287")),level:d.Yj().required(this.t("le_niveau_est_r_81100")).oneOf(yn,this.t("le_niveau_est_r_81100"))}}massPreAssignStep2Fields(){return{positionsCategoriesIds:d.YO().of(d.ai()).test("non-empty-categories",this.t("vous_devez_s_le_32044"),function(){return this.parent.level!==st.Categories||this.parent.positionsCategoriesIds.length>0}),positionsIds:d.YO().of(d.ai()).test("non-empty-positions",this.t("vous_devez_s_le_89603"),function(){return this.parent.level!==st.Positions||this.parent.positionsIds.length>0})}}};SM=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[qn])],SM);const EM=e=>{const t=Xn();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ar,{font:"gray900 textSm medium",children:t("que_souhaitez_v_87607")}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(ub,{name:"massPreAssign.strategy",value:it.Add,children:t("ajouter_des_pr_46968")}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(ub,{name:"massPreAssign.strategy",value:it.Replace,children:t("remplacer_les_p_59777")}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(Ar,{font:"gray900 textSm medium",children:t("_quel_niveau_s_87878")}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(ub,{name:"massPreAssign.level",value:st.Categories,children:t("pr_affecter_su_68204")}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(ub,{name:"massPreAssign.level",value:st.Positions,children:t("pr_affecter_su_38603")}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(Ba,{children:(0,i.jsx)(zl,{onClick:e.handleSubmit,children:t("suivant_pr_a_99182")})})]})},TM=e=>{const t=Xn();return(0,i.jsxs)(Mc,{children:[(0,i.jsx)(Oc,{css:{paddingRight:0},width:48,children:(0,i.jsx)(fc,{state:e.positionsCategoriesIds.includes(e.category.id)?"checked":"unchecked",onClick:t=>{e.change("massPreAssign.positionsCategoriesIds",ro(e.positionsCategoriesIds,e.category.id,"checked"===t))}})}),(0,i.jsx)(Oc,{children:e.category.name}),(0,i.jsx)(Oc,{children:(0,i.jsx)(rc,{color:e.category.assignedResources>=e.category.resources?"success":"warning",leftIcon:"user-group",children:t("_1_2_membres_04485",e.category.assignedResources,e.category.resources)})})]})},zM=e=>{const t=Xn(),[n,s,o]=Wc(""),{data:r,isLoading:a}=Qn("query MassPreAssignCategories($eventId: EventId!) {\n event(id: $eventId) {\n positionsCategories {\n id\n name\n assignedResources\n resources\n }\n }\n}\n",{eventId:e.eventId},[]);const l=(0,L.useMemo)(()=>m(s)?(r.event?.positionsCategories??[]).filter(e=>e.name.trim().toLowerCase().includes(s.trim().toLowerCase())):r.event?.positionsCategories??[],[r.event?.positionsCategories,s]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Lc,{filters:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Ar,{width:320,children:(0,i.jsx)(Bl,{icon:"magnifying-glass",placeholder:t("rechercher_une_66722"),value:n,onChange:o})})}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Gc,{css:{paddingRight:0},width:48}),(0,i.jsx)(Gc,{children:t("nom_de_la_cat_g_03860")}),(0,i.jsx)(Gc,{})]}),numberOfPages:1,offset:0,rows:a?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Hc,{bx:!0}),(0,i.jsx)(Hc,{bx:!0}),(0,i.jsx)(Hc,{bx:!0})]}):l.map(t=>(0,i.jsx)(TM,{category:t,change:e.change,positionsCategoriesIds:e.values.massPreAssign.positionsCategoriesIds},t.id)),setOffset:td.A,title:(0,i.jsxs)(Ba,{direction:"column",gap:"1",children:[(0,i.jsx)(Ar,{children:t("s_lectionner_le_58635")}),(0,i.jsx)(Ar,{font:"gray500 textSm regular",children:t("les_membres_s_l_66443")})]}),totalCount:l.length??0}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(Ba,{children:(0,i.jsx)(zl,{onClick:e.handleSubmit,children:t("pr_affecter_le_81533",e.numberOfSelected)})})]})},OM=e=>{const t=Xn();return(0,i.jsxs)(Mc,{children:[(0,i.jsx)(Oc,{css:{paddingRight:0},width:48,children:(0,i.jsx)(fc,{state:e.positionsIds.includes(e.position.id)?"checked":"unchecked",onClick:t=>{e.change("massPreAssign.positionsIds",ro(e.positionsIds,e.position.id,"checked"===t))}})}),(0,i.jsxs)(Oc,{align:"start",direction:"column",gap:"1",justify:"center",children:[(0,i.jsx)(Ar,{font:"gray900 textSm medium",children:e.position.name}),(0,i.jsx)(Ar,{color:"gray500",children:e.position.positionCategoryName})]}),(0,i.jsx)(Oc,{children:(0,i.jsx)(rc,{color:e.position.assignedResources>=e.position.resources?"success":"warning",leftIcon:"user-group",children:t("_1_2_membres_04485",e.position.assignedResources,e.position.resources)})})]})},RM=e=>{const t=Xn(),[n,s,o]=Wc(""),[r,a]=(0,L.useState)(0),[l,d]=(0,L.useState)(null),{data:c,isLoading:u}=Qn("query MassPreAssignPositions(\n $eventId: EventId!\n $name: String\n $offset: Int\n $sort: PositionsSort\n) {\n event(id: $eventId) {\n positions(name: $name, limit: 25, offset: $offset, sort: $sort) {\n nodes {\n id\n name\n positionCategoryName\n assignedResources\n resources\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{eventId:e.eventId,name:m(s)?s:void 0,offset:r,sort:l},[]);const{numberOfPages:h,totalCount:g}=Su(c.event?.positions);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Lc,{filters:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Ar,{width:320,children:(0,i.jsx)(Bl,{icon:"magnifying-glass",placeholder:t("rechercher_une_69998"),value:n,onChange:e=>{a(0),o(e)}})})}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Gc,{css:{paddingRight:0},width:48}),(0,i.jsx)(jm,{attribute:ht.Name,setSort:e=>{d(e),a(0)},sort:l,children:t("nom_de_la_missi_64605")}),(0,i.jsx)(Gc,{})]}),numberOfPages:h,offset:r,rows:u?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Hc,{bx:!0}),(0,i.jsx)(Hc,{bx:!0}),(0,i.jsx)(Hc,{bx:!0})]}):c.event.positions.nodes.map(t=>(0,i.jsx)(OM,{change:e.change,position:t,positionsIds:e.values.massPreAssign.positionsIds},t.id)),setOffset:a,title:(0,i.jsxs)(Ba,{direction:"column",gap:"1",children:[(0,i.jsx)(Ar,{children:t("s_lectionner_le_26300")}),(0,i.jsx)(Ar,{font:"gray500 textSm regular",children:t("les_membres_s_l_63510")})]}),totalCount:g}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(Ba,{children:(0,i.jsx)(zl,{onClick:e.handleSubmit,children:t("pr_affecter_le_81533",e.numberOfSelected)})})]})},$M=e=>{const t=Xn(),n=Zn(SM),{mutate:s}=za();return(0,i.jsx)(CA,{children:(0,i.jsx)(Lm,{category:t("pr_affectation_12256"),heading:t("pr_affecter_le_71377"),onClose:e.onClose,children:(0,i.jsx)(Mm,{children:(0,i.jsxs)(vb,{initialValues:{massPreAssign:{level:st.Categories,selecteds:e.selecteds,strategy:it.Add,positionsIds:[],positionsCategoriesIds:[]}},isEdit:!1,onSubmit:async n=>{const i=(await s({eventId:e.eventId,massPreAssign:n.massPreAssign})).numberOfMembers;e.onSuccess(t("_1_membres_ont_49355",i)),e.onClose()},children:[(0,i.jsx)(Ib,{heading:t("initialisation_38640"),render:({handleSubmit:e})=>(0,i.jsx)(EM,{handleSubmit:e}),schema:n.massPreAssignStep1Schema()}),(0,i.jsx)(Ib,{heading:t("pr_affectation_68999"),render:t=>t.values.massPreAssign.level===st.Categories?(0,i.jsx)(zM,{change:t.form.change,eventId:e.eventId,handleSubmit:t.handleSubmit,numberOfSelected:e.numberOfSelected,values:t.values}):(0,i.jsx)(RM,{change:t.form.change,eventId:e.eventId,handleSubmit:t.handleSubmit,numberOfSelected:e.numberOfSelected,values:t.values}),schema:n.massPreAssignStep2Schema()})]})})})})},DM=e=>{const t=Xn(),{mutate:n,isLoading:s}=tr(),[o,r]=(0,L.useState)(Pt.WaitingAssignment);return(0,i.jsxs)(au,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Ba,{justify:"center",children:(0,i.jsx)(sC,{color:"primary",icon:"sliders"})}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(Ar,{color:"gray900",fontSize:"textLg",fontWeight:"medium",textAlign:"center",children:t("mettre_jour_l_82143")}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsxs)($u,{label:t("nouveau_statut_57871"),value:o,onChange:e=>{r(e)},children:[(0,i.jsx)("option",{value:Pt.NotApplicable,children:t(Pt.NotApplicable)}),(0,i.jsx)("option",{value:Pt.Refused,children:t(Pt.Refused)}),(0,i.jsx)("option",{value:Pt.WaitingAssignment,children:t(Pt.WaitingAssignment)})]}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsxs)(Ba,{gap:"3",justify:"end",children:[(0,i.jsx)(zl,{isLoading:s,onClick:async()=>{const i=(await n({eventId:e.eventId,massStateUpdate:{selecteds:e.selecteds,state:o}})).numberOfMembers;e.onSuccess(t("le_statut_d_aff_39000",i,t(o))),e.onClose()},children:t("modifier_le_sta_94473")}),(0,i.jsx)(zl,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},PM=e=>{const{translate:t,params:{eventId:n}}=vl(),{organization:s,hasFeature:o}=TI(),{event:r,isEventAdmin:a}=wb(),{canMemberEdit:l,canMemberAccredit:d,canMemberAssign:c}=$S(),{showNotification:u}=Ob(),{mutate:h}=Po(),{mutate:g}=Wo(),{data:p}=Qn("query VolunteerActions($eventId: EventId!) {\n event(id: $eventId) {\n hasDelegations\n hasForms\n }\n}\n",{eventId:n},[]),[f,_]=(0,L.useState)(!1),[x,I]=(0,L.useState)(!1),[v,b]=(0,L.useState)(!1),[j,C]=(0,L.useState)(!1),[y,k]=(0,L.useState)(!1),[A,w]=(0,L.useState)(!1),[S,E]=(0,L.useState)(!1),[T,z]=(0,L.useState)(!1),[O,R]=(0,L.useState)(!1),[$,D]=(0,L.useState)(!1),[P,F]=(0,L.useState)(!1),[M,N]=(0,L.useState)(!1),[B,V]=(0,L.useState)(!1),[U,W]=(0,L.useState)(!1),G=e.massActions.getSelectedsInput(e.predicates,null),H=e.massActions.isAllSelected?e.totalNumberOfMembers:e.massActions.numberOfSelected,q=(0,L.useCallback)(t=>{m(t)&&u(t),e.onMassEditSuccess()},[e.onMassEditSuccess]),K=r.usePositions,Y=r.useAccreditations&&o(Be.Accreditation),Z=r.useDelegations&&o(Be.Delegation),X=r.useCampaigns,J=r.useDocuments;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ar,{css:{flex:"1"}}),l&&(0,i.jsx)(zl,{onClick:()=>{_(!0)},children:t("_diter_un_champ_64621")}),!e.showOnlyMassEdit&&K&&c&&(0,i.jsxs)(km,{children:[(0,i.jsx)(Sm,{children:(0,i.jsx)(Ar,{children:(0,i.jsx)(zl,{color:"white",leftIcon:"wand-magic-sparkles",onClick:()=>{C(!0)}})})}),(0,i.jsx)(wm,{placement:"top",children:t("affecter_1_me_24704",H)})]}),!e.showOnlyMassEdit&&Y&&d&&(0,i.jsxs)(km,{children:[(0,i.jsx)(Sm,{children:(0,i.jsx)(Ar,{children:(0,i.jsx)(zl,{color:"white",leftIcon:"badge-check",onClick:()=>{k(!0)}})})}),(0,i.jsx)(wm,{placement:"top",children:t("accr_diter_1_13773",H)})]}),!e.showOnlyMassEdit&&a&&(0,i.jsxs)(Wd,{children:[(0,i.jsx)(Xd,{children:(0,i.jsx)(zl,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Zd,{maxHeight:400,placement:"bottom-end",children:[(0,i.jsx)(kD,{children:t("gestion_des_mem_51660")}),(0,i.jsx)(Kd,{icon:"merge",onClick:()=>{I(!0)},children:t("fusionner_les_m_37150")}),K&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Xu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(kD,{children:t("affectation_plural")}),(0,i.jsx)(Kd,{icon:"wand-magic-sparkles",onClick:()=>b(!0),children:t("changer_le_stat_39694")}),(0,i.jsx)(Kd,{icon:"wand-magic-sparkles",onClick:()=>E(!0),children:t("pr_affecter_1_62649",H)}),(0,i.jsx)(Kd,{icon:"circle-check",onClick:()=>z(!0),children:t("mettre_jour_l_00128")})]}),(0,i.jsx)(Xu,{color:"gray100",direction:"horizontal"}),(Y||Z)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(kD,{children:t("accr_ditations_39450")}),Y&&(0,i.jsx)(Kd,{icon:"badge-check",onClick:()=>R(!0),children:t("changer_le_stat_27596")}),Z&&(0,i.jsx)(Kd,{icon:"people-group",isDisabled:!p.event?.hasDelegations,onClick:()=>D(!0),children:t("ajouter_1_mem_86218",H)}),(0,i.jsx)(Xu,{color:"gray100",direction:"horizontal"})]}),(0,i.jsx)(kD,{children:t("communication_05277")}),(0,i.jsx)(Kd,{icon:"file-lines",isDisabled:!p.event?.hasForms,onClick:()=>F(!0),children:t("ajouter_1_mem_52947",H)}),(0,i.jsx)(Kd,{icon:"file-lines",isDisabled:!p.event?.hasForms,onClick:()=>N(!0),children:t("marquer_un_form_10633")}),X&&(0,i.jsx)(Kd,{icon:"paper-plane",onClick:()=>V(!0),children:t("SendCampaign")}),J&&(0,i.jsx)(Kd,{icon:"file",onClick:()=>W(!0),children:t("exporter_un_doc_23130")}),(0,i.jsx)(Xu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Kd,{color:"red",icon:"trash-can",onClick:()=>w(!0),children:t("d_sinscrire_de_06416")})]})]}),f&&(0,i.jsx)(vA,{mutate:e=>h({organizationId:s.id,eventId:n,massEdit:e}),organizationId:s.id,selecteds:G,onClose:()=>_(!1),onSuccess:e=>{q(t("_1_membres_ont_07596",e))}}),x&&(0,i.jsx)(zD,{numbersOfSelected:H,organizationId:s.id,usersInfosIds:G.ids||[],onClose:()=>I(!1),onSuccess:q}),v&&(0,i.jsx)(DM,{eventId:n,selecteds:G,onClose:()=>b(!1),onSuccess:q}),j&&(0,i.jsx)(wM,{eventId:n,numberOfSelected:H,selecteds:G,onClose:()=>C(!1),onSuccess:q}),y&&(0,i.jsx)(FA,{eventId:n,numberOfSelected:H,selecteds:G,onClose:()=>k(!1),onSuccess:q}),S&&(0,i.jsx)($M,{eventId:n,numberOfSelected:H,selecteds:G,onClose:()=>E(!1),onSuccess:q}),T&&(0,i.jsx)(_M,{eventId:n,organizationId:s.id,selecteds:G,onClose:()=>z(!1),onSuccess:q}),A&&(0,i.jsx)(cA,{buttonText:t("d_sinscrire_27046"),subtext:[t("_tes_vous_s_r_d_46029")],text:t("d_sinscription_66971",H),onClose:()=>w(!1),onDelete:async()=>{const e=(await g({eventId:n,selecteds:G})).numberOfMembers;q(t("_1_membres_ont_85190",e))}}),O&&(0,i.jsx)(IM,{eventId:n,selecteds:G,onClose:()=>R(!1),onSuccess:q}),P&&(0,i.jsx)(wD,{eventId:n,organizationId:s.id,selecteds:G,onClose:()=>F(!1),onSuccess:q}),M&&(0,i.jsx)(SD,{eventId:n,organizationId:s.id,selecteds:G,onClose:()=>N(!1),onSuccess:q}),$&&(0,i.jsx)(AD,{eventId:n,organizationId:s.id,selecteds:G,onClose:()=>D(!1),onSuccess:q}),B&&(0,i.jsx)(NA,{eventId:n,organizationId:s.id,selecteds:G,onClose:()=>V(!1),onSuccess:q}),U&&(0,i.jsx)(xM,{selecteds:G,onClose:()=>W(!1),onSuccess:e.onMassEditSuccess})]})},FM=e=>{const{params:{organizationId:t,eventId:n}}=vl(),{hasFeature:s}=TI(),o=Zn(Zh),{isEventAdmin:r}=wb(),[a,l]=kz("accreditationMembers.columns",[Kh.Name,Kh.Accreditations]),[d,c]=kz("accreditationMembers.limit",Rc),[u,h]=kz("accreditationMembers.predicates",[]),[m,g]=kz("accreditationMembers.sort",null),{data:p}=nr({organizationId:t,eventId:n,privacy:Ie.All,loadForms:!1,loadSegments:!1}),f=(0,L.useMemo)(()=>p.organization?.customFields.nodes??[],[p.organization]),_=_y(f),x=(0,L.useMemo)(()=>p.event?o.getAccreditationMembersFilters(t,n,f,p.event,{hasDelegations:s(Be.Delegation)}):[],[n,f,p.event]),I=(0,L.useMemo)(()=>o.getAccreditationMembersPossibleColumns(t,f),[t,f]);return(0,i.jsx)(aj,{children:(0,i.jsx)(_m,{columns:a,columnsSearch:[],columnsToIncludes:Yh,eventId:n,filters:x,getMassActionId:e=>e.userInfo.id,limit:d,loadDataList:ar,loadDataListParams:{accreditationCategoryId:e.accreditationCategoryId,accreditationId:e.accreditationId,accreditationSlotId:e.accreditationSlotId,includeCanRegistrationStateUpdate:!1,includeIsEditable:!1},loadRow:or,loadRowParams:{includeCanRegistrationStateUpdate:!1,includeIsEditable:!1},organizationId:t,possibleColumns:I,predicates:u,renderActions:(e,t,n)=>(0,i.jsx)(PM,{massActions:e,predicates:null,showOnlyMassEdit:!0,totalNumberOfMembers:t,onMassEditSuccess:n}),rendering:Gh.List,setColumns:l,setLimit:c,setPredicates:h,setSort:g,showEditColumns:!0,showEditMode:r,showFilters:!0,showMassActions:r,showRowDropdown:r,showRowEdit:r,showSearchColumns:!1,sort:m,children:(0,i.jsx)(Tm,{renderCell:(e,t,s)=>(0,i.jsx)(wk,{canAccredit:!0,canAssign:!0,canChangeDelegation:!0,canClickMemberName:!0,column:e,customField:_.get(e.slug),eventId:n,reloadRow:s,row:t})})})})},MM=e=>{const{params:{organizationId:t,eventId:n,accreditationId:s},translate:o}=vl();Md(e.event.accreditation.name);const r=e=>({organizationId:e?":organizationId":t,eventId:e?":eventId":n,accreditationId:e?":accreditationId":s});return(0,i.jsxs)(dj,{children:[(0,i.jsx)(HF,{accreditation:e.event.accreditation}),(0,i.jsxs)(mj,{css:{flex:"1"},children:[(0,i.jsxs)(uj,{css:{px:"$7"},children:[(0,i.jsx)(cj,{path:is.ACCREDITATION_DASHBOARD(r(!1)),children:o("tableau_de_bord_24627")}),(0,i.jsx)(cj,{path:is.ACCREDITATION_MEMBERS(r(!1)),children:o("membres_125561",e.event.volunteersRegistrations.totalCount)})]}),(0,i.jsx)(hj,{path:is.ACCREDITATION_DASHBOARD(r(!0)),children:(0,i.jsx)(fM,{})}),(0,i.jsx)(hj,{path:is.ACCREDITATION_MEMBERS(r(!0)),children:(0,i.jsx)(FM,{accreditationId:s})})]})]})},NM=()=>{const{params:{organizationId:e,eventId:t,accreditationId:n}}=vl(),{data:s,loader:o}=Qn("query Accreditation($eventId: EventId!, $accreditationId: AccreditationId!) {\n event(id: $eventId) {\n accreditation(id: $accreditationId) {\n id\n name\n assignedResources\n hasSlots\n acronym\n }\n\n volunteersRegistrations(accreditationId: $accreditationId) {\n totalCount\n }\n }\n}\n",{eventId:t,accreditationId:n},[]);return o||(0,i.jsxs)(Sr.dO,{children:[(0,i.jsx)(Sr.qh,{exact:!0,path:is.ACCREDITATION({organizationId:":organizationId",eventId:":eventId",accreditationId:":accreditationId"}),children:(0,i.jsx)(oi,{path:is.ACCREDITATION_DASHBOARD({organizationId:e,eventId:t,accreditationId:n}),replace:!0})}),(0,i.jsx)(Sr.qh,{children:(0,i.jsx)(MM,{event:s.event})})]})},LM=e=>{const t=Xn(),n=e.isEdit?"0px":e.isLeftPanelOpen?"280px":"68px",s=e.isRightPanelOpen?"360px":"68px";return(0,i.jsxs)(hd,{css:{overflow:"hidden"},gridtemplatecolumns:`${n} 1fr ${s}`,gridtemplaterows:"88px 1fr 72px",height:1,width:1,children:[!e.isEdit&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ar,{css:{borderRight:"1px solid $gray200",gridColumn:"1 / 2",gridRow:"1 / 3"},children:e.isLeftPanelOpen&&e.leftPanel}),(0,i.jsx)(Ba,{align:"center",css:{borderRight:"1px solid $gray200",borderTop:"1px solid $gray200",gridColumn:"1 / 2",gridRow:"3 / 4",padding:e.isLeftPanelOpen?"$4":"0"},justify:e.isLeftPanelOpen?"end":"center",children:(0,i.jsxs)(km,{children:[(0,i.jsx)(Sm,{children:(0,i.jsx)(Ar,{children:(0,i.jsx)(zl,{color:"white",leftIcon:"sidebar",onClick:()=>{e.setIsLeftPanelOpen(!e.isLeftPanelOpen)}})})}),(0,i.jsx)(wm,{placement:"top",children:e.isLeftPanelOpen?t("cacher_la_liste_66205"):t("afficher_la_lis_14277")})]})})]}),(0,i.jsx)(Ar,{css:{gridColumn:"2 / 4",gridRow:"1 / 2"},children:e.header}),(0,i.jsx)(Ar,{css:{borderTop:"1px solid $gray200",gridColumn:"2 / 3",gridRow:"2 / 3",overflowY:"auto"},children:e.children}),(0,i.jsx)(Ar,{css:{gridColumn:"2 / 3",gridRow:"3 / 4"},children:e.buttons}),(0,i.jsx)(Ar,{css:{borderLeft:"1px solid $gray200",borderTop:"1px solid $gray200",gridColumn:"3 / 4",gridRow:"2 / 4",overflowY:"auto"},children:e.isRightPanelOpen?e.rightPanel:(0,i.jsx)(Ba,{css:{paddingTop:"$6"},height:1,justify:"center",width:1,children:(0,i.jsxs)(km,{children:[(0,i.jsx)(Sm,{children:(0,i.jsx)(Ar,{color:"gray800",css:{cursor:"pointer"},fontSize:"textLg",onClick:()=>{e.setIsRightPanelOpen(!0)},children:(0,i.jsx)(nl,{icon:"sidebar"})})}),(0,i.jsx)(wm,{placement:"top",children:t("afficher_les_in_82197")})]})})})]})},BM=e=>{const{history:t,translate:n,params:{organizationId:s,eventId:o,userInfoId:r}}=vl(),a=Zn(Jc),l=(0,L.useMemo)(()=>e.teams.find(t=>t.leaderUserInfoId===e.userInfo.id),[e.teams,e.userInfo]),d=(0,L.useMemo)(()=>e.teams.flatMap(e=>e.members.flatMap(e=>e.userInfo.id===r?[]:[e.userInfo])),[e.teams]);return(0,i.jsxs)(Ba,{align:"center",css:{padding:"$5 $6"},gap:"4",children:[(0,i.jsxs)(Ar,{css:{position:"relative"},children:[(0,i.jsx)(sp,{email:e.userInfo.email,image:e.userInfo.picture?.url,name:e.userInfo.name,size:32}),(0,i.jsx)(Ba,{align:"center",css:{background:xr.colors[`${e.badgeColorIcon.color}100`].value,border:"2px solid white",borderRadius:"16px",bottom:"-6px",color:xr.colors[`${e.badgeColorIcon.color}700`].value,fontSize:"8px",position:"absolute",right:"-6px"},height:16,justify:"center",width:16,children:(0,i.jsx)(nl,{icon:e.badgeColorIcon.leftIcon})})]}),(0,i.jsxs)(Ba,{css:{flex:"1"},direction:"column",children:[(0,i.jsxs)(Ba,{align:"center",gap:"2",children:[(0,i.jsx)(el,{to:QI.MEMBER_INFORMATION({organizationId:s,eventId:o,userInfoId:r}),children:(0,i.jsx)(Ar,{css:{cursor:"pointer","&:hover":{textDecoration:"underline"}},font:"gray900 textXl medium",children:e.userInfo.name})}),(0,i.jsxs)(Ar,{color:"gray500",children:["(",e.userInfo.email,")"]}),e.showTeam&&l&&(0,i.jsx)(rc,{leftIcon:"shield",children:n("chef_d_quipe_20641")})]}),(0,i.jsxs)(Ba,{align:"center",gap:"2",children:[(0,i.jsx)(Ar,{color:"gray500",children:a.toLocaleString(e.insertedAt,eo.DateOnly.MonthLong)}),e.showTeam&&so(e.teams)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ar,{color:"gray500",children:"•"}),(0,i.jsx)(Ar,{color:"gray500",children:n("_quipe_1_07445",e.teams[0].teamCode)}),(0,i.jsx)(Ar,{color:"gray500",children:"•"}),(0,i.jsx)(jk,{teamMembers:d})]})]})]}),e.showTabs&&(0,i.jsx)(Ar,{width:320,children:(0,i.jsxs)(eb,{selectedItem:e.isPreAssign?"preassign":"affect",onChange:n=>{"preassign"!==n||e.isPreAssign?"affect"===n&&e.isPreAssign&&t.replace(Ps.ASSIGNMENT(s,o,r)):t.replace(Ps.PRE_ASSIGNMENT(s,o,r))},children:[(0,i.jsx)(tb,{item:"affect",children:n("affecter_94255")}),(0,i.jsx)(tb,{item:"preassign",children:n("pr_affecter_17434")})]})})]})},VM=e=>{const t=Xn(),n=Zn(Jc);return(0,i.jsxs)(Ba,{align:"center",css:{background:e.isSelected?"$primary100":"white",borderBottom:e.displayBorder?"1px solid $gray200":"none",cursor:"pointer",padding:"$4","&:hover":{background:"$primary100"}},gap:"3",onClick:e.onClick,children:[(0,i.jsx)(sp,{email:e.vr.userInfo.email,image:e.vr.userInfo.picture?.url,name:e.vr.userInfo.name,size:40}),(0,i.jsxs)(Ba,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(Ar,{font:"gray800 textSm semiBold",children:e.vr.userInfo.name}),(0,i.jsx)(Ar,{children:t("inscrit_le_1_12018",n.toLocaleString(e.vr.insertedAt,eo.DateOnly.MonthLong))})]})]})},UM=()=>(0,i.jsxs)(Ba,{align:"center",css:{borderBottom:"1px solid $gray200",padding:"$4"},gap:"3",children:[(0,i.jsx)(lc,{size:40,variant:"circular"}),(0,i.jsxs)(Ba,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(lc,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(lc,{borderRadius:"$1",height:20,width:1})]})]}),WM=e=>{const{history:t,params:{organizationId:n,eventId:s},translate:o}=vl(),r=e.event?.delegations?.nodes??[],a=e.event?.segmentsFolders??[],l=e.event?.volunteersRegistrations.totalCount??0,d=e.event?.volunteersRegistrations.nodes??[];return(0,i.jsxs)(Ba,{direction:"column",height:1,width:1,children:[(0,i.jsxs)(Ba,{css:{padding:"$5 $4"},direction:"column",gap:"2",children:[(0,i.jsx)(Sj,{color:"primary",returnPathFallback:is.ACCREDITATIONS({organizationId:n,eventId:s}),children:o("retour_92202")}),(0,i.jsxs)(Ba,{align:"center",gap:"2",children:[(0,i.jsx)(Ar,{font:"gray900 textLg medium",children:o("affectation_plural")}),(0,i.jsx)(rc,{color:"error",size:"sm",children:o("profil_restant",l)})]})]}),(0,i.jsxs)(Ba,{css:{px:"$4"},gap:"4",children:[(0,i.jsx)(Ar,{css:{flex:"1"},children:(0,i.jsx)(Bl,{icon:"magnifying-glass",placeholder:o("rechercher_50038"),value:e.name,onChange:e.setName})}),(0,i.jsxs)(Wd,{doNotCloseOnOtherOpen:!0,children:[(0,i.jsx)(Xd,{children:(0,i.jsx)(zl,{color:"white",leftIcon:"bars-filter"})}),(0,i.jsx)(Zd,{css:{padding:"0"},placement:"bottom",children:(0,i.jsxs)(Ba,{css:{padding:"$4 $6"},direction:"column",gap:"4",width:320,children:[(0,i.jsx)(Ar,{font:"gray800 textMd medium",children:o("liste_des_filtr_75605")}),(0,i.jsxs)($u,{label:o("date_d_inscript_31369"),value:e.direction,onChange:e.setDirection,children:[(0,i.jsx)("option",{value:yt.Desc,children:o("du_plus_r_cent_76468")}),(0,i.jsx)("option",{value:yt.Asc,children:o("du_plus_ancien_08999")})]}),(0,i.jsxs)(Ba,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(Ml,{children:o("vue_personnalis_97654")}),e.isLoading?(0,i.jsx)(lc,{borderRadius:"$1",height:40,width:1}):(0,i.jsx)(yc,{isSearchVisible:!0,multiple:!1,renderOnPortal:!0,values:[e.segmentId],onChange:t=>{so(t)?e.setSegmentId((0,lu.A)(t)):e.setSegmentId(-1)},children:a.map(e=>(0,i.jsx)("optgroup",{label:e.name,children:e.segments.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},e.id))})]}),e.showStates&&(0,i.jsxs)(yc,{isSelectAllVisible:!0,label:o("status_d_affect_75769"),multiple:!0,values:e.states,onChange:e.setStates,children:[(0,i.jsx)("option",{value:Pt.WaitingAssignment,children:o(Pt.WaitingAssignment)}),(0,i.jsx)("option",{value:Pt.PreAssigned,children:o(Pt.PreAssigned)}),(0,i.jsx)("option",{value:Pt.Assigned,children:o(Pt.Assigned)})]}),e.showAccreditationStates&&(0,i.jsxs)(yc,{isSelectAllVisible:!0,label:o("statut_d_accr_d_75527"),multiple:!0,values:e.accreditationStates,onChange:e.setAccreditationStates,children:[(0,i.jsx)("option",{value:le.WaitingAccreditation,children:o(le.WaitingAccreditation)}),(0,i.jsx)("option",{value:le.AutoAccredited,children:o(le.AutoAccredited)}),(0,i.jsx)("option",{value:le.Accredited,children:o(le.Accredited)})]}),e.loadDelegations&&(0,i.jsxs)(Ba,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(Ml,{children:o("Delegation")}),e.isLoading?(0,i.jsx)(lc,{borderRadius:"$1",height:40,width:1}):(0,i.jsx)(yc,{isSearchVisible:!0,multiple:!1,renderOnPortal:!0,values:e.delegationId?[e.delegationId]:[],onChange:t=>{so(t)?e.setDelegationId((0,lu.A)(t)):e.setDelegationId(null)},children:r.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})]})]})})]})]}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(Ba,{css:{flex:"1",overflowY:"auto"},direction:"column",children:e.isLoading?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(UM,{}),(0,i.jsx)(UM,{}),(0,i.jsx)(UM,{})]}):d.map(n=>(0,i.jsx)(VM,{displayBorder:!0,isSelected:n.userInfo.id===e.userInfoId,vr:n,onClick:()=>{t.push(e.getPath(n.userInfo.id))}},n.userInfo.id))})]})},GM=e=>{const[t,n]=L.useState(e.isOpen??!0),s=L.useCallback(t=>{e.setIsOpen?.(t),n(t)},[e.setIsOpen,n]);return L.useEffect(()=>{"boolean"==typeof e.isOpen&&n(e.isOpen)},[e.isOpen]),(0,i.jsxs)(Ba,{css:{borderTop:"1px solid $gray200",padding:"$6",...e.css},direction:"column",gap:"4",children:[(0,i.jsxs)(Ba,{align:"center",css:{cursor:"pointer",userSelect:"none",...e.titleCss},gap:"4",onClick:()=>{s(!t)},children:[(0,i.jsx)(Ar,{color:"gray500",fontSize:"textXs",children:(0,i.jsx)(nl,{icon:t?"chevron-down":"chevron-right"})}),(0,i.jsx)(Ba,{css:{color:"$gray800",flex:"1",fontWeight:"$semiBold"},children:e.title})]}),t&&e.children]})},HM=e=>{const t=Xn(),n=Zn(Jc),[s,o]=kz("assignment.rightPanel.areAccreditationsOpen",!0),r=(0,L.useMemo)(()=>function(e,t,n,i){return e.flatMap(e=>e.accreditationsSlots.map(e=>{const s=Dh(t,e,e.accreditation.name,{defaultName:"-"});return{name:e.accreditation.name,subtitle:s,path:is.ACCREDITATION({organizationId:n,eventId:i,accreditationId:e.accreditation.id})}}))}(e.formsUsersInfos,n,e.organizationId,e.eventId),[e.formsUsersInfos,e.organizationId,e.eventId]);return(0,i.jsx)(GM,{isOpen:s,setIsOpen:o,title:t("accr_ditations_74375"),children:(0,i.jsxs)(Sc,{children:[(0,i.jsx)(kc,{children:(0,i.jsx)(Gc,{children:t("accr_ditation_s_00595")})}),r.map((e,t)=>(0,i.jsx)(Mc,{children:(0,i.jsxs)(Oc,{align:"start",direction:"column",gap:"1",justify:"center",children:[(0,i.jsx)(Ar,{color:"gray900",fontWeight:"medium",children:e.name}),(0,i.jsx)(Ar,{color:"gray500",children:e.subtitle})]})},t))]})})},qM=e=>{const t=Zn(Jc);return(0,i.jsxs)(Ba,{direction:"column",gap:"1",children:[(0,i.jsxs)(Ba,{justify:"between",children:[(0,i.jsx)(Ar,{font:"gray800 textXs medium",children:e.comment.writtenBy.userInfo.name}),(0,i.jsx)(Ar,{font:"gray500 textXs regular",children:t.toLocaleString(e.comment.insertedAt,{...eo.DateTime,month:"numeric"})})]}),(0,i.jsx)(Ba,{css:{background:"$gray100",bd:!0,borderTopLeftRadius:"0",padding:"$2 $3",whiteSpace:"pre-wrap"},children:e.comment.content})]})},KM=()=>{const{translate:e,params:{organizationId:t,eventId:n,userInfoId:s}}=vl(),{data:o,isLoading:r,reload:a}=Sa({organizationId:t,userInfoId:s}),{mutate:l,isLoading:d}=wa(),[c,u]=(0,L.useState)(""),{permissions:[h]}=fk(dk({organizationId:t,eventId:n,userInfoId:s}));return(0,i.jsxs)(Ba,{css:{padding:"0 $6 $4 $6"},direction:"column",gap:"3",children:[r?(0,i.jsx)(lc,{borderRadius:"$1",height:40,variant:"rectangular",width:1}):o.organization.userInfo.comments.map(e=>(0,i.jsx)(qM,{comment:e},e.id)),h&&(0,i.jsxs)(Lb,{children:[(0,i.jsx)(Bb,{children:(0,i.jsx)(zl,{color:"invisible",leftIcon:"plus",children:e("ajouter_un_comm_27671")})}),(0,i.jsxs)(Nb,{children:[(0,i.jsx)(Mb,{icon:"message",children:e("ajouter_un_comm_27671")}),(0,i.jsx)(Fb,{children:(0,i.jsx)(Zm,{label:e("commentaire_08754"),value:c,onChange:u})}),(0,i.jsx)(Pb,{children:o=>(0,i.jsx)(zl,{disabled:g(c),isLoading:d,onClick:async()=>{await l({organizationId:t,eventId:n,userInfoId:s,comment:{content:c}}),a(),o()},children:e("ajouter_97327")})})]})]})]})},YM=e=>{const t=Xn(),[n,s]=kz("assignment.rightPanel.areInformationsOpen",!0);return(0,i.jsxs)(GM,{isOpen:n,setIsOpen:s,title:e.title,children:[(0,i.jsxs)(Ba,{direction:"column",gap:"1",children:[(0,i.jsx)(Hz,{children:t("Email")}),(0,i.jsx)(Ar,{color:"gray500",css:{ellipsis:!0,fontSize:"$textMd","@tablet":{fontSize:"$textSm"}},children:e.userInfo.email})]}),e.customFields.map(t=>(0,i.jsx)(qz,{field:t,fields:e.userInfo.fields},t.id)),e.formsIds.map(n=>{const s=Kz(n,t);return m(e.userInfo.fields[s.slug])?(0,i.jsx)(qz,{field:s,fields:e.userInfo.fields},s.slug):null})]})},ZM=e=>{const t=Xn(),n=Zn(ph),[s,o]=kz("assignment.rightPanel.arePositionsOpen",!0),r=(0,L.useMemo)(()=>Hk(e.formsUsersInfos,n,e.organizationId,e.eventId),[e.formsUsersInfos,e.organizationId,e.eventId]);return(0,i.jsx)(GM,{isOpen:s,setIsOpen:o,title:t("missions_souhai_23225"),children:(0,i.jsxs)(Sc,{children:[(0,i.jsx)(kc,{children:(0,i.jsx)(Gc,{children:t("mission_souhait_49168")})}),r.map((e,n)=>(0,i.jsx)(Mc,{children:(0,i.jsxs)(Oc,{align:"start",direction:"column",gap:"1",justify:"center",children:[(0,i.jsxs)(Ba,{align:"center",gap:"2",children:[(0,i.jsx)(Ar,{color:"gray900",fontWeight:"medium",children:e.name}),e.form.positionRanking===Ke.Ranked&&(0,i.jsx)(rc,{children:t("choix_n_1_00613",e.rank)})]}),(0,i.jsx)(Ar,{color:"gray500",children:e.range})]})},n))]})})},XM=e=>{const t=Xn(),n=Zn(Jc),s=Zn(ph),[o,r]=kz("assignment.rightPanel.areAvailabilitiesOpen",!0),a=(0,L.useMemo)(()=>(0,uc.A)(e.formsUsersInfos.flatMap(e=>e.slots.map(t=>({display:e.form.slotDisplay,slot:t}))),({slot:e})=>e.range.start.toMillis()).map(({display:e,slot:t})=>e===It.Calendar||e===It.DisplayDays?n.toLocaleString(t.range.start,eo.DateOnly.MonthLong):s.toDisplayString(t.range)),[n,s,e.formsUsersInfos]);return(0,i.jsx)(GM,{isOpen:o,setIsOpen:r,title:t("disponibilit_s_49923"),children:(0,i.jsxs)(Sc,{children:[(0,i.jsx)(kc,{children:(0,i.jsx)(Gc,{children:t("disponibilit_92461")})}),a.map((e,t)=>(0,i.jsx)(Mc,{children:(0,i.jsx)(Oc,{children:(0,i.jsx)(Ar,{color:"gray900",fontWeight:"medium",children:e})})},t))]})})},JM=e=>{const t=Xn(),n=(0,L.useMemo)(()=>e.formsUsersInfos.map(e=>e.form.id),[e.formsUsersInfos]);return(0,i.jsxs)(Ba,{direction:"column",height:1,width:1,children:[(0,i.jsxs)(Ba,{align:"center",css:{padding:"$6"},gap:"3",children:[(0,i.jsxs)(km,{children:[(0,i.jsx)(Sm,{children:(0,i.jsx)(Ar,{color:"gray800",css:{cursor:"pointer"},fontSize:"textLg",onClick:e.onCollapse,children:(0,i.jsx)(nl,{icon:"sidebar"})})}),(0,i.jsx)(wm,{placement:"top",children:t("cacher_les_info_51832")})]}),(0,i.jsx)(Ar,{font:"gray900 textMd semiBold",children:t("_propos_de_1_50761",e.userInfo.name)})]}),(0,i.jsx)(KM,{}),(0,i.jsx)(YM,{customFields:e.customFields,formsIds:n,title:t("informations_22954"),userInfo:e.userInfo}),(0,i.jsx)(XM,{formsUsersInfos:e.formsUsersInfos}),e.showWishedPositions&&(0,i.jsx)(ZM,{eventId:e.eventId,formsUsersInfos:e.formsUsersInfos,organizationId:e.organizationId}),e.showWishedAccreditations&&(0,i.jsx)(HM,{eventId:e.eventId,formsUsersInfos:e.formsUsersInfos,organizationId:e.organizationId})]})},QM=L.createContext({}),eN=e=>{const[t,n]=L.useState(e.accreditationsSlotsIds);return(0,i.jsx)(QM.Provider,{value:{accreditationsSlotsIds:t,isEdit:e.isEdit,showNextMember:e.showNextMember,setAccreditationsSlotsIds:n},children:e.children})};function tN(){return L.useContext(QM)}const nN=e=>{const{history:t,params:{organizationId:n,eventId:s},translate:o}=vl(),{accreditationsSlotsIds:r,showNextMember:a}=tN(),{mutate:l,isLoading:d}=Jo(),{mutate:c,isLoading:u}=yo(),h=(0,L.useCallback)(()=>{e.isEdit?t.goBack(Ps.VOLUNTEERS(n,s)):a()},[e.isEdit,a]);return(0,i.jsxs)(Ba,{align:"center",css:{borderTop:"1px solid $gray200",px:"$7"},gap:"4",height:1,justify:"end",width:1,children:[(0,i.jsx)(Ar,{color:"error700",css:{cursor:"pointer"},onClick:async()=>{u||d||(await l({eventId:s,massStateUpdate:{selecteds:{ids:[e.userInfoId]},state:le.Refused}}),h())},children:o("refuser_92819")}),(0,i.jsx)(Ar,{css:{flex:"1"}}),(0,i.jsx)(zl,{color:"primary",isLoading:u,onClick:async()=>{u||d||(so(r)?await c({eventId:s,massAccredit:{accreditationsSlotsIds:r,selecteds:{ids:[e.userInfoId]},strategy:it.Replace}}):await l({eventId:s,massStateUpdate:{selecteds:{ids:[e.userInfoId]},state:le.WaitingAccreditation}}),h())},children:e.isEdit?o("mettre_jour_l_11622"):o("accr_diter_70543")}),(0,i.jsx)(zl,{color:"white",onClick:h,children:e.isEdit?o("annuler_48254"):o("accr_diter_plus_19053")})]})},iN=({slots:e})=>{const{accreditationsSlotsIds:t,setAccreditationsSlotsIds:n}=tN(),{minDate:s,maxDate:o,numberOfMonths:r}=(0,L.useMemo)(()=>Fh(e),[e]),a=(0,L.useMemo)(()=>e.flatMap(e=>e.date?.isValid&&t.includes(e.id)?[e.date]:[]),[e,t]),l=(0,L.useMemo)(()=>e.flatMap(e=>e.isBlocked?[e.date]:[]),[e]);return(0,i.jsx)(Ba,{css:{background:"$gray50",borderTop:"1px solid $gray200",padding:"$4"},gap:"4",wrap:"wrap",children:(0,Dc.A)(0,r).map(d=>{const c=s.plus({month:d}).startOf("month"),u=0===d?s:c,h=d===r-1?o:c.endOf("month"),m=a.filter(e=>e.startOf("month").equals(c));return(0,i.jsx)(SA,{disabledDates:l,firstDayOfMonth:c,max:h,min:u,values:m,onChange:i=>{n(Mh(t,e,c,i))}},d)})})},sN=e=>{const t=Zn(Jc),n=Zn(Vv),{accreditationsSlotsIds:s,setAccreditationsSlotsIds:o}=tN(),r=(0,L.useMemo)(()=>Nh(e.slots),[e.slots]),a=(0,L.useCallback)(t=>{e.isRadio?o([...(0,hc.A)(s,...r.map(e=>e.id)),t]):o(ao(s,t))},[e.isRadio,r,s,o]);return(0,i.jsx)(Ba,{direction:"column",children:r.map(o=>{const r=s.includes(o.id)?"checked":"unchecked",l=e.delegationAccreditations?.find(e=>e.accreditationSlotId===o.id),{assignedResources:d,isMaxedOut:c,limitIcon:u,maxResources:h,percent:m}=mM(l,o),g=void 0!==m?(d+(s.includes(o.id)?1:0))/h:void 0;return(0,i.jsxs)(Ba,{css:{borderTop:"1px solid $gray200",padding:"$4 $6"},children:[(0,i.jsx)(Ar,{css:{flex:"1"},children:e.isRadio?(0,i.jsx)(vc,{disabled:c&&"unchecked"===r,state:r,onClick:()=>{a(o.id)},children:(0,i.jsx)(Ar,{css:{textTransform:"capitalize"},children:Dh(t,o,"",{date:{localeFormat:eo.DateOnly.WeekdayLongMonthLong}})})}):(0,i.jsx)(_c,{disabled:o.isBlocked||c&&"unchecked"===r,state:r,onClick:()=>{a(o.id)},children:(0,i.jsx)(Ar,{css:{textTransform:"capitalize"},children:Dh(t,o,"",{date:{localeFormat:eo.DateOnly.WeekdayLongMonthLong}})})})}),(0,i.jsx)(Ya,{width:"2"}),(0,i.jsx)(Ar,{color:"gray700",css:{marginBlockStart:"2px"},fontSize:"textXs",children:(0,i.jsx)(nl,{icon:"user-group"})}),(0,i.jsx)(Ya,{width:"1"}),(0,i.jsxs)(Ar,{color:"gray700",children:[d+(s.includes(o.id)?1:0),"/",n.toNumberOrInfinity(h)]}),(0,i.jsx)(Ya,{width:"2"}),(0,i.jsx)(Ar,{color:"gray400",textAlign:"center",children:h!==1/0&&(0,i.jsxs)(i.Fragment,{children:["[",u,"]"]})}),(0,i.jsx)(Ya,{width:"6"}),(0,i.jsx)(Ar,{css:{marginTop:"auto",marginBottom:"auto"},width:120,children:void 0!==m&&(0,i.jsx)(Ow,{percent:m,prospectivePercent:g})}),(0,i.jsx)(Ya,{width:"3"}),(0,i.jsx)(Ar,{color:"gray700",textAlign:"end",width:36,children:void 0!==(g??m)&&(0,i.jsxs)(i.Fragment,{children:[Math.min(100,Math.round(100*(g??m))),"%"]})})]},o.id)})})},oN=({accreditation:e,delegationAccreditations:t,slots:n})=>{const{translate:s}=vl(),o=Zn(Vv),{accreditationsSlotsIds:r,setAccreditationsSlotsIds:a}=tN(),[l,d]=L.useState(!0),c=L.useMemo(()=>n.map(e=>e.id),[n]),u=L.useMemo(()=>n.every(e=>r.includes(e.id)),[n,r]),h=e.accreditationDisplay,m=e.hasSlots,g=n[0],p=L.useMemo(()=>t?.find(e=>e.accreditationSlotId===g.id),[e,t,g]),{assignedResources:f,isMaxedOut:_,limitIcon:x,maxResources:I,percent:v}=mM(p,g),b=I!==1/0?r.length/I:void 0,j=r.includes(g.id)?"checked":"unchecked",C=L.useCallback(e=>{Dl(e),a(u?(0,mc.A)(r,c):(0,Bs.A)(r.concat(c)))},[c,r,u,a]),y=L.useCallback(e=>{Dl(e),a((0,mc.A)(r,c))},[c,r,a]);return(0,i.jsxs)(Ba,{css:{background:"white",bd:!0,overflow:"hidden"},direction:"column",children:[(0,i.jsxs)(Ba,{align:"center",css:{cursor:"pointer",padding:"$4 $6",userSelect:"none"},width:1,onClick:()=>{_||(m?d(!l):a(ao(r,g.id)))},children:[m?(0,i.jsx)(nl,{icon:l?"chevron-down":"chevron-right"}):(0,i.jsx)(fc,{disabled:_,shouldPreventDefault:!1,state:j,onClick:td.A}),(0,i.jsx)(Ya,{width:"4"}),(0,i.jsx)(WC,{color:e.color,icon:e.icon}),(0,i.jsx)(Ya,{width:"3"}),(0,i.jsxs)(Ba,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(Ar,{color:"gray800",fontWeight:"semiBold",children:e.name}),m&&(0,i.jsx)(Ar,{color:"gray500",children:s("creneau",n.length)})]}),m?h===ie.List?(0,i.jsx)(zl,{color:"invisible",onClick:C,children:s(u?"tout_d_s_lectio_37372":"tout_s_lectionn_48027")}):h===ie.Radio?(0,i.jsx)(zl,{color:"invisible",onClick:y,children:s("r_initialiser_77538")}):null:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{width:"2"}),(0,i.jsx)(Ar,{color:"gray700",fontSize:"textXs",children:(0,i.jsx)(nl,{icon:"user-group"})}),(0,i.jsx)(Ya,{width:"2"}),(0,i.jsxs)(Ar,{color:"gray700",children:[f+(r.includes(n[0].id)?1:0),"/",o.toNumberOrInfinity(I)]}),(0,i.jsx)(Ya,{width:"2"}),(0,i.jsx)(Ar,{color:"gray400",textAlign:"center",children:I!==1/0&&(0,i.jsxs)(i.Fragment,{children:["[",x,"]"]})}),(0,i.jsx)(Ya,{width:"6"}),(0,i.jsx)(Ar,{css:{marginBlock:"auto"},width:120,children:void 0!==v&&(0,i.jsx)(Ow,{percent:v||0,prospectivePercent:b})}),(0,i.jsx)(Ya,{width:"3"}),(0,i.jsx)(Ar,{color:"gray700",textAlign:"end",width:36,children:void 0!==v&&(0,i.jsxs)(i.Fragment,{children:[Math.min(100,Math.round(100*v)),"%"]})})]})]}),m&&l?e.accreditationDisplay===ie.Calendar?(0,i.jsx)(iN,{slots:n}):(0,i.jsx)(sN,{delegationAccreditations:t?.filter(t=>t.accreditationId===e.id),isRadio:h===ie.Radio,slots:n}):null]})},rN=({delegation:e,slots:t})=>{const n=(0,L.useMemo)(()=>(0,uc.A)(Object.values((0,cc.A)(t,e=>e.accreditation.id)),e=>[$C(e[0].accreditation.index),e[0].accreditation.name.toLowerCase()]),[t]);return(0,i.jsx)(Ba,{css:{background:"$gray100",borderTop:"1px solid ^$gray200",padding:"$4"},direction:"column",gap:"2",children:n.map(t=>{const n=t[0].accreditation,s=e?.accreditationsSlots.filter(e=>e.accreditationSlot.accreditation.id===n.id&&void 0!==e.maxResources);return(0,i.jsx)(oN,{accreditation:n,delegationAccreditations:so(s)?s:void 0,slots:t},n.id)})})},aN=({category:e,delegation:t,slots:n})=>{const[s,o]=(0,L.useState)(!0);return(0,i.jsxs)(Ba,{css:{bd:!0,overflow:"hidden"},direction:"column",children:[(0,i.jsxs)(Ba,{align:"center",css:{background:"white",cursor:"pointer",padding:"$4",userSelect:"none"},gap:"1",onClick:()=>{o(!s)},children:[(0,i.jsx)(Ba,{align:"center",css:{fontSize:"$textXs"},height:32,justify:"center",width:32,children:(0,i.jsx)(nl,{icon:s?"chevron-down":"chevron-right"})}),(0,i.jsx)(Ar,{font:"gray800 textMd medium",children:e.name})]}),s&&(0,i.jsx)(rN,{delegation:t,slots:n})]})},lN=({accreditationsSlots:e,delegation:t})=>{const n=(0,L.useMemo)(()=>(0,uc.A)(Object.values((0,cc.A)(e,e=>e.accreditationCategory.id)),e=>e[0].accreditationCategory.name.toLowerCase()),[e]);return(0,i.jsx)(Ba,{direction:"column",gap:"4",width:1,children:n.map(e=>{const n=e[0].accreditationCategory;return(0,i.jsx)(aN,{category:n,delegation:t,slots:e},n.id)})})},dN=e=>{const t=Xn(),n=Zn(Jc),s=(0,L.useMemo)(()=>(e.accreditationsCategoriesIds||[]).map(t=>e.event.accreditationsCategories.find(e=>e.id===t).name).join(", "),[e.accreditationsCategoriesIds,e.event]),o=(0,L.useMemo)(()=>(e.accreditationsIds||[]).map(t=>e.event.accreditations.nodes.find(e=>e.id===t).name).join(", "),[e.accreditationsIds,e.event]),r=(0,L.useMemo)(()=>e.date?n.toLocaleString(e.date,eo.DateOnly.MonthLong):"",[e.date]),a=(0,L.useMemo)(()=>e.segmentId?e.event.segments.find(t=>t.id===e.segmentId).name:"",[e.segmentId,e.event]),l=(0,L.useMemo)(()=>(e.tagsIds||[]).map(t=>e.organization.tags.nodes.find(e=>e.id===t).name).join(", "),[e.tagsIds,e.organization]);return m(s)||m(o)||m(r)||m(a)||m(l)||e.excludeFull||e.excludePast?(0,i.jsxs)(Ba,{align:"center",gap:"3",wrap:"wrap",children:[m(s)&&(0,i.jsx)(rc,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setAccreditationsCategoriesIds([])},children:t("cat_gories_1_42029",s)}),m(o)&&(0,i.jsx)(rc,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setAccreditationsIds([])},children:t("accr_ditations_30765",o)}),m(r)&&(0,i.jsx)(rc,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setDate(null)},children:t("date_1_17337",r)}),m(a)&&(0,i.jsx)(rc,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setSegmentId(null)},children:t("vue_1_29260",a)}),m(l)&&(0,i.jsx)(rc,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setTagsIds([])},children:t("tags_1_43158",l)}),e.excludeFull&&(0,i.jsx)(rc,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setExcludeFull(!1)},children:t("cr_neaux_comple_77561")}),e.excludePast&&(0,i.jsx)(rc,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setExcludePast(!1)},children:t("cr_neaux_dans_l_92999")}),(0,i.jsx)(Ar,{css:{cursor:"pointer"},font:"gray700 textXs medium",onClick:e.reset,children:t("r_initialiser_l_66835")})]}):null},cN=e=>{const t=Xn(),[n,s]=(0,L.useState)(e.accreditationsCategoriesIds),[o,r]=(0,L.useState)(e.accreditationsIds),[a,l]=(0,L.useState)(e.date),[d,c]=(0,L.useState)(e.tagsIds),[u,h]=(0,L.useState)(e.segmentId?[e.segmentId]:[]),[m,g]=(0,L.useState)(e.excludeFull?"checked":"unchecked"),[p,f]=(0,L.useState)(e.excludePast?"checked":"unchecked");return(0,i.jsxs)(Ba,{direction:"column",onChange:e=>{e.nativeEvent.stopImmediatePropagation(),e.stopPropagation()},children:[(0,i.jsxs)(Ba,{css:{padding:"$2 $6 $4 $6"},direction:"column",gap:"4",children:[(0,i.jsx)(Ar,{font:"gray800 textMd medium",children:t("liste_des_filtr_75605")}),(0,i.jsx)(yc,{isSearchVisible:!0,multiple:!0,placeholder:t("s_lectionnez_de_97056"),renderOnPortal:!0,values:n||[],onChange:s,children:e.event.accreditationsCategories.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(yc,{isSearchVisible:!0,multiple:!0,placeholder:t("s_lectionnez_de_92029"),renderOnPortal:!0,values:o||[],onChange:r,children:e.event.accreditations.nodes.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(Mu,{max:e.event.endAt,min:e.event.startAt,placeholder:t("date_du_cr_neau_82295"),value:a,onChange:l}),(0,i.jsx)(yc,{isSearchVisible:!0,placeholder:t("s_lectionnez_un_19794"),renderOnPortal:!0,values:u,onChange:e=>{so(e)?h([(0,lu.A)(e)]):h([])},children:e.event.segments.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(yc,{isSearchVisible:!0,multiple:!0,placeholder:t("s_lectionnez_de_73255"),renderOnPortal:!0,values:d||[],onChange:c,children:e.organization.tags.nodes.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(_c,{state:m,onClick:g,children:t("masquer_les_cr_14425")}),(0,i.jsx)(_c,{state:p,onClick:f,children:t("masquer_les_cr_05336")})]}),(0,i.jsxs)(Ba,{align:"center",css:{brderTop:"1px solid $gray200",padding:"$4 $6 $2 $6"},gap:"4",justify:"end",children:[(0,i.jsx)(Ar,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{e.reset(),e.close()},children:t("r_initialiser_77538")}),(0,i.jsx)(zl,{size:"sm",onClick:()=>{e.setAccreditationsCategoriesIds(n),e.setAccreditationsIds(o),e.setDate(a),e.setExcludeFull("checked"===m),e.setExcludePast("checked"===p),e.setSegmentId(so(u)?u[0]:null),e.setTagsIds(d),e.close()},children:t("appliquer_05753")})]})]})},uN=e=>{const t=Xn(),[n,s]=(0,L.useState)(!1),o=(0,L.useCallback)(()=>{e.setAccreditationsCategoriesIds([]),e.setAccreditationsIds([]),e.setDate(null),e.setExcludeFull(!1),e.setExcludePast(!1),e.setSegmentId(null),e.setTagsIds([])},[e.setAccreditationsCategoriesIds,e.setAccreditationsIds,e.setDate,e.setExcludeFull,e.setExcludePast,e.setSegmentId,e.setTagsIds]);return(0,i.jsxs)(Ba,{direction:"column",gap:"3",width:1,children:[(0,i.jsxs)(Ba,{gap:"3",children:[(0,i.jsx)(Bl,{icon:"magnifying-glass",placeholder:t("rechercher_une_65646"),value:e.name,onChange:e.setName}),(0,i.jsxs)(Wd,{doNotCloseOnOtherOpen:!0,isOpen:n,onStateChange:s,children:[(0,i.jsx)(Xd,{children:(0,i.jsx)(Ar,{children:(0,i.jsx)(zl,{color:"white",leftIcon:"bars-filter",children:t("filtres_64574")})})}),(0,i.jsx)(Zd,{placement:"bottom-end",width:385,children:(0,i.jsx)(cN,{...e,close:()=>{s(!1)},reset:o})})]})]}),(0,i.jsx)(dN,{...e,reset:o})]})},hN=({event:e,organization:t})=>{const{eventId:n}=ti(),[s,o,r]=Wc(""),[a,l]=kz("accredit.filters.accreditationsCategoriesIds",null),[d,c]=kz("accredit.filters.accreditationsIds",null),[u,h]=kz("accredit.filters.date",null),[g,p]=kz("accredit.filters.tagsIds",null),[f,_]=kz("accredit.filters.segmentId",null),[x,I]=kz("accredit.filters.excludeFull",!1),[v,b]=kz("accredit.filters.excludePast",!1),{data:j,loader:C}=Qn("query AccreditSlots(\n $eventId: EventId!\n $name: String\n $accreditationCategoriesIds: [AccreditationsCategoryId!]\n $accreditationsIds: [AccreditationId!]\n $date: Date\n $tagsIds: [TagId!]\n $segmentId: SegmentId\n $excludeFull: Boolean\n $excludePast: Boolean\n) {\n event(id: $eventId) {\n accreditationsSlots(\n includeHidden: true\n accreditationName: $name\n accreditationsCategoriesIds: $accreditationCategoriesIds\n accreditationsIds: $accreditationsIds\n date: $date\n tagsIds: $tagsIds\n segmentId: $segmentId\n excludeFull: $excludeFull\n excludePast: $excludePast\n ) {\n nodes {\n ...AccreditationsSlot\n }\n }\n }\n}\n",{eventId:n,name:m(o)?o:void 0,accreditationCategoriesIds:so(a)?a:void 0,accreditationsIds:so(d)?d:void 0,date:u,tagsIds:so(g)?g:void 0,segmentId:f,excludeFull:x,excludePast:v},[Vs.AccreditationsSlotFragment]);return(0,i.jsxs)(Ba,{css:{background:"$gray50",minHeight:"100%",padding:"$6 $7"},direction:"column",width:1,children:[(0,i.jsx)(uN,{accreditationsCategoriesIds:a,accreditationsIds:d,date:u,event:e,excludeFull:x,excludePast:v,name:s,organization:t,segmentId:f,setAccreditationsCategoriesIds:l,setAccreditationsIds:c,setDate:h,setExcludeFull:I,setExcludePast:b,setName:r,setSegmentId:_,setTagsIds:p,tagsIds:g}),(0,i.jsx)(Ya,{height:"7"}),C||(0,i.jsx)(lN,{accreditationsSlots:j.event.accreditationsSlots.nodes,delegation:e.volunteerRegistration.delegation})]})},mN=e=>{const{history:t,translate:n,params:{organizationId:s,eventId:o,userInfoId:r}}=vl();Md(n("accr_ditations_79986",e.event.volunteerRegistration.userInfo.name));const[a,l]=kz("accredit.isLeftPanelOpen",!0),[d,c]=kz("accredit.isRightPanelOpen",!0),[u,h,g]=Wc(""),[p,f]=kz("accredit.leftPanelDirection",yt.Desc),[_,x]=kz("accredit.leftPanelSegmentId",-1),[I,v]=kz("accredit.leftPanelDelegationId",null),[b,j]=kz("accredit.leftPanelStates",[le.AutoAccredited,le.WaitingAccreditation]),{data:C,isLoading:y}=Co({eventId:o,accreditationStates:b,name:m(h)?h:void 0,segmentId:-1===_?void 0:_,delegationId:I||void 0,direction:p,loadDelegations:!0}),k=(0,L.useCallback)(()=>{const e=C.event?.volunteersRegistrations.nodes??[],n=e.findIndex(e=>e.userInfo.id===r),i=e[n+1]?.userInfo.id??e[0].userInfo.id;i===r?t.goBack(Ps.ACCREDIT(s,o,r)):t.replace(Ps.ACCREDIT(s,o,i))},[s,o,r,C.event]),A=e.event.volunteerRegistration,w=(0,L.useMemo)(()=>[...A.accreditationsUsersInfos.map(({accreditationSlotId:e})=>e),...e.isEdit?[]:A.accreditationsSlots.flatMap(e=>{const t=A.delegation?.accreditationsSlots.find(t=>t.accreditationSlotId===e.id),n=t?.maxResources&&t?.assignedResources>=t?.maxResources;return e?.maxResources&&e?.assignedResources>=e?.maxResources||n?[]:[e.id]})],[A,e.isEdit]);return(0,i.jsx)(eN,{accreditationsSlotsIds:w,isEdit:e.isEdit,showNextMember:k,children:(0,i.jsx)(LM,{buttons:(0,i.jsx)(nN,{isEdit:e.isEdit,userInfoId:A.userInfo.id}),header:(0,i.jsx)(BM,{badgeColorIcon:yj(A.accreditationState),insertedAt:A.insertedAt,isPreAssign:!1,showTabs:!1,showTeam:!1,teams:[],userInfo:A.userInfo}),isEdit:e.isEdit,isLeftPanelOpen:a,isRightPanelOpen:d,leftPanel:(0,i.jsx)(WM,{accreditationStates:b,delegationId:I,direction:p,event:C.event,getPath:e=>Ps.ACCREDIT(s,o,e),isLoading:y,loadDelegations:!0,name:u,segmentId:_,setAccreditationStates:j,setDelegationId:v,setDirection:f,setName:g,setSegmentId:x,setStates:td.A,showAccreditationStates:!0,showStates:!1,states:[],userInfoId:A.userInfoId}),rightPanel:(0,i.jsx)(JM,{customFields:e.event.formsCustomsFields,eventId:o,formsUsersInfos:e.organization.userInfo.formsUsersInfos,organizationId:s,showWishedAccreditations:!0,showWishedPositions:!1,userInfo:e.event.volunteerRegistration.userInfo,onCollapse:()=>{c(!1)}}),setIsLeftPanelOpen:l,setIsRightPanelOpen:c,children:(0,i.jsx)(hN,{event:e.event,organization:e.organization})})})},gN=e=>{const{organizationId:t,eventId:n,userInfoId:s}=ti(),{data:o,loader:r}=Qn("query AccreditInfos(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $userInfoId: UsersInfoId!\n) {\n organization(id: $organizationId) {\n tags {\n nodes {\n id\n name\n }\n }\n\n userInfo(id: $userInfoId) {\n ...FormsUsersInfosWished\n }\n }\n\n event(id: $eventId) {\n startAt\n endAt\n\n formsCustomsFields {\n ...CustomFieldWithCondition\n }\n\n accreditationsCategories {\n id\n name\n }\n\n accreditations {\n nodes {\n id\n name\n }\n }\n\n segments(segmentType: Accreditations) {\n id\n name\n }\n\n volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n id\n userInfoId\n accreditationState\n insertedAt\n\n accreditationsSlots {\n id\n maxResources\n assignedResources\n }\n\n accreditationsUsersInfos {\n accreditationSlotId\n }\n\n delegation {\n ...DelegationAccreditationsSlots\n }\n\n userInfo {\n id\n name\n email\n fields\n picture {\n url\n }\n }\n }\n }\n}\n",{organizationId:t,eventId:n,userInfoId:s},[Vs.FormsUsersInfosWishedFragment,Vs.CustomFieldWithConditionFragment,Vs.DelegationAccreditationsSlotsFragment]);return r||(0,i.jsx)(mN,{event:o.event,isEdit:e.isEdit,organization:o.organization})},pN=e=>(0,i.jsxs)(Ba,{css:{background:"white",bd:!0,flex:"1",...e.css},direction:"column",children:[(0,i.jsx)(Ba,{css:{flex:"1",padding:"$6"},direction:"column",gap:"2",children:e.children}),e.button&&(0,i.jsx)(Ba,{css:{borderTop:"1px solid $gray200",padding:"$4 $6"},justify:"end",children:e.button})]}),fN=()=>{const{translate:e,params:{eventId:t}}=vl(),[n,s,o]=Wc(""),[r,a]=(0,L.useState)(""),[l,d]=(0,L.useState)(0),{data:c,isLoading:u,reload:h}=Qn("query AccreditationsAssignmentsEmails(\n $eventId: EventId!\n $name: String\n $state: EmailState\n $offset: Int\n) {\n event(id: $eventId) {\n emails(\n emailTypes: [Accreditations, AccreditationsRefused]\n name: $name\n state: $state\n limit: 25\n offset: $offset\n ) {\n nodes {\n ...EmailRecipient\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{eventId:t,name:m(s)?s:void 0,state:""!==r?r:void 0,offset:l},[Vs.EmailRecipientFragment]);const g=Bc(),{numberOfPages:p,totalCount:f}=Su(c.event?.emails);return(0,i.jsx)(Lc,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ar,{width:200,children:(0,i.jsxs)($u,{value:r,onChange:e=>{a(e),d(0)},children:[(0,i.jsx)("option",{value:"",children:e("tous_les_status_67644")}),g(cn.filter(e=>e!==Oe.Queued))]})}),(0,i.jsx)(Ar,{width:320,children:(0,i.jsx)(Bl,{icon:"magnifying-glass",placeholder:e("rechercher_un_d_02329"),value:n,onChange:e=>{o(e),d(0)}})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Gc,{children:e("nom_du_membre_69353")}),(0,i.jsx)(Gc,{children:e("date_d_envoi_74668")}),(0,i.jsx)(Gc,{children:e("status_06428")}),(0,i.jsx)(Gc,{width:100})]}),numberOfPages:p,offset:l,rows:u?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Hc,{bx:!0}),(0,i.jsx)(Hc,{bx:!0}),(0,i.jsx)(Hc,{bx:!0})]}):c.event.emails.nodes.map(e=>(0,i.jsx)(vj,{email:e,emailType:$e.Accreditations,reload:h},e.id)),setOffset:d,title:e("liste_des_envoi_14764"),totalCount:f})},_N=e=>{const t=Xn(),{mutate:n,isLoading:s}=function(e={}){return ei("mutation SendAccreditationsEmails(\n $eventId: EventId!\n $sendAccreditationsEmails: SendAccreditationsEmailsInput!\n) {\n eventAccreditationsEmailsSend(\n eventId: $eventId\n sendAccreditationsEmails: $sendAccreditationsEmails\n )\n}\n",e)}();return(0,i.jsxs)(au,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(sC,{color:"warning",css:{margin:"auto"},icon:"triangle-exclamation"}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(Ar,{font:"gray900 textLg medium",textAlign:"center",children:t("_tes_vous_sur_d_58206",e.numberOfEmails)}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ar,{color:"gray500",textAlign:"center",children:t("les_membres_pr_09143")}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsxs)(Ba,{gap:"3",justify:"end",children:[(0,i.jsx)(zl,{isLoading:s,onClick:async()=>{await n({eventId:e.eventId,sendAccreditationsEmails:e.sendAccreditationsEmails}),e.reload(),e.onClose()},children:t("confirmer_l_env_08749")}),(0,i.jsx)(zl,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},xN=e=>{const t=Xn(),[n,s,o]=Wc(""),[r,a]=(0,L.useState)([]),{data:l}=qr({eventId:e.eventId,usersInfosIds:r,name:m(s)?s:void 0}),d=(0,L.useMemo)(()=>(0,xh.A)((l.event?.volunteersRegistrations.nodes??[]).concat(l.event?.selectedVolunteersRegistrations.nodes??[]),e=>e.id),[l.event]),{mutate:c,isLoading:u}=function(e={}){return ei("mutation AccreditationsEmailsEstimate(\n $eventId: EventId!\n $sendAccreditationsEmails: SendAccreditationsEmailsInput!\n) {\n eventAccreditationsEmailsEstimate(\n eventId: $eventId\n sendAccreditationsEmails: $sendAccreditationsEmails\n )\n}\n",e)}(),[h,g]=(0,L.useState)(oe.Everyone),[p,f]=(0,L.useState)([]),_=h===oe.Everyone||h===oe.Accredited||h===oe.Refused||h===oe.Members&&so(r)||h===oe.Segments&&so(p),x=!(!e.emailSender||e.emailSender.isValidToSendEmail);return(0,i.jsxs)(au,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(sC,{color:"purple",css:{margin:"auto"},icon:"paper-plane"}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(Ar,{color:"gray900",fontSize:"textLg",fontWeight:"medium",textAlign:"center",children:t("envoi_des_e_mai_83224")}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ar,{color:"gray500",textAlign:"center",children:t("personnaliser_v_78340")}),(0,i.jsx)(Ya,{height:"7"}),x&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(rl,{color:"error",leftIcon:"circle-exclamation",children:t("vous_ne_pouvez_69435")}),(0,i.jsx)(Ya,{height:"4"})]}),(0,i.jsx)(Ar,{color:"gray800",fontWeight:"medium",children:t("que_souhaitez_v_01732")}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(vc,{state:h===oe.Everyone?"checked":"unchecked",onClick:()=>{g(oe.Everyone)},children:t("tous_les_e_mail_50843")}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:h===oe.Accredited?"checked":"unchecked",onClick:()=>{g(oe.Accredited)},children:t("tous_les_e_mail_02185")}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:h===oe.Refused?"checked":"unchecked",onClick:()=>{g(oe.Refused)},children:t("tous_les_e_mail_41162")}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:h===oe.Members?"checked":"unchecked",onClick:()=>{g(oe.Members)},children:t("_certains_memb_91094")}),h===oe.Members&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(Ar,{css:{paddingLeft:"$6"},children:(0,i.jsx)(yc,{isSearchVisible:!0,multiple:!0,searchElement:(0,i.jsx)(Bl,{icon:"magnifying-glass",placeholder:t("rechercher_50038"),state:"search",value:n,onChange:o}),values:r,onChange:a,children:d.map(e=>(0,i.jsx)("option",{value:e.userInfo.id,children:e.userInfo.nameOrEmail},e.userInfo.id))})})]}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:h===oe.Segments?"checked":"unchecked",onClick:()=>{g(oe.Segments)},children:t("uniquement_ce_54026")}),h===oe.Segments&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(Ar,{css:{paddingLeft:"$6"},children:(0,i.jsx)(yc,{isSearchVisible:!0,multiple:!0,values:p,onChange:f,children:(l.event?.segments??[]).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})})]}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsxs)(Ba,{gap:"3",justify:"end",children:[(0,i.jsx)(zl,{disabled:x,isLoading:u,onClick:async()=>{if(_){const t={recipients:h,segmentsIds:p,usersInfosIds:r},{eventAccreditationsEmailsEstimate:n}=await c({eventId:e.eventId,sendAccreditationsEmails:t});e.onSuccess(n,t),e.onClose()}},children:t("envoyer_les_e_m_37846")}),(0,i.jsx)(zl,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},IN=e=>{const{history:t,params:{organizationId:n,eventId:s},translate:o}=vl(),{setNumberOfWaitingAccreditations:r}=wb(),[a,l]=(0,L.useState)(!1),[d,c]=(0,L.useState)(null),[u,h]=(0,L.useState)(0),[m,g]=(0,L.useState)(!1);return(0,L.useEffect)(()=>{r(e.event.waitingAccreditation.totalCount)},[e.event]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(aj,{children:[(0,i.jsxs)(Ba,{gap:"3",children:[(0,i.jsxs)(pN,{button:(0,i.jsx)(zl,{disabled:0===e.event.waitingAccreditation.totalCount,onClick:()=>{e.event.waitingAccreditation.totalCount>0&&t.push(Ps.ACCREDIT(n,s,e.event.waitingAccreditation.nodes[0].userInfoId))},children:o("accr_diter_les_48281")}),children:[(0,i.jsx)(Ar,{color:"gray500",fontWeight:"medium",children:o("membres_en_atte_52995")}),(0,i.jsx)(Ar,{font:"gray900 displayMd medium",children:e.event.waitingAccreditation.totalCount})]}),(0,i.jsxs)(pN,{button:(0,i.jsx)(zl,{onClick:()=>{l(!0)},children:o("param_trer_et_e_31095")}),children:[(0,i.jsx)(Ar,{color:"gray500",fontWeight:"medium",children:o("e_mail_de_confi_84099_plural")}),(0,i.jsx)(Ar,{font:"gray900 displayMd medium",children:e.event.emailsStats.numberOfWaiting})]})]}),(0,i.jsx)(Ya,{height:"9"}),(0,i.jsx)(Ar,{font:"gray900 textLg medium",children:o("historique_des_71419")}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsxs)(Ba,{gap:"6",children:[(0,i.jsxs)(pN,{children:[(0,i.jsx)(Ar,{color:"gray500",fontWeight:"medium",children:o("nombre_d_envois_95106")}),(0,i.jsx)(Ar,{font:"gray900 displayMd medium",children:e.event.emailsStats.numberOfSent})]}),(0,i.jsxs)(pN,{children:[(0,i.jsx)(Ar,{color:"gray500",fontWeight:"medium",children:o("nombre_d_ouvert_84187")}),(0,i.jsx)(Ar,{font:"gray900 displayMd medium",children:e.event.emailsStats.numberOfOpen})]}),(0,i.jsxs)(pN,{children:[(0,i.jsx)(Ar,{color:"gray500",fontWeight:"medium",children:o("nombre_de_clics_64232")}),(0,i.jsx)(Ar,{font:"gray900 displayMd medium",children:e.event.emailsStats.numberOfClick})]})]}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(fN,{})]}),a&&(0,i.jsx)(xN,{emailSender:e.organization.emailTemplate?.emailSender,eventId:s,onClose:()=>{l(!1)},onSuccess:(e,t)=>{h(e),c(t),g(!0)}}),m&&(0,i.jsx)(_N,{eventId:s,numberOfEmails:u,reload:e.reload,sendAccreditationsEmails:d,onClose:()=>{g(!1)}})]})},vN=()=>{const e=Xn();return(0,i.jsxs)(lj,{direction:"column",children:[(0,i.jsx)(Ar,{font:"blueGray900 textXl medium",children:e("accr_ditations_39450")}),(0,i.jsx)(Ar,{color:"gray500",children:e("accr_diter_vos_35773")})]})},bN=()=>{const{params:{organizationId:e,eventId:t},translate:n}=vl(),{event:{name:s},localEvent:o,updateLocalEvent:r}=wb();Md(`${s} ${n("accr_ditations_39450")}`);const{data:a,loader:l,reload:d}=Qn('query AccreditationsAssignmentsKpis(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $direction: SortDirection!\n) {\n organization(id: $organizationId) {\n emailTemplate(emailType: Accreditations, eventId: $eventId) {\n emailSender {\n isValidToSendEmail\n }\n }\n }\n\n event(id: $eventId) {\n emailsStats(emailTypes: [Accreditations, AccreditationsRefused]) {\n numberOfOpen\n numberOfClick\n numberOfSent\n numberOfWaiting\n }\n\n waitingAccreditation: volunteersRegistrations(\n accreditationStates: [AutoAccredited, WaitingAccreditation]\n limit: 1\n sort: { attribute: "InsertedAt", direction: $direction }\n ) {\n nodes {\n userInfoId\n }\n\n totalCount\n }\n }\n}\n',{organizationId:e,eventId:t,direction:o?.["accredit.leftPanelDirection"]??yt.Desc},[]);return(0,L.useEffect)(()=>{(async()=>{await Promise.all([r({"accredit.filters.accreditationsCategoriesIds":null}),r({"accredit.filters.accreditationsIds":null}),r({"accredit.filters.date":null}),r({"accredit.filters.tagsIds":null}),r({"accredit.filters.segmentId":null}),r({"accredit.filters.excludeFull":!1})])})()},[]),l||(0,i.jsxs)(dj,{children:[(0,i.jsx)(vN,{}),(0,i.jsx)(IN,{event:a.event,organization:a.organization,reload:d})]})},jN=e=>{const t=Xn(),{mutate:n}=function(e={}){return ei("mutation AccreditationCategoryDelete(\n $eventId: EventId!\n $accreditationCategoryId: AccreditationsCategoryId!\n) {\n accreditationCategoryDelete(\n eventId: $eventId\n accreditationCategoryId: $accreditationCategoryId\n ) {\n id\n }\n}\n",e)}();return(0,i.jsx)(cA,{buttonText:t("supprimer_43083"),subtext:[t("_tes_vous_s_r_d_50954"),t("cela_supprimera_56396")],text:t("suppression_de_73669",e.accreditationCategory.name),onClose:e.onClose,onDelete:async()=>{await n({eventId:e.eventId,accreditationCategoryId:e.accreditationCategory.id}),e.onSuccess()}})},CN=({category:e,reload:t})=>{const{history:n,params:{organizationId:s,eventId:o},translate:r}=vl(),{mutate:a}=function(e={}){return ei("mutation AccreditationCategoryDuplicate(\n $eventId: EventId!\n $accreditationCategoryId: AccreditationsCategoryId!\n) {\n accreditationCategoryDuplicate(\n eventId: $eventId\n accreditationCategoryId: $accreditationCategoryId\n ) {\n id\n }\n}\n",e)}(),[l,d]=(0,L.useState)(!1),[c,u]=(0,L.useState)(!1);return(0,i.jsxs)(lj,{align:"center",gap:"3",hideBorder:!0,children:[(0,i.jsx)(Sj,{returnPathFallback:is.ACCREDITATIONS({organizationId:s,eventId:o})}),(0,i.jsx)(Ar,{css:{flex:"1"},font:"gray900 displayXs medium",children:e.name}),(0,i.jsx)(Kb,{permissions:Hb.ACCREDITATION_EDIT,children:(0,i.jsx)(zl,{color:"white",onClick:()=>u(!0),children:r("_diter_62574")})}),(0,i.jsx)(Kb,{permissions:Hb.ACCREDITATION_EDIT,children:(0,i.jsx)(zl,{onClick:()=>{n.push(Ps.CREATE_ACCREDITATION(s,o,e.id))},children:r("add_accreditation")})}),(0,i.jsx)(Kb,{permissions:Hb.ACCREDITATION_EDIT,children:(0,i.jsxs)(Wd,{children:[(0,i.jsx)(Xd,{children:(0,i.jsx)(zl,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Zd,{placement:"bottom-end",children:[(0,i.jsx)(Kd,{icon:"copy",onClick:async()=>{const{accreditationCategoryDuplicate:{id:t}}=await a({eventId:o,accreditationCategoryId:e.id});n.push(is.ACCREDITATION_CATEGORY({organizationId:s,eventId:o,accreditationCategoryId:t}))},children:r("dupliquer_28256")}),(0,i.jsx)(Xu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Kd,{color:"red",icon:"trash-can",onClick:()=>{d(!0)},children:r("supprimer_43083")})]})]})}),c&&(0,i.jsx)(XP,{accreditationCategory:e,eventId:o,onClose:()=>{u(!1)},onSuccess:t}),l&&(0,i.jsx)(jN,{accreditationCategory:e,eventId:o,onClose:()=>{d(!1)},onSuccess:()=>{n.replace(is.ACCREDITATIONS({organizationId:s,eventId:o}))}})]})},yN=e=>{const{translate:t,params:{eventId:n,accreditationCategoryId:s}}=vl(),{data:o,loader:r}=Qn("query AccreditationsCategoryAccreditationsReorder(\n $eventId: EventId!\n $accreditationCategoryId: AccreditationsCategoryId!\n) {\n event(id: $eventId) {\n accreditationCategory(id: $accreditationCategoryId) {\n name\n\n accreditations {\n id\n name\n index\n }\n }\n }\n}\n",{eventId:n,accreditationCategoryId:s},[]),{mutate:a}=Eo(),[l,d]=(0,L.useState)([]),[c,u]=(0,L.useState)(!1),h=(0,L.useCallback)(async()=>{u(!0),await Promise.all(l.map((e,t)=>a({eventId:n,massEdit:{reset:!1,selecteds:{ids:[e.id]},slug:se.Index,strategy:it.Replace,value:t}}))),e.onClose(),e.onSuccess(),u(!1)},[n,l,u,a,e.onClose,e.onSuccess]),m=(0,L.useCallback)(({reason:e,source:t,destination:n})=>{"DROP"===e&&n&&t.index!==n.index&&d(lo(l,t.index,n.index))},[l,d]);return(0,L.useEffect)(()=>{d(DC(o.event?.accreditationCategory.accreditations??[]))},[o.event,d]),(0,i.jsx)(Lm,{button:(0,i.jsx)(zl,{isLoading:c,onClick:h,children:t("enregistrer_06519")}),category:t("liste_des_accr_02647"),heading:t("changer_l_ordre_11550"),onClose:e.onClose,children:r||(0,i.jsxs)(Mm,{css:{background:"white "},children:[(0,i.jsx)(Ar,{font:"gray900 textLg semiBold",children:t("organisation_de_45058")}),(0,i.jsx)(Ju,{height:"5"}),(0,i.jsx)(Iu.JY,{onDragEnd:m,children:(0,i.jsxs)(Ba,{css:{background:"white",border:"1px solid $gray200",borderRadius:"$2",boxShadow:"$sm",overflow:"hidden"},direction:"column",children:[(0,i.jsx)(Ba,{align:"center",css:{padding:"$4"},gap:"3",children:(0,i.jsx)(Ar,{css:{flex:"1"},font:"gray800 textMd medium",children:o.event.accreditationCategory.name})}),(0,i.jsx)(Iu.gL,{droppableId:"main",type:"accreditation",children:e=>(0,i.jsxs)(Ba,{css:{background:"$gray100",padding:"$4"},direction:"column",gap:"2",...e.droppableProps,ref:e.innerRef,children:[l.map((e,t)=>(0,i.jsx)(Iu.sx,{draggableId:`a-${e.id}`,index:t,children:t=>(0,i.jsxs)(Ba,{css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",padding:"$3"},gap:"3",...t.draggableProps,ref:t.innerRef,align:"center",children:[(0,i.jsx)(Ar,{color:"gray300",css:{cursor:"pointer"},...t.dragHandleProps,children:(0,i.jsx)(nl,{icon:"grip-vertical",iconStyle:"solid"})}),(0,i.jsx)(Ar,{css:{flex:"1"},font:"gray900 textSm medium",children:e.name})]})},e.id)),e.placeholder]})})]})})]})})},kN=()=>{const{params:{organizationId:e,eventId:t,accreditationCategoryId:n},translate:s}=vl(),[o,r,a]=Wc(""),[l,d]=(0,L.useState)(0),[c,u]=(0,L.useState)({direction:yt.Asc,attribute:ae.Index}),{data:h,isLoading:g,reload:p}=Qn("query AccreditationsCategoryAccreditations(\n $eventId: EventId!\n $accreditationCategoryId: AccreditationsCategoryId\n $name: String\n $offset: Int\n $sort: AccreditationsSort\n) {\n event(id: $eventId) {\n accreditations(\n accreditationCategoryId: $accreditationCategoryId\n name: $name\n limit: 25\n offset: $offset\n sort: $sort\n ) {\n nodes {\n id\n name\n accreditationDisplay\n numberOfSlots\n index\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{eventId:t,accreditationCategoryId:n,name:m(r)?r:void 0,offset:l,sort:c},[]);const{numberOfPages:f,totalCount:_}=Su(h.event?.accreditations),[x,I]=(0,L.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Lc,{filters:(0,i.jsxs)(Ba,{gap:"4",children:[(0,i.jsx)(Ar,{width:320,children:(0,i.jsx)(Bl,{icon:"magnifying-glass",placeholder:s("rechercher_une_65646"),value:o,onChange:a})}),(0,i.jsxs)(km,{children:[(0,i.jsx)(Sm,{children:(0,i.jsx)(zl,{color:"white",leftIcon:"gear",onClick:()=>I(!0)})}),(0,i.jsx)(wm,{placement:"top",children:s("changer_l_ordre_11550")})]})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(jm,{attribute:ae.Name,setSort:u,sort:c,children:s("nom_de_l_accr_d_11908")}),(0,i.jsx)(jm,{attribute:ae.Index,setSort:u,sort:c,children:s("Index")}),(0,i.jsx)(Gc,{children:s("number_of_slots_92461")}),(0,i.jsx)(Gc,{children:s("type_d_affichag_55093")})]}),numberOfPages:f,offset:l,rows:g?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Hc,{bx:!0}),(0,i.jsx)(Hc,{bx:!0}),(0,i.jsx)(Hc,{bx:!0})]}):0===h.event.accreditations.totalCount?(0,i.jsxs)(Ba,{align:"center",css:{border:"1px solid $gray200",borderTop:"none",py:"$8"},direction:"column",gap:"4",children:[(0,i.jsx)(sC,{color:"primary",icon:"user-group"}),(0,i.jsx)(Ar,{color:"gray800",fontWeight:"medium",children:s("no_accreditations")})]}):h.event.accreditations.nodes.map(n=>(0,i.jsxs)(Mc,{css:{userSelect:"none"},children:[(0,i.jsx)(Oc,{css:{fontWeight:"$medium"},children:(0,i.jsx)(Zc,{to:is.ACCREDITATION({organizationId:e,eventId:t,accreditationId:n.id}),children:TC(n)})}),(0,i.jsx)(Oc,{children:n.index??"-"}),(0,i.jsx)(Oc,{children:n.numberOfSlots}),(0,i.jsx)(Oc,{children:s(n.accreditationDisplay)})]},n.id)),setOffset:d,title:s("liste_des_accr_02647"),totalCount:_}),x&&(0,Kt.createPortal)((0,i.jsx)(Ar,{css:{background:"white",left:"0",position:"absolute",top:"0",zIndex:"200"},height:1,width:1,children:(0,i.jsx)(yN,{onClose:()=>I(!1),onSuccess:p})}),document.body)]})},AN=()=>{const{translate:e,params:{eventId:t,accreditationCategoryId:n}}=vl(),{data:s,loader:o}=Qn("query AccreditationsCategoryChart(\n $eventId: EventId!\n $accreditationCategoryId: AccreditationsCategoryId!\n) {\n event(id: $eventId) {\n accreditations(accreditationCategoryId: $accreditationCategoryId) {\n nodes {\n ...AccreditationChart\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{eventId:t,accreditationCategoryId:n},[Vs.AccreditationChartFragment]),[r,a]=(0,L.useState)(),l=(0,L.useMemo)(()=>s.event?.accreditations?.nodes.find(e=>e.id==r),[r]);return o||(0,i.jsx)(Sw,{select:(0,i.jsx)(Ba,{width:.5,children:(0,i.jsxs)($u,{value:r??-1,onChange:e=>{a(e)},children:[(0,i.jsx)("option",{disabled:!0,value:-1,children:e("s_lectionner_un_96571")}),s.event.accreditations.nodes.map(e=>(0,i.jsx)("option",{value:e.id,children:TC(e)},e.id))]})}),title:e("r_partition_du_55091"),children:(0,i.jsx)(Ba,{gap:"4",width:1,children:(0,i.jsx)(Ar,{height:380,width:1,children:r&&l?(0,i.jsx)(oS,{accreditation:l,slots:l.slots}):(0,i.jsx)(Gk,{title:e("vous_allez_retr_26787")})})})})},wN=()=>(0,i.jsx)(aj,{children:(0,i.jsxs)(Ba,{direction:"column",gap:"6",children:[(0,i.jsx)(Ba,{width:1,children:(0,i.jsx)(AN,{})}),(0,i.jsx)(Ar,{css:{flex:"1"},children:(0,i.jsx)(kN,{})})]})}),SN=({event:e,reload:t})=>{const{params:{organizationId:n,eventId:s,accreditationCategoryId:o},translate:r}=vl();Md(e.accreditationCategory.name);const a=e=>({organizationId:e?":organizationId":n,eventId:e?":eventId":s,accreditationCategoryId:e?":accreditationCategoryId":o});return(0,i.jsxs)(dj,{children:[(0,i.jsx)(CN,{category:e.accreditationCategory,reload:t}),(0,i.jsxs)(mj,{css:{flex:"1"},children:[(0,i.jsxs)(uj,{css:{px:"$7"},children:[(0,i.jsx)(cj,{path:is.ACCREDITATION_CATEGORY_DASHBOARD(a(!1)),children:r("tableau_de_bord_24627")}),(0,i.jsx)(cj,{path:is.ACCREDITATION_CATEGORY_MEMBERS(a(!1)),children:r("membres_125561",e.volunteersRegistrations.totalCount)})]}),(0,i.jsx)(hj,{path:is.ACCREDITATION_CATEGORY_DASHBOARD(a(!0)),children:(0,i.jsx)(wN,{})}),(0,i.jsx)(hj,{path:is.ACCREDITATION_CATEGORY_MEMBERS(a(!0)),children:(0,i.jsx)(FM,{accreditationCategoryId:o})})]})]})},EN=()=>{const{params:{organizationId:e,eventId:t,accreditationCategoryId:n}}=vl(),{data:s,loader:o,reload:r}=Qn("query AccreditationsCategory(\n $eventId: EventId!\n $accreditationCategoryId: AccreditationsCategoryId!\n) {\n event(id: $eventId) {\n accreditationCategory(id: $accreditationCategoryId) {\n id\n name\n assignedResources\n }\n\n volunteersRegistrations(accreditationCategoryId: $accreditationCategoryId) {\n totalCount\n }\n }\n}\n",{eventId:t,accreditationCategoryId:n},[]);return o||(0,i.jsxs)(Sr.dO,{children:[(0,i.jsx)(Sr.qh,{exact:!0,path:is.ACCREDITATION_CATEGORY({organizationId:":organizationId",eventId:":eventId",accreditationCategoryId:":accreditationCategoryId"}),children:(0,i.jsx)(oi,{path:is.ACCREDITATION_CATEGORY_DASHBOARD({organizationId:e,eventId:t,accreditationCategoryId:n}),replace:!0})}),(0,i.jsx)(Sr.qh,{children:(0,i.jsx)(SN,{event:s.event,reload:r})})]})},TN=e=>{const{params:{organizationId:t,eventId:n,accreditationId:s},translate:o}=vl(),r=Zn(Jc),a=(0,L.useMemo)(()=>Dh(r,e.slot,e.slot.accreditation.name,{accreditation:{includeNameAtEnd:!0},date:{localeFormat:eo.DateOnly.WeekdayLongMonthLong}}),[e.slot]);return(0,i.jsxs)(lj,{align:"center",gap:"3",hideBorder:!0,children:[(0,i.jsx)(Sj,{returnPathFallback:is.ACCREDITATIONS({organizationId:t,eventId:n})}),(0,i.jsxs)(Ar,{color:"gray900",css:{flex:"1"},fontSize:"displayXs",fontWeight:"medium",children:[a,m(e.slot.accreditation.acronym)&&` (${e.slot.accreditation.acronym})`]}),(0,i.jsx)(zl,{to:Ps.EDIT_ACCREDITATION(t,n,s),children:o("_diter_62574")})]})},zN=e=>{const{params:{organizationId:t,eventId:n,accreditationId:s,accreditationSlotId:o},translate:r}=vl();Md(Dh(Zn(Jc),e.event.accreditationSlot,e.event.accreditationSlot.name));const a=e=>({organizationId:e?":organizationId":t,eventId:e?":eventId":n,accreditationId:e?":accreditationId":s,accreditationSlotId:e?":accreditationSlotId":o});return(0,i.jsxs)(dj,{children:[(0,i.jsx)(TN,{slot:e.event.accreditationSlot}),(0,i.jsxs)(mj,{css:{flex:"1"},children:[(0,i.jsxs)(uj,{css:{px:"$7"},children:[(0,i.jsx)(cj,{path:is.ACCREDITATION_SLOT_DASHBOARD(a(!1)),children:r("tableau_de_bord_24627")}),(0,i.jsx)(cj,{path:is.ACCREDITATION_SLOT_MEMBERS(a(!1)),children:r("membres_125561",e.event.volunteersRegistrations.totalCount)})]}),(0,i.jsx)(hj,{path:is.ACCREDITATION_SLOT_DASHBOARD(a(!0)),children:(0,i.jsx)(aj,{children:(0,i.jsxs)(Ba,{direction:"column",gap:"6",children:[(0,i.jsxs)(Ba,{gap:"6",width:1,children:[(0,i.jsx)(rM,{assignedResources:e.event.accreditationSlot.assignedResources,maxResources:e.event.accreditationSlot.maxResources}),(0,i.jsx)(nM,{accreditationCategoryId:e.event.accreditationSlot.accreditation.accreditationCategoryId,accreditationCategoryName:e.event.accreditationSlot.accreditation.accreditationCategoryName,accreditationName:e.event.accreditationSlot.accreditation.name,color:e.event.accreditationSlot.accreditation.color,customFields:e.organization.customFields.nodes,fields:e.event.accreditationSlot.accreditation.fields,icon:e.event.accreditationSlot.accreditation.icon})]}),(0,i.jsxs)(Ba,{gap:"4",children:[(0,i.jsxs)(Ba,{direction:"column",gap:"4",width:1,children:[(0,i.jsx)(oM,{customFields:e.event.accreditationSlot.accreditation.accreditationsCustomFields}),(0,i.jsx)(Uw,{tags:e.event.accreditationSlot.accreditation.tags}),(0,i.jsx)(Nw,{privateNote:e.event.accreditationSlot.accreditation.privateNote})]}),(0,i.jsxs)(Ba,{direction:"column",gap:"4",width:1,children:[(0,i.jsx)(Mw,{description:e.event.accreditationSlot.accreditation.description}),(0,i.jsx)(aM,{location:e.event.accreditationSlot.accreditation})]})]})]})})}),(0,i.jsx)(hj,{path:is.ACCREDITATION_SLOT_MEMBERS(a(!0)),children:(0,i.jsx)(FM,{accreditationSlotId:o})})]})]})},ON=()=>{const{params:{organizationId:e,eventId:t,accreditationId:n,accreditationSlotId:s}}=vl(),{data:o,loader:r}=Qn("query AccreditationsSlot(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $accreditationSlotId: AccreditationsSlotId!\n) {\n organization(id: $organizationId) {\n customFields(variety: Accreditation) {\n nodes {\n ...CustomFieldWithCondition\n }\n }\n }\n\n event(id: $eventId) {\n accreditationSlot(id: $accreditationSlotId) {\n id\n name\n date\n assignedResources\n maxResources\n\n accreditation {\n name\n description\n privateNote\n acronym\n icon\n color\n address\n latitude\n longitude\n layer\n zoom\n accreditationCategoryId\n accreditationCategoryName\n fields\n\n accreditationsCustomFields {\n customField {\n name\n fieldType\n\n values {\n id\n value\n }\n }\n\n conditionValue\n }\n\n tags {\n id\n name\n }\n }\n }\n\n volunteersRegistrations(accreditationSlotId: $accreditationSlotId) {\n totalCount\n }\n }\n}\n",{organizationId:e,eventId:t,accreditationSlotId:s},[Vs.CustomFieldWithConditionFragment]);return r||(0,i.jsxs)(Sr.dO,{children:[(0,i.jsx)(Sr.qh,{exact:!0,path:is.ACCREDITATION_SLOT({organizationId:":organizationId",eventId:":eventId",accreditationId:":accreditationId",accreditationSlotId:":accreditationSlotId"}),children:(0,i.jsx)(oi,{path:is.ACCREDITATION_SLOT_DASHBOARD({organizationId:e,eventId:t,accreditationId:n,accreditationSlotId:s}),replace:!0})}),(0,i.jsx)(Sr.qh,{children:(0,i.jsx)(zN,{event:o.event,organization:o.organization})})]})},RN=L.createContext({}),$N=e=>{const t=ii(),[n,s]=L.useState(e.positionsIds),[o,r]=L.useState(e.positionsCategoriesIds),[a,l]=L.useState(e.positionsSlotsIds);return(0,i.jsx)(RN.Provider,{value:{isEdit:e.isEdit,isPreAssign:t.pathname.includes("pre-assignment"),positionsIds:n,positionsCategoriesIds:o,positionsSlotsIds:a,showNextVolunteer:e.showNextVolunteer,setPositionsIds:s,setPositionsCategoriesIds:r,setPositionsSlotsIds:l,teams:e.teams},children:e.children})};function DN(){return L.useContext(RN)}const PN=e=>{const{history:t,params:{organizationId:n,eventId:s},translate:o}=vl(),{isPreAssign:r,positionsIds:a,positionsCategoriesIds:l,positionsSlotsIds:d,showNextVolunteer:c}=DN(),{mutate:u,isLoading:h}=Qo(),{mutate:m,isLoading:g}=za(),{mutate:p,isLoading:f}=function(e={}){return ei("mutation VolunteerRegistrationAssignmentRefuse(\n $eventId: EventId!\n $volunteerRegistrationId: VolunteersRegistrationId!\n) {\n volunteerRegistrationAssignmentRefuse(\n eventId: $eventId\n volunteerRegistrationId: $volunteerRegistrationId\n ) {\n id\n }\n}\n",e)}(),{mutate:_,isLoading:x}=tr(),I=(0,L.useCallback)(()=>{e.isEdit?t.goBack(Ps.ASSIGNMENTS(n,s)):c()},[e.isEdit,c]);return(0,i.jsxs)(Ba,{align:"center",css:{borderTop:"1px solid $gray200",px:"$7"},gap:"4",height:1,width:1,children:[(0,i.jsx)(Ar,{color:"error700",css:{cursor:"pointer"},onClick:async()=>{h||g||f||x||(await p({eventId:s,volunteerRegistrationId:e.volunteerRegistrationId}),I())},children:o("refuser_92819")}),(0,i.jsx)(Ar,{css:{flex:"1"}}),(0,i.jsx)(zl,{color:"primary",isLoading:h||g,onClick:async()=>{r?(!so(a)||h||g||f||x||(await m({eventId:s,massPreAssign:{level:st.Positions,positionsIds:a,positionsCategoriesIds:[],selecteds:{ids:[e.userInfoId]},strategy:it.Replace}}),I()),!so(l)||h||g||f||x||(await m({eventId:s,massPreAssign:{level:st.Categories,positionsIds:[],positionsCategoriesIds:l,selecteds:{ids:[e.userInfoId]},strategy:it.Replace}}),I())):h||g||f||x||(so(d)?await u({eventId:s,massAssign:{positionsSlotsIds:d,selecteds:{ids:[e.userInfoId]},strategy:it.Replace}}):await _({eventId:s,massStateUpdate:{selecteds:{ids:[e.userInfoId]},state:Pt.WaitingAssignment}}),I())},children:e.isEdit?o("mettre_jour_l_30423"):o(r?"pr_affecter_17434":"affecter_94255")}),(0,i.jsx)(zl,{color:"white",onClick:I,children:e.isEdit?o("annuler_48254"):o("affecter_plus_t_97778")})]})},FN=e=>{const[t,n]=L.useState(e.initialIsOpen);return(0,i.jsxs)(Ba,{css:{bd:!0,userSelect:"none",...e.css},direction:"column",width:1,children:[(0,i.jsxs)(Ba,{align:"center",css:{padding:"$6"},gap:"3",children:[(0,i.jsx)(Ar,{css:{flex:"1"},children:e.header}),(0,i.jsx)(zl,{color:"white",leftIcon:t?"chevron-up":"chevron-down",size:"sm",onClick:()=>{n(!t)}})]}),t&&(0,i.jsx)(Ba,{css:{background:"$gray100",padding:"$6"},direction:"column",children:e.children})]})},MN=e=>{const t=Xn(),n=e.assignedResources/e.neededResources;return(0,i.jsxs)(Ba,{css:{background:"white",bd:!0,cursor:"pointer",userSelect:"none"},direction:"column",width:1,onClick:e.onClick,children:[(0,i.jsxs)(Ba,{align:"center",css:{padding:"$3 $5"},width:1,children:[(0,i.jsx)(fc,{shouldPreventDefault:!1,state:e.isSelected?"checked":"unchecked",onClick:td.A}),(0,i.jsx)(Ya,{width:"4"}),(0,i.jsx)(WC,{color:e.color,icon:e.icon}),(0,i.jsx)(Ya,{width:"3"}),(0,i.jsxs)(Ba,{css:{flex:"1"},direction:"column",gap:"1",children:[m(e.category)&&(0,i.jsx)(Ar,{color:"gray500",css:{fontSize:"11px",textTransform:"uppercase"},fontWeight:"medium",children:e.category}),(0,i.jsx)(Ar,{color:"gray800",fontWeight:"semiBold",children:e.title}),(0,i.jsx)(Ar,{color:"gray500",children:e.subtitle})]}),(0,i.jsx)(Ya,{width:"2"}),(0,i.jsx)(Ar,{color:"gray700",fontSize:"textXs",children:(0,i.jsx)(nl,{icon:"user-group"})}),(0,i.jsx)(Ya,{width:"2"}),(0,i.jsxs)(Ar,{color:"gray700",children:[e.assignedResources,"/",e.neededResources]}),(0,i.jsx)(Ya,{width:"6"}),(0,i.jsx)(Ar,{width:120,children:(0,i.jsx)(Ow,{percent:n})}),(0,i.jsx)(Ya,{width:"3"}),(0,i.jsxs)(Ar,{color:"gray700",textAlign:"end",width:36,children:[Math.min(100,Math.round(100*n)),"%"]})]}),(0,i.jsxs)(Ba,{css:{borderTop:"1px solid $gray200",padding:"$3 $6","&:empty":{display:"none"}},children:[e.overlaps&&(0,i.jsx)(rc,{color:"warning",leftIcon:"triangle-exclamation",children:t("ce_cr_neau_en_c_55775")}),e.teamMembers]})]})},NN=e=>{const t=Xn(),n=Zn(ph),{positionsIds:s,positionsCategoriesIds:o,setPositionsIds:r,setPositionsCategoriesIds:a}=DN(),l=()=>{a(ao(o,e.category.id))};return(0,i.jsx)(FN,{css:{background:"white"},header:(0,i.jsxs)(Ba,{align:"center",children:[(0,i.jsx)(fc,{state:o.includes(e.category.id)?"checked":"unchecked",onClick:l}),(0,i.jsx)(Ya,{width:"3"}),(0,i.jsx)(Ar,{color:"gray800",css:{cursor:"pointer"},fontSize:"textMd",fontWeight:"medium",onClick:l,children:e.category.name}),(0,i.jsx)(Ya,{width:"3"}),(0,i.jsx)(rc,{color:"warning",size:"md",children:t("_1_membre_manq_31014",e.category.resources)}),(0,i.jsx)(Ya,{width:"3"}),(0,i.jsx)(Ar,{css:{flex:"1"}})]}),initialIsOpen:!0,children:(0,i.jsx)(Ba,{css:{background:"$gray100"},direction:"column",gap:"2",children:e.category.positions.map(e=>(0,i.jsx)(MN,{assignedResources:e.assignedResources,color:e.color,icon:e.icon,isSelected:s.includes(e.id),neededResources:e.resources,overlaps:!1,subtitle:e.range?n.toDisplayString(e.range):"-",title:e.name,onClick:()=>{r(ao(s,e.id))}},e.id))})})},LN=e=>{const t=Xn(),n=(0,L.useMemo)(()=>function(e,t,n,i,s,o){const{wishedPositionsSlots:r,possiblePositionsSlots:a,otherPositionsSlots:l}=wh(e,t,n,i,s,o),d=new Set,c=e=>Object.values((0,cc.A)(e,e=>e.positionCategory.id)).flatMap(e=>{const t=Object.values((0,cc.A)(e,e=>e.position.id)).flatMap(e=>{const t=e[0].position;return d.has(t.id)?[]:(d.add(t.id),t)});return 0===t.length?[]:[{...e[0].positionCategory,positions:t}]});return{wishedPositionsCategories:c(r),possiblePositionsCategories:c(a),otherPositionsCategories:c(l)}}(e.positionsSlots,e.wishedPositionsCategoriesIds,e.wishedPositionsIds,e.wishedPositionsSlotsIds,e.wishedRanges,e.userInfo.fields),[e.positionsSlots,e.userInfo,e.wishedPositionsCategoriesIds,e.wishedPositionsIds,e.wishedPositionsSlotsIds,e.wishedRanges]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ar,{font:"gray900 textMd medium",children:t("cat_gorie_mis_36044",n.wishedPositionsCategories.length)}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ar,{color:"gray500",children:t("cat_gories_ou_m_71206")}),(0,i.jsx)(Ya,{height:"3"}),n.wishedPositionsCategories.map(e=>(0,i.jsxs)(L.Fragment,{children:[(0,i.jsx)(NN,{category:e}),(0,i.jsx)(Ya,{height:"3"})]},e.id)),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(Ar,{font:"gray900 textMd medium",children:t("autre_cat_gorie_21569",n.possiblePositionsCategories.length)}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ar,{color:"gray500",children:t("cat_gories_ou_m_50063")}),(0,i.jsx)(Ya,{height:"3"}),n.possiblePositionsCategories.map(e=>(0,i.jsxs)(L.Fragment,{children:[(0,i.jsx)(NN,{category:e}),(0,i.jsx)(Ya,{height:"3"})]},e.id)),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(Ar,{font:"gray900 textMd medium",children:t("autre_cat_gorie_64824",n.otherPositionsCategories.length)}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ar,{color:"gray500",children:t("cat_gories_ou_m_74482")}),(0,i.jsx)(Ya,{height:"3"}),n.otherPositionsCategories.map(e=>(0,i.jsxs)(L.Fragment,{children:[(0,i.jsx)(NN,{category:e}),(0,i.jsx)(Ya,{height:"3"})]},e.id))]})},BN=e=>{const{translate:t}=vl(),{isPreAssign:n,teams:s}=DN(),o=(0,L.useMemo)(()=>!n&&so(s)?s.flatMap(t=>t.members.flatMap(t=>t.positionsSlotsUsersInfos.map(e=>e.positionSlotId).includes(e.positionSlotId)?[t.userInfo]:[])):[],[n,s,e.positionSlotId]);return so(o)?(0,i.jsxs)(Ba,{align:"center",css:{marginLeft:"auto"},gap:"1",children:[(0,i.jsx)(jk,{teamMembers:o}),(0,i.jsx)(Ar,{font:"gray800 textXs regular",children:t("_1_quipier_es_00024",o.length)})]}):null},VN=(e,t)=>{const n={weekday:"long",day:"numeric",month:"long",year:"numeric",hour:"numeric",minute:"numeric"};return m(t.name)?`${t.name} - ${e.toLocaleString(t.range,void 0,n)}`:e.toLocaleString(t.range,void 0,n)},UN=e=>{const t=Xn(),n=Zn(ph),{positionsSlotsIds:s,setPositionsSlotsIds:o}=DN(),r=(0,L.useMemo)(()=>e.positionsSlots.filter(t=>e.state===Pt.Assigned&&s.includes(t.id)),[e.state]),{wishedPositionsSlots:a,possiblePositionsSlots:l,otherPositionsSlots:d}=(0,L.useMemo)(()=>{const t=wh(e.positionsSlots,e.wishedPositionsCategoriesIds,e.wishedPositionsIds,e.wishedPositionsSlotsIds,e.wishedRanges,e.userInfo.fields),n=r.map(e=>e.id);return{wishedPositionsSlots:t.wishedPositionsSlots.filter(e=>!n.includes(e.id)),possiblePositionsSlots:t.possiblePositionsSlots.filter(e=>!n.includes(e.id)),otherPositionsSlots:t.otherPositionsSlots.filter(e=>!n.includes(e.id))}},[e.positionsSlots,e.userInfo,e.wishedPositionsCategoriesIds,e.wishedPositionsIds,e.wishedPositionsSlotsIds,e.wishedRanges]),c=(0,L.useMemo)(()=>{const e=a.concat(l).concat(d);return s.flatMap(t=>{const n=e.find(e=>e.id===t);return n?[n]:[]})},[a,l,d,s]);return(0,i.jsxs)(i.Fragment,{children:[e.state===Pt.Assigned&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ar,{font:"gray900 textMd medium",children:t("cr_neau_affect_50400",r.length)}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ar,{color:"gray500",children:t("cr_neaux_sur_le_05515",e.userInfo.name)}),(0,i.jsx)(Ya,{height:"3"}),r.map(e=>(0,i.jsxs)(L.Fragment,{children:[(0,i.jsx)(MN,{assignedResources:e.assignedResources,category:e.positionCategory.name,color:e.position.color,icon:e.position.icon,isSelected:s.includes(e.id),neededResources:e.resources,overlaps:yh(e,c),subtitle:VN(n,e),teamMembers:(0,i.jsx)(BN,{positionSlotId:e.id}),title:e.position.name,onClick:()=>{o(ao(s,e.id))}}),(0,i.jsx)(Ya,{height:"3"})]},e.id)),(0,i.jsx)(Ya,{height:"6"})]}),(0,i.jsx)(Ar,{font:"gray900 textMd medium",children:t("creneau_souhaite",a.length)}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ar,{color:"gray500",children:t("cr_neaux_dont_l_10130")}),(0,i.jsx)(Ya,{height:"3"}),a.map(e=>(0,i.jsxs)(L.Fragment,{children:[(0,i.jsx)(MN,{assignedResources:e.assignedResources,category:e.positionCategory.name,color:e.position.color,icon:e.position.icon,isSelected:s.includes(e.id),neededResources:e.resources,overlaps:yh(e,c),subtitle:VN(n,e),teamMembers:(0,i.jsx)(BN,{positionSlotId:e.id}),title:e.position.name,onClick:()=>{o(ao(s,e.id))}}),(0,i.jsx)(Ya,{height:"3"})]},e.id)),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(Ar,{font:"gray900 textMd medium",children:t("autre_creneau_possible",l.length)}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ar,{color:"gray500",children:t("cr_neaux_dont_l_99850")}),(0,i.jsx)(Ya,{height:"3"}),l.map(e=>(0,i.jsxs)(L.Fragment,{children:[(0,i.jsx)(MN,{assignedResources:e.assignedResources,category:e.positionCategory.name,color:e.position.color,icon:e.position.icon,isSelected:s.includes(e.id),neededResources:e.resources,overlaps:yh(e,c),subtitle:VN(n,e),teamMembers:(0,i.jsx)(BN,{positionSlotId:e.id}),title:e.position.name,onClick:()=>{o(ao(s,e.id))}}),(0,i.jsx)(Ya,{height:"3"})]},e.id)),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(Ar,{font:"gray900 textMd medium",children:t("autre_creneau",d.length)}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ar,{color:"gray500",children:t("cr_neaux_dont_l_25685")}),(0,i.jsx)(Ya,{height:"3"}),d.map(e=>(0,i.jsxs)(L.Fragment,{children:[(0,i.jsx)(MN,{assignedResources:e.assignedResources,category:e.positionCategory.name,color:e.position.color,icon:e.position.icon,isSelected:s.includes(e.id),neededResources:e.resources,overlaps:yh(e,c),subtitle:VN(n,e),teamMembers:(0,i.jsx)(BN,{positionSlotId:e.id}),title:e.position.name,onClick:()=>{o(ao(s,e.id))}}),(0,i.jsx)(Ya,{height:"3"})]},e.id))]})},WN=e=>{const t=Xn(),n=Zn(Jc),s=(0,L.useMemo)(()=>(e.positionsCategoriesIds||[]).map(t=>e.event.positionsCategories.find(e=>e.id===t).name).join(", "),[e.positionsCategoriesIds,e.event]),o=(0,L.useMemo)(()=>(e.positionsIds||[]).map(t=>e.event.positions.nodes.find(e=>e.id===t).name).join(", "),[e.positionsIds,e.event]),r=(0,L.useMemo)(()=>e.date?n.toLocaleString(e.date,eo.DateOnly.MonthLong):"",[e.date]),a=(0,L.useMemo)(()=>e.segmentId?e.event.segments.find(t=>t.id===e.segmentId).name:"",[e.segmentId,e.event]),l=(0,L.useMemo)(()=>(e.tagsIds||[]).map(t=>e.organization.tags.nodes.find(e=>e.id===t).name).join(", "),[e.tagsIds,e.organization]);return m(s)||m(o)||m(r)||m(a)||m(l)||e.excludeFull||e.excludePast?(0,i.jsxs)(Ba,{align:"center",gap:"3",wrap:"wrap",children:[m(s)&&(0,i.jsx)(rc,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setPositionsCategoriesIds(null)},children:t("cat_gories_1_42029",s)}),m(o)&&(0,i.jsx)(rc,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setPositionsIds(null)},children:t("missions_1_62834",o)}),m(r)&&(0,i.jsx)(rc,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setDate(null)},children:t("date_1_17337",r)}),m(a)&&(0,i.jsx)(rc,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setSegmentId(null)},children:t("vue_1_29260",a)}),m(l)&&(0,i.jsx)(rc,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setTagsIds(null)},children:t("tags_1_43158",l)}),e.excludeFull&&(0,i.jsx)(rc,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setExcludeFull(!1)},children:t("cr_neaux_comple_77561")}),e.excludePast&&(0,i.jsx)(rc,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setExcludePast(!1)},children:t("cr_neaux_dans_l_92999")}),(0,i.jsx)(Ar,{css:{cursor:"pointer"},font:"gray700 textXs medium",onClick:e.reset,children:t("r_initialiser_l_66835")})]}):null},GN=e=>{const t=Xn(),[n,s]=(0,L.useState)(e.positionsCategoriesIds),[o,r]=(0,L.useState)(e.positionsIds),[a,l]=(0,L.useState)(e.date),[d,c]=(0,L.useState)(e.segmentId?[e.segmentId]:[]),[u,h]=(0,L.useState)(e.tagsIds),[m,g]=(0,L.useState)(e.excludeFull?"checked":"unchecked"),[p,f]=(0,L.useState)(e.excludePast?"checked":"unchecked");return(0,i.jsxs)(Ba,{direction:"column",onChange:Dl,children:[(0,i.jsxs)(Ba,{css:{padding:"$2 $6 $4 $6"},direction:"column",gap:"4",children:[(0,i.jsx)(Ar,{font:"gray800 textMd medium",children:t("liste_des_filtr_75605")}),(0,i.jsx)(yc,{isSearchVisible:!0,multiple:!0,placeholder:t("s_lectionnez_de_97056"),renderOnPortal:!0,values:n||[],onChange:s,children:e.event.positionsCategories.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(yc,{isSearchVisible:!0,multiple:!0,placeholder:t("s_lectionnez_de_71859"),renderOnPortal:!0,values:o||[],onChange:r,children:e.event.positions.nodes.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(Mu,{max:e.event.endAt,min:e.event.startAt,placeholder:t("date_du_cr_neau_82295"),value:a,onChange:l}),(0,i.jsx)(yc,{isSearchVisible:!0,placeholder:t("s_lectionnez_un_19794"),renderOnPortal:!0,values:d,onChange:e=>{so(e)?c([(0,lu.A)(e)]):c([])},children:e.event.segments.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(yc,{isSearchVisible:!0,multiple:!0,placeholder:t("s_lectionnez_de_73255"),renderOnPortal:!0,values:u||[],onChange:h,children:e.organization.tags.nodes.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(_c,{state:m,onClick:g,children:t("masquer_les_cr_14425")}),(0,i.jsx)(_c,{state:p,onClick:f,children:t("masquer_les_cr_05336")})]}),(0,i.jsxs)(Ba,{align:"center",css:{borderTop:"1px solid $gray200",padding:"$4 $6 $2 $6"},gap:"4",justify:"end",children:[(0,i.jsx)(Ar,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{e.reset(),e.close()},children:t("r_initialiser_77538")}),(0,i.jsx)(zl,{size:"sm",onClick:()=>{e.setDate(a),e.setExcludeFull("checked"===m),e.setExcludePast("checked"===p),e.setPositionsCategoriesIds(n),e.setPositionsIds(o),e.setSegmentId(so(d)?d[0]:null),e.setTagsIds(u),e.close()},children:t("appliquer_05753")})]})]})},HN=e=>{const t=Xn(),[n,s]=(0,L.useState)(!1),o=(0,L.useCallback)(()=>{e.setDate(null),e.setExcludeFull(!1),e.setExcludePast(!1),e.setPositionsCategoriesIds(null),e.setPositionsIds(null),e.setSegmentId(null),e.setTagsIds(null)},[e.setDate,e.setExcludeFull,e.setExcludePast,e.setPositionsCategoriesIds,e.setPositionsIds,e.setSegmentId,e.setTagsIds]);return(0,i.jsxs)(Ba,{direction:"column",gap:"3",width:1,children:[(0,i.jsxs)(Ba,{gap:"3",children:[(0,i.jsx)(Bl,{icon:"magnifying-glass",placeholder:t("rechercher_un_p_70410"),value:e.name,onChange:e.setName}),(0,i.jsxs)(Wd,{doNotCloseOnOtherOpen:!0,isOpen:n,onStateChange:s,children:[(0,i.jsx)(Xd,{children:(0,i.jsx)(Ar,{children:(0,i.jsx)(zl,{color:"white",leftIcon:"bars-filter",children:t("filtres_64574")})})}),(0,i.jsx)(Zd,{placement:"bottom-end",width:385,children:(0,i.jsx)(GN,{...e,close:()=>{s(!1)},reset:o})})]})]}),(0,i.jsx)(WN,{...e,reset:o})]})},qN=e=>{const{eventId:t}=ti(),{isPreAssign:n}=DN(),[s,o,r]=Wc(""),[a,l]=kz("assignment.filters.positionsCategoriesIds",null),[d,c]=kz("assignment.filters.positionsIds",null),[u,h]=kz("assignment.filters.date",null),[g,p]=kz("assignment.filters.tagsIds",null),[f,_]=kz("assignment.filters.segmentId",null),[x,I]=kz("assignment.filters.excludeFull",!1),[v,b]=kz("assignment.filters.excludePast",!1),{data:j,loader:C}=Qn("query AssignmentSlots(\n $eventId: EventId!\n $name: String\n $positionsCategoriesIds: [PositionsCategoryId!]\n $positionsIds: [PositionId!]\n $date: Date\n $tagsIds: [TagId!]\n $segmentId: SegmentId\n $excludeFull: Boolean\n $excludePast: Boolean\n) {\n event(id: $eventId) {\n positionsSlots(\n positionName: $name\n positionsCategoriesIds: $positionsCategoriesIds\n positionsIds: $positionsIds\n date: $date\n tagsIds: $tagsIds\n segmentId: $segmentId\n excludeFull: $excludeFull\n excludePast: $excludePast\n ) {\n nodes {\n id\n name\n range\n assignedResources\n resources\n\n positionCategory {\n id\n name\n resources\n }\n\n position {\n id\n name\n color\n icon\n assignedResources\n resources\n range\n\n ...PositionPositionsCustomFields\n }\n }\n }\n }\n}\n",{eventId:t,name:m(o)?o:void 0,positionsCategoriesIds:so(a)?a:void 0,positionsIds:so(d)?d:void 0,date:u,tagsIds:so(g)?g:void 0,segmentId:f,excludeFull:x,excludePast:v},[Vs.PositionPositionsCustomFieldsFragment]);return(0,i.jsxs)(Ba,{css:{background:"$gray50",minHeight:"100%",padding:"$6 $7"},direction:"column",width:1,children:[(0,i.jsx)(HN,{date:u,event:e.event,excludeFull:x,excludePast:v,name:s,organization:e.organization,positionsCategoriesIds:a,positionsIds:d,segmentId:f,setDate:h,setExcludeFull:I,setExcludePast:b,setName:r,setPositionsCategoriesIds:l,setPositionsIds:c,setSegmentId:_,setTagsIds:p,tagsIds:g}),(0,i.jsx)(Ya,{height:"7"}),C||(n?(0,i.jsx)(LN,{positionsSlots:j.event?.positionsSlots.nodes??[],userInfo:e.userInfo,wishedPositionsCategoriesIds:e.wishedPositionsCategoriesIds,wishedPositionsIds:e.wishedPositionsIds,wishedPositionsSlotsIds:e.wishedPositionsSlotsIds,wishedRanges:e.wishedRanges}):(0,i.jsx)(UN,{positionsSlots:j.event?.positionsSlots.nodes??[],state:e.state,userInfo:e.userInfo,wishedPositionsCategoriesIds:e.wishedPositionsCategoriesIds,wishedPositionsIds:e.wishedPositionsIds,wishedPositionsSlotsIds:e.wishedPositionsSlotsIds,wishedRanges:e.wishedRanges}))]})},KN=e=>{const{history:t,translate:n,params:{organizationId:s,eventId:o,userInfoId:r}}=vl(),a=ii().pathname.includes("pre-assignment"),{isEventAdmin:l}=wb();Md(n("affectations_1_71402",e.event.volunteerRegistration.userInfo.name));const[d,c]=kz("assignment.isLeftPanelOpen",!0),[u,h]=kz("assignment.isRightPanelOpen",!0),[g,p,f]=Wc(""),[_,x]=kz("assignment.leftPanelDirection",yt.Desc),[I,v]=kz("assignment.leftPanelSegmentId",-1),[b,j]=kz("assignment.leftPanelStates",[Pt.WaitingAssignment,Pt.PreAssigned]),{data:C,isLoading:y}=Co({eventId:o,states:b,name:m(p)?p:void 0,segmentId:-1===I?void 0:I,direction:_,loadDelegations:!1}),k=(0,L.useCallback)(()=>{const e=C.event?.volunteersRegistrations.nodes??[],n=e.findIndex(e=>e.userInfo.id===r),i=e[n+1]?.userInfo.id??e[0].userInfo.id;i===r?t.goBack(Ps.ASSIGNMENTS(s,o)):a?t.replace(Ps.PRE_ASSIGNMENT(s,o,i)):t.replace(Ps.ASSIGNMENT(s,o,i))},[a,s,o,r,C.event]),A=e.event.volunteerRegistration,w=(0,L.useMemo)(()=>A.positionsSlotsUsersInfos.map(({positionSlotId:e})=>e),[A]),S=(0,L.useMemo)(()=>({wishedPositionsCategoriesIds:A.positionsCategories.map(({id:e})=>e),wishedPositionsIds:A.positions.map(({id:e})=>e),wishedPositionsSlotsIds:A.positionsSlots.map(({id:e})=>e),wishedRanges:A.slots.map(({range:e})=>e)}),[A]);return(0,i.jsx)($N,{isEdit:e.isEdit,positionsCategoriesIds:A.preassignPositionsCategoriesIds,positionsIds:A.preassignPositionsIds,positionsSlotsIds:w,showNextVolunteer:k,teams:A.teams,children:(0,i.jsx)(LM,{buttons:(0,i.jsx)(PN,{isEdit:e.isEdit,userInfoId:A.userInfo.id,volunteerRegistrationId:A.id}),header:(0,i.jsx)(BM,{badgeColorIcon:Cj(A.state),insertedAt:A.insertedAt,isPreAssign:a,showTabs:l,showTeam:!0,teams:A.teams,userInfo:A.userInfo}),isEdit:e.isEdit,isLeftPanelOpen:d,isRightPanelOpen:u,leftPanel:(0,i.jsx)(WM,{accreditationStates:[],delegationId:null,direction:_,event:C.event,getPath:e=>a?Ps.PRE_ASSIGNMENT(s,o,e):Ps.ASSIGNMENT(s,o,e),isLoading:y,loadDelegations:!1,name:g,segmentId:I,setAccreditationStates:td.A,setDelegationId:td.A,setDirection:x,setName:f,setSegmentId:v,setStates:j,showAccreditationStates:!1,showStates:!0,states:b,userInfoId:A.userInfoId}),rightPanel:(0,i.jsx)(JM,{customFields:e.event.formsCustomsFields,eventId:o,formsUsersInfos:e.organization.userInfo.formsUsersInfos,organizationId:s,showWishedAccreditations:!1,showWishedPositions:!0,userInfo:e.event.volunteerRegistration.userInfo,onCollapse:()=>{h(!1)}}),setIsLeftPanelOpen:c,setIsRightPanelOpen:h,children:(0,i.jsx)(qN,{event:e.event,organization:e.organization,state:A.state,userInfo:A.userInfo,...S})})})},YN=e=>{const{organizationId:t,eventId:n,userInfoId:s}=ti(),{data:o,loader:r}=Qn("query AssignmentInfos(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $userInfoId: UsersInfoId!\n) {\n organization(id: $organizationId) {\n tags {\n nodes {\n id\n name\n }\n }\n\n userInfo(id: $userInfoId) {\n ...FormsUsersInfosWished\n }\n }\n\n event(id: $eventId) {\n startAt\n endAt\n\n formsCustomsFields {\n ...CustomFieldWithCondition\n }\n\n positionsCategories {\n id\n name\n }\n\n positions {\n nodes {\n id\n name\n }\n }\n\n segments(segmentType: Positions) {\n id\n name\n }\n\n volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n id\n userInfoId\n state\n preassignPositionsIds\n preassignPositionsCategoriesIds\n isTeamMember\n insertedAt\n\n teams {\n leaderUserInfoId\n teamCode\n\n members {\n positionsSlotsUsersInfos {\n positionSlotId\n }\n\n userInfo {\n ...UserInfoTeamMember\n }\n }\n }\n\n userInfo {\n id\n name\n email\n fields\n picture {\n url\n }\n }\n\n positionsCategories {\n id\n }\n\n positions {\n id\n }\n\n positionsSlots {\n id\n }\n\n slots: slotsMerged {\n range\n }\n\n positionsSlotsUsersInfos {\n positionSlotId\n }\n }\n }\n}\n",{organizationId:t,eventId:n,userInfoId:s},[Vs.FormsUsersInfosWishedFragment,Vs.CustomFieldWithConditionFragment,Vs.UserInfoTeamMemberFragment]);return r||(0,i.jsx)(KN,{event:o.event,isEdit:e.isEdit,organization:o.organization})},ZN=e=>{const t=Xn(),{mutate:n,isLoading:s}=function(e={}){return ei("mutation SendAssignmentsEmails(\n $eventId: EventId!\n $sendAssignmentsEmails: SendAssignmentsEmailsInput!\n) {\n eventAssignmentsEmailsSend(eventId: $eventId, sendAssignmentsEmails: $sendAssignmentsEmails)\n}\n",e)}();return(0,i.jsxs)(au,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(sC,{color:"warning",css:{margin:"auto"},icon:"triangle-exclamation"}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(Ar,{font:"gray900 textLg medium",textAlign:"center",children:t("_tes_vous_sur_d_58206",e.numberOfEmails)}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ar,{color:"gray500",textAlign:"center",children:t("les_membres_pr_53976")}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsxs)(Ba,{gap:"3",justify:"end",children:[(0,i.jsx)(zl,{isLoading:s,onClick:async()=>{await n({eventId:e.eventId,sendAssignmentsEmails:e.sendAssignmentsEmails}),e.reload(),e.onClose()},children:t("confirmer_l_env_08749")}),(0,i.jsx)(zl,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},XN=e=>{const t=Xn(),[n,s,o]=Wc(""),[r,a]=(0,L.useState)([]),{data:l}=qr({eventId:e.eventId,usersInfosIds:r,name:m(s)?s:void 0}),{mutate:d,isLoading:c}=function(e={}){return ei("mutation AssignmentsEmailsEstimate(\n $eventId: EventId!\n $sendAssignmentsEmails: SendAssignmentsEmailsInput!\n) {\n eventAssignmentsEmailsEstimate(eventId: $eventId, sendAssignmentsEmails: $sendAssignmentsEmails)\n}\n",e)}(),[u,h]=(0,L.useState)(ce.Everyone),g=(0,L.useMemo)(()=>(0,xh.A)((l.event?.volunteersRegistrations.nodes??[]).concat(l.event?.selectedVolunteersRegistrations.nodes??[]),e=>e.id),[l.event]),[p,f]=(0,L.useState)([]),_=u===ce.Everyone||u===ce.Assigned||u===ce.Refused||u===ce.Members&&so(r)||u===ce.Segments&&so(p),x=!(!e.emailSender||e.emailSender.isValidToSendEmail);return(0,i.jsxs)(au,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(sC,{color:"purple",css:{margin:"auto"},icon:"paper-plane"}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(Ar,{color:"gray900",fontSize:"textLg",fontWeight:"medium",textAlign:"center",children:t("envoi_des_e_mai_81363")}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ar,{color:"gray500",textAlign:"center",children:t("personnaliser_v_78340")}),(0,i.jsx)(Ya,{height:"7"}),x&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(rl,{color:"error",leftIcon:"circle-exclamation",children:t("vous_ne_pouvez_69435")}),(0,i.jsx)(Ya,{height:"4"})]}),(0,i.jsx)(Ar,{color:"gray800",fontWeight:"medium",children:t("que_souhaitez_v_01732")}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(vc,{state:u===ce.Everyone?"checked":"unchecked",onClick:()=>{h(ce.Everyone)},children:t("tous_les_e_mail_39319")}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:u===ce.Assigned?"checked":"unchecked",onClick:()=>{h(ce.Assigned)},children:t("tous_les_e_mail_42685")}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:u===ce.Refused?"checked":"unchecked",onClick:()=>{h(ce.Refused)},children:t("tous_les_e_mail_41162")}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:u===ce.Members?"checked":"unchecked",onClick:()=>{h(ce.Members)},children:t("_certains_memb_91094")}),u===ce.Members&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(Ar,{css:{paddingLeft:"$6"},children:(0,i.jsx)(yc,{isSearchVisible:!0,multiple:!0,searchElement:(0,i.jsx)(Bl,{icon:"magnifying-glass",placeholder:t("rechercher_50038"),state:"search",value:n,onChange:o}),values:r,onChange:a,children:g.map(e=>(0,i.jsx)("option",{value:e.userInfo.id,children:e.userInfo.nameOrEmail},e.userInfo.id))})})]}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:u===ce.Segments?"checked":"unchecked",onClick:()=>{h(ce.Segments)},children:t("uniquement_ce_54026")}),u===ce.Segments&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(Ar,{css:{paddingLeft:"$6"},children:(0,i.jsx)(yc,{isSearchVisible:!0,multiple:!0,values:p,onChange:f,children:(l.event?.segments??[]).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})})]}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsxs)(Ba,{gap:"3",justify:"end",children:[(0,i.jsx)(zl,{disabled:x,isLoading:c,onClick:async()=>{if(_){const t={recipients:u,segmentsIds:p,usersInfosIds:r},{eventAssignmentsEmailsEstimate:n}=await d({eventId:e.eventId,sendAssignmentsEmails:t});e.onSuccess(n,t),e.onClose()}},children:t("envoyer_les_e_m_37846")}),(0,i.jsx)(zl,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},JN=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:s}}=vl(),{localEvent:o,setNumberOfWaitingAssigments:r}=wb(),{data:a,loader:l,reload:d}=Qn('query AssignmentsKpis(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $direction: SortDirection!\n) {\n organization(id: $organizationId) {\n emailTemplate(emailType: Assignments, eventId: $eventId) {\n emailSender {\n isValidToSendEmail\n }\n }\n }\n\n event(id: $eventId) {\n hasFormWithTeamsAllowed\n\n emailsStats(emailTypes: [Assignments, Refused]) {\n numberOfClick\n numberOfOpen\n numberOfSent\n numberOfWaiting\n }\n\n waitingAssignment: volunteersRegistrations(\n states: [PreAssigned, WaitingAssignment]\n limit: 1\n sort: { attribute: "InsertedAt", direction: $direction }\n ) {\n nodes {\n userInfoId\n }\n\n totalCount\n }\n\n assigned: volunteersRegistrations(\n states: [Assigned]\n limit: 1\n sort: { attribute: "InsertedAt", direction: $direction }\n ) {\n totalCount\n }\n\n waitingTeams: teams(state: WaitingAssignment, limit: 1) {\n nodes {\n teamCode\n }\n\n totalCount\n }\n }\n}\n',{organizationId:n,eventId:s,direction:o?.["assignment.leftPanelDirection"]??yt.Desc},[]);const c=Bc(),[u,h,g]=Wc(""),[p,f]=(0,L.useState)(""),[_,x]=(0,L.useState)(0),{data:I,isLoading:v,reload:b}=function(e){return Qn("query AssignmentsEmails($eventId: EventId!, $name: String, $state: EmailState, $offset: Int) {\n event(id: $eventId) {\n emails(\n emailTypes: [Assignments, Refused]\n name: $name\n state: $state\n limit: 25\n offset: $offset\n ) {\n nodes {\n ...EmailRecipient\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",e,[Vs.EmailRecipientFragment])}({eventId:s,name:m(h)?h:void 0,state:""!==p?p:void 0,offset:_}),[j,C]=(0,L.useState)(!1),[y,k]=(0,L.useState)(null),[A,w]=(0,L.useState)(0),[S,E]=(0,L.useState)(!1);return(0,L.useEffect)(()=>{a.event?.waitingAssignment&&r(a.event.waitingAssignment.totalCount)},[a]),l||(0,i.jsxs)(Ba,{css:{padding:"$7"},direction:"column",children:[(0,i.jsx)(Ar,{color:"gray900",css:{flex:"1"},fontSize:"displayXs",fontWeight:"semiBold",children:t("mes_affectation_73224")}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsxs)(Ba,{gap:"6",children:[(0,i.jsx)(uS,{button:(0,i.jsxs)(i.Fragment,{children:[a.event.hasFormWithTeamsAllowed&&(0,i.jsx)(zl,{color:"invisible",disabled:0===a.event.waitingTeams.totalCount,onClick:()=>{e.push(Ps.TEAM_ASSIGNMENT(n,s,a.event.waitingTeams.nodes[0].teamCode))},children:t("affecter_les_q_17322")}),(0,i.jsx)(zl,{disabled:0===a.event.waitingAssignment.totalCount,onClick:()=>{e.push(Ps.ASSIGNMENT(n,s,a.event.waitingAssignment.nodes[0].userInfoId))},children:t("affecter_les_me_77160")})]}),icon:"arrow-trend-up",iconColor:"success",text:t("membre_en_atten_84228",a.event.waitingAssignment.totalCount),value:a.event.waitingAssignment.totalCount}),(0,i.jsx)(uS,{button:(0,i.jsx)(zl,{onClick:()=>{C(!0)},children:t("param_trer_et_e_31095")}),icon:"at",iconColor:"success",text:t("e_mail_de_confi_84099",a.event.emailsStats.numberOfWaiting),value:a.event.emailsStats.numberOfWaiting}),(0,i.jsx)(uS,{button:(0,i.jsx)(zl,{onClick:()=>{e.push(Ps.VOLUNTEERS(n,s))},children:t("voir_les_membre_27923")}),icon:"user-check",iconColor:"success",text:t("membre_affect_05484",a.event.assigned.totalCount),value:a.event.assigned.totalCount})]}),(0,i.jsx)(Ya,{height:"9"}),(0,i.jsx)(Ar,{color:"gray900",fontSize:"textLg",fontWeight:"medium",children:t("historique_des_68195")}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsxs)(Ba,{gap:"6",children:[(0,i.jsx)(uS,{icon:"paper-plane",iconColor:"purple",text:t("nombre_d_envois_95106"),value:a.event.emailsStats.numberOfSent??0}),(0,i.jsx)(uS,{icon:"eye",iconColor:"success",text:t("nombre_d_ouvert_84187"),value:a.event.emailsStats.numberOfOpen??0}),(0,i.jsx)(uS,{icon:"hand-pointer",iconColor:"primary",text:t("nombre_de_clics_64232"),value:a.event.emailsStats.numberOfClick??0})]}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(Lc,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ar,{width:200,children:(0,i.jsxs)($u,{value:p,onChange:e=>{f(e),x(0)},children:[(0,i.jsx)("option",{value:"",children:t("tous_les_status_67644")}),c(cn.filter(e=>e!==Oe.Queued))]})}),(0,i.jsx)(Ar,{width:320,children:(0,i.jsx)(Bl,{icon:"magnifying-glass",placeholder:t("rechercher_un_d_02329"),value:u,onChange:e=>{g(e),x(0)}})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Gc,{children:t("nom_du_membre_69353")}),(0,i.jsx)(Gc,{children:t("date_d_envoi_74668")}),(0,i.jsx)(Gc,{children:t("status_06428")}),(0,i.jsx)(Gc,{width:100})]}),numberOfPages:I.event?.emails.numberOfPages??0,offset:_,rows:v?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Hc,{bx:!0}),(0,i.jsx)(Hc,{bx:!0}),(0,i.jsx)(Hc,{bx:!0})]}):so(I.event.emails.nodes)?(0,i.jsx)(i.Fragment,{children:I.event.emails.nodes.map(e=>(0,i.jsx)(vj,{email:e,emailType:$e.Assignments,reload:b},e.id))}):(0,i.jsx)(Sk,{subtitle:t("vous_n_avez_pas_92612"),title:t("aucun_courriel_12121")}),setOffset:x,title:t("liste_des_envoi_52697"),totalCount:I.event?.emails.totalCount??0}),j&&(0,i.jsx)(XN,{emailSender:a.organization.emailTemplate?.emailSender,eventId:s,onClose:()=>{C(!1)},onSuccess:(e,t)=>{w(e),k(t),E(!0)}}),S&&(0,i.jsx)(ZN,{eventId:s,numberOfEmails:A,reload:d,sendAssignmentsEmails:y,onClose:()=>{E(!1)}})]})},QN=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:s}}=vl(),{localEvent:o}=wb(),{data:r,loader:a}=Qn('query PreAssignmentsKpis($eventId: EventId!, $direction: SortDirection!) {\n event(id: $eventId) {\n preAssigneds: volunteersRegistrations(\n states: [PreAssigned]\n limit: 1\n sort: { attribute: "InsertedAt", direction: $direction }\n ) {\n nodes {\n userInfoId\n }\n\n totalCount\n }\n }\n}\n',{eventId:s,direction:o?.["assignment.leftPanelDirection"]??yt.Desc},[]);return a||(0,i.jsxs)(Ba,{css:{padding:"$7"},direction:"column",children:[(0,i.jsx)(Ar,{color:"gray900",css:{flex:"1"},fontSize:"displayXs",fontWeight:"semiBold",children:t("mes_affectation_73224")}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(Ba,{gap:"6",children:(0,i.jsx)(uS,{button:(0,i.jsx)(zl,{disabled:0===r.event.preAssigneds.totalCount,onClick:()=>{e.push(Ps.ASSIGNMENT(n,s,r.event.preAssigneds.nodes[0].userInfoId))},children:t("affecter_les_me_77160")}),icon:"arrow-trend-up",iconColor:"success",text:t("membre_en_atten_84228",r.event.preAssigneds.totalCount),value:r.event.preAssigneds.totalCount})})]})},eL=()=>{const{translate:e,params:{eventId:t}}=vl(),{event:{name:n},hasPermission:s,updateLocalEvent:o}=wb(),r=s(Hb.MEMBER_ASSIGN,{eventId:t});return Md(`${n} ${e("mes_affectation_73224")}`),(0,L.useEffect)(()=>{(async()=>{await Promise.all([o({"assignment.filters.positionsCategoriesIds":null}),o({"assignment.filters.positionsIds":null}),o({"assignment.filters.date":null}),o({"assignment.filters.tagsIds":null}),o({"assignment.filters.segmentId":null}),o({"assignment.filters.excludeFull":!1})])})()},[]),r?(0,i.jsx)(JN,{}):(0,i.jsx)(QN,{})},tL=e=>{const{history:t,translate:n,params:{organizationId:s,eventId:o,teamCode:r}}=vl(),a=r===e.team.teamCode,[l,d]=(0,L.useState)(a);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ba,{align:"center",css:{background:a?"$primary100":"white",borderBottom:l?"none":"1px solid $gray200",cursor:"pointer",padding:"$4","&:hover":{background:"$primary100"}},gap:"4",onClick:()=>{t.push(Ps.TEAM_ASSIGNMENT(s,o,e.team.teamCode))},children:[(0,i.jsxs)(Ba,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(Ar,{font:"gray800 textSm semiBold",children:e.team.teamCode}),(0,i.jsx)(Ar,{color:"gray500",children:n("_1_membre_49737",e.team.members.length)})]}),(0,i.jsx)(Ar,{color:"gray900",css:{cursor:"pointer",padding:"$2"},fontSize:"textMd",onClick:e=>{Dl(e),d(!l)},children:(0,i.jsx)(nl,{icon:l?"chevron-down":"chevron-right"})})]}),l&&e.team.members.map((n,r)=>(0,i.jsx)(VM,{displayBorder:r===e.team.members.length-1,isSelected:a,vr:n,onClick:()=>{t.push(Ps.TEAM_ASSIGNMENT(s,o,e.team.teamCode))}},n.userInfo.id))]})},nL=e=>{const{params:{organizationId:t,eventId:n,teamCode:s},translate:o}=vl(),r=e.event?.teams.totalCount??0,a=e.event?.teams.nodes??[];return(0,i.jsxs)(Ba,{direction:"column",height:1,width:1,children:[(0,i.jsxs)(Ba,{css:{padding:"$5 $4"},direction:"column",gap:"2",children:[(0,i.jsx)(Sj,{color:"primary",returnPathFallback:Ps.TEAM_ASSIGNMENT(t,n,s),children:o("retour_92202")}),(0,i.jsxs)(Ba,{align:"center",gap:"2",children:[(0,i.jsx)(Ar,{font:"gray900 textLg medium",children:o("affectation_plural")}),(0,i.jsx)(rc,{color:"error",size:"sm",children:o("_1_quipe_rest_49090",r)})]})]}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(Ba,{css:{flex:"1",overflowY:"auto"},direction:"column",children:e.isLoading?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(UM,{}),(0,i.jsx)(UM,{}),(0,i.jsx)(UM,{})]}):a.map(e=>(0,i.jsx)(tL,{team:e},e.teamCode))})]})},iL=()=>{const{translate:e,params:{eventId:t,teamCode:n}}=vl(),{positionsSlotsIds:s,showNextVolunteer:o}=DN(),{mutate:r,isLoading:a}=function(e={}){return ei("mutation TeamAssignmentRefuse($eventId: EventId!, $teamCode: TeamCode!) {\n teamAssignmentRefuse(eventId: $eventId, teamCode: $teamCode)\n}\n",e)}(),{mutate:l,isLoading:d}=function(e={}){return ei("mutation TeamAssign($eventId: EventId!, $teamCode: TeamCode!, $assignment: AssignmentInput!) {\n teamAssign(eventId: $eventId, teamCode: $teamCode, assignment: $assignment)\n}\n",e)}();return(0,i.jsxs)(Ba,{align:"center",css:{borderTop:"1px solid $gray200",px:"$7"},gap:"4",height:1,width:1,children:[(0,i.jsx)(Ar,{color:"error700",css:{cursor:"pointer"},onClick:async()=>{d||a||(await r({eventId:t,teamCode:n}),o())},children:e("refuser_l_quip_29246")}),(0,i.jsx)(Ar,{css:{flex:"1"}}),(0,i.jsx)(zl,{color:"primary",isLoading:d,onClick:async()=>{d||a||(await l({eventId:t,teamCode:n,assignment:{positionsSlotsIds:s}}),o())},children:e("affecter_l_qui_23291")}),(0,i.jsx)(zl,{color:"white",onClick:o,children:e("affecter_l_qui_37763")})]})},sL=e=>{const t=Xn();return(0,i.jsx)(Ba,{align:"center",css:{padding:"$5 $6"},gap:"4",children:(0,i.jsxs)(Ba,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(Ar,{font:"gray900 textXl medium",children:e.team.teamCode}),(0,i.jsx)(Ar,{color:"gray500",children:t("_1_membre_49737",e.team.members.length)})]})})},oL=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=vl(),o=(0,L.useMemo)(()=>e.team.leaderUserInfo.formsUsersInfos.filter(t=>t.form.id===e.team.formId),[e.team]);return(0,i.jsxs)(Ba,{direction:"column",height:1,width:1,children:[(0,i.jsxs)(Ba,{align:"center",css:{padding:"$6"},gap:"3",children:[(0,i.jsxs)(km,{children:[(0,i.jsx)(Sm,{children:(0,i.jsx)(Ar,{color:"gray800",css:{cursor:"pointer"},fontSize:"textLg",onClick:e.onCollapse,children:(0,i.jsx)(nl,{icon:"sidebar"})})}),(0,i.jsx)(wm,{placement:"top",children:t("cacher_les_info_67266")})]}),(0,i.jsx)(Ar,{font:"gray900 textMd semiBold",children:t("_propos_de_l_47506")})]}),e.team.members.map(n=>(0,i.jsx)(YM,{customFields:e.customFields,formsIds:[e.team.formId],title:t("informations_de_63884",n.userInfo.nameOrEmail),userInfo:n.userInfo},n.id)),(0,i.jsx)(ZM,{eventId:s,formsUsersInfos:o,organizationId:n}),(0,i.jsx)(XM,{formsUsersInfos:o})]})},rL=e=>{const{history:t,params:{organizationId:n,eventId:s,teamCode:o}}=vl(),[r,a]=kz("assignment.isLeftPanelOpen",!0),[l,d]=kz("assignment.isRightPanelOpen",!0),{data:c,isLoading:u}=Qn("query TeamAssignmentWaitingTeams($eventId: EventId!) {\n event(id: $eventId) {\n teams(state: WaitingAssignment) {\n nodes {\n teamCode\n\n members {\n ...VolunteerRegistrationWaitingAssignment\n }\n }\n\n totalCount\n }\n }\n}\n",{eventId:s},[Vs.VolunteerRegistrationWaitingAssignmentFragment]),h=(0,L.useCallback)(()=>{const e=c.event?.teams.nodes??[],i=e.findIndex(e=>e.teamCode===o),r=e[i+1]?.teamCode??e[0].teamCode;r===o?t.goBack(Ps.ASSIGNMENTS(n,s)):t.replace(Ps.TEAM_ASSIGNMENT(n,s,r))},[n,s,o,c.event]),m=e.event.team,g=(0,L.useMemo)(()=>({wishedPositionsCategoriesIds:m.positionsCategoriesIds,wishedPositionsIds:m.positionsIds,wishedPositionsSlotsIds:m.positionsSlotsIds,wishedRanges:m.slots.map(({range:e})=>e)}),[m]);return(0,i.jsx)($N,{isEdit:!1,positionsCategoriesIds:[],positionsIds:[],positionsSlotsIds:[],showNextVolunteer:h,teams:[],children:(0,i.jsx)(LM,{buttons:(0,i.jsx)(iL,{}),header:(0,i.jsx)(sL,{team:m}),isEdit:!1,isLeftPanelOpen:r,isRightPanelOpen:l,leftPanel:(0,i.jsx)(nL,{event:c.event,isLoading:u}),rightPanel:(0,i.jsx)(oL,{customFields:e.event.formsCustomsFields,team:m,onCollapse:()=>{d(!1)}}),setIsLeftPanelOpen:a,setIsRightPanelOpen:d,children:(0,i.jsx)(qN,{event:e.event,organization:e.organization,state:Pt.NotApplicable,userInfo:m.leaderUserInfo,...g})})})},aL=()=>{const{params:{organizationId:e,eventId:t,teamCode:n}}=vl(),{data:s,loader:o}=Qn("query TeamAssignmentInfos(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $teamCode: TeamCode!\n) {\n organization(id: $organizationId) {\n tags {\n nodes {\n id\n name\n }\n }\n }\n\n event(id: $eventId) {\n startAt\n endAt\n\n formsCustomsFields {\n ...CustomFieldWithCondition\n }\n\n positionsCategories {\n id\n name\n }\n\n positions {\n nodes {\n id\n name\n }\n }\n\n segments(segmentType: Positions) {\n id\n name\n }\n\n team(teamCode: $teamCode) {\n teamCode\n formId\n\n leaderUserInfo {\n name\n fields\n\n ...FormsUsersInfosWished\n }\n\n members {\n id\n\n userInfo {\n email\n nameOrEmail\n fields\n }\n }\n\n positionsCategoriesIds\n positionsIds\n positionsSlotsIds\n\n slots: slotsMerged {\n range\n }\n }\n }\n}\n",{organizationId:e,eventId:t,teamCode:n},[Vs.CustomFieldWithConditionFragment,Vs.FormsUsersInfosWishedFragment]);return o||(0,i.jsx)(rL,{event:s.event,organization:s.organization})},lL=()=>{const{history:e,params:{organizationId:t,eventId:n},translate:s}=vl(),{event:{name:o},isEventAdmin:r}=wb(),{canCampaignSend:a}=$S();Md(`${o} ${s("Campaigns")}`);const l=Bc(),[d,c]=(0,L.useState)(""),[u,h]=(0,L.useState)(""),g=Uc(e=>{h(e),b()}),[p,f]=(0,L.useState)(""),[_,x]=(0,L.useState)(""),[I,v]=(0,L.useState)(0),b=()=>{v(0)},[j,C]=(0,L.useState)(null),{data:y,isLoading:k,reload:A}=Qn("query Campaigns(\n $eventId: EventId!\n $name: String\n $states: [CampaignState!]\n $campaignType: CampaignType\n $offset: Int\n $sort: CampaignsSort\n) {\n event(id: $eventId) {\n campaignsCost\n\n campaigns(\n name: $name\n states: $states\n campaignType: $campaignType\n limit: 25\n offset: $offset\n sort: $sort\n ) {\n nodes {\n ...CampaignList\n }\n\n numberOfPages\n totalCount\n }\n\n doneCampaigns: campaigns(states: [Done]) {\n totalCount\n }\n }\n}\n",{eventId:n,name:m(u)?u:void 0,states:""!==p?[p]:void 0,campaignType:""!==_?_:void 0,offset:I,sort:j},[Vs.CampaignListFragment]);return I$(y.event?.campaigns.nodes??[],A),(0,i.jsxs)(dj,{children:[(0,i.jsxs)(lj,{children:[(0,i.jsx)(Ar,{css:{flex:"1"},font:"gray900 displayXs semiBold",children:s("Campaigns")}),r?(0,i.jsx)(nE,{menu:(0,i.jsx)(Kd,{icon:"paper-plane",onClick:()=>{e.push($I.CREATE_TEMPLATE({organizationId:t,eventId:n}))},children:s("cr_er_un_mod_le_20298")}),onClick:()=>{e.push($I.CREATE({organizationId:t,eventId:n}))},children:s("cr_er_une_campa_96023")}):a?(0,i.jsx)(zl,{to:$I.CREATE({organizationId:t,eventId:n}),children:s("cr_er_une_campa_96023")}):null]}),(0,i.jsxs)(aj,{children:[(0,i.jsxs)(Ba,{gap:"4",children:[(0,i.jsx)(fj,{content:y.event?.doneCampaigns.totalCount??"-",title:s("nombre_de_campa_52133")}),(0,i.jsx)(fj,{content:y.event?.campaignsCost??"-",title:s("co_t_des_campag_08459")})]}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(Ba,{css:{boxShadow:"$xs"},direction:"column",children:(0,i.jsx)(Lc,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ar,{width:200,children:(0,i.jsxs)($u,{value:p,onChange:e=>{f(e),b()},children:[(0,i.jsx)("option",{value:"",children:s("toutes_les_camp_81617")}),l(en)]})}),(0,i.jsx)(Ar,{width:200,children:(0,i.jsxs)($u,{value:_,onChange:e=>{x(e),b()},children:[(0,i.jsx)("option",{value:"",children:s("sms_et_e_mail_94587")}),l(tn)]})}),(0,i.jsx)(Ar,{width:320,children:(0,i.jsx)(Bl,{icon:"magnifying-glass",placeholder:s("rechercher_une_69554"),value:d,onChange:e=>{c(e),g(e)}})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(jm,{attribute:ue.Name,setSort:C,sort:j,children:s("nom_de_la_campa_45063")}),(0,i.jsx)(jm,{attribute:ue.Type,css:{flex:"0 150px"},setSort:C,sort:j,children:s("type_35427")}),(0,i.jsx)(Gc,{css:{flex:"0 200px"},children:s("nombre_de_desti_21374")}),(0,i.jsx)(Gc,{css:{flex:"0 150px"},children:s("co_t_68998")}),(0,i.jsx)(jm,{attribute:ue.State,css:{flex:"0 150px"},setSort:C,sort:j,children:s("status_06428")}),(0,i.jsx)(Gc,{css:{flex:"0 100px"}})]}),numberOfPages:y.event?.campaigns.numberOfPages??0,offset:I,rows:k?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Hc,{bx:!0}),(0,i.jsx)(Hc,{bx:!0}),(0,i.jsx)(Hc,{bx:!0})]}):(0,i.jsx)(i.Fragment,{children:so(y.event.campaigns.nodes)?(0,i.jsx)(i.Fragment,{children:y.event.campaigns.nodes.map(e=>(0,i.jsx)(x$,{campaign:e,canSendCampaigns:a,eventId:n,organizationId:t,reload:A},e.id))}):(0,i.jsx)(Sk,{title:s("no_campaigns")})}),setOffset:v,title:s("liste_des_campa_60034"),totalCount:y.event?.campaigns.totalCount??0})})]})]})},dL=({organizationId:e,eventId:t,category:n,clickable:s})=>{const o=Xn();return(0,i.jsx)(Mc,{children:(0,i.jsx)(Oc,{children:(0,i.jsxs)(Ba,{direction:"column",gap:"2",width:1,children:[(0,i.jsxs)(Ba,{gap:"3",justify:"between",children:[s?(0,i.jsx)(Zc,{to:xs.POSITION_CATEGORY({organizationId:e,eventId:t,positionCategoryId:n.id}),children:n.name}):(0,i.jsx)(Ar,{color:"gray700",children:n.name}),(0,i.jsx)(Ar,{color:"gray700",children:o("_1_2_membres_04485",n.assignedResources,n.resources)})]}),(0,i.jsx)(Ar,{width:1,children:(0,i.jsx)(Ow,{percent:n.assignedResources/n.resources})})]})})},n.id)},cL=e=>(0,i.jsx)(Ba,{align:"center",css:{background:"white",bd:!0,cursor:"pointer",padding:"$3 $4"},gap:"3",width:1,children:(0,i.jsxs)(el,{to:e.path,width:1,children:[(0,i.jsx)(Ba,{align:"center",css:{background:e.isDone?"$success100":"",border:e.isDone?"":"1px solid $gray300",borderRadius:"20px",color:"$success700",fontSize:"10px"},height:20,justify:"center",width:20,children:e.isDone&&(0,i.jsx)(nl,{icon:"check"})}),(0,i.jsxs)(Ba,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(Ar,{color:"gray800",css:{textDecoration:e.isDone?"line-through":""},fontWeight:"medium",children:e.title}),(0,i.jsx)(Ar,{color:"gray500",children:e.subtitle})]}),(0,i.jsx)(Ar,{color:"gray900",css:{cursor:"pointer"},children:(0,i.jsx)(nl,{icon:"arrow-right"})})]})}),uL=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:s}}=vl(),o=Zn(rp),{isEventAdmin:r}=wb(),{data:a,loader:l}=Qn("query Dashboard($eventId: EventId!) {\n event(id: $eventId) {\n assignedResources\n numberOfPositions\n resources\n volunteerMinutesAssigned\n volunteerMinutesNeeded\n\n assignmentsStats {\n numberOfAssigned\n numberOfWaitingAssignment\n }\n\n onboarding {\n isFirstCampaignCreated\n isFirstFormCreated\n isFirstPositionCreated\n }\n\n positionsCategories {\n id\n name\n resources\n assignedResources\n }\n }\n}\n",{eventId:s},[]),d=(0,L.useMemo)(()=>a.event?(0,uc.A)(a.event.positionsCategories,e=>e.name.toLowerCase()):[],[a.event]),c=!(!r||!a.event||a.event.onboarding.isFirstCampaignCreated&&a.event.onboarding.isFirstFormCreated&&a.event.onboarding.isFirstPositionCreated);return l||(0,i.jsxs)(Ba,{css:{padding:"$7"},direction:"column",width:1,children:[(0,i.jsx)(Ar,{color:"gray900",fontSize:"displayXs",fontWeight:"semiBold",children:t("tableau_de_bord_24627")}),(0,i.jsx)(Ya,{height:"7"}),c&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(FN,{header:(0,i.jsxs)(Ba,{direction:"column",gap:"1",children:[(0,i.jsx)(Ar,{color:"gray900",fontSize:"textMd",fontWeight:"medium",children:t("vos_premiers_pa_81169")}),(0,i.jsx)(Ar,{color:"gray500",children:t("pour_bien_d_mar_03933")})]}),initialIsOpen:!0,children:(0,i.jsxs)(Ba,{direction:"column",gap:"2",width:1,children:[(0,i.jsx)(cL,{isDone:a.event.onboarding.isFirstPositionCreated,path:Ps.CREATE_POSITION(n,s),subtitle:t("cr_er_une_nouve_43436"),title:t("cr_er_votre_pre_70209")}),(0,i.jsx)(cL,{isDone:a.event.onboarding.isFirstFormCreated,path:Vi.FORMS({organizationId:n,eventId:s}),subtitle:t("cr_er_un_formul_31199"),title:t("cr_er_votre_pre_76199")}),(0,i.jsx)(cL,{isDone:a.event.onboarding.isFirstCampaignCreated,path:$I.CREATE({organizationId:n,eventId:s}),subtitle:t("communiquer_fac_26569"),title:t("envoyer_votre_p_47899")})]})}),(0,i.jsx)(Ya,{height:"8"})]}),(0,i.jsxs)(hd,{gap:"6",gridtemplatecolumns:"1fr 1fr 350px",gridtemplaterows:"1fr 1fr",children:[(0,i.jsx)(Ar,{css:{gridColumn:"1 / 2",gridRow:"1 / 2"},children:(0,i.jsx)(uS,{button:(0,i.jsx)(zl,{to:xs.POSITIONS({organizationId:n,eventId:s}),children:t("voir_les_missio_71964")}),icon:"user-group",iconColor:"primary",text:t("nombre_de_membr_60320",a.event.resources),value:a.event.resources})}),(0,i.jsx)(Ar,{css:{gridColumn:"2 / 3",gridRow:"1 / 2"},children:(0,i.jsx)(uS,{button:(0,i.jsx)(zl,{to:xs.POSITIONS({organizationId:n,eventId:s}),children:t("voir_les_missio_71964")}),icon:"sitemap",iconColor:"purple",text:t("nombre_de_missi_67304",a.event.numberOfPositions),value:a.event.numberOfPositions})}),(0,i.jsx)(Ar,{css:{gridColumn:"1 / 2",gridRow:"2 / 3"},children:(0,i.jsx)(uS,{button:(0,i.jsx)(zl,{onClick:()=>{e.push(Ps.VOLUNTEERS(n,s))},children:t("voir_les_membre_27923")}),icon:"user-check",iconColor:"success",text:t("nombre_de_membr_87779",a.event.assignmentsStats.numberOfAssigned),value:a.event.assignmentsStats.numberOfAssigned})}),(0,i.jsx)(Ar,{css:{gridColumn:"2 / 3",gridRow:"2 / 3"},children:(0,i.jsx)(uS,{button:(0,i.jsx)(zl,{onClick:()=>{e.push(Ps.ASSIGNMENTS(n,s))},children:t("voir_mes_affect_10965")}),icon:"wand-magic-sparkles",iconColor:"warning",text:t("nombre_de_membr_63555",a.event.assignmentsStats.numberOfWaitingAssignment),value:a.event.assignmentsStats.numberOfWaitingAssignment})}),(0,i.jsxs)(Ba,{css:{bd:!0,gridColumn:"3 / 4",gridRow:"1 / 3",padding:"$6"},direction:"column",justify:"between",children:[(0,i.jsxs)(Ba,{direction:"column",gap:"2",children:[(0,i.jsx)(Ar,{color:"gray500",children:t("taux_de_remplis_11913")}),(0,i.jsxs)(Ar,{color:"gray900",fontSize:"displaySm",fontWeight:"semiBold",children:[0===a.event.resources?"0":Math.round(a.event.assignedResources/a.event.resources*100),"%"]})]}),(0,i.jsx)(Ar,{css:{borderBottom:"1px solid $gray200"},width:1}),(0,i.jsxs)(Ba,{direction:"column",gap:"2",children:[(0,i.jsx)(Ar,{color:"gray500",children:t("temps_de_b_n_vo_87924")}),(0,i.jsx)(Ar,{color:"gray900",fontSize:"displaySm",fontWeight:"semiBold",children:o.minutesToHoursMinutesString(a.event.volunteerMinutesNeeded)})]}),(0,i.jsx)(Ar,{css:{borderBottom:"1px solid $gray200"},width:1}),(0,i.jsxs)(Ba,{direction:"column",gap:"2",children:[(0,i.jsx)(Ar,{color:"gray500",children:t("temps_de_b_n_vo_60725")}),(0,i.jsx)(Ar,{color:"gray900",fontSize:"displaySm",fontWeight:"semiBold",children:o.minutesToHoursMinutesString(a.event.volunteerMinutesAssigned)})]})]})]}),(0,i.jsx)(Ya,{height:"8"}),r&&(0,i.jsx)(Ar,{css:{boxShadow:"$xs"},children:(0,i.jsx)(Lc,{filters:(0,i.jsx)(i.Fragment,{}),headerCells:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Gc,{children:t("cat_gories_24533")})}),numberOfPages:0,offset:0,rows:(0,i.jsx)(i.Fragment,{children:d.length>0?d.map(e=>(0,i.jsx)(dL,{category:e,clickable:!0,eventId:s,organizationId:n},e.id)):(0,i.jsx)(Sk,{subtitle:t("vous_n_avez_pas_59681"),title:t("aucune_cat_gori_21347")})}),setOffset:td.A,title:t("liste_des_membr_59735"),totalCount:0})})]})};var hL;let mL=class extends LO{static{hL=this}csvInputService;static IMPORT_COLUMNS_DEFAULT={...LO.IMPORT_COLUMNS_DEFAULT,Name:"name",FormId:"formId",Deadline:"deadline",MaxResources:"maxResources",LeadersEmails:"leadersEmails",LeadersFirstNames:"leadersFirstnames",LeadersLastNames:"leadersLastnames",PrivateNote:"privateNote",Tags:"tags"};static IMPORT_COLUMNS_REQUIRED=e=>[...e===Je.Update?[hL.IMPORT_COLUMNS_DEFAULT.Id]:[],hL.IMPORT_COLUMNS_DEFAULT.Name,hL.IMPORT_COLUMNS_DEFAULT.FormId];default(e){const t=super.default(e);return t.input={...t.input,notifyLeaders:!1},t}constructor(e,t){super(e,t),this.csvInputService=e}};mL=hL=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Cv,qn])],mL);const gL=()=>{const{params:{organizationId:e,eventId:t},translate:n}=vl(),{mutate:s}=function(e={}){return ei("mutation DelegationsImport(\n $eventId: EventId!\n $organizationId: OrganizationId!\n $input: DelegationImportInput!\n) {\n jobId: delegationsImport(eventId: $eventId, organizationId: $organizationId, input: $input)\n}\n",e)}(),{checkDelegationsImport:o}=Ob(),r=(0,L.useCallback)((e,t,n)=>o(e,t,n),[o,t]),{data:a,loader:l}=Xr({organizationId:e,variety:je.Delegation});return l||(0,i.jsx)(aR,{ImportInputService:mL,additionalOptions:(0,i.jsx)(Jm,{name:"input.notifyLeaders",children:n("informer_les_re_38743")}),checkImport:r,closePath:hs.DELEGATIONS({organizationId:e,eventId:t}),customFields:a.organization.customFields.nodes,heading:n("import_de_d_l_g_69356"),importTagPrefix:"delegations",itemName:{singular:n("team_33516"),plural:n("teams_75559")},localStorageKeyPrefix:"DELEGATIONS_IMPORT",mutate:s,returnLink:(0,i.jsx)(Zc,{to:hs.DELEGATIONS({organizationId:e,eventId:t}),children:n("revenir_aux_d_l_15915")}),showModeSelection:!1})},pL=e=>{const{translate:t,params:{eventId:n}}=vl(),{isEventAdmin:s}=wb(),[o,r]=(0,L.useState)(e.delegationAccreditationSlot),a=(0,L.useMemo)(()=>ic(e.accreditationSlot.accreditation.color),[e.accreditationSlot]),l=(0,L.useMemo)(()=>({background:a[50],border:`1px solid ${a[500]}`,color:a[700]}),[a]),d=(0,L.useCallback)(async()=>{const{event:{delegation:t}}=await Fo({eventId:n,delegationId:e.delegationId,accreditationSlotId:e.accreditationSlot.id},await Y());r(t.accreditationSlot)},[e.accreditationSlot,e.delegationId,r]),[c,u]=(0,L.useState)(!1),h=o.maxResources?`/${o.maxResources}`:"",m=`${o.assignedResources}${h}`;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ba,{css:{...l,borderRadius:"$1",cursor:s?"pointer":"default",padding:"$2"},direction:"column",gap:"2",height:1,width:1,onClick:()=>{s&&u(!0)},children:[(0,i.jsx)(cw,{background:a[100],count:m,icon:"badge-check",text:t("attribu_es_48167")}),(0,i.jsx)(cw,{background:a[100],count:o.wishedResources,icon:"hand-holding-heart",text:t("souhait_es_78101")}),(0,i.jsx)(cw,{background:a[100],count:o.scannedResources,icon:"scanner-gun",text:t("scann_es_13169")})]}),s&&c&&(0,i.jsx)(dw,{accreditationSlotId:e.accreditationSlot.id,delegationId:e.delegationId,eventId:n,onClose:()=>(u(!1),d())})]})},fL=e=>{const t=(0,L.useMemo)(()=>(e.delegation.accreditationsSlots||[]).find(t=>t.accreditationSlotId===e.accreditationSlot.id),[e.delegation,e.accreditationSlot]);return t?(0,i.jsx)(pL,{accreditationSlot:e.accreditationSlot,delegationAccreditationSlot:t,delegationId:e.delegation.id}):null},_L=e=>(0,i.jsx)(Ba,{css:{borderTop:"1px solid $gray200",height:"$cellHeightXl"},children:e.accreditationsSlots.map(t=>(0,i.jsx)(Ba,{align:"center",css:{borderRight:"1px solid $gray200",padding:"$3 $4"},height:1,width:200,children:(0,i.jsx)(fL,{accreditationSlot:t,delegation:e.delegation})},t.id))}),xL=e=>{const{params:{organizationId:t,eventId:n}}=vl(),s=(0,L.useMemo)(()=>VA(e.allAccreditationsSlots),[e.allAccreditationsSlots]),o=(0,L.useMemo)(()=>UA(s,e.selectedSlotsIds),[s,e.selectedSlotsIds]),r=(0,L.useMemo)(()=>WA(o,e.selectedSlotsIds),[o,e.selectedSlotsIds]),a=(0,L.useMemo)(()=>r.map(e=>e.id),[r]),l=(0,L.useCallback)(e=>(0,i.jsx)(Ba,{align:"center",css:{borderRight:"1px solid $gray200",borderTop:"1px solid $gray200",height:"$cellHeightXl",px:"$4"},width:1,children:(0,i.jsx)(Zc,{to:hs.DELEGATION({organizationId:t,eventId:n,delegationId:e.id}),children:e.name})},e.id),[t,n]),d=(0,L.useCallback)(e=>(0,i.jsx)(_L,{accreditationsSlots:r,delegation:e},e.id),[r,a]);return(0,i.jsx)(Ba,{direction:"column",width:1,children:e.isLoading?(0,i.jsx)(wl,{}):(0,i.jsx)(GA,{allAccreditations:s,cellWidth:200,data:e.delegations,filteredAccreditations:o,limit:e.limit,numberOfPages:e.numberOfPages,offset:e.offset,renderLeftColumn:l,renderRow:d,selectedSlotsIds:e.selectedSlotsIds,setLimit:e.setLimit,setOffset:e.setOffset,setSelectedSlotsIds:e.setSelectedSlotsIds,slots:r,totalCount:e.totalCount})})},IL=()=>{const{params:{organizationId:e,eventId:t}}=vl(),{columns:n,infos:s,limit:o,nameDebounced:r,offset:a,predicates:l,rendering:d,setInfos:c,setLimit:u,setOffset:h}=vy(),g=(0,L.useMemo)(()=>S$(n,d),[n,d]),{data:p,isLoading:f}=Qn("query DelegationsAccreditationsMatrix($eventId: EventId!) {\n event(id: $eventId) {\n accreditationsSlots(includeHidden: true, usedInDelegations: true) {\n nodes {\n ...AccreditationSlotMatrix\n }\n }\n }\n}\n",{eventId:t},[Vs.AccreditationSlotMatrixFragment]),{data:_,isLoading:x}=ia({...g,organizationId:e,eventId:t,level:ot.Event,predicates:l,name:m(r)?r:null,limit:o,offset:a}),{numberOfPages:I,totalCount:v}=Su(_.data?.rows),b=(0,L.useMemo)(()=>s.delegationsMatrixSelectedSlotsIds||[],[s]),j=(0,L.useCallback)(e=>c({...s,delegationsMatrixSelectedSlotsIds:e}),[s,c]);return(0,i.jsx)(xL,{allAccreditationsSlots:p.event?.accreditationsSlots.nodes??[],delegations:_.data?.rows.nodes??[],isLoading:x||f,limit:o,numberOfPages:I,offset:a,selectedSlotsIds:b,setLimit:u,setOffset:h,setSelectedSlotsIds:j,totalCount:v})},vL=e=>{const{history:t,params:{organizationId:n,eventId:s},translate:r}=vl(),{mutate:a,isLoading:l}=Ta(),[d,c]=(0,L.useState)(!1),[u,h]=(0,L.useState)([]),[m,g]=(0,L.useState)(!0),p=!d||so(u);return(0,i.jsxs)(Nb,{children:[(0,i.jsx)(Mb,{icon:"user-group",subtitle:r("ajoutez_une_d_l_54234"),children:r("cr_ation_d_une_07120")}),(0,i.jsxs)(Fb,{children:[(0,i.jsx)(Ar,{font:"gray800 textSm medium",children:r("que_souhaitez_v_87607")}),(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(JR,{state:d?"unchecked":"checked",onClick:()=>c(!1),children:r("cr_er_une_nouve_45377")}),(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(JR,{state:d?"checked":"unchecked",onClick:()=>c(!0),children:r("cr_er_une_d_l_g_37657")}),d&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(yc,{isSearchVisible:!0,label:r("_quelle_d_l_ga_55758"),multiple:!1,renderOnPortal:!0,values:u,onChange:h,children:e.parentDelegations.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(ku,{value:m,onChange:g,children:r("je_souhaite_app_69393")})]})]}),(0,i.jsx)(Pb,{children:(0,i.jsx)(zl,{disabled:!p,isLoading:l,onClick:async()=>{let i;if(d&&so(u)){const t=u[0],n=e.parentDelegations.find(e=>e.id===t);so(n.leadersIds)&&await a({eventId:s,usersInfosIds:n.leadersIds,sendVolunteerRegistrationEmail:!1}),i=o(JSON.stringify({parentId:t,applyParentSettings:m}))}t.push(Ps.CREATE_DELEGATION(n,s,i))},children:r("suivant_62774")})})]})},bL=()=>{const{history:e,params:{organizationId:t,eventId:n},translate:s}=vl(),{segment:o,columns:r}=vy(),{data:a}=Qn("query ParentDelegations($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n delegations(level: Organization) {\n nodes {\n id\n name\n leadersIds\n }\n }\n }\n}\n",{organizationId:t},[]),{mutate:l}=function(e={}){return ei("mutation DelegationsExport(\n $organizationId: OrganizationId!\n $eventId: EventId\n $segmentId: SegmentId!\n $format: ExportFormat!\n $columns: [String!]!\n) {\n jobId: delegationsExport(\n organizationId: $organizationId\n eventId: $eventId\n segmentId: $segmentId\n format: $format\n columns: $columns\n )\n}\n",e)}(),[d,c]=(0,L.useState)(!1),[u,h]=(0,L.useState)(!1),m=so(a.organization?.delegations.nodes),{checkExport:g}=Ob();return(0,i.jsxs)(g$,{children:[(0,i.jsx)(Kb,{permissions:Hb.DELEGATION_EDIT,children:m?(0,i.jsxs)(Lb,{children:[(0,i.jsx)(Bb,{children:(0,i.jsx)(nE,{menu:(0,i.jsx)(Kd,{icon:"file-import",to:Ps.EVENT_DELEGATIONS_IMPORT(t,n),onClick:e=>Vd(e.target),children:s("importer_des_d_05454")}),children:s("cr_er_une_d_l_g_23035")})}),(0,i.jsx)(vL,{parentDelegations:a.organization.delegations.nodes})]}):(0,i.jsx)(nE,{menu:(0,i.jsx)(Kd,{icon:"file-import",to:Ps.EVENT_DELEGATIONS_IMPORT(t,n),onClick:e=>Vd(e.target),children:s("importer_des_d_05454")}),path:Ps.CREATE_DELEGATION(t,n),children:s("cr_er_une_d_l_g_23035")})}),(0,i.jsxs)(Wd,{children:[(0,i.jsx)(Xd,{children:(0,i.jsx)(zl,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Zd,{placement:"bottom-end",children:[(0,i.jsxs)(Kb,{permissions:Hb.DELEGATION_EDIT,children:[(0,i.jsx)(Kd,{icon:"plus",onClick:()=>{c(!0)},children:s("cr_er_une_cat_g_20051")}),(0,i.jsx)(Xu,{color:"gray100",direction:"horizontal"})]}),(0,i.jsx)(Kd,{icon:"file-xls",onClick:e=>{Vd(e.target),h(!0)},children:s("exporter_en_exc_51862")})]})]}),(0,i.jsx)(bD,{isOpen:u,requestExport:async e=>{const{jobId:i}=await l({organizationId:t,eventId:n,segmentId:o.id,format:e,columns:r});g(i,t,n)},showIncludeFiles:!1,onClose:()=>{h(!1)}}),d&&(0,i.jsx)(iy,{eventId:n,organizationId:t,onClose:()=>c(!1),onSuccess:i=>{e.push(hs.DELEGATION_CATEGORY({organizationId:t,eventId:n,delegationCategoryId:i.id}))}})]})},jL=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=vl(),{canDelegationEdit:o,canSegmentEdit:r}=$S(),{limit:a,rendering:l,segment:d}=vy(),c=r&&l===Vh.List,u=o&&l===Vh.List;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(bL,{}),0===e.numberOfDelegations?(0,i.jsx)(aj,{css:{overflow:"hidden"},children:(0,i.jsx)(Ar,{css:{overflow:"hidden"},width:1,children:(0,i.jsx)(Gk,{title:t("vous_n_avez_pas_58215")})})}):(0,i.jsxs)(aj,{children:[(0,i.jsx)(m$,{searchRow:(0,i.jsx)(u$,{actions:(0,i.jsx)(N$,{}),searchPlaceholder:t("rechercher_une_31213"),showActions:o,showEditColumns:c,showEditMode:u,showSearchColumns:r}),selectSegment:(0,i.jsx)($$,{pageSelectedText:t("les_1_d_l_gat_27248",a),segmentSelectedText:t("les_1_d_l_gat_04594",d.count,d.name)})}),l===Vh.AccreditationsMatrix?(0,i.jsx)(IL,{}):(0,i.jsx)(hD,{customFields:e.customFields,eventId:s,level:ot.Event,organizationId:n})]})]})},CL=e=>{const{history:t,translate:n,params:{organizationId:s,eventId:o,segmentId:r}}=vl(),{hasPermission:a,localEvent:l,updateLocalEvent:d}=wb(),c=Zn(E$),u=(0,L.useMemo)(()=>c.getDelegationsFilters(e.event.organizationId,o,e.organization.customFields.nodes,e.organization.delegationsCategories.nodes),[e.event,e.organization,o]),h=(0,L.useMemo)(()=>c.getDelegationsPossibleColumns(e.organization.customFields.nodes),[e.organization]);return(0,i.jsx)(O$,{eventId:o,getEditPath:e=>_i(hs.DELEGATION({organizationId:s,eventId:o,delegationId:e})),getShowPath:e=>hs.DELEGATION({organizationId:s,eventId:o,delegationId:e}),organizationId:s,children:(0,i.jsx)(l$,{canEditSegments:a(Hb.SEGMENT_EDIT),eventId:o,filters:u,filtersButtonText:n("filtrer_les_d_l_04628"),filtersSubtitle:n("appliquer_des_f_65318"),getSegmentPath:e=>Ps.DELEGATIONS_SEGMENT(s,o,e),hideSegments:0===e.event.numberOfDelegations,initialLimit:l?.delegationsLimit??Rc,initialSegmentsOpen:l?.areDelegationsSegmentsOpen??!0,organizationId:s,possibleColumns:h,possibleRenderings:[Vh.List,Vh.AccreditationsMatrix],reload:e.reload,segmentId:r,segmentType:jt.Delegations,segmentsFolders:e.event.segmentsFolders,setLimit:e=>{d({delegationsLimit:e})},onSegmentClick:e=>{d({delegationsSegmentId:e})},onSegmentDelete:async()=>{await d({delegationsSegmentId:null}),t.replace(hs.DELEGATIONS({organizationId:s,eventId:o}))},onSegmentsToggle:async e=>{await d({areDelegationsSegmentsOpen:e})},children:(0,i.jsx)(jL,{customFields:e.organization.customFields.nodes,numberOfDelegations:e.event.numberOfDelegations})})})},yL=()=>{const{params:{organizationId:e,eventId:t},translate:n}=vl(),{event:{name:s},localEvent:o}=wb();Md(`${s} ${n("d_l_gations_78318")}`);const{data:r,loader:a,reload:l}=Qn("query DelegationsSegments($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n customFields(variety: Delegation) {\n nodes {\n ...SegmentCustomField\n }\n }\n\n delegationsCategories(level: Event, eventId: $eventId) {\n nodes {\n id\n name\n }\n }\n }\n\n event(id: $eventId) {\n organizationId\n numberOfDelegations\n\n segmentsFolders(segmentType: Delegations) {\n ...SegmentsFoldersSegments\n }\n }\n}\n",{organizationId:e,eventId:t},[Vs.SegmentCustomFieldFragment,Vs.SegmentsFoldersSegmentsFragment]),d=(0,L.useMemo)(()=>(r.event?.segmentsFolders??[]).flatMap(e=>e.segments).map(e=>e.id),[r.event]);return a||(0,i.jsxs)(Sr.dO,{children:[(0,i.jsx)(Sr.qh,{path:Ps.DELEGATIONS_SEGMENT(":organizationId",":eventId",":segmentId"),children:(0,i.jsx)(CL,{event:r.event,organization:r.organization,reload:l})}),(0,i.jsx)(Sr.qh,{children:(0,i.jsx)(oi,{path:Ps.DELEGATIONS_SEGMENT(e,t,o?.delegationsSegmentId&&d.includes(o.delegationsSegmentId)?o.delegationsSegmentId:d[0]),replace:!0})})]})},kL=()=>{const{hasFeature:e}=TI();return e(Be.Delegation)?(0,i.jsx)(yL,{}):(0,i.jsx)(Ba,{align:"center",height:1,justify:"center",width:1,children:(0,i.jsx)(zI,{icon:"people-group"})})};let AL=class extends Gl{constructor(e){super(e)}delegationCategoryInputDefault(e){return{name:e.name,banners:e.banners}}};AL=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[qn])],AL);let wL=class extends Gl{constructor(e){super(e)}delegationCategoryBannerInputDefault(){return{color:de.Bleu,min:1,max:10}}};wL=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[qn])],wL);const SL=e=>{const{translate:t}=vl(),n=Zn(wL),s=Bc();return(0,i.jsxs)(Ba,{css:{background:"$gray50",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",padding:"$6 $4"},direction:"column",gap:"3",width:1,children:[e.values.banners.map((n,o)=>{const r=`delegationCategory.banners[${o}].`;return(0,i.jsxs)(Ba,{css:{background:"white",bd:!0,padding:"$3 $4"},gap:"4",children:[(0,i.jsx)(Qj,{label:t("couleur_du_band_50334"),name:`${r}color`,children:s(Qt)}),(0,i.jsx)(Vl,{label:t("commence_par_la_30514"),min:0,name:`${r}min`,shouldParseAsInt:!0}),(0,i.jsx)(Vl,{label:t("jusqu_la_vale_40572"),min:0,name:`${r}max`,shouldParseAsInt:!0}),(0,i.jsx)(Ba,{align:"end",children:(0,i.jsx)(zl,{color:"white",leftIcon:"trash-can",onClick:()=>{e.change("delegationCate gory.banners",e.values.banners.filter((e,t)=>t!==o))}})})]},o)}),(0,i.jsx)(Ba,{children:(0,i.jsx)(zl,{color:"invisible",leftIcon:"plus",onClick:()=>{e.change("delegationCategory.banners",[...e.values.banners,n.delegationCategoryBannerInputDefault()])},children:t("ajouter_un_band_94873")})})]})},EL=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:s,delegationCategoryId:o}}=vl(),{showNotification:r}=Ob(),a=Zn(AL),{data:l,loader:d}=Qn("query DelegationCategoryToEdit(\n $organizationId: OrganizationId!\n $delegationCategoryId: DelegationsCategoryId!\n) {\n organization(id: $organizationId) {\n delegationCategory(id: $delegationCategoryId) {\n id\n name\n\n banners {\n color\n min\n max\n }\n }\n }\n}\n",{organizationId:n,delegationCategoryId:o},[]),{mutate:c}=function(e={}){return ei("mutation DelegationCategoryUpdate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $delegationCategoryId: DelegationsCategoryId!\n $delegationCategory: DelegationsCategoryUpdateInput!\n) {\n delegationCategoryUpdate(\n organizationId: $organizationId\n eventId: $eventId\n delegationCategoryId: $delegationCategoryId\n delegationCategory: $delegationCategory\n ) {\n id\n name\n }\n}\n",e)}(),u=(0,L.useMemo)(()=>so(l.organization?.delegationCategory.banners),[l.organization]);return d||(0,i.jsx)(kl,{height:1,initialValues:{delegationCategory:a.delegationCategoryInputDefault(l.organization.delegationCategory)},render:({form:e,handleSubmit:r,submitting:a,values:d})=>(0,i.jsx)(Lm,{button:(0,i.jsx)(zl,{isLoading:a,onClick:r,children:t("mettre_jour_l_94846")}),category:t("mise_jour_de_17055",l.organization.delegationCategory.name),color:"dark",fallbackClosePath:hs.DELEGATION_CATEGORY({organizationId:n,eventId:s,delegationCategoryId:o}),heading:l.organization.delegationCategory.name,children:(0,i.jsxs)(Mm,{children:[(0,i.jsx)(Vm,{heading:t("informations_su_03761"),hideToggle:!0,initialIsOpen:!0,children:(0,i.jsx)(Vl,{label:t("nom_de_la_cat_g_03860"),name:"delegationCategory.name"})}),Lh(n)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"5"}),(0,i.jsx)(Vm,{heading:t("bandeaux_v_hicu_49859"),initialIsOpen:u,onToggle:t=>{t||e.change("delegationCategory.banners",[])},children:(0,i.jsx)(SL,{change:e.change,values:d.delegationCategory})})]}),(0,i.jsx)(Ya,{height:"5"}),(0,i.jsx)(Bm,{children:(0,i.jsx)(zl,{isLoading:a,textAlign:"center",onClick:r,children:t("mettre_jour_l_94846")})})]})}),width:1,onSubmit:async i=>{await c({organizationId:n,eventId:s,delegationCategoryId:o,delegationCategory:i.delegationCategory}),r(t("la_cat_gorie_a_28053")),e.goBack(hs.DELEGATION_CATEGORY({organizationId:n,eventId:s,delegationCategoryId:o}))}})};let TL=class extends Gl{constructor(e){super(e)}customDocumentInputDefault(e){return{name:e?.name??"",slug:e?.slug??"",populationsIds:e?.populationsIds??[],configuration:e?.configuration??this.getConfigurationDefault()}}customDocumentInputSchema(){return d.Ik().shape({name:d.Yj().required(this.t("le_nom_est_requ_61536")),slug:d.Yj().required(this.t("le_nom_de_la_va_15472")).test("is-valid",this.t("le_nom_de_la_va_15472"),e=>null!==e.match(/^[a-z][a-z0-9]*$/))})}getConfigurationDefault(){return{bleed:!1,height:ig,pages:[this.getPageDefault()],width:sg}}getPageDefault(){return{id:V(),accreditationsSlotsIds:[],accreditationAcronym:"",conditionsCustomFields:[],elements:[],hasConditions:!1,positionsSlotsIds:[]}}getContainerElementDefault(e,t,n){return{type:"container",id:e,inContainer:t,backgroundColor:"",accreditationsSlotsIds:[],accreditationAcronym:"",align:"start",borderColor:"#e4e7ec",borderRadius:0,borderSize:0,conditionsCustomFields:[],direction:"row",elements:[],gap:0,hasBackground:!1,hasConditions:!1,hasRotate:!1,height:100,isRatioLocked:!1,justify:"start",left:0,name:this.t("conteneur_1_03989",n+1),positionsSlotsIds:[],px:0,py:0,rotateDegree:0,top:0,width:100,zIndex:1}}getImageElementDefault(e,t,n){return{type:"image",id:e,inContainer:t,accreditationsSlotsIds:[],accreditationAcronym:"",borderColor:"#e4e7ec",borderRadius:0,borderSize:0,conditionsCustomFields:[],hasConditions:!1,hasRotate:!1,height:100,isRatioLocked:!1,left:0,name:this.t("image_1_30956",n+1),positionsSlotsIds:[],px:0,py:0,rotateDegree:0,top:0,width:100,zIndex:1}}getTextElementDefault(e,t,n){return{type:"text",id:e,inContainer:t,accreditationsSlotsIds:[],accreditationAcronym:"",align:"start",hasBackground:!1,backgroundColor:"",borderColor:"#e4e7ec",borderRadius:0,borderSize:0,conditionsCustomFields:[],hasConditions:!1,hasRotate:!1,height:20,isRatioLocked:!1,left:0,name:this.t("texte_1_59540",n+1),text:"",color:"#1d2939",fontFamily:"Open Sans",fontSize:14,fontWeight:400,justify:"start",lineHeight:1.4,positionsSlotsIds:[],px:0,py:0,rotateDegree:0,textTransform:"none",top:0,width:100,zIndex:1}}};function zL(e){const t=e=>e.flatMap(e=>"container"===e.type?[e].concat(t(e.elements)):[e]);return e.configuration.pages.flatMap(e=>t(e.elements))}function OL(e,t,n){const i={...e,id:t,name:n};if("container"===i.type){const e=i.elements.map(e=>OL(e,V(),e.name));return{...i,elements:e}}return i}function RL(e,t){return e===ig&&t===sg?"a4":e===og&&t===rg?"a6":e===dg&&t===cg?"cb":"custom"}function $L(e,t,n,i,s){return!e.hasConditions||(so(e.accreditationsSlotsIds)?so((0,fh.A)(e.accreditationsSlotsIds,t)):m(e.accreditationAcronym)?n.some(t=>e.accreditationAcronym===t):so(e.positionsSlotsIds)?so((0,fh.A)(e.positionsSlotsIds,i)):!so(e.conditionsCustomFields)||e.conditionsCustomFields.every(({slug:e,value:t})=>"isEmpty"===t?g(s[e]?.rawValue):"isNotEmpty"===t?m(s[e]?.rawValue):"boolean"==typeof t?s[e]?.rawValue===t:!!Array.isArray(t)&&so((0,fh.A)(io(s[e]?.rawValue),t))))}TL=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[qn])],TL);const DL=L.createContext({}),PL=e=>{const{translate:t,params:{eventId:n}}=vl(),s=Zn(Jc),o=Zn(ph),r=Zn(TL),[a,d]=L.useState(e.initialCustomDocument),[c,u]=L.useState(null),[g,p]=L.useState(null),[f,_]=L.useState("parameters"),x=L.useCallback(e=>{d((0,xu.jM)(t=>{t.name=e}))},[a,d]),I=L.useCallback((e,t)=>{d((0,xu.jM)(n=>{n.configuration.pages.forEach(n=>{n.id===g&&(n[e]=t)})}))},[g,d]),v=L.useCallback(e=>{d((0,xu.jM)(t=>{t.populationsIds=e}))},[d]),b=L.useCallback(e=>{d((0,xu.jM)(t=>{t.slug=h(e,{replacer:l.Empty})}))},[d]),j=L.useCallback(e=>{d((0,xu.jM)(t=>{t.configuration.bleed=e}))},[a,d]),C=L.useCallback((e,t)=>{d((0,xu.jM)(n=>{n.configuration.height=e,n.configuration.width=t}))},[a,d]),y=L.useCallback(()=>{u(null),p(null)},[u,p]),k=L.useCallback(()=>zL(a).find(e=>e.id===c)||null,[a,c]),A=L.useCallback(()=>a.configuration.pages.find(e=>e.id===g)||null,[a,g]),w=L.useCallback(()=>{d((0,xu.jM)(e=>{e.configuration.pages.push(r.getPageDefault())}))},[d]),S=L.useCallback(e=>{d((0,xu.jM)(t=>{t.configuration.pages=t.configuration.pages.filter(t=>t.id!==e)}))},[d]),E=L.useCallback(e=>{const t=V();d((0,xu.jM)(n=>{e?zL(n).forEach(n=>{"container"===n.type&&n.id===e.id&&n.elements.push(r.getContainerElementDefault(t,!0,n.elements.length))}):n.configuration.pages.forEach(e=>{e.id===g&&e.elements.push(r.getContainerElementDefault(t,!1,e.elements.length))})})),u(t)},[a,g,d]),T=L.useCallback(e=>{const t=V();d((0,xu.jM)(n=>{e?zL(n).forEach(n=>{"container"===n.type&&n.id===e.id&&n.elements.push(r.getTextElementDefault(t,!0,n.elements.length))}):n.configuration.pages.forEach(e=>{e.id===g&&e.elements.push(r.getTextElementDefault(t,!1,e.elements.length))})})),u(t)},[a,g,d]),z=L.useCallback(e=>{const t=V();d((0,xu.jM)(n=>{e?zL(n).forEach(n=>{"container"===n.type&&n.id===e.id&&n.elements.push(r.getImageElementDefault(t,!0,n.elements.length))}):n.configuration.pages.forEach(e=>{e.id===g&&e.elements.push(r.getImageElementDefault(t,!1,e.elements.length))})})),u(t)},[a,g,d,u]),O=L.useCallback(e=>{d((0,xu.jM)(t=>{t.configuration.pages.forEach(t=>{t.elements=t.elements.filter(t=>t.id!==e)}),zL(t).forEach(t=>{"container"===t.type&&(t.elements=t.elements.filter(t=>t.id!==e))})})),u(null)},[a,d,u]),R=L.useCallback(e=>{const n=V();d((0,xu.jM)(i=>{zL(i).forEach(i=>{if("container"===i.type){const s=i.elements.find(t=>t.id===e);s&&i.elements.push(OL(s,n,t("copie_de_1_62900",s.name)))}}),i.configuration.pages.forEach(i=>{const s=i.elements.find(t=>t.id===e);s&&i.elements.push(OL(s,n,t("copie_de_1_62900",s.name)))})})),u(n)},[a,d,u]),$=L.useCallback(e=>{const n=V();d((0,xu.jM)(i=>{const s=i.configuration.pages.find(t=>t.id===e);s&&i.configuration.pages.push(function(e,t,n){return{...e,id:t,name:n,elements:e.elements.map(e=>OL(e,V(),e.name))}}(s,n,m(s.name)?t("copie_de_1_62900",s.name):""))}))},[]),D=L.useCallback((e,t)=>{u(e),p(t)},[a,u,p]),P=L.useCallback(e=>{p(e),u(null),_("design")},[u,p,_]),F=L.useCallback((e,t,n)=>{d((0,xu.jM)(i=>{const s=zL(i).find(t=>t.id===e);s&&(s[t]=n)}))},[a]),{data:M}=Qn("query CustomDocumentConditions($eventId: EventId!) {\n event(id: $eventId) {\n accreditationsSlots(includeHidden: true) {\n nodes {\n id\n name\n date\n\n accreditation {\n name\n }\n }\n }\n\n positionsSlots {\n nodes {\n id\n name\n range\n\n position {\n name\n }\n }\n }\n }\n}\n",{eventId:n},[]),N=L.useMemo(()=>nm(s,M.event?.accreditationsSlots.nodes??[]).map(({name:e,values:t},n)=>(0,i.jsx)("optgroup",{label:e,children:t.map(({id:e,name:t})=>(0,i.jsx)("option",{value:e,children:t},e))},n)),[M.event]),B=L.useMemo(()=>tm(o,M.event?.positionsSlots.nodes??[]).map(({name:e,values:t},n)=>(0,i.jsx)("optgroup",{label:e,children:t.map(({id:e,name:t})=>(0,i.jsx)("option",{value:e,children:t},e))},n)),[M.event]);return(0,i.jsx)(DL.Provider,{value:{accreditationsOptions:N,addContainerElement:E,addImageElement:z,addPage:w,addTextElement:T,cleanSelecteds:y,customDocument:a,customFields:e.customFields,deleteElement:O,duplicateElement:R,duplicatePage:$,getSelectedElement:k,getSelectedPage:A,population:e.population,positionsOptions:B,removePage:S,selectElement:D,selectPage:P,selectedElementId:c,selectedPageId:g,setBleed:j,setDimensions:C,setName:x,setPopulations:v,setSlug:b,setTab:_,tab:f,updateElementProperty:F,updatePageProperty:I},children:e.children})};function FL(){return L.useContext(DL)}const ML=e=>{const{translate:t}=vl(),{addContainerElement:n,addImageElement:s,addTextElement:o}=FL();return(0,i.jsxs)(Ba,{css:{bd:!0},direction:"column",children:[(0,i.jsxs)(Ba,{align:"center",css:{borderBottom:"1px solid $gray200",cursor:"pointer",padding:"$4 $6"},gap:"3",onClick:()=>{o(e.container)},children:[(0,i.jsx)(Ba,{align:"center",height:24,justify:"center",width:24,children:(0,i.jsx)(nl,{icon:"text"})}),(0,i.jsx)(Ar,{css:{flex:"1"},font:"gray800 textSm medium",children:t("Text")}),(0,i.jsx)(zl,{color:"white",leftIcon:"plus",size:"sm"})]}),(0,i.jsxs)(Ba,{align:"center",css:{borderBottom:"1px solid $gray200",cursor:"pointer",padding:"$4 $6"},gap:"3",onClick:()=>{s(e.container)},children:[(0,i.jsx)(Ba,{align:"center",height:24,justify:"center",width:24,children:(0,i.jsx)(nl,{icon:"image"})}),(0,i.jsx)(Ar,{css:{flex:"1"},font:"gray800 textSm medium",children:t("image_40624")}),(0,i.jsx)(zl,{color:"white",leftIcon:"plus",size:"sm"})]}),(0,i.jsxs)(Ba,{align:"center",css:{cursor:"pointer",padding:"$4 $6"},gap:"3",onClick:()=>{n(e.container)},children:[(0,i.jsx)(Ba,{align:"center",height:24,justify:"center",width:24,children:(0,i.jsx)(nl,{icon:"chart-simple"})}),(0,i.jsx)(Ar,{css:{flex:"1"},font:"gray800 textSm medium",children:t("conteneur_33078")}),(0,i.jsx)(zl,{color:"white",leftIcon:"plus",size:"sm"})]})]})},NL=e=>{const{translate:t}=vl(),{accreditationsOptions:n,customFields:s,positionsOptions:o}=FL(),r=(0,L.useMemo)(()=>s.filter(e=>e.fieldType===We.Checkbox||e.fieldType===We.Select||e.fieldType===We.Text||e.fieldType===We.Validation).map(e=>(0,i.jsx)("option",{value:e.slug,children:e.name},e.slug)),[s]),a=e.element.conditionsCustomFields||[],l=a.map(e=>e.slug),d=(t,n)=>{const i=(0,xu.jM)(a,e=>{e[n].value=t});e.updateProperty(e.elementId,"conditionsCustomFields",i)},c=s.filter(e=>l.includes(e.slug));return(0,i.jsx)(GM,{css:{padding:"$4 $6"},title:t("condition_d_aff_68185"),children:(0,i.jsxs)(Ba,{direction:"column",gap:"4",children:[(0,i.jsx)(ku,{value:e.element.hasConditions,onChange:t=>{t||(e.updateProperty(e.elementId,"accreditationsSlotsIds",[]),e.updateProperty(e.elementId,"accreditationAcronym",""),e.updateProperty(e.elementId,"positionsSlotsIds",[]),e.updateProperty(e.elementId,"conditionsCustomFields",[])),e.updateProperty(e.elementId,"hasConditions",t)},children:t("afficher_en_fon_47208")}),e.element.hasConditions&&(0,i.jsxs)(Ba,{css:{background:"$gray100",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",padding:"$3 $4"},direction:"column",gap:"2",children:[(0,i.jsx)(yc,{isSearchVisible:!0,label:t("afficher_en_fon_89756"),multiple:!0,values:e.element.accreditationsSlotsIds||[],onChange:t=>{e.updateProperty(e.elementId,"accreditationsSlotsIds",t)},children:n}),(0,i.jsx)(Bl,{label:t("afficher_en_fon_78748"),value:e.element.accreditationAcronym||"",onChange:t=>{e.updateProperty(e.elementId,"accreditationAcronym",t)}}),(0,i.jsx)(yc,{isSearchVisible:!0,label:t("afficher_en_fon_19925"),multiple:!0,values:e.element.positionsSlotsIds||[],onChange:t=>{e.updateProperty(e.elementId,"positionsSlotsIds",t)},children:o}),(0,i.jsx)(yc,{isSearchVisible:!0,label:t("afficher_en_fon_56078"),multiple:!0,values:l,onChange:t=>{const n=(0,mc.A)(t,l),i=s.filter(e=>n.includes(e.slug)),o=(0,mc.A)(l,t),r=a.filter(e=>!o.includes(e.slug)).concat(i.map(e=>({slug:e.slug,value:e.fieldType===We.Checkbox||e.fieldType===We.Validation||(e.fieldType===We.Text?"isNotEmpty":[])})));e.updateProperty(e.elementId,"conditionsCustomFields",r)},children:r}),c.map((e,n)=>e.fieldType===We.Checkbox||e.fieldType===We.Validation?(0,i.jsxs)($u,{label:t("afficher_si_la_42654",e.name),shouldParseAsBoolean:!0,value:a[n].value,onChange:e=>{d(e,n)},children:[(0,i.jsx)("option",{value:"true",children:t("true")}),(0,i.jsx)("option",{value:"false",children:t("false")})]},e.id):e.fieldType===We.Text?(0,i.jsxs)($u,{label:t("afficher_si_la_42654",e.name),value:a[n].value,onChange:e=>{d(e,n)},children:[(0,i.jsx)("option",{value:"isEmpty",children:t("est_vide_96759")}),(0,i.jsx)("option",{value:"isNotEmpty",children:t("n_est_pas_vide_45804")})]},e.id):(0,i.jsx)(yc,{isSearchVisible:!0,label:t("afficher_si_la_42654",e.name),multiple:!0,values:a[n].value||[],onChange:e=>{d(e,n)},children:e.values.map(({id:e,value:t})=>(0,i.jsx)("option",{value:e,children:t},e))},e.id))]})]})})},LL=e=>{const{translate:t}=vl(),{updateElementProperty:n}=FL();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(GM,{css:{padding:"$4 $6"},title:t("apparence_75510"),children:(0,i.jsxs)(Ba,{direction:"column",gap:"4",children:[(0,i.jsxs)(Ba,{gap:"4",children:[(0,i.jsx)(Bl,{label:t("largeur_54184"),rightText:e.element.width<=1?"%":"px",shouldParseAsInt:!0,value:e.element.width,onChange:t=>{e.element.isRatioLocked&&n(e.element.id,"height",Math.round(e.element.height*t/e.element.width)),n(e.element.id,"width",t)}}),(0,i.jsx)(Bl,{label:t("hauteur_56576"),rightText:e.element.height<=1?"%":"px",shouldParseAsInt:!0,value:e.element.height,onChange:t=>{e.element.isRatioLocked&&n(e.element.id,"width",Math.round(e.element.width*t/e.element.height)),n(e.element.id,"height",t)}}),(0,i.jsx)(Ar,{css:{alignSelf:"end"},width:40,children:(0,i.jsxs)(km,{children:[(0,i.jsx)(Sm,{children:(0,i.jsx)(zl,{color:e.element.isRatioLocked?"primary":"white",leftIcon:e.element.isRatioLocked?"lock-keyhole":"lock-keyhole-open",onClick:()=>{n(e.element.id,"isRatioLocked",!e.element.isRatioLocked)}})}),(0,i.jsx)(wm,{placement:"top",children:e.element.isRatioLocked?t("ne_pas_pr_serve_68003"):t("pr_server_le_ra_39750")})]})})]}),!e.element.inContainer&&(0,i.jsxs)(Ba,{gap:"4",children:[(0,i.jsx)(Bl,{label:"X",rightText:"px",shouldParseAsInt:!0,value:e.element.left,onChange:t=>{n(e.element.id,"left",t)}}),(0,i.jsx)(Bl,{label:"Y",rightText:"px",shouldParseAsInt:!0,value:e.element.top,onChange:t=>{n(e.element.id,"top",t)}})]}),!e.element.inContainer&&(0,i.jsx)(Bl,{hint:t("la_position_z_d_29473"),label:t("position_z_du_c_46647"),shouldParseAsInt:!0,value:e.element.zIndex,onChange:t=>{n(e.element.id,"zIndex",t)}}),("image"===e.element.type||"text"===e.element.type)&&!e.element.inContainer&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ku,{value:e.element.hasRotate,onChange:t=>{n(e.element.id,"hasRotate",t)},children:t("faire_pivoter_06431")}),e.element.hasRotate&&(0,i.jsx)(Bl,{label:t("degr_79492"),rightText:"deg",shouldParseAsInt:!0,value:e.element.rotateDegree,onChange:t=>{n(e.element.id,"rotateDegree",t)}})]}),("container"===e.element.type||"text"===e.element.type)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ku,{value:e.element.hasBackground,onChange:t=>{n(e.element.id,"hasBackground",t)},children:t("afficher_un_arr_96006")}),e.element.hasBackground&&(0,i.jsx)(Hj,{label:t("couleur_de_fond_75677"),value:e.element.backgroundColor,onChange:t=>{n(e.element.id,"backgroundColor",t)}})]}),(0,i.jsxs)(Ba,{gap:"4",children:[(0,i.jsx)(Bl,{label:t("taille_de_la_bo_84060"),rightText:"px",shouldParseAsInt:!0,value:e.element.borderSize,onChange:t=>{n(e.element.id,"borderSize",t)}}),(0,i.jsx)(Hj,{label:t("couleur_de_la_b_84227"),value:e.element.borderColor,onChange:t=>{n(e.element.id,"borderColor",t)}})]}),(0,i.jsx)(Bl,{label:t("rayon_de_la_bor_26070"),rightText:"px",shouldParseAsInt:!0,value:e.element.borderRadius,onChange:t=>{n(e.element.id,"borderRadius",t)}}),(0,i.jsxs)(Ba,{gap:"4",children:[(0,i.jsx)(Bl,{label:t("padding_horizon_14268"),rightText:"px",shouldParseAsInt:!0,value:e.element.px,onChange:t=>{n(e.element.id,"px",t)}}),(0,i.jsx)(Bl,{label:t("padding_vertica_78457"),rightText:"px",shouldParseAsInt:!0,value:e.element.py,onChange:t=>{n(e.element.id,"py",t)}})]})]})}),(0,i.jsx)(NL,{element:e.element,elementId:e.element.id,updateProperty:n})]})},BL=e=>{const{translate:t}=vl(),{getSelectedPage:n,selectPage:s,updateElementProperty:o}=FL();return(0,i.jsxs)(Ba,{css:{boxShadow:"$sm",overflow:"hidden auto",paddingBottom:"$11"},direction:"column",height:1,width:1,children:[(0,i.jsx)(Ba,{css:{padding:"$2 $6"},children:(0,i.jsx)(zl,{color:"invisible",leftIcon:"arrow-left",onClick:()=>{s(n().id)},children:t("retour_92202")})}),(0,i.jsxs)(GM,{css:{padding:"$4 $6"},title:t("initialisation_38640"),children:[(0,i.jsx)(Bl,{label:t("nom_08311"),value:e.container.name,onChange:t=>{o(e.container.id,"name",t)}}),(0,i.jsx)(ML,{container:e.container})]}),(0,i.jsxs)(GM,{css:{padding:"$4 $6"},title:t("conteneur_33078"),children:[(0,i.jsxs)($u,{label:t("direction_39738"),value:e.container.direction,onChange:t=>{o(e.container.id,"direction",t)},children:[(0,i.jsx)("option",{value:"column",children:t("de_haut_en_bas_72752")}),(0,i.jsx)("option",{value:"row",children:t("de_gauche_dro_21330")})]}),(0,i.jsx)(Bl,{label:t("_cart_entre_les_62547"),rightText:"px",shouldParseAsInt:!0,value:e.container.gap,onChange:t=>{o(e.container.id,"gap",t)}}),(0,i.jsxs)(Ba,{direction:"column",gap:"1",children:[(0,i.jsx)(Ar,{font:"gray700 textSm medium",children:t("alignement_54247")}),(0,i.jsxs)(Ba,{gap:"4",children:[(0,i.jsxs)(Ba,{children:[(0,i.jsx)(zl,{color:"start"===e.container.justify?"primary":"white",css:{borderBottomRightRadius:"0",borderTopRightRadius:"0"},leftIcon:"align-left",onClick:()=>{o(e.container.id,"justify","start")}}),(0,i.jsx)(zl,{color:"center"===e.container.justify?"primary":"white",css:{borderLeft:"none",borderRadius:"0",borderRight:"none"},leftIcon:"align-center",onClick:()=>{o(e.container.id,"justify","center")}}),(0,i.jsx)(zl,{color:"end"===e.container.justify?"primary":"white",css:{borderBottomLeftRadius:"0",borderTopLeftRadius:"0"},leftIcon:"align-right",onClick:()=>{o(e.container.id,"justify","end")}})]}),(0,i.jsxs)(Ba,{children:[(0,i.jsx)(zl,{color:"start"===e.container.align?"primary":"white",css:{borderBottomRightRadius:"0",borderTopRightRadius:"0"},leftIcon:"objects-align-top",onClick:()=>{o(e.container.id,"align","start")}}),(0,i.jsx)(zl,{color:"center"===e.container.align?"primary":"white",css:{borderLeft:"none",borderRadius:"0",borderRight:"none"},leftIcon:"objects-align-center-vertical",onClick:()=>{o(e.container.id,"align","center")}}),(0,i.jsx)(zl,{color:"end"===e.container.align?"primary":"white",css:{borderBottomLeftRadius:"0",borderTopLeftRadius:"0"},leftIcon:"objects-align-bottom",onClick:()=>{o(e.container.id,"align","end")}})]})]})]})]}),(0,i.jsx)(LL,{element:e.container})]})},VL=()=>{const{translate:e}=vl(),{getSelectedPage:t,updatePageProperty:n}=FL(),s=t();return(0,i.jsxs)(Ba,{direction:"column",children:[(0,i.jsxs)(GM,{css:{padding:"$4 $6"},title:e("initialisation_38640"),children:[(0,i.jsx)(Bl,{label:e("nom_de_la_page_82146"),value:s.name||"",onChange:e=>{n("name",e)}}),(0,i.jsx)(ML,{container:null})]}),(0,i.jsx)(NL,{element:s,elementId:s.id,updateProperty:(e,t,i)=>{n(t,i)}})]})},UL=()=>{const{translate:e}=vl(),{getSelectedPage:t}=FL();return t()?(0,i.jsx)(VL,{}):(0,i.jsx)(Ba,{css:{px:"$4"},height:1,width:1,children:(0,i.jsxs)(Ba,{align:"center",css:{bd:!0,px:"$9"},direction:"column",gap:"4",height:1,justify:"center",width:1,children:[(0,i.jsx)(Ba,{css:{border:"1px solid $gray200",borderRadius:"10px",padding:"$3"},children:(0,i.jsx)(nl,{icon:"hand-pointer"})}),(0,i.jsx)(Ar,{font:"gray800 textMd medium",textAlign:"center",children:e("pour_ajouter_de_11528")})]})})},WL=e=>{const{translate:t,params:{organizationId:n}}=vl(),{getSelectedPage:s,selectPage:o,updateElementProperty:r}=FL();return(0,i.jsxs)(Ba,{css:{boxShadow:"$sm",overflow:"hidden auto",paddingBottom:"$11"},direction:"column",height:1,width:1,children:[(0,i.jsx)(Ba,{css:{padding:"$2 $6"},children:(0,i.jsx)(zl,{color:"invisible",leftIcon:"arrow-left",onClick:()=>{o(s().id)},children:t("retour_92202")})}),(0,i.jsxs)(GM,{css:{padding:"$4 $6"},title:t("initialisation_38640"),children:[(0,i.jsx)(Bl,{label:t("nom_08311"),value:e.image.name,onChange:t=>{r(e.image.id,"name",t)}}),(0,i.jsx)(Bl,{hint:t("utilisez_user_81685"),label:t("source_16397"),value:e.image.source||"",onChange:t=>{r(e.image.id,"source",t)}}),(0,i.jsx)(Yv,{accept:yv.SmallImages,acl:"public-read",label:t("File"),organizationId:n,value:null,onChange:t=>{if(t){const n=`https://${P.HEAVENT_AWS_UPLOADS_BUCKET}.s3.eu-west-1.amazonaws.com/${t.key}`;r(e.image.id,"source",n)}}}),(0,i.jsx)(Bl,{label:t("lien_68557"),value:e.image.link||"",onChange:t=>{r(e.image.id,"link",t)}})]}),(0,i.jsx)(LL,{element:e.image})]})},GL=()=>{const{translate:e}=vl(),{customDocument:t,population:n,setBleed:s,setDimensions:o,setName:r,setPopulations:a,setSlug:l}=FL(),d=t.configuration.height,c=t.configuration.width,u=RL(d,c),h=(0,L.useMemo)(()=>(0,uc.A)(n.values,e=>e.value.toLowerCase()),[n]);return(0,i.jsxs)(Ba,{css:{px:"$4"},direction:"column",gap:"4",width:1,children:[(0,i.jsx)(Bl,{label:e("nom_du_document_73868"),value:t.name,onChange:r}),(0,i.jsxs)($u,{label:e("format_du_docum_28991"),value:u,onChange:e=>{"a4"===e?o(ig,sg):"a6"===e?o(og,rg):"cb"===e?o(dg,cg):o(0,0)},children:[(0,i.jsx)("option",{value:"a4",children:"A4 (794 * 1123 px) (210 * 297 mm)"}),(0,i.jsx)("option",{value:"a6",children:"A6 (397 * 561 px) (105 * 148 mm)"}),(0,i.jsx)("option",{value:"cb",children:"CB (204 * 325 px) (54 * 86 mm)"}),(0,i.jsx)("option",{value:"custom",children:e("personnalis_40360")})]}),"custom"===u&&(0,i.jsxs)(Ba,{gap:"4",children:[(0,i.jsx)(Bl,{hint:`${zr(t.configuration.width)}mm`,label:e("largeur_54184"),rightText:"px",shouldParseAsInt:!0,value:t.configuration.width,onChange:e=>{o(d,e)}}),(0,i.jsx)(Bl,{hint:`${zr(t.configuration.height)}mm`,label:e("hauteur_56576"),rightText:"px",shouldParseAsInt:!0,value:t.configuration.height,onChange:e=>{o(e,c)}})]}),(0,i.jsx)(_c,{state:t.configuration.bleed?"checked":"unchecked",onClick:e=>{s("checked"===e)},children:e("ajouter_des_fon_73494")}),(0,i.jsx)(Xu,{direction:"horizontal"}),(0,i.jsx)(Bl,{hint:e("ne_doit_conteni_53122"),label:e("nom_de_la_varia_81999"),value:t.slug,onChange:l}),(0,i.jsx)(yc,{isSearchVisible:!0,label:e("lier_ce_documen_79055"),multiple:!0,values:t.populationsIds,onChange:a,children:h.map(e=>(0,i.jsx)("option",{value:e.id,children:e.value},e.id))})]})},HL=["Anton","Archivo","Arial","Arimo","Asap","Barlow","Be Vietnam Pro","Bebas Neue","Bricolage Grotesque","Chivo","Fira Sans","Georgia","IBM Plex Sans","Inter","Kumbh Sans","Lato","League Gothic","Merriweather","Montserrat","Noto Sans","Nunito","Open Sans","Oswald","Oxanium","PT Sans","Playfair Display","Plus Jakarta Sans","Poppins","Raleway","Roboto","Rubik","Ubuntu"];function qL(){return(0,L.useMemo)(()=>HL.map(e=>(0,i.jsx)("option",{value:e,children:e},e)),[])}const KL=e=>{const{translate:t}=vl(),{customFields:n,getSelectedPage:s,selectPage:o,updateElementProperty:r}=FL(),a=qL(),l=(0,L.useMemo)(()=>(0,uc.A)(n.concat([{slug:"id",name:t("id_51738")},{slug:"localId",name:t("id_sur_l_v_nem_01171")},{slug:"email",name:t("Email")},{slug:"delegation.name",name:t("nom_de_la_d_l_g_28087")},{slug:"delegation.leader.firstName",name:t("pr_nom_du_respo_22241")},{slug:"delegation.leader.lastName",name:t("nom_du_responsa_44761")},{slug:"delegation.leader.phone",name:t("t_l_hpone_du_re_85143")},{slug:"name",name:t("full_name")},{slug:"ticketId",name:t("TicketId")}]),e=>e.name.toLowerCase()).map(e=>{const t=`{user.${e.slug}}`,n=`${e.name} {user.${e.slug}}`;return(0,i.jsx)("option",{value:t,children:n},e.slug)}),[n]),d=e.text.lineHeight||1.4,c=(0,Vb.A)(e.text.fontSize*d,2);return(0,i.jsxs)(Ba,{css:{boxShadow:"$sm",overflow:"hidden auto",paddingBottom:"$11"},direction:"column",height:1,width:1,children:[(0,i.jsx)(Ba,{css:{padding:"$2 $6"},children:(0,i.jsx)(zl,{color:"invisible",leftIcon:"arrow-left",onClick:()=>{o(s().id)},children:t("retour_92202")})}),(0,i.jsx)(GM,{css:{padding:"$4 $6"},title:t("initialisation_38640"),children:(0,i.jsxs)(Ba,{direction:"column",gap:"4",children:[(0,i.jsx)(Bl,{label:t("nom_du_calque_77484"),value:e.text.name,onChange:t=>{r(e.text.id,"name",t)}}),(0,i.jsx)(Zm,{label:t("contenu_29668"),value:e.text.text,onChange:t=>{r(e.text.id,"text",t)}}),(0,i.jsx)(yc,{isSearchVisible:!0,label:t("ajouter_une_var_79098"),values:[],onChange:t=>{so(t)&&r(e.text.id,"text",`${e.text.text} ${t[0]}`.trim())},children:l})]})}),(0,i.jsx)(GM,{css:{padding:"$4 $6"},title:t("typographie_11343"),children:(0,i.jsxs)(Ba,{direction:"column",gap:"4",children:[(0,i.jsx)(yc,{isSearchVisible:!0,label:"Police",values:[e.text.fontFamily],onChange:t=>{r(e.text.id,"fontFamily",t[0]||"Open Sans")},children:a}),(0,i.jsxs)(Ba,{gap:"4",children:[(0,i.jsx)(Bl,{label:t("taille_de_la_po_58427"),shouldParseAsInt:!0,value:e.text.fontSize,onChange:t=>{r(e.text.id,"fontSize",t)}}),(0,i.jsx)(qm,{hint:t("soit_1_px_73099",c),label:t("hauteur_de_lign_08120"),value:d,onChange:t=>{r(e.text.id,"lineHeight",t)}})]}),(0,i.jsxs)(Ba,{gap:"4",children:[(0,i.jsx)(Hj,{label:t("couleur_du_text_32021"),value:e.text.color,onChange:t=>{r(e.text.id,"color",t)}}),(0,i.jsxs)($u,{label:t("graisse_de_la_p_41139"),shouldParseAsInt:!0,value:e.text.fontWeight,onChange:t=>{r(e.text.id,"fontWeight",t)},children:[(0,i.jsx)("option",{value:"400",children:"400"}),(0,i.jsx)("option",{value:"500",children:"500"}),(0,i.jsx)("option",{value:"600",children:"600"}),(0,i.jsx)("option",{value:"700",children:"700"}),(0,i.jsx)("option",{value:"800",children:"800"}),(0,i.jsx)("option",{value:"900",children:"900"})]})]}),(0,i.jsxs)(Ba,{direction:"column",gap:"1",children:[(0,i.jsx)(Ar,{font:"gray700 textSm medium",children:t("alignement_54247")}),(0,i.jsxs)(Ba,{gap:"4",children:[(0,i.jsxs)(Ba,{children:[(0,i.jsxs)(km,{children:[(0,i.jsx)(Sm,{children:(0,i.jsx)(zl,{color:"start"===e.text.justify?"primary":"white",css:{borderBottomRightRadius:"0",borderTopRightRadius:"0"},leftIcon:"align-left",onClick:()=>{r(e.text.id,"justify","start")}})}),(0,i.jsx)(wm,{placement:"top",children:t("aligner_gauch_04681")})]}),(0,i.jsxs)(km,{children:[(0,i.jsx)(Sm,{children:(0,i.jsx)(zl,{color:"center"===e.text.justify?"primary":"white",css:{borderLeft:"none",borderRadius:"0",borderRight:"none"},leftIcon:"align-center",onClick:()=>{r(e.text.id,"justify","center")}})}),(0,i.jsx)(wm,{placement:"top",children:t("centrer_39779")})]}),(0,i.jsxs)(km,{children:[(0,i.jsx)(Sm,{children:(0,i.jsx)(zl,{color:"end"===e.text.justify?"primary":"white",css:{borderBottomLeftRadius:"0",borderTopLeftRadius:"0"},leftIcon:"align-right",onClick:()=>{r(e.text.id,"justify","end")}})}),(0,i.jsx)(wm,{placement:"top",children:t("aligner_droit_73883")})]})]}),(0,i.jsxs)(Ba,{children:[(0,i.jsxs)(km,{children:[(0,i.jsx)(Sm,{children:(0,i.jsx)(zl,{color:"start"===e.text.align?"primary":"white",css:{borderBottomRightRadius:"0",borderTopRightRadius:"0"},leftIcon:"objects-align-top",onClick:()=>{r(e.text.id,"align","start")}})}),(0,i.jsx)(wm,{placement:"top",children:t("aligner_en_haut_69916")})]}),(0,i.jsxs)(km,{children:[(0,i.jsx)(Sm,{children:(0,i.jsx)(zl,{color:"center"===e.text.align?"primary":"white",css:{borderLeft:"none",borderRadius:"0",borderRight:"none"},leftIcon:"objects-align-center-vertical",onClick:()=>{r(e.text.id,"align","center")}})}),(0,i.jsx)(wm,{placement:"top",children:t("centrer_39779")})]}),(0,i.jsxs)(km,{children:[(0,i.jsx)(Sm,{children:(0,i.jsx)(zl,{color:"end"===e.text.align?"primary":"white",css:{borderBottomLeftRadius:"0",borderTopLeftRadius:"0"},leftIcon:"objects-align-bottom",onClick:()=>{r(e.text.id,"align","end")}})}),(0,i.jsx)(wm,{placement:"top",children:t("aligner_en_bas_42956")})]})]})]})]}),(0,i.jsxs)($u,{label:t("transformation_09363"),value:e.text.textTransform,onChange:t=>{r(e.text.id,"textTransform",t)},children:[(0,i.jsx)("option",{value:"none",children:t("aucune_76773")}),(0,i.jsx)("option",{value:"capitalize",children:t("capitaliser_76627")}),(0,i.jsx)("option",{value:"uppercase",children:t("majuscules_64521")}),(0,i.jsx)("option",{value:"lowercase",children:t("minuscules_02420")})]})]})}),(0,i.jsx)(LL,{element:e.text})]})},YL=()=>{const{translate:e}=vl(),{getSelectedElement:t,tab:n,setTab:s}=FL(),o=t();return"container"===o?.type?(0,i.jsx)(BL,{container:o}):"image"===o?.type?(0,i.jsx)(WL,{image:o}):"text"===o?.type?(0,i.jsx)(KL,{text:o}):(0,i.jsxs)(Ba,{css:{boxShadow:"$sm",overflow:"hidden auto",py:"$6",paddingBottom:"$11"},direction:"column",gap:"6",height:1,width:1,children:[(0,i.jsx)(Ba,{css:{px:"$4"},children:(0,i.jsxs)(eb,{selectedItem:n,onChange:s,children:[(0,i.jsx)(tb,{item:"parameters",children:e("param_tres_78420")}),(0,i.jsx)(tb,{item:"design",children:e("design_15043")})]})}),"parameters"===n&&(0,i.jsx)(GL,{}),"design"===n&&(0,i.jsx)(UL,{})]})},ZL=()=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ar,{css:{borderTop:"1px solid black",height:"1px",left:"0",position:"absolute",top:"19px",width:"11px"}}),(0,i.jsx)(Ar,{css:{borderRight:"1px solid black",height:"11px",left:"19px",position:"absolute",top:"0",width:"1px"}}),(0,i.jsx)(Ar,{css:{borderTop:"1px solid black",height:"1px",position:"absolute",right:"0",top:"19px",width:"11px"}}),(0,i.jsx)(Ar,{css:{borderRight:"1px solid black",height:"11px",position:"absolute",right:"19px",top:"0",width:"1px"}}),(0,i.jsx)(Ar,{css:{borderTop:"1px solid black",bottom:"19px",height:"1px",left:"0",position:"absolute",width:"11px"}}),(0,i.jsx)(Ar,{css:{borderRight:"1px solid black",bottom:"0",height:"11px",left:"19px",position:"absolute",width:"1px"}}),(0,i.jsx)(Ar,{css:{borderTop:"1px solid black",bottom:"19px",height:"1px",position:"absolute",right:"0",width:"11px"}}),(0,i.jsx)(Ar,{css:{borderRight:"1px solid black",bottom:"0",height:"11px",position:"absolute",right:"19px",width:"1px"}})]}),XL=e=>{const{selectedElementId:t,selectElement:n}=FL();return(0,i.jsx)(Ba,{align:e.container.align,css:{backgroundColor:e.container.hasBackground?e.container.backgroundColor:"none",border:e.container.borderSize>0?`${e.container.borderSize}px solid ${e.container.borderColor}`:"",borderRadius:e.container.borderRadius>0?`${e.container.borderRadius}px`:"0",gap:`${e.container.gap}px`,left:`${e.container.left}px`,outline:t===e.container.id?"2px solid $primary500":"",overflow:"hidden",paddingBottom:`${e.container.py||0}px`,paddingLeft:`${e.container.px||0}px`,paddingRight:`${e.container.px||0}px`,paddingTop:`${e.container.py||0}px`,position:e.container.inContainer?"static":"absolute",top:`${e.container.top}px`,zIndex:e.container.zIndex},direction:e.container.direction,height:e.container.height,justify:e.container.justify,width:e.container.width,onClick:t=>{Dl(t),n(e.container.id,e.pageId)},children:e.container.elements.map(t=>(0,i.jsx)(eB,{element:t,pageId:e.pageId},t.id))})},JL=e=>{const{selectedElementId:t,selectElement:n}=FL();return(0,i.jsx)(Ar,{css:{border:e.image.borderSize>0?`${e.image.borderSize}px solid ${e.image.borderColor}`:"",borderRadius:e.image.borderRadius>0?`${e.image.borderRadius}px`:"0",left:`${e.image.left}px`,outline:t===e.image.id?"2px solid $primary500":"",overflow:"hidden",paddingBottom:`${e.image.py||0}px`,paddingLeft:`${e.image.px||0}px`,paddingRight:`${e.image.px||0}px`,paddingTop:`${e.image.py||0}px`,position:e.image.inContainer?"static":"absolute",top:`${e.image.top}px`,transform:e.image.hasRotate?`rotate(${e.image.rotateDegree}deg)`:void 0,transformOrigin:e.image.hasRotate?"top left":void 0,zIndex:e.image.zIndex},height:e.image.height,width:e.image.width,onClick:t=>{Dl(t),n(e.image.id,e.pageId)},children:m(e.image.source)&&(0,i.jsx)("img",{height:"100%",src:(s=e.image.source,"{user.picture}"===s?`${P.HEAVENT_ASSETS_URL}/badges/profile.jpg`:"{user.qrcode}"===s||"{user.skidata}"===s?pg("https://weezevent.com",{height:360,width:360}):"{user.code39}"===s?pg("12345678",{barcodeType:gg.Code39,height:28,width:234}):s),width:"100%"})});var s},QL=e=>{const{selectedElementId:t,selectElement:n}=FL(),s=gz(e.text.text);return(0,i.jsx)(Ba,{align:e.text.align,css:{backgroundColor:e.text.hasBackground?e.text.backgroundColor:"none",border:e.text.borderSize>0?`${e.text.borderSize}px solid ${e.text.borderColor}`:"",borderRadius:e.text.borderRadius>0?`${e.text.borderRadius}px`:"0",color:e.text.color,fontFamily:e.text.fontFamily,fontSize:`${e.text.fontSize}px`,fontWeight:e.text.fontWeight,left:`${e.text.left}px`,lineHeight:e.text.lineHeight||1.4,outline:t===e.text.id?"2px solid $primary500":"",overflow:"hidden",paddingBottom:`${e.text.py||0}px`,paddingLeft:`${e.text.px||0}px`,paddingRight:`${e.text.px||0}px`,paddingTop:`${e.text.py||0}px`,position:e.text.inContainer?"static":"absolute",textAlign:e.text.justify,textTransform:e.text.textTransform,top:`${e.text.top}px`,transform:e.text.hasRotate?`rotate(${e.text.rotateDegree}deg)`:void 0,transformOrigin:e.text.hasRotate?"top left":void 0,whiteSpace:"pre-wrap",zIndex:e.text.zIndex,"& em":{fontStyle:"italic"},"& s":{textDecoration:"line-through"},"& strong":{fontWeight:700},"& u":{textDecoration:"underline"}},dangerouslySetInnerHTML:{__html:s},height:e.text.height,justify:e.text.justify,width:e.text.width,onClick:t=>{Dl(t),n(e.text.id,e.pageId)}})},eB=e=>"container"===e.element.type?(0,i.jsx)(XL,{container:e.element,pageId:e.pageId}):"image"===e.element.type?(0,i.jsx)(JL,{image:e.element,pageId:e.pageId}):"text"===e.element.type?(0,i.jsx)(QL,{pageId:e.pageId,text:e.element}):null,tB=e=>{const{translate:t}=vl(),{customDocument:n,addPage:s,removePage:o,selectedPageId:r,selectPage:a}=FL(),l=n.configuration.pages.length>1,d=n.configuration.bleed?19:0;return(0,i.jsxs)(Ba,{css:{height:"fit-content",width:"fit-content"},direction:"column",gap:"2",children:[(0,i.jsxs)(Ba,{align:"center",children:[(0,i.jsx)(Ar,{css:{cursor:"pointer",flex:"1"},fontWeight:"semiBold",onClick:t=>{Dl(t),a(e.page.id)},children:m(e.page.name)?e.page.name:t("page_1_33637",e.index+1)}),(0,i.jsxs)(Ba,{gap:"2",children:[(0,i.jsx)(zl,{color:"white",leftIcon:"plus",size:"sm",onClick:s}),(0,i.jsx)(zl,{color:"white",disabled:!l,leftIcon:"trash-can",size:"sm",onClick:()=>{o(e.page.id)}})]})]}),(0,i.jsxs)(Ba,{css:{background:"white",padding:`${d}px`,position:"relative"},height:2*d+n.configuration.height,width:2*d+n.configuration.width,children:[n.configuration.bleed&&(0,i.jsx)(ZL,{}),(0,i.jsx)(Ba,{css:{background:"white",outline:r===e.page.id?"2px solid $primary500":"",position:"relative"},height:n.configuration.height,width:n.configuration.width,onClick:t=>{Dl(t),a(e.page.id)},children:e.page.elements.map(t=>(0,i.jsx)(eB,{element:t,pageId:e.page.id},t.id))})]})]})},nB=()=>{const{customDocument:e,cleanSelecteds:t}=FL(),[n,s]=(0,L.useState)(100);return(0,i.jsxs)(Ar,{css:{background:"$gray100",position:"relative"},height:1,width:1,children:[(0,i.jsx)(Ba,{align:"center",css:{overflow:"auto",padding:"$9",zoom:`${n}%`},direction:"column",gap:"7",height:1,width:1,onClick:t,children:e.configuration.pages.map((e,t)=>(0,i.jsx)(tB,{index:t,page:e},e.id))}),(0,i.jsx)(Ar,{css:{bottom:"24px",position:"absolute",right:"24px",zIndex:1e3},width:140,children:(0,i.jsxs)($u,{shouldParseAsInt:!0,value:n,onChange:s,children:[(0,i.jsx)("option",{value:"50",children:"Zoom (50%)"}),(0,i.jsx)("option",{value:"66",children:"Zoom (66%)"}),(0,i.jsx)("option",{value:"80",children:"Zoom (80%)"}),(0,i.jsx)("option",{value:"100",children:"Zoom (100%)"}),(0,i.jsx)("option",{value:"120",children:"Zoom (120%)"}),(0,i.jsx)("option",{value:"150",children:"Zoom (150%)"}),(0,i.jsx)("option",{value:"200",children:"Zoom (200%)"})]})})]})},iB=e=>{const{deleteElement:t,duplicateElement:n,selectedElementId:s,selectElement:o}=FL();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ba,{align:"center",css:{background:s===e.element.id?"$primary100":"none",borderRadius:"$1",color:s===e.element.id?"$primary500":"$gray800",cursor:"pointer",padding:"$2","& .h-duplicate, & .h-delete":{display:"none"},"&:hover":{background:"$primary100",color:"$primary500","& .h-duplicate, & .h-delete":{display:"block"}}},gap:"3",width:250,onClick:()=>{o(e.element.id,e.pageId)},children:[(0,i.jsx)(Ar,{fontSize:"textMd",children:(0,i.jsx)(nl,{icon:(r=e.element,"container"===r.type?"column"===r.direction?"chart-simple-horizontal":"chart-simple":"image"===r.type?"image":"text")})}),(0,i.jsx)(Ar,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(Ar,{css:{ellipsis:!0},fontSize:"textSm",fontWeight:"medium",title:e.element.name,width:1,children:e.element.name})}),(0,i.jsx)(Ar,{className:"h-duplicate",onClick:t=>{Dl(t),n(e.element.id)},children:(0,i.jsx)(nl,{icon:"copy"})}),(0,i.jsx)(Ar,{className:"h-delete",onClick:n=>{Dl(n),t(e.element.id)},children:(0,i.jsx)(nl,{icon:"trash-can"})})]}),"container"===e.element.type&&(0,i.jsx)(Ba,{css:{paddingLeft:"$8"},direction:"column",children:e.element.elements.map(t=>(0,i.jsx)(iB,{element:t,pageId:e.pageId},t.id))})]});var r},sB=e=>{const{translate:t}=vl(),{duplicatePage:n,selectedPageId:s,selectPage:o}=FL(),r=m(e.page.name)?e.page.name:t("page_1_33637",e.index+1);return(0,i.jsx)(GM,{css:{gap:"0",width:"fit-content"},title:(0,i.jsxs)(Ba,{align:"center",css:{background:s===e.page.id?"$primary100":"",borderRadius:"$1",color:s===e.page.id?"$primary500":"$gray800",fontWeight:"$medium",padding:"$2","& .h-duplicate":{display:"none"},"&:hover":{background:"$primary100",color:"$primary500","& .h-duplicate":{display:"block"}}},gap:"3",width:250,onClick:t=>{Dl(t),o(e.page.id)},children:[(0,i.jsx)(Ar,{fontSize:"textMd",children:(0,i.jsx)(nl,{icon:"frame"})}),(0,i.jsx)(Ar,{css:{flex:"1"},children:r}),(0,i.jsx)(Ar,{className:"h-duplicate",onClick:t=>{Dl(t),n(e.page.id)},children:(0,i.jsx)(nl,{icon:"copy"})})]}),titleCss:{gap:"$2"},children:(0,i.jsx)(Ba,{css:{paddingLeft:"$8"},direction:"column",children:e.page.elements.map(t=>(0,i.jsx)(iB,{element:t,pageId:e.page.id},t.id))})})},oB=()=>{const{customDocument:e}=FL();return(0,i.jsx)(Ba,{css:{overflowY:"auto"},direction:"column",height:1,width:1,children:e.configuration.pages.map((e,t)=>(0,i.jsx)(sB,{index:t,page:e},e.id))})},rB=()=>{const{history:e,params:{organizationId:t,eventId:n,customDocumentId:s},translate:o}=vl(),{mutate:r,isLoading:a}=function(e={}){return ei("mutation CustomDocumentUpdate(\n $eventId: EventId!\n $customDocumentId: CustomDocumentId!\n $customDocument: CustomDocumentInput!\n) {\n customDocumentUpdate(\n eventId: $eventId\n customDocumentId: $customDocumentId\n customDocument: $customDocument\n ) {\n id\n }\n}\n",e)}(),{customDocument:l}=FL(),d=(0,L.useMemo)(()=>JSON.stringify(l),[a]),[c,u]=(0,L.useState)(!1),h=(0,L.useCallback)(()=>{JSON.stringify(l)===d?e.goBack(Ps.DOCUMENTS(t,n)):u(!0)},[l,d]);return Md(o("mise_jour_de_17055",l.name)),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Lm,{button:(0,i.jsx)(zl,{isLoading:a,onClick:async()=>{await r({eventId:n,customDocumentId:s,customDocument:l})},children:o("enregistrer_06519")}),category:o("document_person_69340"),color:"dark",heading:l.name,onClose:h,children:(0,i.jsxs)(Ba,{height:1,width:1,children:[(0,i.jsx)(Ar,{height:1,width:420,children:(0,i.jsx)(YL,{})}),(0,i.jsx)(Ar,{css:{flex:"1"},height:1,children:(0,i.jsx)(nB,{})}),(0,i.jsx)(Ar,{height:1,width:340,children:(0,i.jsx)(oB,{})})]})}),(0,i.jsx)(eE,{fallbackPath:Ps.DOCUMENTS(t,n),isOpen:c,onClose:()=>u(!1)})]})},aB=()=>{const{history:e,params:{organizationId:t,eventId:n,customDocumentId:s}}=vl(),{data:o,loader:r}=Qn('query CustomDocument(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $customDocumentId: CustomDocumentId!\n) {\n organization(id: $organizationId) {\n population: customFieldBySlug(slug: "population") {\n values {\n id\n value\n }\n }\n\n customFields(variety: UserInfo, privacy: All, sort: { attribute: Name, direction: Asc }) {\n nodes {\n ...ConditionCustomField\n }\n }\n }\n\n event(id: $eventId) {\n customDocument(customDocumentId: $customDocumentId) {\n name\n slug\n populationsIds\n configuration\n }\n }\n}\n',{organizationId:t,eventId:n,customDocumentId:s},[Vs.ConditionCustomFieldFragment]),a=Zn(TL);return r||o.event?.customDocument||e.replace(Ps.DOCUMENTS(t,n)),r||(0,i.jsx)(PL,{customFields:o.organization.customFields.nodes,initialCustomDocument:a.customDocumentInputDefault(o.event.customDocument),population:o.organization.population,children:(0,i.jsx)(rB,{})})},lB=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:s}}=vl(),{mutate:o}=function(e={}){return ei("mutation CustomDocumentCreate($eventId :EventId!, $customDocument: CustomDocumentInput!){\n customDocumentCreate(eventId: $eventId, customDocument: $customDocument){\n id\n }\n}\n",e)}(),r=Zn(TL),[a,d]=(0,L.useState)(""),[c,u]=(0,L.useState)(""),[g,p]=(0,L.useState)(!1),f=(0,L.useCallback)(e=>{d(e),g||u(h(e,{replacer:l.Empty}))},[g,d,u]),_=(0,L.useCallback)(e=>{m(e)?(u(h(e,{replacer:l.Empty})),p(!0)):(u(""),p(!1))},[u,p]);return(0,i.jsxs)(Lb,{children:[(0,i.jsx)(Bb,{children:(0,i.jsx)(zl,{children:t("cr_er_un_docume_92512")})}),(0,i.jsxs)(Nb,{children:[(0,i.jsx)(Mb,{icon:"file",children:t("nouveau_documen_36722")}),(0,i.jsxs)(Fb,{gap:"5",children:[(0,i.jsx)(Bl,{label:t("nom_du_document_22604"),value:a,onChange:f}),(0,i.jsx)(Bl,{hint:t("ne_doit_conteni_53122"),label:t("nom_de_la_varia_81999"),value:c,onChange:_})]}),(0,i.jsx)(Pb,{children:(0,i.jsx)(zl,{onClick:async()=>{const{customDocumentCreate:t}=await o({eventId:s,customDocument:{name:a,slug:c,populationsIds:[],configuration:r.getConfigurationDefault()}});e.push(Ps.EDIT_CUSTOM_DOCUMENT(n,s,t.id))},children:t("cr_er_le_docume_02657")})})]})]})},dB=e=>(0,i.jsxs)(Ba,{direction:"column",gap:"2",children:[(0,i.jsx)(Ar,{font:"gray900 textLg medium",children:e.title}),(0,i.jsx)(Ba,{css:{background:"white",bd:!0,"& > div:last-child":{borderBottom:"none"}},direction:"column",children:e.children})]}),cB=e=>{const{history:t,translate:n,params:{organizationId:s,eventId:o}}=vl(),{showNotification:r}=Ob(),{mutate:a}=function(e={}){return ei("mutation CustomDocumentDuplicate($eventId: EventId!, $customDocumentId: CustomDocumentId!) {\n customDocumentDuplicate(eventId: $eventId, customDocumentId: $customDocumentId) {\n id\n }\n}\n",e)}(),{mutate:l}=function(e={}){return ei("mutation CustomDocumentDelete($eventId: EventId!, $customDocumentId: CustomDocumentId!) {\n customDocumentDelete(eventId: $eventId, customDocumentId: $customDocumentId) {\n id\n }\n}\n",e)}(),[d,c]=(0,L.useState)(!1),u=RL(e.customDocument.configuration.height,e.customDocument.configuration.width),h=e.customDocument.populations.join(", ");return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ba,{align:"center",css:{borderBottom:"1px solid $gray200",px:"$6"},gap:"4",height:74,width:1,children:[(0,i.jsx)(Ba,{align:"center",css:{background:"$success100",borderRadius:"$3",color:"$success700",fontSize:"$textMd"},height:40,justify:"center",width:40,children:(0,i.jsx)(nl,{icon:"pen-ruler"})}),(0,i.jsxs)(Ba,{css:{flex:"1"},direction:"column",gap:"1",children:[e.disabled?(0,i.jsx)(Ar,{font:"gray800 textMd medium",children:e.customDocument.name}):(0,i.jsx)(Zc,{css:{fontSize:"$textMd"},to:Ps.DOCUMENTS_USER_CUSTOM_DOCUMENT(s,o,e.userInfoId,e.customDocument.id),children:e.customDocument.name}),(0,i.jsx)(Ar,{color:"gray500",children:n("cr_par_1_69201",e.customDocument.createdBy.nameOrEmail)})]}),(0,i.jsxs)(Ba,{direction:"column",gap:"1",width:100,children:[(0,i.jsx)(Ar,{font:"gray500 textXs regular",children:n("populations_48141")}),(0,i.jsx)(Ar,{css:{ellipsis:!0},font:"gray800 textSm medium",title:h,width:1,children:m(h)?h:"-"})]}),(0,i.jsxs)(Ba,{direction:"column",gap:"1",width:85,children:[(0,i.jsx)(Ar,{font:"gray500 textXs regular",children:n("format_54368")}),(0,i.jsx)(Ar,{font:"gray800 textSm medium",children:"custom"===u?n("personnalis_40360"):u.toUpperCase()})]}),(0,i.jsxs)(Ba,{direction:"column",gap:"1",width:280,children:[(0,i.jsx)(Ar,{font:"gray500 textXs regular",children:n("nom_de_la_varia_81999")}),(0,i.jsx)(Ar,{css:{ellipsis:!0},font:"gray800 textSm medium",title:`{user.documents.${e.customDocument.slug}}`,width:1,children:`{user.documents.${e.customDocument.slug}}`})]}),(0,i.jsx)(Kb,{permissions:Hb.DOCUMENT_EDIT,children:(0,i.jsxs)(km,{children:[(0,i.jsx)(Sm,{children:(0,i.jsx)(zl,{color:"white",leftIcon:"pen",size:"sm",onClick:()=>{t.push(Ps.EDIT_CUSTOM_DOCUMENT(s,o,e.customDocument.id))}})}),(0,i.jsx)(wm,{placement:"top",children:n("_diter_62574")})]})}),(0,i.jsx)(Kb,{permissions:Hb.DOCUMENT_EDIT,children:(0,i.jsxs)(Wd,{children:[(0,i.jsx)(Xd,{children:(0,i.jsx)(zl,{color:"white",leftIcon:"ellipsis-vertical",size:"sm"})}),(0,i.jsxs)(Zd,{placement:"bottom-end",children:[(0,i.jsx)(Kd,{icon:"clone",onClick:async()=>{await a({eventId:o,customDocumentId:e.customDocument.id}),e.reload()},children:n("dupliquer_28256")}),(0,i.jsx)(Xu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Kd,{color:"red",icon:"trash-can",onClick:()=>{c(!0)},children:n("supprimer_43083")})]})]})})]}),d&&(0,i.jsx)(cA,{buttonText:n("supprimer_43083"),subtext:n("_tes_vous_s_r_d_81333"),text:n("suppression_de_73669",e.customDocument.name),onClose:()=>{c(!1)},onDelete:async()=>{await l({eventId:o,customDocumentId:e.customDocument.id}),r(n("le_document_1_14516",e.customDocument.name)),e.reload()}})]})},uB=e=>{const{translate:t}=vl(),n=(0,L.useMemo)(()=>(0,uc.A)(e.customDocuments,e=>e.name.toLowerCase()),[e.customDocuments]);return(0,i.jsx)(dB,{title:t("documents_perso_87374"),children:n.map(t=>(0,i.jsx)(cB,{customDocument:t,disabled:0===e.numberOfVolunteersRegistrations,reload:e.reload,userInfoId:e.userInfoId},t.id))})},hB=e=>{const{translate:t}=vl();return(0,i.jsxs)(Ba,{align:"center",css:{borderBottom:"1px solid $gray200",px:"$6"},gap:"4",height:74,width:1,children:[(0,i.jsx)(Ba,{align:"center",css:{background:xr.colors[`${e.color}100`],borderRadius:"$3",color:xr.colors[`${e.color}700`],fontSize:"$textMd"},height:40,justify:"center",width:40,children:(0,i.jsx)(nl,{icon:e.icon})}),(0,i.jsxs)(Ba,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsxs)(Ba,{align:"center",gap:"2",children:[e.disabled?(0,i.jsx)(Ar,{font:"gray800 textMd medium",children:e.title}):(0,i.jsx)(Zc,{css:{fontSize:"$textMd"},to:e.path,children:e.title}),e.disabled&&(0,i.jsx)(rc,{color:"warning",size:"sm",children:t("le_document_n_e_47973")})]}),(0,i.jsx)(Ar,{color:"gray500",children:t("cr_par_1_69201","WeezCrew")})]}),m(e.variable)&&(0,i.jsxs)(Ba,{direction:"column",gap:"1",width:280,children:[(0,i.jsx)(Ar,{font:"gray500 textXs regular",children:t("nom_de_la_varia_81999")}),(0,i.jsx)(Ar,{css:{ellipsis:!0},font:"gray800 textSm medium",title:"",width:1,children:`{user.documents.${e.variable}}`})]}),void 0!==e.count&&!e.disabled&&(0,i.jsxs)(Ba,{direction:"column",gap:"1",width:150,children:[(0,i.jsx)(Ar,{font:"gray500 textXs regular",children:e.text}),(0,i.jsx)(Ar,{font:"gray800 textSm medium",children:e.count})]})]})},mB=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=vl();return(0,i.jsxs)(dB,{title:t("_v_nement_22345"),children:[(0,i.jsx)(hB,{color:"pink",icon:"list-ul",path:Ps.DOCUMENTS_VOLUNTEERS_LISTING(n,s,e.volunteersSegmentId),text:t("nombre_de_membr_87049"),title:t("liste_des_membr_89037")}),(0,i.jsx)(hB,{color:"purple",icon:"calendar-day",path:Ps.DOCUMENTS_POSITIONS_VOLUNTEERS_PLANNING(n,s,e.positionsSegmentId),text:t("nombre_de_missi_56719"),title:t("planning_d_un_g_23684")}),(0,i.jsx)(hB,{color:"purple",icon:"calendar-day",path:Ps.DOCUMENTS_PLANNING(n,s,e.positionsSegmentId),text:t("nombre_de_missi_56719"),title:t("planning_de_l_96909")}),(0,i.jsx)(hB,{color:"purple",icon:"image",path:Ps.DOCUMENTS_USERS_PICTURES(n,s,e.volunteersSegmentId),text:"",title:t("trombinoscope_11316")})]})},gB=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=vl(),{organization:o}=TI();return(0,i.jsxs)(dB,{title:t("membres_11310"),children:[(0,i.jsx)(hB,{color:"pink",count:e.numberOfAssignedVolunteersRegistrations,disabled:0===e.numberOfAssignedVolunteersRegistrations,icon:"user",path:Ps.DOCUMENTS_ASSIGNMENTS(n,s,e.assignedUserInfoId),text:t("nombre_de_membr_87049"),title:t("fiche_d_affecta_91461"),variable:"assignments"}),(0,i.jsx)(hB,{color:"purple",count:e.numberOfAssignedVolunteersRegistrations,disabled:0===e.numberOfAssignedVolunteersRegistrations,icon:"calendar-day",path:Ps.DOCUMENTS_USER_PLANNING(n,s,e.assignedUserInfoId),text:t("nombre_de_membr_87049"),title:t("UserPlanning"),variable:"planning"}),(0,i.jsx)(hB,{color:"purple",count:e.numberOfAssignedVolunteersRegistrations,disabled:0===e.numberOfAssignedVolunteersRegistrations,icon:"calendar-day",path:Ps.DOCUMENTS_USER_PLANNING_LIST(n,s,e.assignedUserInfoId),text:t("nombre_de_membr_87049"),title:t("UserPlanningList"),variable:"planningList"}),(0,i.jsx)(hB,{color:"purple",count:e.numberOfAssignedVolunteersRegistrations,disabled:0===e.numberOfAssignedVolunteersRegistrations,icon:"calendar-day",path:Ps.DOCUMENTS_USER_PLANNING_DAYS(n,s,e.assignedUserInfoId),text:t("nombre_de_membr_87049"),title:t("UserPlanningDays"),variable:"planningDays"}),(0,i.jsx)(hB,{color:"success",count:e.numberOfAssignedVolunteersRegistrations,disabled:0===e.numberOfAssignedVolunteersRegistrations,icon:"certificate",path:Ps.DOCUMENTS_CERTIFICATE(n,s,e.assignedUserInfoId),text:t("nombre_de_membr_87049"),title:t("Certificate"),variable:"certificate"}),(0,i.jsx)(hB,{color:"success",count:e.numberOfAssignedVolunteersRegistrations,disabled:0===e.numberOfAssignedVolunteersRegistrations,icon:"id-card",path:Ps.DOCUMENTS_BADGE(n,s,e.assignedUserInfoId,"generic"),text:t("nombre_de_membr_87049"),title:t("BadgeCheck"),variable:"badge"}),(0,i.jsx)(hB,{color:"success",count:e.numberOfAssignedVolunteersRegistrations,disabled:0===e.numberOfAssignedVolunteersRegistrations,icon:"clock",path:Ps.DOCUMENTS_HOURS(n,s,e.assignedUserInfoId),text:t("nombre_de_membr_87049"),title:t("UserHours"),variable:"hours"}),o.customBadges.map(o=>(0,i.jsx)(hB,{color:"success",count:e.numberOfVolunteersRegistrations,disabled:!1,icon:"id-card",path:Ps.DOCUMENTS_BADGE(n,s,e.userInfoId,o),text:t("nombre_de_membr_87049"),title:Vx(o),variable:o.toLowerCase()},o))]})},pB=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=vl();return(0,i.jsxs)(dB,{title:t("missions_63972"),children:[(0,i.jsx)(hB,{color:"blueGray",count:e.numberOfPositions,disabled:0===e.numberOfPositions,icon:"sitemap",path:Ps.DOCUMENTS_POSITION(n,s,e.positionId),text:t("nombre_de_fiche_03009"),title:t("fiche_de_missio_00324")}),(0,i.jsx)(hB,{color:"purple",count:e.numberOfPositions,disabled:0===e.numberOfPositions,icon:"calendar-day",path:Ps.DOCUMENTS_POSITION_PLANNING(n,s,e.positionId),text:t("nombre_de_missi_56719"),title:t("planning_d_une_64581")})]})},fB=e=>{const{hasFeature:t}=TI(),n=e.event.volunteersRegistrations.nodes[0]?.userInfoId??-1;return(0,i.jsxs)(Ba,{direction:"column",gap:"7",children:[t(Be.CustomDocument)&&so(e.event.customDocuments)&&(0,i.jsx)(uB,{customDocuments:e.event.customDocuments,numberOfVolunteersRegistrations:e.event.volunteersRegistrations.totalCount,reload:e.reload,userInfoId:n}),(0,i.jsx)(gB,{assignedUserInfoId:e.event.assignedVolunteersRegistrations.nodes[0]?.userInfoId??-1,numberOfAssignedVolunteersRegistrations:e.event.assignedVolunteersRegistrations.totalCount,numberOfVolunteersRegistrations:e.event.volunteersRegistrations.totalCount,userInfoId:n}),(0,i.jsx)(pB,{numberOfPositions:e.event.positions.totalCount,positionId:e.event.positions.nodes[0]?.id??-1}),(0,i.jsx)(mB,{positionsSegmentId:e.event.positionsSegments[0].id,volunteersSegmentId:e.event.volunteersSegments[0].id})]})},_B=()=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"7"}),(0,i.jsxs)(Ba,{direction:"column",gap:"2",children:[(0,i.jsx)(lc,{borderRadius:"$1",height:25,width:1}),(0,i.jsx)(lc,{borderRadius:"$2",height:74,width:1}),(0,i.jsx)(lc,{borderRadius:"$2",height:74,width:1})]}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsxs)(Ba,{direction:"column",gap:"2",children:[(0,i.jsx)(lc,{borderRadius:"$1",height:25,width:1}),(0,i.jsx)(lc,{borderRadius:"$2",height:74,width:1}),(0,i.jsx)(lc,{borderRadius:"$2",height:74,width:1})]})]}),xB=()=>{const{translate:e,params:{eventId:t}}=vl(),{hasFeature:n}=TI(),{event:{name:s}}=wb(),{canDocumentEdit:o}=$S();Md(`${s} ${e("Documents")}`);const{data:r,isLoading:a,reload:l}=Qn('query Documents($eventId: EventId!) {\n event(id: $eventId) {\n customDocuments {\n id\n name\n slug\n configuration\n populations\n\n createdBy {\n nameOrEmail\n }\n }\n\n positions(limit: 1) {\n nodes {\n id\n }\n\n totalCount\n }\n\n volunteersRegistrations(limit: 1, sort: { attribute: "Name", direction: Asc }) {\n nodes {\n userInfoId\n }\n\n totalCount\n }\n\n assignedVolunteersRegistrations: volunteersRegistrations(\n states: [Assigned]\n limit: 1\n sort: { attribute: "Name", direction: Asc }\n ) {\n nodes {\n userInfoId\n }\n\n totalCount\n }\n\n volunteersSegments: segments(segmentType: Volunteers) {\n id\n }\n\n positionsSegments: segments(segmentType: Positions) {\n id\n }\n }\n}\n',{eventId:t},[]);return(0,i.jsxs)(dj,{children:[(0,i.jsxs)(lj,{gap:"3",children:[(0,i.jsxs)(Ba,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(Ar,{font:"gray900 displayXs semiBold",children:e("Documents")}),(0,i.jsx)(Ar,{color:"gray500",children:e("retrouver_et_pe_99652")})]}),n(Be.CustomDocument)&&o&&(0,i.jsx)(lB,{})]}),(0,i.jsx)(aj,{children:n(Be.Documents)?a?(0,i.jsx)(_B,{}):(0,i.jsx)(fB,{event:r.event,reload:l}):(0,i.jsx)(Ba,{align:"center",css:{flex:"1"},direction:"column",justify:"center",children:(0,i.jsx)(zI,{icon:"folders"})})})]})};var IB;function vB(){return vB=Object.assign?Object.assign.bind():function(e){for(var t=1;t div":{alignItems:"center",background:"$success400",borderRadius:"$1",display:"flex",height:"100%",justifyContent:"center",width:"100%","& svg":{height:"50%"}}}),AB=_r(Ar,{background:`url(${jB}) no-repeat`,borderBottom:"1px solid $gray100",borderRight:"1px solid $gray100",color:"$gray700",height:"48px",width:"100px"}),wB=_r(Ar,{alignItems:"center",borderBottom:"1px solid $gray100",borderRight:"1px solid $gray100",color:"$gray800",display:"flex",height:"48px",padding:"$2",width:"100px","& > div":{alignItems:"center",border:"1px dashed $gray300",borderRadius:"$1",display:"flex",fontSize:"$textXs",height:"100%",justifyContent:"center",width:"100%"}}),SB=e=>{const t=Xn(),n=Zn(Jc),s=(0,L.useMemo)(()=>ch(e.slots.map(({range:e})=>e).reduce((e,t)=>e.union(t),e.slots[0].range)),[e.slots]),o=e.slots[0].range.start;return(0,i.jsxs)(Ba,{css:{background:"white",pageBreakBefore:"always"},direction:"column",width:1,children:[(0,i.jsx)(Ba,{css:{background:"$gray100",padding:"$6"},direction:"column",children:(0,i.jsx)(Ar,{font:"gray900 textXl medium",children:t("planning_1_14391",e.position.name)})}),(0,i.jsxs)(Ba,{css:{background:"white",padding:"$6"},direction:"column",width:1,children:[(0,i.jsxs)(Ba,{children:[(0,i.jsx)(CB,{width:200,children:t("jours_88317")}),(0,Dc.A)(0,s).map(t=>{const s=o.plus({days:t}),r=kh(s,e.slots);return(0,i.jsx)(CB,{width:100*(r.length||1),children:n.toLocaleString(s,eo.DateOnly.MonthShort)},t)})]}),(0,i.jsxs)(Ba,{children:[(0,i.jsx)(CB,{width:200,children:t("cr_neaux_33401")}),(0,Dc.A)(0,s).map(t=>{const n=kh(o.plus({days:t}),e.slots);return 0===n.length||n[0].isAddedSlot?(0,i.jsx)(AB,{},`${t}`):n.map(e=>(0,i.jsx)(CB,{width:100,children:e.range.toFormat("HH:mm",{separator:"-"})},`${t}-${e.id}`))})]}),e.volunteersRegistrations.map(n=>{const r=n.userInfo;return(0,i.jsxs)(Ba,{children:[(0,i.jsxs)(yB,{children:[(0,i.jsx)(sp,{email:r.email,image:r.picture?.url,name:r.name,size:24}),(0,i.jsx)(Ar,{css:{flex:"1",ellipsis:""},title:r.name,children:r.name})]}),(0,Dc.A)(0,s).map(s=>{const r=kh(o.plus({days:s}),e.slots);return 0===r.length||r[0].isAddedSlot?(0,i.jsx)(AB,{},`${s}`):r.map(e=>{const o=`${s}-${e.id}`,r=void 0!==n.positionsSlotsUsersInfos.find(({positionSlotId:t})=>t===e.id),a=n.positionsSlotsUsersInfos.some(({positionSlot:t})=>t.range.overlaps(e.range)),l=n.slots.some(t=>t.range.engulfs(e.range));return r?(0,i.jsx)(kB,{children:(0,i.jsx)(Ar,{children:(0,i.jsx)(bB,{})})},o):l&&!a?(0,i.jsx)(wB,{children:(0,i.jsx)(Ar,{children:t("disponible_69523")})},o):(0,i.jsx)(AB,{},o)})})]},n.id)})]})]})},EB=e=>{const t=Xn(),n=(0,L.useMemo)(()=>(0,uc.A)(uh(e.event.position.slots),e=>e.range.start).filter(t=>{if(e.date?.isValid&&e.endDate?.isValid){const n=Gs.IX.fromDateTimes(e.date.startOf("day"),e.endDate.endOf("day"));return t.range.overlaps(n)}return!e.date?.isValid||t.range.start.startOf("day").equals(e.date.startOf("day"))}),[e.event,e.date,e.endDate]),s=(0,L.useMemo)(()=>{if(so(n)){const e=ch(n.map(({range:e})=>e).reduce((e,t)=>e.union(t),n[0].range)),t=n[0].range.start;return(0,Dc.A)(0,e).flatMap(e=>{const i=t.plus({days:e}),s=kh(i,n);return so(s)?s:[{id:i.toMillis(),range:Gs.IX.fromDateTimes(i.startOf("day"),i.endOf("day")),isAddedSlot:!0}]})}return[]},[n]);return so(s)?(0,i.jsx)(i.Fragment,{children:(0,ep.A)(s,8).map((t,n)=>(0,ep.A)(e.event.volunteersRegistrations.nodes,11).map((s,o)=>(0,i.jsx)(SB,{position:e.event.position,slots:t,volunteersRegistrations:s},`${n}-${o}`)))}):(0,i.jsx)(Ba,{css:{background:"white",pageBreakBefore:"always"},direction:"column",width:1,children:(0,i.jsx)(Ba,{css:{background:"$gray100",padding:"$6"},direction:"column",children:(0,i.jsx)(Ar,{font:"gray900 textXl medium",children:t("planning_1_14391",e.event.position.name)})})})},TB=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=vl(),{user:o}=ai(),{checkDocumentsExport:r}=Ob(),[a,l]=(0,L.useState)([e.segmentsFolders[0].segments[0].id]),[d,c]=(0,L.useState)(e.languages[0]),[u,h]=(0,L.useState)(Gs.c9.invalid("Invalid")),[m,g]=(0,L.useState)(Ee.OnePerPage),[p,f]=(0,L.useState)(!1),_=(0,L.useMemo)(()=>e.showStrategy&&(!e.badgeType||function(e){try{return function(e,t){switch(e){case xe.Animajeconvention:case xe.Asoassignment:case xe.Cerclestaff:case xe.Cerclelivraison:case xe.Cerclepressandpartenaire:case xe.Cercleopcom:case xe.Delta:case xe.Dfcoa4:case xe.Dfcosmall:throw new Error("Not implemented");case xe.Eurockeennes:return(0,i.jsx)(dp,{event:t});case xe.Fcg:return(0,i.jsx)(mp,{event:t});case xe.Garorockplanning:case xe.Goldencoast:case xe.Hbcldc:case xe.Hbclnh:case xe.Lnh:case xe.Moorea:case xe.Nuitssecretes:case xe.Openbrest:case xe.P2nassignment:case xe.P2nassignmentmontagedemontage:case xe.P2nbadge:case xe.Paris20km:case xe.Paris20kmassignment:case xe.Paris20kmcontremarque:case xe.Pastourelle:case xe.Pastourelleexposant:case xe.Pec:case xe.Playground:case xe.Roiarthur:case xe.Rose:case xe.Roseparking:throw new Error("Not implemented");case xe.Salamandre:return(0,i.jsx)(sx,{event:t});case xe.T24assignment:case xe.Triathlonlarochellebadge:case xe.Utopialesimprimeur:case xe.Utopialesa4:case xe.Vandbcontremarque:case xe.Vannes:case xe.Vannesassignment:case xe.Vendanges:case xe.Vendeeglobebadge:case xe.Vendeeglobecontremarque:throw new Error("Not implemented");default:ll()}}(e,{}),!0}catch(e){return"Not implemented"!==e.message}}(e.badgeType)),[e.badgeType,e.showStrategy]);return(0,i.jsxs)(au,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Ba,{justify:"center",children:(0,i.jsx)(Ba,{align:"center",css:{background:"$primary50",borderRadius:"48px",color:"$primary500",height:"48px",fontSize:"20px",width:"48px"},justify:"center",children:(0,i.jsx)(nl,{icon:"envelope"})})}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(Ar,{color:"gray900",fontSize:"textLg",textAlign:"center",children:e.title}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ar,{color:"gray500",dangerouslySetInnerHTML:{__html:t("en_2_clics_rec_97175")},textAlign:"center"}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(rl,{color:"gray",leftIcon:"circle-exclamation",children:t("l_e_mail_peut_m_13253")}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsxs)(Ba,{css:{flex:"1",overflowY:"auto"},direction:"column",gap:"4",children:[(0,i.jsx)(yc,{isSearchVisible:!0,label:t("vue_s_personna_35768"),multiple:!0,placeholder:t("s_lectionnez_un_53633"),values:a,onChange:l,children:e.segmentsFolders.map(e=>(0,i.jsx)("optgroup",{label:e.name,children:e.segments.map(({id:e,name:t})=>(0,i.jsx)("option",{value:e,children:t},e))},e.id))}),e.languages.length>1&&(0,i.jsx)($u,{label:t("Language"),placeholder:t("Language"),value:d,onChange:e=>{c(e)},children:e.languages.map(e=>(0,i.jsx)("option",{value:e,children:e},e))}),e.showDate&&(0,i.jsx)(Mu,{label:t("exportez_vos_do_87332"),max:e.endAt,min:e.startAt,value:u,onChange:h}),_&&(0,i.jsx)($u,{label:t("strat_gie_44389"),value:m,onChange:e=>g(e),children:dn.map(e=>(0,i.jsx)("option",{value:e,children:t(e)},e))}),(0,i.jsx)(_c,{state:p?"checked":"unchecked",onClick:e=>{f("checked"===e)},children:t("fusionner_les_d_64130")}),(0,i.jsx)(Bl,{label:t("Email"),state:"disabled",value:o?.email??"",onChange:td.A})]}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsxs)(Ba,{gap:"3",justify:"end",children:[(0,i.jsx)(zl,{isLoading:e.isSendLoading,onClick:async()=>{const t=await e.onSend(a,d,p,m,u.isValid?u:void 0);r(t,n,s),e.onClose()},children:t("envoyer_26609")}),(0,i.jsx)(zl,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},zB=e=>{const t=Xn(),{mutate:n,isLoading:s}=Mo(),[o,r]=L.useState(!1);return(0,i.jsxs)(Ba,{align:"center",gap:"3",children:[(0,i.jsx)(Sj,{returnPathFallback:Ps.DOCUMENTS(e.organizationId,e.eventId)}),(0,i.jsx)(Ar,{color:"gray900",css:{flex:"1"},fontSize:"displayXs",fontWeight:"medium",children:e.title}),(0,i.jsx)(Kb,{rolesTypes:jI,children:e.extraButton}),(0,i.jsx)(Kb,{rolesTypes:jI,children:(0,i.jsx)(zl,{isLoading:s,onClick:()=>{r(!0)},children:t("param_trer_l_ex_83342")})}),o&&(0,i.jsx)(TB,{badgeType:e.badgeType,endAt:e.endAt,isSendLoading:s,languages:e.languages,segmentsFolders:e.segmentsFolders,showDate:e.showDate,showStrategy:e.showStrategy,startAt:e.startAt,title:t("envoi_de_vos_do_32953"),onClose:()=>{r(!1)},onSend:async(t,i,s,o,r)=>{const{eventDocumentsExport:a}=await n({organizationId:e.organizationId,eventId:e.eventId,documentsExport:{documentType:e.documentType,badgeType:e.badgeType,customDocumentSlug:e.customDocumentSlug,segmentsIds:t,language:i,oneFile:s,strategy:o,date:r}});return a}})]})},OB=e=>(0,i.jsx)(Ba,{css:{background:"$gray50",border:"1px solid $gray200",flex:"1",padding:"$7",overflowX:"hidden",overflowY:"auto"},height:1,justify:"center",children:(0,i.jsx)(Ba,{css:{boxShadow:"$md",borderRadius:"$2",height:"fit-content",overflow:"hidden"},direction:"column",width:e.width,children:e.children})});const RB=e=>{const{history:t,translate:n,params:{organizationId:s,eventId:o,positionId:r}}=vl(),[a,l,d]=Wc(""),{positionsOptions:c,isLoading:u}=function({eventId:e,hasSelected:t,nameDebounced:n,organizationId:s,positionsIds:o}){const{data:r,isLoading:a}=(l={organizationId:s,eventId:e,hasSelected:t,name:m(n)?n:void 0,ids:o},Qn(xo,l,[]));var l;const d=L.useMemo(()=>(0,uc.A)((0,xh.A)((r.organization?.list.nodes??[]).concat(r.organization?.selected.nodes??[]),e=>e.id),e=>e.name.toLowerCase()),[r.organization]);return{positionsOptions:L.useMemo(()=>d.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id)),[d]),isLoading:a}}({organizationId:s,eventId:o,hasSelected:!0,positionsIds:[r],nameDebounced:l});return(0,i.jsxs)(Ba,{align:"center",css:{background:"$gray100",border:"1px solid $gray200",borderBottom:"none",padding:"$3 $7"},gap:"4",children:[(0,i.jsx)(Ar,{font:"gray900 textMd semiBold",children:n("aper_u_pour_la_94895")}),(0,i.jsx)(Ar,{width:320,children:(0,i.jsx)(yc,{isSearchLoading:u,isSearchVisible:!0,searchElement:(0,i.jsx)(Bl,{icon:"magnifying-glass",placeholder:n("rechercher_une_69998"),state:"search",value:a,onChange:d}),values:[r],onChange:n=>{so(n)&&t.replace(e.getPath(n[0]))},children:c})})]})},$B=()=>{const{translate:e,params:{organizationId:t,eventId:n,positionId:s}}=vl(),{event:o}=wb(),{data:r,loader:a}=Qn("query PositionPlanningDocument($eventId: EventId!, $positionId: PositionId!) {\n event(id: $eventId) {\n ...DocumentPositionPlanning\n ...EventPositionsExport\n }\n}\n",{eventId:n,positionId:s},[Vs.DocumentPositionPlanningFragment,Vs.EventPositionsExportFragment]);return Md(`${o.name} ${e("planning_d_une_64581")}`),(0,i.jsxs)(Ba,{css:{overflowY:"auto",padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(zB,{documentType:ze.PositionPlanning,eventId:n,languages:r.event?.languages??[],organizationId:t,segmentsFolders:r.event?.segmentsFolders??[],showDate:!0,title:e("planning_d_une_64581")}),(0,i.jsx)(Ya,{height:"7"}),a||(0,i.jsxs)(Ba,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(RB,{getPath:e=>Ps.DOCUMENTS_POSITION_PLANNING(t,n,e)}),(0,i.jsx)(OB,{children:(0,i.jsx)(EB,{event:r.event})})]})]})},DB=e=>{const t=Xn(),n=m(e.acronym)?`${e.name} (${e.acronym})`:e.name;return(0,i.jsxs)(Ba,{css:{background:"$gray100",padding:"$7 56px"},direction:"column",children:[(0,i.jsx)(Ar,{color:"gray900",fontSize:"displayXs",fontWeight:"medium",children:n}),(0,i.jsx)(Ar,{color:"gray800",children:t("fiche_de_missio_00324")})]})},PB=e=>{const t=Xn(),n=Zn(mC),s=(0,L.useMemo)(()=>e.slugsToDisplay||[],[e.slugsToDisplay]),o=(0,L.useMemo)(()=>Object.fromEntries(s.flatMap(t=>{const n=e.customFields.find(e=>e.slug===t);return n?[[t,n]]:[]})),[s,e.customFields]),r=(0,L.useMemo)(()=>(0,uc.A)(e.volunteers,e=>e.userInfo.name),[e.volunteers]);return(0,i.jsxs)(Sc,{children:[(0,i.jsx)(kc,{css:{height:"32px"},children:s.map(e=>{const n=o[e];return"email"===e?(0,i.jsx)(Gc,{children:t("Email")},e):"fullName"===e?(0,i.jsx)(Gc,{children:t("full_name")},e):"picture"===e&&n?(0,i.jsx)(Gc,{width:80,children:n.name},e):"teamCode"===e?(0,i.jsx)(Gc,{children:t("code_quipe_14296")},e):n?(0,i.jsx)(Gc,{children:n.name},e):(0,i.jsx)(Gc,{},e)})}),r.map(e=>{const t=e.userInfo;return(0,i.jsx)(Mc,{css:{height:"28px"},children:s.map(s=>{const r=o[s];return"email"===s?(0,i.jsx)(Oc,{children:t.email},s):"fullName"===s?(0,i.jsx)(Gc,{css:{color:"$gray800"},children:t.name},s):"picture"===s&&r?(0,i.jsx)(Oc,{width:80,children:(0,i.jsx)(sp,{email:t.email,image:t.picture?.url,name:t.name,size:32})},s):"teamCode"===s?(0,i.jsx)(Oc,{children:e.teams.map(e=>e.teamCode).join(", ")},s):r?(0,i.jsx)(Oc,{children:n.getValueString(r,t.fields)},s):(0,i.jsx)(Oc,{},s)})},t.id)})]})},FB=e=>{const t=Xn(),{isRenamed:n,finalName:s,rangeString:o}=WT(e.slot);return(0,i.jsx)(i.Fragment,{children:(0,ep.A)(e.volunteers,30).map((r,a)=>(0,i.jsxs)(Ba,{css:{background:"white",pageBreakBefore:"always"},direction:"column",width:1,children:[(0,i.jsx)(DB,{acronym:e.positionAcronym,name:e.positionName}),(0,i.jsxs)(Ba,{css:{padding:"$7 56px"},direction:"column",gap:"3",children:[(0,i.jsxs)(Ba,{direction:"column",gap:"1",children:[(0,i.jsxs)(Ar,{font:"gray800 textSm medium",children:[t("membres_pour_le_20317",s)," (",e.volunteers.length,")"]}),n&&(0,i.jsx)(Ar,{font:"gray800 textXs medium",children:o})]}),(0,i.jsx)(PB,{customFields:e.customFields,slugsToDisplay:e.slugsToDisplay,volunteers:r})]})]},a))})};function MB(e,t){const n=[];return"both"!==t&&"email"!==t||n.push(e.userInfo.email),m(e.userInfo.name)&&n.unshift(e.userInfo.name),!e.userInfo.phone||"both"!==t&&"phone"!==t||n.push(`${e.userInfo.phone.internationalFormat} `),n.join(" ")}const NB=e=>{const t=Xn(),n=Zn(ph),s=(0,L.useMemo)(()=>(0,uc.A)(e.ranges,e=>e.range.start.toMillis()).map(({name:e,range:t})=>(0,Za.A)([m(e)?e:null,n.toDisplayString(t,{formats:{displayWeekday:!0}})]).join(" - ")),[e.ranges]),o=(0,xh.A)(e.position.leaders.concat(e.position.category.leaders),e=>e.userInfo.id);return(0,i.jsxs)(Ba,{css:{background:"white",padding:"$7 56px"},direction:"column",gap:"6",children:[e.displayPositionName&&(0,i.jsxs)(Ar,{color:"gray800",fontSize:"textMd",fontWeight:"medium",children:[e.position.category.name," | ",e.position.name]}),(0,i.jsxs)(Ba,{gap:"9",children:[(0,i.jsx)(Ar,{color:"gray500",width:150,children:t("date_de_la_miss_70346")}),(0,i.jsx)(Ba,{css:{flex:"1"},direction:"column",children:s.map((e,t)=>(0,i.jsx)(Ar,{color:"gray800",css:{textTransform:"capitalize"},children:e},t))})]}),o.map((n,s)=>(0,i.jsxs)(Ba,{gap:"9",children:[(0,i.jsx)(Ar,{color:"gray500",width:150,children:t("reponsable_82458")}),(0,i.jsx)(Ar,{color:"gray800",css:{flex:"1"},dangerouslySetInnerHTML:{__html:MB(n,e.leadersData)}})]},s)),m(e.position.description)&&(0,i.jsxs)(Ba,{gap:"9",children:[(0,i.jsx)(Ar,{color:"gray500",width:150,children:t("description_58935")}),(0,i.jsx)(Ar,{css:{flex:"1"},children:(0,i.jsx)(Cg,{text:e.position.description})})]}),Rh(e.position)&&(0,i.jsxs)(Ba,{gap:"9",children:[(0,i.jsx)(Ar,{color:"gray500",width:150,children:t("localisation_38416")}),(0,i.jsxs)(Ar,{color:"gray800",css:{flex:"1"},children:[zh(e.position)&&e.position.address,Oh(e.position)&&(0,i.jsx)("a",{href:yg(e.position.latitude,e.position.longitude),children:(0,i.jsx)("img",{alt:"Position map",src:`${P.HEAVENT_API_URL}/image/event/${e.position.eventId}/position/${e.position.id}.png`,width:"100%"})})]})]}),e.showResourcesInfos&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ba,{gap:"9",children:[(0,i.jsx)(Ar,{color:"gray500",width:150,children:t("nombre_de_cr_ne_40593")}),(0,i.jsx)(Ar,{color:"gray800",css:{flex:"1"},children:e.position.numberOfSlots})]}),(0,i.jsxs)(Ba,{gap:"9",children:[(0,i.jsx)(Ar,{color:"gray500",width:150,children:t("nombre_de_membr_08851")}),(0,i.jsx)(Ar,{color:"gray800",css:{flex:"1"},children:e.position.assignedResources})]})]})]})},LB=e=>{const{organization:t,event:n}=e.positionDocumentFragment,s=n.position,o=(0,L.useMemo)(()=>s.slots.filter(t=>!e.date?.isValid||t.range.start.startOf("day").equals(e.date.startOf("day"))),[s,e.date]);return(0,i.jsxs)(Ar,{css:{background:"white"},width:1,children:[e.options.showPositionData&&(0,i.jsxs)(Ba,{css:{background:"white",pageBreakBefore:"always"},direction:"column",width:1,children:[(0,i.jsx)(DB,{acronym:s.acronym,name:s.name}),(0,i.jsx)(NB,{displayPositionName:!1,leadersData:"both",position:s,ranges:s.range?[{name:null,range:s.range}]:[],showResourcesInfos:!0})]}),e.options.showVolunteersLists&&o.map(o=>{const r=(0,uc.A)(n.volunteersRegistrations.nodes.filter(({positionsSlotsUsersInfos:e})=>e.map(({positionSlotId:e})=>e).includes(o.id)),e=>e.userInfo.name);return(0,i.jsx)(FB,{customFields:t.customFields.nodes,positionAcronym:s.acronym,positionName:s.name,slot:o,slugsToDisplay:e.options.slugsToDisplay,volunteers:r},o.id)})]})},BB=e=>{const t=Xn();return(0,i.jsx)(Kb,{permissions:Hb.DOCUMENT_EDIT,children:(0,i.jsxs)(Ba,{css:{border:"1px solid $gray200",borderRadius:"$2",padding:"$6",overflowY:"auto",minWidth:"320px"},direction:"column",width:420,children:[(0,i.jsx)(Ar,{color:"gray900",fontSize:"textMd",fontWeight:"medium",children:t("param_tres_de_l_11729")}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ar,{color:"gray500",children:t("s_lectionnez_le_59909")}),(0,i.jsx)(Ya,{height:"5"}),(0,i.jsx)(Ba,{direction:"column",gap:"3",width:1,children:e.children})]})})};function VB(e,t,n,i){const{canDocumentEdit:s}=$S(),{mutate:o}=function(e={}){return ei("mutation EventDocumentUpdate(\n $eventId: EventId!\n $id: EventsDocumentId!\n $eventDocument: EventsDocumentInput!\n) {\n eventDocumentUpdate(eventId: $eventId, id: $id, eventDocument: $eventDocument) {\n id\n }\n}\n",e)}(),[r,a]=L.useState({...t,...e}),[l,d]=L.useState(i.informations2Content||""),[c,u]=L.useState(i.informations2Title||""),[h,m]=L.useState(i.informationsContent||""),[g,p]=L.useState(i.informationsTitle||""),[f,_]=L.useState(i.signature||""),[x,I]=L.useState(i.title||""),v=L.useCallback((0,Vc.A)(async(e,t,r,a,l,d,c)=>{s&&await o({eventId:n,id:i.id,eventDocument:{options:e,informations2Content:t,informations2Title:r,informationsContent:a,informationsTitle:l,signature:d,title:c}})},200),[n,i.id,s]);return{eventDocument:{options:e,informations2Content:l,informations2Title:c,informationsContent:h,informationsTitle:g,signature:f,title:x},informations2Content:l,informations2Title:c,informationsContent:h,informationsTitle:g,options:r,signature:f,title:x,setInformations2Content:async t=>{d(t),await v(e,t,c,h,g,f,x)},setInformations2Title:async t=>{u(t),await v(e,l,t,h,g,f,x)},setInformationsContent:async t=>{m(t),await v(e,l,c,t,g,f,x)},setInformationsTitle:async t=>{p(t),await v(e,l,c,h,t,f,x)},setOptions:async e=>{const t={...r,...e};a(t),await v(t,l,c,h,g,f,x)},setSignature:async t=>{_(t),await v(e,l,c,h,g,t,x)},setTitle:async t=>{I(t),await v(e,l,c,h,g,f,t)}}}const UB=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=vl(),{event:o}=wb(),{options:r,setOptions:a}=VB(e.data.event.document.options,{format:at.A4Portrait,showPositionData:!0,showVolunteersLists:!0,slugsToDisplay:["fullName","phone"]},s,{id:e.data.event.document.id});return Md(`${o.name} ${t("fiche_de_missio_00324")}`),(0,i.jsxs)(Ba,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[(0,i.jsxs)(BB,{children:[(0,i.jsxs)($u,{value:r.format,onChange:e=>{a({format:e})},children:[(0,i.jsx)("option",{value:at.A4Portrait,children:t("a4_portrait_92125")}),(0,i.jsx)("option",{value:at.A4Landscape,children:t("a4_paysage_24039")})]}),(0,i.jsx)(_c,{state:r.showPositionData?"checked":"unchecked",onClick:e=>{a({showPositionData:"checked"===e})},children:t("afficher_les_do_85282")}),(0,i.jsx)(_c,{state:r.showVolunteersLists?"checked":"unchecked",onClick:e=>{a({showVolunteersLists:"checked"===e})},children:t("afficher_les_li_18523")}),(0,i.jsxs)(yc,{isSearchVisible:!0,multiple:!0,placeholder:t("champs_affich_17945"),values:r.slugsToDisplay,onChange:e=>{a({slugsToDisplay:e})},children:[(0,i.jsx)("option",{value:"email",children:t("Email")}),(0,i.jsx)("option",{value:"fullName",children:t("nom_complet_05907")}),(0,i.jsx)("option",{value:"teamCode",children:t("code_quipe_14296")}),e.data.organization.customFields.nodes.map(e=>(0,i.jsx)("option",{value:e.slug,children:e.name},e.id))]})]}),(0,i.jsxs)(Ba,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(RB,{getPath:e=>Ps.DOCUMENTS_POSITION(n,s,e)}),(0,i.jsx)(OB,{width:1,children:(0,i.jsx)(LB,{options:r,positionDocumentFragment:e.data})})]})]})},WB=()=>{const{translate:e,params:{organizationId:t,eventId:n,positionId:s}}=vl(),{data:o,loader:r}=Qn("query PositionSheetDocument(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $positionId: PositionId!\n) {\n ...DocumentPositionSheet\n\n event(id: $eventId) {\n ...EventPositionsExport\n }\n}\n",{organizationId:t,eventId:n,positionId:s},[Vs.DocumentPositionSheetFragment,Vs.EventPositionsExportFragment]);return(0,i.jsxs)(Ba,{css:{padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(zB,{documentType:ze.Position,eventId:n,languages:o.event?.languages??[],organizationId:t,segmentsFolders:o.event?.segmentsFolders??[],showDate:!0,title:e("fiche_de_missio_61604")}),(0,i.jsx)(Ya,{height:"7"}),r||(0,i.jsx)(UB,{data:o})]})},GB=e=>{const t=Xn();return(0,i.jsx)(Ba,{css:{background:"$gray100",padding:"$6"},direction:"column",children:(0,i.jsx)(Ar,{color:"gray900",fontSize:"textXl",fontWeight:"medium",children:t("planning_1_14391",`${e.eventName} - ${e.segmentName}`)})})},HB=e=>{const t=Xn(),n=Zn(Jc),s=(0,cc.A)(e.slots,e=>e.positionId);return(0,i.jsxs)(Ba,{css:{background:"white",pageBreakBefore:"always"},direction:"column",width:1,children:[!0!==e.hideHeader&&(0,i.jsx)(GB,{eventName:e.eventName,segmentName:e.segmentName}),(0,i.jsxs)(Ba,{css:{background:"white",padding:"$6",position:"relative"},direction:"column",width:1,children:[(0,i.jsxs)(Ba,{children:[(0,i.jsx)(CB,{width:240,children:t("jour_87026")}),(0,i.jsx)(CB,{width:720,children:n.toLocaleString(e.startDate,eo.DateOnly.WeekdayLongMonthLong)})]}),(0,i.jsxs)(Ba,{children:[(0,i.jsx)(CB,{width:240,children:t("cr_neaux_33401")}),(0,Dc.A)(0,6).map(t=>{const n=e.startDate.plus({hour:2*t}),s=n.plus({hour:2}),o=Gs.IX.fromDateTimes(n,s);return(0,i.jsx)(CB,{width:120,children:o.toFormat("HH:mm")},t)})]}),e.positions.map((t,n)=>{const o=s[t.id];return(0,i.jsxs)(L.Fragment,{children:[(0,i.jsxs)(Ba,{children:[(0,i.jsx)(CB,{css:{color:"$gray700",height:"48px"},width:240,children:(0,i.jsx)(Ar,{css:{ellipsis:!0},textAlign:"start",width:1,children:t.name})}),(0,Dc.A)(0,6).map(e=>(0,i.jsx)(CB,{css:{height:"48px"},width:120},e))]}),o.map(t=>{const s=t.range.start.diff(e.startDate).shiftTo("hours","minutes"),o=t.range.end.diff(t.range.start).shiftTo("hours","minutes"),r=264+60*s.hours+s.minutes,a=112+48*n,l=60*o.hours+o.minutes,d=`${m(t.name)?`${t.name} - `:""}${t.range.toFormat("HH:mm")}`;return(0,i.jsx)(Ba,{align:"center",css:{background:t.position.color,borderRadius:"$1",color:Qd(t.position.color),fontSize:"$textXs",height:"32px",left:`${r}px`,position:"absolute",top:`${a}px`,width:`${l}px`},children:(0,i.jsx)(Ar,{css:{ellipsis:!0,px:"$1"},textAlign:"center",title:d,width:1,children:d})},t.id)})]},t.id)})]})]})},qB=e=>{const t=(0,L.useMemo)(()=>{const t=uh(e.event.positionsSlots.nodes);if(so(t)){const n=gh(t.map(e=>e.range));let i;return i=8!==n.startHour||20!==n.endHour?t.flatMap(e=>{const t=e.range;return t.start.hour<12&&t.end.hour>=12?[{...e,range:Gs.IX.fromDateTimes(t.start,t.start.set({hour:12,minute:0}))},{...e,range:Gs.IX.fromDateTimes(t.end.set({hour:12,minute:0}),t.end)}]:[e]}):t,i.filter(t=>!e.date?.isValid||t.range.start.startOf("day").equals(e.date.startOf("day")))}return[]},[e.event,e.date]),n=(0,L.useMemo)(()=>so(t)?gh(t.map(e=>e.range)):null,[t]),s=n&&(8!==n.startHour||20!==n.endHour);return(0,i.jsx)(i.Fragment,{children:n?(0,Dc.A)(0,n.numberOfDays).map((o,r)=>(0,Dc.A)(0,s?2:1).map((a,l)=>{const d=n.startDate.plus({day:o}).set({hour:s?0===l?0:12:8}),c=s?0===l?d.set({hour:12}):d.plus({day:1}).startOf("day"):d.set({hour:20}),u=Gs.IX.fromDateTimes(d,c),h=t.filter(e=>e.range.overlaps(u)),m=(0,uc.A)((0,xh.A)(h.map(e=>e.position),e=>e.id),e=>e.name);return so(h)?(0,ep.A)(m,11).map((t,n)=>(0,i.jsx)(HB,{eventName:e.event.name,hideHeader:e.hideHeader,positions:t,segmentName:e.event.segment.name,slots:h,startDate:d},`${r}-${l}-${n}`)):null})):!0!==e.hideHeader?(0,i.jsx)(GB,{eventName:e.event.name,segmentName:e.event.segment.name}):null})},KB=e=>{const{history:t,translate:n,params:{segmentId:s}}=vl();return(0,i.jsxs)(Ba,{align:"center",css:{background:"$gray100",border:"1px solid $gray200",borderBottom:"none",padding:"$3 $7"},gap:"4",children:[(0,i.jsx)(Ar,{font:"gray900 textMd semiBold",children:n("aper_u_pour_la_43833")}),(0,i.jsx)(Ar,{width:320,children:(0,i.jsx)(yc,{isSearchVisible:!0,values:[s],onChange:n=>{so(n)&&t.replace(e.getPath(n[0]))},children:e.segmentsFolders.map(e=>(0,i.jsx)("optgroup",{label:e.name,children:e.segments.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},e.id))})}),m(e.downloadPath)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ar,{css:{flex:"1"}}),(0,i.jsx)(Ar,{children:(0,i.jsx)(zl,{color:"white",to:e.downloadPath,children:n("t_l_charger_03283")})})]})]})},YB=()=>{const{translate:e,params:{organizationId:t,eventId:n,segmentId:s}}=vl(),{event:o}=wb(),{data:r,loader:a}=Qn("query PlanningDocument($eventId: EventId!, $segmentId: SegmentId!, $date: Date) {\n event(id: $eventId) {\n ...DocumentPositionsPlanning\n ...EventPositionsExport\n }\n}\n",{eventId:n,segmentId:s},[Vs.DocumentPositionsPlanningFragment,Vs.EventPositionsExportFragment]);return Md(`${o.name} ${e("planning_de_l_96909")}`),(0,i.jsxs)(Ba,{css:{overflowY:"auto",padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(zB,{documentType:ze.Planning,eventId:n,languages:r.event?.languages??[],organizationId:t,segmentsFolders:r.event?.segmentsFolders??[],title:e("planning_de_l_96909")}),(0,i.jsx)(Ya,{height:"7"}),a||(0,i.jsxs)(Ba,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(KB,{getPath:e=>Ps.DOCUMENTS_PLANNING(t,n,e),segmentsFolders:r.event.segmentsFolders}),(0,i.jsx)(OB,{width:1,children:(0,i.jsx)(Ar,{css:{overflow:"auto"},width:1,children:(0,i.jsx)(qB,{event:r.event})})})]})]})},ZB=100,XB=e=>{const t=Xn(),n=Zn(Jc),s=(0,L.useMemo)(()=>ch(e.slots.map(({range:e})=>e).reduce((e,t)=>e.union(t),e.slots[0].range)),[e.slots]),o=e.slots[0].range.start,r=t=>(0,uc.A)(kh(t,e.slots),[e=>e.position.name.toLowerCase(),e=>e.range.start.toMillis()]);return(0,i.jsxs)(Ba,{css:{background:"white",fontSize:"12px",pageBreakBefore:"always"},direction:"column",width:1,children:[(0,i.jsx)(GB,{eventName:e.eventName,segmentName:e.segmentName}),(0,i.jsxs)(Ba,{css:{background:"white",padding:"$6"},direction:"column",width:1,children:[(0,i.jsxs)(Ba,{children:[(0,i.jsx)(CB,{width:200,children:t("jours_88317")}),(0,Dc.A)(0,s).map(t=>{const s=o.plus({days:t}),r=kh(s,e.slots);return(0,i.jsx)(CB,{width:(r.length||1)*ZB,children:n.toLocaleString(s,eo.DateOnly.MonthShort)},t)})]}),(0,i.jsxs)(Ba,{children:[(0,i.jsx)(CB,{width:200,children:t("missions_63972")}),(0,Dc.A)(0,s).map(t=>{const n=o.plus({days:t}),s=(0,uc.A)(Object.values((0,cc.A)(kh(n,e.slots),e=>e.position.id)).map(e=>({position:e[0].position,numberOfSlots:e.length})),({position:e})=>e.name.toLowerCase());return 0===s.length?(0,i.jsx)(AB,{css:{height:"40px"},width:ZB},t):s.map(({position:e,numberOfSlots:n})=>{const s=m(e.acronym)?e.acronym:e.name;return(0,i.jsx)(CB,{width:n*ZB,children:(0,i.jsx)(Ar,{css:{ellipsis:!0,px:"$1"},textAlign:"center",title:s,width:1,children:s})},`${t}-${e.id}`)})})]}),(0,i.jsxs)(Ba,{children:[(0,i.jsx)(CB,{width:200,children:t("cr_neaux_33401")}),(0,Dc.A)(0,s).map(e=>{const t=o.plus({days:e}),n=r(t);return 0===n.length?(0,i.jsx)(AB,{css:{height:"40px"},width:ZB},e):n.map(t=>(0,i.jsx)(CB,{width:ZB,children:t.range.toFormat("HH:mm",{separator:"-"})},`${e}-${t.id}`))})]}),e.volunteersRegistrations.map(e=>{const t=e.userInfo;return(0,i.jsxs)(Ba,{children:[(0,i.jsxs)(yB,{width:200,children:[(0,i.jsx)(sp,{email:t.email,image:t.picture?.url,name:t.name,size:24}),(0,i.jsx)(Ar,{css:{flex:"1",ellipsis:""},title:t.name,children:t.name})]}),(0,Dc.A)(0,s).map(t=>{const n=o.plus({days:t}),s=r(n);return 0===s.length?(0,i.jsx)(AB,{width:ZB},t):s.map(n=>{const s=`${t}-${n.id}`;return void 0!==e.positionsSlotsUsersInfos.find(({positionSlotId:e})=>e===n.id)?(0,i.jsx)(kB,{width:ZB,children:(0,i.jsx)(Ar,{children:(0,i.jsx)(bB,{})})},s):(0,i.jsx)(AB,{width:ZB},s)})})]},e.id)})]})]})},JB=e=>{const t=(0,uc.A)(uh(e.event.positionsSlots.nodes),e=>e.range.start),n=e.event.volunteersRegistrations.nodes;return(0,i.jsx)(i.Fragment,{children:(0,ep.A)(t,8).map((t,s)=>{const o=t.map(e=>e.id),r=n.filter(e=>{const t=e.positionsSlotsUsersInfos.map(e=>e.positionSlotId);return(0,fh.A)(o,t).length>0});return(0,ep.A)(r,10).map((n,o)=>(0,i.jsx)(XB,{eventName:e.event.name,segmentName:e.event.segment.name,slots:t,volunteersRegistrations:n},`${s}-${o}`))})})},QB=()=>{const{translate:e,params:{organizationId:t,eventId:n,segmentId:s}}=vl(),{event:o}=wb(),{data:r,loader:a}=Qn("query PositionsVolunteersPlanningDocument($eventId: EventId!, $segmentId: SegmentId!) {\n event(id: $eventId) {\n ...DocumentPositionsVolunteersPlanning\n ...EventPositionsExport\n }\n}\n",{eventId:n,segmentId:s},[Vs.DocumentPositionsVolunteersPlanningFragment,Vs.EventPositionsExportFragment]);return Md(`${o.name} ${e("planning_d_un_g_23684")}`),(0,i.jsxs)(Ba,{css:{overflowY:"auto",padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(zB,{documentType:ze.PositionsVolunteersPlanning,eventId:n,languages:r.event?.languages??[],organizationId:t,segmentsFolders:r.event?.segmentsFolders??[],title:e("planning_d_un_g_23684")}),(0,i.jsx)(Ya,{height:"7"}),a||(0,i.jsxs)(Ba,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(KB,{getPath:e=>Ps.DOCUMENTS_POSITIONS_VOLUNTEERS_PLANNING(t,n,e),segmentsFolders:r.event.segmentsFolders}),(0,i.jsx)(OB,{children:(0,i.jsx)(Ar,{css:{overflow:"auto"},width:1,children:(0,i.jsx)(JB,{event:r.event})})})]})]})};var eV=n(8962),tV=n.n(eV);const nV=(e,t)=>"base64"===t?new Promise((t,n)=>{const i=new FileReader;i.onload=()=>{t(i.result?.toString()??"")},i.onerror=n,i.readAsDataURL(e)}):new Promise((t,n)=>{const i=new FileReader;i.onload=()=>{const e=new Uint8Array(i.result);t(tV().detect(e)||"UTF-8")},i.onerror=n,i.readAsArrayBuffer(e)}).then(t=>new Promise((n,i)=>{const s=new FileReader;s.onload=()=>n(s.result?.toString()??""),s.onerror=i,s.readAsText(e,t)})),iV=({css:e,label:t,description:n,icon:s,hint:o,state:r,value:a,placeholder:l,accept:d,format:c,onChange:u,...h})=>{const g=(0,L.useRef)(null),{inputId:p,descId:f,errorId:_}=qa();return(0,i.jsxs)(Ba,{css:e,direction:"column",width:1,children:[(0,i.jsx)(Ml,{htmlFor:p,isClickable:!1,children:t}),(0,i.jsx)(Pl,{id:f,children:n}),(t||n)&&(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ll,{cursor:"pointer",icon:s,rightIcon:"file",state:r,onClick:()=>{g.current?.click()},children:(0,i.jsxs)(Ar,{color:m(a?.name)?"gray800":"gray500",css:{flex:"1","& input":{display:"none"}},children:[m(a?.name)?a.name:l,(0,i.jsx)("input",{ref:g,accept:wv(d),"aria-describedby":n?f:void 0,"aria-errormessage":"error"===r?_:void 0,"aria-invalid":"error"===r,id:p,type:"file",onChange:async e=>{const t=e.target.files?.[0];t&&u({name:t.name,content:await nV(t,c)})},...h})]})}),(0,i.jsx)(Fl,{id:_,state:r,children:o})]})};function sV(e){return{color:sc(e.subtitleColor)?e.subtitleColor:"$gray800",fontFamily:e.titleFontFamily||"Open Sans",fontSize:"14px",fontWeight:"700",textTransform:"uppercase"}}const oV=e=>{const t=Xn();return e.options.showInformations?(0,i.jsxs)(Ba,{css:{background:e.isAso?void 0:"white",borderRadius:"$2",px:e.isAso?"0":"$3",py:"$4"},direction:"column",gap:e.isAso?"1":"3",width:1,children:[(0,i.jsx)(Ar,{css:{...sV(e.options),textAlign:"center"},width:1,children:m(e.informationsTitle)?e.informationsTitle:t("informations_22954")}),m(e.informationsContent)&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Ar,{css:{wordBreak:"break-word","& .h-rich-text > p":{margin:"0"}},children:(0,i.jsx)(Cg,{text:e.renderText(e.informationsContent)})})})]}):null},rV=e=>(0,i.jsx)(Ba,{css:{paddingTop:e.isAso?"180px":"73px",position:"relative"},direction:"column",gap:"5",width:e.isAso?157:178,children:e.children}),aV=e=>e.options.showQrCode?(0,i.jsxs)(Ba,{align:"center",css:{background:e.isAso?"transparent":"white",borderRadius:"$2",padding:"$4 $3"},direction:"column",gap:"3",width:1,children:[(0,i.jsx)(Ar,{css:{...sV(e.options),textAlign:"center"},width:1,children:e.isAso?"QR Code pour valider ma présence":"QR Code"}),(0,i.jsx)(Ba,{align:"center",css:{background:e.isAso?"white":"transparent",borderRadius:e.isAso?"$1":"none"},height:112,justify:"center",width:112,children:(0,i.jsx)(Ar,{height:104,width:104,children:(0,i.jsx)("img",{height:"100%",src:pg(e.ticketId,{height:90,width:90}),width:"100%"})})})]}):null,lV=e=>{const t=Xn(),n=e.psuis[0].position,s=e.userInfo,o=168===e.organizationId,r=573===e.organizationId,a=858===e.organizationId,l=306===e.organizationId,d=sc(e.options.headerColor)?e.options.headerColor:"white",c={color:sc(e.options.titleColor)?e.options.titleColor:"$gray800",fontFamily:e.options.titleFontFamily||"Open Sans",fontSize:o?"22px":"24px",fontWeight:o?"500":"800",lineHeight:o?"34px":void 0,textAlign:"center"},u=sV(e.options),h=e.options.showInformations||e.options.showInformations2||e.options.showQrCode,g=(0,xh.A)(n.leaders.concat(n.category.leaders),e=>e.userInfo.id);return(0,i.jsxs)(Ba,{css:{color:sc(e.options.textColor)?e.options.textColor:"$gray800",fontFamily:e.options.fontFamily||"Open Sans",fontSize:"12px","@media print":{breakBefore:"page"},"@media screen":{backgroundColor:n.color,backgroundImage:m(e.options.background?.content)?`url(${e.options.background?.content})`:void 0,backgroundRepeat:"repeat-y",backgroundSize:"100% auto",height:`calc-size(auto, round(up, size, ${ig}px))`,width:`${sg}px`},"@page":{size:"A4 portrait"}},direction:"column",children:[(0,i.jsx)(Ar,{css:{backgroundAttachment:"fixed",backgroundColor:n.color,backgroundImage:m(e.options.background?.content)?`url(${e.options.background?.content})`:void 0,backgroundRepeat:"no-repeat",backgroundSize:"cover",position:"fixed",height:"100%",width:"100%",zIndex:"-1","@media screen":{display:"none"}}}),(0,i.jsxs)(Ba,{align:"center",css:{marginLeft:"210px",marginTop:"51px"},gap:"4",justify:l?"end":"center",width:568,children:[(0,i.jsxs)(Ba,{align:l?"end":"center",css:{gap:"2px"},direction:"column",children:[(0,i.jsx)(Ar,{css:{color:d,fontSize:"14px",fontWeight:"700",lineHeight:"18px"},children:m(e.document.title)?e.document.title:t("Assignments")}),(0,i.jsx)(Ar,{css:{color:d,fontSize:"28px",fontWeight:"700",lineHeight:"38px"},children:s.name})]}),l&&(0,i.jsx)(Ar,{css:{background:`url(${e.userInfo.picture?.url}) no-repeat`,backgroundSize:"contain",borderRadius:"$1",overflowX:"hidden"},height:74,width:74})]}),(0,i.jsx)(Ya,{height:l?"4":"7"}),(0,i.jsxs)(Ba,{css:{paddingLeft:a?"46px":"$4",paddingRight:"$4"},gap:"4",width:1,children:[h&&(0,i.jsxs)(rV,{isAso:a,children:[(0,i.jsx)(oV,{informationsContent:e.document.informationsContent,informationsTitle:e.document.informationsTitle,isAso:a,options:e.options,renderText:e.renderText}),e.options.showInformations2&&(0,i.jsxs)(Ba,{css:{background:"white",borderRadius:"$2",padding:"$4 $3"},direction:"column",gap:"3",width:1,children:[(0,i.jsx)(Ar,{css:{...u,textAlign:"center"},width:1,children:m(e.document.informations2Title)?e.document.informations2Title:t("informations_se_69499")}),m(e.document.informations2Content)&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Ar,{css:{wordBreak:"break-word","& .h-rich-text > p":{margin:"0"}},children:(0,i.jsx)(Cg,{text:e.renderText(e.document.informations2Content)})})})]}),(0,i.jsx)(aV,{isAso:a,options:e.options,ticketId:e.volunteerRegistration.ticketId}),a&&e.options.showLeaders&&g[0]&&(0,i.jsxs)(Ar,{css:{position:"absolute",textAlign:"center",top:"710px"},width:1,children:[(0,i.jsx)(Ar,{css:{...sV(e.options),marginBottom:"$1",textAlign:"center"},width:1,children:"TON RESPONSABLE"}),g[0].userInfo.name,(0,i.jsx)("br",{}),g[0].userInfo.phone?.internationalFormat]})]}),(0,i.jsxs)(Ba,{css:{alignSelf:"start",border:"2px solid transparent",background:a?void 0:"white",borderRadius:"$3",flex:"1",fontSize:"12px",overflowX:"hidden",padding:"32px 40px"},direction:"column",children:[r&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ar,{css:{...c,fontSize:"12px",fontWeight:"700"},children:n.category.name}),(0,i.jsx)(Ya,{height:"1"})]}),(0,i.jsx)(Ar,{css:c,width:1,children:n.name}),e.children]})]})]})},dV=e=>{const t=Xn(),n=Zn(mC),s=Zn(Fw),o=Zn(qn),r=e.psuis[0].position,a=(0,uc.A)(e.psuis.map(({positionSlot:e})=>e),e=>e.range.start.toMillis()),l=168===e.organizationId,d=573===e.organizationId,c=858===e.organizationId,u=2695===e.organizationId,h=426===e.organizationId,g=sV(e.options),p=(0,xh.A)(r.leaders.concat(r.category.leaders),e=>e.userInfo.id),f="both"===e.options.leadersData||"email"===e.options.leadersData,_="both"===e.options.leadersData||"phone"===e.options.leadersData,x=t=>s.renderText(t,{userInfo:e.userInfo,volunteerRegistration:e.volunteerRegistration});return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(lV,{document:e.document,options:e.options,organizationId:e.organizationId,psuis:e.psuis,renderText:x,userInfo:e.userInfo,volunteerRegistration:e.volunteerRegistration,children:[e.options.showLeaders&&!d&&!c&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"1"}),(0,i.jsxs)(Ar,{css:{color:sc(e.options.subtitleColor)?e.options.subtitleColor:"$gray800",fontSize:"14px",fontWeight:"700"},textAlign:"center",width:1,children:[t("ton_responsable_16222",p.length)," ",p.map(e=>(0,Za.A)([e.userInfo.name,f?e.userInfo.email:"",_?e.userInfo.phone?.internationalFormat??"":""]).join(" ")).join(", ")]})]}),(0,i.jsx)(Ya,{height:"7"}),!c&&(0,i.jsxs)(Ba,{css:{gap:"2px"},direction:"column",children:[(0,i.jsx)(Ar,{css:g,children:u?"Horaire":t("date_de_ta_miss_18706")}),(0,i.jsx)(Ba,{direction:"column",gap:"1",children:a.map((e,t)=>{const n=e.range.start,s=e.range.end,r=n.startOf("day").toMillis()===s.startOf("day").toMillis();return(0,i.jsxs)(Ar,{children:[m(e.name)?`${e.name} | `:"",(0,i.jsx)(ng,{css:{textTransform:"capitalize"},children:n.toFormat("cccc d MMMM yyyy HH:mm",{locale:o.language.toString().toLowerCase()})})," ","-"," ",(0,i.jsx)(ng,{css:{textTransform:"capitalize"},children:r?s.toFormat("HH:mm"):s.toFormat("cccc d MMMM yyyy HH:mm",{locale:o.language.toString().toLowerCase()})})]},t)})})]}),c&&(0,i.jsxs)(Ba,{css:{gap:"2px"},direction:"column",children:[(0,i.jsx)(Ar,{css:g,children:"Rendez-vous"}),(0,i.jsx)(Ba,{direction:"column",gap:"1",children:a.map((e,t)=>(0,i.jsxs)(Ar,{children:[(0,i.jsx)(ng,{css:{textTransform:"capitalize"},fontWeight:"bold",children:e.range.start.toFormat("cccc d MMMM yyyy à H'h'mm",{locale:"fr"})})," ","(fin de mission estimée à ",e.range.end.toFormat("H'h'mm"),")"]},t))})]}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsxs)(Ba,{css:{gap:"2px"},direction:"column",children:[(0,i.jsx)(Ar,{css:g,children:u?"Consignes du poste":t("description_de_15187")}),(0,i.jsxs)(Ba,{direction:"column",children:[m(r.description)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ar,{css:{"& .h-rich-text > p":{margin:"0"},"& .h-rich-text figure, & .h-rich-text img":{maxWidth:"100%"}},children:(0,i.jsx)(Cg,{text:r.description})}),(0,i.jsx)(Ya,{height:"1"})]}),Rh(r)&&(0,i.jsxs)(Ba,{css:{"@media print":{breakInside:"avoid",display:"block",overflow:"visible"}},direction:"column",children:[(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(Ar,{css:g,children:d?"Point de rendez-vous":h?"Lieu du poste":t("lieu_de_rendez_30016")}),zh(r)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ar,{children:r.address})]}),Oh(r)&&(d||u)&&(0,i.jsxs)(Ar,{children:["Point GPS : ",r.latitude,", ",r.longitude]}),Oh(r)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"1"}),(0,i.jsxs)(Ba,{gap:"3",width:1,children:[(0,i.jsx)(Ar,{css:{width:"100%"},height:u?270:180,children:(0,i.jsx)("a",{href:yg(r.latitude,r.longitude),style:{background:`url(${P.HEAVENT_API_URL}/image/event/${e.eventId}/position/${r.id}.png)`,backgroundPosition:"center",backgroundSize:"cover",display:"block",height:"100%",width:"100%"}})}),l&&m(r.fields?.cf44697?.url)&&(0,i.jsx)(Ar,{css:{background:`url(${r.fields.cf44697.url}) no-repeat`,backgroundSize:"contain"},height:180,width:204}),d&&m(r.fields?.cf46814?.url)&&(0,i.jsx)(Ar,{css:{background:`url(${r.fields.cf46814.url}) no-repeat`,backgroundSize:"contain"},height:180,width:1}),c&&m(r.fields?.cf45815?.url)&&(0,i.jsx)(Ar,{css:{background:`url(${r.fields.cf45815.url}) no-repeat`,backgroundSize:"contain"},height:180,width:204})]})]}),d&&m(r.fields?.cf46813)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ar,{children:r.fields.cf46813})]})]})]})]}),d&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"6"}),(0,i.jsxs)(Ba,{css:{gap:"2px"},direction:"column",children:[(0,i.jsx)(Ar,{css:g,children:"UNE QUESTION OU UN PROBLÈME ?"}),(0,i.jsxs)(Ar,{children:["Nous sommes là pour vous aider. Contactez votre responsable de secteur :"," ",(0,i.jsxs)(ng,{fontWeight:"bold",children:[p[0]?.userInfo.name," :"," ",p[0]?.userInfo.phone?.internationalFormat]})]})]})]}),e.customFields.map(t=>{const s=n.getValueString(t,r.fields,{fileReturnValue:"url"});return e.options.positionCustomFields?.includes(t.id)&&m(s)?(0,i.jsxs)(L.Fragment,{children:[(0,i.jsx)(Ya,{height:"6"}),(0,i.jsxs)(Ba,{css:{gap:"2px"},direction:"column",children:[(0,i.jsx)(Ar,{css:g,children:t.name}),t.fieldType===We.File?function(e){const{extension:t}=ov(e);return rv.includes(t)}(n.getValueString(t,r.fields,{fileReturnValue:"name"}))?(0,i.jsx)(Ar,{css:{background:`url(${s}) no-repeat`,backgroundPosition:"center",backgroundSize:"cover"},height:180,width:1}):(0,i.jsx)(Ar,{css:{wordBreak:"break-word","& > a":{color:"inherit"}},children:(0,i.jsx)("a",{href:s,rel:"noreferrer",target:"_blank",children:s})}):(0,i.jsx)(Ar,{dangerouslySetInnerHTML:{__html:s.replace(/\n/g," ")}})]})]},t.id):null}),m(e.options.signature)&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Ar,{css:{"& .h-rich-text > p":{margin:"0"}},children:(0,i.jsx)(Cg,{text:x(e.options.signature)})})})]}),c&&m(r.fields?.cf24781?.url)&&(0,i.jsxs)(lV,{document:e.document,options:e.options,organizationId:e.organizationId,psuis:e.psuis,renderText:x,userInfo:e.userInfo,volunteerRegistration:e.volunteerRegistration,children:[(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ar,{css:{color:sc(e.options.titleColor)?e.options.titleColor:"$gray800",fontFamily:e.options.titleFontFamily||"Open Sans",fontSize:"16px",fontWeight:"700",textAlign:"center"},children:"(Annexe)"}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(Ar,{css:{background:`url(${r.fields.cf24781.url}) no-repeat`,backgroundSize:"contain"},height:1,width:1})]}),u&&(0,i.jsx)(lV,{document:e.document,options:e.options,organizationId:e.organizationId,psuis:e.psuis,renderText:x,userInfo:e.userInfo,volunteerRegistration:e.volunteerRegistration,children:(0,i.jsx)(Ar,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/velotour/condition.png) no-repeat`,backgroundSize:"cover"},height:601,width:533})})]})},cV=e=>{const t=e.assignmentsInfos.event.volunteerRegistration,n=(0,L.useMemo)(()=>vg(t.positionsSlotsUsersInfos,e.date,e.endDate).filter(e=>!e.position.tags.find(e=>"mission privée"===e.name.trim().toLowerCase()||"document-assignments-excluded"===e.name.trim().toLowerCase())),[t,e.date,e.endDate]),s=(0,L.useMemo)(()=>(0,uc.A)(Object.entries((0,cc.A)(n,e=>e.position.id)),([e,t])=>(0,_h.A)(t.map(e=>e.positionSlot.range.start.toMillis()))),[n]);return(0,i.jsx)(i.Fragment,{children:s.map(([n,s],o)=>(0,i.jsx)(dV,{customFields:e.assignmentsInfos.organization.customFields.nodes,document:e.eventDocument,eventId:e.assignmentsInfos.event.id,options:e.options,organizationId:e.assignmentsInfos.organization.id,psuis:s,userInfo:e.assignmentsInfos.organization.userInfo,volunteerRegistration:t},o))})},uV=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=vl(),{eventDocument:o,informations2Content:r,informations2Title:a,informationsContent:l,informationsTitle:d,options:c,signature:u,title:h,setInformations2Content:g,setInformations2Title:p,setInformationsContent:f,setInformationsTitle:_,setOptions:x,setSignature:I,setTitle:v}=VB(e.data.event.document.options,{background:{name:"",content:""},fontFamily:"Open Sans",headerColor:"#ffffff",informationsContent:"",informationsTitle:"",informationsContent2:"",informationsTitle2:"",leadersData:"phone",positionCustomFields:[],showInformations:!1,showInformations2:!1,showLeaders:!1,showQrCode:!1,signature:"",subtitleColor:"#1d2939",textColor:"#1d2939",title:"",titleColor:"#1d2939",titleFontFamily:"Open Sans"},s,{id:e.data.event.document.id,title:e.data.event.document.title,signature:e.data.event.document.signature,informationsTitle:e.data.event.document.informationsTitle,informationsContent:e.data.event.document.informationsContent,informations2Title:e.data.event.document.informations2Title,informations2Content:e.data.event.document.informations2Content}),b=qL(),j=(0,L.useMemo)(()=>(0,uc.A)(e.data.organization.customFields.nodes,e=>e.name.toLowerCase()),[e.data]),C=e.data.organization.userInfo;return(0,i.jsxs)(Ba,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[(0,i.jsxs)(BB,{children:[(0,i.jsxs)(Ba,{align:"center",gap:"3",children:[(0,i.jsx)(iV,{accept:yv.Images,format:"base64",label:t("fond_du_documen_51758"),placeholder:t("fond_du_documen_51758"),value:c.background,onChange:e=>{x({background:e})}}),m(c.background?.name)&&(0,i.jsx)(Ar,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{x({background:{name:"",content:""}})},children:t("r_initialiser_77538")})]}),(0,i.jsx)(Bl,{label:t("titre_du_docume_33508"),value:h,onChange:e=>{v(e)}}),(0,i.jsx)(Xu,{direction:"horizontal"}),(0,i.jsx)($u,{label:"Police",value:c.fontFamily,onChange:e=>{x({fontFamily:e})},children:b}),(0,i.jsx)($u,{label:t("police_des_titr_37497"),value:c.titleFontFamily,onChange:e=>{x({titleFontFamily:e})},children:b}),(0,i.jsx)(Hj,{label:t("couleur_du_titr_08509"),value:c.titleColor,onChange:e=>{x({titleColor:e})}}),(0,i.jsx)(Hj,{label:t("couleur_des_sou_18968"),value:c.subtitleColor,onChange:e=>{x({subtitleColor:e})}}),(0,i.jsx)(Hj,{label:t("couleur_du_text_32021"),value:c.textColor,onChange:e=>{x({textColor:e})}}),(0,i.jsx)(Hj,{label:t("couleur_du_cont_17150"),value:c.headerColor,onChange:e=>{x({headerColor:e})}}),(0,i.jsx)(Xu,{direction:"horizontal"}),(0,i.jsx)(ku,{value:c.showInformations,onChange:e=>{x({showInformations:e})},children:t("afficher_la_sec_84744")}),c.showInformations&&(0,i.jsxs)(Ba,{css:{background:"$gray50",border:"1px solid $gray200",borderRadius:"$1",padding:"$4"},direction:"column",gap:"3",children:[(0,i.jsx)(Bl,{label:t("titre_de_la_sec_41575"),value:d,onChange:e=>{_(e)}}),(0,i.jsx)(ob,{initialValue:l,label:t("contenu_de_la_s_43102"),onChange:e=>{f(e)}})]}),(0,i.jsx)(ku,{value:c.showInformations2,onChange:e=>{x({showInformations2:e})},children:t("afficher_la_sec_67554")}),c.showInformations2&&(0,i.jsxs)(Ba,{css:{background:"$gray50",border:"1px solid $gray200",borderRadius:"$1",padding:"$4"},direction:"column",gap:"3",children:[(0,i.jsx)(Bl,{label:t("titre_de_la_sec_41575"),value:a,onChange:e=>{p(e)}}),(0,i.jsx)(ob,{initialValue:r,label:t("contenu_de_la_s_43102"),onChange:e=>{g(e)}})]}),(0,i.jsx)(ku,{value:c.showQrCode,onChange:e=>{x({showQrCode:e})},children:t("afficher_le_qr_15635")}),(0,i.jsx)(ku,{value:c.showLeaders,onChange:e=>{x({showLeaders:e})},children:t("afficher_les_re_08705")}),c.showLeaders&&(0,i.jsx)(Ba,{css:{background:"$gray50",border:"1px solid $gray200",borderRadius:"$1",padding:"$4"},direction:"column",gap:"3",children:(0,i.jsxs)($u,{label:t("donn_es_des_res_45809"),value:c.leadersData,onChange:e=>{x({leadersData:e})},children:[(0,i.jsx)("option",{value:"both",children:t("afficher_le_num_37296")}),(0,i.jsx)("option",{value:"phone",children:t("afficher_unique_41829")}),(0,i.jsx)("option",{value:"email",children:t("afficher_unique_97964")}),(0,i.jsx)("option",{value:"none",children:t("afficher_aucune_38167")})]})}),(0,i.jsx)(Xu,{direction:"horizontal"}),(0,i.jsx)(ob,{initialValue:u,label:t("signature_67521"),onChange:e=>{I(e)}}),so(j)&&(0,i.jsx)(yc,{label:t("liste_des_champ_40847"),multiple:!0,values:c.positionCustomFields,onChange:e=>{x({positionCustomFields:e})},children:j.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})]}),(0,i.jsxs)(Ba,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(jj,{downloadPath:_g(C.links?.userAssignmentsLink??"","pdf",{lang:C.language}),getPath:e=>Ps.DOCUMENTS_ASSIGNMENTS(n,s,e)}),(0,i.jsx)(OB,{children:(0,i.jsx)(cV,{assignmentsInfos:e.data,eventDocument:o,options:c})})]})]})},hV=()=>{const{translate:e,params:{organizationId:t,eventId:n,userInfoId:s}}=vl(),{event:o}=wb(),{data:r,loader:a}=Qn("query UserAssignmentsDocument(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $userInfoId: UsersInfoId!\n) {\n ...DocumentUserAssignments\n\n event(id: $eventId) {\n startAt\n endAt\n\n ...EventVolunteersExport\n }\n}\n",{organizationId:t,eventId:n,userInfoId:s},[Vs.DocumentUserAssignmentsFragment,Vs.EventVolunteersExportFragment]);return Md(`${o.name} ${e("fiche_d_affecta_91461")}`),(0,i.jsxs)(Ba,{css:{padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(zB,{documentType:ze.Assignments,endAt:r.event?.endAt,eventId:n,languages:r.event?.languages??[],organizationId:t,segmentsFolders:r.event?.segmentsFolders??[],showDate:!0,startAt:r.event?.startAt,title:e("fiches_d_affect_98583")}),(0,i.jsx)(Ya,{height:"7"}),a||(0,i.jsx)(uV,{data:r})]})},mV=e=>{const t=Xn(),n=Zn(ph),s=e.options.format===at.A4Portrait?ug.A4:e.options.format===at.A5Portrait?ug.A5:ug.A6,o=e.badgeDocumentFragment.volunteerRegistration;return(0,i.jsxs)(Ar,{width:s.width,children:[(0,i.jsxs)(Ba,{css:{background:`linear-gradient(190deg, ${e.options.color} 40%, white 40%)`},direction:"column",height:s.height,width:1,children:[(0,i.jsx)(Ar,{css:{height:"calc(40% - 40px)"}}),(0,i.jsxs)(Ba,{align:"center",direction:"column",width:1,children:[(0,i.jsx)(sp,{email:o.userInfo.email,image:o.userInfo.picture?.url,name:o.userInfo.name,size:96}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(Ar,{color:"gray900",fontSize:"textXl",fontWeight:"medium",children:o.userInfo.nameOrEmail}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ar,{color:"gray800",fontSize:"textLg",children:m(e.options.name)?e.options.name:t("membre_45658")})]}),(0,i.jsx)(Ar,{css:{flex:"1"}}),m(e.options.logo?.content)&&(0,i.jsx)(Ba,{height:96,justify:"center",children:(0,i.jsx)("img",{height:"100%",src:e.options.logo.content})}),(0,i.jsx)(Ya,{height:"6"})]}),e.showPageSeparator&&(0,i.jsx)(Ar,{css:{background:"transparent",height:"$space$6"}}),(0,i.jsxs)(Ba,{css:{background:"white",pageBreakBefore:"always",padding:"$4 $6"},direction:"column",height:s.height,width:1,children:[m(e.options.logo?.content)&&(0,i.jsx)(Ba,{height:32,justify:"center",children:(0,i.jsx)("img",{height:"100%",src:e.options.logo.content})}),(0,i.jsx)(Ya,{height:"6"}),!1!==e.options.showAssignments&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ar,{color:"gray900",fontWeight:"medium",children:t("affectation_plural")}),(0,i.jsx)(Ya,{height:"2"}),o.positionsSlotsUsersInfos.map(({position:e,positionSlot:s},o)=>(0,i.jsxs)(L.Fragment,{children:[(0,i.jsx)(Ar,{color:"gray500",fontSize:"textXs",children:t("affectation_n_78121",o+1)}),(0,i.jsxs)(Ar,{color:"gray800",children:[e.name," :"," ",n.toDisplayString(s.range)]}),(0,i.jsx)(Ya,{height:"2"})]},o))]}),m(e.options.infos)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ar,{color:"gray500",fontSize:"textXs",children:t("renseigements_c_00093")}),(0,i.jsx)(Ar,{color:"gray800",css:{whiteSpace:"pre-wrap"},children:e.options.infos})]})]})]})},gV=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=vl(),{options:o,setOptions:r}=VB(e.data.event.document.options,{format:at.A6Portrait,logo:{name:"",content:""},color:xr.colors.gray900.value,name:"",infos:"",showAssignments:!0},s,{id:e.data.event.document.id}),a=e.data.event.volunteerRegistration.userInfo;return(0,i.jsxs)(Ba,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[(0,i.jsxs)(BB,{children:[(0,i.jsxs)($u,{label:"Format",value:o.format,onChange:e=>{r({format:e})},children:[(0,i.jsx)("option",{value:at.A4Portrait,children:"A4"}),(0,i.jsx)("option",{value:at.A5Portrait,children:"A5"}),(0,i.jsx)("option",{value:at.A6Portrait,children:"A6"})]}),(0,i.jsxs)(Ba,{align:"center",gap:"3",children:[(0,i.jsx)(iV,{accept:yv.Images,format:"base64",label:t("logo_18191"),placeholder:t("logo_18191"),value:o.logo,onChange:e=>{r({logo:e})}}),m(o.logo?.name)&&(0,i.jsx)(Ar,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{r({logo:{name:"",content:""}})},children:t("r_initialiser_77538")})]}),(0,i.jsx)(Hj,{label:t("couleur_de_fond_75677"),value:o.color,onChange:e=>{r({color:e})}}),(0,i.jsx)(Bl,{hint:t("ce_nom_sera_sit_11616"),label:t("nom_du_badge_36141"),placeholder:t("membre_45658"),value:o.name,onChange:e=>{r({name:e})}}),(0,i.jsx)(Zm,{label:t("renseigements_c_00093"),placeholder:t("ex_contact_d_11070"),value:o.infos,onChange:e=>{r({infos:e})}}),(0,i.jsx)(_c,{state:o.showAssignments?"checked":"unchecked",onClick:e=>{r({showAssignments:"checked"===e})},children:t("afficher_les_af_46643")})]}),(0,i.jsxs)(Ba,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(jj,{downloadPath:_g(a.links?.userBadgeLink??"","pdf",{lang:a.language}),getPath:e=>Ps.DOCUMENTS_BADGE(n,s,e,"generic")}),(0,i.jsx)(OB,{children:(0,i.jsx)(mV,{badgeDocumentFragment:e.data.event,options:o,showPageSeparator:!0})})]})]})},pV=()=>{const{translate:e,params:{organizationId:t,eventId:n,userInfoId:s}}=vl(),{event:o}=wb(),{data:r,loader:a}=Qn("query UserBadgeDocument($eventId: EventId!, $userInfoId: UsersInfoId!) {\n event(id: $eventId) {\n ...DocumentUserBadge\n ...EventVolunteersExport\n }\n}\n",{eventId:n,userInfoId:s},[Vs.DocumentUserBadgeFragment,Vs.EventVolunteersExportFragment]);return Md(`${o.name} ${e("BadgeCheck")}`),(0,i.jsxs)(Ba,{css:{padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(zB,{documentType:ze.Badge,eventId:n,languages:r.event?.languages??[],organizationId:t,segmentsFolders:r.event?.segmentsFolders??[],title:e("badges_37586")}),(0,i.jsx)(Ya,{height:"7"}),a||(0,i.jsx)(gV,{data:r})]})},fV=e=>{const t=Xn(),n=Zn(Jc),s=Zn(ph),o=(0,L.useMemo)(()=>(0,uc.A)(e.certificateDocumentFragment.volunteerRegistration.positionsSlotsUsersInfos,e=>e.positionSlot.range.start.toMillis()),[e.certificateDocumentFragment.volunteerRegistration]),r=Gs.c9.local(),a=e.certificateDocumentFragment.volunteerRegistration.userInfo;return(0,i.jsxs)(Ba,{css:{background:"white",padding:"$7 56px"},direction:"column",gap:"5",width:1,children:[m(e.options.header.content)&&(0,i.jsx)(Ar,{css:{borderRadius:"$1",boxShadow:"$xs",overflow:"hidden"},height:260,children:(0,i.jsx)("img",{height:"100%",src:e.options.header.content,width:"100%"})}),(0,i.jsx)(Ar,{color:"gray900",fontSize:"textXl",fontWeight:"semiBold",textAlign:"center",children:t("attestation_de_92734")}),(0,i.jsxs)(Ba,{css:{bd:!0,padding:"$4"},direction:"column",gap:"6",children:[(0,i.jsxs)(Ar,{color:"gray800",fontWeight:"semiBold",children:[t("je_soussign_e_04371",e.options.name)," ",(0,i.jsx)("br",{}),e.options.title]}),(0,i.jsxs)(Ar,{css:{"& > span":{fontWeight:"$semiBold"}},children:[t("certifie_que_13123")," ",(0,i.jsx)("span",{children:a.name}),(0,i.jsx)("br",{}),t("n_e_le_14393")," ",(0,i.jsx)("span",{children:m(a.dateOfBirth)?n.toLocaleString(Gs.c9.fromISO(a.dateOfBirth),eo.DateOnly.MonthLong):""}),(0,i.jsx)("br",{}),t("demeurant_78485")," ",(0,i.jsx)("span",{children:m(a.street)?a.street:""}),(0,i.jsx)("br",{}),t("commune_48881")," ",(0,i.jsx)("span",{children:m(a.city)?a.city:""}),(0,i.jsx)("br",{}),t("code_postal_74563")," ",(0,i.jsx)("span",{children:m(a.postalCode)?a.postalCode:""})]}),(0,i.jsx)(Ar,{color:"gray800",fontWeight:"semiBold",children:t("a_t_b_n_vole_58773")}),(0,i.jsx)(Ar,{dangerouslySetInnerHTML:{__html:o.map(({position:e,positionSlot:t})=>`${e.name} : ${s.toDisplayString(t.range)}`).join(" ")}}),(0,i.jsxs)(Ar,{color:"gray800",css:{whiteSpace:"pre-wrap","& > span":{fontWeight:"$semiBold"}},children:[(0,i.jsx)("span",{children:t("nom_et_adresse_96441")}),(0,i.jsx)("br",{}),e.options.address]}),m(e.options.infos)&&(0,i.jsx)(Ar,{color:"gray800",css:{whiteSpace:"pre-wrap"},children:e.options.infos})]}),(0,i.jsx)(Ar,{color:"gray800",children:t("atteste_sur_l_h_37408")}),(0,i.jsxs)(hd,{gap:"6",gridtemplatecolumns:"repeat(3, 1fr)",children:[(0,i.jsxs)(Ba,{direction:"column",gap:"3",children:[(0,i.jsx)(Ar,{color:"gray800",children:t("signature_67521")}),m(e.options.signature.content)&&(0,i.jsx)(Ar,{width:1,children:(0,i.jsx)("img",{src:e.options.signature.content,width:"100%"})})]}),(0,i.jsx)(Ar,{color:"gray800",children:t("fait_1_39349",e.options.place)}),(0,i.jsx)(Ar,{color:"gray800",children:n.toLocaleString(r,eo.DateOnly.MonthLong)})]})]})},_V=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=vl(),{options:o,setOptions:r}=VB(e.data.event.document.options,function(e){return{address:`${e.name}\n${e.street||""}\n${e.postalCode||""}\n${e.city||""}`.trim(),header:{name:"",content:""},infos:"",name:e.adminName||"",place:"Montpellier",signature:{name:"",content:""},title:`Président de ${e.name}`}}(e.data.organization),s,{id:e.data.event.document.id}),a=e.data.event.volunteerRegistration.userInfo;return(0,i.jsxs)(Ba,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[(0,i.jsxs)(BB,{children:[(0,i.jsx)(Bl,{label:t("full_name"),placeholder:"Antoine Dupont",value:o.name,onChange:e=>{r({name:e})}}),(0,i.jsx)(Bl,{label:t("fonction_68322"),placeholder:t("pr_sident_30600"),value:o.title,onChange:e=>{r({title:e})}}),(0,i.jsx)(Zm,{label:t("nom_et_adresse_81953"),value:o.address,onChange:e=>{r({address:e})}}),(0,i.jsx)(Zm,{label:t("informations_su_09057"),value:o.infos,onChange:e=>{r({infos:e})}}),(0,i.jsx)(Bl,{label:t("lieu_de_l_attes_84804"),placeholder:"Montpellier",value:o.place,onChange:e=>{r({place:e})}}),(0,i.jsxs)(Ba,{align:"center",gap:"3",children:[(0,i.jsx)(iV,{accept:yv.Images,format:"base64",hint:t("taille_de_l_ima_12660","682x260px"),label:t("en_t_te_11987"),placeholder:t("en_t_te_11987"),value:o.header,onChange:e=>{r({header:e})}}),m(o.header?.name)&&(0,i.jsx)(Ar,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{r({header:{name:"",content:""}})},children:t("r_initialiser_77538")})]}),(0,i.jsxs)(Ba,{align:"center",gap:"3",children:[(0,i.jsx)(iV,{accept:yv.Images,format:"base64",label:t("signature_67521"),placeholder:t("signature_67521"),value:o.signature,onChange:e=>{r({signature:e})}}),m(o.signature?.name)&&(0,i.jsx)(Ar,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{r({signature:{name:"",content:""}})},children:t("r_initialiser_77538")})]})]}),(0,i.jsxs)(Ba,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(jj,{downloadPath:_g(a.links?.userCertificateLink??"","pdf",{lang:a.language}),getPath:e=>Ps.DOCUMENTS_CERTIFICATE(n,s,e)}),(0,i.jsx)(OB,{children:(0,i.jsx)(fV,{certificateDocumentFragment:e.data.event,options:o})})]})]})},xV=()=>{const{translate:e,params:{organizationId:t,eventId:n,userInfoId:s}}=vl(),{event:o}=wb(),{data:r,loader:a}=Qn("query UserCertificateDocument(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $userInfoId: UsersInfoId!\n) {\n organization(id: $organizationId) {\n ...OrganizationCertificateDefault\n }\n\n event(id: $eventId) {\n ...DocumentUserCertificate\n ...EventVolunteersExport\n }\n}\n",{organizationId:t,eventId:n,userInfoId:s},[Vs.OrganizationCertificateDefaultFragment,Vs.DocumentUserCertificateFragment,Vs.EventVolunteersExportFragment]);return Md(`${o.name} ${e("Certificate")}`),(0,i.jsxs)(Ba,{css:{padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(zB,{documentType:ze.Certificate,eventId:n,languages:r.event?.languages??[],organizationId:t,segmentsFolders:r.event?.segmentsFolders??[],title:e("attestations_98371")}),(0,i.jsx)(Ya,{height:"7"}),a||(0,i.jsx)(_V,{data:r})]})},IV=e=>{const{translate:t,params:{organizationId:n,eventId:s,badgeType:o}}=vl(),{options:r,setOptions:a}=VB(e.event.document.options,o===xe.Pec?{header:{name:"",content:""}}:o===xe.T24assignment?{logo:{name:"",content:""}}:{habits:""},s,{id:e.event.document.id}),l=e.event.volunteerRegistration.userInfo;return(0,i.jsxs)(Ba,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[o===xe.Asoassignment&&(0,i.jsx)(BB,{children:(0,i.jsx)(ob,{initialValue:r.habits,label:"Habitudes",onChange:e=>{a({habits:e})}})}),o===xe.Pec&&(0,i.jsx)(BB,{children:(0,i.jsx)(iV,{accept:yv.Images,format:"base64",label:t("banni_re_86634"),placeholder:t("banni_re_86634"),value:r.header,onChange:e=>{a({header:e})}})}),o===xe.T24assignment&&(0,i.jsx)(BB,{children:(0,i.jsx)(iV,{accept:yv.Images,format:"base64",label:t("logo_18191"),placeholder:t("logo_18191"),value:r.logo,onChange:e=>{a({logo:e})}})}),(0,i.jsxs)(Ba,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(jj,{downloadPath:_g(l.links?.userCustomBadgeLinks?.[o]||"","pdf",{lang:l.fields?.language?.rawValue}),getPath:e=>Ps.DOCUMENTS_BADGE(n,s,e,o)}),(0,i.jsx)(OB,{children:Bx(o,e.event,r,null)})]})]})},vV=()=>{const{translate:e,params:{organizationId:t,eventId:n,userInfoId:s,badgeType:o}}=vl(),{data:r,loader:a}=Qn("query UserCustomBadgeDocument(\n $eventId: EventId!\n $userInfoId: UsersInfoId!\n $customBadge: CustomBadge!\n) {\n event(id: $eventId) {\n ...DocumentUserCustomBadge\n ...EventVolunteersExport\n }\n}\n",{eventId:n,userInfoId:s,customBadge:o},[Vs.DocumentUserCustomBadgeFragment,Vs.EventVolunteersExportFragment]);return(0,i.jsxs)(Ba,{css:{padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(zB,{badgeType:o,documentType:ze.CustomBadge,eventId:n,languages:r.event?.languages??[],organizationId:t,segmentsFolders:r.event?.segmentsFolders??[],showDate:o===xe.Paris20kmassignment,showStrategy:!0,title:e("badge_1_89709",Vx(o))}),(0,i.jsx)(Ya,{height:"7"}),a||(0,i.jsx)(IV,{event:r.event})]})},bV=(e,t)=>{if("{user.picture}"===e)return t.userInfo.fields?.picture?.url||"";if("{user.skidata}"===e){const e=t.utid||"";return pg(e,{height:100,width:100})}if("{user.qrcode}"===e){const e=t.ticketId;return pg(e,{height:100,width:100})}if("{user.code39}"===e){const e=t.ticketId;return pg(e,{barcodeType:gg.Code39,height:28,width:234})}return e},jV=e=>{const t=m(e.element.source)&&m(bV(e.element.source,e.vr))?(0,i.jsx)("img",{height:"100%",src:bV(e.element.source,e.vr),width:"100%"}):null;return(0,i.jsx)(Ar,{css:{border:e.element.borderSize>0?`${e.element.borderSize}px solid ${e.element.borderColor}`:"",borderRadius:e.element.borderRadius>0?`${e.element.borderRadius}px`:"0",left:`${e.element.left}px`,overflow:"hidden",paddingBottom:`${e.element.py||0}px`,paddingLeft:`${e.element.px||0}px`,paddingRight:`${e.element.px||0}px`,paddingTop:`${e.element.py||0}px`,position:e.element.inContainer?"static":"absolute",top:`${e.element.top}px`,transform:e.element.hasRotate?`rotate(${e.element.rotateDegree}deg)`:void 0,transformOrigin:e.element.hasRotate?"top left":void 0,zIndex:e.element.zIndex},height:e.element.height,width:e.element.width,children:m(e.element.link)?(0,i.jsx)("a",{href:e.element.link,rel:"noreferrer",target:"_blank",children:t}):t})};var CV=n(1184);const yV=e=>{const t=Zn(Jc),n=Zn(Fw),s=gz((0,CV.A)(n.renderText(e.element.text,{userInfo:e.vr.userInfo,event:e.event,customFields:e.customFields,volunteerRegistration:e.vr,extraInfos:{...bg(t,e.vr.positionsSlotsUsersInfos)}}),{target:"_blank"}));return(0,i.jsx)(Ba,{align:e.element.align,css:{backgroundColor:e.element.hasBackground?e.element.backgroundColor:"none",border:e.element.borderSize>0?`${e.element.borderSize}px solid ${e.element.borderColor}`:"",borderRadius:e.element.borderRadius>0?`${e.element.borderRadius}px`:"0",color:e.element.color,fontFamily:e.element.fontFamily,fontSize:`${e.element.fontSize}px`,fontWeight:e.element.fontWeight,left:`${e.element.left}px`,lineHeight:e.element.lineHeight||1.4,overflow:"hidden",paddingBottom:`${e.element.py||0}px`,paddingLeft:`${e.element.px||0}px`,paddingRight:`${e.element.px||0}px`,paddingTop:`${e.element.py||0}px`,position:e.element.inContainer?"static":"absolute",textAlign:e.element.justify,textTransform:e.element.textTransform,top:`${e.element.top}px`,transform:e.element.hasRotate?`rotate(${e.element.rotateDegree}deg)`:void 0,transformOrigin:e.element.hasRotate?"top left":void 0,whiteSpace:"pre-wrap",zIndex:e.element.zIndex,"& a":{color:"inherit"},"& em":{fontStyle:"italic"},"& s":{textDecoration:"line-through"},"& strong":{fontWeight:700},"& u":{textDecoration:"underline"}},dangerouslySetInnerHTML:{__html:s},height:e.element.height,justify:e.element.justify,width:e.element.width})},kV=e=>$L(e.element,e.accreditationsSlotsIds,e.accreditationsAcronyms,e.positionsSlotsIds,e.vr.userInfo.fields)?"container"===e.element.type?(0,i.jsx)(Ba,{align:e.element.align,css:{backgroundColor:e.element.hasBackground?e.element.backgroundColor:"none",border:e.element.borderSize>0?`${e.element.borderSize}px solid ${e.element.borderColor}`:"",borderRadius:e.element.borderRadius>0?`${e.element.borderRadius}px`:"0",gap:`${e.element.gap}px`,left:`${e.element.left}px`,overflow:"hidden",paddingBottom:`${e.element.py||0}px`,paddingLeft:`${e.element.px||0}px`,paddingRight:`${e.element.px||0}px`,paddingTop:`${e.element.py||0}px`,position:e.element.inContainer?"static":"absolute",top:`${e.element.top}px`,transform:e.element.hasRotate?`rotate(${e.element.rotateDegree}deg)`:void 0,transformOrigin:e.element.hasRotate?"top left":void 0,whiteSpace:"pre-wrap",zIndex:e.element.zIndex},direction:e.element.direction,height:e.element.height,justify:e.element.justify,width:e.element.width,children:e.element.elements.map(t=>(0,i.jsx)(kV,{accreditationsAcronyms:e.accreditationsAcronyms,accreditationsSlotsIds:e.accreditationsSlotsIds,customFields:e.customFields,element:t,event:e.event,positionsSlotsIds:e.positionsSlotsIds,vr:e.vr},t.id))}):"image"===e.element.type?(0,i.jsx)(jV,{element:e.element,vr:e.vr}):"text"===e.element.type?(0,i.jsx)(yV,{customFields:e.customFields,element:e.element,event:e.event,vr:e.vr}):null:null,AV=e=>{const t=e.customDocument.configuration,n=e.volunteerRegistration.accreditationsUsersInfos.map(e=>e.accreditationSlot.id),s=e.volunteerRegistration.accreditationsUsersInfos.flatMap(e=>m(e.accreditation.acronym)?[e.accreditation.acronym]:[]),o=e.volunteerRegistration.positionsSlotsUsersInfos.map(e=>e.positionSlot.id),r=t.bleed?19:0;return(0,i.jsx)(i.Fragment,{children:t.pages.map(a=>$L(a,n,s,o,e.volunteerRegistration.userInfo.fields)?(0,i.jsxs)(Ba,{css:{background:"white",padding:`${r}px`,position:"relative"},height:2*r+t.height,width:2*r+t.width,children:[t.bleed&&(0,i.jsx)(ZL,{}),(0,i.jsx)(Ba,{css:{background:"white",pageBreakBefore:"always",position:"relative"},height:t.height,width:t.width,children:a.elements.map(t=>(0,i.jsx)(kV,{accreditationsAcronyms:s,accreditationsSlotsIds:n,customFields:e.customFields,element:t,event:e.event,positionsSlotsIds:o,vr:e.volunteerRegistration},t.id))})]},a.id):null)})},wV=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:s,userInfoId:o,customDocumentId:r}}=vl(),{event:a}=wb(),{data:l,loader:d}=Qn("query UserCustomDocumentExport(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $userInfoId: UsersInfoId!\n $customDocumentId: CustomDocumentId!\n) {\n organization(id: $organizationId) {\n customFields {\n nodes {\n ...CustomFieldWithCondition\n }\n }\n }\n\n event(id: $eventId) {\n ...EventVolunteersExport\n\n id\n name\n organizationId\n startAt\n endAt\n fields\n\n customDocument(customDocumentId: $customDocumentId) {\n name\n slug\n configuration\n populationsIds\n }\n\n volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n ...CustomBadgeVolunteerRegistration\n }\n }\n}\n",{organizationId:n,eventId:s,userInfoId:o,customDocumentId:r},[Vs.CustomFieldWithConditionFragment,Vs.EventVolunteersExportFragment,Vs.CustomBadgeVolunteerRegistrationFragment]),c=(0,L.useMemo)(()=>{if(l.event){const e=l.event.customDocument,t=l.event.volunteerRegistration.userInfo.links;return _g(t?.userCustomDocumentLinks[e?.slug||""]||"","pdf",{lang:l.event.volunteerRegistration.userInfo.fields?.language?.rawValue})}return""},[l.event]);return Md(`${a.name} ${l.event?.customDocument?.name??""}`),(0,i.jsxs)(Ba,{css:{padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(zB,{customDocumentSlug:l.event?.customDocument?.slug,documentType:ze.UserCustomDocument,eventId:s,extraButton:(0,i.jsx)(zl,{color:"white",onClick:()=>{e.push(Ps.EDIT_CUSTOM_DOCUMENT(n,s,r))},children:t("_diter_le_docum_83590")}),languages:l.event?.languages??[],organizationId:n,segmentsFolders:l.event?.segmentsFolders??[],title:l.event?.customDocument?.name??""}),(0,i.jsx)(Ya,{height:"7"}),d||(0,i.jsxs)(Ba,{css:{flex:"1",overflow:"hidden"},direction:"column",children:[(0,i.jsx)(jj,{downloadPath:c,getPath:e=>Ps.DOCUMENTS_USER_CUSTOM_DOCUMENT(n,s,e,r),populationsIds:so(l.event?.customDocument?.populationsIds)?l.event.customDocument.populationsIds:void 0}),(0,i.jsx)(OB,{children:(0,i.jsx)(AV,{customDocument:l.event.customDocument,customFields:l.organization.customFields.nodes,event:l.event,volunteerRegistration:l.event.volunteerRegistration})})]})]})},SV=e=>{const t=sc(e.options.headerColor)?e.options.headerColor:"white";return(0,i.jsxs)(Ba,{css:{color:sc(e.options.textColor)?e.options.textColor:"$gray800",background:m(e.options.background?.content)?`url(${e.options.background?.content})`:"#5230a1",backgroundRepeat:"no-repeat",backgroundSize:"cover",fontFamily:e.options.fontFamily||"Open Sans",fontSize:"12px",minHeight:`${ig}px`,pageBreakBefore:"always"},direction:"column",width:sg,children:[(0,i.jsxs)(Ba,{align:"end",css:{marginTop:"51px",px:"16px"},direction:"column",gap:"1",children:[(0,i.jsx)(Ar,{css:{color:t,fontSize:"13px",fontWeight:"700",lineHeight:"18px"},children:e.headerTitle1}),(0,i.jsx)(Ar,{css:{color:t,fontSize:"24px",fontWeight:"700",textTransform:"uppercase"},children:e.headerTitle2})]}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(Ba,{css:{minHeight:"971px",paddingBottom:"$6",paddingLeft:"$4",paddingRight:"$4"},gap:"4",width:1,children:(0,i.jsx)(Ba,{css:{background:"white",borderRadius:"$3",flex:"1",fontSize:"12px",overflowX:"hidden",padding:"$4"},direction:"column",children:e.children})})]})},EV=e=>{const t=Xn(),n=Zn(Jc),s=Zn(rp),o=(0,L.useMemo)(()=>e.psuis.filter(t=>t.positionSlot.range.start.startOf("day").toMillis()===e.day.toMillis()),[e.day,e.psuis]),r=(0,L.useMemo)(()=>(0,uv.A)(o,e=>e.timeDifferenceMinutes),[o]);return(0,i.jsxs)(Ba,{css:{bd:!0,overflow:"hidden"},direction:"column",width:1,children:[(0,i.jsx)(Ar,{css:{padding:"$3 $4",textTransform:"capitalize"},font:"gray800 textSm semiBold",children:n.toLocaleString(e.day,eo.DateOnly.WeekdayLongMonthLong)}),(0,i.jsxs)(Sc,{css:{borderTop:"1px solid $gray200"},hideBorder:!0,children:[(0,i.jsxs)(kc,{css:{height:"32px"},children:[(0,i.jsx)(Gc,{children:t("nom_de_la_missi_64605")}),(0,i.jsxs)(Gc,{align:"start",direction:"column",width:120,children:[(0,i.jsx)(Ar,{children:t("d_but_41840")}),(0,i.jsx)(Ar,{css:{fontSize:"8px"},children:t("_point_missi_66864")})]}),(0,i.jsxs)(Gc,{align:"start",direction:"column",width:120,children:[(0,i.jsx)(Ar,{children:t("fin_60104")}),(0,i.jsx)(Ar,{css:{fontSize:"8px"},children:t("_point_missi_66864")})]}),(0,i.jsx)(Gc,{width:120,children:t("pause_46709")}),(0,i.jsx)(Gc,{width:120,children:t("total_07173")})]}),o.map((t,o)=>(0,i.jsxs)(Mc,{css:{height:"32px"},children:[(0,i.jsx)(Oc,{children:(0,i.jsx)(Ar,{font:"gray800 textXs medium",children:t.position.name})}),(0,i.jsxs)(Oc,{align:"start",css:{color:"$gray500"},direction:"column",width:120,children:[(0,i.jsx)(Ar,{children:t.checkInAt?.isValid?n.toLocaleString(t.checkInAt.setZone(e.timeZone),eo.TimeOnly):"-"}),(0,i.jsx)(Ar,{css:{fontSize:"8px"},children:n.toLocaleString(t.positionSlot.range.start,eo.TimeOnly)})]}),(0,i.jsxs)(Oc,{align:"start",css:{color:"$gray500"},direction:"column",width:120,children:[(0,i.jsx)(Ar,{children:t.checkOutAt?.isValid?n.toLocaleString(t.checkOutAt.setZone(e.timeZone),eo.TimeOnly):"-"}),(0,i.jsx)(Ar,{css:{fontSize:"8px"},children:n.toLocaleString(t.positionSlot.range.end,eo.TimeOnly)})]}),(0,i.jsx)(Oc,{css:{color:"$gray500"},width:120,children:t.breakTime>0?s.minutesToHoursMinutesString(t.breakTime):"-"}),(0,i.jsx)(Oc,{css:{color:"$gray500"},justify:"end",width:120,children:s.minutesToHoursMinutesString(t.timeDifferenceMinutes)})]},o)),(0,i.jsxs)(kc,{css:{borderBottom:"none",height:"32px"},children:[(0,i.jsx)(Gc,{children:(0,i.jsx)(Ar,{font:"gray800 textXs semiBold",children:t("total_de_la_jou_73634")})}),(0,i.jsx)(Gc,{justify:"end",width:120,children:(0,i.jsx)(Ar,{font:"gray800 textXs semiBold",children:s.minutesToHoursMinutesString(r)})})]})]})]})},TV=e=>{const t=Xn(),n=Zn(rp),s=e.event.volunteerRegistration,o=s.userInfo,r=(0,L.useMemo)(()=>vg(s.positionsSlotsUsersInfos,e.date,null),[s.positionsSlotsUsersInfos]),a=(0,L.useMemo)(()=>(0,uc.A)((0,xh.A)(r.map(e=>e.positionSlot.range.start.startOf("day")),e=>e.toMillis()),e=>e.toMillis()),[r]),l=(0,L.useMemo)(()=>(0,uv.A)(r,e=>e.timeDifferenceMinutes),[r]);return(0,i.jsx)(SV,{headerTitle1:`${m(e.eventDocument.title)?e.eventDocument.title:t("UserHours")} ${o.name}`,headerTitle2:t("total_d_heures_11826",n.minutesToHoursMinutesString(l)),options:e.options,children:(0,i.jsx)(Ba,{direction:"column",gap:"4",width:1,children:a.map(t=>(0,i.jsx)(EV,{day:t,psuis:r,timeZone:e.event.timeZone},t.toMillis()))})})},zV=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=vl(),{eventDocument:o,options:r,title:a,setOptions:l,setTitle:d}=VB(e.event.document.options,{background:{name:"",content:""},fontFamily:"Open Sans",headerColor:"#ffffff",textColor:"#1d2939",title:""},s,{id:e.event.document.id}),c=qL(),u=e.event.volunteerRegistration.userInfo,h=u.links?.userHoursLink??"";return(0,i.jsxs)(Ba,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[(0,i.jsxs)(BB,{children:[(0,i.jsxs)(Ba,{align:"center",gap:"3",children:[(0,i.jsx)(iV,{accept:yv.Images,format:"base64",label:t("fond_du_documen_51758"),placeholder:t("fond_du_documen_51758"),value:r.background,onChange:e=>{l({background:e})}}),m(r.background?.name)&&(0,i.jsx)(Ar,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{l({background:{name:"",content:""}})},children:t("r_initialiser_77538")})]}),(0,i.jsx)(Bl,{label:t("titre_du_docume_33508"),value:a,onChange:e=>{d(e)}}),(0,i.jsx)(Xu,{direction:"horizontal"}),(0,i.jsx)($u,{label:"Police",value:r.fontFamily,onChange:e=>{l({fontFamily:e})},children:c}),(0,i.jsx)(Hj,{label:t("couleur_du_cont_17150"),value:r.headerColor,onChange:e=>{l({headerColor:e})}})]}),(0,i.jsxs)(Ba,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(jj,{downloadPath:_g(h,"pdf",{lang:u.language}),getPath:e=>Ps.DOCUMENTS_HOURS(n,s,e)}),(0,i.jsx)(OB,{children:(0,i.jsx)(TV,{event:e.event,eventDocument:o,options:r})})]})]})},OV=()=>{const{translate:e,params:{organizationId:t,eventId:n,userInfoId:s}}=vl(),{event:o}=wb(),{data:r,loader:a}=Qn("query UserHoursDocument($eventId: EventId!, $userInfoId: UsersInfoId!) {\n event(id: $eventId) {\n ...DocumentUsersHours\n ...EventVolunteersExport\n }\n}\n",{eventId:n,userInfoId:s},[Vs.DocumentUsersHoursFragment,Vs.EventVolunteersExportFragment]);return Md(`${o.name} ${e("UserHours")}`),(0,i.jsxs)(Ba,{css:{padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(zB,{documentType:ze.UserHours,eventId:n,languages:r.event?.languages??[],organizationId:t,segmentsFolders:r.event?.segmentsFolders??[],showDate:!0,title:e("UserHours")}),(0,i.jsx)(Ya,{height:"7"}),a||(0,i.jsx)(zV,{event:r.event})]})},RV=e=>{const t=Xn(),n=Zn(Jc),s=e.event.volunteerRegistration,o=s.userInfo,r=(0,L.useMemo)(()=>(0,rh.A)(s.positionsSlotsUsersInfos.map(e=>e.positionSlot.range.start)),[s.positionsSlotsUsersInfos]),a=(0,L.useMemo)(()=>(0,ah.A)(s.positionsSlotsUsersInfos.map(e=>e.positionSlot.range.end)),[s.positionsSlotsUsersInfos]),l=(0,L.useMemo)(()=>(0,uc.A)(Object.entries((0,cc.A)(s.positionsSlotsUsersInfos,e=>e.positionSlot.range.start.startOf("day").toMillis())),([e,t])=>t[0].positionSlot.range.start.startOf("day").toMillis()).map(([e,t])=>{const i=t[0],s=(0,uc.A)(Object.values((0,cc.A)(t,e=>e.position.id)),e=>(0,_h.A)(e.map(e=>e.positionSlot.range.start.toMillis()))).map(e=>{const t=e[0].position,n=(0,uc.A)(e.map(({positionSlot:e})=>e.range),e=>e.start.toMillis()).map(e=>`${e.start.toFormat("H'h'mm")}-${e.end.toFormat("H'h'mm")}`).join(" | "),i=1504===t.organizationId&&m(t.address)?` (${t.address})`:"";return`${t.name} : ${n}${i}`});return[n.toLocaleString(i.positionSlot.range.start.startOf("day"),eo.DateOnly.WeekdayLongMonthLong),s]}),[s.positionsSlotsUsersInfos]);return(0,i.jsxs)(Ba,{css:{background:"$gray100",padding:"32px 45px 50px 45px"},direction:"column",width:1,children:[m(e.options.logo?.content)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ar,{height:56,textAlign:"center",width:1,children:(0,i.jsx)("img",{height:"100%",src:e.options.logo.content,width:"auto"})}),(0,i.jsx)(Ya,{height:"7"})]}),(0,i.jsxs)(Ba,{css:{background:"white",borderRadius:"16px",padding:"32px"},direction:"column",height:1,width:1,children:[(0,i.jsx)(Ar,{font:"primary800 displayXs semiBold",children:o.nameOrEmail}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ar,{color:"gray800",children:t("p_riode_du_1_89633",n.toLocaleString(r,eo.DateTime),n.toLocaleString(a,eo.DateTime))}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(Ba,{direction:"column",gap:"4",children:l.map(([e,t],n)=>(0,i.jsxs)(Ba,{direction:"column",gap:"1",children:[(0,i.jsx)(Ar,{css:{textTransform:"capitalize"},font:"gray800 textSm bold",children:e}),(0,i.jsx)(Ba,{direction:"column",children:t.map((e,t)=>(0,i.jsx)(Ar,{children:e},t))})]},n))})]})]})},$V=e=>{const t=Xn(),n=e.event.volunteerRegistration,s=n.userInfo;return so(n.positionsSlotsUsersInfos)?(0,i.jsx)(RV,{...e}):(0,i.jsxs)(Ba,{css:{background:"$gray100",padding:"32px 45px 50px 45px"},direction:"column",width:1,children:[m(e.options.logo?.content)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ar,{height:56,textAlign:"center",width:1,children:(0,i.jsx)("img",{height:"100%",src:e.options.logo.content,width:"auto"})}),(0,i.jsx)(Ya,{height:"7"})]}),(0,i.jsxs)(Ba,{css:{background:"white",borderRadius:"16px",padding:"32px"},direction:"column",height:1,width:1,children:[(0,i.jsx)(Ar,{font:"primary800 displayXs semiBold",children:s.nameOrEmail}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ar,{color:"gray800",children:t("aucune_affectat_04761")})]})]})},DV=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=vl(),{options:o,setOptions:r}=VB(e.data.event.document.options,{logo:{name:"",content:""}},s,{id:e.data.event.document.id}),a=e.data.event.volunteerRegistration.userInfo;return(0,i.jsxs)(Ba,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[(0,i.jsx)(BB,{children:(0,i.jsx)(iV,{accept:yv.Images,format:"base64",label:t("logo_18191"),placeholder:t("logo_18191"),value:o.logo,onChange:e=>{r({logo:e})}})}),(0,i.jsxs)(Ba,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(jj,{downloadPath:_g(a.links?.userPlanningDaysLink??"","pdf",{lang:a.language}),getPath:e=>Ps.DOCUMENTS_USER_PLANNING_DAYS(n,s,e)}),(0,i.jsx)(OB,{children:(0,i.jsx)($V,{event:e.data.event,options:o})})]})]})},PV=()=>{const{translate:e,params:{organizationId:t,eventId:n,userInfoId:s}}=vl(),{event:o}=wb(),{data:r,loader:a}=Qn("query UserPlanningDaysDocument($eventId: EventId!, $userInfoId: UsersInfoId!) {\n event(id: $eventId) {\n ...DocumentUserPlanningDays\n ...EventVolunteersExport\n }\n}\n",{eventId:n,userInfoId:s},[Vs.DocumentUserPlanningDaysFragment,Vs.EventVolunteersExportFragment]);return Md(`${o.name} ${e("UserPlanningDays")}`),(0,i.jsxs)(Ba,{css:{overflowY:"auto",padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(zB,{documentType:ze.UserPlanningDays,eventId:n,languages:r.event?.languages??[],organizationId:t,segmentsFolders:r.event?.segmentsFolders??[],title:e("plannings_indiv_39650")}),(0,i.jsx)(Ya,{height:"7"}),a||(0,i.jsx)(DV,{data:r})]})};var FV=n(3514);const MV=e=>{const t=Xn(),n=Zn(Jc),s=e.event.volunteerRegistration,o=s.userInfo,r=e.startDate?Gs.c9.max(e.startDate,e.event.startAt):e.event.startAt,a=e.startDate?Gs.c9.min(e.startDate.plus({week:1}).minus({day:1}),e.event.endAt):e.event.endAt,l=sc(e.options.headerColor)?e.options.headerColor:"white",d=e.options.showInformations||e.options.showQrCode;return(0,i.jsxs)(Ba,{css:{color:sc(e.options.textColor)?e.options.textColor:"$gray800",background:m(e.options.background?.content)?`url(${e.options.background?.content})`:"#5230a1",backgroundRepeat:"no-repeat",backgroundSize:"cover",fontFamily:e.options.fontFamily||"Open Sans",fontSize:"12px",pageBreakBefore:"always",position:"relative"},height:sg,width:ig,children:[(0,i.jsxs)(Ba,{align:"end",css:{position:"absolute",right:"16px",top:"69px"},direction:"column",gap:"1",children:[(0,i.jsx)(Ar,{css:{color:l,fontSize:"13px",fontWeight:"700",lineHeight:"18px"},children:t("planning_indivi_05075",o.nameOrEmail)}),(0,i.jsx)(Ar,{css:{color:l,fontSize:"24px",fontWeight:"700",textTransform:"uppercase"},children:t("du_1_au_2_12974",n.toLocaleString(r,eo.DateOnly.MonthLong),n.toLocaleString(a,eo.DateOnly.MonthLong))})]}),(0,i.jsxs)(Ba,{css:{px:"$4",position:"absolute",top:"140px"},gap:"5",height:635,width:1,children:[d&&(0,i.jsxs)(rV,{children:[(0,i.jsx)(oV,{informationsContent:e.document.informationsContent,informationsTitle:e.document.informationsTitle,options:e.options,renderText:e.renderText}),(0,i.jsx)(aV,{isAso:!1,options:e.options,ticketId:s.ticketId})]}),(0,i.jsx)(Ba,{css:{background:"white",borderRadius:"$3",flex:"1",fontSize:"12px",padding:"$6 $5"},height:1,children:(0,i.jsx)(Ar,{width:1,children:e.children})})]})]})},NV=e=>{const t=Xn(),n=Zn(ph),s=(0,L.useMemo)(()=>{const t=ic(e.psui.position.color);return{background:t[50],color:t[700]}},[e.psui]),o=(0,L.useMemo)(()=>"number"==typeof e.startHour&&e.startHour>0&&e.psui.positionSlot.range.start.hour{const i=e.psui.positionSlot.range.start.day===e.psui.positionSlot.range.end.day,s=Ch(n,e.psui.positionSlot,"",{interval:{options:i?{hideDate:!0}:{formats:{localeFormat:{day:"numeric",month:"numeric"}}}},slot:{includeRange:!0}});return o?`${s} ${t("j_1_51317")}`:s},[e.psui,o]);return(0,i.jsxs)(Ba,{css:{...s,borderRadius:"$1",padding:"$1 $2"},direction:"column",gap:"1",justify:"center",width:1,children:[(0,i.jsx)(Ar,{css:{fontSize:"10px"},children:r}),(0,i.jsx)(Ar,{fontSize:"textXs",fontWeight:"medium",children:e.psui.position.name})]})},LV=e=>(0,i.jsx)(MV,{document:e.document,event:e.event,options:e.options,renderText:e.renderText,startDate:e.startDate,children:(0,i.jsx)(ow,{css:{border:"1px solid $gray200",borderRadius:"$2",height:"100%",overflow:"hidden","& .h-calendar-events-container":{height:"100% !important"}},date:e.startDate,display:"week",maxDate:e.event.endAt,minDate:e.event.startAt,children:e.assignments.map(t=>(0,i.jsx)(sw,{endAt:t.range.start,startAt:t.range.start,startHour:e.startHour,children:(0,i.jsx)(NV,{psui:t,startHour:e.startHour})},t.id))})}),BV=e=>{const{minDate:t,numberOfWeeks:n}=(0,L.useMemo)(()=>{const t=(0,_h.A)(e.assignments.map(e=>e.positionSlot.range.start)).startOf("week"),n=(0,FV.A)(e.assignments.map(e=>e.positionSlot.range.end)).endOf("week");return{minDate:t,numberOfWeeks:Math.ceil(n.diff(t,"weeks").weeks)}},[e.assignments]);return(0,i.jsx)(i.Fragment,{children:(0,Dc.A)(0,n).map(n=>(0,i.jsx)(LV,{assignments:e.assignments,document:e.eventDocument,event:e.event,options:e.options,renderText:e.renderText,startDate:t.plus({week:n}),startHour:e.startHour},n))})},VV=e=>{const t=Zn(Fw),[n]=(0,L.useMemo)(()=>jh(e.event.dayStartTime),[e.event.dayStartTime]),s=(0,L.useMemo)(()=>{const t=hh(e.event.volunteerRegistration.positionsSlotsUsersInfos.map(e=>({...e,range:e.positionSlot.range})),e.event.startAt,e.event.endAt,n);return(0,uc.A)(vg(t,e.date,e.endDate),e=>e.positionSlot.range.start.toMillis())},[e.event,n]),o=n=>t.renderText(n,{userInfo:e.event.volunteerRegistration.userInfo,volunteerRegistration:e.event.volunteerRegistration});return oo(s)?(0,i.jsx)(MV,{document:e.eventDocument,event:e.event,options:e.options,renderText:o}):(0,i.jsx)(BV,{assignments:s,event:e.event,eventDocument:e.eventDocument,options:e.options,renderText:o,startHour:n})},UV=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=vl(),{eventDocument:o,informationsTitle:r,informationsContent:a,options:l,setOptions:d,setInformationsTitle:c,setInformationsContent:u}=VB(e.data.event.document.options,{background:{name:"",content:""},fontFamily:"Open Sans",headerColor:"#ffffff",informationsContent:"",informationsTitle:"",showInformations:!1,showQrCode:!1,subtitleColor:"#1d2939",textColor:"#1d2939",titleFontFamily:"Open Sans"},s,{id:e.data.event.document.id,informationsTitle:e.data.event.document.informationsTitle,informationsContent:e.data.event.document.informationsContent}),h=qL(),g=e.data.event?.volunteerRegistration.userInfo,p=g.links?.userPlanningLink??"";return(0,i.jsxs)(Ba,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[(0,i.jsxs)(BB,{children:[(0,i.jsxs)(Ba,{align:"center",gap:"3",children:[(0,i.jsx)(iV,{accept:yv.Images,format:"base64",label:t("fond_du_documen_51758"),placeholder:t("fond_du_documen_51758"),value:l.background,onChange:e=>{d({background:e})}}),m(l.background?.name)&&(0,i.jsx)(Ar,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{d({background:{name:"",content:""}})},children:t("r_initialiser_77538")})]}),(0,i.jsx)(Xu,{direction:"horizontal"}),(0,i.jsx)($u,{label:"Police",value:l.fontFamily,onChange:e=>{d({fontFamily:e})},children:h}),(0,i.jsx)($u,{label:t("police_des_titr_37497"),value:l.titleFontFamily,onChange:e=>{d({titleFontFamily:e})},children:h}),(0,i.jsx)(Hj,{label:t("couleur_des_sou_18968"),value:l.subtitleColor,onChange:e=>{d({subtitleColor:e})}}),(0,i.jsx)(Hj,{label:t("couleur_du_text_32021"),value:l.textColor,onChange:e=>{d({textColor:e})}}),(0,i.jsx)(Hj,{label:t("couleur_du_cont_17150"),value:l.headerColor,onChange:e=>{d({headerColor:e})}}),(0,i.jsx)(Xu,{direction:"horizontal"}),(0,i.jsx)(ku,{value:l.showInformations,onChange:e=>{d({showInformations:e})},children:t("afficher_la_sec_84744")}),l.showInformations&&(0,i.jsxs)(Ba,{css:{background:"$gray50",border:"1px solid $gray200",borderRadius:"$1",padding:"$4"},direction:"column",gap:"3",children:[(0,i.jsx)(Bl,{label:t("titre_de_la_sec_41575"),value:r,onChange:e=>{c(e)}}),(0,i.jsx)(ob,{initialValue:a,label:t("contenu_de_la_s_43102"),onChange:e=>{u(e)}})]}),(0,i.jsx)(ku,{value:l.showQrCode,onChange:e=>{d({showQrCode:e})},children:t("afficher_le_qr_15635")})]}),(0,i.jsxs)(Ba,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(jj,{downloadPath:_g(p,"pdf",{lang:g?.language}),getPath:e=>Ps.DOCUMENTS_USER_PLANNING(n,s,e)}),(0,i.jsx)(OB,{children:(0,i.jsx)(VV,{event:e.data.event,eventDocument:o,options:l})})]})]})},WV=()=>{const{translate:e,params:{organizationId:t,eventId:n,userInfoId:s}}=vl(),{event:o}=wb(),{data:r,loader:a}=Qn("query UserPlanningDocument($eventId: EventId!, $userInfoId: UsersInfoId!) {\n event(id: $eventId) {\n ...DocumentUserPlanning\n ...EventVolunteersExport\n\n startAt\n endAt\n }\n}\n",{eventId:n,userInfoId:s},[Vs.DocumentUserPlanningFragment,Vs.EventVolunteersExportFragment]);return Md(`${o.name} ${e("UserPlanning")}`),(0,i.jsxs)(Ba,{css:{overflowY:"auto",padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(zB,{documentType:ze.UserPlanning,endAt:r.event?.endAt,eventId:n,languages:r.event?.languages??[],organizationId:t,segmentsFolders:r.event?.segmentsFolders??[],showDate:!0,startAt:r.event?.startAt,title:e("plannings_indiv_80073")}),(0,i.jsx)(Ya,{height:"7"}),a||(0,i.jsx)(UV,{data:r})]})},GV=e=>{const t=Xn(),n=Zn(ph);return(0,i.jsxs)(Ba,{css:{background:"$gray100",padding:"$4 56px"},direction:"column",gap:"2",children:[(0,i.jsx)(Ar,{font:"gray900 textXl semiBold",children:t("planning_1_14391",e.nameOrEmail)}),e.interval&&(0,i.jsxs)(Ba,{gap:"1",children:[(0,i.jsx)(Ar,{color:"gray800",children:t("plage_de_dates_08875")}),(0,i.jsx)(Ar,{color:"gray500",children:n.toDisplayString(e.interval,{formats:{displayWeekday:!0},hideTime:!0})})]}),(0,i.jsxs)(Ba,{gap:"1",children:[(0,i.jsx)(Ar,{color:"gray800",children:t("nombre_d_affect_01587")}),(0,i.jsx)(Ar,{color:"gray500",children:e.numberOfAssignments})]})]})},HV=e=>{const t=Xn(),n=Zn(Jc),s=Zn(rp);return(0,i.jsx)(Ba,{css:{padding:"$6 $8"},children:(0,i.jsxs)(Sc,{children:[(0,i.jsxs)(kc,{children:[(0,i.jsx)(Gc,{css:{px:"$3"},children:t("nom_de_la_missi_64605")}),(0,i.jsx)(Gc,{css:{px:"$3"},width:380,children:t("Date")}),e.showHours&&(0,i.jsx)(Gc,{css:{px:"$3"},width:120,children:t("total_07173")})]}),e.assignments.map((t,o)=>{const r=so(t.slotsNames),a=(0,np.A)(t.ranges.map(e=>e.toDuration("minutes").minutes));return(0,i.jsxs)(Mc,{css:{height:r?"54px":"44px"},children:[(0,i.jsx)(Oc,{align:"center",css:{px:"$3"},children:(0,i.jsx)(Ar,{css:{clamp:"2"},font:"gray900 textSm medium",title:t.name,width:1,children:t.name})}),(0,i.jsxs)(Oc,{css:{px:"$3"},direction:"column",gap:"1",justify:"center",width:380,children:[r&&(0,i.jsx)(Ar,{color:"gray900",width:1,children:t.slotsNames.join(", ")}),(0,i.jsxs)(Ar,{width:1,children:[(0,xd.A)(n.toLocaleString(t.ranges[0].start,eo.DateOnly.WeekdayShortMonthLong))," ",t.ranges.map(e=>`${e.start.toFormat("HH:mm")}-${e.end.toFormat("HH:mm")}`).join(" | ")]})]}),e.showHours&&(0,i.jsx)(Oc,{css:{px:"$3"},width:120,children:s.minutesToHoursMinutesString(a)})]},o)})]})})},qV=e=>{const t=(0,L.useMemo)(()=>tp(vg(e.event.volunteerRegistration.positionsSlotsUsersInfos,e.date,e.endDate)),[e.event.volunteerRegistration,e.date]);return(0,i.jsx)(i.Fragment,{children:(0,ep.A)(t,20).map((t,n)=>{const s=t.flatMap(e=>e.ranges),o=(0,rh.A)(s.map(e=>e.start),e=>e.toMillis()),r=(0,ah.A)(s.map(e=>e.end),e=>e.toMillis()),a=Gs.IX.fromDateTimes(o,r);return(0,i.jsxs)(Ba,{css:{background:"white",pageBreakBefore:"always"},direction:"column",width:1,children:[(0,i.jsx)(GV,{interval:a,nameOrEmail:e.event.volunteerRegistration.userInfo.nameOrEmail,numberOfAssignments:t.flatMap(e=>e.ranges).length}),(0,i.jsx)(HV,{assignments:t,showHours:e.options.showHours})]},n)})})},KV=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=vl(),{options:o,setOptions:r}=VB(e.data.event.document.options,{showHours:!0},s,{id:e.data.event.document.id}),a=e.data.event.volunteerRegistration.userInfo;return(0,i.jsxs)(Ba,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[(0,i.jsx)(BB,{children:(0,i.jsx)(_c,{state:o.showHours?"checked":"unchecked",onClick:e=>{r({showHours:"checked"===e})},children:t("afficher_le_tot_23855")})}),(0,i.jsxs)(Ba,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(jj,{downloadPath:_g(a.links?.userPlanningListLink??"","pdf",{lang:a.language}),getPath:e=>Ps.DOCUMENTS_USER_PLANNING_LIST(n,s,e)}),(0,i.jsx)(OB,{width:1,children:(0,i.jsx)(qV,{event:e.data.event,options:o})})]})]})},YV=()=>{const{translate:e,params:{organizationId:t,eventId:n,userInfoId:s}}=vl(),{event:o}=wb(),{data:r,loader:a}=Qn("query UserPlanningListDocument($eventId: EventId!, $userInfoId: UsersInfoId!) {\n event(id: $eventId) {\n ...DocumentUserPlanningList\n ...EventVolunteersExport\n\n startAt\n endAt\n }\n}\n",{eventId:n,userInfoId:s},[Vs.DocumentUserPlanningListFragment,Vs.EventVolunteersExportFragment]);return Md(`${o.name} ${e("UserPlanningList")}`),(0,i.jsxs)(Ba,{css:{overflowY:"auto",padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(zB,{documentType:ze.UserPlanningList,endAt:r.event?.endAt,eventId:n,languages:r.event?.languages??[],organizationId:t,segmentsFolders:r.event?.segmentsFolders??[],showDate:!0,startAt:r.event?.startAt,title:e("plannings_indiv_97766")}),(0,i.jsx)(Ya,{height:"7"}),a||(0,i.jsx)(KV,{data:r})]})},ZV=e=>{const t=Xn(),n=e.documentUsersListing.organization.customFields.nodes,s=(0,L.useMemo)(()=>(0,uc.A)(e.documentUsersListing.event.volunteersRegistrations.nodes,e=>e.userInfo.name),[e.documentUsersListing.event.volunteersRegistrations.nodes]),o=(0,L.useMemo)(()=>(0,ep.A)(s,30),[s]),r=e.documentUsersListing.event.segment;return so(s)?(0,i.jsx)(i.Fragment,{children:o.map((o,a)=>(0,i.jsx)(SV,{headerTitle1:m(e.eventDocument.title)?e.eventDocument.title:t("liste_des_membr_89037"),headerTitle2:`${r.name} (${s.length})`,options:e.options,children:(0,i.jsx)(Ba,{css:{background:"white"},direction:"column",width:1,children:(0,i.jsx)(PB,{customFields:n,slugsToDisplay:e.options.slugsToDisplay,volunteers:o})})},a))}):(0,i.jsx)(SV,{headerTitle1:m(e.eventDocument.title)?e.eventDocument.title:t("liste_des_membr_89037"),headerTitle2:r.name,options:e.options})},XV=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=vl(),{user:o}=ai(),{eventDocument:r,options:a,title:l,setOptions:d,setTitle:c}=VB(e.data.event.document.options,{background:{name:"",content:""},fontFamily:"Open Sans",headerColor:"#ffffff",slugsToDisplay:["fullName","phone"],textColor:"#1d2939",title:""},e.eventId,{id:e.data.event.document.id}),u=qL();return(0,i.jsxs)(Ba,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[(0,i.jsxs)(BB,{children:[(0,i.jsxs)(Ba,{align:"center",gap:"3",children:[(0,i.jsx)(iV,{accept:yv.Images,format:"base64",label:t("fond_du_documen_51758"),placeholder:t("fond_du_documen_51758"),value:a.background,onChange:e=>{d({background:e})}}),m(a.background?.name)&&(0,i.jsx)(Ar,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{d({background:{name:"",content:""}})},children:t("r_initialiser_77538")})]}),(0,i.jsx)(Bl,{label:t("titre_du_docume_33508"),value:l,onChange:e=>{c(e)}}),(0,i.jsx)(Xu,{direction:"horizontal"}),(0,i.jsx)($u,{label:"Police",value:a.fontFamily,onChange:e=>{d({fontFamily:e})},children:u}),(0,i.jsx)(Hj,{label:t("couleur_du_cont_17150"),value:a.headerColor,onChange:e=>{d({headerColor:e})}}),(0,i.jsx)(Xu,{direction:"horizontal"}),(0,i.jsxs)(yc,{isSearchVisible:!0,label:t("champs_affich_17945"),multiple:!0,placeholder:t("champs_affich_17945"),values:a.slugsToDisplay,onChange:e=>{d({slugsToDisplay:e})},children:[(0,i.jsx)("option",{value:"email",children:t("Email")}),(0,i.jsx)("option",{value:"fullName",children:t("nom_complet_05907")}),(0,i.jsx)("option",{value:"teamCode",children:t("code_quipe_14296")}),e.data.organization.customFields.nodes.map(e=>(0,i.jsx)("option",{value:e.slug,children:e.name},e.id))]})]}),(0,i.jsxs)(Ba,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(KB,{downloadPath:_g(e.data.event.segment.links.usersListingLink,"pdf",{lang:o?.language}),getPath:e=>Ps.DOCUMENTS_VOLUNTEERS_LISTING(n,s,e),segmentsFolders:e.data.event.segmentsFolders}),(0,i.jsx)(OB,{width:1,children:(0,i.jsx)(ZV,{documentUsersListing:e.data,eventDocument:r,options:a})})]})]})},JV=()=>{const{translate:e,params:{organizationId:t,eventId:n,segmentId:s}}=vl(),{event:o}=wb(),{data:r,loader:a}=Qn("query UsersListingDocument(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $segmentId: SegmentId!\n) {\n ...DocumentUsersListing\n\n event(id: $eventId) {\n ...EventVolunteersExport\n }\n}\n",{organizationId:t,eventId:n,segmentId:s},[Vs.DocumentUsersListingFragment,Vs.EventVolunteersExportFragment]);return Md(`${o.name} ${e("liste_des_membr_89037")}`),(0,i.jsxs)(Ba,{css:{padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(zB,{documentType:ze.VolunteersListing,eventId:n,languages:r.event?.languages??[],organizationId:t,segmentsFolders:r.event?.segmentsFolders??[],title:e("liste_des_membr_89037")}),(0,i.jsx)(Ya,{height:"7"}),a||(0,i.jsx)(XV,{data:r,eventId:n})]})},QV=e=>{const t=Zn(mC),n=(0,L.useMemo)(()=>e.customFields.find(t=>t.slug===e.options.customFieldSlug),[e.customFields,e.options.customFieldSlug]);return(0,i.jsx)(Ba,{css:{columnGap:"$2",rowGap:"$3"},wrap:"wrap",children:e.vrs.map(s=>{const o=s.userInfo,r=Dg(o.name,o.email);return(0,i.jsxs)(Ba,{direction:"column",gap:"2",width:84,children:[(0,i.jsx)(Ar,{css:{borderRadius:"$1",overflow:"hidden"},height:84,width:84,children:m(o.picture?.url)?(0,i.jsx)("img",{height:"100%",src:o.picture.url,width:"100%"}):(0,i.jsx)(Ba,{align:"center",css:{background:Fg(r)},height:1,justify:"center",width:1,children:(0,i.jsx)(Ar,{font:"white displaySm medium",children:r})})}),(0,i.jsxs)(Ba,{direction:"column",width:1,children:[(0,i.jsx)(Ar,{css:{ellipsis:!0},font:"gray900 textXs medium",title:o.lastName,children:(o.lastName||"-").toUpperCase()}),(0,i.jsx)(Ar,{css:{ellipsis:!0},font:"gray900 textXs medium",title:o.firstName,children:o.firstName||"-"}),n&&(0,i.jsx)(Ar,{color:"gray500",css:{ellipsis:!0,fontSize:"10px"},title:"",children:t.getValueString(n,o.fields)||"-"}),e.options.showPhone&&(0,i.jsx)(Ar,{color:"gray500",css:{ellipsis:!0,fontSize:"10px"},title:o.phone?.internationalFormat||"-",children:o.phone?.internationalFormat||"-"})]})]},o.id)})})},eU=e=>{const t=Xn(),n=e.documentUsersPictures.event.volunteersRegistrations.nodes,s=(0,L.useMemo)(()=>(0,ep.A)(n,48),[n]),o=e.documentUsersPictures.event.segment;return so(n)?(0,i.jsx)(i.Fragment,{children:s.map((s,r)=>(0,i.jsx)(SV,{headerTitle1:m(e.eventDocument.title)?e.eventDocument.title:t("trombinoscope_11316"),headerTitle2:`${o.name} (${n.length})`,options:e.options,children:(0,i.jsx)(QV,{customFields:e.documentUsersPictures.organization.customFields.nodes,options:e.options,vrs:s})},r))}):(0,i.jsx)(SV,{headerTitle1:m(e.eventDocument.title)?e.eventDocument.title:t("trombinoscope_11316"),headerTitle2:o.name,options:e.options})},tU=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=vl(),{user:o}=ai(),{eventDocument:r,options:a,title:l,setOptions:d,setTitle:c}=VB(e.data.event.document.options,{background:{name:"",content:""},customFieldSlug:null,fontFamily:"Open Sans",headerColor:"#ffffff",showPhone:!0,textColor:"#1d2939",title:""},s,{id:e.data.event.document.id,title:e.data.event.document.title}),u=qL();return(0,i.jsxs)(Ba,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[(0,i.jsxs)(BB,{children:[(0,i.jsxs)(Ba,{align:"center",gap:"3",children:[(0,i.jsx)(iV,{accept:yv.Images,format:"base64",label:t("fond_du_documen_51758"),placeholder:t("fond_du_documen_51758"),value:a.background,onChange:e=>{d({background:e})}}),m(a.background?.name)&&(0,i.jsx)(Ar,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{d({background:{name:"",content:""}})},children:t("r_initialiser_77538")})]}),(0,i.jsx)(Bl,{label:t("titre_du_docume_33508"),value:l,onChange:e=>{c(e)}}),(0,i.jsx)(Xu,{direction:"horizontal"}),(0,i.jsx)($u,{label:"Police",value:a.fontFamily,onChange:e=>{d({fontFamily:e})},children:u}),(0,i.jsx)(Hj,{label:t("couleur_du_cont_17150"),value:a.headerColor,onChange:e=>{d({headerColor:e})}}),(0,i.jsx)(Xu,{direction:"horizontal"}),(0,i.jsx)(yc,{isSearchVisible:!0,label:t("champ_suppl_men_12652"),placeholder:t("champ_suppl_men_12652"),values:a.customFieldSlug?[a.customFieldSlug]:[],onChange:e=>{so(e)?d({customFieldSlug:e[0]}):d({customFieldSlug:null})},children:e.data.organization.customFields.nodes.map(e=>(0,i.jsx)("option",{value:e.slug,children:e.name},e.id))}),a.showPhone&&(0,i.jsx)(ku,{value:a.showPhone,onChange:e=>{d({showPhone:e})},children:t("afficher_le_num_37843")})]}),(0,i.jsxs)(Ba,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(KB,{downloadPath:_g(e.data.event.segment.links.usersPicturesLink,"pdf",{lang:o?.language}),getPath:e=>Ps.DOCUMENTS_USERS_PICTURES(n,s,e),segmentsFolders:e.data.event.segmentsFolders}),(0,i.jsx)(OB,{children:(0,i.jsx)(eU,{documentUsersPictures:e.data,eventDocument:r,options:a})})]})]})},nU=()=>{const{translate:e,params:{organizationId:t,eventId:n,segmentId:s}}=vl(),{event:o}=wb(),{data:r,loader:a}=Qn("query UsersPicturesDocument(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $segmentId: SegmentId!\n) {\n ...DocumentUsersPictures\n\n event(id: $eventId) {\n ...EventVolunteersExport\n }\n}\n",{organizationId:t,eventId:n,segmentId:s},[Vs.DocumentUsersPicturesFragment,Vs.EventVolunteersExportFragment]);return Md(`${o.name} ${e("trombinoscope_11316")}`),(0,i.jsxs)(Ba,{css:{padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(zB,{documentType:ze.UsersPictures,eventId:n,languages:r.event?.languages??[],organizationId:t,segmentsFolders:r.event?.segmentsFolders??[],title:e("trombinoscope_11316")}),(0,i.jsx)(Ya,{height:"7"}),a||(0,i.jsx)(tU,{data:r})]})},iU=e=>{const{history:t,translate:n}=vl(),{data:s,loader:o}=Qn("query EmailsTemplates($eventId: EventId!) {\n event(id: $eventId) {\n emailSender {\n ... on EmailsSender {\n domainStatus\n }\n }\n }\n}\n",{eventId:e.eventId},[]);const[r,a]=(0,L.useState)($e.Assignments);return o||(0,i.jsxs)(i.Fragment,{children:[(!s.event.emailSender||s.event.emailSender.domainStatus!==Se.Success)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ba,{gap:"4",width:1,children:[s.event.emailSender&&s.event.emailSender.domainStatus!==Se.Success&&(0,i.jsx)(rl,{color:"error",leftIcon:"circle-exclamation",width:1,children:(0,i.jsxs)(Ba,{css:{fontWeight:"$medium"},direction:"column",gap:"3",children:[(0,i.jsx)(Ar,{children:n("vos_entr_es_dns_68834")}),(0,i.jsxs)(Ba,{align:"center",css:{cursor:"pointer"},gap:"3",onClick:()=>{t.push(Ps.ORGANIZATION_PARAMETERS_EMAILS_DNS(e.organizationId))},children:[(0,i.jsx)(Ar,{children:n("configurer_les_65453")}),(0,i.jsx)(Ar,{children:(0,i.jsx)(nl,{icon:"arrow-right"})})]})]})}),!s.event.emailSender&&(0,i.jsx)(rl,{color:"warning",leftIcon:"triangle-exclamation",width:1,children:(0,i.jsxs)(Ba,{css:{fontWeight:"$medium"},direction:"column",gap:"3",children:[(0,i.jsx)(Ar,{children:n("aucun_metteur_26635",P.EMAIL_FROM)}),(0,i.jsxs)(Ba,{align:"center",css:{cursor:"pointer"},gap:"3",onClick:()=>{t.push(Ps.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(e.organizationId))},children:[(0,i.jsx)(Ar,{children:n("configurer_les_56837")}),(0,i.jsx)(Ar,{children:(0,i.jsx)(nl,{icon:"arrow-right"})})]})]})})]}),(0,i.jsx)(Ya,{height:"6"})]}),(0,i.jsxs)(Ba,{gap:"7",children:[(0,i.jsxs)(Ba,{css:{flex:"1",py:"$3"},direction:"column",children:[(0,i.jsx)(Ar,{color:"gray900",fontSize:"textLg",fontWeight:"medium",children:n("liste_des_e_mai_73508")}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsxs)(Sc,{children:[(0,i.jsx)(kc,{children:(0,i.jsx)(Gc,{children:n("type_d_e_mail_06577")})}),(0,i.jsx)(bE,{isSelected:r===$e.VolunteerRegistration,subtitle:n("cet_e_mail_est_75023"),title:n("UserInfoAdminCreate"),onClick:()=>a($e.VolunteerRegistration)}),(0,i.jsx)(bE,{isSelected:r===$e.Assignments,subtitle:n("cet_e_mail_cont_98777"),title:n("affectation_u_11128"),onClick:()=>a($e.Assignments)}),(0,i.jsx)(bE,{isSelected:r===$e.Refused,subtitle:n("cet_e_mail_est_69069"),title:n("refus_d_affecta_71455"),onClick:()=>a($e.Refused)}),(0,i.jsx)(bE,{isSelected:r===$e.Accreditations,subtitle:n("cet_e_mail_cont_75798"),title:n("affectation_u_39802"),onClick:()=>a($e.Accreditations)}),(0,i.jsx)(bE,{isSelected:r===$e.AccreditationsRefused,subtitle:n("cet_e_mail_est_69069"),title:n("refus_d_accr_di_89997"),onClick:()=>a($e.AccreditationsRefused)}),(0,i.jsx)(bE,{isSelected:r===$e.DelegationCategoryLeaderAssign,subtitle:n("cet_e_mail_est_67392"),title:n("nomination_en_t_77654"),onClick:()=>a($e.DelegationCategoryLeaderAssign)}),(0,i.jsx)(bE,{isSelected:r===$e.DelegationLeaderAssign,subtitle:n("email_sent_when_appointing_team_manager"),title:n("appointment_as_team_manager"),onClick:()=>a($e.DelegationLeaderAssign)}),(0,i.jsx)(bE,{isSelected:r===$e.DelegationFormInvite,subtitle:n("cet_e_mail_est_19547"),title:n("envoi_du_formul_09434"),onClick:()=>a($e.DelegationFormInvite)}),(0,i.jsx)(bE,{isSelected:r===$e.PositionLeaderAssign,subtitle:n("cet_e_mail_est_82173"),title:n("nomination_en_t_06971"),onClick:()=>a($e.PositionLeaderAssign)}),(0,i.jsx)(bE,{isSelected:r===$e.PositionCategoryLeaderAssign,subtitle:n("cet_e_mail_est_70420"),title:n("nomination_en_t_02948"),onClick:()=>a($e.PositionCategoryLeaderAssign)}),(0,i.jsx)(bE,{isSelected:r===$e.NotifyLeaders,subtitle:n("cet_e_mail_est_90425"),title:n("un_responsable_88525"),onClick:()=>a($e.NotifyLeaders)}),(0,i.jsx)(bE,{isSelected:r===$e.Code,subtitle:n("cet_e_mail_est_49663"),title:n("code_20843"),onClick:()=>a($e.Code)})]})]}),(0,i.jsx)(Ar,{css:{borderRight:"1px solid $gray200",width:"1px"}}),(0,i.jsx)(Ba,{css:{flex:"1",py:"$3"},children:(0,i.jsx)(CE,{emailType:r,eventId:e.eventId,formId:null,organizationId:e.organizationId,source:null})})]})]})},sU=()=>{const e=Xn(),{event:{name:t}}=wb();Md(`${t} ${e("e_mails_09850")}`);const{organizationId:n,eventId:s}=ti();return(0,i.jsxs)(Ba,{css:{padding:"$7"},direction:"column",width:1,children:[(0,i.jsx)(Ar,{color:"gray900",fontSize:"displayXs",fontWeight:"semiBold",children:e("mod_les_e_mail_91257")}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(iU,{eventId:s,organizationId:n})]})};let oU=class extends Gl{constructor(e){super(e)}formParametersAccreditationsInputDefault(e){return{accreditationDisplay:e?.accreditationDisplay||pt.None,accreditationFilter:e?.accreditationFilter||xt.None,hiddenAccreditationsCategoriesIds:e?.hiddenAccreditationsCategoriesIds||[],hiddenAccreditationsIds:e?.hiddenAccreditationsIds||[],hiddenAccreditationsSlotsIds:e?.hiddenAccreditationsSlotsIds||[],displayedAccreditationsCategoriesIds:e?.displayedAccreditationsCategoriesIds||[],displayedAccreditationsIds:e?.displayedAccreditationsIds||[],displayedAccreditationsSlotsIds:e?.displayedAccreditationsSlotsIds||[],showFullAccreditation:e?.showFullAccreditation??!0,showAccreditationDescription:e?.showAccreditationDescription??!1,accreditationTitle:e?.accreditationTitle||"",accreditationSubtitle:e?.accreditationSubtitle||""}}formParametersAccreditationsInputSchema(){return d.Ik().shape({accreditationDisplay:d.Yj().required(this.t("la_strat_gie_d_70458")).oneOf(wn,this.t("la_strat_gie_d_70458")),accreditationFilter:d.Yj().required(this.t("la_strat_gie_de_28051")).oneOf(Tn,this.t("la_strat_gie_de_28051")),hiddenAccreditationsIds:d.YO().of(d.ai()),showFullAccreditation:d.zM().required(),showAccreditationDescription:d.zM().required(),accreditationTitle:d.Yj(),accreditationSubtitle:d.Yj()})}updateFormParametersAccreditationsSchema(){return d.Ik().shape({form:this.formParametersAccreditationsInputSchema()})}};oU=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[qn])],oU);const rU=e=>{const t=Xn(),{data:n,loader:s}=Qn("query FormParametersAccreditationsHiddenDisplayed($eventId: EventId!) {\n event(id: $eventId) {\n accreditationsCategories {\n id\n name\n\n accreditations {\n id\n name\n index\n\n slots(includeHidden: true) {\n id\n name\n date\n }\n }\n }\n }\n}\n",{eventId:e.eventId},[]);const o=Zn(Jc),[r,a]=(0,L.useState)(so(e.values.form.hiddenAccreditationsCategoriesIds)||so(e.values.form.hiddenAccreditationsIds)||so(e.values.form.hiddenAccreditationsSlotsIds)?"hidden":"displayed"),[l,d]=(0,L.useState)(so(e.values.form.hiddenAccreditationsCategoriesIds)?"checked":"unchecked"),[c,u]=(0,L.useState)(so(e.values.form.hiddenAccreditationsIds)?"checked":"unchecked"),[h,m]=(0,L.useState)(so(e.values.form.hiddenAccreditationsSlotsIds)?"checked":"unchecked"),[g,p]=(0,L.useState)(so(e.values.form.displayedAccreditationsCategoriesIds)?"checked":"unchecked"),[f,_]=(0,L.useState)(so(e.values.form.displayedAccreditationsIds)?"checked":"unchecked"),[x,I]=(0,L.useState)(so(e.values.form.displayedAccreditationsSlotsIds)?"checked":"unchecked"),v=(0,L.useMemo)(()=>(0,uc.A)(n.event?.accreditationsCategories??[],e=>e.name.toLowerCase()),[n.event]),b=(0,L.useMemo)(()=>v.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id)),[v]),j=(0,L.useMemo)(()=>v.map(e=>{const t=DC(e.accreditations);return(0,i.jsx)("optgroup",{label:e.name,children:t.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},e.id)}),[n.event]),C=(0,L.useMemo)(()=>v.flatMap(e=>DC(e.accreditations).map(e=>{const t=Nh(e.slots).map(t=>({id:t.id,name:Dh(o,t,e.name,{accreditation:{includeNameAtEnd:!0},date:{localeFormat:eo.DateOnly.MonthLong}})}));return(0,i.jsx)("optgroup",{label:e.name,children:t.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},e.id)})),[v]);return(0,i.jsx)(Ba,{css:{background:"$gray50",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",padding:"$4 $6"},direction:"column",children:s||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ar,{font:"gray800 textSm semiBold",children:t("pr_f_rences_d_a_19371")}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:"hidden"===r?"checked":"unchecked",onClick:t=>{"checked"===t&&(a("hidden"),e.change("form.displayedAccreditationsCategoriesIds",[]),e.change("form.displayedAccreditationsIds",[]),e.change("form.displayedAccreditationsSlotsIds",[]))},children:t("cacher_des_cat_43848")}),(0,i.jsx)(Ya,{height:"3"}),"hidden"===r&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ba,{css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",padding:"$4 $6"},direction:"column",children:[(0,i.jsx)(_c,{state:l,onClick:t=>{d(t),"unchecked"===t&&e.change("form.hiddenAccreditationsCategoriesIds",[])},children:t("cacher_certaine_12220")}),"checked"===l&&(0,i.jsxs)(Ba,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(Ym,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.hiddenAccreditationsCategoriesIds",children:b})]}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(_c,{state:c,onClick:t=>{u(t),"unchecked"===t&&e.change("form.hiddenAccreditationsIds",[])},children:t("cacher_certaine_08734")}),"checked"===c&&(0,i.jsxs)(Ba,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(Ym,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.hiddenAccreditationsIds",children:j})]}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(_c,{state:h,onClick:t=>{m(t),"unchecked"===t&&e.change("form.hiddenAccreditationsSlotsIds",[])},children:t("cacher_certains_02997")}),"checked"===h&&(0,i.jsxs)(Ba,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(Ym,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.hiddenAccreditationsSlotsIds",children:C})]})]}),(0,i.jsx)(Ya,{height:"5"})]}),(0,i.jsx)(vc,{state:"displayed"===r?"checked":"unchecked",onClick:t=>{a("displayed"),"checked"===t&&(e.change("form.hiddenAccreditationsCategoriesIds",[]),e.change("form.hiddenAccreditationsIds",[]),e.change("form.hiddenAccreditationsSlotsIds",[]))},children:t("afficher_des_ca_68243")}),(0,i.jsx)(Ya,{height:"3"}),"displayed"===r&&(0,i.jsxs)(Ba,{css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",padding:"$4 $6"},direction:"column",children:[(0,i.jsx)(_c,{state:g,onClick:t=>{p(t),"unchecked"===t&&e.change("form.displayedAccreditationsCategoriesIds",[])},children:t("afficher_certai_88457")}),"checked"===g&&(0,i.jsxs)(Ba,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(Ym,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.displayedAccreditationsCategoriesIds",children:b})]}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(_c,{state:f,onClick:t=>{_(t),"unchecked"===t&&e.change("form.displayedAccreditationsIds",[])},children:t("afficher_certai_29161")}),"checked"===f&&(0,i.jsxs)(Ba,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(Ym,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.displayedAccreditationsIds",children:j})]}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(_c,{state:x,onClick:t=>{I(t),"unchecked"===t&&e.change("form.displayedAccreditationsSlotsIds",[])},children:t("afficher_certai_38724")}),"checked"===x&&(0,i.jsxs)(Ba,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(Ym,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.displayedAccreditationsSlotsIds",children:C})]})]})]})})},aU=e=>{const t=Xn(),[n,s]=(0,L.useState)(so(e.values.form.hiddenAccreditationsCategoriesIds)||so(e.values.form.hiddenAccreditationsIds)||so(e.values.form.hiddenAccreditationsSlotsIds)||so(e.values.form.displayedAccreditationsCategoriesIds)||so(e.values.form.displayedAccreditationsIds)||so(e.values.form.displayedAccreditationsSlotsIds));return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ku,{value:n,onChange:t=>{s(t),t||(e.change("form.hiddenAccreditationsCategoriesIds",[]),e.change("form.hiddenAccreditationsIds",[]),e.change("form.hiddenAccreditationsSlotsIds",[]),e.change("form.displayedAccreditationsCategoriesIds",[]),e.change("form.displayedAccreditationsIds",[]),e.change("form.displayedAccreditationsSlotsIds",[]))},children:t("afficher_masq_37398")}),n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(rU,{change:e.change,eventId:e.eventId,values:e.values})]})]})},lU=e=>{const t=Xn(),{isNotSavedModalOpen:n,onClose:s,onNotSavedClose:o,onSave:r}=EE(e.initialValues,e.values,e.handleSubmit),a=e.slotDisplay!==It.Hide;return(0,i.jsx)(XS,{button:(0,i.jsx)(zl,{isLoading:e.isMutateLoading,onClick:r,children:t("enregistrer_06519")}),title:e.name,onClose:s,children:(0,i.jsx)(SE,{isNotSavedOpen:n,onNotSavedClose:o,children:e.loader||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ar,{font:"gray800 textMd semiBold",children:t("param_tres_des_90955")}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(Ar,{color:"gray800",fontWeight:"medium",children:t("comment_souhait_18471")}),(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(ub,{name:"form.accreditationDisplay",value:pt.Accreditation,children:t("afficher_les_ac_56952")}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(ub,{name:"form.accreditationDisplay",value:pt.None,children:t("ne_rien_affiche_81467")}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(Ar,{color:"gray800",fontWeight:"medium",children:t("personnalisatio_86385")}),(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(Jm,{name:"form.showFullAccreditation",children:t("afficher_les_ac_56062")}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(aU,{change:e.change,eventId:e.eventId,values:e.values}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(Ar,{color:"gray800",fontWeight:"medium",children:t("affichage_des_d_57491")}),(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(Gm,{name:"form.showAccreditationDescription",children:t("afficher_la_des_94587")}),a&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ju,{height:"7"}),(0,i.jsx)(Ar,{font:"gray800 textMd semiBold",children:t("filtrer_les_acc_57840")}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ar,{color:"gray500",children:t("d_cider_si_le_c_31187")}),(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(ub,{name:"form.accreditationFilter",value:xt.FilterWithSlots,children:t("filtrer_les_acc_66152")}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(ub,{name:"form.accreditationFilter",value:xt.None,children:t("ne_pas_filtrer_97321")})]}),(0,i.jsx)(Ju,{height:"7"}),(0,i.jsx)(Ar,{font:"gray800 textMd semiBold",children:t("personnalisatio_15893")}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ar,{color:"gray500",children:t("personnaliser_l_44808")}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(Vl,{label:t("nom_de_l_tape_85862"),name:"form.accreditationTitle"}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(rb,{label:t("description_58935"),name:"form.accreditationSubtitle"})]})})})},dU=()=>{const{params:{organizationId:e,eventId:t,formId:n}}=vl(),{data:s,loader:o}=Qn("query FormParametersAccreditations($organizationId: OrganizationId!, $formId: FormId!) {\n organization(id: $organizationId) {\n form(id: $formId) {\n name\n slotDisplay\n accreditationDisplay\n hiddenAccreditationsCategoriesIds\n hiddenAccreditationsIds\n hiddenAccreditationsSlotsIds\n displayedAccreditationsCategoriesIds\n displayedAccreditationsIds\n displayedAccreditationsSlotsIds\n showFullAccreditation\n showAccreditationDescription\n accreditationTitle\n accreditationSubtitle\n accreditationFilter\n }\n }\n}\n",{organizationId:e,formId:n},[]);Md(s.organization?.form.name??"");const r=Zn(Ua),a=Zn(oU),{mutate:l,isLoading:d}=function(e={}){return ei("mutation FormParametersAccreditationsUpdate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $formId: FormId!\n $form: FormParametersAccreditationsInput!\n) {\n formParametersAccreditationsUpdate(\n organizationId: $organizationId\n eventId: $eventId\n formId: $formId\n form: $form\n ) {\n id\n }\n}\n",e)}(),c=L.useMemo(()=>({form:a.formParametersAccreditationsInputDefault(s.organization?.form)}),[s.organization]);return(0,i.jsx)(kl,{direction:"column",height:1,initialValues:c,render:({form:e,handleSubmit:n,values:r})=>(0,i.jsx)(lU,{change:e.change,eventId:t,handleSubmit:n,initialValues:c,isMutateLoading:d,loader:o,name:s.organization?.form.name??"",slotDisplay:s.organization?.form.slotDisplay||It.Hide,values:r}),validate:r.validateForForm(a.updateFormParametersAccreditationsSchema()),width:1,onSubmit:i=>l({organizationId:e,eventId:t,formId:n,form:i.form})})};class cU extends Gl{constructor(e){super(e)}customSlotInputDefault(){return{name:"",startTime:"",endTime:""}}customSlotInputSchema(){return d.Ik().shape({name:d.Yj().required(this.t("le_nom_du_cr_ne_97703")),startTime:d.Yj().required(this.t("le_d_but_du_cr_40745")),endTime:d.Yj().required(this.t("la_fin_du_cr_ne_90351"))})}}let uU=class extends Gl{customSlotInputService;constructor(e,t){super(e),this.customSlotInputService=t}customSlotPeriodInputDefault(){return{name:"",customSlots:[this.customSlotInputService.customSlotInputDefault()],hideNameDates:!1,displayAsCalendar:!1,hasCondition:!1,conditionCustomFieldId:null,conditionValue:!1}}customSlotPeriodInputSchema(){return d.Ik().shape({customSlotPeriod:d.Ik().shape({name:d.Yj(),customSlots:d.YO().of(this.customSlotInputService.customSlotInputSchema()).required("").min(1,"")})})}};uU=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[qn,cU])],uU);let hU=class extends Gl{constructor(e){super(e)}formParametersAvailabilitiesInputDefault(e){return{slotDisplay:e?.slotDisplay||It.Hide,daysDisplay:e?.daysDisplay||ft.AllDays,customSlotsPeriods:(e?.customSlotsPeriods??[]).map(e=>(0,ur.A)(e,["id","conditionCustomField"])),slotTitle:e?.slotTitle||"",slotSubtitle:e?.slotSubtitle||""}}formParametersAvailabilitiesInputSchema(){return d.Ik().shape({slotDisplay:d.Yj().required(this.t("la_strat_gie_d_34961")).oneOf(zn,this.t("la_strat_gie_d_34961")),daysDisplay:d.Yj().required(this.t("la_strat_gie_de_56435")).oneOf(Sn,this.t("la_strat_gie_de_56435"))})}updateFormParametersAvailabilitiesSchema(){return d.Ik().shape({form:this.formParametersAvailabilitiesInputSchema()})}};hU=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[qn])],hU);const mU=e=>{const t=Xn(),n=Zn(uU),s=Zn(cU);return(0,i.jsx)(Lb,{isOpen:!0,onClose:e.onClose,children:(0,i.jsx)(Nb,{children:(0,i.jsx)(kl,{direction:"column",hideDefaultErrors:!0,initialValues:{customSlotPeriod:e.customSlotPeriod},render:({form:n,handleSubmit:o,submitting:r,values:a})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mb,{icon:"sliders-up",subtitle:t("param_trer_les_33935"),children:t("mise_jour_de_14984")}),(0,i.jsxs)(Fb,{css:{overflowY:"auto"},gap:"7",children:[(0,i.jsxs)(Ba,{direction:"column",gap:"4",children:[(0,i.jsx)(jl,{hideSpacer:!0}),(0,i.jsx)(Vl,{hint:t("le_nom_de_la_p_49293"),label:(0,i.jsx)(Zv,{children:t("nom_de_la_p_rio_89140")}),name:"customSlotPeriod.name"}),(0,i.jsxs)(Ba,{gap:"4",children:[(0,i.jsx)(Hm,{label:(0,i.jsx)(Zv,{children:t("date_de_d_but_43380")}),max:e.event.endAt,min:e.event.startAt,name:"customSlotPeriod.startDate"}),(0,i.jsx)(Hm,{label:(0,i.jsx)(Zv,{children:t("date_de_fin_86920")}),max:e.event.endAt,min:e.event.startAt,name:"customSlotPeriod.endDate"})]}),(0,i.jsxs)(Ba,{direction:"column",gap:"3",children:[(0,i.jsx)(Jm,{name:"customSlotPeriod.hasCondition",children:t("conditionner_l_33629")}),a.customSlotPeriod.hasCondition&&(0,i.jsx)(Ba,{css:{background:"$gray50",bd:!0,padding:"$4"},direction:"column",gap:"4",children:(0,i.jsx)(mE,{conditionCustomFieldId:a.customSlotPeriod.conditionCustomFieldId,conditionCustomFields:e.conditionCustomFields,conditionValue:a.customSlotPeriod.conditionValue,setConditionCustomFieldId:t=>{const i=e.conditionCustomFields.find(e=>e.id===t);i&&(n.change("customSlotPeriod.conditionValue",i.fieldType===We.Checkbox||[]),n.change("customSlotPeriod.conditionCustomFieldId",t))},setConditionValue:e=>{n.change("customSlotPeriod.conditionValue",e)}})})]})]}),(0,i.jsxs)(Ba,{direction:"column",gap:"4",children:[(0,i.jsx)(Ar,{font:"gray800 textMd medium",children:t("cr_neaux_person_16330")}),a.customSlotPeriod.customSlots.map((e,s)=>{const o=`customSlotPeriod.customSlots[${s}].`;return(0,i.jsxs)(Ba,{align:"end",gap:"4",children:[(0,i.jsx)(Ar,{css:{flex:"1"},children:(0,i.jsx)(Vl,{label:t("nom_du_cr_neau_54351"),name:`${o}name`})}),(0,i.jsx)(Ar,{css:{flex:"1"},children:(0,i.jsx)(lb,{label:t("SlotStart"),name:`${o}startTime`})}),(0,i.jsx)(Ar,{css:{flex:"1"},children:(0,i.jsx)(lb,{label:t("SlotEnd"),name:`${o}endTime`})}),(0,i.jsx)(zl,{color:"white",leftIcon:"trash-can",onClick:()=>{n.change("customSlotPeriod.customSlots",co(a.customSlotPeriod.customSlots,s))}})]},s)}),(0,i.jsx)(zl,{color:"invisible",leftIcon:"plus",onClick:()=>{n.change("customSlotPeriod.customSlots",[...a.customSlotPeriod.customSlots,s.customSlotInputDefault()])},children:t("ajouter_un_cr_n_63607")})]}),a.customSlotPeriod.customSlots.length<2&&(0,i.jsxs)(Ba,{direction:"column",gap:"2",children:[(0,i.jsx)(Ar,{font:"gray800 textMd medium",children:t("options_d_affic_10797")}),(0,i.jsx)(Jm,{name:"customSlotPeriod.hideNameDates",children:t("masquer_les_inf_78021")}),(0,i.jsx)(Jm,{name:"customSlotPeriod.displayAsCalendar",children:t("afficher_les_di_90328")})]})]}),(0,i.jsx)(Pb,{children:(0,i.jsx)(zl,{isLoading:r,onClick:o,children:t("mettre_jour_l_81276")})})]}),schema:n.customSlotPeriodInputSchema(),onSubmit:async t=>{await e.onSuccess(t.customSlotPeriod),e.onClose()}})})})},gU=e=>{const t=Xn(),n=Zn(Jc),[s,o]=(0,L.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ba,{align:"center",css:{background:"white",bd:!0,padding:"$3 $4"},gap:"2",children:[(0,i.jsxs)(Ba,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(Ar,{font:"gray900 textSm semiBold",children:m(e.customSlotPeriod.name)?e.customSlotPeriod.name:t("p_riode_de_l_v_78032")}),(0,i.jsxs)(Ar,{color:"gray500",children:[e.customSlotPeriod.startDate?n.toLocaleString(e.customSlotPeriod.startDate,eo.DateOnly.WeekdayLongMonthLong):t("d_but_le_l_v_n_58366")," ","-"," ",e.customSlotPeriod.endDate?n.toLocaleString(e.customSlotPeriod.endDate,eo.DateOnly.WeekdayLongMonthLong):t("fin_de_l_v_nem_88380")," ","- ",t("creneau",e.customSlotPeriod.customSlots.length)]})]}),(0,i.jsx)(zl,{color:"white",leftIcon:"pen",size:"sm",onClick:()=>o(!0)}),(0,i.jsx)(zl,{color:"white",leftIcon:"trash-can",size:"sm",onClick:e.remove})]}),s&&(0,i.jsx)(mU,{conditionCustomFields:e.conditionCustomFields,customSlotPeriod:e.customSlotPeriod,event:e.event,onClose:()=>o(!1),onSuccess:async t=>{e.updateCustomSlotPeriod(t,e.index)}})]})},pU=e=>{const t=Xn();return(0,i.jsxs)(Ba,{css:{background:"$gray50",borderRadius:"$1",marginLeft:"$6",padding:"$6"},direction:"column",gap:"3",width:1,children:[e.customSlotsPeriods.map((t,n)=>(0,i.jsx)(gU,{conditionCustomFields:e.conditionCustomFields,customSlotPeriod:t,event:e.event,index:n,remove:()=>{e.remove(n)},updateCustomSlotPeriod:e.updateCustomSlotPeriod},n)),(0,i.jsxs)(Ba,{align:"center",css:{color:"$primary500",cursor:"pointer"},gap:"3",onClick:e.add,children:[(0,i.jsx)(nl,{icon:"plus"}),(0,i.jsx)(Ar,{children:t("ajouter_une_p_r_04249")})]})]})},fU=e=>{const t=Xn(),n=Zn(uU),{isNotSavedModalOpen:s,onClose:o,onNotSavedClose:r,onSave:a}=EE(e.initialValues,e.values,e.handleSubmit),l=(0,L.useCallback)(()=>{e.form.change("form.customSlotsPeriods",[...e.values.form.customSlotsPeriods,n.customSlotPeriodInputDefault()])},[e.values.form.customSlotsPeriods,e.form.change]),d=(0,L.useCallback)(t=>{e.form.change("form.customSlotsPeriods",co(e.values.form.customSlotsPeriods,t))},[e.values.form.customSlotsPeriods,e.form.change]),c=(0,L.useCallback)((t,n)=>{const i=[...e.values.form.customSlotsPeriods];i[n]=t,e.form.change("form.customSlotsPeriods",i)},[e.values.form.customSlotsPeriods,e.form.change]),u=e.values.form.slotDisplay===It.Custom,h=e.values.form.slotDisplay===It.DisplayDays||e.values.form.slotDisplay===It.Calendar||e.values.form.slotDisplay===It.Custom;return(0,i.jsx)(XS,{button:(0,i.jsx)(zl,{isLoading:e.isMutateLoading,onClick:a,children:t("enregistrer_06519")}),title:e.name,onClose:o,children:(0,i.jsx)(SE,{isNotSavedOpen:s,onNotSavedClose:r,children:e.loader||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(FE,{heading:t("affichage_des_d_20852"),role:"radiogroup",subtitle:t("personnaliser_l_64536"),children:[(0,i.jsx)(ub,{name:"form.slotDisplay",value:It.Display,children:t("demander_au_mem_07520")}),(0,i.jsx)(ub,{name:"form.slotDisplay",value:It.DisplayDays,children:t("demander_au_mem_50067")}),(0,i.jsx)(ub,{name:"form.slotDisplay",value:It.Calendar,children:t("demander_au_mem_60083")}),(0,i.jsx)(ub,{name:"form.slotDisplay",value:It.Custom,children:t("demander_au_mem_31132")}),u&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(pU,{add:l,conditionCustomFields:e.conditionCustomFields,customSlotsPeriods:e.values.form.customSlotsPeriods,event:e.event,remove:d,updateCustomSlotPeriod:c})}),(0,i.jsx)(ub,{name:"form.slotDisplay",value:It.Hide,children:t("ne_pas_demander_46686")})]}),h&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ju,{height:"7"}),(0,i.jsx)(Ar,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("filtrer_les_dis_80634")}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ar,{color:"gray500",children:t("d_cider_de_filt_81078")}),(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(ub,{name:"form.daysDisplay",value:ft.AllDays,children:t("afficher_l_ense_11531")}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(ub,{name:"form.daysDisplay",value:ft.DaysWithSlots,children:t("filtrer_les_jou_51154")})]}),e.values.form.slotDisplay!==It.Hide&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ju,{height:"7"}),(0,i.jsx)(Ar,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("personnalisatio_15893")}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ar,{color:"gray500",children:t("personnaliser_l_44808")}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(Vl,{label:t("nom_de_l_tape_85862"),name:"form.slotTitle"}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(rb,{label:t("description_58935"),name:"form.slotSubtitle"})]})]})})})},_U=()=>{const{params:{organizationId:e,eventId:t,formId:n}}=vl(),{data:s,loader:o}=Qn("query FormParametersAvailabilities(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $formId: FormId!\n) {\n organization(id: $organizationId) {\n ...FormCustomFields\n\n form(id: $formId) {\n name\n ...FormSlotsOptions\n\n customSlotsPeriods {\n ...FormRegisterCustomSlotPeriod\n }\n }\n }\n\n event(id: $eventId) {\n startAt\n endAt\n }\n}\n",{organizationId:e,eventId:t,formId:n},[Vs.FormCustomFieldsFragment,Vs.FormSlotsOptionsFragment,Vs.FormRegisterCustomSlotPeriodFragment]);Md(s.organization?.form.name??"");const r=Zn(Ua),a=Zn(hU),{mutate:l,isLoading:d}=function(e={}){return ei("mutation FormParametersAvailabilitiesUpdate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $formId: FormId!\n $form: FormParametersAvailabilitiesInput!\n) {\n formParametersAvailabilitiesUpdate(\n organizationId: $organizationId\n eventId: $eventId\n formId: $formId\n form: $form\n ) {\n id\n }\n}\n",e)}(),c=(0,L.useMemo)(()=>(s.organization?.formCustomFields.nodes??[]).filter(e=>[We.Checkbox,We.Country,We.Language,We.Nationality,We.Select].includes(e.fieldType)),[s.organization]),u=(0,L.useMemo)(()=>({form:a.formParametersAvailabilitiesInputDefault(s.organization?.form)}),[s.organization]);return(0,i.jsx)(kl,{direction:"column",height:1,initialValues:u,render:({form:e,handleSubmit:t,values:n})=>(0,i.jsx)(fU,{conditionCustomFields:c,event:s.event,form:e,handleSubmit:t,initialValues:u,isMutateLoading:d,loader:o,name:s.organization?.form.name??"",values:n}),validate:r.validateForForm(a.updateFormParametersAvailabilitiesSchema()),width:1,onSubmit:i=>l({organizationId:e,eventId:t,formId:n,form:i.form})})};let xU=class extends Gl{constructor(e){super(e)}formParametersMissionsInputDefault(e){return{positionDisplay:e?.positionDisplay||_t.None,positionFilter:e?.positionFilter||xt.FilterWithSlots,positionRanking:e?.positionRanking||Ke.Unranked,positionLimit:e?.positionLimit||3,hiddenPositionsCategoriesIds:e?.hiddenPositionsCategoriesIds||[],hiddenPositionsIds:e?.hiddenPositionsIds||[],hiddenPositionsSlotsIds:e?.hiddenPositionsSlotsIds||[],hiddenPositionsTagsIds:e?.hiddenPositionsTagsIds||[],displayedPositionsCategoriesIds:e?.displayedPositionsCategoriesIds||[],displayedPositionsIds:e?.displayedPositionsIds||[],displayedPositionsSlotsIds:e?.displayedPositionsSlotsIds||[],displayedPositionsTagsIds:e?.displayedPositionsTagsIds||[],showFullPosition:e?.showFullPosition??!0,showPositionCategoryDescription:e?.showPositionCategoryDescription??!1,showPositionDescription:e?.showPositionDescription??!1,positionTitle:e?.positionTitle||"",positionSubtitle:e?.positionSubtitle||"",willAutoAssign:e?.willAutoAssign??!1}}formParametersMissionsInputSchema(){return d.Ik().shape({positionDisplay:d.Yj().required(this.t("la_strat_gie_d_44170")).oneOf(En,this.t("la_strat_gie_d_44170")),positionFilter:d.Yj().required(this.t("la_strat_gie_de_13294")).oneOf(Tn,this.t("la_strat_gie_de_13294")),positionRanking:d.Yj().required(this.t("le_type_de_clas_66819")).oneOf(fn,this.t("le_type_de_clas_66819")),positionLimit:d.ai().required(this.t("le_nombre_maxim_38249")).min(1,this.t("le_nombre_de_ch_27910")),hiddenPositionsCategoriesIds:d.YO().of(d.ai()),hiddenPositionsIds:d.YO().of(d.ai()),hiddenPositionsSlotsIds:d.YO().of(d.ai()),hiddenPositionsTagsIds:d.YO().of(d.ai()),displayedPositionsCategoriesIds:d.YO().of(d.ai()),displayedPositionsIds:d.YO().of(d.ai()),displayedPositionsSlotsIds:d.YO().of(d.ai()),displayedPositionsTagsIds:d.YO().of(d.ai()),showFullPosition:d.zM().required(),showPositionCategoryDescription:d.zM().required(),showPositionDescription:d.zM().required(),positionTitle:d.Yj(),positionSubtitle:d.Yj(),willAutoAssign:d.zM().required()})}updateFormParametersMissionsSchema(){return d.Ik().shape({form:this.formParametersMissionsInputSchema()})}};xU=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[qn])],xU);const IU=e=>(0,i.jsxs)(Ba,{css:{cursor:"pointer",position:"relative"},direction:"column",gap:"1",onClick:e.onSelect,children:[e.isSelected&&(0,i.jsx)(Ba,{align:"center",css:{background:"$primary500",borderRadius:"20px",color:"white",fontSize:"$textMd",position:"absolute",right:"-10px",top:"-10px"},height:20,justify:"center",width:20,children:(0,i.jsx)(nl,{icon:"check"})}),(0,i.jsx)(Ar,{css:{background:"$gray100",border:e.isSelected?"2px solid $primary500":"2px solid $gray100",borderRadius:"$1",padding:"$6",paddingBottom:"0"},height:135,width:240,children:(0,i.jsx)("img",{height:"107px",src:e.src,width:"188px"})}),(0,i.jsx)(Ar,{font:"gray800 textSm semiBold",children:e.name})]}),vU=e=>{const t=Xn(),{data:n,loader:s}=Qn("query FormParametersMissionsHiddenDisplayed($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n tags(context: Positions) {\n nodes {\n id\n name\n }\n }\n }\n\n event(id: $eventId) {\n positionsCategories {\n id\n name\n\n positions {\n id\n name\n\n slots {\n id\n name\n range\n }\n }\n }\n }\n}\n",{organizationId:e.organizationId,eventId:e.eventId},[]);const o=Zn(ph),[r,a]=(0,L.useState)(so(e.values.form.hiddenPositionsCategoriesIds)||so(e.values.form.hiddenPositionsIds)||so(e.values.form.hiddenPositionsSlotsIds)||so(e.values.form.hiddenPositionsTagsIds)?"hidden":"displayed"),[l,d]=(0,L.useState)(so(e.values.form.hiddenPositionsCategoriesIds)?"checked":"unchecked"),[c,h]=(0,L.useState)(so(e.values.form.hiddenPositionsIds)?"checked":"unchecked"),[g,p]=(0,L.useState)(so(e.values.form.hiddenPositionsSlotsIds)?"checked":"unchecked"),[f,_]=(0,L.useState)(so(e.values.form.hiddenPositionsTagsIds)?"checked":"unchecked"),[x,I]=(0,L.useState)(so(e.values.form.displayedPositionsCategoriesIds)?"checked":"unchecked"),[v,b]=(0,L.useState)(so(e.values.form.displayedPositionsIds)?"checked":"unchecked"),[j,C]=(0,L.useState)(so(e.values.form.displayedPositionsSlotsIds)?"checked":"unchecked"),[y,k]=(0,L.useState)(so(e.values.form.displayedPositionsTagsIds)?"checked":"unchecked"),A=(0,L.useMemo)(()=>(0,uc.A)(n.event?.positionsCategories??[],e=>u(e.name)),[n.event]),w=(0,L.useMemo)(()=>A.map(e=>(0,i.jsx)("optgroup",{label:e.name,children:e.positions.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},e.id)),[A]),S=(0,L.useMemo)(()=>(0,uc.A)(A.flatMap(e=>e.positions),e=>u(e.name)).map(e=>{const t=(0,uc.A)(e.slots.map(t=>{const n=m(t.name)?`${t.name} - `:"",i=o.toDisplayString(t.range,{formats:{displayWeekday:!0}});return{id:t.id,name:`${n}${i} - ${e.name}`,startTime:t.range.start.toMillis()}}),e=>e.startTime);return(0,i.jsx)("optgroup",{label:e.name,children:t.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},e.id)}),[A]),E=(0,L.useMemo)(()=>(0,uc.A)(n.organization?.tags.nodes??[],e=>u(e.name)).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id)),[n.organization]);return(0,i.jsx)(Ba,{css:{background:"$gray50",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",padding:"$4 $6"},direction:"column",children:s||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ar,{font:"gray800 textSm semiBold",children:t("pr_f_rences_d_a_19371")}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:"hidden"===r?"checked":"unchecked",onClick:t=>{"checked"===t&&(a("hidden"),e.change("form.displayedPositionsCategoriesIds",[]),e.change("form.displayedPositionsIds",[]),e.change("form.displayedPositionsSlotsIds",[]),e.change("form.displayedPositionsTagsIds",[]))},children:t("cacher_des_cat_31908")}),(0,i.jsx)(Ya,{height:"3"}),"hidden"===r&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ba,{css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",padding:"$4 $6"},direction:"column",children:[(0,i.jsx)(_c,{state:l,onClick:t=>{d(t),"unchecked"===t&&e.change("form.hiddenPositionsCategoriesIds",[])},children:t("cacher_certaine_12220")}),"checked"===l&&(0,i.jsxs)(Ba,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(Ym,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.hiddenPositionsCategoriesIds",children:A.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})]}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(_c,{state:c,onClick:t=>{h(t),"unchecked"===t&&e.change("form.hiddenPositionsIds",[])},children:t("cacher_certaine_19933")}),"checked"===c&&(0,i.jsxs)(Ba,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(Ym,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.hiddenPositionsIds",children:w})]}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(_c,{state:g,onClick:t=>{p(t),"unchecked"===t&&e.change("form.hiddenPositionsSlotsIds",[])},children:t("cacher_certains_02997")}),"checked"===g&&(0,i.jsxs)(Ba,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(Ym,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.hiddenPositionsSlotsIds",children:S})]}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(_c,{state:f,onClick:t=>{_(t),"unchecked"===t&&e.change("form.hiddenPositionsTagsIds",[])},children:t("cacher_certains_66424")}),"checked"===f&&(0,i.jsxs)(Ba,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(Ym,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.hiddenPositionsTagsIds",children:E})]})]}),(0,i.jsx)(Ya,{height:"5"})]}),(0,i.jsx)(vc,{state:"displayed"===r?"checked":"unchecked",onClick:t=>{a("displayed"),"checked"===t&&(e.change("form.hiddenPositionsCategoriesIds",[]),e.change("form.hiddenPositionsIds",[]),e.change("form.hiddenPositionsSlotsIds",[]),e.change("form.hiddenPositionsTagsIds",[]))},children:t("afficher_des_ca_37473")}),(0,i.jsx)(Ya,{height:"3"}),"displayed"===r&&(0,i.jsxs)(Ba,{css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",padding:"$4 $6"},direction:"column",children:[(0,i.jsx)(_c,{state:x,onClick:t=>{I(t),"unchecked"===t&&e.change("form.displayedPositionsCategoriesIds",[])},children:t("afficher_certai_88457")}),"checked"===x&&(0,i.jsxs)(Ba,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(Ym,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.displayedPositionsCategoriesIds",children:A.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})]}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(_c,{state:v,onClick:t=>{b(t),"unchecked"===t&&e.change("form.displayedPositionsIds",[])},children:t("affficher_certa_32341")}),"checked"===v&&(0,i.jsxs)(Ba,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(Ym,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.displayedPositionsIds",children:w})]}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(_c,{state:j,onClick:t=>{C(t),"unchecked"===t&&e.change("form.displayedPositionsSlotsIds",[])},children:t("afficher_certai_38724")}),"checked"===j&&(0,i.jsxs)(Ba,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(Ym,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.displayedPositionsSlotsIds",children:S})]}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(_c,{state:y,onClick:t=>{k(t),"unchecked"===t&&e.change("form.displayedPositionsTagsIds",[])},children:t("afficher_certai_47793")}),"checked"===y&&(0,i.jsxs)(Ba,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(Ym,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.displayedPositionsTagsIds",children:E})]})]})]})})},bU=e=>{const t=Xn(),[n,s]=(0,L.useState)(so(e.values.form.hiddenPositionsCategoriesIds)||so(e.values.form.hiddenPositionsIds)||so(e.values.form.hiddenPositionsSlotsIds)||so(e.values.form.hiddenPositionsTagsIds)||so(e.values.form.displayedPositionsCategoriesIds)||so(e.values.form.displayedPositionsIds)||so(e.values.form.displayedPositionsSlotsIds)||so(e.values.form.displayedPositionsTagsIds));return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ku,{value:n,onChange:t=>{s(t),t||(e.change("form.hiddenPositionsCategoriesIds",[]),e.change("form.hiddenPositionsIds",[]),e.change("form.hiddenPositionsSlotsIds",[]),e.change("form.hiddenPositionsTagsIds",[]),e.change("form.displayedPositionsCategoriesIds",[]),e.change("form.displayedPositionsIds",[]),e.change("form.displayedPositionsSlotsIds",[]),e.change("form.displayedPositionsTagsIds",[]))},children:t("afficher_masq_74825")}),n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(vU,{change:e.change,eventId:e.eventId,organizationId:e.organizationId,values:e.values})]})]})},jU=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=vl(),{isNotSavedModalOpen:o,onClose:r,onNotSavedClose:a,onSave:l}=EE(e.initialValues,e.values,e.handleSubmit),d=e.slotDisplay!==It.Hide&&e.values.form.positionDisplay!==_t.None;return(0,i.jsx)(XS,{button:(0,i.jsx)(zl,{isLoading:e.isMutateLoading,onClick:l,children:t("enregistrer_06519")}),title:e.name,onClose:r,children:(0,i.jsx)(SE,{isNotSavedOpen:o,onNotSavedClose:a,children:e.loader||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ar,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("param_tres_des_93365")}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ar,{color:"gray500",children:t("d_cider_du_type_01830")}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsxs)(Ba,{gap:"8",children:[(0,i.jsx)(IU,{isSelected:e.values.form.positionRanking===Ke.Unranked,name:t("choix_illimit_s_72460"),src:fd.FormPositionUnranked,onSelect:()=>{e.change("form.positionRanking",Ke.Unranked)}}),(0,i.jsx)(IU,{isSelected:e.values.form.positionRanking===Ke.Ranked,name:t("classement_des_43897"),src:fd.FormPositionRanked,onSelect:()=>{e.change("form.positionRanking",Ke.Ranked),e.values.form.positionDisplay!==_t.None&&e.values.form.positionDisplay!==_t.Slot||e.change("form.positionDisplay",_t.Position)}})]}),e.values.form.positionRanking===Ke.Ranked&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(Vl,{label:t("nombre_de_choix_19811"),name:"form.positionLimit",shouldParseAsInt:!0})]}),(0,i.jsx)(Ju,{height:"6"}),(0,i.jsx)(Ar,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("affichage_des_m_65982")}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ar,{color:"gray500",children:t("personnaliser_l_26207")}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(Ar,{color:"gray800",fontWeight:"medium",children:t("comment_souhait_23788")}),(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(ub,{name:"form.positionDisplay",value:_t.Category,children:t("afficher_les_ca_26287")}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(ub,{name:"form.positionDisplay",value:_t.Position,children:t("afficher_les_mi_31841")}),e.values.form.positionRanking===Ke.Unranked&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(ub,{name:"form.positionDisplay",value:_t.Slot,children:t("afficher_les_cr_32311")}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(ub,{name:"form.positionDisplay",value:_t.None,children:t("ne_rien_affiche_81467")})]}),e.values.form.positionDisplay!==_t.None&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(Ar,{color:"gray800",fontWeight:"medium",children:t("personnalisatio_94071")}),(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(Jm,{name:"form.showFullPosition",children:t("afficher_les_mi_35510")}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(bU,{change:e.change,eventId:s,organizationId:n,values:e.values}),e.values.form.positionRanking!==Ke.Ranked&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(Ar,{color:"gray800",fontWeight:"medium",children:t("affichage_des_d_57491")}),(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(Gm,{name:"form.showPositionCategoryDescription",children:t("afficher_la_des_67852")}),e.values.form.positionDisplay!==_t.Category&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(Gm,{name:"form.showPositionDescription",children:t("afficher_la_des_21998")})]})]}),(0,i.jsx)(Ju,{height:"6"}),(0,i.jsx)(Ar,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("automatisation_49411")}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ar,{color:"gray500",children:t("d_cider_si_l_af_60345")}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(Jm,{name:"form.willAutoAssign",children:e.values.form.positionDisplay===_t.Category?t("la_pr_affectat_61978"):e.values.form.positionDisplay===_t.Position?t("la_pr_affectat_20431"):t("l_affectation_s_68435")})]}),d&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ju,{height:"6"}),(0,i.jsx)(Ar,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("filtrer_les_cat_63783")}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ar,{color:"gray500",children:t("d_cider_si_le_c_98644")}),(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(ub,{name:"form.positionFilter",value:xt.FilterWithSlots,children:t("filtrer_les_cat_52780")}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(ub,{name:"form.positionFilter",value:xt.None,children:t("ne_pas_filtrer_73952")})]}),e.values.form.positionDisplay!==_t.None&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ju,{height:"6"}),(0,i.jsx)(Ar,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("personnalisatio_15893")}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ar,{color:"gray500",children:t("personnaliser_l_44808")}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(Vl,{label:t("nom_de_l_tape_85862"),name:"form.positionTitle"}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(rb,{label:t("description_58935"),name:"form.positionSubtitle"})]})]})})})},CU=()=>{const{params:{organizationId:e,eventId:t,formId:n}}=vl(),{data:s,loader:o}=Qn("query FormParametersMissions($organizationId: OrganizationId!, $formId: FormId!) {\n organization(id: $organizationId) {\n form(id: $formId) {\n name\n slotDisplay\n positionDisplay\n positionFilter\n positionRanking\n positionLimit\n hiddenPositionsCategoriesIds\n hiddenPositionsIds\n hiddenPositionsSlotsIds\n hiddenPositionsTagsIds\n displayedPositionsCategoriesIds\n displayedPositionsIds\n displayedPositionsSlotsIds\n displayedPositionsTagsIds\n showFullPosition\n showPositionCategoryDescription\n showPositionDescription\n positionTitle\n positionSubtitle\n willAutoAssign\n }\n }\n}\n",{organizationId:e,formId:n},[]);Md(s.organization?.form.name??"");const r=Zn(Ua),a=Zn(xU),{mutate:l,isLoading:d}=function(e={}){return ei("mutation FormParametersMissionsUpdate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $formId: FormId!\n $form: FormParametersMissionsInput!\n) {\n formParametersMissionsUpdate(\n organizationId: $organizationId\n eventId: $eventId\n formId: $formId\n form: $form\n ) {\n id\n }\n}\n",e)}(),c=L.useMemo(()=>({form:a.formParametersMissionsInputDefault(s.organization?.form)}),[s.organization]);return(0,i.jsx)(kl,{direction:"column",height:1,initialValues:c,render:({form:e,handleSubmit:t,values:n})=>(0,i.jsx)(jU,{change:e.change,handleSubmit:t,initialValues:c,isMutateLoading:d,loader:o,name:s.organization?.form.name??"",slotDisplay:s.organization?.form.slotDisplay??It.Hide,values:n}),validate:r.validateForForm(a.updateFormParametersMissionsSchema()),width:1,onSubmit:i=>l({organizationId:e,eventId:t,formId:n,form:i.form})})},yU=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=vl(),{hasFeature:o}=TI(),{user:r}=ai(),a=t=>fg({organizationId:n,eventId:s,lang:r?.language,pathComponent:t,key:e.eventKey});return(0,i.jsxs)(Ba,{direction:"column",width:1,children:[(0,i.jsx)(Ar,{color:"gray900",fontSize:"textLg",fontWeight:"medium",children:t("liste_des_api_d_94349")}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(xD,{hint:t("param_tres_disp_37413"),link:a("assignments"),title:t("api_pour_les_af_45788")}),(0,i.jsx)(Ya,{height:"6"}),o(Be.Accreditation)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(xD,{hint:t("param_tres_disp_76489"),link:a("accreditations"),title:t("api_pour_les_ac_97802")}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(xD,{hint:t("param_tres_disp_49170"),link:a("accreditations-matrix"),title:t("api_pour_les_ac_69006")}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(xD,{hint:t("param_tres_disp_45950"),link:a("accreditations-slots"),title:t("api_pour_les_cr_99061")}),(0,i.jsx)(Ya,{height:"6"})]}),(0,i.jsx)(xD,{hint:t("param_tres_disp_45950"),link:a("positions"),title:t("api_pour_la_lis_89027")}),(0,i.jsx)(Ya,{height:"6"}),o(Be.Delegation)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(xD,{hint:t("param_tres_disp_83198"),link:a("delegations-matrix"),title:t("api_pour_les_d_32713")}),(0,i.jsx)(Ya,{height:"6"})]}),(0,i.jsx)(xD,{link:`=IMPORTDATA("${a("assignments")}")`,title:t("import_des_affe_58949")}),(0,i.jsx)(Ya,{height:"6"}),o(Be.Accreditation)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(xD,{link:`=IMPORTDATA("${a("accreditations")}")`,title:t("import_des_accr_52173")}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(xD,{link:`=IMPORTDATA("${a("accreditations-matrix")}")`,title:t("import_des_accr_49559")}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(xD,{link:`=IMPORTDATA("${a("accreditations-slots")}")`,title:t("import_des_cr_n_78532")}),(0,i.jsx)(Ya,{height:"6"})]}),(0,i.jsx)(xD,{link:`=IMPORTDATA("${a("positions")}")`,title:t("import_de_la_li_00747")}),(0,i.jsx)(Ya,{height:"6"}),o(Be.Delegation)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(xD,{link:`=IMPORTDATA("${a("delegations-matrix")}")`,title:t("api_pour_les_d_32713")}),(0,i.jsx)(Ya,{height:"6"})]}),(0,i.jsx)(Ya,{height:"1"})]})},kU=()=>{const{translate:e,params:{eventId:t}}=vl(),{event:{name:n}}=wb();Md(`${n} API`);const{hasFeature:s}=TI(),{data:o,loader:r}=Qn("query EventKey($eventId: EventId!) {\n event(id: $eventId) {\n key\n }\n}\n",{eventId:t},[]);return r||(0,i.jsxs)(dj,{children:[(0,i.jsx)(lj,{children:(0,i.jsx)(Ar,{font:"gray900 displayXs medium",children:"API"})}),(0,i.jsxs)(aj,{children:[(0,i.jsx)(rl,{leftIcon:"circle-exclamation",children:e("l_api_permet_de_66672",Cd)}),(0,i.jsx)(Ya,{height:"7"}),s(Be.Api)?(0,i.jsx)(yU,{eventKey:o.event.key}):(0,i.jsx)(Ba,{align:"center",css:{flex:"1"},height:1,justify:"center",width:1,children:(0,i.jsx)(zI,{icon:"code-branch"})})]})]})},AU=[Ve.Eid,Ve.FirstName,Ve.LastName,Ve.Picture,Ve.Population],wU=()=>{const{translate:e,params:{organizationId:t,eventId:n}}=vl(),{event:s}=wb();Md(`${s.name} Weezevent`);const{data:o}=Qn("query WeezeventV2Infos($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n customFields(privacy: All, variety: UserInfo) {\n nodes {\n slug\n name\n }\n }\n\n weezaccessEvents {\n id\n name\n }\n }\n\n event(id: $eventId) {\n weezevent\n\n accreditationsCategories {\n id\n name\n\n accreditations {\n id\n name\n }\n }\n\n segmentsFolders(segmentType: Volunteers) {\n id\n name\n\n segments {\n id\n name\n }\n }\n }\n}\n",{organizationId:t,eventId:n},[]),{mutate:r}=function(e={}){return ei("mutation EventWeezeventUpdate($eventId: EventId!, $weezevent: EventWeezeventInput!) {\n eventWeezeventUpdate(eventId: $eventId, weezevent: $weezevent) {\n id\n }\n}\n",e)}(),a=(0,L.useMemo)(()=>(0,uc.A)(o.organization?.customFields.nodes??[],e=>u(e.name)).filter(e=>!AU.includes(e.slug)).map(e=>(0,i.jsx)("option",{value:e.slug,children:e.name},e.slug)),[o]),l=(0,L.useMemo)(()=>(o.event?.segmentsFolders??[]).map(e=>(0,i.jsx)("optgroup",{label:e.name,children:e.segments.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},e.id)),[o]),d=(0,L.useMemo)(()=>(0,uc.A)(o.event?.accreditationsCategories??[],e=>u(e.name)).map(e=>(0,i.jsx)("optgroup",{label:e.name,children:(0,uc.A)(e.accreditations,e=>u(e.name)).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},e.id)),[o]),c=(0,L.useMemo)(()=>(0,uc.A)(o.organization?.weezaccessEvents??[],e=>u(e.name)).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id)),[o]);return(0,i.jsxs)(dj,{children:[(0,i.jsx)(lj,{children:(0,i.jsx)(Ar,{font:"gray900 displayXs medium",children:"Weezevent"})}),(0,i.jsx)(aj,{children:(0,i.jsx)(kl,{initialValues:{accreditationsIds:o.event?.weezevent?.accreditationsIds||[],customFieldsSlugs:o.event?.weezevent?.customFieldsSlugs||[],segmentsIds:o.event?.weezevent?.segmentsIds||[],weezaccessEventId:o.event?.weezevent?.weezaccessEventId??null},render:({handleSubmit:t,submitting:n})=>(0,i.jsxs)(Ba,{direction:"column",gap:"6",width:1,children:[(0,i.jsx)(Ym,{isSearchVisible:!0,label:e("liste_des_champ_73852"),multiple:!0,name:"customFieldsSlugs",children:a}),(0,i.jsx)(Ym,{isSearchVisible:!0,label:e("liste_des_vues_82829"),multiple:!0,name:"segmentsIds",children:l}),(0,i.jsx)(Ym,{hint:e("toutes_les_accr_55233"),isSearchVisible:!0,label:e("liste_des_accr_50214"),multiple:!0,name:"accreditationsIds",children:d}),(0,i.jsx)(Ym,{isSearchVisible:!0,label:e("id_de_l_v_neme_87336"),name:"weezaccessEventId",children:c}),(0,i.jsx)(Kb,{rolesTypes:jI,children:(0,i.jsx)(Ba,{children:(0,i.jsx)(zl,{isLoading:n,onClick:t,children:e("enregistrer_06519")})})})]}),onSubmit:e=>r({eventId:n,weezevent:e})})})]})};let SU=class{positionsCustomFieldInputSchema(){return d.Ik().shape({customFieldId:d.ai().required(),conditionValue:d.gl().required()})}};SU=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)()],SU);let EU=class extends Gl{constructor(e){super(e)}positionsSlotInputDefault(e,t){return{id:t?.id,name:t?.name??"",startDate:t?.startDate??e,startTime:t?.startTime??e.toFormat("HH:mm"),endDate:t?.endDate??e,endTime:t?.endTime??e.plus({hour:1}).toFormat("HH:mm"),resources:t?.resources??1,assignedResources:t?.assignedResources}}createPositionSlotSchema(){return d.Ik().shape({slot:this.positionsSlotInputSchema()})}positionsSlotInputSchema(){return d.Ik().shape({name:d.Yj(),startDate:Qm.required(this.t("la_date_de_d_bu_05030")).typeError(this.t("la_date_de_d_bu_05030")),startTime:d.Yj().required(this.t("heure_de_d_but_90785")),endDate:Qm.required(this.t("la_date_de_fin_32246")).typeError(this.t("la_date_de_fin_32246")).test("after-start-date",this.t("la_date_de_fin_00429"),(e,t)=>Gs.c9.isDateTime(t.parent.startDate)&&t.parent.startDate.isValid&&Gs.c9.isDateTime(t.parent.endDate)&&t.parent.endDate.isValid&&t.parent.endDate>=t.parent.startDate),endTime:d.Yj().required(this.t("l_heure_de_fin_78626")).test("after-start-time",this.t("la_date_de_fin_00429"),(e,t)=>{const n=Gs.c9.isDateTime(t.parent.startDate)&&t.parent.startDate.isValid,i=bh(t.parent.startTime),s=Gs.c9.isDateTime(t.parent.endDate)&&t.parent.endDate.isValid,o=bh(t.parent.endTime);if(n&&i&&s&&o){const[e,n]=jh(t.parent.startTime),[i,s]=jh(t.parent.endTime);return t.parent.startDate.set({hours:e,minutes:n})=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[qn])],EU);let TU=class extends Gl{positionsCustomFieldInputService;positionsSlotInputService;constructor(e,t,n){super(n),this.positionsCustomFieldInputService=e,this.positionsSlotInputService=t}positionInputDefault(e,{positionCategoryId:t,layer:n,latitude:i,longitude:s,startAt:o}){let r=e?.category.id??t;return Number.isInteger(r)||(r=null),{name:e?.name??"",positionCategoryId:r,description:e?.description??"",acronym:e?.acronym??"",color:e?.color??xr.colors.primary500.value,icon:e?.icon??Xe.LocationDot,privateNote:e?.privateNote??"",address:e?.address??null,latitude:e?.latitude??i??null,longitude:e?.longitude??s??null,zoom:e?.zoom??$r,layer:e?.layer??n,tracesIds:e?.tracesIds??[],slots:e?.slots??[this.positionsSlotInputService.positionsSlotInputDefault(o)],conditionsOperator:e?.conditionsOperator??_e.And,positionsCustomFields:e?.positionsCustomFields??[],tagsIds:e?.tagsIds??[],fields:e?.fields??{},leadersIds:e?.fields??[]}}createUpdatePositionSchema(){return d.Ik().shape({position:this.positionInputSchema()})}positionInputSchema(){return d.Ik().shape({name:d.Yj().required(this.t("le_nom_de_la_mi_74207")),positionCategoryId:d.ai().required(this.t("la_cat_gorie_es_14008")).typeError(this.t("la_cat_gorie_es_14008")).min(1,this.t("la_cat_gorie_es_14008")),acronym:d.Yj(),color:d.Yj().required(this.t("la_couleur_est_95740")),icon:d.Yj().required(this.t("l_ic_ne_est_req_15843")).oneOf(xn,this.t("l_ic_ne_est_req_15843")),description:d.Yj(),privateNote:d.Yj(),address:d.Yj().nullable(),latitude:d.ai().nullable().typeError(this.t("la_latitude_doi_43118")),longitude:d.ai().nullable().typeError(this.t("la_longitude_do_35170")),traces:d.YO().of(d.ai()),slots:d.YO().of(this.positionsSlotInputService.positionsSlotInputSchema()).required(this.t("vous_devez_avoi_26563")).min(1,this.t("vous_devez_avoi_26563")),positionsCustomFields:d.YO().of(this.positionsCustomFieldInputService.positionsCustomFieldInputSchema()),tagsIds:d.YO().of(d.ai())})}};TU=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[SU,EU,qn])],TU);const zU=e=>{const{mutate:t}=function(e={}){return ei("mutation PositionCategoryCreate($eventId: EventId!, $positionCategory: PositionsCategoryInput!) {\n positionCategoryCreate(eventId: $eventId, positionCategory: $positionCategory) {\n id\n name\n }\n}\n",e)}();return(0,i.jsx)(ny,{initialName:"",isEdit:!1,mutate:async n=>{const{positionCategoryCreate:i}=await t({eventId:e.eventId,positionCategory:{name:n}});return i},onClose:e.onClose,onSuccess:e.onSuccess})},OU=e=>{const{mutate:t}=function(e={}){return ei("mutation PositionCategoryUpdate(\n $eventId: EventId!\n $positionCategoryId: PositionsCategoryId!\n $positionCategory: PositionsCategoryInput!\n) {\n positionCategoryUpdate(\n eventId: $eventId\n positionCategoryId: $positionCategoryId\n positionCategory: $positionCategory\n ) {\n id\n name\n }\n}\n",e)}();return(0,i.jsx)(ny,{initialName:e.positionCategoryName,isEdit:!0,mutate:async n=>{const{positionCategoryUpdate:i}=await t({eventId:e.eventId,positionCategoryId:e.positionCategoryId,positionCategory:{name:n}});return i},onClose:e.onClose,onSuccess:e.onSuccess})},RU=(0,L.memo)(function(e){const{params:{eventId:t},translate:n}=vl(),[s,o]=(0,L.useState)(ty(e.event.positionsCategories)),{isEventAdmin:r}=wb(),[a,l]=(0,L.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Vl,{label:n("nom_de_la_missi_64605"),name:"position.name"}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsxs)(Ba,{gap:"4",children:[(0,i.jsx)(Ym,{createText:n("cr_er_une_nouve_72722"),isCreateVisible:r,isSearchVisible:!0,label:n("cat_gorie_00291"),name:"position.positionCategoryId",placeholder:n("rechercher_ou_c_16469"),onCreateClick:()=>{l(!0)},children:s.map(({id:e,name:t})=>(0,i.jsx)("option",{value:e,children:t},e))}),(0,i.jsx)(Vl,{label:(0,i.jsx)(Zv,{children:n("Acronym")}),name:"position.acronym"})]}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsxs)(Ba,{gap:"4",children:[(0,i.jsx)(qj,{label:n("Color"),name:"position.color"}),(0,i.jsx)(Jj,{label:n("ic_ne_55554"),name:"position.icon"})]}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(rb,{label:(0,i.jsx)(Zv,{children:n("description_58935")}),name:"position.description"}),a&&(0,i.jsx)(zU,{eventId:t,onClose:()=>{l(!1)},onSuccess:t=>{o(ty([...s,t])),e.change("position.positionCategoryId",t.id)}})]})}),$U=()=>{const e=Xn();return(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(rb,{label:(0,i.jsx)(Zv,{children:e("note_priv_e_06303")}),name:"position.privateNote"})})},DU=e=>{const t=Xn(),n=Zn(EU);return(0,i.jsx)(oC,{buttonText:t("mettre_jour_l_76289"),icon:"sliders",initialValues:{slot:e.slot},schema:n.createPositionSlotSchema(),size:"md",subtitle:t("param_trer_les_00874"),title:t("mise_jour_d_u_86656"),onClose:e.onClose,onSubmit:async t=>{await e.onSuccess((0,Er.A)(t.slot,["id","name","startDate","startTime","endDate","endTime","resources"])),e.onClose()},children:({form:n,values:s})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Nr.Yr,{name:"slot.startDate",children:e=>{e>s.slot.endDate&&n.change("slot.endDate",e)}}),(0,i.jsxs)(Ba,{css:{flex:"1",overflowY:"auto"},direction:"column",width:1,children:[(0,i.jsx)(Vl,{hint:t("vous_pouvez_per_94218"),label:(0,i.jsx)(Zv,{children:t("nom_du_cr_neau_54351")}),name:"slot.name"}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsxs)(Ba,{gap:"4",children:[(0,i.jsx)(Hm,{label:t("date_de_d_but_43380"),max:e.event.endAt,min:e.event.startAt,name:"slot.startDate"}),(0,i.jsx)(lb,{label:t("horaire_de_d_bu_02380"),name:"slot.startTime"})]}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsxs)(Ba,{gap:"4",children:[(0,i.jsx)(Hm,{label:t("date_de_fin_86920"),max:e.event.endAt,min:e.event.startAt,name:"slot.endDate"}),(0,i.jsx)(lb,{label:t("horaire_de_fin_10624"),name:"slot.endTime"})]}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(Vl,{label:t("nombre_de_membr_08851"),name:"slot.resources",shouldParseAsInt:!0})]})]})})},PU=e=>{const t=Xn(),n=Zn(Jc),s=(0,L.useMemo)(()=>m(e.slot.name)?e.slot.name:t("cr_neau_n_1_80362",e.index+1),[e.slot.name,e.index]),o=(0,L.useMemo)(()=>{const i=n.toLocaleString(e.slot.startDate,eo.DateOnly.WeekdayLongMonthLong),s=n.toLocaleString(e.slot.endDate,eo.DateOnly.WeekdayLongMonthLong);return`${i} ${e.slot.startTime.substring(0,5)} - ${s} ${e.slot.endTime.substring(0,5)} - ${t("_1_membre_49737",e.slot.resources)}`},[e.slot.startDate,e.slot.startTime,e.slot.endDate,e.slot.endTime,e.slot.resources]),[r,a]=(0,L.useState)(e.initialIsEditOpen),[l,d]=(0,L.useState)(!1),c=(e.slot.assignedResources??0)>0;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ba,{align:"center",css:{background:"white",bd:!0,padding:"$3 $4"},gap:"2",children:[(0,i.jsxs)(Ba,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(Ar,{font:"gray800 textSm semiBold",children:s}),(0,i.jsx)(Ar,{color:"gray500",children:o})]}),(0,i.jsxs)(km,{children:[(0,i.jsx)(Sm,{children:(0,i.jsx)(Ar,{children:(0,i.jsx)(zl,{color:"white",leftIcon:"pen",size:"sm",onClick:()=>{a(!0)}})})}),(0,i.jsx)(wm,{placement:"top",children:t("_diter_62574")})]}),(0,i.jsxs)(km,{children:[(0,i.jsx)(Sm,{children:(0,i.jsx)(Ar,{children:(0,i.jsx)(zl,{color:"white",leftIcon:"arrows-repeat",size:"sm",onClick:()=>{d(!0)}})})}),(0,i.jsx)(wm,{placement:"top",children:t("r_p_ter_le_cr_n_68038")})]}),(0,i.jsxs)(km,{children:[(0,i.jsx)(Sm,{children:(0,i.jsx)(Ar,{children:(0,i.jsx)(zl,{color:"white",disabled:c,leftIcon:"trash-can",size:"sm",onClick:()=>{e.remove(e.index)}})})}),(0,i.jsx)(wm,{placement:"top",children:t(c?"des_membres_son_92320":"supprimer_43083")})]})]}),r&&(0,i.jsx)(DU,{event:e.event,slot:e.slot,onClose:()=>{a(!1)},onSuccess:async t=>{e.updateSlots(t,e.index)}}),l&&(0,i.jsx)(eF,{showHours:!0,onClose:()=>{d(!1)},onSubmit:(t,n)=>{e.onRepeat(e.slot,t,n)}})]})},FU=e=>{const t=Zn(EU),[n,s]=(0,L.useState)(-1),o=(0,L.useCallback)((t,n)=>{const i=[...e.values.position.slots];i[n]=t,e.change("position.slots",i)},[e.values.position.slots,e.change]),r=(0,L.useCallback)((e,t,n)=>Zs(e).overlaps(n),[]),a=(0,L.useCallback)(()=>{e.change("position.slots",e.values.position.slots.concat([t.positionsSlotInputDefault(e.event.startAt)])),s(e.values.position.slots.length)},[e.values.position.slots,e.change]),l=(0,L.useCallback)((t,n,i)=>{const s=function(e,t,n){const i=jh(e.startTime);let s=e.startDate;i&&(s=s.set({hour:i[0],minute:i[1]}));const o=jh(e.endTime);let r=e.endDate;return o&&(r=r.set({hour:o[0],minute:o[1]})),(0,Dc.A)(1,t+1).map(t=>{if("hour"===n){const n=s.plus({hour:t}),i=r.plus({hour:t});return{name:e.name,startDate:n,startTime:n.toFormat("HH:mm"),endDate:i,endTime:i.toFormat("HH:mm"),resources:e.resources}}if("day"===n){const n=s.plus({day:t}),i=r.plus({day:t});return{name:e.name,startDate:n,startTime:n.toFormat("HH:mm"),endDate:i,endTime:i.toFormat("HH:mm"),resources:e.resources}}if("week"===n){const n=s.plus({week:t}),i=r.plus({week:t});return{name:e.name,startDate:n,startTime:n.toFormat("HH:mm"),endDate:i,endTime:i.toFormat("HH:mm"),resources:e.resources}}throw new Error("Wrong unit")})}(t,n,i);e.change("position.slots",e.values.position.slots.concat(s))},[e.values.position.slots,e.change]),d=(0,L.useCallback)(t=>{e.change("position.slots",co(e.values.position.slots,t))},[e.values.position.slots,e.change]);return(0,i.jsx)(QP,{event:e.event,matchDateFilter:r,renderSlot:t=>(0,i.jsx)(PU,{event:e.event,index:t.index,initialIsEditOpen:t.index===n,remove:d,slot:t,updateSlots:o,onRepeat:l},t.index),slots:e.values.position.slots,onNewSlot:a})},MU=e=>{const{history:t,translate:n,params:{organizationId:s,eventId:o}}=vl(),{showNotification:r}=Ob(),a=Zn(TU),l=Zn(Ua),d=(0,L.useRef)(null),c=(0,L.useMemo)(()=>e.isEdit?n("mise_jour_de_17055",e.initialValues.position.name):n("cr_ation_d_une_10675"),[e.isEdit,e.initialValues]);Md(c);const u=(0,L.useMemo)(()=>so(e.initialValues.position.tracesIds)||m(e.initialValues.position.address)||"number"==typeof e.initialValues.position.latitude||"number"==typeof e.initialValues.position.longitude,[e.isEdit,e.initialValues]),h=(0,L.useMemo)(()=>!!e.isEdit&&so(e.initialValues.position.positionsCustomFields),[e.isEdit,e.initialValues]),g=(0,L.useMemo)(()=>!!e.isEdit&&so(Object.keys(e.initialValues.position.fields)),[e.isEdit,e.initialValues]),p=(0,L.useMemo)(()=>!!e.isEdit&&m(e.initialValues.position.privateNote),[e.isEdit,e.initialValues]),f=(0,L.useMemo)(()=>!!e.isEdit&&so(e.initialValues.position.tagsIds),[e.isEdit,e.initialValues]);return(0,i.jsx)(kl,{customErrorRef:d,height:1,initialValues:e.initialValues,render:({form:t,handleSubmit:r,submitting:a,values:l})=>(0,i.jsx)(Lm,{button:e.isEdit&&(0,i.jsx)(zl,{isLoading:a,onClick:r,children:n("mettre_jour_l_19061")}),category:c,color:"dark",fallbackClosePath:xs.POSITIONS({organizationId:s,eventId:o}),heading:e.isEdit?e.initialValues.position.name:n("nouvelle_missio_60727"),children:(0,i.jsxs)(Mm,{ref:d,children:[(0,i.jsx)(jl,{}),(0,i.jsx)(Vm,{hideToggle:!0,initialIsOpen:!0,heading:n("informations_su_61022"),children:(0,i.jsx)(RU,{change:t.change,event:e.event})}),(0,i.jsx)(Ya,{height:"5"}),(0,i.jsx)(Vm,{hideToggle:!0,initialIsOpen:!0,subtitle:n("ajouter_les_dif_22779"),heading:n("cr_neaux_horair_62996"),children:(0,i.jsx)(FU,{change:t.change,event:e.event,values:l})}),(0,i.jsx)(Ya,{height:"5"}),(0,i.jsx)(Vm,{initialIsOpen:u,subtitle:n("localiser_le_li_46319"),heading:n("localisation_38416"),onToggle:n=>{n||(t.change("position.layer",e.event.layer),t.change("position.zoom",$r),t.change("position.tracesIds",[]),t.change("position.address",null),t.change("position.latitude",null),t.change("position.longitude",null))},children:(0,i.jsx)(oF,{center:e.event,layer:l.position.layer,name:"position.",point:l.position,traces:e.event.traces,tracesIds:l.position.tracesIds})}),(0,i.jsx)(Ya,{height:"5"}),(0,i.jsx)(Vm,{initialIsOpen:h,subtitle:n("ajouter_des_con_75357"),heading:n("conditions_77756"),onToggle:e=>{e||t.change("position.positionsCustomFields",[])},children:(0,i.jsx)(KP,{change:t.change,conditionsOperator:l.position.conditionsOperator,customFields:e.conditionsCustomFields,customFieldsValues:l.position.positionsCustomFields,name:"position.positionsCustomFields",prefix:"position."})}),(0,i.jsx)(Ya,{height:"5"}),(0,i.jsx)(Vm,{initialIsOpen:g,subtitle:n("ajouter_des_inf_14340"),heading:n("champs_de_formu_64126"),onToggle:e=>{e||t.change("position.fields",{})},children:(0,i.jsx)(dP,{change:t.change,customFields:e.positionCustomFields,formCustomFields:[],formCustomFieldsValues:[],prefix:"position.",showFormCustomFields:!1})}),(0,i.jsx)(Ya,{height:"5"}),(0,i.jsx)(Vm,{initialIsOpen:p,subtitle:n("ajouter_une_not_81707"),heading:n("note_priv_e_06303"),onToggle:e=>{e||t.change("position.privateNote","")},children:(0,i.jsx)($U,{})}),(0,i.jsx)(Ya,{height:"5"}),(0,i.jsx)(Vm,{initialIsOpen:f,subtitle:n("ajouter_des_tag_64526"),heading:n("tags_79499"),onToggle:e=>{e||t.change("position.tagsIds",[])},children:(0,i.jsx)(aC,{change:t.change,name:"position.",organizationId:s,tags:e.tags,tagsIds:l.position.tagsIds})}),(0,i.jsx)(Ya,{height:"5"}),(0,i.jsx)(Bm,{children:(0,i.jsx)(zl,{isLoading:a,textAlign:"center",onClick:r,children:e.isEdit?n("mettre_jour_l_19061"):n("cr_er_la_missio_82644")})})]})}),validate:l.validateForForm(a.createUpdatePositionSchema()),width:1,onSubmit:async i=>{const a=await e.mutate({eventId:o,position:{...i.position,slots:i.position.slots.map(e=>(0,ur.A)(e,["index"]))}});r(e.isEdit?n("la_mission_a_t_79916"):n("la_mission_a_t_14808")),e.isEdit?t.goBack(xs.POSITION({organizationId:s,eventId:o,positionId:a})):t.replace(xs.POSITION({organizationId:s,eventId:o,positionId:a}))}})},NU=()=>{const e=Zn(TU),{organizationId:t,eventId:n,options:s}=ti(),{data:o,loader:r}=Qn("query PositionEventInfos($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n ...ConditionsCustomFields\n ...CreatePositionTags\n\n positionCustomFields: customFields(variety: Position, privacy: All) {\n nodes {\n ...AttachCustomField\n }\n }\n }\n\n event(id: $eventId) {\n ...CreatePositionEvent\n }\n}\n",{organizationId:t,eventId:n},[Vs.ConditionsCustomFieldsFragment,Vs.CreatePositionTagsFragment,Vs.AttachCustomFieldFragment,Vs.CreatePositionEventFragment]),{mutate:a}=function(e={}){return ei("mutation PositionCreate($eventId: EventId!, $position: PositionInput!) {\n positionCreate(eventId: $eventId, position: $position) {\n id\n }\n}\n",e)}({redirectOnSuccess:!0}),{positionCategoryId:l,latitude:d,longitude:c}=(e=>{const[t,n]=(e??"").split(",");return m(t)&&m(n)?{latitude:parseFloat(t),longitude:parseFloat(n)}:m(e)?{positionCategoryId:parseInt(e,10)}:{}})(s);return r||(0,i.jsx)(MU,{conditionsCustomFields:o.organization.conditionsCustomFields.nodes,event:o.event,initialValues:{position:e.positionInputDefault(null,{layer:o.event.layer,startAt:o.event.startAt,positionCategoryId:l,latitude:d,longitude:c})},isEdit:!1,mutate:async e=>{const{positionCreate:{id:t}}=await a(e);return t},positionCustomFields:o.organization.positionCustomFields.nodes,tags:o.organization.tags.nodes})},LU=()=>{const{organizationId:e,eventId:t,positionId:n}=ti(),{data:s,loader:o}=Qn("query PositionToEdit(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $positionId: PositionId!\n) {\n organization(id: $organizationId) {\n ...ConditionsCustomFields\n ...CreatePositionTags\n\n positionCustomFields: customFields(variety: Position, privacy: All) {\n nodes {\n ...AttachCustomField\n }\n }\n }\n\n event(id: $eventId) {\n ...CreatePositionEvent\n\n position(id: $positionId) {\n name\n description\n acronym\n color\n icon\n privateNote\n address\n latitude\n longitude\n layer\n zoom\n tracesIds\n tagsIds\n fields\n conditionsOperator\n\n category {\n id\n }\n\n slots {\n id\n name\n startDate\n startTime\n endDate\n endTime\n resources\n assignedResources\n }\n\n positionsCustomFields {\n customFieldId\n conditionValue\n }\n }\n }\n}\n",{organizationId:e,eventId:t,positionId:n},[Vs.ConditionsCustomFieldsFragment,Vs.CreatePositionTagsFragment,Vs.AttachCustomFieldFragment,Vs.CreatePositionEventFragment]),r=Zn(TU),{mutate:a}=function(e={}){return ei("mutation PositionUpdate($eventId: EventId!, $positionId: PositionId!, $position: PositionInput!) {\n positionUpdate(eventId: $eventId, positionId: $positionId, position: $position) {\n id\n }\n}\n",e)}({redirectOnSuccess:!0});return o||(0,i.jsx)(MU,{conditionsCustomFields:s.organization.conditionsCustomFields.nodes,event:s.event,initialValues:{position:r.positionInputDefault(s.event.position,{layer:s.event.layer,startAt:s.event.startAt})},isEdit:!0,mutate:async e=>{const{positionUpdate:{id:t}}=await a({...e,positionId:n});return t},positionCustomFields:s.organization.positionCustomFields.nodes,tags:s.organization.tags.nodes})};var BU;let VU=class extends LO{static{BU=this}csvInputService;static IMPORT_COLUMNS_DEFAULT={...LO.IMPORT_COLUMNS_DEFAULT,PositionName:"positionName",PositionCategoryName:"positionCategoryName",SlotStart:"slotStart",SlotEnd:"slotEnd",MaxResources:"slotMaxResources",SlotName:"slotName",Acronym:"acronym",Color:"color",Icon:"icon",Description:"description",Address:"address",Latitude:"latitude",Longitude:"longitude",MapLayer:"mapLayer",MapZoom:"mapZoom",LeadersEmails:"leadersEmails",LeadersFirstNames:"leadersFirstnames",LeadersLastNames:"leadersLastnames",PrivateNote:"privateNote",Tags:"tags"};static IMPORT_COLUMNS_REQUIRED=e=>[...e===Je.Update?[BU.IMPORT_COLUMNS_DEFAULT.Id]:[],BU.IMPORT_COLUMNS_DEFAULT.SlotStart,BU.IMPORT_COLUMNS_DEFAULT.SlotEnd,BU.IMPORT_COLUMNS_DEFAULT.MaxResources,BU.IMPORT_COLUMNS_DEFAULT.PositionName,BU.IMPORT_COLUMNS_DEFAULT.PositionCategoryName];constructor(e,t){super(e,t),this.csvInputService=e}};VU=BU=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Cv,qn])],VU);const UU=()=>{const{params:{organizationId:e,eventId:t},translate:n}=vl(),{mutate:s}=function(e={}){return ei("mutation PositionsImport(\n $eventId: EventId!\n $organizationId: OrganizationId!\n $input: MappableImportInput!\n) {\n jobId: positionsImport(eventId: $eventId, organizationId: $organizationId, input: $input)\n}\n",e)}(),{checkPositionsImport:o}=Ob(),{data:r,loader:a}=Xr({organizationId:e,variety:je.Position});return a||(0,i.jsx)(aR,{ImportInputService:VU,checkImport:o,closePath:xs.POSITIONS({organizationId:e,eventId:t}),customFields:r.organization.customFields.nodes,heading:n("importing_tasks_31757"),importTagPrefix:"positions",itemName:{singular:n("task_24074"),plural:n("tasks_06050")},localStorageKeyPrefix:"POSITIONS_IMPORT",mutate:s,returnLink:(0,i.jsx)(Zc,{to:xs.POSITIONS({organizationId:e,eventId:t}),children:n("revenir_aux_mis_73428")}),showModeSelection:!1})};var WU;!function(e){e.Acronym="acronym",e.Address="address",e.Category="category",e.CategoryLeaders="categoryLeaders",e.CheckedInRate="checkedInRate",e.Color="color",e.Conditions="conditions",e.CreatedAt="createdAt",e.CreatedBy="createdBy",e.Description="description",e.FillingRate="fillingRate",e.Icon="icon",e.IconColor="iconColor",e.Id="id",e.Latitude="latitude",e.Leaders="leaders",e.Longitude="longitude",e.Name="name",e.PrivateNote="privateNote",e.Resources="resources",e.Slot="slot",e.SlotName="slotName",e.State="state",e.Tags="tags"}(WU||(WU={}));let GU=class extends _u{constructor(e,t,n){super(e,t,n)}getPositionsFilters(e,t){return(0,Za.A)([{slug:WU.Name,name:this.t("nom_de_la_missi_64605"),category:this.t("missions_63972"),fieldType:He.Text,hideEmpty:!0},{slug:"position",name:this.t("Position"),category:this.t("missions_63972"),fieldType:He.Select,hideEmpty:!0,needLoading:!0,eventId:e.id},{slug:WU.Description,name:this.t("Description"),category:this.t("missions_63972"),fieldType:He.Text},{slug:WU.PrivateNote,name:this.t("note_priv_e_06303"),category:this.t("missions_63972"),fieldType:He.Text},so(e.positionsCategories)?{slug:"positionCategory",name:this.t("cat_gorie_00291"),category:this.t("missions_63972"),fieldType:He.Select,values:e.positionsCategories,hideEmpty:!0}:null,{slug:"positionSlot",name:this.t("cr_neau_11117"),category:this.t("missions_63972"),fieldType:He.DateTimeRange,startAt:e.startAt,endAt:e.endAt},{slug:"positionSlotName",name:this.t("nom_du_cr_neau_54351"),category:this.t("missions_63972"),fieldType:He.Text},{slug:"tag",name:this.t("Tag"),category:this.t("missions_63972"),fieldType:He.Select,needLoading:!0,organizationId:e.organizationId,eventId:e.id,tagContext:wt.Positions},{slug:"positionCustomField",name:this.t("condition_61066"),category:this.t("missions_63972"),fieldType:He.Select,needLoading:!0,organizationId:e.organizationId},{slug:"acronym",name:this.t("Acronym"),category:this.t("missions_63972"),fieldType:He.Text},{slug:"color",name:this.t("Color"),category:this.t("missions_63972"),fieldType:He.Text,hideEmpty:!0},{slug:"icon",name:this.t("ic_ne_55554"),category:this.t("missions_63972"),fieldType:He.Select,values:xn.map(e=>({id:e,name:this.t(e)})),hideEmpty:!0},{slug:"address",name:this.t("Address"),category:this.t("missions_63972"),fieldType:He.Text},{slug:"latitude",name:this.t("Latitude"),category:this.t("missions_63972"),fieldType:He.Number},{slug:"longitude",name:this.t("Longitude"),category:this.t("missions_63972"),fieldType:He.Number},{slug:"state",name:this.t("statut_des_ress_73550"),category:this.t("missions_63972"),fieldType:He.Select,hideEmpty:!0,values:An.map(e=>({id:e,name:this.t(e)}))},{slug:"fillingRate",name:this.t("taux_de_remplis_11913"),category:this.t("missions_63972"),fieldType:He.Number,hideEmpty:!0},{slug:"checkedInRate",name:this.t("taux_de_pointag_87285"),category:this.t("missions_63972"),fieldType:He.Number,hideEmpty:!0},{slug:WU.Leaders,name:this.t("nombre_de_respo_19772"),category:this.t("missions_63972"),fieldType:He.Number,hideEmpty:!0},{slug:WU.CategoryLeaders,name:this.t("nombre_de_respo_01994"),category:this.t("missions_63972"),fieldType:He.Number,hideEmpty:!0},{slug:WU.CreatedBy,name:this.t("cr_e_par_30622"),category:this.t("missions_63972"),fieldType:He.Select,hideEmpty:!0,needLoading:!0,organizationId:e.organizationId,eventId:e.id},{slug:WU.CreatedAt,name:this.t("cr_e_le_02658"),category:this.t("missions_63972"),fieldType:He.Datetime,hideEmpty:!0},...this.customFieldsToFilters(t)])}getPositionsPossibleColumns(e){return[{slug:WU.Id,name:this.t("id_51738"),isSearchable:!0,isSortable:!0,sortAttribute:ht.Id,width:100},{slug:WU.Name,name:this.t("nom_de_la_missi_64605"),isSearchable:!0,isSortable:!0,sortAttribute:ht.Name,minWidth:120},{slug:WU.Category,name:this.t("cat_gorie_00291"),isSearchable:!0,isSortable:!0,sortAttribute:ht.Category,minWidth:240},{slug:WU.SlotName,name:this.t("nom_du_cr_neau_54351"),isSearchable:!0,minWidth:180},{slug:WU.Slot,name:this.t("cr_neau_11117"),isSortable:!0,sortAttribute:ht.Slot,minWidth:240},{slug:WU.Resources,name:this.t("membres_11310"),minWidth:320},{slug:WU.Tags,name:this.t("tags_79499"),isSearchable:!0,minWidth:320},{slug:WU.Conditions,name:this.t("conditions_77756"),minWidth:320},{slug:WU.Address,name:this.t("Address"),isSearchable:!0,minWidth:240},{slug:WU.Latitude,name:this.t("latitude_46176"),isSearchable:!0,minWidth:180},{slug:WU.Longitude,name:this.t("longitude_01695"),isSearchable:!0,minWidth:180},{slug:WU.Acronym,name:this.t("Acronym"),isSearchable:!0,minWidth:180},{slug:WU.Color,name:this.t("Color"),isSearchable:!0,width:80},{slug:WU.Icon,name:this.t("ic_ne_55554"),width:80},{slug:WU.IconColor,name:this.t("ic_ne_et_couleu_54485"),width:80},{slug:WU.State,name:this.t("statut_des_ress_73550"),minWidth:240},{slug:WU.FillingRate,name:this.t("taux_de_remplis_11913"),minWidth:240},{slug:WU.CheckedInRate,name:this.t("taux_de_pointag_87285"),minWidth:240},{slug:WU.CreatedBy,name:this.t("cr_e_par_30622"),isSearchable:!0,minWidth:180},{slug:WU.CreatedAt,name:this.t("cr_e_le_02658"),isSortable:!0,sortAttribute:ht.CreatedAt,minWidth:180},{slug:WU.Leaders,name:this.t("responsables_de_54941"),isSearchable:!0,minWidth:320},{slug:WU.CategoryLeaders,name:this.t("responsables_de_22220"),isSearchable:!0,minWidth:320}].concat(this.customFieldsToPossibleColumns(e))}};GU=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[hu,Jc,qn])],GU);const HU=e=>{const{params:{eventId:t}}=vl(),{mutate:n}=Do(),s=L.useCallback(async i=>{const s=io(e.property);for(const o of s){const r=1===s.length?i:i[o];await n({eventId:t,massEdit:{reset:!1,selecteds:{ids:[e.positionId]},slug:o,strategy:it.Replace,value:r}})}},[e.positionId,e.property,n]);return(0,i.jsx)(yy,{column:e.column,initialValue:e.initialValue,mutate:s,reload:e.reload,renderInput:e.renderInput,renderValue:e.renderValue,updatable:e.updatable})},qU=e=>{const{translate:t}=vl();return(0,i.jsx)(HU,{column:e.column,initialValue:e.position.acronym||"",positionId:e.position.id,property:lt.Acronym,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(Bl,{label:t("Acronym"),value:e,onChange:n}),renderValue:e.position.acronym||"",updatable:e.updatable})},KU=L.createContext({}),YU=e=>{const[t,n]=L.useState(),s=T$(_a,{eventId:e.eventId},e=>e.event.positionsCategories),o=T$(Uo,{organizationId:e.organizationId},e=>e.organization.tags.nodes);return(0,i.jsx)(KU.Provider,{value:{newPositionLatLng:t,getPositionsCategories:s,getTags:o,setNewPositionLatLng:n},children:e.children})};function ZU(){return L.useContext(KU)}const XU=e=>{const t=Xn(),{getPositionsCategories:n}=ZU(),{result:s,isLoading:o}=U$(n);return o?(0,i.jsxs)(Ba,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(Ml,{children:t("Category")}),(0,i.jsx)(lc,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)($u,{label:t("Category"),shouldParseAsInt:!0,value:e.value,onChange:e.setValue,children:s.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})},JU=e=>{const{params:{organizationId:t,eventId:n}}=vl(),{isEditMode:s}=vy();return(0,i.jsx)(HU,{column:e.column,initialValue:e.positionCategory.id,positionId:e.positionId,property:lt.Category,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(XU,{setValue:t,value:e}),renderValue:()=>(0,i.jsx)(q$,{isEditMode:s,title:e.positionCategory.name,updatable:e.updatable,children:(0,i.jsx)(Zc,{to:xs.POSITION_CATEGORY({organizationId:t,eventId:n,positionCategoryId:e.positionCategory.id}),children:e.positionCategory.name})}),updatable:e.updatable})},QU=e=>{const{translate:t}=vl();return(0,i.jsx)(HU,{column:e.column,initialValue:e.position.color,positionId:e.position.id,property:lt.Color,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(Hj,{label:t("Color"),value:e,onChange:n}),renderValue:()=>(0,i.jsx)(Ba,{align:"center",gap:"3",width:1,children:(0,i.jsxs)(km,{children:[(0,i.jsx)(Sm,{children:(0,i.jsx)(Ar,{css:{background:e.position.color,borderRadius:"2px",height:"24px",width:"24px"},onClick:()=>{US(e.position.color)}})}),(0,i.jsx)(wm,{placement:"top",children:e.position.color})]})}),updatable:e.updatable})},eW=e=>{const{translate:t}=vl(),n=(0,L.useMemo)(()=>e.position.positionsCustomFields||[],[e.position]),s=(0,L.useMemo)(()=>n.map((e,n)=>({id:n,color:"gray",icon:null,text:`${e.customField.name} : ${IF(t,e.customField,e.conditionValue)}`})),[n]);return(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Py,{badges:s})})},tW=e=>{const{translate:t}=vl();return(0,i.jsx)(HU,{column:e.column,initialValue:e.position.icon,positionId:e.position.id,property:lt.Icon,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(Xj,{label:t("Icon"),renderOnPortal:!0,value:e,onChange:n}),renderValue:()=>(0,i.jsx)(nl,{icon:tl(e.position.icon)}),updatable:e.updatable})},nW=e=>{const{translate:t}=vl(),n=(0,L.useMemo)(()=>({[lt.Color]:e.position.color,[lt.Icon]:e.position.icon}),[e.position]);return(0,i.jsx)(HU,{column:e.column,initialValue:n,positionId:e.position.id,property:[lt.Color,lt.Icon],reload:e.reload,renderInput:(e,n)=>(0,i.jsxs)(Ba,{direction:"column",gap:"2",width:1,children:[(0,i.jsx)(Hj,{label:t("Color"),value:e[se.Color],onChange:t=>{n({...e,[se.Color]:t})}}),(0,i.jsx)(Xj,{label:t("Icon"),renderOnPortal:!0,value:e[se.Icon],onChange:t=>{n({...e,[se.Icon]:t})}})]}),renderValue:()=>(0,i.jsx)(WC,{color:e.position.color,icon:e.position.icon}),updatable:e.updatable})},iW=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=vl(),{isEditMode:o}=vy();return(0,i.jsx)(HU,{column:e.column,initialValue:e.position.name,positionId:e.position.id,property:lt.Name,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(Bl,{label:t("nom_de_la_missi_64605"),value:e,onChange:n}),renderValue:()=>(0,i.jsx)(q$,{isEditMode:o,title:e.position.name,updatable:e.updatable,children:(0,i.jsx)(Zc,{to:xs.POSITION({organizationId:n,eventId:s,positionId:e.position.id}),children:e.position.name})}),updatable:e.updatable})},sW=e=>{const{translate:t}=vl(),{getTags:n}=ZU(),{result:s,isLoading:o}=U$(n);return o?(0,i.jsxs)(Ba,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(Ml,{children:t("tags_79499")}),(0,i.jsx)(lc,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(yc,{isSearchVisible:!0,label:t("tags_79499"),multiple:!0,renderOnPortal:!0,values:e.value,onChange:e.setValue,children:s.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})},oW=e=>{const t=(0,L.useMemo)(()=>e.position.tags||[],[e.position]),n=(0,L.useMemo)(()=>t.map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[t]);return(0,i.jsx)(HU,{column:e.column,initialValue:t.map(e=>e.id),positionId:e.position.id,property:lt.Tag,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(sW,{setValue:t,value:e}),renderValue:()=>(0,i.jsx)(Py,{badges:n}),updatable:e.updatable})},rW=e=>{const{translate:t,params:{eventId:n}}=vl(),{mutate:s}=ya(),o=(0,L.useMemo)(()=>m(e.positionSlot.name)?e.positionSlot.name:"-",[e.positionSlot]);return(0,i.jsx)(yy,{column:e.column,initialValue:e.positionSlot.name,mutate:async t=>s({eventId:n,positionId:e.positionSlot.position.id,positionSlotId:e.positionSlot.id,positionSlot:{...(0,Er.A)(e.positionSlot,["id","startDate","startTime","endDate","endTime","resources"]),name:t}}),reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(Bl,{label:t("nom_du_cr_neau_54351"),value:e,onChange:n}),renderValue:()=>(0,i.jsx)(Ar,{css:{ellipsis:!0},font:"gray900 textSm medium",title:o,width:1,children:o}),updatable:e.updatable})},aW=e=>{const{translate:t,params:{eventId:n}}=vl(),{isEventAdmin:s}=wb(),o=Zn(ph),r=Zn(mC),{mutate:a}=ya(),l=_y(e.customFields),d=(0,L.useCallback)(()=>{e.reloadPositionSlot(e.positionSlot.id)},[e.positionSlot,e.reloadPositionSlot]),[c,u]=(0,L.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Mc,{css:{"&:hover":{background:"$gray100"}},children:[e.columns.map(n=>{const a=l.get(n.slug);return n.slug===WU.Id?(0,i.jsx)(Oc,{minWidth:n.minWidth,width:n.width,children:e.positionSlot.id},n.slug):n.slug===WU.Category?(0,i.jsx)(JU,{column:n,positionCategory:e.positionSlot.positionCategory,positionId:e.positionSlot.position.id,reload:d,updatable:s},n.slug):n.slug===WU.Name?(0,i.jsx)(iW,{column:n,position:e.positionSlot.position,reload:d,updatable:s},n.slug):n.slug===WU.Slot?(0,i.jsx)(Oc,{minWidth:n.minWidth,width:n.width,children:o.toDisplayString(e.positionSlot.range)},n.slug):n.slug===WU.SlotName?(0,i.jsx)(rW,{column:n,positionSlot:e.positionSlot,reload:d,updatable:s},n.slug):n.slug===WU.Resources?(0,i.jsx)(Oc,{minWidth:n.minWidth,width:n.width,children:(0,i.jsx)(L$,{assignedResources:e.positionSlot.assignedResources,resources:e.positionSlot.resources})},n.slug):n.slug===WU.Tags?(0,i.jsx)(oW,{column:n,position:e.positionSlot.position,reload:d,updatable:s},n.slug):n.slug===WU.Conditions?(0,i.jsx)(eW,{column:n,position:e.positionSlot.position},n.slug):n.slug===WU.Address?(0,i.jsx)(Oc,{minWidth:n.minWidth,width:n.width,children:e.positionSlot.position.address},n.slug):n.slug===WU.Latitude?(0,i.jsx)(Oc,{minWidth:n.minWidth,width:n.width,children:e.positionSlot.position.latitude},n.slug):n.slug===WU.Longitude?(0,i.jsx)(Oc,{minWidth:n.minWidth,width:n.width,children:e.positionSlot.position.longitude},n.slug):n.slug===WU.Acronym?(0,i.jsx)(qU,{column:n,position:e.positionSlot.position,reload:d,updatable:s},n.slug):n.slug===WU.Color?(0,i.jsx)(QU,{column:n,position:e.positionSlot.position,reload:d,updatable:s},n.slug):n.slug===WU.Icon?(0,i.jsx)(tW,{column:n,position:e.positionSlot.position,reload:d,updatable:s},n.slug):n.slug===WU.IconColor?(0,i.jsx)(nW,{column:n,position:e.positionSlot.position,reload:d,updatable:s},n.slug):n.slug===WU.State?(0,i.jsx)(Oc,{minWidth:n.minWidth,width:n.width,children:e.positionSlot.state===mt.Full?(0,i.jsx)(rc,{color:"success",children:t(e.positionSlot.state)}):(0,i.jsx)(rc,{color:"warning",children:t(e.positionSlot.state)})},n.slug):n.slug===WU.FillingRate?(0,i.jsxs)(Oc,{minWidth:n.minWidth,width:n.width,children:[e.positionSlot.fillingRate,"%"]},n.slug):n.slug==WU.CheckedInRate?(0,i.jsxs)(Oc,{minWidth:n.minWidth,width:n.width,children:[e.positionSlot.checkedInRate||0,"%"]},n.slug):n.slug===WU.CreatedAt?(0,i.jsx)(MR,{column:n,insertedAt:e.positionSlot.insertedAt}):n.slug===WU.CreatedBy?(0,i.jsx)(NR,{column:n,createdBy:e.positionSlot.position.createdBy},n.slug):(0,i.jsx)(Oc,{minWidth:n.minWidth,width:n.width,children:a?r.getValueString(a,e.positionSlot.position.fields,{fileReturnValue:"name"}):""},n.slug)}),(0,i.jsx)(Kb,{permissions:Hb.POSITION_EDIT,children:(0,i.jsx)(Xc,{justify:"center",children:(0,i.jsxs)(km,{children:[(0,i.jsx)(Sm,{children:(0,i.jsx)(Ar,{children:(0,i.jsx)(nl,{icon:"pen",onClick:()=>{u(!0)}})})}),(0,i.jsx)(wm,{placement:"top",children:t("_diter_62574")})]})})})]}),c&&(0,i.jsx)(DU,{event:e.event,slot:e.positionSlot,onClose:()=>{u(!1)},onSuccess:async t=>{await a({eventId:n,positionId:e.positionSlot.position.id,positionSlotId:e.positionSlot.id,positionSlot:t}),d()}})]})},lW=e=>{const{params:{eventId:t}}=vl(),{columns:n,columnsSearch:s,limit:o,nameDebounced:r,offset:a,possibleColumns:l,predicates:d,reloadKey:c,setLimit:u,setOffset:h,setSort:g,sort:p}=vy(),f=(0,L.useMemo)(()=>({includeCheckedInRate:n.includes(WU.CheckedInRate),includeConditions:n.includes(WU.Conditions),includeCreatedBy:n.includes(WU.CreatedBy),includeTags:n.includes(WU.Tags)}),[n]),{data:_,isLoading:x,reload:I}=Qn("query PositionsSlots(\n $eventId: EventId!\n $name: String\n $predicates: [Predicate!]\n $columnsSearch: [String!]\n $limit: Int\n $offset: Int\n $sort: PositionsSlotsSort\n $includeCheckedInRate: Boolean!\n $includeConditions: Boolean!\n $includeCreatedBy: Boolean!\n $includeTags: Boolean!\n) {\n event(id: $eventId) {\n startAt\n endAt\n\n positionsSlots(\n name: $name\n predicates: $predicates\n columnsSearch: $columnsSearch\n limit: $limit\n offset: $offset\n sort: $sort\n ) {\n nodes {\n ...PositionsPositionSlot\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{...f,eventId:t,name:m(r)?r:null,columnsSearch:so(s)?s:null,predicates:d,limit:o,offset:a,sort:p},[Vs.PositionsPositionSlotFragment]);const v=(0,L.useMemo)(()=>n.flatMap(e=>(0,Za.A)([l.find(t=>t.slug===e)])),[l,n]),{numberOfPages:b,totalCount:j}=Su(_.event?.positionsSlots),[C,y]=(0,L.useState)([]),[k,A]=(0,L.useState)({}),w=(0,L.useCallback)(async e=>{A(t=>({...t,[e]:!0}));const{event:{positionSlot:n}}=await function(e,t){return go("query PositionsPositionSlot(\n $eventId: EventId!\n $id: PositionsSlotId!\n $includeCheckedInRate: Boolean!\n $includeConditions: Boolean!\n $includeCreatedBy: Boolean!\n $includeTags: Boolean!\n) {\n event(id: $eventId) {\n positionSlot(id: $id) {\n ...PositionsPositionSlot\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[Vs.PositionsPositionSlotFragment]})}({...f,eventId:t,id:e},await Y());y(t=>t.map(t=>t.id===e?n:t)),A(t=>({...t,[e]:!1}))},[f,A,y]);return(0,L.useEffect)(()=>{y(_.event?.positionsSlots.nodes??[])},[_.event]),(0,L.useEffect)(()=>{c>1&&I()},[c]),(0,i.jsx)(Ba,{css:{flex:"1",overflow:"hidden"},width:1,children:(0,i.jsx)(Cm,{"aria-busy":x,headerRow:(0,i.jsxs)(kc,{children:[v.map(e=>e.isSortable?(0,i.jsx)(jm,{attribute:e.sortAttribute||e.slug,minWidth:e.minWidth,setSort:g,sort:p,width:e.width,children:(0,i.jsx)(Ar,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug):(0,i.jsx)(Gc,{minWidth:e.minWidth,width:e.width,children:(0,i.jsx)(Ar,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug)),(0,i.jsx)(Kb,{permissions:Hb.POSITION_EDIT,children:(0,i.jsx)(Gc,{width:100})})]}),paginationRow:(0,i.jsx)(Nc,{css:{borderTop:"1px solid $gray200"},children:(0,i.jsx)(Fc,{limit:o,numberOfPages:b,offset:a,setLimit:u,setOffset:h,showLimits:!0,totalCount:j})}),children:x?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Hc,{}),(0,i.jsx)(Hc,{}),(0,i.jsx)(Hc,{})]}):C.map(t=>k[t.id]?(0,i.jsx)(Hc,{},t.id):(0,i.jsx)(aW,{columns:v,customFields:e.customFields,event:_.event,positionSlot:t,reloadPositionSlot:w},t.id))})})};let dW=class extends Gl{translationService;constructor(e){super(e),this.translationService=e}massConditionsStep1Schema(){return d.Ik().shape({massConditions:d.Ik().shape({...this.massConditionsStep1Fields()})})}massConditionsStep2Schema(){return d.Ik().shape({massConditions:d.Ik().shape({...this.massConditionsStep2Fields()})})}massConditionsSchema(){return d.Ik().shape({...this.massConditionsStep1Fields(),...this.massConditionsStep2Fields()})}massConditionsStep1Fields(){return{strategy:d.Yj().required(this.t("la_strat_gie_es_82287")).oneOf(Cn,this.t("la_strat_gie_es_82287"))}}massConditionsStep2Fields(){return{customFieldId:d.ai().required(this.t("le_champ_person_80074")),value:d.gl().required(this.t("la_valeur_est_r_70136"))}}};dW=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[qn])],dW);const cW=()=>{const e=Xn();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ar,{color:"gray900",fontWeight:"medium",children:e("que_souhaitez_v_87607")}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(QR,{label:e("ajouter_des_con_91773"),name:"massConditions.strategy",value:it.Add}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(QR,{label:e("remplacer_les_c_29446"),name:"massConditions.strategy",value:it.Replace})]})},uW=e=>{const t=Xn(),{data:n,loader:s}=Qn("query MassConditionsCustomFields($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n ...ConditionsCustomFields\n }\n}\n",{organizationId:e.organizationId},[Vs.ConditionsCustomFieldsFragment]);const o=(0,L.useMemo)(()=>n.organization&&e.values.massConditions.customFieldId?n.organization.conditionsCustomFields.nodes.find(t=>t.id===e.values.massConditions.customFieldId):void 0,[n.organization,e.values.massConditions.customFieldId]);return(0,L.useEffect)(()=>{o?.fieldType===We.Checkbox?e.change("massConditions.value",!0):o?.fieldType===We.Select&&e.change("massConditions.value",[])},[o]),s||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Qj,{label:t("CustomField"),name:"massConditions.customFieldId",shouldParseAsInt:!0,children:[(0,i.jsx)("option",{value:-1,children:t("s_lectionner_un_01451")}),n.organization.conditionsCustomFields.nodes.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))]}),o?.fieldType===We.Select&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(Ym,{isSearchVisible:!0,label:t("mission_accessi_77261"),multiple:!0,name:"massConditions.value",children:o.values.map(({id:e,value:t})=>(0,i.jsx)("option",{value:e,children:t},e))})]}),o?.fieldType===We.Checkbox&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"6"}),(0,i.jsxs)(Qj,{label:t("mission_accessi_77261"),name:"massConditions.value",shouldParseAsBoolean:!0,children:[(0,i.jsx)("option",{value:"true",children:t("true")}),(0,i.jsx)("option",{value:"false",children:t("false")})]})]})]})},hW=e=>{const t=Xn(),n=Zn(dW),s=Zn(Ua),{mutate:o}=function(e={}){return ei("mutation PositionsMassConditions($eventId: EventId!, $massConditions: MassConditionsInput!) {\n numberOfPositions: positionsMassConditions(eventId: $eventId, massConditions: $massConditions)\n}\n",e)}(),[r,a]=(0,L.useState)(0);return(0,i.jsx)(au,{size:"md",onClose:e.onClose,children:(0,i.jsx)(Ga.lV,{initialValues:{massConditions:{customFieldId:-1,selecteds:e.selecteds,strategy:it.Add,value:""}},initialValuesEqual:Mr.A,render:({form:n,handleSubmit:s,values:o})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{justify:"center",children:(0,i.jsx)(sC,{color:"primary",icon:"lock"})}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(Ar,{color:"gray900",fontSize:"textLg",fontWeight:"medium",textAlign:"center",children:t("_diter_les_cond_95618")}),(0,i.jsx)(Ya,{height:"7"}),0===r?(0,i.jsx)(cW,{}):(0,i.jsx)(uW,{change:n.change,organizationId:e.organizationId,values:o}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsxs)(Ba,{gap:"3",children:[0!==r&&(0,i.jsx)(zl,{color:"white",leftIcon:"arrow-left",onClick:()=>{a(Math.max(0,r-1))},children:t("retour_92202")}),(0,i.jsx)(Ar,{css:{flex:"1"}}),0===r?(0,i.jsx)(zl,{rightIcon:"arrow-right",onClick:s,children:t("suivant_1_2_16815")}):(0,i.jsx)(zl,{onClick:s,children:t("mettre_jour_l_67209")})]})]}),validate:e=>0===r?s.validateForForm(n.massConditionsStep1Schema())(e):s.validateForForm(n.massConditionsStep2Schema())(e),onSubmit:async n=>{if(1===r){const i=(await o({eventId:e.eventId,massConditions:n.massConditions})).numberOfPositions;e.onSuccess(t("les_conditions_78548",i)),e.onClose()}else a(r+1)}})})},mW=()=>{const e=Xn(),{roles:t}=TI(),{eventId:n,massActions:s,onMassEditSuccess:o,organizationId:r,predicates:a,segment:l}=vy(),{showNotification:d}=Ob(),{mutate:c}=Do(),{mutate:u}=ca(),{mutate:h}=xa(),[g,p]=(0,L.useState)(!1),[f,_]=(0,L.useState)(!1),[x,I]=(0,L.useState)(!1),[v,b]=(0,L.useState)(!1),j=s.getSelectedsInput(a,null),C=s.isAllSelected?l.count:s.numberOfSelected,y=(0,L.useCallback)(e=>{m(e)&&d(e),o()},[o]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zl,{onClick:()=>{p(!0)},children:e("_diter_une_prop_26724")}),(0,i.jsxs)(Wd,{children:[(0,i.jsx)(Xd,{children:(0,i.jsx)(zl,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Zd,{placement:"bottom-end",children:[(0,i.jsx)(Kd,{icon:"lock",onClick:()=>{_(!0)},children:e("_diter_les_cond_95618")}),(0,i.jsx)(Kd,{icon:"user-gear",onClick:()=>I(!0),children:e("_diter_les_resp_29588")}),(0,i.jsx)(Xu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Kd,{color:"red",icon:"trash-can",onClick:()=>{b(!0)},children:e("supprimer_43083")})]})]}),g&&(0,i.jsx)(fA,{eventId:n,mutate:e=>c({eventId:n,massEdit:e}),organizationId:r,selecteds:j,onClose:()=>{p(!1)},onSuccess:t=>{y(e("_1_missions_on_96803",t))}}),f&&(0,i.jsx)(hW,{eventId:n,organizationId:r,selecteds:j,onClose:()=>{_(!1)},onSuccess:y}),x&&(0,i.jsx)(D$,{roles:t.positionRoles,showRoleSelect:!0,onClose:()=>I(!1),onSuccess:async(t,i)=>{const s=(await u({eventId:n,massLeaders:{leaders:i,strategy:t,selecteds:j}})).numberOfPositions;y(e("les_responsable_23291",s))}}),v&&(0,i.jsx)(cA,{buttonText:e("supprimer_43083"),subtext:[e("_tes_vous_s_r_d_65487")],text:e("suppression_de_81835",C),onClose:()=>{b(!1)},onDelete:async()=>{const t=(await h({eventId:n,selecteds:j})).numberOfPositions;y(e("_1_missions_on_56713",t))}})]})};function gW(){const{history:e,params:{organizationId:t,eventId:n}}=vl(),{mutate:i}=function(e={}){return ei("mutation PositionDuplicate($eventId: EventId!, $positionId: PositionId!) {\n positionDuplicate(eventId: $eventId, positionId: $positionId) {\n id\n }\n}\n",e)}();return(0,L.useCallback)(async s=>{const{positionDuplicate:o}=await i({eventId:n,positionId:s});e.push(Ps.EDIT_POSITION(t,n,o.id))},[t,n,i])}const pW=e=>{const{translate:t,params:{eventId:n}}=vl(),{showNotification:s}=Ob(),{mutate:o}=xa(),r=[];return e.position.assignedResources>0&&r.push(t("_1_membre_est_66702",e.position.assignedResources)),(0,i.jsx)(cA,{buttonText:t("supprimer_43083"),subtext:[t("_tes_vous_s_r_d_01544"),t("cela_supprimera_15744"),...r],text:t("suppression_de_73669",e.position.name),onClose:e.onClose,onDelete:async()=>{await o({eventId:n,selecteds:{ids:[e.position.id]}}),s(t("la_mission_1_45985",e.position.name)),e.onSuccess()}})},fW=e=>{const{params:{organizationId:t,eventId:n},translate:s}=vl(),o=gW(),{isEventAdmin:r}=wb(),[a,l]=(0,L.useState)(!1),[d,c]=(0,L.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Yc,{children:[(0,i.jsx)(Kd,{icon:"pen",to:Ps.EDIT_POSITION(t,n,e.position.id),children:s("_diter_62574")}),(0,i.jsx)(Kd,{icon:"clone",onClick:async()=>{await o(e.position.id)},children:s("dupliquer_28256")}),(0,i.jsx)(Kd,{color:"red",icon:"trash-can",onClick:e=>{l(!0),Vd(e.target)},children:s("supprimer_43083")}),(0,i.jsx)(Xu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Kd,{icon:"plus",to:Ps.CREATE_POSITION(t,n,e.position.category.id),children:s("ajouter_une_mis_99800")}),(0,i.jsx)(Kd,{icon:"eye",to:xs.POSITION_CATEGORY({organizationId:t,eventId:n,positionCategoryId:e.position.category.id}),children:s("voir_1_90465",e.position.category.name)}),r&&(0,i.jsx)(Kd,{icon:"pen",onClick:()=>{c(!0)},children:s("renommer_1_40542",e.position.category.name)})]}),a&&(0,i.jsx)(pW,{position:e.position,onClose:()=>{l(!1)},onSuccess:e.reload}),d&&(0,i.jsx)(OU,{eventId:n,positionCategoryId:e.position.category.id,positionCategoryName:e.position.category.name,onClose:()=>{c(!1)},onSuccess:e.reload})]})},_W=e=>{const t=(0,L.useMemo)(()=>(e.position.category?.leaders??[]).map(e=>({id:e.userInfo.id,color:"gray",icon:null,text:e.userInfo.nameOrEmail})),[e.position]);return(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Py,{badges:t})})},xW=e=>{const t=(0,L.useMemo)(()=>(e.position?.leaders??[]).map(e=>({id:e.userInfo.id,color:"gray",icon:null,text:e.userInfo.nameOrEmail})),[e.position]);return(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Py,{badges:t})})},IW=e=>{const{translate:t}=vl(),n=Zn(Jc),{mutate:s}=Do(),o=(0,L.useCallback)((t,n)=>s({eventId:e.eventId,massEdit:{reset:!1,selecteds:{ids:[e.row.id]},slug:n,strategy:it.Replace,value:t}}),[e.row,s]),r=(0,L.useMemo)(()=>{if(e.row.range){const t=e.row.range.start,i=e.row.range.end;return t.startOf("day").equals(i.startOf("day"))?n.toLocaleString(t,eo.DateOnly.MonthShort):`${n.toLocaleString(t,eo.DateOnly.MonthShort)} → ${n.toLocaleString(i,eo.DateOnly.MonthShort)}`}return"-"},[e.row]),{isEventAdmin:a}=wb();return e.column.slug==WU.Id?(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.id}):e.column.slug===WU.Category?(0,i.jsx)(JU,{column:e.column,positionCategory:e.row.category,positionId:e.row.id,reload:e.reloadRow,updatable:a}):e.column.slug===WU.Name?(0,i.jsx)(iW,{column:e.column,position:e.row,reload:e.reloadRow,updatable:a}):e.column.slug===WU.Slot?(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsxs)(Ba,{css:{overflow:"hidden"},direction:"column",width:1,children:[(0,i.jsx)(Ar,{font:"gray900 textSm medium",children:r}),(0,i.jsx)(Ar,{color:"gray500",children:t("creneau",e.row.numberOfSlots)})]})}):e.column.slug===WU.SlotName?(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:"-"}):e.column.slug===WU.Resources?(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(L$,{assignedResources:e.row.assignedResources,resources:e.row.resources})}):e.column.slug===WU.Tags?(0,i.jsx)(oW,{column:e.column,position:e.row,reload:e.reloadRow,updatable:a}):e.column.slug===WU.Conditions?(0,i.jsx)(eW,{column:e.column,position:e.row}):e.column.slug===WU.Address?(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.address}):e.column.slug===WU.Latitude?(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.latitude}):e.column.slug===WU.Longitude?(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.longitude}):"isVisible"===e.column.slug?(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Ba,{align:"center",gap:"3",width:1,children:e.row.isVisible?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ar,{children:(0,i.jsx)(nl,{icon:"square-check"})}),(0,i.jsx)(Ar,{children:t("visible_27909")})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ar,{children:(0,i.jsx)(nl,{icon:"square"})}),(0,i.jsx)(Ar,{children:t("non_visible_30040")})]})})}):e.column.slug===WU.Acronym?(0,i.jsx)(qU,{column:e.column,position:e.row,reload:e.reloadRow,updatable:a}):e.column.slug===WU.Color?(0,i.jsx)(QU,{column:e.column,position:e.row,reload:e.reloadRow,updatable:a}):e.column.slug===WU.Icon?(0,i.jsx)(tW,{column:e.column,position:e.row,reload:e.reloadRow,updatable:a}):e.column.slug===WU.IconColor?(0,i.jsx)(nW,{column:e.column,position:e.row,reload:e.reloadRow,updatable:a}):e.column.slug===WU.State?(0,i.jsx)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.state===mt.Full?(0,i.jsx)(rc,{color:"success",children:t(e.row.state)}):(0,i.jsx)(rc,{color:"warning",children:t(e.row.state)})}):e.column.slug===WU.FillingRate?(0,i.jsxs)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:[e.row.fillingRate,"%"]}):e.column.slug===WU.CheckedInRate?(0,i.jsxs)(Oc,{minWidth:e.column.minWidth,width:e.column.width,children:[e.row.checkedInRate||0,"%"]}):e.column.slug===WU.CreatedAt?(0,i.jsx)(MR,{column:e.column,insertedAt:e.row.insertedAt}):e.column.slug===WU.CreatedBy?(0,i.jsx)(NR,{column:e.column,createdBy:e.row.createdBy}):e.column.slug===WU.Leaders?(0,i.jsx)(xW,{column:e.column,position:e.row}):e.column.slug===WU.CategoryLeaders?(0,i.jsx)(_W,{column:e.column,position:e.row}):(0,i.jsx)(By,{column:e.column,customField:e.customField,fields:e.row.fields,mutate:o,reload:e.reloadRow,updatable:a})},vW=e=>{const{params:{organizationId:t,eventId:n},translate:s}=vl(),{hasPermission:o}=wb(),r=o(Hb.POSITION_EDIT,{eventId:"ANY"}),a=_y(e.customFields),l=(0,L.useCallback)(()=>{e.reloadPosition(e.position.id)},[e.position,e.reloadPosition]);return(0,i.jsxs)(Mc,{css:{background:"checked"===e.state?"$primary100":"white","&:hover":{background:"checked"===e.state?"$primary100":"$gray100"}},onMouseLeave:e=>{Vd(e.target)},children:[r&&(0,i.jsx)(Oc,{justify:"center",width:48,children:(0,i.jsx)(fc,{state:e.state,onClick:(t,n)=>{Dl(n),e.toggleRow(`p${e.position.id}`,t)}})}),e.columns.map(t=>{const s=a.get(t.slug);return(0,i.jsx)(IW,{column:t,customField:s,eventId:n,reloadRow:l,row:e.position},t.slug)}),(0,i.jsx)(Kb,{permissions:Hb.POSITION_EDIT,children:(0,i.jsx)(Xc,{justify:"center",children:(0,i.jsxs)(Kb,{permissions:Hb.POSITION_EDIT,scope:{positionCategoryId:e.position.category.id},children:[(0,i.jsxs)(km,{children:[(0,i.jsx)(Sm,{children:(0,i.jsx)(Ar,{children:(0,i.jsx)(nl,{icon:"pen",to:Ps.EDIT_POSITION(t,n,e.position.id)})})}),(0,i.jsx)(wm,{placement:"top",children:s("_diter_62574")})]}),(0,i.jsx)(fW,{position:e.position,reload:e.reload})]})})})]})},bW=e=>{const{params:{eventId:t}}=vl(),{hasPermission:n}=wb(),s=n(Hb.POSITION_EDIT,{eventId:"ANY"}),{columns:o,columnsSearch:r,limit:a,massActions:l,nameDebounced:d,offset:c,possibleColumns:u,predicates:h,reloadKey:g,setLimit:p,setOffset:f,setSort:_,sort:x}=vy(),I=(0,L.useMemo)(()=>({includeCheckedInRate:o.includes(WU.CheckedInRate),includeConditions:o.includes(WU.Conditions),includeCreatedBy:o.includes(WU.CreatedBy),includeLeaders:o.includes(WU.Leaders)||o.includes(WU.CategoryLeaders),includeTags:o.includes(WU.Tags),includeTraces:!1}),[o]),{data:v,isLoading:b,reload:j}=Ia({...I,eventId:t,name:m(d)?d:null,columnsSearch:so(r)?r:null,predicates:h,limit:a,offset:c,sort:x}),C=(0,L.useMemo)(()=>o.flatMap(e=>(0,Za.A)([u.find(t=>t.slug===e)])),[u,o]),{numberOfPages:y,totalCount:k}=Su(v.data?.rows),[A,w]=(0,L.useState)([]),[S,E]=(0,L.useState)({}),T=(0,L.useCallback)(async e=>{E(t=>({...t,[e]:!0}));const{data:{row:n}}=await(i={...I,eventId:t,id:e},s=await Y(),go("query PositionsPosition(\n $eventId: EventId!\n $id: PositionId!\n $includeCheckedInRate: Boolean!\n $includeConditions: Boolean!\n $includeCreatedBy: Boolean!\n $includeLeaders: Boolean!\n $includeTags: Boolean!\n) {\n data: event(id: $eventId) {\n row: position(id: $id) {\n ...PositionsPosition\n }\n }\n}\n",{variables:i,token:s||void 0,fragments:[Vs.PositionsPositionFragment]}));var i,s;w(t=>t.map(t=>t.id===e?n:t)),E(t=>({...t,[e]:!1}))},[I,E,w]);return(0,L.useEffect)(()=>{w(v.data?.rows.nodes??[])},[v.data]),(0,L.useEffect)(()=>{g>1&&j()},[g]),(0,L.useEffect)(()=>{l.setStates(Object.fromEntries((v.data?.rows.nodes??[]).map(e=>[`p${e.id}`,{id:e.id,state:"unchecked"}])))},[v.data,l.setStates]),(0,i.jsx)(Ba,{css:{flex:"1",overflow:"hidden"},width:1,children:(0,i.jsx)(Cm,{"aria-busy":b,headerRow:(0,i.jsxs)(kc,{children:[s&&(0,i.jsx)(Gc,{justify:"center",width:48,children:(0,i.jsx)(fc,{state:l.selectAllState,onClick:l.toggleSelectAll})}),C.map(e=>e.isSortable?(0,i.jsx)(jm,{attribute:e.sortAttribute||e.slug,minWidth:e.minWidth,setSort:_,sort:x,width:e.width,children:(0,i.jsx)(Ar,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug):(0,i.jsx)(Gc,{minWidth:e.minWidth,width:e.width,children:(0,i.jsx)(Ar,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug)),(0,i.jsx)(Kb,{permissions:Hb.POSITION_EDIT,children:(0,i.jsx)(Gc,{width:100})})]}),paginationRow:(0,i.jsx)(Nc,{css:{borderTop:"1px solid $gray200"},children:(0,i.jsx)(Fc,{limit:a,numberOfPages:y,offset:c,setLimit:p,setOffset:f,showLimits:!0,totalCount:k})}),children:b?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Hc,{}),(0,i.jsx)(Hc,{}),(0,i.jsx)(Hc,{})]}):A.map(t=>S[t.id]?(0,i.jsx)(Hc,{},t.id):(0,i.jsx)(vW,{columns:C,customFields:e.customFields,position:t,reload:j,reloadPosition:T,state:l.states[`p${t.id}`]?.state??"unchecked",toggleRow:l.toggleRow},t.id))})})};function jW(e,t,n,i){n.current.forEach(e=>e.setMap(null)),n.current=e.map(e=>{const n=e.points.map(([e,t])=>({lat:e,lng:t})),s=e.direction===Tt.None?[]:[{icon:{path:e.direction===Tt.Backward?google.maps.SymbolPath.BACKWARD_OPEN_ARROW:google.maps.SymbolPath.FORWARD_OPEN_ARROW,scale:4,strokeColor:e.color},offset:"0%",repeat:"200px"}],o=new google.maps.Polyline({path:n,geodesic:!0,strokeColor:e.color,strokeOpacity:1,strokeWeight:4,visible:!t.includes(e.id),icons:s});return o.setMap(i.current),o})}const CW=(0,L.memo)(e=>{const t=(0,L.useCallback)(t=>{t&&(n.current&&(s.current?.setMap(null),o.current?.setMap(null),n.current=null),n.current=new google.maps.Map(t,{...e.mapOptions??{},...Dr(e.initialCenter,e.initialZoom,e.layer)}),n.current.mapTypes.set(nt.IgnPlan,Lr()),s.current=new google.maps.OverlayView,s.current.draw=td.A,s.current.setMap(n.current),n.current.addListener("drag",()=>{e.onMapDrag?.()}),n.current.addListener("center_changed",()=>{e.onMapCenterChanged?.({lat:n.current.getCenter().lat(),lng:n.current.getCenter().lng()})}),n.current.addListener("zoom_changed",()=>{e.onMapZoomchanged?.(n.current.getZoom())}),n.current.addListener("click",t=>{e.showMarker&&(o.current?.setMap(null),o.current=new google.maps.Marker({position:t.latLng,map:n.current,draggable:!0}),e.onMarkerDragEnd?.(t.latLng.lat(),t.latLng.lng()),o.current.addListener("dragend",()=>{const t=o.current.getPosition();e.onMarkerDragEnd?.(t.lat(),t.lng())}))}),n.current.addListener("tilesloaded",()=>{setTimeout(()=>{e.onMapTilesloaded?.()},1e3)}),l(),jW(e.traces,e.hiddenTracesIds,a,n))},[]),n=(0,L.useRef)(null),s=(0,L.useRef)(null),o=(0,L.useRef)(null),r=(0,L.useRef)([]),a=(0,L.useRef)([]),l=()=>{r.current.forEach(e=>e.setMap(null)),r.current=e.positions.map(t=>{const i=Or(Pr(t)),o=new google.maps.Marker({position:i,map:n.current,icon:"acronym"===e.acronymIcon?`${P.HEAVENT_API_URL}/icons/acronym.svg?color=${encodeURIComponent(t.color)}&text=${t.acronym}`:`${P.HEAVENT_API_URL}/icons/${tl(t.icon)}.svg?color=${encodeURIComponent(t.color)}`});return o.addListener("click",()=>{const n=s.current?.getProjection()?.fromLatLngToContainerPixel(new google.maps.LatLng(i.lat,i.lng));n&&e.onPositionClick?.(t,n)}),o})};return(0,L.useEffect)(()=>{l()},[JSON.stringify(e.positions),e.acronymIcon]),(0,L.useEffect)(()=>{n.current?.setMapTypeId(Fr(e.layer))},[e.layer]),(0,L.useEffect)(()=>{jW(e.traces,e.hiddenTracesIds,a,n)},[JSON.stringify(e.traces),e.hiddenTracesIds]),(0,i.jsx)(Ar,{ref:t,height:1,width:1})},Mr.A);CW.displayName="PositionsMap";const yW=e=>{const t=Xn();return Ld(e.onClose),Nd(e.onClose),(0,i.jsxs)(Ba,{css:{background:"white",borderRadius:"$1",boxShadow:"$xs",padding:"$1 $3",width:"180px"},direction:"column",onClick:e=>{e.nativeEvent.stopImmediatePropagation()},children:[(0,i.jsxs)(Ba,{align:"center",css:{borderBottom:"1px solid $gray200",cursor:"pointer",py:"$2"},gap:"2",onClick:()=>{e.onChange("acronym")},children:[(0,i.jsx)(Ar,{fontSize:"textMd",children:(0,i.jsx)(nl,{icon:"text"})}),(0,i.jsx)(Ar,{color:"gray800",css:{flex:"1"},children:t("acronymes_11499")}),"acronym"===e.selectedAcronymIcon&&(0,i.jsx)(Ba,{align:"center",css:{fontSize:"$textMd"},justify:"center",children:(0,i.jsx)(nl,{icon:"circle-check",iconStyle:"duotone",primaryColor:"white",secondaryColor:xr.colors.primary600.value})})]}),(0,i.jsxs)(Ba,{align:"center",css:{cursor:"pointer",py:"$2"},gap:"2",onClick:()=>{e.onChange("icon")},children:[(0,i.jsx)(Ar,{fontSize:"textMd",children:(0,i.jsx)(nl,{icon:"location-dot"})}),(0,i.jsx)(Ar,{color:"gray800",css:{flex:"1"},children:t("ic_nes_16022")}),"icon"===e.selectedAcronymIcon&&(0,i.jsx)(Ba,{align:"center",css:{fontSize:"$textMd"},justify:"center",children:(0,i.jsx)(nl,{icon:"circle-check",iconStyle:"duotone",primaryColor:"white",secondaryColor:xr.colors.primary600.value})})]})]})},kW=e=>(Ld(e.onClose),Nd(e.onClose),(0,i.jsxs)(Ba,{css:{background:"white",borderRadius:"$1",boxShadow:"$xs",padding:"$1 $3",width:"180px"},direction:"column",onClick:e=>{e.nativeEvent.stopImmediatePropagation()},children:[(0,i.jsx)(Ba,{align:"center",css:{borderBottom:"1px solid $gray200",cursor:"pointer",py:"$2"},gap:"2",onClick:()=>{e.onExport("a3")},children:(0,i.jsx)(Ar,{color:"gray800",css:{flex:"1"},children:"A3 (420 x 297 mm)"})}),(0,i.jsx)(Ba,{align:"center",css:{cursor:"pointer",py:"$2"},gap:"2",onClick:()=>{e.onExport("a4")},children:(0,i.jsx)(Ar,{color:"gray800",css:{flex:"1"},children:"A4 (297 x 210 mm)"})})]})),AW=e=>(0,i.jsxs)(Ba,{align:"center",css:{cursor:"pointer",py:"$2","&:not(:last-child)":{borderBottom:"1px solid $gray200"}},gap:"2",onClick:e.onClick,children:[(0,i.jsx)(Ar,{css:{borderRadius:"$1",height:"32px",overflow:"hidden",width:"32"},children:(0,i.jsx)("img",{alt:"Layer",height:"32px",src:e.imageSrc,width:"32px"})}),(0,i.jsx)(Ar,{css:{flex:"1"},children:e.name}),e.isSelected&&(0,i.jsx)(Ba,{align:"center",css:{fontSize:"$textMd"},justify:"center",children:(0,i.jsx)(nl,{icon:"circle-check",iconStyle:"duotone",primaryColor:"white",secondaryColor:xr.colors.primary600.value})})]}),wW=e=>{const t=Xn();return Ld(e.onClose),Nd(e.onClose),(0,i.jsxs)(Ba,{css:{background:"white",borderRadius:"$1",boxShadow:"$xs",padding:"$1 $3",width:"180px"},direction:"column",onClick:e=>{e.nativeEvent.stopImmediatePropagation()},children:[(0,i.jsx)(AW,{imageSrc:fd.Maps.GooglePlan,isSelected:e.selectedLayer===nt.Google,name:"Plan",onClick:()=>{e.onChange(nt.Google)}}),(0,i.jsx)(AW,{imageSrc:fd.Maps.GoogleSatellite,isSelected:e.selectedLayer===nt.GoogleSatellite,name:t("satellite_82253"),onClick:()=>{e.onChange(nt.GoogleSatellite)}}),(0,i.jsx)(AW,{imageSrc:fd.Maps.IgnPlan,isSelected:e.selectedLayer===nt.IgnPlan,name:"IGN Plan",onClick:()=>{e.onChange(nt.IgnPlan)}})]})},SW=e=>(0,i.jsxs)(Ba,{align:"center",css:{background:"white",borderRadius:"$2",boxShadow:"$md",cursor:"pointer",height:"48px",minWidth:"180px",padding:"$2 $3",userSelect:"none"},gap:"3",onClick:t=>{Dl(t),e.onClick()},children:[e.children,(0,i.jsx)(Ar,{color:"gray700",children:e.isOpen?(0,i.jsx)(nl,{icon:"chevron-up"}):(0,i.jsx)(nl,{icon:"chevron-down"})})]});let EW=class extends Gl{constructor(e){super(e)}traceInputDefault(e){return{name:e?.name??"",color:e?.color??xr.colors.primary500.value,points:e?.points??[],direction:e?.direction??Tt.None}}traceInputSchema(){return d.Ik().shape({name:d.Yj().required(this.t("le_nom_du_trac_39859")),color:d.Yj().required(this.t("la_couleur_du_t_36646")),points:d.YO().required(this.t("le_trac_doit_c_20895")).min(2,this.t("le_trac_doit_c_20895"))})}createTraceSchema(){return d.Ik().shape({trace:this.traceInputSchema()})}updateNameSchema(){return d.Ik().shape({name:d.Yj().required(this.t("le_nom_du_trac_39859"))})}};function TW(e){const t=e.replace(/<\?xml(.*)\?>/,""),n=(new DOMParser).parseFromString(t,"text/xml");if(0!==n.querySelectorAll("parsererror").length)throw new Error("Could not parse: "+e);return n}EW=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[qn])],EW);const zW=e=>{const t=parseFloat(e.getAttribute("lat")),n=parseFloat(e.getAttribute("lon"));return isNaN(t)||isNaN(n)?[]:[[t,n]]},OW=e=>{const t=Xn(),n=Zn(EW),s=Zn(Ua),[o,r]=(0,L.useState)({name:e.trace?`${h(e.trace.name)}.gpx`:"",content:""}),{mutate:a,isLoading:l}=function(e={}){return ei("mutation TraceCreate($eventId: EventId!, $trace: TraceInput!) {\n traceCreate(eventId: $eventId, trace: $trace) {\n id\n }\n}\n",e)}(),{mutate:d,isLoading:c}=function(e={}){return ei("mutation TraceUpdate($eventId: EventId!, $traceId: TraceId!, $trace: TraceInput!) {\n traceUpdate(eventId: $eventId, traceId: $traceId, trace: $trace) {\n id\n }\n}\n",e)}();return(0,i.jsx)(kl,{hideDefaultErrors:!0,initialValues:{trace:n.traceInputDefault(e.trace)},render:({form:n,handleSubmit:s})=>(0,i.jsxs)(au,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Ar,{color:"primary600",fontSize:"displayXs",textAlign:"center",children:(0,i.jsx)(nl,{icon:"route"})}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(Ar,{color:"gray900",fontSize:"textLg",textAlign:"center",children:t("ajouter_un_trac_05425")}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(jl,{}),(0,i.jsx)(Vl,{label:t("nom_du_trac_16379"),name:"trace.name",placeholder:t("nom_du_trac_16379")}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(iV,{accept:yv.Gpx,format:"string",label:t("fichier_gpx_55484"),placeholder:t("s_lectionnez_un_17918"),value:o,onChange:e=>{r(e),n.change("trace.points",function(e){const t=TW(e),n=Array.from(t.querySelectorAll("trk trkseg trkpt")),i=Array.from(t.querySelectorAll("wpt")),s=Array.from(t.querySelectorAll("rte rtept"));return n.length>0?n.flatMap(zW):i.length>0?i.flatMap(zW):s.flatMap(zW)}(e.content))}}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(qj,{label:t("couleur_du_trac_28854"),name:"trace.color"}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsxs)(Qj,{label:t("sens_du_trac_49290"),name:"trace.direction",children:[(0,i.jsx)("option",{value:Tt.None,children:t("aucun_93456")}),(0,i.jsx)("option",{value:Tt.Forward,children:t("en_avant_17614")}),(0,i.jsx)("option",{value:Tt.Backward,children:t("en_arri_re_24636")})]}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsxs)(Ba,{gap:"3",justify:"end",children:[(0,i.jsx)(zl,{isLoading:l||c,onClick:s,children:e.traceId?t("mettre_jour_85141"):t("ajouter_97327")}),(0,i.jsx)(zl,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]}),validate:s.validateForForm(n.createTraceSchema()),onSubmit:async t=>{e.traceId?await d({eventId:e.eventId,traceId:e.traceId,trace:t.trace}):await a({eventId:e.eventId,trace:t.trace}),e.onClose(),e.reload()}})},RW=e=>{const t=Xn(),{mutate:n}=function(e={}){return ei("mutation TraceDelete($eventId: EventId!, $traceId: TraceId!) {\n traceDelete(eventId: $eventId, traceId: $traceId) {\n id\n }\n}\n",e)}(),[s,o]=(0,L.useState)(!1),[r,a]=(0,L.useState)(!1);return(0,i.jsxs)(Ba,{align:"center",css:{py:"$2","&:not(:last-child)":{borderBottom:"1px solid $gray200"}},gap:"2",children:[(0,i.jsx)(Ar,{css:{background:e.trace.color,borderRadius:"$1",height:"16px",width:"16px"}}),(0,i.jsx)(Ar,{color:"gray900",css:{flex:"1",ellipsis:!0},children:e.trace.name}),(0,i.jsx)(Ar,{color:"gray700",css:{cursor:"pointer"},onClick:()=>{e.toggleVisible(e.trace.id)},children:(0,i.jsx)(nl,{icon:e.isHidden?"eye-slash":"eye"})}),(0,i.jsx)(Ar,{color:"gray700",css:{cursor:"pointer"},onClick:()=>{a(!0)},children:(0,i.jsx)(nl,{icon:"pen"})}),(0,i.jsx)(Ar,{color:"gray700",css:{cursor:"pointer"},onClick:()=>{o(!0)},children:(0,i.jsx)(nl,{icon:"xmark"})}),s&&(0,i.jsx)(cA,{buttonText:t("supprimer_43083"),subtext:t("_tes_vous_s_r_d_34035"),text:t("suppression_de_73669",e.trace.name),onClose:()=>{o(!1)},onDelete:async()=>{await n({eventId:e.eventId,traceId:e.trace.id}),e.reload()}}),r&&(0,i.jsx)(OW,{eventId:e.eventId,reload:e.reload,trace:e.trace,traceId:e.trace.id,onClose:()=>{a(!1)}})]})},$W=e=>{const t=Xn();return Ld(e.onClose),Nd(e.onClose),(0,i.jsxs)(Ba,{css:{background:"white",borderRadius:"$1",boxShadow:"$xs",padding:"$1 $3",width:"240px"},direction:"column",onClick:e=>{e.nativeEvent.stopImmediatePropagation()},children:[e.traces.map(t=>(0,i.jsx)(RW,{eventId:e.eventId,isHidden:e.hiddenTracesIds.includes(t.id),reload:e.reload,toggleVisible:e.toggleVisible,trace:t},t.id)),(0,i.jsx)(Ar,{color:"primary500",css:{cursor:"pointer",py:"$2"},onClick:()=>{e.onAddTrace(),e.onClose()},children:t("ajouter_un_trac_05425")})]})},DW=e=>{const{translate:t,params:{eventId:n}}=vl(),[s,o]=(0,L.useState)(!1),[r,a]=(0,L.useState)(!1),[l,d]=(0,L.useState)(!1),[c,u]=(0,L.useState)(!1),[h,m]=(0,L.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ba,{css:{bottom:"12px",left:"12px",position:"absolute",zIndex:10},gap:"2",children:[(0,i.jsx)(Ba,{align:"center",css:{background:"white",borderRadius:"$2",boxShadow:"$md",cursor:"pointer",fontSize:"$textLg"},height:48,justify:"center",width:48,onClick:()=>{e.onFullscreen()},children:(0,i.jsx)(nl,{icon:"expand"})}),(0,i.jsxs)(SW,{isOpen:s,onClick:()=>{o(e=>!e),a(()=>!1),d(()=>!1),u(()=>!1)},children:[(0,i.jsx)(Ar,{css:{borderRadius:"$1",height:"32px",overflow:"hidden",width:"32px"},children:(0,i.jsx)("img",{alt:"Layer",height:"32px",src:e.layer===nt.Google?fd.Maps.GooglePlan:e.layer===nt.GoogleSatellite?fd.Maps.GoogleSatellite:fd.Maps.IgnPlan,width:"32px"})}),(0,i.jsx)(Ar,{color:"gray900",css:{flex:"1"},children:e.layer===nt.Google?"Plan":e.layer===nt.GoogleSatellite?t("satellite_82253"):"IGN Plan"})]}),(0,i.jsx)(SW,{isOpen:r,onClick:()=>{o(()=>!1),a(e=>!e),d(()=>!1),u(()=>!1)},children:(0,i.jsxs)(Ba,{align:"center",css:{flex:"1"},gap:"1",children:[(0,i.jsx)(Ar,{color:"gray900",children:t("trac_s_41454")}),(0,i.jsx)(Ya,{width:"1"}),e.traces.map(e=>(0,i.jsx)(Ar,{css:{background:e.color,borderRadius:"$1",height:"16px",width:"16px"}},e.id))]})}),e.showAcronymIcon&&(0,i.jsx)(SW,{isOpen:l,onClick:()=>{o(()=>!1),a(()=>!1),d(e=>!e),u(()=>!1)},children:(0,i.jsxs)(Ba,{align:"center",css:{flex:"1"},gap:"2",children:[(0,i.jsx)(Ar,{fontSize:"textMd",children:(0,i.jsx)(nl,{icon:"acronym"===e.acronymIcon?"text":"location-dot"})}),(0,i.jsx)(Ar,{color:"gray900",children:"acronym"===e.acronymIcon?t("acronymes_11499"):t("ic_nes_16022")})]})}),e.showExport&&(0,i.jsx)(SW,{isOpen:c,onClick:()=>{o(()=>!1),a(()=>!1),d(()=>!1),u(e=>!e)},children:(0,i.jsxs)(Ba,{align:"center",css:{flex:"1"},gap:"2",children:[(0,i.jsx)(Ar,{fontSize:"textMd",children:(0,i.jsx)(nl,{icon:"file-export"})}),(0,i.jsx)(Ar,{color:"gray900",children:t("exporter_59120")})]})})]}),s&&(0,i.jsx)(Ar,{css:{bottom:"64px",left:"68px",position:"absolute",zIndex:10},children:(0,i.jsx)(wW,{selectedLayer:e.layer,onChange:e.setLayer,onClose:()=>o(!1)})}),r&&(0,i.jsx)(Ar,{css:{bottom:"64px",left:"256px",position:"absolute",zIndex:10},children:(0,i.jsx)($W,{eventId:n,hiddenTracesIds:e.hiddenTracesIds,reload:e.reload,toggleVisible:t=>{e.setHiddenTracesIds(ao(e.hiddenTracesIds,t))},traces:e.traces,onAddTrace:()=>{m(!0)},onClose:()=>{a(!1)}})}),h&&(0,i.jsx)(OW,{eventId:n,reload:e.reload,onClose:()=>{m(!1)}}),l&&(0,i.jsx)(Ar,{css:{bottom:"64px",left:"444px",position:"absolute",zIndex:10},children:(0,i.jsx)(yW,{selectedAcronymIcon:e.acronymIcon,onChange:e.setAcronymIcon,onClose:()=>d(!1)})}),c&&(0,i.jsx)(Ar,{css:{bottom:"64px",left:"632px",position:"absolute",zIndex:10},children:(0,i.jsx)(kW,{onClose:()=>u(!1),onExport:e.onExport})})]})},PW=e=>{const{organizationId:t,eventId:n}=ti(),s=Zn(ph);return(0,i.jsx)(Ba,{align:"center",css:{background:"white",borderRadius:"$1",boxShadow:"$xs",padding:"$4"},gap:"4",height:70,children:(0,i.jsxs)(el,{to:xs.POSITION({organizationId:t,eventId:n,positionId:e.position.id}),children:[(0,i.jsxs)(Ba,{direction:"column",children:[(0,i.jsx)(Ar,{color:"gray800",children:e.position.name}),(0,i.jsx)(Ar,{color:"gray500",fontSize:"textXs",children:e.position.range?s.toDisplayString(e.position.range):"-"})]}),(0,i.jsx)(Ar,{children:(0,i.jsx)(nl,{icon:"chevron-right"})})]})})},FW=e=>{const{translate:t,params:{eventId:n,segmentId:s}}=vl(),{isEventAdmin:o,localEvent:r,updateLocalEvent:a}=wb(),{mutate:l}=So(),{setNewPositionLatLng:d}=ZU(),[c,u]=(0,L.useState)(e.layer),[h,m]=(0,L.useState)([]),[g,p]=(0,L.useState)(null),[f,_]=kz("positionsMap.center",e.center),[x,I]=kz("positionsMap.zoom",$r),[v,b]=kz("positionsMap.acronymIcon","icon"),[j,C]=(0,L.useState)(r?.isPositionsMapAlertVisible??!0),y=(0,L.useRef)(null),k=(0,L.useCallback)(e=>{const t=f?`${f.lat},${f.lng}`:"",i=new URLSearchParams;i.set("format",e),i.set("hiddenTracesIds",h.join(",")),i.set("center",t),i.set("acronymIcon",v),i.set("zoom",x.toString(10)),window.open(`${P.HEAVENT_API_URL}/image/event/${n}/positions/${s}/map.png?${i.toString()}`)},[f,x,h,v]);return(0,i.jsxs)(Ba,{css:{flex:"1",position:"relative"},direction:"column",width:1,children:[o&&j&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(rl,{leftIcon:"circle-exclamation",rightIcon:"xmark",rightIconClick:async()=>{await a({isPositionsMapAlertVisible:!1}),C(!1)},children:t("pour_cr_er_une_11133")}),(0,i.jsx)(Ya,{height:"6"})]}),(0,i.jsx)(Ar,{ref:y,css:{flex:"1",borderRadius:"$1"},width:1,children:(0,i.jsx)(CW,{acronymIcon:v,hiddenTracesIds:h,initialCenter:f,initialZoom:x,layer:c,positions:e.positions,showMarker:o,traces:e.traces,onMapCenterChanged:_,onMapDrag:()=>p(null),onMapZoomchanged:e=>{p(null),I(e)},onMarkerDragEnd:(e,t)=>d({latitude:e,longitude:t}),onPositionClick:(e,t)=>p({position:e,left:t.x,top:t.y})})}),o&&(0,i.jsx)(DW,{acronymIcon:v,hiddenTracesIds:h,layer:c,reload:e.reload,setAcronymIcon:b,setHiddenTracesIds:m,setLayer:async e=>{u(e),await l({eventId:n,layer:e})},showAcronymIcon:!0,showExport:!0,traces:e.traces,onExport:k,onFullscreen:()=>{y.current?.requestFullscreen()}}),y.current&&g&&(0,Kt.createPortal)((0,i.jsx)(Ar,{css:{left:`${g.left+32}px`,position:"absolute",top:g.top-35-16+"px",zIndex:10},children:(0,i.jsx)(PW,{position:g.position})}),y.current)]})},MW=e=>{const{eventId:t}=ti(),{data:n,loader:s,reload:o}=Ia({eventId:t,includeCheckedInRate:!1,includeConditions:!1,includeCreatedBy:!1,includeLeaders:!1,includeTags:!1,includeTraces:!0,name:m(e.name)?e.name:null,predicates:e.predicates,hasCoordinates:!0});return s?(0,i.jsx)(Ba,{css:{flex:"1"},children:s}):(0,i.jsx)(FW,{center:Ux(n.data),layer:n.data.layer,positions:n.data.rows.nodes,reload:o,traces:n.data.traces||[]})};var NW=n(6965);const LW=e=>{const t=L.useMemo(()=>e.startOfDay.plus({day:1}).minus({second:1}),[e.startOfDay]),n=L.useMemo(()=>Gs.IX.fromDateTimes(e.startOfDay,t).overlaps(e.slot.range),[e.startOfDay,t,e.slot]),s=L.useMemo(()=>n?Gs.IX.fromDateTimes(Gs.c9.max(e.startOfDay,e.slot.range.start),Gs.c9.min(t,e.slot.range.end)):e.slot.range,[n,e.startOfDay,t,e.slot]),o=L.useMemo(()=>{const t=s.start.diff(e.startOfDay).shiftTo("hours","minutes");return Math.floor(1+60*t.hours+t.minutes)},[e.startOfDay,s]),r=L.useMemo(()=>{const t=s.end.diff(e.startOfDay).shiftTo("hours","minutes");return Math.floor(1+60*t.hours+t.minutes)},[e.startOfDay,s]);return n?(0,i.jsx)(Ba,{css:{gridColumnStart:o,gridColumnEnd:r},height:32,children:e.renderSlot(e.slot,e.row)},s.toISO()):null},BW=e=>{const[t,n]=L.useState(null),s=L.useCallback(e=>{e&&n(e.getBoundingClientRect())},[]),[o,r]=L.useState(!1),[a,l]=L.useState(1),d=L.useMemo(()=>e.date.startOf("day").set({hour:e.startHour}),[e.date,e.startHour]),c=L.useCallback(e=>{const n=Math.floor(1440*(e.clientX-(t?.left??0))/(t?.width??0)),i=n-n%60+1;i!==a&&l(i)},[t,a,l]),u=L.useCallback(n=>{const i=Math.floor(1440*(n.clientX-(t?.left??0))/(t?.width??0)),s=i-i%60,o=d.plus({minute:s});e.onPlus?.(o,e.row)},[d,e.row,e.onPlus,t]);return(0,i.jsxs)(Ba,{className:"h-planning-data-row",css:{borderBottom:"1px solid $gray200"},width:1,children:[(0,i.jsx)(Ba,{css:{borderRight:"1px solid $gray200",width:"calc(2 * $cellWidth)"},children:e.renderLeftCell(e.row)}),(0,i.jsxs)(Ba,{css:{flex:"1",py:"$3",position:"relative"},children:[(0,i.jsx)(hd,{ref:s,css:{cursor:e.showPlus?"pointer":"inherit",gridAutoFlow:"column",overflow:"hidden",rowGap:"$2",zIndex:10},gridtemplatecolumns:"repeat(1440, 1fr)",width:1,onClick:e.showPlus?u:void 0,onMouseMove:e.showPlus?c:void 0,onMouseOut:()=>{r(!1)},onMouseOver:()=>{r(!0)},children:e.row.slots.map((t,n)=>(0,i.jsx)(LW,{renderSlot:e.renderSlot,row:e.row,slot:t,startOfDay:d},n))}),e.showPlus&&(0,i.jsx)(hd,{css:{bottom:"0",left:"0",position:"absolute",right:"0",top:"0",zIndex:5},gridtemplatecolumns:"repeat(1440, 1fr)",children:o&&(0,i.jsx)(Ba,{align:"center",css:{gridColumn:`${a} / span 60`,padding:"$1"},height:1,justify:"center",children:(0,i.jsx)(Ba,{align:"center",css:{background:"$gray100",borderRadius:"$1",color:"$gray800",cursor:"pointer",fontSize:"$textMd"},height:1,justify:"center",width:1,children:(0,i.jsx)(nl,{icon:"plus"})})})}),(0,i.jsx)(hd,{css:{bottom:"0",left:"0",position:"absolute",right:"0",top:"0",zIndex:1},gridtemplatecolumns:"repeat(1440, 1fr)",children:(0,Dc.A)(0,23).map(e=>(0,i.jsx)(Ar,{css:{borderRightColor:"$gray200",borderRightStyle:"dashed",borderRightWidth:"1px",gridColumn:`${60*e+1} / ${60*e+61}`}},e))})]})]})},VW=e=>{const t=Zn(Jc),n=e.date.startOf("day").equals(e.minDate.startOf("day")),s=e.date.endOf("day").equals(e.maxDate.endOf("day"));return(0,i.jsxs)(Ba,{css:{border:"1px solid $gray200",...e.css},direction:"column",width:1,children:[(0,i.jsxs)(Ba,{css:{borderBottom:"1px solid $gray200"},height:52,width:1,children:[(0,i.jsxs)(Ba,{align:"center",css:{borderRight:"1px solid $gray200",px:"$4",width:"calc(2 * $cellWidth)"},gap:"3",height:1,children:[(0,i.jsx)(Mu,{max:e.maxDate,min:e.minDate,value:e.date,onChange:e.onChange}),e.renderFilters?.()]}),(0,i.jsxs)(Ba,{align:"center",css:{flex:"1",px:"$2"},gap:"3",children:[(0,i.jsx)(zl,{color:"white",disabled:n,leftIcon:"chevron-left",onClick:()=>{e.onChange(e.date.minus({day:1}))}}),(0,i.jsx)(Ar,{css:{flex:"1",textTransform:"capitalize"},font:"gray800 textSm medium",textAlign:"center",children:t.toLocaleString(e.date,eo.DateOnly.WeekdayLongMonthLong)}),(0,i.jsx)(zl,{color:"white",disabled:s,leftIcon:"chevron-right",onClick:()=>{e.onChange(e.date.plus({day:1}))}})]})]}),(0,i.jsxs)(Ba,{css:{background:"$gray50",borderBottom:"1px solid $gray200"},height:24,width:1,children:[(0,i.jsx)(Ba,{css:{borderRight:"1px solid $gray200",width:"calc(2 * $cellWidth)"}}),(0,i.jsx)(Ba,{css:{flex:"1"},children:(0,i.jsxs)(hd,{gridtemplatecolumns:"repeat(1440, 1fr)",height:1,width:1,children:[(0,i.jsx)(Ar,{css:{gridColumn:"span 60"}}),(0,Dc.A)(e.startHour+2,e.startHour+24,2).map(e=>(0,i.jsxs)(Ba,{align:"center",css:{fontSize:"$textXs",gridColumn:"span 120"},justify:"center",children:[(0,NW.A)((e>=24?e-24:e).toString(10),2,"0"),":00"]},e))]})})]}),e.data.map(t=>(0,i.jsx)(BW,{date:e.date,renderLeftCell:e.renderLeftCell,renderSlot:e.renderSlot,row:t,showPlus:e.showPlus,startHour:e.startHour,onPlus:e.onPlus},t.id.toString(10)))]})},UW=e=>{const{params:{organizationId:t,eventId:n}}=vl();return(0,i.jsxs)(Ba,{css:{padding:"$1 $4"},direction:"column",height:1,justify:"center",width:1,children:[(0,i.jsx)(Zc,{css:{overflow:"hidden",width:"100%"},to:xs.POSITION({organizationId:t,eventId:n,positionId:e.position.id}),children:(0,i.jsx)(Ar,{css:{ellipsis:!0},title:e.position.name,width:1,children:e.position.name})}),(0,i.jsx)(Ar,{color:"gray500",css:{ellipsis:!0},title:e.position.category.name,width:1,children:e.position.category.name})]})},WW=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=vl(),o=Zn(ph),r="number"==typeof e.slot.assignedResources&&"number"==typeof e.slot.fillingRate&&"number"==typeof e.slot.resources;return(0,i.jsxs)(Ba,{direction:"column",width:1,children:[(0,i.jsxs)(Ba,{css:{borderBottom:"1px solid $gray200",padding:"$4 $3 $3 $6"},gap:"4",children:[(0,i.jsx)(WC,{color:e.position.color,icon:e.position.icon}),(0,i.jsxs)(Ba,{direction:"column",children:[(0,i.jsx)(Zc,{to:xs.POSITION({organizationId:n,eventId:s,positionId:e.position.id}),children:(0,i.jsx)(Ar,{css:{ellipsis:!0},width:1,children:e.position.name})}),(0,i.jsx)(Ar,{color:"gray500",children:e.category.name})]})]}),(0,i.jsxs)(Ba,{css:{padding:"$5 $6 $4 $6"},direction:"column",gap:"6",children:[(0,i.jsxs)(Ba,{direction:"column",gap:"1",children:[(0,i.jsx)(Ar,{color:"gray500",children:t("nom_du_cr_neau_54351")}),(0,i.jsx)(Ar,{font:"gray800 textSm medium",children:m(e.slot.name)?e.slot.name:"-"})]}),(0,i.jsxs)(Ba,{direction:"column",gap:"1",children:[(0,i.jsx)(Ar,{color:"gray500",children:t("cr_neau_horaire_28150")}),(0,i.jsx)(Ar,{css:{textTransform:"capitalize"},font:"gray800 textSm medium",children:o.toDisplayString(e.slot.range,{formats:{displayWeekday:!0}})})]}),r&&(0,i.jsxs)(Ba,{direction:"column",gap:"1",children:[(0,i.jsxs)(Ba,{justify:"between",children:[(0,i.jsx)(Ar,{color:"gray500",children:t("membres_11310")}),(0,i.jsxs)(Ar,{color:"gray500",children:[e.slot.assignedResources,"/",e.slot.resources]})]}),(0,i.jsx)(Ar,{css:{textTransform:"capitalize"},font:"gray800 textSm medium",children:(0,i.jsx)(Ow,{percent:e.slot.fillingRate/100})})]})]}),(0,i.jsx)(Ba,{css:{padding:"$4"},gap:"4",justify:"end",children:(0,i.jsx)(zl,{to:Ps.POSITION_SLOT_ASSIGN_VOLUNTEERS(n,s,e.position.id,e.slot.id),children:t("affecter_sur_le_19590")})})]})},GW=e=>{const t=Ch(Zn(ph),e.slot,"",{interval:{options:{hideDate:!0}},slot:{includeRange:!0}});return(0,i.jsxs)(Wd,{children:[(0,i.jsx)(Xd,{children:(0,i.jsx)(Ba,{align:"center",css:{background:zw(e.slot.fillingRate/100),borderRadius:"$1",cursor:"pointer",px:"$2",userSelect:"none"},height:1,width:1,children:(0,i.jsx)(Ar,{css:{ellipsis:!0},font:"white textXs medium",title:t,width:1,children:t})})}),(0,i.jsx)(Zd,{css:{padding:"0"},placement:"bottom-start",renderOnPortal:!0,width:460,children:(0,i.jsx)(WW,{category:e.position.category,position:e.position,slot:e.slot})})]})},HW=e=>{const{params:{eventId:t}}=vl(),n=Zn(EU),{infos:s,isEditMode:o,limit:r,nameDebounced:a,offset:l,predicates:d,setInfos:c,setLimit:u,setOffset:h}=vy(),{mutate:g}=function(e={}){return ei("mutation PositionSlotCreate(\n $eventId: EventId!\n $positionId: PositionId!\n $positionSlot: PositionsSlotInput!\n) {\n positionSlotCreate(eventId: $eventId, positionId: $positionId, positionSlot: $positionSlot) {\n id\n }\n}\n",e)}(),{data:p,loader:f}=Qn("query PositionsPlanning(\n $eventId: EventId!\n $name: String\n $predicates: [Predicate!]\n $limit: Int\n $offset: Int\n) {\n data: event(id: $eventId) {\n rows: positions(name: $name, predicates: $predicates, limit: $limit, offset: $offset) {\n nodes {\n ...PositionPlanning\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{eventId:t,name:m(a)?a:void 0,predicates:d,limit:r,offset:l},[Vs.PositionPlanningFragment]);const{numberOfPages:_,totalCount:x}=Su(p.data?.rows),[I,v]=(0,L.useState)([]),b=(0,L.useMemo)(()=>Gs.c9.isDateTime(s.positionsPlanningStartAt)&&s.positionsPlanningStartAt?.isValid?s.positionsPlanningStartAt:Gs.c9.fromISO(s.positionsPlanningStartAt)?.isValid?Gs.c9.fromISO(s.positionsPlanningStartAt,{zone:"utc"}):Gs.IX.fromDateTimes(e.startAt.startOf("day"),e.endAt.endOf("day")).contains(Gs.c9.utc())?Gs.c9.utc():e.startAt,[e.startAt,e.endAt,s]),j=(0,L.useCallback)(t=>{c({...s,positionsPlanningStartAt:t?.toISO()??e.startAt.toISO()})},[e.startAt,s,c]),[C,y]=(0,L.useState)(!1),[k,A]=(0,L.useState)(e.startAt),[w,S]=(0,L.useState)(-1),E=(0,L.useMemo)(()=>{const t=jh(e.dayStartTime);return t?.[0]??0},[e.dayStartTime]),T=(0,L.useCallback)(async e=>{const{data:{row:n}}=await function(e,t){return go("query PositionsPlanningPosition($eventId: EventId!, $positionId: PositionId!) {\n data: event(id: $eventId) {\n row: position(id: $positionId) {\n ...PositionPlanning\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[Vs.PositionPlanningFragment]})}({eventId:t,positionId:e},await Y());v(t=>t.map(t=>t.id===e?n:t))},[t]);return(0,L.useEffect)(()=>{v(p.data?.rows.nodes??[])},[p.data]),f||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ba,{css:{flex:"1"},direction:"column",width:1,children:[(0,i.jsx)(Ba,{css:{background:"white",flex:"1"},children:(0,i.jsx)(VW,{data:I,date:b,maxDate:e.endAt,minDate:e.startAt,renderLeftCell:e=>(0,i.jsx)(UW,{position:e}),renderSlot:(e,t)=>(0,i.jsx)(GW,{position:t,slot:e}),showPlus:o,startHour:E,onChange:j,onPlus:(e,t)=>{A(e),y(!0),S(t.id)}})}),(0,i.jsx)(Nc,{children:(0,i.jsx)(Fc,{limit:r,numberOfPages:_,offset:l,setLimit:u,setOffset:h,showLimits:!0,totalCount:x})})]}),C&&(0,i.jsx)(DU,{event:{endAt:e.endAt,startAt:e.startAt},slot:n.positionsSlotInputDefault(k),onClose:()=>{y(!1)},onSuccess:async e=>(await g({eventId:t,positionId:w,positionSlot:e}),T(w))})]})};function qW(e,t,n,i){const s=TW(e),o=(e=>Object.fromEntries(Array.from(e.querySelectorAll("Style")).map(e=>{const t=e.getAttribute("id"),[,,n,i,s,o,r,a]=(e.querySelector("color")?.textContent||"").trim().split("");return[`#${t}`,`#${r}${a}${s}${o}${n}${i}`]})))(s);return Array.from(s.querySelectorAll("Placemark")).map(e=>((e,t,n,i,s)=>{const[o,r]=(e.querySelector("Point coordinates")?.textContent||"").trim().split(",");return{positionCategoryId:t,name:(e.querySelector("name")?.textContent||"").trim(),description:(e.querySelector("description")?.textContent||"").trim(),color:s[`${e.querySelector("styleUrl")?.textContent||""}-normal`]||xr.colors.primary500.value,icon:Xe.LocationDot,layer:n,latitude:parseFloat(r),longitude:parseFloat(o),tracesIds:[],slots:[{startDate:i,startTime:"08:00",endDate:i,endTime:"09:00",resources:1}],conditionsOperator:_e.And,positionsCustomFields:[],tagsIds:[],fields:{},leadersIds:[]}})(e,t,n,i,o))}const KW=e=>{const t=Xn(),{data:n,loader:s}=Qn("query KmlEventInfos($eventId: EventId!) {\n event(id: $eventId) {\n layer\n startAt\n\n positionsCategories {\n id\n name\n }\n }\n}\n",{eventId:e.eventId},[]);const{mutate:o,isLoading:r}=function(e={}){return ei("mutation PositionsCreate($eventId: EventId!, $positions: [PositionInput!]!) {\n positionsCreate(eventId: $eventId, positions: $positions) {\n id\n }\n}\n",e)}(),[a,l]=(0,L.useState)(),[d,c]=(0,L.useState)(-1),u=m(a?.content)&&-1!==d;return(0,i.jsxs)(au,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Ar,{color:"primary600",fontSize:"displayXs",textAlign:"center",children:(0,i.jsx)(nl,{icon:"cloud-arrow-up"})}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(Ar,{color:"gray900",fontSize:"textLg",textAlign:"center",children:t("importer_des_mi_32264")}),(0,i.jsx)(Ya,{height:"7"}),s||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(iV,{accept:yv.Kml,format:"string",label:t("fichier_kml_55657"),placeholder:t("s_lectionnez_un_75984"),value:a,onChange:e=>{l(e)}}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsxs)($u,{label:t("cat_gorie_00291"),shouldParseAsInt:!0,value:d??-1,onChange:e=>{c(e)},children:[(0,i.jsx)("option",{disabled:!0,value:"-1",children:t("choisissez_la_c_72356")}),n.event.positionsCategories.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))]})]}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsxs)(Ba,{gap:"3",justify:"end",children:[(0,i.jsx)(zl,{disabled:!u,isLoading:r,onClick:async()=>{a&&(await o({eventId:e.eventId,positions:qW(a.content,d,n.event.layer,n.event.startAt)}),window.location.reload())},children:t("importer_90688")}),(0,i.jsx)(zl,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},YW=({name:e,numberOfCategories:t,segment:n})=>{const{history:s,params:{organizationId:o,eventId:r},translate:a}=vl(),{user:l}=ai(),{hasFeature:d}=TI(),{hasPermission:c}=wb(),{newPositionLatLng:u}=ZU(),{data:h,isLoading:m}=Qn("query PositionsHeader($eventId: EventId!, $segmentId: SegmentId!) {\n event(id: $eventId) {\n key\n\n segment(id: $segmentId) {\n count\n\n links {\n positionsPlanningLink\n positionsVolunteersPlanningLink\n }\n\n stats {\n ... on PositionsSegmentStats {\n assignedResources\n resources\n }\n }\n }\n }\n}\n",{eventId:r,segmentId:n.id},[]);const[g,p]=(0,L.useState)(!1),[f,_]=(0,L.useState)(!1),[x,I]=(0,L.useState)(!1),[v,b]=(0,L.useState)(!1),j=c(Hb.POSITION_EDIT,{eventId:"ANY"}),C=c(Hb.POSITION_EDIT,{positionCategoryId:"ANY"}),y=(0,L.useMemo)(()=>{let e;return u&&(e=`${u.latitude},${u.longitude}`),Ps.CREATE_POSITION(o,r,e)},[u]);return(0,i.jsxs)(g$,{name:(0,i.jsxs)(Ba,{align:"center",css:{flex:"1",overflow:"hidden",position:"relative"},gap:"2",children:[(0,i.jsx)(Ar,{css:{ellipsis:!0},font:"gray900 displaySm semiBold",title:e,children:e}),(0,i.jsxs)(km,{children:[(0,i.jsx)(Sm,{children:(0,i.jsx)(Ar,{color:"gray500",children:(0,i.jsx)(nl,{icon:"circle-exclamation"})})}),(0,i.jsxs)(wm,{placement:"bottom-start",renderOnPortal:!0,children:[a("nombre_de_missi_06171",h.event?.segment.count??0),(0,i.jsx)("br",{}),a("nombre_de_membr_16367",h.event?.segment.stats?.assignedResources??0),(0,i.jsx)("br",{}),a("nombre_de_membr_29724",h.event?.segment.stats?.resources??0)]})]})]}),children:[j?(0,i.jsx)(nE,{menu:(0,i.jsxs)(i.Fragment,{children:[d(Be.KmlImport)&&(0,i.jsx)(Kd,{color:0===t?"disabled":"default",icon:"file-import",onClick:()=>{p(!1),b(!0)},children:a("importer_des_mi_32264")}),(0,i.jsx)(Kd,{icon:"file-import",to:xs.POSITION_IMPORT_CSV({organizationId:o,eventId:r}),children:a("import_tasks_fr_52548")})]}),path:y,children:a("cr_er_une_missi_66818")}):C?(0,i.jsx)(zl,{onClick:()=>{s.push(y)},children:a("cr_er_une_missi_66818")}):null,j&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Wd,{isOpen:g,onStateChange:p,children:[(0,i.jsx)(Xd,{children:(0,i.jsx)(zl,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Zd,{placement:"bottom-end",children:[(0,i.jsx)(Kd,{icon:"plus",onClick:()=>{p(!1),I(!0)},children:a("cr_er_une_cat_g_20051")}),(0,i.jsx)(Xu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Kd,{icon:"calendar",to:_g(h.event?.segment.links.positionsPlanningLink,"html"),children:a("voir_le_plannin_85187")}),(0,i.jsx)(Kd,{icon:"calendar",to:_g(h.event?.segment.links.positionsVolunteersPlanningLink,"html"),children:a("voir_le_plannin_47650")}),(0,i.jsx)(Kb,{permissions:Hb.POSITION_EDIT,children:(0,i.jsx)(Kd,{icon:"plug-circle-bolt",onClick:e=>{Vd(e.target),_(!0)},children:a("exporter_via_l_09843")})}),(0,i.jsx)(Kd,{download:`${n.name}-positions-planning`,icon:"arrow-down-to-bracket",to:_g(h.event?.segment.links.positionsPlanningLink,"pdf"),children:a("t_l_charger_le_06050")}),(0,i.jsx)(Kd,{download:`${n.name}-positions-volunteers-planning`,icon:"arrow-down-to-bracket",to:_g(h.event?.segment.links.positionsVolunteersPlanningLink,"pdf"),children:a("t_l_charger_le_02952")})]})]}),x&&(0,i.jsx)(zU,{eventId:r,onClose:()=>{I(!1)},onSuccess:({id:e})=>{s.push(xs.POSITION_CATEGORY({organizationId:o,eventId:r,positionCategoryId:e}))}}),v&&(0,i.jsx)(KW,{eventId:r,onClose:()=>{b(!1)}}),!m&&(0,i.jsx)(vD,{isOpen:f,link:fg({organizationId:o,eventId:r,lang:l?.language,pathComponent:"positions",key:h.event.key}),onClose:()=>{_(!1)}})]})]})},ZW=e=>{const t=Xn(),n=ii(),{hasPermission:s,updateLocalEvent:o}=wb(),{limit:r,nameDebounced:a,predicates:l,rendering:d,segment:c}=vy(),u=s(Hb.SEGMENT_EDIT)&&(d===Wh.List||d===Wh.SlotsList),h=s(Hb.POSITION_EDIT,{eventId:"ANY"})&&(d===Wh.Calendar||d===Wh.List||d===Wh.SlotsList);return(0,L.useEffect)(()=>{o({positionBackPath:n.pathname,positionCategoryBackPath:n.pathname})},[c]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(YW,{name:c.name,numberOfCategories:e.event.positionsCategories.length,segment:c}),0===e.event.numberOfPositions&&d!==Wh.Map?(0,i.jsx)(aj,{css:{overflow:"hidden"},children:(0,i.jsx)(Ar,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(Gk,{subtitle:t("plus_besoin_de_08254"),title:t("vous_n_avez_pas_08610")})})}):(0,i.jsxs)(aj,{children:[(0,i.jsx)(m$,{searchRow:(0,i.jsx)(u$,{actions:(0,i.jsx)(mW,{}),searchPlaceholder:t("rechercher_une_69998"),showActions:s(Hb.POSITION_EDIT),showEditColumns:u,showEditMode:h,showSearchColumns:s(Hb.SEGMENT_EDIT)}),selectSegment:(0,i.jsx)($$,{pageSelectedText:t("les_1_mission_95719",r),segmentSelectedText:t("les_1_mission_38484",c.count,c.name)})}),d===Wh.List?(0,i.jsx)(bW,{customFields:e.customFields}):d===Wh.Map?(0,i.jsx)(MW,{name:a,predicates:l}):d==Wh.SlotsList?(0,i.jsx)(lW,{customFields:e.customFields}):(0,i.jsx)(HW,{dayStartTime:e.event.dayStartTime,endAt:e.event.endAt,startAt:e.event.startAt})]})]})},XW=e=>{const{history:t,translate:n,params:{organizationId:s,eventId:o,segmentId:r}}=vl(),{hasPermission:a,localEvent:l,updateLocalEvent:d}=wb(),c=Zn(GU),u=(0,L.useMemo)(()=>c.getPositionsFilters(e.event,e.customFields),[e.event,e.customFields]),h=(0,L.useMemo)(()=>c.getPositionsPossibleColumns(e.customFields),[e.customFields]);return(0,i.jsx)(YU,{eventId:o,organizationId:s,children:(0,i.jsx)(l$,{canEditSegments:a(Hb.SEGMENT_EDIT),eventId:o,filters:u,filtersButtonText:n("filtrer_les_mis_43681"),filtersSubtitle:n("appliquer_des_f_16037"),getSegmentPath:e=>Ps.POSITIONS_SEGMENT(s,o,e),hideSegments:0===e.event.numberOfPositions,initialLimit:l?.positionsLimit??Rc,initialSegmentsOpen:l?.arePositionsSegmentsOpen??!0,organizationId:s,possibleColumns:h,possibleRenderings:[Wh.List,Wh.Calendar,Wh.Map,Wh.SlotsList],reload:e.reload,segmentId:r,segmentType:jt.Positions,segmentsFolders:e.event.segmentsFolders,setLimit:e=>{d({positionsLimit:e})},onSegmentClick:e=>{d({positionsSegmentId:e})},onSegmentDelete:async()=>{await d({positionsSegmentId:null}),t.push(xs.POSITIONS({organizationId:s,eventId:o}))},onSegmentsToggle:async e=>{await d({arePositionsSegmentsOpen:e})},children:(0,i.jsx)(ZW,{customFields:e.customFields,event:e.event})})})},JW=(0,L.memo)(function(){const{params:{organizationId:e,eventId:t},translate:n}=vl(),{event:{name:s},localEvent:o}=wb();Md(`${s} ${n("missions_63972")}`);const{data:r,loader:a,reload:l}=Qn("query PositionsSegments($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n customFields(variety: Position) {\n nodes {\n ...SegmentCustomField\n }\n }\n }\n\n event(id: $eventId) {\n id\n organizationId\n startAt\n endAt\n numberOfPositions\n dayStartTime\n\n positionsCategories {\n id\n name\n\n leaders {\n ...LeaderInfos\n }\n }\n\n segmentsFolders(segmentType: Positions) {\n ...SegmentsFoldersSegments\n }\n }\n}\n",{organizationId:e,eventId:t},[Vs.SegmentCustomFieldFragment,Vs.LeaderInfosFragment,Vs.SegmentsFoldersSegmentsFragment]),d=(0,L.useMemo)(()=>(r.event?.segmentsFolders??[]).flatMap(e=>e.segments).map(e=>e.id),[r.event]);return a||(0,i.jsxs)(Sr.dO,{children:[(0,i.jsx)(Sr.qh,{path:Ps.POSITIONS_SEGMENT(":organizationId",":eventId",":segmentId"),children:(0,i.jsx)(XW,{customFields:r.organization.customFields.nodes,event:r.event,reload:l})}),(0,i.jsx)(Sr.qh,{children:(0,i.jsx)(oi,{path:Ps.POSITIONS_SEGMENT(e,t,o?.positionsSegmentId&&d.includes(o.positionsSegmentId)?o?.positionsSegmentId:d[0]),replace:!0})})]})}),QW=e=>{const{translate:t}=vl(),n=Tc();return(0,i.jsx)(Sw,{title:e.title,children:(0,i.jsxs)(Ba,{align:"center",direction:"column",...n?{gap:"9"}:{gap:"7"},gap:"4",width:1,children:[(0,i.jsx)(Rw,{count:e.category.assignedResources,total:e.category.resources}),(0,i.jsx)(rc,{leftIcon:"user",children:t("_1_membre_pr_32812",e.category.preassignedResources)})]})})},eG=({position:e})=>(0,i.jsx)(Ar,{color:"gray800",css:{background:e.color,borderRadius:"20px",height:"20px",width:"20px"}}),tG=e=>{const{eventId:t,positionId:n}=ti(),{mutate:s}=Do(),o=(0,L.useRef)(null),[r,a]=(0,L.useState)(e.position.color),l=Uc(e=>s({eventId:t,massEdit:{reset:!1,selecteds:{ids:[n]},slug:lt.Color,strategy:it.Replace,value:e}})),{hasPermission:d}=wb(),c=d(Hb.POSITION_EDIT,{positionCategoryId:e.position.positionCategoryId,positionId:e.position.id});return(0,i.jsx)(Ar,{color:"gray800",css:{background:r,borderRadius:"20px",cursor:"pointer",height:"20px",width:"20px","& input":{background:"transparent",border:"none",borderRadius:"20px",cursor:"pointer",height:"20px",width:"20px","&::-webkit-color-swatch-wrapper":{padding:0},"&::-webkit-color-swatch":{borderRadius:"20px",border:"none"},"&::-moz-color-swatch":{border:"none"}}},onClick:()=>{c&&o.current?.click()},children:c&&(0,i.jsx)("input",{ref:o,type:"color",value:r,onChange:e=>{a(e.target.value),l(e.target.value)}})})},nG=({customFields:e,position:t})=>{const n=Tc(),{params:{organizationId:s,eventId:o},translate:r}=vl(),a=Zn(ph);return(0,i.jsx)(Sw,{title:r("param_tres_78420"),children:(0,i.jsx)(Ba,{direction:"column",gap:"4",width:1,children:(0,i.jsxs)(tM,{children:[(0,i.jsxs)(QF,{children:[(0,i.jsx)(YF,{children:r("cat_gorie_00291")}),(0,i.jsx)(XF,{children:n?(0,i.jsx)(i.Fragment,{children:t.positionCategoryName}):(0,i.jsx)(Zc,{to:xs.POSITION_CATEGORY({organizationId:s,eventId:o,positionCategoryId:t.positionCategoryId}),children:t.positionCategoryName})})]}),(0,i.jsx)(qF,{direction:"horizontal"}),(0,i.jsxs)(QF,{children:[(0,i.jsx)(YF,{children:r("Color")}),(0,i.jsx)(XF,{children:n?(0,i.jsx)(eG,{position:t}):(0,i.jsx)(tG,{position:t})})]}),(0,i.jsx)(qF,{direction:"horizontal"}),(0,i.jsxs)(QF,{children:[(0,i.jsx)(YF,{children:r("ic_ne_55554")}),(0,i.jsx)(XF,{children:(0,i.jsx)(nl,{icon:tl(t.icon)})})]}),(0,i.jsx)(qF,{direction:"horizontal"}),(0,i.jsxs)(QF,{children:[(0,i.jsx)(YF,{children:r("Date")}),(0,i.jsx)(XF,{children:t.range?n?a.toLocaleString(t.range,void 0,{year:"numeric",month:"long",day:"numeric"}):a.toDisplayString(t.range):"-"})]}),e.map(e=>(0,i.jsxs)(L.Fragment,{children:[(0,i.jsx)(Xu,{direction:"horizontal"}),(0,i.jsxs)(Ba,{align:"center",gap:"3",justify:"between",children:[(0,i.jsx)(Ar,{color:"gray500",css:{flex:"1"},children:e.name}),(0,i.jsx)(Ba,{justify:"end",width:300,children:(0,i.jsx)(kw,{field:e,fields:t.fields})})]})]},e.slug))]})})})},iG=e=>{const t=Xn(),{hasPermission:n}=wb(),s=n(Hb.MEMBER_ASSIGN,{positionCategoryId:e.positionSlot.positionCategoryId,positionId:e.positionSlot.positionId}),{mutate:o}=Bo(),{mutate:r}=Qo(),a=e.volunteerRegistration.positionSlotUserInfo;return(0,i.jsxs)(Yc,{children:[a.state===pe.Waiting&&(0,i.jsx)(Kd,{icon:"clock",onClick:async()=>{await o({eventId:e.eventId,checkIn:{strategy:fe.CheckIn,positionsSlotsUsersInfosIds:[a.id]}}),e.reload()},children:t("pointer_1_57919",e.volunteerRegistration.userInfo.name)}),a.state===pe.CheckedIn&&(0,i.jsx)(Kd,{icon:"clock",onClick:async()=>{await o({eventId:e.eventId,checkIn:{strategy:fe.CheckOut,positionsSlotsUsersInfosIds:[a.id]}}),e.reload()},children:t("d_pointer_1_08337",e.volunteerRegistration.userInfo.name)}),a.state===pe.CheckedOut&&(0,i.jsx)(Kd,{icon:"clock",onClick:async()=>{await o({eventId:e.eventId,checkIn:{strategy:fe.Reset,positionsSlotsUsersInfosIds:[a.id]}}),e.reload()},children:t("remettre_z_ro_11572")}),s&&(0,i.jsx)(Kd,{color:"red",icon:"user-xmark",onClick:async()=>{await r({eventId:e.eventId,massAssign:{positionsSlotsIds:[e.positionSlot.id],selecteds:{ids:[e.volunteerRegistration.userInfo.id]},strategy:it.Delete}}),e.reload()},children:t("d_saffecter_du_47122")})]})},sG=e=>{const{translate:t,params:{eventId:n}}=vl(),s=Zn(Jc),o=Zn(rp);return(0,i.jsxs)(Mc,{css:{"&:hover":{background:"$gray100"}},children:[(0,i.jsx)(Oc,{children:(0,i.jsx)(xj,{userInfo:e.volunteerRegistration.userInfo})}),(0,i.jsx)(Oc,{children:e.volunteerRegistration.positionSlotUserInfo.state===pe.CheckedOut?(0,i.jsx)(rc,{leftIcon:"clock",children:t("temps_total_79448",o.minutesToHoursMinutesString(e.volunteerRegistration.positionSlotUserInfo.timeDifferenceMinutes))}):e.volunteerRegistration.positionSlotUserInfo.state===pe.CheckedIn?(0,i.jsx)(rc,{color:"success",leftIcon:"circle",leftIconStyle:"solid",size:"sm",children:t("point_le_1_63576",s.toLocaleString(e.volunteerRegistration.positionSlotUserInfo.checkInAt.toLocal(),eo.DateTime))}):(0,i.jsx)(rc,{color:"warning",leftIcon:"circle",leftIconStyle:"solid",size:"sm",children:t("non_point_42145")})}),(0,i.jsx)(Xc,{justify:"center",children:(0,i.jsx)(iG,{eventId:n,positionSlot:e.positionSlot,reload:e.reload,volunteerRegistration:e.volunteerRegistration})})]})},oG=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:s,positionId:o,positionSlotId:r}}=vl(),a=Zn(ph),[l,d]=(0,L.useState)(0),[c,u]=(0,L.useState)({direction:yt.Asc,attribute:Mt.Name}),{data:h,isLoading:m,reload:g}=Qn("query PositionSlotVolunteers(\n $eventId: EventId!\n $positionSlotId: PositionsSlotId!\n $offset: Int\n $sort: VolunteersRegistrationsSort\n) {\n event(id: $eventId) {\n positionSlot(id: $positionSlotId) {\n id\n positionId\n positionCategoryId\n name\n range\n assignedResources\n resources\n }\n\n volunteersRegistrations(\n positionSlotId: $positionSlotId\n limit: 25\n offset: $offset\n sort: $sort\n ) {\n nodes {\n id\n\n userInfo {\n id\n name\n email\n picture {\n url\n }\n }\n\n positionSlotUserInfo(positionSlotId: $positionSlotId) {\n id\n checkInAt\n checkOutAt\n state\n timeDifferenceMinutes\n }\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{eventId:s,positionSlotId:r,offset:l,sort:c},[]),{numberOfPages:p,totalCount:f}=Su(h.event?.volunteersRegistrations),_=(0,L.useMemo)(()=>h.event?.positionSlot?h.event.positionSlot.resources-h.event.positionSlot.assignedResources:0,[h.event?.positionSlot]),{hasPermissions:x}=wb(),[I]=m?[!1]:x([Hb.MEMBER_ASSIGN],{positionCategoryId:h.event.positionSlot.positionCategoryId,positionId:o});return(0,i.jsxs)(vu,{returnToFallback:xs.POSITION({organizationId:n,eventId:s,positionId:o}),size:"md",children:[(0,i.jsx)(zj,{children:(0,i.jsx)(Ba,{direction:"column",gap:"1",width:1,children:m?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(lc,{borderRadius:"$1",height:28,width:1}),(0,i.jsx)(lc,{borderRadius:"$1",height:20,width:1})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ar,{children:h.event.positionSlot.name||"-"}),(0,i.jsx)(Ar,{font:"gray500 textSm regular",children:a.toDisplayString(h.event.positionSlot.range)})]})})}),(0,i.jsxs)(bu,{children:[(0,i.jsx)(Ya,{height:"5"}),(0,i.jsxs)(Ba,{align:"center",gap:"2",children:[(0,i.jsx)(Ar,{children:t("liste_des_membr_89037")}),h.event?_>0?(0,i.jsx)(rc,{color:"warning",children:t("_1_membre_manq_31014",_)}):(0,i.jsx)(rc,{color:"success",children:t("complet_51600")}):null]}),(0,i.jsx)(Ya,{height:"2"}),(0,i.jsxs)(Sc,{children:[(0,i.jsxs)(kc,{children:[(0,i.jsx)(jm,{attribute:Mt.Name,setSort:e=>{d(0),u(e)},sort:c,children:t("nom_08311")}),(0,i.jsx)(Gc,{children:t("status_06428")}),(0,i.jsx)(Gc,{width:100})]}),m?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Hc,{bx:!0}),(0,i.jsx)(Hc,{bx:!0}),(0,i.jsx)(Hc,{bx:!0})]}):h.event.volunteersRegistrations.nodes.map(e=>(0,i.jsx)(sG,{positionSlot:h.event.positionSlot,reload:g,volunteerRegistration:e},e.id)),(0,i.jsx)(Nc,{children:(0,i.jsx)(Fc,{numberOfPages:p,offset:l,setOffset:d,totalCount:f})})]}),(0,i.jsx)(Ya,{height:"5"})]}),(0,i.jsx)(ju,{children:(0,i.jsxs)(Ba,{gap:"3",justify:"end",children:[I&&(0,i.jsx)(zl,{onClick:()=>{e.push(Ps.POSITION_SLOT_ASSIGN_VOLUNTEERS(n,s,o,r))},children:t("affecter_des_me_30349")}),(0,i.jsx)(zl,{color:"white",onClick:()=>e.goBack(xs.POSITION_SLOT({organizationId:n,eventId:s,positionId:o,positionSlotId:r})),children:t("fermer_62479")})]})})]})},rG=e=>{const{history:t,translate:n,params:{organizationId:s,eventId:o}}=vl(),r=Zn(ph),{hasPermissions:a}=wb(),l=Zn(EU),{mutate:d}=ya(),{mutate:c}=Bo(),{mutate:u}=function(e={}){return ei("mutation PositionSlotDelete(\n $eventId: EventId!\n $positionId: PositionId!\n $positionSlotId: PositionsSlotId!\n) {\n positionSlotDelete(\n eventId: $eventId\n positionId: $positionId\n positionSlotId: $positionSlotId\n ) {\n id\n }\n}\n",e)}(),[h,g]=(0,L.useState)(!1),[p,f]=(0,L.useState)(!1),_=(0,L.useMemo)(()=>r.toDisplayString(e.slot.range,{formats:{displayWeekday:!0}}),[e.slot]),[x,I]=a([Hb.POSITION_EDIT,Hb.MEMBER_ASSIGN],{positionCategoryId:e.slot.positionCategoryId,positionId:e.slot.positionId});return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Mc,{css:{cursor:"pointer"},onClick:()=>{t.push(Ps.POSITION_SLOT_MEMBERS(s,o,e.slot.positionId,e.slot.id))},children:[(0,i.jsx)(Oc,{align:"start",direction:"column",justify:"center",children:(0,i.jsx)(Ar,{font:"gray900 textSm medium",children:m(e.slot.name)?e.slot.name:"-"})}),(0,i.jsx)(Oc,{css:{textTransform:"capitalize"},children:_}),(0,i.jsx)(Oc,{children:(0,i.jsx)(L$,{assignedResources:e.slot.assignedResources,resources:e.slot.resources})}),(0,i.jsx)(Xc,{justify:"end",children:(0,i.jsxs)(Yc,{children:[I&&(0,i.jsx)(Kd,{icon:"wand-magic-sparkles",to:Ps.POSITION_SLOT_ASSIGN_VOLUNTEERS(s,o,e.slot.positionId,e.slot.id),children:n("affecter_des_me_30349")}),x&&(0,i.jsx)(Kd,{icon:"pen",onClick:()=>{g(!0)},children:n("_diter_62574")}),x&&(0,i.jsx)(Kd,{color:e.slot.assignedResources>0?"disabled":"red",icon:"trash-can",onClick:()=>{f(!0)},children:n("supprimer_43083")}),(0,i.jsx)(Kd,{icon:"clock",onClick:async()=>{await c({eventId:o,checkIn:{strategy:fe.CheckIn,positionsSlotsIds:[e.slot.id]}})},children:n("pointer_les_mem_50347")}),(0,i.jsx)(Kd,{icon:"clock",onClick:async()=>{await c({eventId:o,checkIn:{strategy:fe.CheckOut,positionsSlotsIds:[e.slot.id]}})},children:n("d_pointer_les_m_17150")})]})})]}),h&&(0,i.jsx)(DU,{event:e.event,slot:l.positionsSlotInputDefault(e.event.startAt,e.slot),onClose:()=>{g(!1)},onSuccess:async t=>{await d({eventId:o,positionId:e.slot.positionId,positionSlotId:e.slot.id,positionSlot:t}),e.reload()}}),p&&(0,i.jsx)(cA,{buttonText:n("supprimer_43083"),subtext:[n("_tes_vous_s_r_d_48876")],text:n("suppression_de_73669",_),onClose:()=>{f(!1)},onDelete:async()=>{await u({eventId:o,positionId:e.slot.positionId,positionSlotId:e.slot.id}),e.reload()}})]})},aG=()=>{const{translate:e,params:{eventId:t,positionId:n}}=vl(),[s,o,r]=Wc(""),[a,l]=kz("position.slots.date",Gs.c9.invalid("Invalid"),vm),[d,c]=(0,L.useState)(0),[u,h]=kz("position.slots.sort",null),{data:g,isLoading:p,reload:f}=Qn("query PositionSlots(\n $eventId: EventId!\n $positionId: PositionId!\n $name: String\n $date: Date\n $offset: Int\n $sort: PositionsSlotsSort\n) {\n event(id: $eventId) {\n startAt\n endAt\n\n positionsSlots(\n positionsIds: [$positionId]\n name: $name\n date: $date\n limit: 25\n offset: $offset\n sort: $sort\n ) {\n nodes {\n ...PositionPositionSlot\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{eventId:t,positionId:n,name:m(o)?o:void 0,date:a.isValid?a:void 0,offset:d,sort:u},[Vs.PositionPositionSlotFragment]);const{numberOfPages:_,totalCount:x}=Su(g.event?.positionsSlots),I=(0,L.useCallback)(e=>{h(e),c(0)},[h,c]);return(0,i.jsx)(Lc,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ar,{width:320,children:(0,i.jsx)(Bl,{icon:"magnifying-glass",placeholder:e("rechercher_un_c_70424"),value:s,onChange:r})}),(0,i.jsx)(Ar,{width:200,children:(0,i.jsx)(Mu,{max:g.event?.endAt,min:g.event?.startAt,value:a,onChange:l})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(jm,{attribute:ut.Name,setSort:I,sort:u,children:e("nom_du_cr_neau_54351")}),(0,i.jsx)(jm,{attribute:ut.Range,setSort:I,sort:u,children:e("cr_neau_11117")}),(0,i.jsx)(Gc,{children:e("remplissage_75916")}),(0,i.jsx)(Gc,{width:100})]}),numberOfPages:_,offset:d,rows:p?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Hc,{bx:!0}),(0,i.jsx)(Hc,{bx:!0}),(0,i.jsx)(Hc,{bx:!0})]}):(0,i.jsx)(i.Fragment,{children:g.event.positionsSlots.nodes.map(e=>(0,i.jsx)(rG,{event:g.event,reload:f,slot:e},e.id))}),setOffset:c,title:e("liste_des_cr_ne_86148"),totalCount:x})},lG=()=>{const{params:{organizationId:e,eventId:t,positionId:n},translate:s}=vl(),{roles:o}=TI(),{hasPermission:r}=wb(),{data:a,loader:l,reload:d}=Ca({organizationId:e,eventId:t,positionId:n}),{mutate:c}=ca(),{mutate:u}=Do(),h=r(Hb.POSITION_EDIT,{positionCategoryId:a.event?.position.positionCategoryId,positionId:n});return l||(0,i.jsxs)(aj,{children:[(0,i.jsxs)(Ba,{gap:"6",children:[(0,i.jsx)(QW,{category:a.event.position,title:s("remplissage_de_52564")}),(0,i.jsx)(nG,{customFields:a.organization.customFields.nodes,position:a.event.position})]}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(aG,{}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsxs)(Ba,{gap:"6",children:[(0,i.jsxs)(Ba,{direction:"column",gap:"4",width:1,children:[(0,i.jsx)(_S,{leaders:a.event.position.leaders,reload:d,roles:o.positionRoles,onSave:e=>c({eventId:t,massLeaders:{leaders:e,selecteds:{ids:[n]},strategy:it.Replace}})}),(0,i.jsx)(oM,{customFields:a.event.position.customFields}),(0,i.jsx)(Uw,{modalSubtitle:s("ajouter_des_tag_64526"),reload:d,tags:a.event.position.tags,...h?{associateTags:e=>u({eventId:t,massEdit:{reset:!1,selecteds:{ids:[n]},slug:lt.Tag,strategy:it.Replace,value:e}})}:{}})]}),(0,i.jsxs)(Ba,{direction:"column",gap:"4",width:1,children:[(0,i.jsx)(Mw,{description:a.event.position.description}),(0,i.jsx)(aM,{location:a.event.position}),(0,i.jsx)(Nw,{privateNote:a.event.position.privateNote})]})]}),(0,i.jsx)(Sr.qh,{path:Ps.POSITION_SLOT_MEMBERS(":organizationId",":eventId",":positionId",":positionSlotId"),children:(0,i.jsx)(oG,{})})]})},dG=e=>{const{params:{organizationId:t,eventId:n}}=vl(),s=Zn(Zh),{isEventAdmin:o}=wb(),[r,a]=kz("positionMembers.columns",[Kh.Name,Kh.Positions]),[l,d]=kz("positionMembers.limit",Rc),[c,u]=kz("positionMembers.predicates",[]),[h,m]=kz("positionMembers.sort",null),{data:g}=nr({organizationId:t,eventId:n,privacy:o?Ie.All:Ie.Public,loadForms:!1,loadSegments:!1}),p=(0,L.useMemo)(()=>g.organization?.customFields.nodes??[],[g.organization]),f=_y(p),_=(0,L.useMemo)(()=>g.event?s.getPositionMembersFilters(t,n,p,g.event):[],[n,p,g.event]),x=(0,L.useMemo)(()=>s.getPositionMembersPossibleColumns(p),[p]);return(0,i.jsx)(aj,{children:(0,i.jsx)(_m,{columns:r,columnsSearch:[],columnsToIncludes:Yh,eventId:n,filters:_,getMassActionId:e=>e.userInfo.id,limit:l,loadDataList:ar,loadDataListParams:{includeCanRegistrationStateUpdate:!o,includeIsEditable:!o,positionCategoryId:e.positionCategoryId,positionId:e.positionId,preassignedPositionCategoryId:e.preassignedPositionCategoryId,preassignedPositionId:e.preassignedPositionId},loadRow:or,loadRowParams:{includeCanRegistrationStateUpdate:!o,includeIsEditable:!o},organizationId:t,possibleColumns:x,predicates:c,renderActions:(e,t,n)=>(0,i.jsx)(PM,{massActions:e,predicates:null,showOnlyMassEdit:!0,totalNumberOfMembers:t,onMassEditSuccess:n}),rendering:Gh.List,setColumns:a,setLimit:d,setPredicates:u,setSort:m,showEditColumns:o,showEditMode:o,showFilters:o,showMassActions:o,showRowDropdown:!1,showRowEdit:!1,showSearchColumns:!1,sort:h,children:(0,i.jsx)(Tm,{renderCell:(e,t,s)=>(0,i.jsx)(wk,{canAccredit:o,canAssign:o,canChangeDelegation:o,canClickMemberName:!0,column:e,customField:f.get(e.slug),eventId:n,reloadRow:s,row:t})})})})},cG=({position:e})=>{const{history:t,translate:n,params:{organizationId:s,eventId:o}}=vl(),{user:r}=ai(),{hasPermission:a}=wb(),l=a(Hb.POSITION_EDIT,{positionCategoryId:e.positionCategoryId}),d=gW(),[c,u]=(0,L.useState)(!1);return(0,i.jsxs)(lj,{align:"center",gap:"3",hideBorder:!0,children:[(0,i.jsx)(Sj,{returnPathFallback:xs.POSITIONS({organizationId:s,eventId:o})}),(0,i.jsxs)(Ar,{css:{flex:"1"},font:"gray900 displayXs medium",children:[e.name," ",m(e.acronym)?`(${e.acronym})`:""]}),(0,i.jsx)(zl,{color:"white",download:`${e.name}-position-sheet`,to:_g(e.links.positionSheetLink,"pdf",{lang:r?.language}),children:n("t_l_charger_la_16259")}),(0,i.jsx)(Kb,{permissions:Hb.POSITION_EDIT,scope:{positionCategoryId:e.positionCategoryId,positionId:e.id},children:(0,i.jsx)(zl,{to:Ps.EDIT_POSITION(s,o,e.id),children:n("_diter_la_missi_90442")})}),(0,i.jsxs)(Wd,{children:[(0,i.jsx)(Xd,{children:(0,i.jsx)(zl,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Zd,{placement:"bottom-end",children:[l&&(0,i.jsx)(Kd,{icon:"clone",onClick:async()=>await d(e.id),children:n("dupliquer_28256")}),(0,i.jsx)(Kd,{download:`${e.name}-position-planning`,icon:"arrow-down-to-bracket",target:"_blank",to:_g(e.links.positionPlanningLink,"pdf",{lang:r?.language}),children:n("t_l_charger_le_06050")}),l&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Xu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Kd,{color:"red",icon:"trash-can",onClick:async()=>u(!0),children:n("supprimer_43083")})]})]})]}),c&&(0,i.jsx)(pW,{position:e,onClose:()=>u(!1),onSuccess:()=>t.replace(xs.POSITIONS({organizationId:s,eventId:o}))})]})},uG=e=>{const{params:{organizationId:t,eventId:n,positionId:s},translate:o}=vl();Md(e.event.position.name);const r=e=>({organizationId:e?":organizationId":t,eventId:e?":eventId":n,positionId:e?":positionId":s});return(0,i.jsxs)(dj,{children:[(0,i.jsx)(cG,{position:e.event.position}),(0,i.jsxs)(mj,{css:{flex:"1"},children:[(0,i.jsxs)(uj,{css:{px:"$7"},children:[(0,i.jsx)(cj,{path:xs.POSITION_DASHBOARD(r(!1)),children:o("tableau_de_bord_24627")}),(0,i.jsx)(cj,{path:xs.POSITION_MEMBERS(r(!1)),children:o("membres_125561",e.event.volunteersRegistrations.totalCount)}),(0,i.jsx)(cj,{path:xs.POSITION_PREASSIGNED_MEMBERS(r(!1)),children:o("membres_pr_aff_93093",e.event.position.preassignedResources)})]}),(0,i.jsx)(hj,{path:[xs.POSITION_DASHBOARD(r(!0)),Ps.POSITION_SLOT_MEMBERS(":organizationId",":eventId",":positionId",":positionSlotId")],children:(0,i.jsx)(lG,{})}),(0,i.jsx)(hj,{path:xs.POSITION_MEMBERS(r(!0)),children:(0,i.jsx)(dG,{positionId:s})}),(0,i.jsx)(hj,{path:xs.POSITION_PREASSIGNED_MEMBERS(r(!0)),children:(0,i.jsx)(dG,{preassignedPositionId:s})})]})]})},hG=()=>{const{params:{organizationId:e,eventId:t,positionId:n}}=vl(),{data:s,loader:o}=Qn("query Position($eventId: EventId!, $positionId: PositionId!) {\n event(id: $eventId) {\n position(id: $positionId) {\n id\n name\n acronym\n positionCategoryId\n assignedResources\n preassignedResources\n\n links {\n positionPlanningLink\n positionSheetLink\n }\n }\n\n volunteersRegistrations(positionId: $positionId) {\n totalCount\n }\n }\n}\n",{eventId:t,positionId:n},[]);return o||(0,i.jsxs)(Sr.dO,{children:[(0,i.jsx)(Sr.qh,{exact:!0,path:xs.POSITION({organizationId:":organizationId",eventId:":eventId",positionId:":positionId"}),children:(0,i.jsx)(oi,{path:xs.POSITION_DASHBOARD({organizationId:e,eventId:t,positionId:n}),replace:!0})}),(0,i.jsx)(Sr.qh,{children:(0,i.jsx)(uG,{event:s.event})})]})},mG=e=>{const t=Xn(),{mutate:n}=function(e={}){return ei("mutation PositionCategoryDescriptionUpdate(\n $eventId: EventId!\n $positionCategoryId: PositionsCategoryId!\n $description: String!\n) {\n positionCategoryDescriptionUpdate(\n eventId: $eventId\n positionCategoryId: $positionCategoryId\n description: $description\n ) {\n id\n }\n}\n",e)}();return(0,i.jsx)(oC,{buttonText:t("mettre_jour_l_18158"),icon:"text",initialValues:{positionCategory:{description:e.positionCategory.description}},size:"md",subtitle:t("la_description_98866"),title:t("ajouter_une_des_10769"),onClose:e.onClose,onSubmit:async t=>{await n({eventId:e.eventId,positionCategoryId:e.positionCategory.id,description:t.positionCategory?.description??""}),e.reload(),e.onClose()},children:(0,i.jsx)(Ar,{css:{overflow:"hidden auto"},width:1,children:(0,i.jsx)(rb,{label:t("description_58935"),name:"positionCategory.description"})})})},gG=e=>{const t=Xn(),{hasPermission:n}=wb(),s=n(Hb.POSITION_EDIT,{positionCategoryId:e.category.id}),[o,r]=(0,L.useState)(!1),a=m(e.category.description);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Sw,{rightIcon:s?a?"pen":"plus":void 0,rightIconClick:()=>{r(!0)},title:t("description_58935"),children:a?(0,i.jsx)(Cg,{text:e.category.description}):(0,i.jsx)(Ar,{color:"gray500",textAlign:"center",width:1,children:t("aucune_descript_25737")})}),s&&o&&(0,i.jsx)(mG,{eventId:e.eventId,positionCategory:e.category,reload:e.reload,onClose:()=>{r(!1)}})]})},pG=e=>{const{history:t,translate:n,params:{organizationId:s,eventId:o}}=vl(),r=Zn(ph),a=(0,L.useMemo)(()=>e.position.resources-e.position.assignedResources,[e.position]);return(0,i.jsxs)(Mc,{css:{cursor:"pointer"},onClick:()=>{t.push(xs.POSITION({organizationId:s,eventId:o,positionId:e.position.id}))},children:[(0,i.jsx)(Oc,{children:(0,i.jsx)(Ar,{font:"gray900 textSm medium",children:e.position.name})}),(0,i.jsx)(Oc,{children:(0,i.jsxs)(Ba,{direction:"column",children:[(0,i.jsx)(Ar,{font:"gray900 textSm medium",children:e.position.range?r.toLocaleString(e.position.range,void 0,{day:"numeric",month:"short",year:"numeric"}):"-"}),(0,i.jsx)(Ar,{font:"gray500 textSm regular",children:n("creneau",e.position.numberOfSlots)})]})}),(0,i.jsx)(Oc,{children:a>0?(0,i.jsx)(rc,{color:"warning",children:n("_1_membre_manq_31014",a)}):(0,i.jsx)(rc,{color:"success",children:n("complet_51600")})}),(0,i.jsx)(Xc,{justify:"end",children:(0,i.jsxs)(Yc,{children:[(0,i.jsx)(Kd,{icon:"eye",to:xs.POSITION({organizationId:s,eventId:o,positionId:e.position.id}),children:n("voir_la_mission_68087")}),(0,i.jsx)(Kd,{icon:"pen",onClick:()=>{t.push(Ps.EDIT_POSITION(s,o,e.position.id))},children:n("_diter_la_missi_90442")})]})})]})},fG=()=>{const{translate:e,params:{eventId:t,positionCategoryId:n}}=vl(),[s,o,r]=Wc(""),[a,l]=(0,L.useState)(Gs.c9.invalid("Invalid")),[d,c]=(0,L.useState)(0),{data:u,isLoading:h}=Qn("query PositionCategoryPositions(\n $eventId: EventId!\n $positionCategoryId: PositionsCategoryId!\n $name: String\n $date: Date\n $offset: Int\n) {\n event(id: $eventId) {\n startAt\n endAt\n\n positions(\n positionCategoriesIds: [$positionCategoryId]\n name: $name\n date: $date\n limit: 25\n offset: $offset\n ) {\n nodes {\n ...PositionCategoryPosition\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{eventId:t,positionCategoryId:n,name:m(o)?o:void 0,date:a.isValid?a:void 0,offset:d},[Vs.PositionCategoryPositionFragment]);const{numberOfPages:g,totalCount:p}=Su(u.event?.positions);return(0,i.jsx)(Lc,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ar,{width:320,children:(0,i.jsx)(Bl,{icon:"magnifying-glass",placeholder:e("rechercher_un_c_70424"),value:s,onChange:r})}),(0,i.jsx)(Ar,{width:200,children:(0,i.jsx)(Mu,{max:u.event?.endAt,min:u.event?.startAt,value:a,onChange:l})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Gc,{children:e("nom_de_la_missi_64605")}),(0,i.jsx)(Gc,{children:e("Date")}),(0,i.jsx)(Gc,{children:e("status_06428")})]}),numberOfPages:g,offset:d,rows:h?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Hc,{bx:!0}),(0,i.jsx)(Hc,{bx:!0}),(0,i.jsx)(Hc,{bx:!0})]}):(0,i.jsx)(i.Fragment,{children:u.event.positions.nodes.map(e=>(0,i.jsx)(pG,{position:e},e.id))}),setOffset:c,title:e("liste_des_missi_40241"),totalCount:p})},_G=e=>{const{translate:t,params:{eventId:n,positionCategoryId:s}}=vl(),{roles:o}=TI(),r=Zn(ph),{mutate:a}=function(e={}){return ei("mutation PositionsCategoriesMassLeadersEdit($eventId: EventId!, $massLeaders: MassLeadersInput!) {\n positionsCategoriesMassLeadersAssign(eventId: $eventId, massLeaders: $massLeaders)\n}\n",e)}();return(0,i.jsx)(aj,{children:(0,i.jsxs)(Ba,{direction:"column",gap:"6",children:[(0,i.jsxs)(Ba,{gap:"6",width:1,children:[(0,i.jsx)(uS,{iconColor:"primary",text:t("nombre_de_missi_56719"),value:e.positionCategory.numberOfPositions}),(0,i.jsx)(uS,{iconColor:"primary",text:t("number_of_membe_24698"),value:e.positionCategory.assignedResources}),(0,i.jsx)(uS,{iconColor:"primary",text:t("nombre_de_membr_74699"),value:e.positionCategory.preassignedResources}),(0,i.jsx)(uS,{iconColor:"primary",text:t("Date"),value:e.positionCategory.range?r.toLocaleString(e.positionCategory.range,void 0,{day:"numeric",month:"short",year:"numeric"}):"-"})]}),(0,i.jsxs)(Ba,{gap:"7",children:[(0,i.jsxs)(Ba,{direction:"column",gap:"6",width:470,children:[(0,i.jsx)(_S,{leaders:e.positionCategory.leaders,reload:e.reload,roles:o.positionRoles,onSave:e=>a({eventId:n,massLeaders:{leaders:e,selecteds:{ids:[s]},strategy:it.Replace}})}),(0,i.jsx)(gG,{category:e.positionCategory,eventId:n,reload:e.reload})]}),(0,i.jsx)(Ar,{css:{flex:"1"},children:(0,i.jsx)(fG,{})})]})]})})},xG=e=>{const t=Xn(),{mutate:n}=function(e={}){return ei("mutation PositionCategoryDelete($eventId: EventId!, $positionCategoryId: PositionsCategoryId!) {\n positionCategoryDelete(eventId: $eventId, positionCategoryId: $positionCategoryId) {\n id\n }\n}\n",e)}();return(0,i.jsx)(cA,{buttonText:t("supprimer_43083"),subtext:[t("_tes_vous_s_r_d_50954"),t("cela_supprimera_30946")],text:t("suppression_de_73669",e.positionCategory.name),onClose:e.onClose,onDelete:async()=>{await n({eventId:e.eventId,positionCategoryId:e.positionCategory.id}),e.onSuccess()}})},IG=({category:e,reload:t})=>{const{translate:n,history:s,params:{organizationId:o,eventId:r}}=vl(),{isEventAdmin:a}=wb(),{mutate:l}=function(e={}){return ei("mutation PositionCategoryDuplicate($eventId: EventId!, $positionCategoryId: PositionsCategoryId!) {\n positionCategoryDuplicate(eventId: $eventId, positionCategoryId: $positionCategoryId) {\n id\n }\n}\n",e)}(),[d,c]=(0,L.useState)(!1),[u,h]=(0,L.useState)(!1);return(0,i.jsxs)(lj,{align:"center",gap:"3",hideBorder:!0,children:[(0,i.jsx)(Sj,{returnPathFallback:xs.POSITIONS({organizationId:o,eventId:r})}),(0,i.jsx)(Ar,{css:{flex:"1"},font:"gray900 displayXs medium",children:e.name}),(0,i.jsxs)(Kb,{permissions:Hb.POSITION_EDIT,scope:{positionCategoryId:e.id},children:[(0,i.jsx)(zl,{color:"white",onClick:()=>h(!0),children:n("_diter_62574")}),(0,i.jsx)(zl,{onClick:()=>{s.push(Ps.CREATE_POSITION(o,r,e.id))},children:n("ajouter_une_mis_99800")})]}),a&&(0,i.jsxs)(Wd,{children:[(0,i.jsx)(Xd,{children:(0,i.jsx)(zl,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Zd,{placement:"bottom-end",children:[(0,i.jsx)(Kd,{icon:"copy",onClick:async()=>{const{positionCategoryDuplicate:{id:t}}=await l({eventId:r,positionCategoryId:e.id});s.push(xs.POSITION_CATEGORY({organizationId:o,eventId:r,positionCategoryId:t}))},children:n("dupliquer_28256")}),(0,i.jsx)(Xu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Kd,{color:"red",icon:"trash-can",onClick:()=>{c(!0)},children:n("supprimer_43083")})]})]}),u&&(0,i.jsx)(OU,{eventId:r,positionCategoryId:e.id,positionCategoryName:e.name,onClose:()=>{h(!1)},onSuccess:t}),d&&(0,i.jsx)(xG,{eventId:r,positionCategory:e,onClose:()=>{c(!1)},onSuccess:()=>{s.replace(xs.POSITIONS({organizationId:o,eventId:r}))}})]})},vG=({event:e,reload:t})=>{const{translate:n,params:{organizationId:s,eventId:o,positionCategoryId:r}}=vl(),a=ii(),{updateLocalEvent:l}=wb();Md(e.positionCategory.name),(0,L.useEffect)(()=>{l({positionBackPath:a.pathname})},[]);const d=e=>({organizationId:e?":organizationId":s,eventId:e?":eventId":o,positionCategoryId:e?":positionCategoryId":r});return(0,i.jsxs)(dj,{children:[(0,i.jsx)(IG,{category:e.positionCategory,reload:t}),(0,i.jsxs)(mj,{css:{flex:"1"},children:[(0,i.jsxs)(uj,{css:{px:"$7"},children:[(0,i.jsx)(cj,{path:xs.POSITION_CATEGORY_DASHBOARD(d(!1)),children:n("tableau_de_bord_24627")}),(0,i.jsx)(cj,{path:xs.POSITION_CATEGORY_MEMBERS(d(!1)),children:n("membres_125561",e.volunteersRegistrations.totalCount)}),(0,i.jsx)(cj,{path:xs.POSITION_CATEGORY_PREASSIGNED_MEMBERS(d(!1)),children:n("membres_pr_aff_93093",e.positionCategory.preassignedResources)})]}),(0,i.jsx)(hj,{path:xs.POSITION_CATEGORY_DASHBOARD(d(!0)),children:(0,i.jsx)(_G,{positionCategory:e.positionCategory,reload:t})}),(0,i.jsx)(hj,{path:xs.POSITION_CATEGORY_MEMBERS(d(!0)),children:(0,i.jsx)(dG,{positionCategoryId:r})}),(0,i.jsx)(hj,{path:xs.POSITION_CATEGORY_PREASSIGNED_MEMBERS(d(!0)),children:(0,i.jsx)(dG,{preassignedPositionCategoryId:r})})]})]})},bG=()=>{const{params:{organizationId:e,eventId:t,positionCategoryId:n}}=vl(),{data:s,loader:o,reload:r}=Qn("query PositionCategory($eventId: EventId!, $positionCategoryId: PositionsCategoryId!) {\n event(id: $eventId) {\n positionCategory(id: $positionCategoryId) {\n id\n name\n description\n assignedResources\n preassignedResources\n numberOfPositions\n resources\n range\n\n leaders {\n ...LeaderInfos\n }\n }\n\n volunteersRegistrations(positionCategoryId: $positionCategoryId) {\n totalCount\n }\n }\n}\n",{eventId:t,positionCategoryId:n},[Vs.LeaderInfosFragment]);return o||(0,i.jsxs)(Sr.dO,{children:[(0,i.jsx)(Sr.qh,{exact:!0,path:xs.POSITION_CATEGORY({organizationId:":organizationId",eventId:":eventId",positionCategoryId:":positionCategoryId"}),children:(0,i.jsx)(oi,{path:xs.POSITION_CATEGORY_DASHBOARD({organizationId:e,eventId:t,positionCategoryId:n}),replace:!0})}),(0,i.jsx)(Sr.qh,{children:(0,i.jsx)(vG,{event:s.event,reload:r})})]})},jG=e=>(0,i.jsx)(Lm,{category:e.popup.category,fallbackClosePath:e.closePath,heading:e.popup.title,children:(0,i.jsxs)(Ba,{css:{overflow:"hidden"},direction:"column",height:1,width:1,children:[(0,i.jsx)(Ba,{css:{background:"$gray50",flex:"1",overflow:"auto",py:"$9"},justify:"center",children:(0,i.jsx)(Ba,{css:{height:"fit-content",overflow:"hidden"},direction:"column",width:1170,children:e.children})}),(0,i.jsx)(Ba,{align:"center",css:{boxShadow:"0px -4px 8px -2px rgba(16, 24, 40, 0.1), 0px -2px 4px -2px rgba(16, 24, 40, 0.06)"},height:72,justify:"center",width:1,children:e.button})]})}),CG=()=>{const{params:{organizationId:e,eventId:t,positionId:n,positionSlotId:s},translate:o}=vl(),r=Zn(Jc),[a,l]=kz("positionsSlotsAssignVolunteers.filterAvailabilities",!0),[d,c]=kz("positionsSlotsAssignVolunteers.filterPositions",!1),[u,h]=kz("positionsSlotsAssignVolunteers.applyConditions",!0),[g,p]=(0,L.useState)(null),{data:f,isLoading:_}=Qn("query AvailableVolunteersRegistrations(\n $eventId: EventId!\n $positionSlotId: PositionsSlotId!\n $filterAvailabilities: Boolean!\n $filterPositions: Boolean!\n $applyConditions: Boolean!\n $sort: VolunteersRegistrationsSort\n) {\n event(id: $eventId) {\n positionSlot(id: $positionSlotId) {\n positionName\n positionCategoryId\n nameOrRange\n\n availableVolunteersRegistrations(\n filterAvailabilities: $filterAvailabilities\n filterPositions: $filterPositions\n applyConditions: $applyConditions\n sort: $sort\n ) {\n id\n positionsCategoriesIds\n positionsSlotsIds\n positionsIds\n numberOfAssignments\n isAssignedTo(positionSlotId: $positionSlotId)\n insertedAt\n\n userInfo {\n id\n email\n name\n picture {\n url\n }\n }\n }\n }\n }\n}\n",{eventId:t,positionSlotId:s,filterAvailabilities:a,filterPositions:d,applyConditions:u,sort:g},[]),{mutate:x,isLoading:I}=Qo(),[v,b]=(0,L.useState)(""),j=(0,L.useMemo)(()=>{const e=f.event?.positionSlot.availableVolunteersRegistrations??[];return m(v)?e.filter(e=>e.userInfo.name.toLowerCase().includes(v.toLowerCase())||e.userInfo.email.includes(v.toLowerCase())):e},[f.event,v]),{numberOfSelected:C,selectAllState:y,states:k,setStates:A,toggleRow:w,toggleSelectAll:S}=wu({}),E=(0,L.useMemo)(()=>(u?1:0)+(a?1:0)+(d?1:0),[u,a,d]);return(0,L.useEffect)(()=>{A(Object.fromEntries((f.event?.positionSlot.availableVolunteersRegistrations??[]).map(e=>[`ui${e.userInfo.id}`,{id:e.userInfo.id,state:e.isAssignedTo?"checked":"unchecked"}])))},[f.event]),(0,i.jsx)(jG,{button:(0,i.jsx)(zl,{isLoading:I,to:xs.POSITION({organizationId:e,eventId:t,positionId:n}),onClick:async()=>{const e=(f.event?.positionSlot.availableVolunteersRegistrations??[]).flatMap(e=>e.isAssignedTo?[e.userInfo.id]:[]),n=Object.values(k).filter(({state:e})=>"checked"===e).map(({id:e})=>e),i=(0,mc.A)(n,e),o=(0,mc.A)(e,n);so(i)&&await x({eventId:t,massAssign:{positionsSlotsIds:[s],selecteds:{ids:i},strategy:it.Add}}),so(o)&&await x({eventId:t,massAssign:{positionsSlotsIds:[s],selecteds:{ids:o},strategy:it.Delete}})},children:0===C?o("ne_pas_affecter_05756"):o("affecter_1_me_46721",C)}),closePath:xs.POSITION({organizationId:e,eventId:t,positionId:n}),popup:{category:o("affectation_u_96975",f.event?.positionSlot.positionName??""),title:f.event?.positionSlot.nameOrRange??""},children:(0,i.jsx)(Lc,{filters:(0,i.jsxs)(Ba,{gap:"3",children:[(0,i.jsx)(Ar,{width:320,children:(0,i.jsx)(Bl,{icon:"magnifying-glass",placeholder:o("rechercher_un_m_05904"),value:v,onChange:b})}),(0,i.jsxs)(Wd,{children:[(0,i.jsx)(Xd,{children:(0,i.jsx)(zl,{color:"gray",leftIcon:"sliders",children:o("filtres_1_41774",E)})}),(0,i.jsx)(Zd,{css:{padding:"0"},placement:"bottom-end",children:(0,i.jsxs)(Ba,{css:{padding:"$4 $6"},direction:"column",width:440,children:[(0,i.jsx)(Ar,{font:"gray800 textMd medium",children:o("liste_des_filtr_75605")}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(Ar,{font:"gray800 textSm medium",children:o("disponibilit_s_49923")}),(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(vc,{state:a?"unchecked":"checked",onClick:e=>{l("checked"!==e)},children:o("afficher_tous_l_44338")}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:a?"checked":"unchecked",onClick:e=>{l("checked"===e)},children:o("filtrer_selon_l_35857")}),(0,i.jsx)(Ju,{height:"4"}),(0,i.jsx)(Ar,{font:"gray800 textSm medium",children:o("missions_63972")}),(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(vc,{state:d?"unchecked":"checked",onClick:e=>{c("checked"!==e)},children:o("afficher_tous_l_44338")}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:d?"checked":"unchecked",onClick:e=>{c("checked"===e)},children:o("filtrer_selon_l_42798")}),(0,i.jsx)(Ju,{height:"4"}),(0,i.jsx)(Ar,{font:"gray800 textSm medium",children:o("conditions_77756")}),(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(vc,{state:u?"unchecked":"checked",onClick:e=>{h("checked"!==e)},children:o("afficher_tous_l_44338")}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:u?"checked":"unchecked",onClick:e=>{h("checked"===e)},children:o("filtrer_selon_l_59697")})]})})]})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Gc,{css:{paddingRight:0},width:48,children:(0,i.jsx)(fc,{state:y,onClick:S})}),(0,i.jsx)(jm,{attribute:Mt.Name,css:{paddingLeft:"$2",flexGrow:2},setSort:p,sort:g,children:o("nom_du_membre_69353")}),(0,i.jsx)(Gc,{children:o("nombre_d_affect_31455")}),(0,i.jsx)(jm,{attribute:Mt.InsertedAt,setSort:p,sort:g,children:o("date_d_inscript_31369")})]}),limit:j.length,numberOfPages:1,offset:0,rows:_?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Hc,{bx:!0}),(0,i.jsx)(Hc,{bx:!0}),(0,i.jsx)(Hc,{bx:!0})]}):j.map(e=>(0,i.jsxs)(Mc,{children:[(0,i.jsx)(Oc,{css:{paddingRight:0},width:48,children:(0,i.jsx)(fc,{state:k[`ui${e.userInfo.id}`]?.state??"unchecked",onClick:(t,n)=>{Dl(n),w(`ui${e.userInfo.id}`,t)}})}),(0,i.jsx)(Oc,{css:{paddingLeft:"$2",flexGrow:2},children:(0,i.jsx)(xj,{userInfo:e.userInfo})}),(0,i.jsx)(Oc,{children:e.numberOfAssignments}),(0,i.jsx)(Oc,{children:r.toLocaleString(e.insertedAt.toLocal(),eo.DateTime)})]},e.id)),setOffset:td.A,title:o("liste_des_membr_42505"),totalCount:j.length})})},yG=e=>{const{params:{organizationId:t,eventId:n,userInfoId:s},translate:o}=vl(),r=e.userInfo.volunteerRegistration?.delegation;return(0,i.jsx)(zO,{forms:e.forms,getTabPath:e=>Ps.EDIT_USER_ACCREDITATIONS_FORM(t,n,s,e),handleSubmit:e.handleSubmit,isLoading:e.isLoading,returnPathFallback:Ps.VOLUNTEERS(t,n),title:o("mise_jour_des_60902",e.userInfo.nameOrEmail),children:e.forms.map((o,a)=>(0,i.jsxs)(hj,{path:Ps.EDIT_USER_ACCREDITATIONS_FORM(t,n,s,o.id),children:[(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(DT,{accreditationsSlotsIds:e.values.userInfo.accreditations[a].accreditationsSlotsIds,change:e.change,delegationAccreditations:r?.formId===o.id?r.accreditationsSlots:[],displayFormCustomFields:!1,event:e.event,options:{...o,showFullAccreditation:!0,slotDisplay:It.Hide,accreditationFilter:xt.None},prefix:`userInfo.accreditations[${a}].`,showAutoAccredit:!1,slots:[],userInfosFields:e.userInfo.fields})]},o.id))})},kG=e=>{const{history:t,params:{organizationId:n,eventId:s,userInfoId:o}}=vl(),r=Zn(kT),{mutate:a,isLoading:l}=function(e={}){return ei("mutation UserInfoAccreditationsUpdate(\n $eventId: EventId!\n $userId: UserId\n $delegationId: DelegationId\n $userInfoId: UsersInfoId!\n $userInfoAccreditations: [UserInfoAccreditationsInput!]!\n) {\n userInfoAccreditationsUpdate(\n eventId: $eventId\n userId: $userId\n delegationId: $delegationId\n userInfoId: $userInfoId\n userInfoAccreditations: $userInfoAccreditations\n )\n}\n",e)}(),d=(0,L.useMemo)(()=>e.forms.map(t=>{const n=e.userInfo.formsUsersInfos.find(e=>e.formId===t.id);return{formId:t.id,...r.volunteersRegistrationsWishedAccreditationsUpdateInputDefault(n)}}),[e.forms,e.userInfo.formsUsersInfos]);return(0,i.jsx)(kl,{direction:"column",height:1,initialValues:{userInfo:{accreditations:d}},render:({form:t,handleSubmit:n,values:s})=>(0,i.jsx)(yG,{change:t.change,event:e.event,forms:e.forms,handleSubmit:n,isLoading:l,userInfo:e.userInfo,values:s}),width:1,onSubmit:async e=>{await a({eventId:s,userInfoId:o,userInfoAccreditations:e.userInfo.accreditations}),t.goBack(Ps.VOLUNTEERS(n,s))}})},AG=()=>{const{organizationId:e,eventId:t,userInfoId:n}=ti(),{data:s,loader:o}=Qn("query UserUpdateAccreditationsInfos(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $userInfoId: UsersInfoId!\n $loadDelegation: Boolean!\n) {\n organization(id: $organizationId) {\n userInfo(id: $userInfoId) {\n ...MemberRegistrationUserInfo\n ...FormsUsersInfosWished\n\n volunteerRegistration(eventId: $eventId) @include(if: $loadDelegation) {\n delegation {\n formId\n\n accreditationsSlots {\n ...DelegationAccreditationSlot\n }\n }\n }\n }\n }\n\n event(id: $eventId) {\n forms {\n nodes {\n ...FormMemberRegistration\n }\n }\n\n accreditationsCategories {\n ...FormRegisterAccreditationCategory\n }\n }\n}\n",{organizationId:e,eventId:t,userInfoId:n,loadDelegation:!0},[Vs.MemberRegistrationUserInfoFragment,Vs.FormsUsersInfosWishedFragment,Vs.DelegationAccreditationSlotFragment,Vs.FormMemberRegistrationFragment,Vs.FormRegisterAccreditationCategoryFragment]),r=(0,L.useMemo)(()=>{if(s.organization&&s.event){const e=s.organization.userInfo.volunteerRegistration;return s.event.forms.nodes.filter(t=>t.accreditationDisplay!==pt.None||e.delegation?.formId===t.id&&so(e.delegation.accreditationsSlots))}return[]},[s.organization,s.event]);return o||(so(r)?(0,i.jsxs)(Sr.dO,{children:[(0,i.jsx)(Sr.qh,{path:Ps.EDIT_USER_ACCREDITATIONS_FORM(":organizationId",":eventId",":userInfoId",":formId"),children:(0,i.jsx)(kG,{event:s.event,forms:r,userInfo:s.organization.userInfo})}),(0,i.jsx)(Sr.qh,{children:(0,i.jsx)(oi,{path:Ps.EDIT_USER_ACCREDITATIONS_FORM(e,t,n,r[0].id),replace:!0})})]}):(0,i.jsx)(oi,{}))},wG=e=>{const{params:{organizationId:t,eventId:n,userInfoId:s},translate:o}=vl();return(0,i.jsx)(zO,{forms:e.forms,getTabPath:e=>Ps.EDIT_USER_MISSIONS_FORM(t,n,s,e),handleSubmit:e.handleSubmit,isLoading:e.isLoading,returnPathFallback:Ps.VOLUNTEERS(t,n),title:o("mise_jour_des_02859",e.userInfo.nameOrEmail),children:e.forms.map((o,r)=>(0,i.jsxs)(hj,{path:Ps.EDIT_USER_MISSIONS_FORM(t,n,s,o.id),children:[(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(YT,{change:e.change,event:e.event,options:{...o,showFullPosition:!0,slotDisplay:It.Hide,positionFilter:xt.None},positionsCategoriesIds:e.values.userInfo.missions[r].positionsCategoriesIds,positionsIds:e.values.userInfo.missions[r].positionsIds,positionsSlotsIds:e.values.userInfo.missions[r].positionsSlotsIds,prefix:`userInfo.missions[${r}].`,slots:[],userInfoFields:e.userInfo.fields})]},o.id))})},SG=e=>{const{history:t,params:{organizationId:n,eventId:s,userInfoId:o}}=vl(),r=Zn(kT),{mutate:a,isLoading:l}=function(e={}){return ei("mutation UserInfoPositionsUpdate(\n $eventId: EventId!\n $userId: UserId\n $delegationId: DelegationId\n $userInfoId: UsersInfoId!\n $userInfoPositions: [UserInfoPositionsInput!]!\n) {\n userInfoPositionsUpdate(\n eventId: $eventId\n userId: $userId\n delegationId: $delegationId\n userInfoId: $userInfoId\n userInfoPositions: $userInfoPositions\n )\n}\n",e)}(),d=(0,L.useMemo)(()=>e.forms.map(t=>{const n=e.userInfo.formsUsersInfos.find(e=>e.formId===t.id);return{formId:t.id,...r.volunteersRegistrationsWishedPositionsUpdateInputDefault(n)}}),[e.forms,e.userInfo.formsUsersInfos]);return(0,i.jsx)(kl,{direction:"column",height:1,initialValues:{userInfo:{missions:d}},render:({form:t,handleSubmit:n,values:s})=>(0,i.jsx)(wG,{change:t.change,event:e.event,forms:e.forms,handleSubmit:n,isLoading:l,userInfo:e.userInfo,values:s}),width:1,onSubmit:async e=>{await a({eventId:s,userInfoId:o,userInfoPositions:e.userInfo.missions}),t.goBack(Ps.VOLUNTEERS(n,s))}})},EG=()=>{const{organizationId:e,eventId:t,userInfoId:n}=ti(),{data:s,loader:o}=Qn("query UserUpdateMissionsInfos(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $userInfoId: UsersInfoId!\n) {\n organization(id: $organizationId) {\n userInfo(id: $userInfoId) {\n ...MemberRegistrationUserInfo\n\n ...FormsUsersInfosWished\n }\n }\n\n event(id: $eventId) {\n forms {\n nodes {\n ...FormMemberRegistration\n }\n }\n\n positionsCategories {\n ...FormRegisterCategory\n }\n }\n}\n",{organizationId:e,eventId:t,userInfoId:n},[Vs.MemberRegistrationUserInfoFragment,Vs.FormsUsersInfosWishedFragment,Vs.FormMemberRegistrationFragment,Vs.FormRegisterCategoryFragment]),r=(0,L.useMemo)(()=>(s.event?.forms.nodes??[]).filter(e=>e.positionDisplay!==_t.None),[s.event]);return o||(0,i.jsxs)(Sr.dO,{children:[(0,i.jsx)(Sr.qh,{path:Ps.EDIT_USER_MISSIONS_FORM(":organizationId",":eventId",":userInfoId",":formId"),children:(0,i.jsx)(SG,{event:s.event,forms:r,userInfo:s.organization.userInfo})}),(0,i.jsx)(Sr.qh,{children:(0,i.jsx)(oi,{path:Ps.EDIT_USER_MISSIONS_FORM(e,t,n,r[0].id),replace:!0})})]})},TG=e=>{const{translate:t,params:{organizationId:n,eventId:s,userInfoId:o}}=vl();return(0,i.jsx)(zO,{forms:e.forms,getTabPath:e=>Ps.EDIT_USER_SLOTS_FORM(n,s,o,e),handleSubmit:e.handleSubmit,isLoading:e.isLoading,returnPathFallback:Ps.VOLUNTEERS(n,s),title:t("mise_jour_des_28904",e.userInfo.nameOrEmail),children:e.forms.map((t,r)=>(0,i.jsxs)(hj,{path:Ps.EDIT_USER_SLOTS_FORM(n,s,o,t.id),children:[(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(rz,{change:e.change,currentSlots:e.values.userInfo.slots[r].slots,customSlotsPeriods:t.customSlotsPeriods,daysDisplay:t.daysDisplay,event:e.event,prefix:`userInfo.slots[${r}].`,slotDisplay:t.slotDisplay,userInfoFields:e.userInfo.fields})]},t.id))})},zG=e=>{const{history:t,params:{organizationId:n,eventId:s,userInfoId:o}}=vl(),r=Zn(kT),{mutate:a,isLoading:l}=function(e={}){return ei("mutation UserInfoSlotsUpdate(\n $eventId: EventId!\n $userId: UserId\n $delegationId: DelegationId\n $userInfoId: UsersInfoId!\n $userInfoSlots: [UserInfoSlotsInput!]!\n) {\n userInfoSlotsUpdate(\n eventId: $eventId\n userId: $userId\n delegationId: $delegationId\n userInfoId: $userInfoId\n userInfoSlots: $userInfoSlots\n )\n}\n",e)}(),d=(0,L.useMemo)(()=>e.forms.map(t=>{const n=e.userInfo.formsUsersInfos.find(e=>e.formId===t.id);return{formId:t.id,slots:r.volunteersRegistrationsSlotsUpdateInputDefault(n?.slots)}}),[e.forms,e.userInfo]);return(0,i.jsx)(kl,{direction:"column",height:1,initialValues:{userInfo:{slots:d}},render:({form:t,handleSubmit:n,values:s})=>(0,i.jsx)(TG,{change:t.change,event:e.event,forms:e.forms,handleSubmit:n,isLoading:l,userInfo:e.userInfo,values:s}),width:1,onSubmit:async e=>{await a({eventId:s,userInfoId:o,userInfoSlots:e.userInfo.slots}),t.goBack(Ps.VOLUNTEERS(n,s))}})},OG=()=>{const{organizationId:e,eventId:t,userInfoId:n}=ti(),{data:s,loader:o}=Qn("query UserUpdateSlotsInfos(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $userInfoId: UsersInfoId!\n) {\n organization(id: $organizationId) {\n userInfo(id: $userInfoId) {\n ...MemberRegistrationUserInfo\n\n ...FormsUsersInfosWished\n }\n }\n\n event(id: $eventId) {\n startAt\n endAt\n dayStartTime\n ranges\n\n forms {\n nodes {\n ...FormMemberRegistration\n }\n }\n }\n}\n",{organizationId:e,eventId:t,userInfoId:n},[Vs.MemberRegistrationUserInfoFragment,Vs.FormsUsersInfosWishedFragment,Vs.FormMemberRegistrationFragment]),r=(0,L.useMemo)(()=>(s.event?.forms.nodes??[]).filter(e=>e.slotDisplay!==It.Hide),[s.organization,s.event]),{permissions:[a],isLoading:l}=fk(uk({eventId:t,userInfoId:n})),d=ni();return l||a||d.push(Ps.DASHBOARD(e,t)),o||l?o:(0,i.jsxs)(Sr.dO,{children:[(0,i.jsx)(Sr.qh,{path:Ps.EDIT_USER_SLOTS_FORM(":organizationId",":eventId",":userInfoId",":formId"),children:(0,i.jsx)(zG,{event:s.event,forms:r,userInfo:s.organization.userInfo})}),(0,i.jsx)(Sr.qh,{children:(0,i.jsx)(oi,{path:Ps.EDIT_USER_SLOTS_FORM(e,t,n,r[0].id),replace:!0})})]})},RG=()=>{const{params:{eventId:e}}=vl(),{columns:t,columnsSearch:n,infos:s,isEditMode:o,limit:r,nameDebounced:a,offset:l,predicates:d,rendering:c,setInfos:u,setLimit:h,setOffset:g}=vy(),p=(0,L.useMemo)(()=>({...Yh(t,c),includeCanRegistrationStateUpdate:!1,includeIsEditable:!1}),[t,c]),{mutate:f}=yo(),{data:_,isLoading:x}=Qn("query VolunteersAccreditationsMatrix($eventId: EventId!) {\n event(id: $eventId) {\n accreditationsSlots(includeHidden: true) {\n nodes {\n ...AccreditationSlotMatrix\n }\n }\n }\n}\n",{eventId:e},[Vs.AccreditationSlotMatrixFragment]),{data:I,isLoading:v}=rr({...p,eventId:e,predicates:d,name:m(a)?a:null,columnsSearch:so(n)?n:void 0,limit:r,offset:l}),{numberOfPages:b,totalCount:j}=Su(I.data?.rows),[C,y]=(0,L.useState)([]),[k,A]=(0,L.useState)({}),w=(0,L.useMemo)(()=>s.volunteersMatrixSelectedSlotsIds||[],[s]),S=(0,L.useCallback)(e=>u({...s,volunteersMatrixSelectedSlotsIds:e}),[s,u]),E=(0,L.useCallback)(async t=>{A(e=>({...e,[t]:!0}));const{data:{row:n}}=await or({...p,eventId:e,id:t},await Y());y(e=>e.map(e=>e.id===t?n:e)),A(e=>({...e,[t]:!1}))},[p,A,y]),T=(0,L.useCallback)(e=>k[e]??!1,[k]),z=(0,L.useCallback)((t,n)=>f({eventId:e,massAccredit:{accreditationsSlotsIds:[n],selecteds:{ids:[t]},strategy:it.Add}}),[e,f]),O=(0,L.useCallback)((t,n)=>f({eventId:e,massAccredit:{accreditationsSlotsIds:[n],selecteds:{ids:[t]},strategy:it.Delete}}),[e,f]);return(0,L.useEffect)(()=>{y(I.data?.rows.nodes??[])},[I.data]),(0,i.jsx)(qA,{addAccreditationSlot:z,allAccreditationsSlots:_.event?.accreditationsSlots.nodes??[],deleteAccreditationSlot:O,editMode:"assigned",isEditMode:o,isLoading:v||x,isRowLoading:T,limit:r,members:C,numberOfPages:b,offset:l,reloadRow:E,selectedSlotsIds:w,setLimit:h,setOffset:g,setSelectedSlotsIds:S,totalCount:j})},$G=e=>{const{translate:t,params:{eventId:n}}=vl(),{mutate:s}=function(e={}){return ei("mutation VolunteerRegistrationDuplicate(\n $eventId: EventId!\n $volunteerRegistrationId: VolunteersRegistrationId!\n $numberOfCopies: Int!\n) {\n volunteerRegistrationDuplicate(\n eventId: $eventId\n volunteerRegistrationId: $volunteerRegistrationId\n numberOfCopies: $numberOfCopies\n )\n}\n",e)}(),[o,r]=(0,L.useState)(1),[a,l]=(0,L.useState)(!1);return(0,i.jsx)(Lb,{isOpen:!0,onClose:e.onClose,children:(0,i.jsxs)(Nb,{children:[(0,i.jsx)(Mb,{icon:"clone",children:t("dupliquer_un_me_90016")}),(0,i.jsx)(Fb,{children:(0,i.jsx)(Bl,{label:t("nombre_de_copie_37518"),min:1,shouldParseAsInt:!0,value:o,onChange:r})}),(0,i.jsx)(Pb,{children:(0,i.jsx)(zl,{isLoading:a,onClick:async()=>{l(!0),await s({eventId:n,volunteerRegistrationId:e.volunteerRegistrationId,numberOfCopies:o}),e.onClose(),e.reload()},children:t("dupliquer_1_94438",e.name)})})]})})},DG=({eventId:e,organizationId:t,reload:n,reloadRow:s,volunteerRegistration:o})=>{const{history:r,translate:a}=vl(),{hasFeature:l}=TI(),{event:d,isEventAdmin:c}=wb(),{canMemberAssign:u,canMemberAssignmentStateEdit:h,canMemberAccredit:m,canMemberCreate:g,canMemberDelete:p}=$S(),{showNotification:f}=Ob(),_=o.state,x=o.accreditationState,{mutate:I,isLoading:v}=tr(),{mutate:b,isLoading:j}=Jo(),{mutate:C}=No(),{mutate:y}=Wo(),k=h&&_!==Pt.WaitingAssignment,A=h&&_!==Pt.Refused,w=h&&(_===Pt.WaitingAssignment||_===Pt.Assigned),S=u&&_===Pt.Assigned,E=u&&_===Pt.PreAssigned,T=u&&_===Pt.WaitingAssignment,z=m&&x!==le.WaitingAccreditation,O=m&&x!==le.Refused,R=m&&(x===le.WaitingAccreditation||x===le.Accredited||x===le.AutoAccredited),$=m&&(x===le.Accredited||x===le.AutoAccredited),D=m&&x===le.WaitingAccreditation,[P,F]=(0,L.useState)(!1),[M,N]=(0,L.useState)(!1),[B,V]=(0,L.useState)(!1),U=c&&d.useDelegations&&l(Be.Delegation)&&o.delegation,W=g,G=p&&o.canDelete,H=(u||h)&&m&&(U||W||G);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Yc,{children:[(u||h)&&(0,i.jsxs)(i.Fragment,{children:[k&&(0,i.jsx)(Kd,{icon:"arrow-right-arrow-left",onClick:async()=>{v||(await I({eventId:e,massStateUpdate:{selecteds:{ids:[o.userInfo.id]},state:Pt.WaitingAssignment}}),s())},children:a("changer_le_stat_90266")}),A&&(0,i.jsx)(Kd,{icon:"arrow-right-arrow-left",onClick:async()=>{v||(await I({eventId:e,massStateUpdate:{selecteds:{ids:[o.userInfo.id]},state:Pt.Refused}}),s())},children:a("changer_le_stat_68392")}),w&&(0,i.jsx)(Kd,{icon:"arrow-right-arrow-left",onClick:async()=>{v||(await I({eventId:e,massStateUpdate:{selecteds:{ids:[o.userInfo.id]},state:Pt.NotApplicable}}),s())},children:a("changer_le_stat_62507")}),S&&(0,i.jsx)(Kd,{icon:"pen",onClick:()=>{v||r.push(Ps.EDIT_ASSIGNMENT(t,e,o.userInfo.id))},children:a("_diter_les_affe_42283")}),E&&(0,i.jsx)(Kd,{icon:"pen",onClick:()=>{v||r.push(Ps.PRE_ASSIGNMENT(t,e,o.userInfo.id))},children:a("_diter_les_pr_10213")}),T&&(0,i.jsx)(Kd,{icon:"wand-magic-sparkles",onClick:()=>{v||r.push(Ps.ASSIGNMENT(t,e,o.userInfo.id))},children:a("affecter_94255")})]}),(u||h)&&m&&(0,i.jsx)(Xu,{color:"gray100",direction:"horizontal"}),m&&(0,i.jsxs)(i.Fragment,{children:[z&&(0,i.jsx)(Kd,{icon:"arrow-right-arrow-left",onClick:async()=>{j||(await b({eventId:e,massStateUpdate:{selecteds:{ids:[o.userInfo.id]},state:le.WaitingAccreditation}}),s())},children:a("change_le_statu_93385")}),O&&(0,i.jsx)(Kd,{icon:"arrow-right-arrow-left",onClick:async()=>{j||(await b({eventId:e,massStateUpdate:{selecteds:{ids:[o.userInfo.id]},state:le.Refused}}),s())},children:a("changer_le_stat_68392")}),R&&(0,i.jsx)(Kd,{icon:"arrow-right-arrow-left",onClick:async()=>{j||(await b({eventId:e,massStateUpdate:{selecteds:{ids:[o.userInfo.id]},state:le.NotApplicable}}),s())},children:a("changer_le_stat_62507")}),$&&(0,i.jsx)(Kd,{icon:"pen",onClick:()=>{j||r.push(Ps.EDIT_ACCREDIT(t,e,o.userInfo.id))},children:a("_diter_les_accr_86042")}),D&&(0,i.jsx)(Kd,{icon:"badge-check",onClick:()=>{j||r.push(Ps.ACCREDIT(t,e,o.userInfo.id))},children:a("accr_diter_70543")})]}),H&&(0,i.jsx)(Xu,{color:"gray100",direction:"horizontal"}),W&&(0,i.jsx)(Kd,{icon:"clone",onClick:()=>F(!0),children:a("dupliquer_28256")}),U&&(0,i.jsx)(Kd,{color:"red",icon:"minus",onClick:()=>{N(!0)},children:a("retirer_de_la_d_64963")}),G&&(0,i.jsx)(Kd,{color:"red",icon:"trash-can",onClick:()=>{V(!0)},children:a("d_sinscrire_de_06416")})]}),W&&P&&(0,i.jsx)($G,{name:o.userInfo.nameOrEmail,reload:n,volunteerRegistrationId:o.id,onClose:()=>F(!1)}),U&&M&&(0,i.jsx)(cA,{buttonText:a("retirer_de_la_d_64963"),subtext:[a("_tes_vous_sur_d_34901",o.delegation.name)],text:a("suppression_de_73669",o.userInfo.name),onClose:()=>{N(!1)},onDelete:async()=>{await C({organizationId:t,eventId:e,delegationId:o.delegation.id,selecteds:{ids:[o.userInfo.id]}}),f(a("_1_a_t_retir_36729",o.userInfo.name,o.delegation.name)),s()}}),p&&B&&(0,i.jsx)(cA,{buttonText:a("d_sinscrire_de_06416"),subtext:[a("_tes_vous_sur_d_79932")],text:a("suppression_de_73669",o.userInfo.name),onClose:()=>{V(!1)},onDelete:async()=>{await y({eventId:e,selecteds:{ids:[o.userInfo.id]}}),f(a("_1_a_t_d_sin_66177",o.userInfo.name)),n()}})]})},PG=({columns:e,customFields:t,eventId:n,organizationId:s,reload:o,reloadVolunteer:r,segmentId:a,state:l,toggleRow:d,volunteerRegistration:c})=>{const{translate:u}=vl(),{isEventAdmin:h,hasPermission:m}=wb(),{canMemberAccredit:g,canMemberAssign:p,canMemberAssignmentStateEdit:f,canMemberCreate:_,canMemberDelete:x,canMemberEdit:I}=$S(),v=_y(t),b=(0,L.useCallback)(()=>{r(c.id)},[c,r]),j=I||p||g,C=_||x||g||p||f,y=c.userInfo,k=Ps.VOLUNTEERS_LIST_USER_PANEL_ACCREDITATIONS(s,n,a,y.id),A=Ps.VOLUNTEERS_LIST_USER_PANEL_AVAILABILITIES(s,n,a,y.id),w=Ps.VOLUNTEERS_LIST_USER_PANEL_POSITIONS(s,n,a,y.id),S=(c.teams||[]).map(e=>Ps.VOLUNTEERS_LIST_USER_PANEL_TEAM(s,n,a,y.id,e.teamCode));return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Mc,{css:{background:"checked"===l?"$primary100":"white","&:hover":{background:"checked"===l?"$primary100":"$gray100"}},onMouseLeave:e=>Vd(e.target),children:[j&&(0,i.jsx)(Oc,{justify:"center",width:48,children:(0,i.jsx)(fc,{state:l,onClick:(e,t)=>{Dl(t),d(`ui${y.id}`,e)}})}),e.map(e=>{const t=v.get(e.slug);return(0,i.jsx)(wk,{accreditationsPanelPath:k,availabilitiesPanelPath:A,canAccredit:h,canAssign:h,canChangeDelegation:h,canClickMemberName:!0,column:e,customField:t,eventId:n,positionsPanelPath:w,reloadRow:b,row:c},e.slug)}),C&&(0,i.jsxs)(Xc,{justify:"center",children:[(y.isEditable??!0)&&(0,i.jsxs)(km,{children:[(0,i.jsx)(Sm,{children:(0,i.jsx)(Ar,{children:(0,i.jsx)(nl,{icon:"pen",to:Ps.EDIT_USER(s,n,c.userInfo.id)})})}),(0,i.jsx)(wm,{placement:"top",children:u("_diter_62574")})]}),(0,i.jsx)(DG,{eventId:n,organizationId:s,reload:o,reloadRow:b,volunteerRegistration:c})]})]}),(0,i.jsx)(lA,{accreditationsPanelPath:k,availabilitiesPanelPath:A,canAccredit:h,canCheckIn:(e,t)=>m(Hb.POSITION_READ,{positionCategoryId:e,positionId:t}),canDeletePosition:(e,t)=>m(Hb.MEMBER_ASSIGN,{positionCategoryId:e,positionId:t}),canEditWishedAccreditations:!1,defaultHiddenAccreditationsSlotsIds:[],eventId:n,organizationId:s,positionsPanelPath:w,reloadRow:b,returnPathFallback:Ps.VOLUNTEERS(s,n),teamsPanelsPath:S,volunteerRegistration:c})]})},FG=(0,L.memo)(function(e){const{params:{organizationId:t,eventId:n,segmentId:s}}=vl(),{isEventAdmin:o}=wb(),{canMemberAccredit:r,canMemberAssign:a,canMemberAssignmentStateEdit:l,canMemberCreate:d,canMemberDelete:c,canMemberEdit:u}=$S(),{columns:h,columnsSearch:g,limit:p,massActions:f,nameDebounced:_,offset:x,possibleColumns:I,predicates:v,reloadKey:b,rendering:j,setLimit:C,setOffset:y,setSort:k,sort:A}=vy(),w=(0,L.useMemo)(()=>({...Yh(h,j,{includeWeezeventUrls:!0}),includeCanRegistrationStateUpdate:!o,includeIsEditable:!o}),[h,j]),{data:S,isLoading:E,reload:T}=rr({...w,eventId:n,predicates:v,name:m(_)?_:null,columnsSearch:so(g)?g:null,limit:p,offset:x,sort:A}),{numberOfPages:z,totalCount:O}=Su(S.data?.rows);(0,L.useEffect)(()=>{b>1&&T()},[b]);const R=(0,L.useMemo)(()=>h.flatMap(e=>(0,Za.A)([I.find(t=>t.slug===e)])),[I,h]),[$,D]=(0,L.useState)([]),[P,F]=(0,L.useState)({}),M=(0,L.useCallback)(async e=>{F(t=>({...t,[e]:!0}));const{data:{row:t}}=await or({...w,eventId:n,id:e},await Y());D(n=>n.map(n=>n.id===e?t:n)),F(t=>({...t,[e]:!1}))},[w,F,D]),N=u||a||r,B=d||c||r||a||l;return(0,L.useEffect)(()=>{D(S.data?.rows.nodes??[])},[S.data]),(0,L.useEffect)(()=>{f.setStates(Object.fromEntries((S.data?.rows.nodes??[]).map(({userInfo:e})=>[`ui${e.id}`,{id:e.id,state:"unchecked"}])))},[S.data,f.setStates]),(0,i.jsx)(Ba,{css:{flex:"1",overflow:"hidden"},width:1,children:(0,i.jsx)(Cm,{"aria-busy":E,headerRow:(0,i.jsxs)(kc,{children:[N&&(0,i.jsx)(Gc,{justify:"center",width:48,children:(0,i.jsx)(fc,{state:f.selectAllState,onClick:f.toggleSelectAll})}),R.map(e=>e.isSortable?(0,i.jsx)(jm,{attribute:e.sortAttribute||e.slug,minWidth:e.minWidth,setSort:k,sort:A,width:e.width,children:(0,i.jsx)(Ar,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug):(0,i.jsx)(Gc,{minWidth:e.minWidth,width:e.width,children:(0,i.jsx)(Ar,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug)),B&&(0,i.jsx)(Gc,{width:100})]}),paginationRow:(0,i.jsx)(Nc,{css:{borderTop:"1px solid $gray200"},children:(0,i.jsx)(Fc,{limit:p,numberOfPages:z,offset:x,setLimit:C,setOffset:y,showLimits:!0,totalCount:O})}),children:E?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Hc,{}),(0,i.jsx)(Hc,{}),(0,i.jsx)(Hc,{})]}):$.map(o=>P[o.id]?(0,i.jsx)(Hc,{},o.id):(0,i.jsx)(PG,{columns:R,customFields:e.customFields,eventId:n,organizationId:t,reload:T,reloadVolunteer:M,segmentId:s,state:f.states[`ui${o.userInfo.id}`]?.state??"unchecked",toggleRow:f.toggleRow,volunteerRegistration:o},o.id))})})}),MG=(0,L.memo)(e=>{const t=(0,L.useCallback)(t=>{t&&(n.current&&(s.current?.setMap(null),n.current=null),n.current=new google.maps.Map(t,{...Dr(e.initialCenter,e.initialZoom,e.layer)}),n.current.mapTypes.set(nt.IgnPlan,Lr()),s.current=new google.maps.OverlayView,s.current.draw=td.A,s.current.setMap(n.current),n.current.addListener("drag",()=>{e.onMapDrag?.()}),n.current.addListener("center_changed",()=>{e.onMapCenterChanged?.({lat:n.current.getCenter().lat(),lng:n.current.getCenter().lng()})}),n.current.addListener("zoom_changed",()=>{e.onMapZoomchanged?.(n.current.getZoom())}),n.current.addListener("tilesloaded",()=>{setTimeout(()=>{e.onMapTilesloaded?.()},1e3)}),a(),jW(e.traces,e.hiddenTracesIds,r,n))},[]),n=(0,L.useRef)(null),s=(0,L.useRef)(null),o=(0,L.useRef)([]),r=(0,L.useRef)([]),a=(0,L.useCallback)(()=>{o.current.forEach(e=>e.setMap(null)),o.current=e.users.map(t=>{const i=Or(t),o=Dg(t.name,t.email),r=new google.maps.Marker({position:i,map:n.current,icon:`${P.HEAVENT_API_URL}/icons/acronym.svg?color=${encodeURIComponent("#0284fe")}&text=${o}`});return r.addListener("click",()=>{const n=s.current?.getProjection()?.fromLatLngToContainerPixel(new google.maps.LatLng(i.lat,i.lng));n&&e.onUserClick?.(t,n)}),r})},[e.users]);return(0,L.useEffect)(()=>{a()},[JSON.stringify(e.users)]),(0,L.useEffect)(()=>{n.current?.setMapTypeId(Fr(e.layer))},[e.layer]),(0,L.useEffect)(()=>{jW(e.traces,e.hiddenTracesIds,r,n)},[JSON.stringify(e.traces),e.hiddenTracesIds]),(0,i.jsx)(Ar,{ref:t,height:1,width:1})},Mr.A);MG.displayName="UsersMap";const NG=e=>{const{params:{organizationId:t,eventId:n}}=vl();return(0,i.jsx)(Ba,{align:"center",css:{background:"white",borderRadius:"$1",boxShadow:"$xs",padding:"$4"},gap:"4",height:50,children:(0,i.jsxs)(el,{to:QI.MEMBER_INFORMATION({organizationId:t,eventId:n,userInfoId:e.user.id}),children:[(0,i.jsx)(Ar,{color:"gray800",children:e.user.name}),(0,i.jsx)(Ar,{children:(0,i.jsx)(nl,{icon:"chevron-right"})})]})})},LG=e=>{const{params:{eventId:t}}=vl(),{isEventAdmin:n}=wb(),{mutate:s}=So(),[o,r]=(0,L.useState)(e.layer),[a,l]=(0,L.useState)(null),[d,c]=(0,L.useState)([]),[u,h]=kz("volunteerssMap.center",e.center),[m,g]=kz("volunteerssMap.zoom",$r),p=(0,L.useRef)(null);return(0,i.jsxs)(Ba,{css:{flex:"1",position:"relative"},direction:"column",width:1,children:[(0,i.jsx)(Ar,{ref:p,css:{flex:"1"},width:1,children:(0,i.jsx)(MG,{hiddenTracesIds:d,initialCenter:u,initialZoom:m,layer:o,traces:e.traces,users:e.users,onMapCenterChanged:h,onMapDrag:()=>l(null),onMapZoomchanged:g,onUserClick:(e,t)=>l({user:e,left:t.x,top:t.y})})}),n&&(0,i.jsx)(DW,{acronymIcon:"icon",hiddenTracesIds:d,layer:o,reload:e.reload,setAcronymIcon:td.A,setHiddenTracesIds:c,setLayer:async e=>{r(e),await s({eventId:t,layer:e})},showAcronymIcon:!1,showExport:!1,traces:e.traces,onExport:td.A,onFullscreen:()=>{p.current?.requestFullscreen()}}),p.current&&a&&(0,Kt.createPortal)((0,i.jsx)(Ar,{css:{left:`${a.left+32}px`,position:"absolute",top:a.top-25-16+"px",zIndex:10},children:(0,i.jsx)(NG,{user:a.user})}),p.current)]})},BG=()=>{const{params:{eventId:e}}=vl(),{columns:t,columnsSearch:n,nameDebounced:s,predicates:o,rendering:r}=vy(),a=(0,L.useMemo)(()=>({...Yh(t,r),includeCanRegistrationStateUpdate:!1,includeIsEditable:!1}),[t,r]),{data:l,loader:d,reload:c}=rr({...a,eventId:e,predicates:o,hasCoordinates:!0,name:m(s)?s:null,columnsSearch:so(n)?n:void 0,limit:250}),u=(0,L.useMemo)(()=>(l.data?.rows.nodes??[]).flatMap(e=>"number"==typeof e.userInfo.fields.latitude&&"number"==typeof e.userInfo.fields.longitude?[{id:e.userInfo.id,email:e.userInfo.email,latitude:e.userInfo.fields.latitude,longitude:e.userInfo.fields.longitude,name:e.userInfo.name}]:[]),[l.data]);return d||(0,i.jsx)(LG,{center:Ux(l.data),layer:l.data.layer,reload:c,traces:l.data.traces||[],users:u})},VG=e=>(0,i.jsx)(Ba,{align:"center",css:{padding:"$2 $4"},direction:"column",height:1,justify:"center",width:1,children:(0,i.jsx)(xj,{size:32,userInfo:e.vr.userInfo})}),UG=()=>{const{translate:e}=vl();return(0,i.jsx)(Ba,{align:"center",css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",px:"$2"},height:1,width:1,children:(0,i.jsx)(Ar,{css:{ellipsis:!0},font:"gray800 textXs medium",textAlign:"center",width:1,children:e("disponible_69523")})})},WG=e=>{const t=Zn(ph),n=(0,L.useMemo)(()=>ic(e.slot.position.color),[e.slot]),s=(0,L.useMemo)(()=>Ch(t,e.slot.positionSlot,e.slot.position.name,{position:{includeName:!0},slot:{includeRange:!0}}),[e.slot]);return(0,i.jsxs)(Wd,{children:[(0,i.jsx)(Xd,{children:(0,i.jsx)(Ba,{align:"center",css:{background:n[50],borderRadius:"$1",color:n[700],cursor:"pointer",px:"$2"},height:1,width:1,children:(0,i.jsx)(Ar,{css:{ellipsis:!0},fontSize:"textXs",fontWeight:"medium",textAlign:"center",title:s,width:1,children:s})})}),(0,i.jsx)(Zd,{css:{padding:"0"},placement:"bottom-start",renderOnPortal:!0,width:460,children:(0,i.jsx)(WW,{category:e.slot.positionCategory,position:e.slot.position,slot:e.slot.positionSlot})})]})},GG=e=>"assignment"===e.slot.type?(0,i.jsx)(WG,{slot:e.slot}):(0,i.jsx)(UG,{}),HG=e=>{const{translate:t,params:{eventId:n}}=vl(),{infos:s,limit:o,nameDebounced:r,offset:a,predicates:l,setInfos:d,setLimit:c,setOffset:u}=vy(),{data:h,loader:g}=Qn("query VolunteersPlanning(\n $eventId: EventId!\n $predicates: [Predicate!]!\n $name: String\n $limit: Int\n $offset: Int\n) {\n data: event(id: $eventId) {\n rows: volunteersRegistrations(\n predicates: $predicates\n name: $name\n limit: $limit\n offset: $offset\n ) {\n nodes {\n ...DocumentUsersPlanning\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{eventId:n,predicates:l,name:m(r)?r:void 0,limit:o,offset:a},[Vs.DocumentUsersPlanningFragment]);const{numberOfPages:p,totalCount:f}=Su(h.data?.rows),_=(0,L.useMemo)(()=>s?.volunteersPlanningshowAvailabilities??!0,[s]),x=(0,L.useCallback)(e=>{d({...s,volunteersPlanningshowAvailabilities:e})},[s,d]),I=(0,L.useMemo)(()=>(h.data?.rows.nodes??[]).map(e=>({...e,slots:e.slots.flatMap(e=>_?[{type:"availability",range:e.range}]:[]).concat(e.positionsSlotsUsersInfos.map(e=>({type:"assignment",range:e.positionSlot.range,positionCategory:e.positionCategory,position:e.position,positionSlot:e.positionSlot})))})),[h.data,_]),v=(0,L.useMemo)(()=>Gs.c9.isDateTime(s.volunteersPlanningStartAt)&&s.volunteersPlanningStartAt?.isValid?s.volunteersPlanningStartAt:Gs.c9.fromISO(s.volunteersPlanningStartAt)?.isValid?Gs.c9.fromISO(s.volunteersPlanningStartAt,{zone:"utc"}):Gs.IX.fromDateTimes(e.startAt.startOf("day"),e.endAt.endOf("day")).contains(Gs.c9.utc())?Gs.c9.utc():e.startAt,[e.startAt,e.endAt,s]),b=(0,L.useCallback)(t=>{d({...s,volunteersPlanningStartAt:t?.toISO()??e.startAt.toISO()})},[e.startAt,s,d]),j=(0,L.useMemo)(()=>{const t=jh(e.dayStartTime);return t?.[0]??0},[e.dayStartTime]);return g||(0,i.jsxs)(Ba,{css:{flex:"1"},direction:"column",width:1,children:[(0,i.jsx)(Ba,{css:{background:"white",flex:"1"},children:(0,i.jsx)(VW,{data:I,date:v,maxDate:e.endAt,minDate:e.startAt,renderFilters:()=>(0,i.jsx)(Ar,{width:40,children:(0,i.jsxs)(km,{children:[(0,i.jsx)(Sm,{children:(0,i.jsx)(zl,{color:"white",leftIcon:_?"eye":"eye-slash",onClick:()=>x(!_)})}),(0,i.jsx)(wm,{placement:"top",children:t(_?"masquer_les_dis_82263":"afficher_les_di_01534")})]})}),renderLeftCell:e=>(0,i.jsx)(VG,{vr:e}),renderSlot:e=>(0,i.jsx)(GG,{slot:e}),showPlus:!1,startHour:j,onChange:b})}),(0,i.jsx)(Nc,{children:(0,i.jsx)(Fc,{limit:o,numberOfPages:p,offset:a,setLimit:c,setOffset:u,showLimits:!0,totalCount:f})})]})},qG=()=>(0,i.jsxs)(Ba,{align:"center",css:{borderBottom:"1px solid $gray200",cursor:"pointer",py:"$3",userSelect:"none",width:"100%","&:last-child":{border:"none"}},children:[(0,i.jsx)(fc,{shouldPreventDefault:!1,state:"unchecked",onClick:td.A}),(0,i.jsx)(Ya,{width:"3"}),(0,i.jsx)(lc,{size:40,variant:"circular"}),(0,i.jsx)(Ya,{width:"4"}),(0,i.jsxs)(Ba,{css:{flex:"1",overflow:"hidden"},direction:"column",gap:"1",children:[(0,i.jsx)(lc,{borderRadius:"$1",height:12,width:1}),(0,i.jsx)(lc,{borderRadius:"$1",height:12,width:1})]})]}),KG=e=>{const{data:t,isLoading:n}=Ea({organizationId:e.organizationId,excludedEventId:e.eventId,name:m(e.nameOrEmail)?e.nameOrEmail:null});return n?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qG,{}),(0,i.jsx)(qG,{}),(0,i.jsx)(qG,{})]}):(0,i.jsx)(i.Fragment,{children:t.organization.usersInfos.nodes.map(t=>{const n=e.usersInfosIds.includes(t.id)?"checked":"unchecked";return(0,i.jsx)(Kw,{state:n,userInfo:t,onClick:()=>{e.select(t.id)}},t.id)})})},YG=e=>{const t=Xn(),n=Zn(kT),s=Zn(Ua),[o,r,a]=Wc(""),{mutate:l,isLoading:d}=Ta();return(0,i.jsx)(kl,{hideDefaultErrors:!0,initialValues:{usersInfosIds:[],sendVolunteerRegistrationEmail:!1},render:({form:n,handleSubmit:s,values:l})=>(0,i.jsxs)(au,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Ar,{color:"gray800",css:{height:"56px",textAlign:"center"},children:(0,i.jsx)("img",{alt:"Avatars",height:"100%",src:fd.AvatarGroup})}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(Ar,{color:"gray800",fontSize:"textLg",fontWeight:"medium",textAlign:"center",children:t("ajouter_un_memb_33261")}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ar,{color:"gray500",textAlign:"center",children:t("ajouter_un_ou_d_44771")}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(Bl,{icon:"magnifying-glass",placeholder:t("rechercher_un_m_05904"),value:o,onChange:a}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(jl,{}),(0,i.jsx)(Ba,{css:{flex:"1",overflowY:"auto"},direction:"column",children:(0,i.jsx)(KG,{eventId:e.eventId,nameOrEmail:r,organizationId:e.organizationId,select:e=>{n.change("usersInfosIds",ao(l.usersInfosIds,e))},usersInfosIds:l.usersInfosIds})}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsxs)(Ba,{align:"center",gap:"3",justify:"end",children:[(0,i.jsx)(Gm,{name:"sendVolunteerRegistrationEmail",children:t("envoyer_l_e_mai_35622")}),(0,i.jsx)(zl,{isLoading:d,onClick:s,children:t("ajouter_97327")}),(0,i.jsx)(zl,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]}),validate:s.validateForForm(n.adminAddSchema()),onSubmit:async t=>{await l({eventId:e.eventId,usersInfosIds:t.usersInfosIds,sendVolunteerRegistrationEmail:t.sendVolunteerRegistrationEmail}),e.reload(),e.onClose()}})},ZG=({reload:e})=>{const{params:{organizationId:t,eventId:n,segmentId:s},translate:o}=vl(),{user:r}=ai(),{canMemberCreate:a}=DS(),{canMemberCreate:l}=$S(),{segment:d,columns:c}=vy(),{mutate:u}=function(e={}){return ei("mutation VolunteersExport(\n $eventId: EventId!\n $segmentId: SegmentId!\n $format: ExportFormat!\n $includeFiles: Boolean!\n $columns: [String!]!\n) {\n jobId: volunteersExport(\n eventId: $eventId\n segmentId: $segmentId\n format: $format\n includeFiles: $includeFiles\n columns: $columns\n )\n}\n",e)}(),{data:h,isLoading:m}=Qn("query VolunteersHeader($eventId: EventId!, $segmentId: SegmentId!) {\n event(id: $eventId) {\n key\n\n segment(id: $segmentId) {\n links {\n usersListingLink\n }\n }\n }\n}\n",{eventId:n,segmentId:s},[]),[g,p]=(0,L.useState)(!1),[f,_]=(0,L.useState)(!1),[x,I]=(0,L.useState)(!1),{checkExport:v}=Ob();return(0,i.jsxs)(g$,{children:[l&&(0,i.jsx)(nE,{menu:(0,i.jsxs)(i.Fragment,{children:[a&&(0,i.jsx)(Kd,{icon:"user-group",onClick:e=>{Vd(e.target),p(!0)},children:o("ajouter_des_mem_06922")}),(0,i.jsx)(Kd,{icon:"file-import",to:Ps.EVENT_VOLUNTEERS_IMPORT(t,n),onClick:e=>Vd(e.target),children:o("importer_via_un_61623")})]}),path:QI.CREATE({organizationId:t,eventId:n}),children:o("ajouter_un_memb_33261")}),(0,i.jsxs)(Wd,{children:[(0,i.jsx)(Xd,{children:(0,i.jsx)(zl,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Zd,{placement:"bottom-end",children:[(0,i.jsxs)(Kb,{permissions:Hb.POSITION_EDIT,children:[(0,i.jsx)(Kd,{icon:"plug-circle-bolt",onClick:e=>{Vd(e.target),_(!0)},children:o("exporter_via_l_09843")}),(0,i.jsx)(Kd,{icon:"file-xls",onClick:e=>{Vd(e.target),I(!0)},children:o("exporter_en_exc_51862")})]}),(0,i.jsx)(Kd,{download:`${d.name}-users-listing`,icon:"arrow-down-to-bracket",to:_g(h.event?.segment.links.usersListingLink,"pdf",{lang:r?.language}),children:o("t_l_charger_en_59616")}),(0,i.jsx)(Kb,{rolesTypes:jI,children:(0,i.jsx)(Kd,{icon:"file-import",to:Ps.EVENT_FILES_IMPORT(t,n),children:o("importer_des_do_55420")})})]})]}),g&&(0,i.jsx)(YG,{eventId:n,organizationId:t,reload:e,onClose:()=>{p(!1)}}),!m&&(0,i.jsx)(vD,{isOpen:f,link:fg({organizationId:t,eventId:n,lang:r?.language,pathComponent:`volunteers/${s}`,key:h.event.key}),onClose:()=>{_(!1)}}),(0,i.jsx)(bD,{isOpen:x,requestExport:async(e,i)=>{const{jobId:s}=await u({eventId:n,segmentId:d.id,format:e,includeFiles:i,columns:c});v(s,t,n)},showIncludeFiles:!0,onClose:()=>{I(!1)}})]})},XG=(0,L.memo)(function(e){const t=Xn(),{hasPermission:n}=wb(),{limit:s,massActions:o,onMassEditSuccess:r,predicates:a,reloadKey:l,rendering:d,segment:c,setReloadKey:u}=vy(),h=n(Hb.SEGMENT_EDIT)&&d===Gh.List,m=n(Hb.MEMBER_EDIT)&&d===Gh.List||n(Hb.MEMBER_ACCREDIT)&&d===Gh.AccreditationsMatrix;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ZG,{reload:()=>{u(l+1)}}),(0,i.jsxs)(aj,{children:[(0,i.jsx)(m$,{searchRow:(0,i.jsx)(u$,{actions:(0,i.jsx)(PM,{massActions:o,predicates:a,showOnlyMassEdit:!1,totalNumberOfMembers:c.count,onMassEditSuccess:r}),searchPlaceholder:t("rechercher_un_m_05904"),showActions:n(Hb.MEMBER_EDIT),showEditColumns:h,showEditMode:m,showSearchColumns:n(Hb.SEGMENT_EDIT)}),selectSegment:(0,i.jsx)($$,{pageSelectedText:t("les_1_membres_00895",s),segmentSelectedText:t("les_1_membres_56748",c.count,c.name)})}),n(Hb.ACCREDITATION_READ)&&d===Gh.AccreditationsMatrix?(0,i.jsx)(RG,{}):d===Gh.Calendar?(0,i.jsx)(HG,{dayStartTime:e.event.dayStartTime,endAt:e.event.endAt,startAt:e.event.startAt}):d===Gh.Map?(0,i.jsx)(BG,{}):(0,i.jsx)(FG,{customFields:e.customFields})]})]})}),JG=e=>{const{history:t,translate:n,params:{organizationId:s,eventId:o,segmentId:r}}=vl(),{hasFeature:a}=TI(),{event:l,hasPermission:d,isEventReader:c,localEvent:u,updateLocalEvent:h}=wb(),m=Zn(Zh),g=(0,L.useMemo)(()=>m.getVolunteersFilters(s,o,r,e.organization.customFields.nodes,e.event,{hasAccreditations:l.useAccreditations&&a(Be.Accreditation),hasCampaigns:l.useCampaigns,hasDelegations:l.useDelegations&&a(Be.Delegation),hasForms:l.useForms,hasPositions:l.usePositions,isWeezeventConnected:e.event.isWeezeventConnected}),[o,r,e.organization,e.event]),p=(0,L.useMemo)(()=>m.getVolunteersPossibleColumns(s,e.organization.customFields.nodes,e.event.forms.nodes,{hasAccreditations:l.useAccreditations&&a(Be.Accreditation),hasCampaigns:l.useCampaigns,hasDelegations:l.useDelegations&&a(Be.Delegation),hasForms:l.useForms,hasPositions:l.usePositions,isWeezeventConnected:e.event.isWeezeventConnected}),[s,l,e.organization,e.event]);return(0,i.jsx)(l$,{canEditSegments:d(Hb.SEGMENT_EDIT),eventId:o,filters:g,filtersButtonText:n("filtrer_les_mem_47149"),filtersSubtitle:n("appliquer_des_f_48814"),getSegmentPath:e=>Ps.VOLUNTEERS_SEGMENT(s,o,e),initialLimit:u?.volunteersLimit??Rc,initialSegmentsOpen:u?.areVolunteersSegmentsOpen??!0,organizationId:s,possibleColumns:p,possibleRenderings:c?[Gh.List,Gh.Calendar,Gh.AccreditationsMatrix,Gh.Map]:[Gh.List,Gh.Calendar],reload:e.reload,segmentId:r,segmentType:jt.Volunteers,segmentsFolders:e.event.segmentsFolders,setLimit:e=>{h({volunteersLimit:e})},onSegmentClick:e=>{h({volunteersSegmentId:e})},onSegmentDelete:async()=>{await h({volunteersSegmentId:null}),t.replace(Ps.VOLUNTEERS(s,o))},onSegmentsToggle:async e=>{await h({areVolunteersSegmentsOpen:e})},children:(0,i.jsx)(XG,{customFields:e.organization.customFields.nodes,event:e.event})})},QG=(0,L.memo)(function(){const{params:{organizationId:e,eventId:t},translate:n}=vl(),{event:{name:s},localEvent:o}=wb();Md(`${s} ${n("membres_11310")}`);const{data:r,loader:a,reload:l}=nr({organizationId:e,eventId:t,privacy:Ie.All,loadForms:!0,loadSegments:!0}),d=(0,L.useMemo)(()=>(r.event?.segmentsFolders??[]).flatMap(e=>e.segments).map(e=>e.id),[r.event]);return a||(0,i.jsxs)(Sr.dO,{children:[(0,i.jsx)(Sr.qh,{path:Ps.VOLUNTEERS_SEGMENT(":organizationId",":eventId",":segmentId"),children:(0,i.jsx)(JG,{event:r.event,organization:r.organization,reload:l})}),(0,i.jsx)(Sr.qh,{children:(0,i.jsx)(oi,{path:Ps.VOLUNTEERS_SEGMENT(e,t,o?.volunteersSegmentId&&d.includes(o?.volunteersSegmentId)?o.volunteersSegmentId:d[0]),replace:!0})})]})}),eH=_r(Ba,{variants:{active:{true:{color:"$blue600"}}}}),tH=({children:e,path:t,text:n,eventId:s})=>{const o=ii(),r=null!==(0,Sr.B6)(o.pathname,{path:t}),a=ti(),l=ni();return(0,i.jsxs)(eH,{active:r,align:"center",direction:"column",onClick:()=>{!1===r&&l.push((0,Sr.tW)(t,{...a,eventId:a.eventId||s}))},children:[(0,i.jsx)(Ar,{children:e(r)}),(0,i.jsx)(Ar,{fontSize:"textXs",children:n})]})},nH=_r("i",{fontSize:"18px"}),iH=({active:e,className:t})=>(0,i.jsx)(nH,{className:`${e?"fa-solid":"fa-regular"} ${t}`}),sH=_r(Ba,{color:"$gray500",padding:"10px 0",boxShadow:"0px -2px 8px -2px rgba(16, 24, 40, 0.04), 0px -4px 12px -2px rgba(16, 24, 40, 0.05)"}),oH=({user:e,eventId:t})=>{const n=Xn();return(0,i.jsxs)(sH,{justify:"evenly",children:[(0,i.jsx)(tH,{eventId:t,path:Ps.DASHBOARD(":organizationId",":eventId"),text:n("accueil_70474"),children:e=>(0,i.jsx)(iH,{active:e,className:"fa-house"})}),(0,i.jsx)(tH,{eventId:t,path:Ps.VOLUNTEERS(":organizationId",":eventId"),text:n("membres_11310"),children:e=>(0,i.jsx)(iH,{active:e,className:"fa-user-group"})}),(0,i.jsx)(tH,{eventId:t,path:xs.POSITIONS({organizationId:":organizationId",eventId:":eventId"}),text:n("missions_63972"),children:e=>(0,i.jsx)(iH,{active:e,className:"fa-sitemap"})}),(0,i.jsx)(tH,{eventId:t,path:Ps.ORGANIZATION_PARAMETERS(":organizationId"),text:n("profil_14444"),children:()=>(0,i.jsx)(sp,{email:e.email,image:e.userInfo.picture?.url,name:e.userInfo.name,size:24})})]})},rH=({children:e,user:t,eventId:n})=>(0,i.jsxs)(Ba,{css:{height:"100%"},direction:"column",children:[(0,i.jsx)(Ar,{css:{flex:1,overflow:"auto"},children:e}),(0,i.jsx)(oH,{eventId:n,user:t})]}),aH=({header:e,value:t})=>(0,i.jsxs)(Ba,{css:{bd:!0,padding:"$5 $4"},direction:"column",gap:"2",children:[(0,i.jsx)(Ar,{color:"gray500",fontSize:"textSm",fontWeight:"medium",children:e}),(0,i.jsx)(Ar,{color:"gray900",fontSize:"displaySm",fontWeight:"semiBold",children:t})]}),lH=({position:e})=>{const{history:t,params:{organizationId:n,eventId:s},translate:o}=vl();return(0,i.jsx)(Mc,{css:{cursor:"pointer"},onClick:()=>{t.push(xs.POSITION({organizationId:n,eventId:s,positionId:e.id}))},children:(0,i.jsx)(Oc,{children:(0,i.jsxs)(Ba,{direction:"column",gap:"2",width:1,children:[(0,i.jsxs)(Ba,{gap:"3",children:[(0,i.jsx)(Ar,{color:"gray700",css:{flex:"1"},children:e.name}),(0,i.jsx)(Ar,{color:"gray700",children:o("_1_2_membres_04485",e.assignedResources,e.resources)})]}),(0,i.jsx)(Ar,{width:1,children:(0,i.jsx)(Ow,{percent:e.assignedResources/e.resources})})]})})},e.id)},dH=_r("h1",{fontSize:"$displaySm",fontWeight:"$semiBold",margin:0}),cH=_r(nl,{color:"$gray800",fontSize:"$textLg",padding:"$2"}),uH=_r("h2",{fontSize:"$textMd",fontWeight:"$semiBold",margin:0}),hH=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:s}}=vl(),o=Zn(rp),{isEventAdmin:r,hasPermission:a}=wb(),{data:l,loader:d}=Qn("query DashboardMobile($eventId: EventId!) {\n event(id: $eventId) {\n assignedResources\n name\n resources\n volunteerMinutesAssigned\n volunteerMinutesNeeded\n\n positions {\n nodes {\n id\n name\n resources\n assignedResources\n }\n totalCount\n }\n\n waitingAssignment: volunteersRegistrations(states: [WaitingAssignment], limit: 1) {\n totalCount\n }\n\n assigned: volunteersRegistrations(states: [Assigned], limit: 1) {\n totalCount\n }\n\n positionsCategories {\n id\n name\n resources\n assignedResources\n }\n }\n}\n",{eventId:s},[]),c=(0,L.useMemo)(()=>l.event?(0,uc.A)(l.event.positionsCategories,e=>e.name.toLowerCase()):[],[l.event]),u=()=>{e.push(Ps.DASHBOARD_EVENT_SWITCH(n,s))};if(d)return d;{const e=r||c.some(e=>a(Hb.POSITION_READ,{positionCategoryId:e.id}));return(0,i.jsxs)(Ba,{css:{flex:1,minHeight:"100%",padding:"$6 $3"},direction:"column",gap:"6",children:[(0,i.jsxs)(Ba,{align:"center",gap:"4",justify:"between",children:[(0,i.jsx)(dH,{children:t("accueil_70474")}),(0,i.jsx)(cH,{icon:"arrow-down-arrow-up",onClick:u})]}),(0,i.jsxs)(Ba,{direction:"column",gap:"4",children:[(0,i.jsx)(uH,{children:l.event.name}),(0,i.jsx)(aH,{header:t("nombre_de_membr_60320",l.event.resources),value:l.event.resources}),(0,i.jsx)(aH,{header:t("nombre_de_missi_67304",l.event.positions.totalCount),value:l.event.positions.totalCount}),(0,i.jsx)(aH,{header:t("nombre_de_membr_87779",l.event.assigned.totalCount),value:l.event.assigned.totalCount}),(0,i.jsx)(aH,{header:t("nombre_de_membr_63555",l.event.waitingAssignment.totalCount),value:l.event.waitingAssignment.totalCount}),(0,i.jsx)(aH,{header:t("taux_de_remplis_11913"),value:`${0===l.event.resources?"0":Math.round(l.event.assignedResources/l.event.resources*100)}%`}),(0,i.jsx)(aH,{header:t("temps_de_b_n_vo_87924"),value:o.minutesToHoursMinutesString(l.event.volunteerMinutesNeeded)}),(0,i.jsx)(aH,{header:t("temps_de_b_n_vo_60725"),value:o.minutesToHoursMinutesString(l.event.volunteerMinutesAssigned)}),(0,i.jsx)(Ar,{css:{boxShadow:"$xs"},children:e?(0,i.jsx)(Lc,{filters:(0,i.jsx)(i.Fragment,{}),headerCells:(0,i.jsx)(Gc,{children:t("cat_gories_24533")}),numberOfPages:0,offset:0,rows:(0,i.jsx)(i.Fragment,{children:c.length>0?c.map(e=>(0,i.jsx)(dL,{category:e,clickable:!1,eventId:s,organizationId:n},e.id)):(0,i.jsx)(Sk,{subtitle:t("vous_n_avez_pas_59681"),title:t("aucune_cat_gori_21347")})}),setOffset:td.A,title:t("liste_des_membr_59735"),totalCount:0}):(0,i.jsx)(Lc,{filters:(0,i.jsx)(i.Fragment,{}),headerCells:(0,i.jsx)(Gc,{children:t("missions_63972")}),numberOfPages:0,offset:0,rows:(0,i.jsx)(i.Fragment,{children:l.event.positions.nodes.map(e=>(0,i.jsx)(lH,{position:e},e.id))}),setOffset:td.A,title:t("liste_des_membr_57353"),totalCount:0})})]})]})}},mH=_r("div",{alignSelf:"flex-end",cursor:"pointer",padding:"$4 $6 $3 $6",i:{color:"$gray500"}}),gH=({onClose:e})=>(0,i.jsx)(mH,{onClick:e,children:(0,i.jsx)("i",{className:"fa-regular fa-xmark"})}),pH=_r(Ba,{overflowX:"hidden",overflowY:"auto"}),fH=_r(Ba,{background:"rgba(0, 0, 0, 0.7)",position:"absolute",left:"0",right:"0",top:"0",bottom:"0"}),_H=_r(Ba,{background:"white",borderRadius:"20px 20px 0 0",marginTop:"44px",flex:"1",overflow:"auto"}),xH=({children:e,onClose:t})=>{const n=(0,Sr.W6)(),s=t??n.goBack;return Ld(s),(0,i.jsx)(fH,{"data-testid":"overlay-backdrop",direction:"column",onClick:s,children:(0,i.jsxs)(_H,{"data-testid":"overlay-body",direction:"column",onClick:e=>e.stopPropagation(),children:[(0,i.jsx)(gH,{onClose:s}),(0,i.jsx)(pH,{direction:"column",children:e})]})})},IH=({event:e})=>{const t=Zn(Jc);return(0,i.jsx)(Ar,{children:(0,i.jsxs)(Ba,{align:"center",css:{color:"$gray500"},children:[(0,i.jsx)(Ar,{width:25,children:(0,i.jsx)(nl,{icon:"calendar"})}),(0,i.jsx)(Ar,{css:{flex:"1",ellipsis:!0},children:Wx(t,e.startAt,e.endAt)})]})})},vH=({event:e})=>{const t=Xn();return(0,i.jsxs)(Ba,{align:"start",direction:"column",gap:"2",children:[(0,i.jsx)(rc,{color:e.state===Me.Ongoing?"success":"error",children:t(e.state)}),(0,i.jsx)(Ar,{color:"gray800",fontSize:"textLg",fontWeight:"medium",width:1,children:e.name}),(0,i.jsx)(IH,{event:e})]})},bH=({events:e})=>{const{organizationId:t,eventId:n}=ti(),[s,o]=(0,L.useState)(n),r=ni(),a=Xn();return(0,i.jsxs)(Ba,{css:{margin:"0 $4 $7 $4"},direction:"column",children:[(0,i.jsx)(Ba,{direction:"column",gap:"4",children:e.map(e=>(0,i.jsx)(JR,{state:e.id===s?"checked":"unchecked",onClick:()=>o(e.id),children:(0,i.jsx)(vH,{event:e})},e.id))}),(0,i.jsx)(Ya,{height:7}),(0,i.jsx)(zl,{onClick:()=>{r.push(Ps.DASHBOARD(t,s))},children:a("s_lectionner_l_77300")})]})},jH=_r("h3",{color:"$gray800",fontWeight:"$bold",margin:"$3 $4"}),CH=()=>{const{organizationId:e,eventId:t}=ti(),{loader:n,data:s}=ra({organizationId:e,includeCreatedBy:!1,includeNumberOfMembers:!1}),o=ni(),r=Xn();return(0,i.jsxs)(xH,{onClose:()=>{o.push(Ps.DASHBOARD(e,t))},children:[(0,i.jsx)(jH,{children:r("liste_de_vos_v_44993")}),n||(0,i.jsx)(bH,{events:s.data.rows.nodes})]})},yH=_r("div",{display:"flex",flex:1,flexDirection:"column",margin:"0 $3"}),kH=_r(Ba,{margin:"0 $3",padding:"$3 $4"}),AH=({back:e,children:t})=>(0,i.jsxs)(Ba,{align:"center",css:{padding:"10px 0",borderBottom:"1px solid $gray100"},children:[(0,i.jsx)(kH,{color:"gray700",onClick:e,children:(0,i.jsx)(nl,{icon:"chevron-left"})}),t]}),wH=_r("div",{display:"flex",flexDirection:"column",height:"100%",overflow:"auto"}),SH=_r("i",{fontSize:"$textXl"}),EH=({replaySearch:e})=>{const{eventId:t}=ti(),{data:n,loader:s}=Qn("query RecentPositionsSearchesMobile($eventId: EventId!) {\n event(id: $eventId) {\n recentPositionsRegistrationsSearches\n }\n}\n",{eventId:t},[]),o=Xn();if(s)return s;{const t=n.event.recentPositionsRegistrationsSearches;return(0,i.jsxs)(Ba,{css:{padding:"$6 0"},direction:"column",gap:"6",children:[(0,i.jsx)(Ar,{fontSize:"textMd",fontWeight:"semiBold",children:o("recherches_r_ce_82891",t.length)}),t.map((t,n)=>(0,i.jsxs)(Ba,{align:"center",gap:"2",onClick:()=>{e(t)},children:[(0,i.jsx)(SH,{className:"fa-regular fa-clock"}),(0,i.jsx)(Ar,{children:t})]},n))]})}},TH=e=>{const t=Xn(),n=m(e.content?.[0])?t(e.content[0]):t("ooops_on_a_un_p_56888"),s=((e,t)=>"accreditation_limit_reached"===t?.[0]?e("_ditez_l_accr_d_66820"):"delegation_limit_reached"===t?.[0]?e("_diter_la_d_l_g_14763"):"can_not_delete_paired"===t?.[0]?e("ce_membre_est_d_53903"):so(t)?t:[e("une_erreur_est_92333")])(t,e.content);return(0,i.jsx)(Lb,{isOpen:!0,onClose:e.onClose,children:(0,i.jsxs)(Nb,{children:[(0,i.jsx)(Mb,{icon:"triangle-exclamation",iconColor:"$error700",children:n}),(0,i.jsx)(Fb,{css:{color:"$gray500"},hideBorder:!0,children:e.content?s:e.children}),(0,i.jsx)(Pb,{hideBorder:!0,hideCancelButton:!0,children:(0,i.jsx)(zl,{color:"error",onClick:e.onClose,children:t("fermer_62479")})})]})})},zH=L.createContext({}),OH=e=>{const[t,n]=L.useState(!1),[s,o]=L.useState([]),r=L.useCallback((e,t)=>{n(e),o((t||[]).flatMap(e=>e.isHeaventError?e.message.split("\n"):e.message?.startsWith("db::")?[e.message.substring(4).split(" ")[0]]:[]))},[n,o]),a=L.useCallback(()=>{n(!1),o([])},[n,o]);return(0,i.jsxs)(zH.Provider,{value:{isError:t,setIsError:r},children:[e.children,t&&(0,i.jsx)(TH,{content:s,onClose:a})]})},RH=(e,t)=>{switch(t.type){case"FIRST_PAGE_INIT":return{...e,isLoading:!0,data:void 0,xs:void 0};case"LOAD_MORE_INIT":return{...e,isLoading:!0};case"FIRST_PAGE_SUCCESS":case"LOAD_MORE_SUCCESS":return{...e,isLoading:!1,data:t.data,xs:t.xs,offset:t.offset}}};function $H(e,t,n){const[s,o]=(0,L.useReducer)(RH,{isLoading:!0,data:void 0,xs:void 0,offset:t.offset}),{setIsError:r}=(0,L.useContext)(zH);(0,L.useEffect)(()=>{let i=!1;return o({type:"FIRST_PAGE_INIT"}),Y().then(n=>e(t,n||null)).then(e=>{!1===i&&o({type:"FIRST_PAGE_SUCCESS",data:e,xs:n(e),offset:t.offset})},()=>{!1===i&&r(!0)}),()=>{i=!0}},[e,JSON.stringify(t),n]);const a=()=>{o({type:"LOAD_MORE_INIT"});const i=s.offset+t.limit;Y().then(n=>e({...t,offset:i},n||null)).then(e=>{const t=[...s.xs||[]];t.splice(i,0,...n(e)),o({type:"LOAD_MORE_SUCCESS",data:e,xs:t,offset:i})},()=>{r(!0)})};return(e=>e.isLoading&&void 0===e.data)(s)?{data:s.data,loader:(0,i.jsx)(wl,{}),loadMore:a,xs:s.xs}:{data:s.data,loader:s.isLoading?(0,i.jsx)(wl,{}):void 0,loadMore:a,xs:s.xs}}const DH=_r(Ar,{display:"flex",flexDirection:"column",[`${zl} + .load-more-status`]:{paddingTop:"12px"}}),PH=({loadMore:e,pageInfo:t,isLoading:n,buttonText:s,statusText:o})=>!1===t.hasNextPage&&!1===t.hasPreviousPage?null:(0,i.jsxs)(DH,{children:[t.hasNextPage&&(0,i.jsx)(zl,{isLoading:n,textAlign:"center",onClick:e,children:s}),(0,i.jsx)(Ar,{className:"load-more-status",fontSize:"textSm",textAlign:"center",children:o})]});var FH=n(2872);const MH=_r(Ba,{bd:!0,padding:"$4 $3"}),NH=({children:e,...t})=>(0,i.jsxs)(MH,{align:"center",...t,children:[(0,i.jsx)(Ar,{css:{flex:1},children:e}),(0,i.jsx)(Ar,{color:"gray700",css:{padding:"0 10px 0 $4"},children:(0,i.jsx)(nl,{icon:"chevron-right"})})]}),LH=({open:e,position:t})=>{const n=Xn(),s=Zn(ph);return(0,i.jsxs)(NH,{onClick:()=>{e(t.id)},children:[(0,i.jsxs)(Ba,{gap:"2",children:[t.assignedResources>=t.resources?(0,i.jsx)(rc,{color:"success",children:n("complet_51600")}):(0,i.jsx)(rc,{color:"warning",children:n("incomplet_45915")}),!t.isVisible&&(0,i.jsx)(rc,{color:"gray",children:n("Private")})]}),(0,i.jsx)(Ar,{color:"gray800",css:{marginTop:"$2"},fontWeight:"semiBold",children:t.name}),(0,i.jsx)(Ar,{color:"gray500",css:{marginTop:"$1"},fontSize:"textSm",children:`${n("creneau",t.slots.length)} · ${t.range?s.toLocaleString(t.range,void 0,{year:"numeric",month:"long",day:"numeric"}):"-"}`}),(0,i.jsx)(Ar,{css:{marginTop:"$3"},children:(0,i.jsx)(Ow,{percent:t.assignedResources/t.resources})})]})},BH=_r("div",{color:"$gray800",fontWeight:"$semiBold",lineHeight:"24px"}),VH=_r("div",{color:"$gray400",fontSize:"$textSm"}),UH=_r("span",{color:"$gray800"}),WH=({category:e})=>{const t=Xn();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(BH,{children:e.name}),so(e.leaders)&&(0,i.jsxs)(VH,{children:[`${t("responsable_category",e.leaders.length)} `,(0,i.jsx)(UH,{children:e.leaders.map(({userInfo:e})=>e.name).join(", ")})]})]})},GH=({open:e,positions:t})=>{const n=(0,L.useMemo)(()=>(0,uc.A)((0,FH.A)((0,cc.A)(t,e=>e.category.id)),e=>e[0].category.name),[t]);return(0,i.jsx)(i.Fragment,{children:n.map((t,n)=>(0,i.jsxs)(Ba,{direction:"column",gap:"3",children:[(0,i.jsx)(WH,{category:t[0].category}),t.map((t,n)=>(0,i.jsx)(LH,{open:e,position:t},n))]},n))})},HH=()=>{const e=Xn();return(0,i.jsx)(Gk,{css:{flex:1,padding:"0 $4"},title:e("d_sol_il_n_y_46236")})},qH=e=>e.event.positions.nodes,KH=({search:e})=>{const t=Xn(),{organizationId:n,eventId:s}=ti(),o={eventId:s,predicates:[],limit:Rc,offset:0,name:e},{data:r,loader:a,loadMore:l,xs:d}=$H(va,o,qH),c=ni();return a&&void 0===r?a:0===d.length?(0,i.jsx)(HH,{}):(0,i.jsxs)(Ba,{css:{padding:"$6 0"},direction:"column",gap:"6",children:[(0,i.jsx)(Ar,{fontSize:"textMd",fontWeight:"semiBold",children:t("r_sultat_de_la_64686",d.length)}),(0,i.jsx)(GH,{open:t=>{c.push(Ps.POSITION_SETTINGS(n,s,t),{from:"SEARCH_MOBILE",search:e})},positions:d}),(0,i.jsx)(PH,{buttonText:t("afficher_plus_d_49529"),isLoading:void 0!==a,loadMore:l,pageInfo:r.event.positions.pageInfo,statusText:t("_1_sur_2_mis_94157",d.length,r.event.positions.totalCount)})]})},YH=_r(Ba,{color:"$blue600"}),ZH=()=>{const{organizationId:e,eventId:t}=ti(),n=ni(),s=Xn(),o=ii(),[r,a]=(0,L.useState)(o.state?.search||""),[l,d]=(0,L.useState)(o.state?.search||"");return(0,i.jsxs)(wH,{children:[(0,i.jsx)(AH,{back:()=>{n.push(xs.POSITIONS({organizationId:e,eventId:t}))},children:(0,i.jsxs)(Ba,{align:"center",css:{marginRight:"$4",flexGrow:1},gap:"3",children:[(0,i.jsx)(Bl,{icon:"search",placeholder:s("rechercher_une_69998"),value:r,onChange:e=>{a(e),e||d(e)},onKeyDown:e=>{"Enter"===e.key&&d(r)}}),l&&(0,i.jsx)(YH,{onClick:()=>{a(""),d("")},children:s("annuler_48254")})]})}),(0,i.jsx)(yH,{children:l?(0,i.jsx)(KH,{search:l}):(0,i.jsx)(EH,{replaySearch:e=>{a(e),d(e)}})})]})},XH=({folders:e,segmentId:t,...n})=>(0,i.jsx)($u,{shouldParseAsInt:!0,value:t,...n,children:e.map((e,t)=>(0,i.jsx)("optgroup",{label:e.name,children:e.segments.map((e,t)=>(0,i.jsxs)("option",{value:e.id,children:[e.name," (",e.count,")"]},t))},t))});var JH=n(473);const QH=()=>{const e=Xn();return(0,i.jsx)(Gk,{css:{flex:1,padding:"0 $4"},subtitle:e("cr_ez_de_nouvel_87003"),title:e("il_n_y_a_pas_de_55837")})},eq=e=>e.event.positions.nodes,tq=({segment:e})=>{const t=Xn(),{organizationId:n,eventId:s}=ti(),o={eventId:s,predicates:e.predicates,limit:Rc,offset:0},{data:r,loader:a,loadMore:l,xs:d}=$H(va,o,eq),c=ni();return a&&void 0===r?a:0===d.length?(0,i.jsx)(QH,{}):(0,i.jsxs)(Ba,{direction:"column",gap:"7",children:[(0,i.jsx)(GH,{open:e=>{c.push(Ps.POSITION_SETTINGS(n,s,e))},positions:d}),(0,i.jsx)(PH,{buttonText:t("afficher_plus_d_49529"),isLoading:void 0!==a,loadMore:l,pageInfo:r.event.positions.pageInfo,statusText:t("_1_sur_2_mis_94157",d.length,r.event.positions.totalCount)})]})},nq=_r("h1",{fontSize:"$displaySm",fontWeight:"$semiBold",margin:0}),iq=_r(nl,{color:"$gray800",fontSize:"$textLg",padding:"$2"}),sq=({event:e})=>{const{organizationId:t,eventId:n,segmentId:s}=ti(),o=ni(),r=Xn(),a=(0,JH.A)(e.segmentsFolders.flatMap(e=>e.segments),{id:s});return(0,i.jsxs)(Ba,{css:{flex:1,minHeight:"100%",padding:"$6 $3"},direction:"column",gap:"6",children:[(0,i.jsxs)(Ba,{align:"center",gap:"4",justify:"between",children:[(0,i.jsx)(nq,{children:r("missions_63972")}),(0,i.jsx)(iq,{icon:"search",onClick:()=>{o.push(Ps.POSITIONS_SEARCH(t,n))}})]}),(0,i.jsx)(Ar,{children:(0,i.jsx)(XH,{folders:e.segmentsFolders,segmentId:s,onChange:e=>o.push(Ps.POSITIONS_SEGMENT(t,n,e))})}),(0,i.jsx)(Ba,{css:{flex:1},direction:"column",children:(0,i.jsx)(tq,{segment:a})})]})},oq=()=>{const{organizationId:e,eventId:t}=ti(),{data:n,loader:s}=Qn("query PositionsSegmentsMobile($eventId: EventId!) {\n event(id: $eventId) {\n segmentsFolders(segmentType: Positions) {\n ...SegmentsFoldersSegments\n }\n }\n}\n",{eventId:t},[Vs.SegmentsFoldersSegmentsFragment]);return s||(0,i.jsxs)(Sr.dO,{children:[(0,i.jsx)(Sr.qh,{path:Ps.POSITIONS_SEARCH(":organizationId",":eventId"),children:(0,i.jsx)(ZH,{})}),(0,i.jsx)(Sr.qh,{path:Ps.POSITIONS_SEGMENT(":organizationId",":eventId",":segmentId"),children:(0,i.jsx)(sq,{event:n.event})}),(0,i.jsx)(Sr.qh,{children:(0,i.jsx)(oi,{path:Ps.POSITIONS_SEGMENT(e,t,n.event.segmentsFolders[0].segments[0].id)})})]})},rq=_r(Ba,{backgroundColor:"$gray100",borderRadius:"$1",padding:"2px"}),aq=({children:e,...t})=>(0,i.jsx)(rq,{...t,children:e}),lq=_r(Ba,{color:"$gray400",flex:1,fontSize:"$textSm",fontWeight:"$medium",padding:"6px 8px",variants:{isSelected:{true:{backgroundColor:"white",border:"0.5px solid $gray200",borderRadius:"$1",color:"$gray800",fontWeight:"$semiBold"}}}}),dq=({children:e,path:t})=>{const n=ni(),s=ii().pathname===t;return(0,i.jsx)(lq,{isSelected:s,justify:"center",onClick:()=>{n.push(t)},children:e})},cq=({children:e,css:t,...n})=>(0,i.jsx)(Ba,{align:"center",css:{flex:1,marginRight:"66px",...t},direction:"column",...n,children:e}),uq=({back:e,position:t})=>(0,i.jsx)(AH,{back:e,children:(0,i.jsxs)(cq,{css:{minHeight:"40px"},children:[(0,i.jsx)(Ar,{color:"gray900",fontWeight:"medium",textAlign:"center",children:t.name}),(0,i.jsx)(Ar,{color:"gray500",fontSize:"textXs",textAlign:"center",children:t.positionCategoryName})]})}),hq=({customFields:e,position:t})=>{const n=Xn(),{roles:s}=TI();return(0,i.jsxs)(Ba,{css:{marginBottom:"$7"},direction:"column",gap:"7",children:[(0,i.jsx)(QW,{category:t,title:n("remplissage_des_84383")}),(0,i.jsx)(_S,{leaders:t.leaders,roles:s.positionRoles}),(0,i.jsx)(nG,{customFields:e,position:t}),(0,i.jsx)(Mw,{description:t.description}),(0,i.jsx)(aM,{location:t}),(0,i.jsx)(oM,{customFields:t.customFields}),(0,i.jsx)(Uw,{modalSubtitle:n("ajouter_des_tag_64526"),tags:t.tags}),(0,i.jsx)(Nw,{privateNote:t.privateNote})]})},mq=(e,t)=>e.name||t.toLocaleString(e.range,void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric"}),gq=({open:e,slot:t})=>{const n=Xn(),s=Zn(ph);return(0,i.jsxs)(NH,{onClick:()=>{e(t.id)},children:[(0,i.jsx)(Ba,{gap:"2",children:t.assignedResources>=t.resources?(0,i.jsx)(rc,{color:"success",children:n("complet_51600")}):(0,i.jsx)(rc,{color:"warning",children:n("_1_membre_manq_31014",t.resources-t.assignedResources)})}),(0,i.jsx)(Ar,{color:"gray800",css:{marginTop:"$2"},fontWeight:"semiBold",children:t.name}),(0,i.jsx)(Ar,{color:"gray500",css:{marginTop:"$1"},fontSize:"textSm",children:mq(t,s)}),(0,i.jsx)(Ar,{css:{marginTop:"$3"},children:(0,i.jsx)(Ow,{percent:t.assignedResources/t.resources})})]})},pq=({open:e,slots:t})=>{const n=Xn();return(0,i.jsxs)(Ba,{direction:"column",gap:"3",children:[(0,i.jsx)(Ar,{color:"gray900",fontSize:"textLg",fontWeight:"semiBold",children:n("liste_des_cr_ne_94056")}),t.map((t,n)=>(0,i.jsx)(gq,{open:e,slot:t},n))]})},fq=e=>e.event.positionsSlots.nodes,_q=({open:e,eventId:t,positionId:n})=>{const s={eventId:t,positionId:n,limit:Rc,offset:0},{data:o,loader:r,loadMore:a,xs:l}=$H(ja,s,fq);return r&&void 0===o?r:(0,i.jsxs)(Ba,{css:{marginBottom:"$7"},direction:"column",gap:"7",children:[(0,i.jsx)(pq,{open:e,slots:l}),(0,i.jsx)(PH,{buttonText:"Afficher plus de créneaux",isLoading:void 0!==r,loadMore:a,pageInfo:o.event.positionsSlots.pageInfo,statusText:`${l.length} sur ${o.event.positionsSlots.totalCount} créneaux`})]})},xq=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:s,positionId:o}}=vl(),{data:r,loader:a}=Ca({organizationId:n,eventId:s,positionId:o}),l=ii(),[d]=(0,L.useState)(l.state);if(l.pathname===xs.POSITION({organizationId:n,eventId:s,positionId:o}))return(0,i.jsx)(oi,{path:Ps.POSITION_SETTINGS(n,s,o)});const c={settings:Ps.POSITION_SETTINGS(n,s,o),slots:xs.POSITION_SLOTS({organizationId:n,eventId:s,positionId:o})};return a||(0,i.jsxs)(wH,{children:[(0,i.jsx)(uq,{back:()=>{"SEARCH_MOBILE"===d?.from?e.push(Ps.POSITIONS_SEARCH(n,s),{search:d?.search}):e.push(xs.POSITIONS({organizationId:n,eventId:s}))},position:r.event.position}),(0,i.jsx)(yH,{children:(0,i.jsxs)(mj,{children:[(0,i.jsxs)(aq,{css:{margin:"$6 0"},children:[(0,i.jsx)(dq,{path:c.settings,children:t("param_tres_78420")}),(0,i.jsx)(dq,{path:c.slots,children:t("cr_neaux_33401")})]}),(0,i.jsx)(hj,{path:c.settings,children:(0,i.jsx)(hq,{customFields:r.organization.customFields.nodes,position:r.event.position})}),(0,i.jsx)(hj,{path:c.slots,children:(0,i.jsx)(_q,{eventId:s,open:t=>{e.push(Ps.POSITION_SLOT_MEMBERS(n,s,o,t))},positionId:r.event.position.id})})]})})]})},Iq=()=>{const{organizationId:e,eventId:t,positionId:n,positionSlotId:s}=ti(),o=ni(),r=Xn();return(0,i.jsx)(xH,{onClose:()=>{o.push(Ps.POSITION_SLOT_MEMBERS(e,t,n,s))},children:(0,i.jsxs)(Ba,{css:{margin:"$3"},direction:"column",gap:"3",children:[(0,i.jsx)(zl,{onClick:()=>{o.push(Ps.POSITION_SLOT_CHECK_MEMBERS_CHECK_IN(e,t,n,s))},children:r("pointer_des_mem_09244")}),(0,i.jsx)(zl,{onClick:()=>{o.push(Ps.POSITION_SLOT_CHECK_MEMBERS_CHECK_OUT(e,t,n,s))},children:r("d_pointer_des_m_31557")}),(0,i.jsx)(zl,{onClick:()=>{o.push(Ps.POSITION_SLOT_CHECK_MEMBERS_RESET(e,t,n,s))},children:r("remettre_z_ro_65589")})]})})},vq=_r(Ba,{fontSize:"$textSm",color:"$blue600"}),bq=({onSubmit:e,children:t,data:n,loader:s,loadMore:o,xs:r,disabled:a})=>{const l=Xn(),[d,c]=(0,L.useState)(r);(0,L.useEffect)(()=>{c(r.toSpliced(0,d.length,...d))},[r]);const u=d.filter(e=>"checked"===e.state&&!a.includes(e.positionSlotUserInfo.id)).map(e=>e.positionSlotUserInfo.id);return(0,i.jsxs)(Ba,{direction:"column",height:"100%",width:"100%",children:[(0,i.jsxs)(Ba,{css:{flex:1,overflow:"auto",padding:"$6 $4 $3 $4"},direction:"column",gap:"5",children:[(0,i.jsxs)(Ba,{justify:"between",children:[(0,i.jsx)(Ar,{fontSize:"textMd",fontWeight:"semiBold",children:l("liste_des_membr_86405",r.length)}),(0,i.jsx)(vq,{onClick:()=>{c(d.map(e=>({...e,state:"checked"})))},children:l("tout_s_l_ctionn_18234")})]}),(0,i.jsxs)(Ba,{direction:"column",gap:"3",children:[d.map((e,t)=>(0,i.jsx)(_c,{disabled:a.includes(e.positionSlotUserInfo.id),state:e.state,onClick:e=>((e,t)=>{c(d.toSpliced(e,1,{...d[e],state:t}))})(t,e),children:e.userInfo.name},t)),(0,i.jsx)(PH,{buttonText:l("afficher_plus_d_41906"),isLoading:void 0!==s,loadMore:o,pageInfo:n.event.volunteersRegistrations.pageInfo,statusText:l("_1_sur_2_mem_14323",r.length,n.event.volunteersRegistrations.totalCount)})]})]}),(0,i.jsx)(Ba,{css:{boxShadow:"$mdReverse",padding:"$6 $4"},direction:"column",children:(0,L.isValidElement)(t)?(0,L.cloneElement)(t,{onClick:()=>e(u),disabled:0===u.length}):t})]})},jq=e=>e.event.volunteersRegistrations.nodes,Cq=()=>{const{eventId:e,positionSlotId:t}=ti(),n=Xn(),s={eventId:e,positionSlotId:t,predicates:[{operator:gt.IsNot,value:[pe.CheckedIn],value2:[t],slug:"checkInStatePositionSlot"}],limit:50,offset:0},{data:o,loader:r,loadMore:a,xs:l}=$H(ba,s,jq),{isLoading:d,mutate:c}=Bo(),[u,h]=(0,L.useState)([]);if(r&&void 0===o)return r;{const t=async t=>{await c({eventId:e,checkIn:{strategy:fe.CheckIn,positionsSlotsUsersInfosIds:t}}),h([...u,...t])};return(0,i.jsx)(bq,{data:o,disabled:u,loadMore:a,loader:r,xs:l,onSubmit:t,children:(0,i.jsx)(zl,{isLoading:d,textAlign:"center",children:n("pointer_80927")})})}},yq=()=>{const{organizationId:e,eventId:t,positionId:n,positionSlotId:s}=ti(),o=ni(),r=Xn();return(0,i.jsxs)(wH,{children:[(0,i.jsx)(AH,{back:()=>{o.push(Ps.POSITION_SLOT_MEMBERS(e,t,n,s))},children:(0,i.jsx)(cq,{children:r("pointer_des_mem_09244")})}),(0,i.jsx)(yH,{css:{margin:"0",overflow:"auto"},children:(0,i.jsx)(Cq,{})})]})},kq=e=>e.event.volunteersRegistrations.nodes,Aq=()=>{const{eventId:e,positionSlotId:t}=ti(),n=Xn(),s={eventId:e,positionSlotId:t,predicates:[{operator:gt.IsNot,value:[pe.CheckedOut],value2:[t],slug:"checkInStatePositionSlot"}],limit:50,offset:0},{data:o,loader:r,loadMore:a,xs:l}=$H(ba,s,kq),{isLoading:d,mutate:c}=Bo(),[u,h]=(0,L.useState)([]);if(r&&void 0===o)return r;{const t=async t=>{await c({eventId:e,checkIn:{strategy:fe.CheckOut,positionsSlotsUsersInfosIds:t}}),h([...u,...t])};return(0,i.jsx)(bq,{data:o,disabled:u,loadMore:a,loader:r,xs:l,onSubmit:t,children:(0,i.jsx)(zl,{isLoading:d,textAlign:"center",children:n("d_pointer_25328")})})}},wq=()=>{const{organizationId:e,eventId:t,positionId:n,positionSlotId:s}=ti(),o=ni(),r=Xn();return(0,i.jsxs)(wH,{children:[(0,i.jsx)(AH,{back:()=>{o.push(Ps.POSITION_SLOT_MEMBERS(e,t,n,s))},children:(0,i.jsx)(cq,{children:r("d_pointer_des_m_31557")})}),(0,i.jsx)(yH,{css:{margin:"0",overflow:"auto"},children:(0,i.jsx)(Aq,{})})]})},Sq=e=>e.event.volunteersRegistrations.nodes,Eq=()=>{const{eventId:e,positionSlotId:t}=ti(),n=Xn(),s={eventId:e,positionSlotId:t,predicates:[{operator:gt.IsNot,value:[pe.Waiting],value2:[t],slug:"checkInStatePositionSlot"}],limit:50,offset:0},{data:o,loader:r,loadMore:a,xs:l}=$H(ba,s,Sq),{isLoading:d,mutate:c}=Bo(),[u,h]=(0,L.useState)([]);if(r&&void 0===o)return r;{const t=async t=>{await c({eventId:e,checkIn:{strategy:fe.Reset,positionsSlotsUsersInfosIds:t}}),h([...u,...t])};return(0,i.jsx)(bq,{data:o,disabled:u,loadMore:a,loader:r,xs:l,onSubmit:t,children:(0,i.jsx)(zl,{isLoading:d,textAlign:"center",children:n("remettre_z_ro_82376")})})}},Tq=()=>{const{organizationId:e,eventId:t,positionId:n,positionSlotId:s}=ti(),o=ni(),r=Xn();return(0,i.jsxs)(wH,{children:[(0,i.jsx)(AH,{back:()=>{o.push(Ps.POSITION_SLOT_MEMBERS(e,t,n,s))},children:(0,i.jsx)(cq,{children:r("remettre_z_ro_11572")})}),(0,i.jsx)(yH,{css:{margin:"0",overflow:"auto"},children:(0,i.jsx)(Eq,{})})]})},zq=e=>{let t,n,s;return"registrationState"in e?(({color:t,leftIcon:s}=Cj(e.registrationState)),n=`${t}100`):(t=function(e){switch(e){case pe.CheckedIn:case pe.CheckedOut:return"success";case pe.Waiting:return"warning"}}(e.checkInState),n=`${t}500`),(0,i.jsx)(Ba,{align:"center",css:{background:xr.colors[n].value,border:"2px solid white",borderRadius:`${e.size}px`,bottom:"0",color:xr.colors[`${t}700`].value,fontSize:`${Math.round(.45*e.size)}px`,right:"0",position:"absolute"},height:e.size,justify:"center",width:e.size,children:s&&(0,i.jsx)(nl,{icon:s})})},Oq=e=>{switch(e){case 16:return 8;case 24:return 10;case 32:return 12;case 40:return 14;case 48:return 16;case 56:return 18;case 64:return 20;case 88:return 22;case 96:return 24;case 110:return 30;case 160:return 40;case 310:return 80}},Rq=_r("div",{position:"relative"}),$q=e=>{let t,n;if("registrationState"in e){t={registrationState:e.registrationState,size:Oq(e.size)};const{registrationState:i,...s}=e;n=s}else{t={checkInState:e.checkInState,size:Oq(e.size)};const{checkInState:i,...s}=e;n=s}return(0,i.jsxs)(Rq,{children:[(0,i.jsx)(sp,{...n}),(0,i.jsx)(zq,{...t})]})},Dq=_r(Ba,{overflow:"hidden"}),Pq=_r("div",{color:"$gray500",fontSize:"$textSm",ellipsis:"",variants:{size:{40:{"&:first-child":{color:"$gray800",fontSize:"$textMd",fontWeight:"$medium"}},64:{"&:first-child":{color:"$gray900",fontSize:"$textXl",fontWeight:"$semiBold"}}}}}),Fq=({userInfo:e,size:t,...n})=>(0,i.jsxs)(Dq,{direction:"column",...n,children:[m(e.name)&&(0,i.jsx)(Pq,{size:t,children:e.name}),(0,i.jsx)(Pq,{size:t,children:e.email})]}),Mq=e=>{const t={name:e.userInfo.name,email:e.userInfo.email,image:e.userInfo.picture?.url};return(0,i.jsxs)(Ba,{align:"center",onClick:e.openVolunteer,children:["registrationState"in e?(0,i.jsx)($q,{...t,registrationState:e.registrationState,size:40}):"checkInState"in e?(0,i.jsx)($q,{...t,checkInState:e.checkInState,size:40}):(0,i.jsx)(sp,{...t,size:40}),(0,i.jsx)(Fq,{css:{marginLeft:"$3"},size:40,userInfo:e.userInfo})]})},Nq=()=>{const e=Xn();return(0,i.jsxs)(Ba,{align:"center",css:{flex:1},direction:"column",gap:"4",justify:"center",children:[(0,i.jsx)(sC,{color:"primary",icon:"user-group"}),(0,i.jsx)(Ar,{color:"gray500",children:e("aucun_b_n_vole_19616")})]})},Lq=_r("h1",{color:"$gray900",fontSize:"$textMd",fontWeight:"$medium"}),Bq=_r(nl,{color:"$gray800",margin:"0 $3",padding:"$3 $4"}),Vq=({back:e,slot:t})=>{const{organizationId:n,eventId:s,positionId:o,positionSlotId:r}=ti(),a=Zn(ph),l=ni(),{hasPermission:d}=wb(),c=d(Hb.POSITION_READ,{positionCategoryId:t.positionCategoryId,positionId:o});return(0,i.jsxs)(AH,{back:e,children:[(0,i.jsx)(cq,{css:{minHeight:"40px",marginRight:"0"},children:(0,i.jsx)(Lq,{children:mq(t,a)})}),c&&(0,i.jsx)(Bq,{icon:"list-check",onClick:()=>{l.push(Ps.POSITION_SLOT_MEMBERS_CHECK_OPTIONS(n,s,o,r))}})]})},Uq=e=>e.event.volunteersRegistrations.nodes,Wq=()=>{const{organizationId:e,eventId:t,positionId:n,positionSlotId:s}=ti(),o=Xn(),r=ni(),a={eventId:t,positionSlotId:s,predicates:[],limit:Rc,offset:0},{data:l,loader:d,loadMore:c,xs:u}=$H(ba,a,Uq);return d&&void 0===l?d:(0,i.jsxs)(wH,{children:[(0,i.jsx)(Vq,{back:()=>{r.push(xs.POSITION_SLOTS({organizationId:e,eventId:t,positionId:n}))},slot:l.event.positionSlot}),(0,i.jsx)(yH,{children:(0,i.jsx)(Ba,{css:{flex:1,margin:"$7 0"},direction:"column",gap:"7",children:0===u.length?(0,i.jsx)(Nq,{}):(0,i.jsxs)(Ba,{direction:"column",gap:"6",children:[u.map(o=>(0,i.jsx)(Mq,{checkInState:o.positionSlotUserInfo.state,openVolunteer:()=>{r.push(Ps.POSITION_SLOT_MEMBERS_USER_INFORMATIONS(e,t,n,s,o.userInfo.id))},userInfo:o.userInfo},o.id)),(0,i.jsx)(PH,{buttonText:o("afficher_plus_d_41906"),isLoading:void 0!==d,loadMore:c,pageInfo:l.event.volunteersRegistrations.pageInfo,statusText:o("_1_sur_2_mem_14323",u.length,l.event.volunteersRegistrations.totalCount)})]})})})]})},Gq=_r("div",{minHeight:"$space$5","@tablet":{minHeight:"$space$6"}}),Hq=e=>(0,i.jsx)(Ar,{color:"gray800",css:{fontSize:"$textLg","@tablet":{fontSize:"$textMd"},...e.css},fontWeight:"semiBold",children:e.children}),qq=e=>{const t=Tc(),n=Xn(),s=e.fieldsToDisplay.filter(e=>!["picture","firstName","lastName"].includes(e.fieldProperty)),o=s.length,r=e.privateCustomFields.length;return(0,i.jsxs)(Ba,{direction:"column",children:[o>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(Hq,{children:n("informations_pe_37892")}),(0,i.jsx)(Ya,{height:"3"}),s.map(t=>pC(t,e.userInfo.fields,s)&&(0,i.jsxs)(L.Fragment,{children:[(0,i.jsx)(qz,{field:t,fields:e.userInfo.fields}),(0,i.jsx)(Gq,{})]},t.id)),!1===t&&(0,i.jsx)(Ar,{css:{borderBottom:"1px solid $gray200"},width:1})]}),r>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:t?5:6}),(0,i.jsxs)(Ba,{gap:"3",children:[(0,i.jsx)(Hq,{children:(0,i.jsx)(nl,{icon:"lock"})}),(0,i.jsx)(Hq,{children:n("informations_pr_15873")})]}),(0,i.jsx)(Ya,{height:"3"}),e.privateCustomFields.map(t=>(0,i.jsxs)(L.Fragment,{children:[(0,i.jsx)(qz,{field:t,fields:e.userInfo.fields}),(0,i.jsx)(Gq,{})]},t.id)),!1===t&&(0,i.jsx)(Ar,{css:{borderBottom:"1px solid $gray200"},width:1})]}),!1===t&&e.editButton,!1===t&&(0,i.jsx)(Ya,{height:"6"})]})},Kq=e=>{const t=ni(),n=Tc(),s=m(e.path);return(0,i.jsxs)(Ba,{css:{cursor:s?"pointer":"initial"},direction:"column",onClick:()=>{s&&t.push(e.path)},children:[(0,i.jsx)(Ar,{color:"gray800",css:{fontSize:"$textSm",overflow:"hidden",textOverflow:"ellipsis"},fontWeight:"medium",children:e.text}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ar,{color:"gray500",css:{fontSize:"$textMd","@tablet":{fontSize:"$textSm"}},children:e.subtext}),(0,i.jsx)(Ya,{height:n?5:6})]})},Yq=e=>{const t=Xn(),{hasPermission:n}=wb(),s=Zn(Jc),o=Zn(rp),r=Zn(ph),a=Tc(),l=n(Hb.MEMBER_ASSIGN),d=(0,uc.A)(e.volunteerRegistration.positionsSlotsUsersInfos,e=>e.positionSlot.range.start.toMillis()),c=(0,uc.A)(e.volunteerRegistration.preassignPositions.map(({id:e,name:t,range:n})=>({id:e,name:t,range:n,isPosition:!0})).concat(e.volunteerRegistration.preassignPositionsCategories.map(({id:e,name:t,range:n})=>({id:e,name:t,range:n,isPosition:!1}))),e=>e.range?.start.toMillis()??0);return(0,i.jsxs)(Ba,{direction:"column",children:[(0,i.jsx)(Ya,{height:"6"}),so(d)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Hq,{children:t("affectation_plural")}),(0,i.jsx)(Ya,{height:"3"}),d.map((t,s)=>(0,i.jsxs)(L.Fragment,{children:[(0,i.jsx)(Lk,{canCheckIn:n(Hb.POSITION_READ,{positionCategoryId:t.positionCategoryId,positionId:t.position.id}),canDelete:l,positionSlotUserInfo:t,reloadCheckIn:e.reload,onDelete:e.reload}),(0,i.jsx)(Ya,{height:a?2:3})]},s)),(0,i.jsx)(Ya,{height:"3"}),!1===a&&(0,i.jsx)(Xu,{direction:"horizontal"}),(0,i.jsx)(Ya,{height:a?5:6})]}),so(c)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Hq,{children:t("missions_et_cat_88954")}),(0,i.jsx)(Ya,{height:"3"}),c.map((t,n)=>(0,i.jsx)(Kq,{path:t.isPosition?xs.POSITION({organizationId:e.organizationId,eventId:e.eventId,positionId:t.id}):xs.POSITION_CATEGORY({organizationId:e.organizationId,eventId:e.eventId,positionCategoryId:t.id}),subtext:t.range?r.toDisplayString(t.range):"-",text:t.name},n)),!1===a&&(0,i.jsx)(Xu,{direction:"horizontal"}),(0,i.jsx)(Ya,{height:a?5:6})]}),(so(e.volunteerRegistration.positionsCategories)||so(e.volunteerRegistration.positions)||so(e.volunteerRegistration.positionsSlots))&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Hq,{children:t("missions_souhai_23225")}),(0,i.jsx)(Ya,{height:"3"}),(0,uc.A)(e.volunteerRegistration.positionsCategories,e=>e.range?.start?.toMillis()??0).map((t,n)=>(0,i.jsx)(Kq,{path:xs.POSITION_CATEGORY({organizationId:e.organizationId,eventId:e.eventId,positionCategoryId:t.id}),subtext:t.range?r.toDisplayString(t.range):"-",text:t.name},n)),(0,uc.A)(e.volunteerRegistration.positions,e=>e.range?.start?.toMillis()??0).map((t,n)=>(0,i.jsx)(Kq,{path:xs.POSITION({organizationId:e.organizationId,eventId:e.eventId,positionId:t.id}),subtext:t.range?r.toDisplayString(t.range):"-",text:t.name},n)),(0,uc.A)(e.volunteerRegistration.positionsSlots,e=>e.range.start.toMillis()).map((t,n)=>(0,i.jsx)(Kq,{path:xs.POSITION({organizationId:e.organizationId,eventId:e.eventId,positionId:t.position.id}),subtext:t.nameOrRange,text:t.position.name},n)),!1===a&&(0,i.jsx)(Xu,{direction:"horizontal"}),(0,i.jsx)(Ya,{height:a?5:6})]}),so(e.volunteerRegistration.slots)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Hq,{children:t("disponibilit_s_49923")}),(0,i.jsx)(Ya,{height:"3"}),e.volunteerRegistration.slots.map((e,n)=>(0,i.jsx)(Kq,{subtext:r.toDisplayString(e.range),text:t("disponibilit_n_50484",n+1)},n)),!1===a&&(0,i.jsx)(Xu,{direction:"horizontal"}),(0,i.jsx)(Ya,{height:a?5:6})]}),e.volunteerRegistration.state===Pt.Assigned&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Hq,{children:t("statistiques_98073")}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(Kq,{subtext:o.minutesToHoursMinutesString(e.volunteerRegistration.volunteerMinutes),text:t("nombre_d_heures_36999")}),!1===a&&(0,i.jsx)(Xu,{direction:"horizontal"}),(0,i.jsx)(Ya,{height:a?5:6})]}),(0,i.jsx)(Hq,{children:t("inscription_48144")}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(Kq,{subtext:s.toLocaleString(e.volunteerRegistration.insertedAt.toLocal(),eo.DateTime),text:t("date_d_inscript_31369")})]})},Zq=_r(Ar,{lineHeight:"28px",marginTop:"$3",maxWidth:"100%",ellipsis:""}),Xq=_r(Ar,{lineHeight:"20px",maxWidth:"100%",ellipsis:""}),Jq=({registration:e})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)($q,{email:e.userInfo.email,image:e.userInfo.picture?.url,name:e.userInfo.name,registrationState:e.state,size:64}),(0,i.jsx)(Zq,{color:"gray800",fontSize:"textLg",fontWeight:"semiBold",children:e.userInfo.name}),(0,i.jsx)(Xq,{color:"gray500",fontSize:"textSm",children:e.userInfo.email})]}),Qq=({basePath:e,data:t,reload:n})=>{const s=Xn(),{organizationId:o,eventId:r}=ti(),a=t.event.volunteerRegistration,l={informations:`${e}/${gi.INFORMATION}`,registration:`${e}/${gi.REGISTRATION}`};return(0,i.jsxs)(Ba,{align:"center",css:{alignSelf:"center",padding:"0 $4"},direction:"column",width:1,children:[(0,i.jsx)(Jq,{registration:a}),(0,i.jsxs)(mj,{css:{marginTop:"$5"},children:[(0,i.jsxs)(aq,{children:[(0,i.jsx)(dq,{path:l.informations,children:s("informations_22954")}),(0,i.jsx)(dq,{path:l.registration,children:s("missions_63972")})]}),(0,i.jsx)(hj,{path:l.informations,children:(0,i.jsx)(qq,{fieldsToDisplay:t.event.formsCustomsFields,privateCustomFields:t.organization.customFields.nodes,userInfo:a.userInfo})}),(0,i.jsx)(hj,{path:l.registration,children:(0,i.jsx)(Yq,{eventId:r,organizationId:o,reload:n,volunteerRegistration:a})})]})]})},eK=({basePath:e,onClose:t})=>{const{organizationId:n,eventId:s,userInfoId:o}=ti(),{data:r,loader:a,reload:l}=Qn("query UserInfoMobile(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $userInfoId: UsersInfoId!\n) {\n organization(id: $organizationId) {\n customFields(variety: UserInfo, privacy: Private) {\n nodes {\n ...CustomFieldWithCondition\n }\n }\n }\n\n event(id: $eventId) {\n formsCustomsFields {\n ...CustomFieldWithCondition\n }\n\n volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n id\n state\n volunteerMinutes\n insertedAt\n\n slots {\n range\n }\n\n positionsSlots {\n nameOrRange\n range\n\n position {\n id\n name\n }\n }\n\n positions {\n id\n name\n range\n }\n\n positionsCategories {\n id\n name\n range\n }\n\n userInfo {\n ...UserInfoOverlay\n }\n\n positionsSlotsUsersInfos {\n ...UserPositionSlotUserInfo\n }\n\n preassignPositions {\n id\n name\n range\n }\n\n preassignPositionsCategories {\n id\n name\n range\n }\n }\n }\n}\n",{organizationId:n,eventId:s,userInfoId:o},[Vs.CustomFieldWithConditionFragment,Vs.UserInfoOverlayFragment,Vs.UserPositionSlotUserInfoFragment]);return(0,i.jsx)(xH,{onClose:t,children:a||(0,i.jsx)(Qq,{basePath:e,data:r,reload:l})})},tK=()=>{const{organizationId:e,eventId:t,positionId:n,positionSlotId:s,userInfoId:o}=ti(),r=ni(),a=Ps.POSITION_SLOT_MEMBERS_USER(e,t,n,s,o);return(0,i.jsx)(eK,{basePath:a,onClose:()=>{r.push(Ps.POSITION_SLOT_MEMBERS(e,t,n,s))}})},nK=()=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Sr.dO,{children:[(0,i.jsx)(Sr.qh,{path:Ps.POSITION_SLOT_CHECK_MEMBERS_CHECK_IN(":organizationId",":eventId",":positionId",":positionSlotId"),children:(0,i.jsx)(yq,{})}),(0,i.jsx)(Sr.qh,{path:Ps.POSITION_SLOT_CHECK_MEMBERS_CHECK_OUT(":organizationId",":eventId",":positionId",":positionSlotId"),children:(0,i.jsx)(wq,{})}),(0,i.jsx)(Sr.qh,{path:Ps.POSITION_SLOT_CHECK_MEMBERS_RESET(":organizationId",":eventId",":positionId",":positionSlotId"),children:(0,i.jsx)(Tq,{})}),(0,i.jsx)(Sr.qh,{path:Ps.POSITION_SLOT_MEMBERS(":organizationId",":eventId",":positionId",":positionSlotId"),children:(0,i.jsx)(Wq,{})}),(0,i.jsx)(Sr.qh,{children:(0,i.jsx)(xq,{})})]}),(0,i.jsxs)(Sr.dO,{children:[(0,i.jsx)(Sr.qh,{path:Ps.POSITION_SLOT_MEMBERS_CHECK_OPTIONS(":organizationId",":eventId",":positionId",":positionSlotId"),children:(0,i.jsx)(Iq,{})}),(0,i.jsx)(Sr.qh,{path:Ps.POSITION_SLOT_MEMBERS_USER(":organizationId",":eventId",":positionId",":positionSlotId",":userInfoId"),children:(0,i.jsx)(tK,{})})]})]}),iK=_r("i",{fontSize:"$textXl"}),sK=({replaySearch:e})=>{const{eventId:t}=ti(),{data:n,loader:s}=Qn("query RecentVolunteersSearchesMobile($eventId: EventId!) {\n event(id: $eventId) {\n recentVolunteersRegistrationsSearches\n }\n}\n",{eventId:t},[]),o=Xn();if(s)return s;{const t=n.event.recentVolunteersRegistrationsSearches;return(0,i.jsxs)(Ba,{css:{padding:"$6 0"},direction:"column",gap:"6",children:[(0,i.jsx)(Ar,{fontSize:"textMd",fontWeight:"semiBold",children:o("recherches_r_ce_82891",t.length)}),t.map((t,n)=>(0,i.jsxs)(Ba,{align:"center",gap:"2",onClick:()=>{e(t)},children:[(0,i.jsx)(iK,{className:"fa-regular fa-clock"}),(0,i.jsx)(Ar,{children:t})]},n))]})}},oK=()=>{const e=Xn();return(0,i.jsx)(Gk,{css:{flex:1,padding:"0 $4"},title:e("d_sol_il_n_y_46236")})},rK=e=>e.event.volunteersRegistrations.nodes,aK=({search:e})=>{const t=Xn(),{organizationId:n,eventId:s}=ti(),o={eventId:s,predicates:[],limit:Rc,offset:0,name:e},{data:r,loader:a,loadMore:l,xs:d}=$H(Ra,o,rK),c=ni();return a&&void 0===r?a:0===d.length?(0,i.jsx)(oK,{}):(0,i.jsxs)(Ba,{css:{padding:"$6 0"},direction:"column",gap:"6",children:[(0,i.jsx)(Ar,{fontSize:"textMd",fontWeight:"semiBold",children:t("r_sultat_de_la_64686",d.length)}),d.map((e,t)=>(0,i.jsx)(Mq,{openVolunteer:()=>{c.push(Ps.VOLUNTEERS_SEARCH_USER_INFORMATIONS(n,s,e.userInfo.id))},registrationState:e.state,userInfo:e.userInfo},t)),(0,i.jsx)(PH,{buttonText:t("afficher_plus_d_41906"),isLoading:void 0!==a,loadMore:l,pageInfo:r.event.volunteersRegistrations.pageInfo,statusText:t("_1_sur_2_mem_14323",d.length,r.event.volunteersRegistrations.totalCount)})]})},lK=_r(Ba,{color:"$blue600"}),dK=()=>{const{organizationId:e,eventId:t}=ti(),n=ni(),s=Xn(),[o,r]=(0,L.useState)(""),[a,l]=(0,L.useState)("");return(0,i.jsxs)(wH,{children:[(0,i.jsx)(AH,{back:()=>{n.push(Ps.VOLUNTEERS(e,t))},children:(0,i.jsxs)(Ba,{align:"center",css:{marginRight:"$4",flexGrow:1},gap:"3",children:[(0,i.jsx)(Bl,{icon:"search",placeholder:s("rechercher_un_m_05904"),value:o,onChange:e=>{r(e),e||l(e)},onKeyDown:e=>{"Enter"===e.key&&l(o)}}),a&&(0,i.jsx)(lK,{onClick:()=>{r(""),l("")},children:s("annuler_48254")})]})}),(0,i.jsx)(yH,{children:a?(0,i.jsx)(aK,{search:a}):(0,i.jsx)(sK,{replaySearch:e=>{r(e),l(e)}})})]})},cK=()=>{const{organizationId:e,eventId:t,userInfoId:n}=ti(),s=ni(),o=Ps.VOLUNTEERS_SEARCH_USER(e,t,n);return(0,i.jsx)(eK,{basePath:o,onClose:()=>{s.push(Ps.VOLUNTEERS_SEARCH(e,t))}})},uK=()=>{const e=Xn();return(0,i.jsx)(Gk,{css:{flex:1,padding:"0 $4"},subtitle:e("diffusez_le_for_36054"),title:e("il_n_y_a_pas_de_22623")})},hK=e=>e.event.volunteersRegistrations.nodes,mK=({segment:e})=>{const t=Xn(),{organizationId:n,eventId:s,segmentId:o}=ti(),r={eventId:s,predicates:e.predicates,limit:Rc,offset:0},{data:a,loader:l,loadMore:d,xs:c}=$H(Ra,r,hK),u=ni();return l&&void 0===a?l:0===c.length?(0,i.jsx)(uK,{}):(0,i.jsxs)(Ba,{direction:"column",gap:"6",children:[c.map((e,t)=>(0,i.jsx)(Mq,{openVolunteer:()=>{u.push(Ps.VOLUNTEERS_LIST_USER_INFORMATIONS(n,s,o,e.userInfo.id))},registrationState:e.state,userInfo:e.userInfo},t)),(0,i.jsx)(PH,{buttonText:t("afficher_plus_d_41906"),isLoading:void 0!==l,loadMore:d,pageInfo:a.event.volunteersRegistrations.pageInfo,statusText:t("_1_sur_2_mem_14323",c.length,a.event.volunteersRegistrations.totalCount)})]})},gK=_r("h1",{fontSize:"$displaySm",fontWeight:"$semiBold",margin:0}),pK=_r(nl,{color:"$gray800",fontSize:"$textLg",padding:"$2"}),fK=({event:e})=>{const{organizationId:t,eventId:n,segmentId:s}=ti(),o=ni(),r=Xn(),a=(0,JH.A)(e.segmentsFolders.flatMap(e=>e.segments),{id:s});return(0,i.jsxs)(Ba,{css:{flex:1,minHeight:"100%",padding:"$6 $3"},direction:"column",gap:"6",children:[(0,i.jsxs)(Ba,{align:"center",gap:"4",justify:"between",children:[(0,i.jsx)(gK,{children:r("membres_11310")}),(0,i.jsx)(pK,{icon:"search",onClick:()=>{o.push(Ps.VOLUNTEERS_SEARCH(t,n))}})]}),(0,i.jsx)(Ar,{children:(0,i.jsx)(XH,{folders:e.segmentsFolders,segmentId:s,onChange:e=>o.push(Ps.VOLUNTEERS_SEGMENT(t,n,e))})}),(0,i.jsx)(Ba,{css:{flex:1},direction:"column",children:(0,i.jsx)(mK,{segment:a})})]})},_K=()=>{const{organizationId:e,eventId:t,segmentId:n,userInfoId:s}=ti(),o=ni(),r=Ps.VOLUNTEERS_LIST_USER(e,t,n,s);return(0,i.jsx)(eK,{basePath:r,onClose:()=>{o.push(Ps.VOLUNTEERS_SEGMENT(e,t,n))}})},xK=()=>{const{organizationId:e,eventId:t}=ti(),{data:n,loader:s}=Qn("query VolunteersSegmentsMobile($eventId: EventId!) {\n event(id: $eventId) {\n segmentsFolders(segmentType: Volunteers) {\n ...SegmentsFoldersSegments\n }\n }\n}\n",{eventId:t},[Vs.SegmentsFoldersSegmentsFragment]);return s||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Sr.dO,{children:[(0,i.jsx)(Sr.qh,{path:Ps.VOLUNTEERS_SEARCH(":organizationId",":eventId"),children:(0,i.jsx)(dK,{})}),(0,i.jsx)(Sr.qh,{path:Ps.VOLUNTEERS_SEGMENT(":organizationId",":eventId",":segmentId"),children:(0,i.jsx)(fK,{event:n.event})}),(0,i.jsx)(Sr.qh,{children:(0,i.jsx)(oi,{path:Ps.VOLUNTEERS_SEGMENT(e,t,n.event.segmentsFolders[0].segments[0].id)})})]}),(0,i.jsxs)(Sr.dO,{children:[(0,i.jsx)(Sr.qh,{path:Ps.VOLUNTEERS_SEARCH_USER(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(cK,{})}),(0,i.jsx)(Sr.qh,{path:Ps.VOLUNTEERS_LIST_USER(":organizationId",":eventId",":segmentId",":userInfoId"),children:(0,i.jsx)(_K,{})})]})]})},IK=()=>{const{organizationId:e,eventId:t}=ti(),{user:n}=TI();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Sr.dO,{children:[(0,i.jsx)(Sr.qh,{path:Ps.DASHBOARD(":organizationId",":eventId"),children:(0,i.jsx)(rH,{eventId:t,user:n,children:(0,i.jsx)(hH,{})})}),(0,i.jsx)(Sr.qh,{path:Ps.VOLUNTEERS(":organizationId",":eventId"),children:(0,i.jsx)(rH,{eventId:t,user:n,children:(0,i.jsx)(xK,{})})}),(0,i.jsx)(Sr.qh,{path:xs.POSITIONS({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(rH,{eventId:t,user:n,children:(0,i.jsx)(oq,{})})}),(0,i.jsx)(Sr.qh,{path:xs.POSITION({organizationId:":organizationId",eventId:":eventId",positionId:":positionId"}),children:(0,i.jsx)(nK,{})}),(0,i.jsx)(Sr.qh,{children:(0,i.jsx)(oi,{path:Ps.DASHBOARD(e,t)})})]}),(0,i.jsx)(Sr.dO,{children:(0,i.jsx)(Sr.qh,{path:Ps.DASHBOARD_EVENT_SWITCH(":organizationId",":eventId"),children:(0,i.jsx)(CH,{})})})]})},vK=e=>{const t=e.isActive?e.isActive(location.pathname):location.pathname===e.to,[n,s]=L.useState(t),o=!!e.children&&(!e.isMenuOpen||n),r=()=>(0,i.jsxs)(Ba,{align:"center",className:t?"h-event-menu-group-active":"",css:{color:"$gray700",cursor:"pointer",padding:"$2 $3","&:hover, &.h-event-menu-group-active":{background:"$primary50",borderRadius:"6px",color:"$primary500"}},gap:"3",height:e.isMenuOpen?void 0:40,width:1,onClick:()=>{e.isMenuOpen&&s(!n)},children:[(0,i.jsx)(nl,{icon:e.icon}),e.isMenuOpen&&(0,i.jsx)(Ar,{css:{flex:"1"},fontWeight:"medium",children:e.title}),e.isMenuOpen&&e.children&&(0,i.jsx)(Ar,{fontSize:"textXs",children:(0,i.jsx)(nl,{icon:n?"chevron-up":"chevron-down"})})]});return(0,i.jsxs)(Ba,{className:e.isMenuOpen?"h-event-menu-open":"h-event-menu-collapsed",css:{position:"relative",userSelect:"none","&.h-event-menu-collapsed > .h-event-menu-group":{display:"none"},"&.h-event-menu-collapsed:hover > .h-event-menu-group":{display:"flex"}},direction:"column",gap:"2",width:1,children:[e.isMenuOpen&&e.children||!e.to?r():(0,i.jsx)(el,{to:e.to,children:r()}),o&&(0,i.jsx)(Ba,{className:"h-event-menu-group",css:e.isMenuOpen?{paddingLeft:"36px"}:{left:"28px",position:"absolute",paddingLeft:"12px",top:"-8px",width:"192px",zIndex:"10"},children:(0,i.jsxs)(Ba,{css:e.isMenuOpen?{}:{background:"white",bd:"gray200 2 md",py:"$2",width:"100%"},direction:"column",children:[!e.isMenuOpen&&(0,i.jsx)(Ar,{css:{padding:"$2 $3"},font:"gray900 textSm semiBold",children:e.title}),e.children]})})]})},bK=e=>{const t=e.isActive(location.pathname);return(0,i.jsx)(el,{"aria-label":e.children,"aria-selected":t,role:"menuitem",to:e.to,onClick:async()=>await(e.onClick?.()),children:(0,i.jsx)(Ba,{className:t?"h-event-menu-item-active":"",css:{color:"$gray800",cursor:"pointer",padding:"6px $3","&:hover, &.h-event-menu-item-active":{color:"$primary500"}},children:e.children})})},jK=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=vl(),{hasFeature:o,organization:r}=TI(),{event:a,isEventReader:l,numberOfWaitingAccreditations:d,numberOfWaitingAssigments:c,updateLocalEvent:u}=wb(),{canAccreditationRead:h,canCampaignRead:m,canDelegationRead:g,canDocumentRead:p,canEmailEdit:f,canFormRead:_,canMemberAccredit:x,canMemberAssign:I,canPositionRead:v,canWorkflowRead:b}=$S(),j=hm(),C=(0,L.useCallback)(e=>e.endsWith("/volunteers")||null!==e.match(/\/volunteers\/\d+/)||null!==e.match(/\/member\/\d+/)&&(e.endsWith("informations")||e.endsWith("availabilities")||e.endsWith("positions")||e.endsWith("accreditations")||e.endsWith("actions")||e.endsWith("comments")||e.includes("history")),[]),y=(0,L.useCallback)(e=>null!==e.match(/\/delegations\/\d+/)||null!==e.match(/\/delegation\/\d+/)||null!==e.match(/\/delegation-category\/\d+/),[]),k=(0,L.useCallback)(e=>C(e)||y(e),[C,y]),A=(0,L.useCallback)(e=>(null!==e.match(/\/positions\/\d+/)||null!==e.match(/\/position\/\d+/)||null!==e.match(/\/position-category\/\d+/))&&!e.includes("documents"),[]),w=(0,L.useCallback)(e=>e.endsWith("/assignments")||e.endsWith("/assignments/blank")||null!==e.match(/\/assignment\/\d+/)||null!==e.match(/\/pre-assignment\/\d+/)||null!==e.match(/\/team-assignment\/\w+/),[]),S=(0,L.useCallback)(e=>A(e)||w(e),[A,w]),E=(0,L.useCallback)(e=>null!==e.match(/\/accreditations\/\d+/)||null!==e.match(/\/accreditation\/\d+/)||null!==e.match(/\/accreditation-category\/\d+/),[]),T=(0,L.useCallback)(e=>e.endsWith("/accreditations-assignments")||null!==e.match(/\/edit-accredit\/\d+/),[]),z=(0,L.useCallback)(e=>E(e)||T(e),[E,T]),O=(0,L.useCallback)(e=>e.endsWith("/forms")||e.endsWith("/forms/create"),[]),R=(0,L.useCallback)(e=>e.endsWith("/campaigns")&&!e.endsWith("/history/campaigns")||null!==e.match(/\/campaign\/\d+/),[]),$=(0,L.useCallback)(e=>e.endsWith("/emails/parameters")||e.endsWith("/emails/templates")||e.endsWith("/emails/dns"),[]),D=(0,L.useCallback)(e=>e.endsWith("/documents")||null!==e.match(/\/documents\//),[]),P=(0,L.useCallback)(e=>O(e)||R(e)||$(e)||D(e),[O,R,$,D]),F=(0,L.useCallback)(e=>e.endsWith("/options/api"),[]),M=(0,L.useCallback)(e=>e.endsWith("options/weezevent-v2"),[]),N=(0,L.useCallback)(e=>e.endsWith("/workflows"),[]),B=(0,L.useCallback)(e=>F(e)||M(e)||N(e),[F,M,N]),V=l,U=o(Be.Api)&&l,W="number"==typeof r.weezeventOrganizationId&&a.isWeezeventSynchronized&&l,G=U||W||b,H=_||m||f||p;return(0,i.jsxs)(Ba,{css:{overflowY:e.isOpen?"auto":void 0,paddingTop:"$5",px:"$3"},direction:"column",gap:"5",width:1,children:[(0,i.jsxs)(Ba,{align:"center",css:{bd:"gray300 1",cursor:"pointer",padding:"$2 $3"},gap:"2",onClick:e=>{Dl(e),e.target.dispatchEvent(new CustomEvent(iT,{bubbles:!0}))},children:[(0,i.jsx)(Ar,{children:(0,i.jsx)(nl,{icon:"sparkles"})}),e.isOpen&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ar,{color:"gray800",css:{flex:"1"},children:t("action_rapide_97952")}),(0,i.jsxs)(Ba,{align:"center",css:{background:"$gray50",bd:"gray200 1",padding:"2px $1"},justify:"center",children:[j?"⌘":"Ctrl","+k"]})]})]}),(0,i.jsxs)(Ba,{direction:"column",gap:"1",width:1,children:[V&&(0,i.jsx)(vK,{icon:"objects-column",isMenuOpen:e.isOpen,title:t("tableau_de_bord_24627"),to:Ps.DASHBOARD(n,s)}),(0,i.jsxs)(vK,{icon:"user-group",isActive:k,isMenuOpen:e.isOpen,title:t("population_38615"),to:Ps.VOLUNTEERS(n,s),children:[(0,i.jsx)(bK,{isActive:C,to:Ps.VOLUNTEERS(n,s),onClick:()=>u({volunteersSegmentId:null}),children:t("membres_11310")}),g&&(0,i.jsx)(bK,{isActive:y,to:hs.DELEGATIONS({organizationId:n,eventId:s}),onClick:()=>u({delegationsSegmentId:null}),children:t("d_l_gations_78318")})]}),v&&(0,i.jsxs)(vK,{icon:"sitemap",isActive:S,isMenuOpen:e.isOpen,title:t("missions_63972"),to:xs.POSITIONS({organizationId:n,eventId:s}),children:[(0,i.jsx)(bK,{isActive:A,to:xs.POSITIONS({organizationId:n,eventId:s}),onClick:()=>u({positionsSegmentId:null}),children:t("missions_63972")}),I&&(0,i.jsx)(bK,{isActive:w,to:Ps.ASSIGNMENTS(n,s),children:`${t("affectation_plural")} (${c})`})]}),h&&(0,i.jsxs)(vK,{icon:"badge-check",isActive:z,isMenuOpen:e.isOpen,title:t("accr_ditations_39450"),to:is.ACCREDITATIONS({organizationId:n,eventId:s}),children:[(0,i.jsx)(bK,{isActive:E,to:is.ACCREDITATIONS({organizationId:n,eventId:s}),onClick:()=>u({accreditationsSegmentId:null}),children:t("accr_ditations_39450")}),x&&(0,i.jsx)(bK,{isActive:T,to:Ps.ACCREDITATIONS_ASSIGNMENTS(n,s),children:`${t("mod_ration_09947")} (${d})`})]}),H&&(0,i.jsxs)(vK,{icon:"message",isActive:P,isMenuOpen:e.isOpen,title:t("communication_05277"),to:Vi.FORMS({organizationId:n,eventId:s}),children:[_&&(0,i.jsx)(bK,{isActive:O,to:Vi.FORMS({organizationId:n,eventId:s}),children:t("Form_plural")}),m&&(0,i.jsx)(bK,{isActive:R,to:$I.CAMPAIGNS({organizationId:n,eventId:s}),children:t("Campaigns")}),f&&(0,i.jsx)(bK,{isActive:e=>e.endsWith("/emails/parameters")||e.endsWith("/emails/templates")||e.endsWith("/emails/dns"),to:Ps.EVENT_EMAILS_PARAMETERS(n,s),children:t("e_mails_09850")}),p&&(0,i.jsx)(bK,{isActive:D,to:Ps.DOCUMENTS(n,s),children:t("Documents")})]}),G&&(0,i.jsxs)(vK,{icon:"sliders-up",isActive:B,isMenuOpen:e.isOpen,title:t("options_53186"),to:Ps.OPTIONS_API(n,s),children:[U&&(0,i.jsx)(bK,{isActive:F,to:Ps.OPTIONS_API(n,s),children:"API"}),W&&(0,i.jsx)(bK,{isActive:M,to:Ps.OPTIONS_WEEZEVENT_V2(n,s),children:"Weezevent"}),b&&(0,i.jsx)(bK,{isActive:N,to:nv.WORKFLOWS({organizationId:n,eventId:s}),children:t("automatisations_60045")})]})]})]})},CK=e=>{const{translate:t}=vl();return(0,i.jsx)(Ba,{align:"center",css:{px:"$4"},height:48,justify:"end",children:(0,i.jsxs)(km,{children:[(0,i.jsx)(Sm,{children:(0,i.jsx)(zl,{color:"white",css:{border:"none"},leftIcon:"sidebar",size:"sm",onClick:e.onToggle})}),(0,i.jsx)(wm,{placement:"top",children:e.isOpen?t("masquer_le_menu_29008"):t("afficher_le_men_91936")})]})})},yK=()=>{const{params:{organizationId:e,eventId:t},translate:n}=vl(),{event:s,isEventAdmin:o,isEventReader:r}=wb(),{canAccreditationRead:a,canCampaignRead:l,canDelegationRead:d,canDocumentRead:c,canEmailEdit:u,canFormEdit:h,canFormRead:m,canMemberAccredit:g,canMemberAssign:p,canMemberEdit:f,canPositionRead:_,canWorkflowRead:x}=$S();Md(s.name);const[I,v]=fy(e,"isEventMenuOpen",!1);return(0,i.jsxs)(Ba,{height:1,width:1,children:[(0,i.jsxs)(Ba,{"aria-label":n("menu_de_l_v_ne_05526"),as:Ma.Nav,css:{borderRight:"1px solid $gray200"},direction:"column",width:I?240:64,children:[(0,i.jsx)(Ba,{css:{flex:"1",overflowY:I?"hidden":void 0},width:1,children:(0,i.jsx)(jK,{isOpen:I})}),(0,i.jsx)(CK,{isOpen:I,onToggle:()=>{v(!I)}})]}),(0,i.jsx)(Ar,{css:{flex:"1",height:"100%",overflowX:"hidden"},tabIndex:-1,children:(0,i.jsxs)(Sr.dO,{children:[r&&(0,i.jsx)(Sr.qh,{exact:!0,path:Ps.DASHBOARD(":organizationId",":eventId"),children:(0,i.jsx)(uL,{})}),_&&(0,i.jsx)(Sr.qh,{path:xs.POSITIONS({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(JW,{})}),_&&(0,i.jsx)(Sr.qh,{path:xs.POSITION_CATEGORY({organizationId:":organizationId",eventId:":eventId",positionCategoryId:":positionCategoryId"}),children:(0,i.jsx)(bG,{})}),_&&(0,i.jsx)(Sr.qh,{path:xs.POSITION({organizationId:":organizationId",eventId:":eventId",positionId:":positionId"}),children:(0,i.jsx)(hG,{})}),(0,i.jsx)(Sr.qh,{path:Ps.VOLUNTEERS(":organizationId",":eventId"),children:(0,i.jsx)(QG,{})}),f&&(0,i.jsx)(Sr.qh,{path:Ps.EDIT_USER(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(PO,{})}),o&&(0,i.jsx)(Sr.qh,{path:Ps.EDIT_USER_DELEGATION(":organizationId",":eventId",":delegationId",":userInfoId"),children:(0,i.jsx)(PO,{})}),g&&(0,i.jsx)(Sr.qh,{path:Ps.EDIT_USER_ACCREDITATIONS(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(AG,{})}),p&&(0,i.jsx)(Sr.qh,{path:Ps.EDIT_USER_MISSIONS(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(EG,{})}),(0,i.jsx)(Sr.qh,{path:Ps.EDIT_USER_SLOTS(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(OG,{})}),d&&(0,i.jsx)(Sr.qh,{path:hs.DELEGATIONS({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(kL,{})}),(0,i.jsx)(Sr.qh,{path:QI.MEMBER({organizationId:":organizationId",eventId:":eventId",userInfoId:":userInfoId"}),children:(0,i.jsx)(jO,{})}),d&&(0,i.jsx)(Sr.qh,{path:hs.DELEGATION_CATEGORY({organizationId:":organizationId",eventId:":eventId",delegationCategoryId:":delegationCategoryId"}),children:(0,i.jsx)(yS,{isEvent:!0})}),d&&(0,i.jsx)(Sr.qh,{path:hs.DELEGATION({organizationId:":organizationId",eventId:":eventId",delegationId:":delegationId"}),children:(0,i.jsx)(cS,{})}),(r||p)&&(0,i.jsx)(Sr.qh,{path:Ps.ASSIGNMENTS(":organizationId",":eventId"),children:(0,i.jsx)(eL,{})}),p&&(0,i.jsx)(Sr.qh,{path:Ps.ASSIGNMENT(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(YN,{isEdit:!1})}),p&&(0,i.jsx)(Sr.qh,{path:Ps.EDIT_ASSIGNMENT(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(YN,{isEdit:!0})}),o&&(0,i.jsx)(Sr.qh,{path:Ps.TEAM_ASSIGNMENT(":organizationId",":eventId",":teamCode"),children:(0,i.jsx)(aL,{})}),p&&(0,i.jsx)(Sr.qh,{path:Ps.PRE_ASSIGNMENT(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(YN,{isEdit:!1})}),g&&(0,i.jsx)(Sr.qh,{path:Ps.ACCREDITATIONS_ASSIGNMENTS(":organizationId",":eventId"),children:(0,i.jsx)(bN,{})}),g&&(0,i.jsx)(Sr.qh,{path:Ps.ACCREDIT(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(gN,{isEdit:!1})}),g&&(0,i.jsx)(Sr.qh,{path:Ps.EDIT_ACCREDIT(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(gN,{isEdit:!0})}),h&&(0,i.jsx)(Sr.qh,{path:Vi.CREATE({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(BS,{isCreateOpen:!0})}),m&&(0,i.jsx)(Sr.qh,{path:Vi.FORMS({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(BS,{isCreateOpen:!1})}),l&&(0,i.jsx)(Sr.qh,{path:$I.CAMPAIGNS({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(lL,{})}),l&&(0,i.jsx)(Sr.qh,{path:$I.CAMPAIGN({organizationId:":organizationId",eventId:":eventId",campaignId:":campaignId"}),children:(0,i.jsx)(Nj,{})}),(r||u)&&(0,i.jsx)(Sr.qh,{path:Ps.EVENT_EMAILS(":organizationId",":eventId"),children:(0,i.jsx)(sU,{})}),c&&(0,i.jsx)(Sr.qh,{exact:!0,path:Ps.DOCUMENTS_USER_PLANNING(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(WV,{})}),c&&(0,i.jsx)(Sr.qh,{exact:!0,path:Ps.DOCUMENTS_USER_PLANNING_LIST(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(YV,{})}),c&&(0,i.jsx)(Sr.qh,{exact:!0,path:Ps.DOCUMENTS_USER_PLANNING_DAYS(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(PV,{})}),c&&(0,i.jsx)(Sr.qh,{exact:!0,path:Ps.DOCUMENTS_ASSIGNMENTS(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(hV,{})}),c&&(0,i.jsx)(Sr.qh,{exact:!0,path:Ps.DOCUMENTS_VOLUNTEERS_LISTING(":organizationId",":eventId",":segmentId"),children:(0,i.jsx)(JV,{})}),c&&(0,i.jsx)(Sr.qh,{exact:!0,path:Ps.DOCUMENTS_BADGE(":organizationId",":eventId",":userInfoId","generic"),children:(0,i.jsx)(pV,{})}),c&&(0,i.jsx)(Sr.qh,{exact:!0,path:Ps.DOCUMENTS_BADGE(":organizationId",":eventId",":userInfoId",":badgeType"),children:(0,i.jsx)(vV,{})}),c&&(0,i.jsx)(Sr.qh,{exact:!0,path:Ps.DOCUMENTS_CERTIFICATE(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(xV,{})}),c&&(0,i.jsx)(Sr.qh,{exact:!0,path:Ps.DOCUMENTS_HOURS(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(OV,{})}),c&&(0,i.jsx)(Sr.qh,{exact:!0,path:Ps.DOCUMENTS_POSITION_PLANNING(":organizationId",":eventId",":positionId"),children:(0,i.jsx)($B,{})}),c&&(0,i.jsx)(Sr.qh,{exact:!0,path:Ps.DOCUMENTS_POSITIONS_VOLUNTEERS_PLANNING(":organizationId",":eventId",":segmentId"),children:(0,i.jsx)(QB,{})}),c&&(0,i.jsx)(Sr.qh,{exact:!0,path:Ps.DOCUMENTS_POSITION(":organizationId",":eventId",":positionId"),children:(0,i.jsx)(WB,{})}),c&&(0,i.jsx)(Sr.qh,{exact:!0,path:Ps.DOCUMENTS_PLANNING(":organizationId",":eventId",":segmentId"),children:(0,i.jsx)(YB,{})}),c&&(0,i.jsx)(Sr.qh,{exact:!0,path:Ps.DOCUMENTS_USERS_PICTURES(":organizationId",":eventId",":segmentId"),children:(0,i.jsx)(nU,{})}),c&&(0,i.jsx)(Sr.qh,{exact:!0,path:Ps.DOCUMENTS_USER_CUSTOM_DOCUMENT(":organizationId",":eventId",":userInfoId",":customDocumentId"),children:(0,i.jsx)(wV,{})}),c&&(0,i.jsx)(Sr.qh,{exact:!0,path:Ps.DOCUMENTS(":organizationId",":eventId"),children:(0,i.jsx)(xB,{})}),r&&(0,i.jsx)(Sr.qh,{path:Ps.OPTIONS_WEEZEVENT_V2(":organizationId",":eventId"),children:(0,i.jsx)(wU,{})}),x&&(0,i.jsx)(Sr.qh,{path:nv.WORKFLOWS({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(WR,{})}),r&&(0,i.jsx)(Sr.qh,{path:Ps.OPTIONS_API(":organizationId",":eventId"),children:(0,i.jsx)(kU,{})}),a&&(0,i.jsx)(Sr.qh,{path:is.ACCREDITATIONS({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(GF,{})}),a&&(0,i.jsx)(Sr.qh,{path:is.ACCREDITATION_SLOT({organizationId:":organizationId",eventId:":eventId",accreditationId:":accreditationId",accreditationSlotId:":accreditationSlotId"}),children:(0,i.jsx)(ON,{})}),a&&(0,i.jsx)(Sr.qh,{path:is.ACCREDITATION({organizationId:":organizationId",eventId:":eventId",accreditationId:":accreditationId"}),children:(0,i.jsx)(NM,{})}),a&&(0,i.jsx)(Sr.qh,{path:is.ACCREDITATION_CATEGORY({organizationId:":organizationId",eventId:":eventId",accreditationCategoryId:":accreditationCategoryId"}),children:(0,i.jsx)(EN,{})}),(0,i.jsx)(Sr.qh,{children:(0,i.jsx)(oi,{path:Ps.VOLUNTEERS(e,t),replace:!0})})]})}),(0,i.jsx)(sT,{level:"event"})]})},kK=()=>{const{hasFeature:e}=TI(),{event:t,isEventAdmin:n}=wb(),{canAccreditationEdit:s,canCampaignSend:o,canDelegationEdit:r,canDocumentEdit:a,canFormRead:l,canMemberAssign:d,canMemberCreate:c,canMemberEdit:u,canPositionEdit:h,canWorkflowEdit:m}=$S();return(0,i.jsxs)(Sr.dO,{children:[t.usePositions&&h&&(0,i.jsx)(Sr.qh,{exact:!0,path:Ps.CREATE_POSITION(":organizationId",":eventId",":options?"),children:(0,i.jsx)(NU,{})}),t.usePositions&&h&&(0,i.jsx)(Sr.qh,{exact:!0,path:Ps.EDIT_POSITION(":organizationId",":eventId",":positionId"),children:(0,i.jsx)(LU,{})}),t.usePositions&&d&&(0,i.jsx)(Sr.qh,{path:Ps.POSITION_SLOT_ASSIGN_VOLUNTEERS(":organizationId",":eventId",":positionId",":positionSlotId"),children:(0,i.jsx)(CG,{})}),n&&(0,i.jsx)(Sr.qh,{exact:!0,path:$I.CREATE_TEMPLATE({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(sj,{isTemplate:!0})}),o&&(0,i.jsx)(Sr.qh,{exact:!0,path:$I.CREATE({organizationId:":organizationId",eventId:":eventId",options:":options?"}),children:(0,i.jsx)(sj,{isTemplate:!1})}),o&&(0,i.jsx)(Sr.qh,{exact:!0,path:$I.UPDATE({organizationId:":organizationId",eventId:":eventId",campaignId:":campaignId"}),children:(0,i.jsx)(oj,{})}),s&&(0,i.jsx)(Sr.qh,{exact:!0,path:Ps.CREATE_ACCREDITATION(":organizationId",":eventId",":options?"),children:(0,i.jsx)(aF,{})}),s&&(0,i.jsx)(Sr.qh,{exact:!0,path:Ps.EDIT_ACCREDITATION(":organizationId",":eventId",":accreditationId"),children:(0,i.jsx)(lF,{})}),a&&(0,i.jsx)(Sr.qh,{path:Ps.EDIT_CUSTOM_DOCUMENT(":organizationId",":eventId",":customDocumentId"),children:(0,i.jsx)(aB,{})}),r&&(0,i.jsx)(Sr.qh,{exact:!0,path:Ps.CREATE_DELEGATION(":organizationId",":eventId",":options?"),children:(0,i.jsx)(hy,{})}),r&&(0,i.jsx)(Sr.qh,{exact:!0,path:Ps.EDIT_DELEGATION(":organizationId",":eventId",":delegationId"),children:(0,i.jsx)(gy,{})}),n&&(0,i.jsx)(Sr.qh,{exact:!0,path:hs.DELEGATION_CATEGORY_UPDATE({organizationId:":organizationId",eventId:":eventId",delegationCategoryId:":delegationCategoryId"}),children:(0,i.jsx)(EL,{})}),l&&(0,i.jsx)(Sr.qh,{path:Vi.FORM_ELEMENTS({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)(vE,{})}),l&&(0,i.jsx)(Sr.qh,{path:Vi.FORM_PARAMETERS_GENERAL({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)(qE,{})}),l&&(0,i.jsx)(Sr.qh,{path:Vi.FORM_PARAMETERS_DESIGN({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)(UE,{})}),l&&(0,i.jsx)(Sr.qh,{path:Vi.FORM_PARAMETERS_AVAILABILITIES({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)(_U,{})}),t.usePositions&&l&&(0,i.jsx)(Sr.qh,{path:Vi.FORM_PARAMETERS_MISSIONS({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)(CU,{})}),t.useAccreditations&&l&&e(Be.Accreditation)&&(0,i.jsx)(Sr.qh,{path:Vi.FORM_PARAMETERS_ACCREDITATIONS({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)(dU,{})}),l&&(0,i.jsx)(Sr.qh,{path:Vi.FORM_PARAMETERS_BROADCAST({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)(RE,{})}),l&&(0,i.jsx)(Sr.qh,{path:Vi.FORM_PARAMETERS_STATE({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)(ZE,{})}),l&&(0,i.jsx)(Sr.qh,{path:Vi.FORM_INTEGRATION({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)(JS,{})}),l&&(0,i.jsx)(Sr.qh,{path:Vi.FORM_EMAILS({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)(yE,{})}),l&&(0,i.jsx)(Sr.qh,{path:Vi.FORM_PREVIEW({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)(QS,{})}),r&&(0,i.jsx)(Sr.qh,{path:Ps.EVENT_DELEGATIONS_IMPORT(":organizationId",":eventId"),children:(0,i.jsx)(gL,{})}),u&&(0,i.jsx)(Sr.qh,{path:Ps.EVENT_VOLUNTEERS_IMPORT(":organizationId",":eventId"),children:(0,i.jsx)(hR,{})}),h&&(0,i.jsx)(Sr.qh,{path:xs.POSITION_IMPORT_CSV({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(UU,{})}),c&&(0,i.jsx)(Sr.qh,{path:Ps.EVENT_FILES_IMPORT(":organizationId",":eventId"),children:(0,i.jsx)(zS,{})}),c&&(0,i.jsx)(Sr.qh,{path:[QI.CREATE({organizationId:":organizationId",eventId:":eventId",delegationId:":delegationId"}),QI.CREATE({organizationId:":organizationId",eventId:":eventId"})],children:(0,i.jsx)(hz,{})}),m&&(0,i.jsx)(Sr.qh,{path:nv.CREATE({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(zR,{})}),m&&(0,i.jsx)(Sr.qh,{path:nv.UPDATE({organizationId:":organizationId",eventId:":eventId",workflowId:":workflowId"}),children:(0,i.jsx)(OR,{})}),(0,i.jsx)(Sr.qh,{children:(0,i.jsx)(jT,{children:(0,i.jsx)(yK,{})})})]})},AK=()=>{const{organizationId:e,eventId:t}=ti(),{data:n,loader:s}=Qn("query Event($organizationId: OrganizationId!, $eventId: EventId!) {\n event(id: $eventId) {\n id\n organizationId\n name\n languages\n usePositions\n useAccreditations\n useDelegations\n useForms\n useCampaigns\n useDocuments\n useWorkflows\n isWeezeventSynchronized\n\n accreditationsStats {\n numberOfWaitingAccreditation\n }\n\n assignmentsStats {\n numberOfWaitingAssignment\n numberOfPreAssigned\n }\n }\n\n user {\n ...UserPermissions\n }\n}\n",{organizationId:e,eventId:t},[Vs.UserPermissionsFragment]),{setSelectedEventId:o}=TI(),r=Tc(),a=(0,L.useMemo)(()=>n.user?function(e){return e.roles.some(e=>jI.includes(e.type))}(n.user):void 0,[n.user]);if((0,L.useEffect)(()=>(o(t),()=>{o()}),[t]),s)return s;{const e=n.event.assignmentsStats;return(0,i.jsx)(jb,{isEventAdmin:a,userPermissions:n.user,children:(0,i.jsx)(Ab,{event:n.event,numberOfWaitingAccreditations:n.event.accreditationsStats.numberOfWaitingAccreditation,numberOfWaitingAssigments:a?e.numberOfWaitingAssignment+e.numberOfPreAssigned:e.numberOfPreAssigned,children:r?(0,i.jsx)(IK,{}):(0,i.jsx)(kK,{})})})}};let wK=class extends Gl{documentInputService;constructor(e,t){super(e),this.documentInputService=t}emailSenderInputDefault(e){return{header:e?.header??this.documentInputService.documentInputDefault(),picture:e?.picture??this.documentInputService.documentInputDefault(),footer:e?.footer??this.documentInputService.documentInputDefault(),signature:e?.signature??"",name:e?.name??"",fromEmail:e?.fromEmail??"",fromName:e?.fromName??"",replyTo:e?.replyTo??"",eventsIds:e?.eventsIds??[],isOrganizationDefault:e?.isOrganizationDefault??!1}}emailSenderInputSchema(){return d.Ik().shape({header:this.documentInputService.documentInputSchemaNotRequired(),picture:this.documentInputService.documentInputSchemaNotRequired(),signature:d.Yj(),name:d.Yj().required(this.t("le_label_est_re_86986")),fromEmail:d.Yj().required(this.t("l_e_mail_de_l_56279")),fromName:d.Yj().required(this.t("le_nom_de_l_me_01331")),replyTo:d.Yj()})}createUpdateEmailSenderSchema(){return d.Ik().shape({emailSender:this.emailSenderInputSchema()})}};wK=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[qn,Gj])],wK);const SK=e=>{const{history:t,translate:n,params:{organizationId:s}}=vl(),{showNotification:o}=Ob(),r=Zn(wK),a=(0,L.useRef)(null),[l,d]=(0,L.useState)(e.initialValues.emailSender.isOrganizationDefault||so(e.initialValues.emailSender.eventsIds)),[c,u]=(0,L.useState)(e.initialValues.emailSender.eventsIds.concat(e.initialValues.emailSender.isOrganizationDefault?["community"]:[]));return(0,i.jsx)(kl,{customErrorRef:a,height:1,initialValues:e.initialValues,render:({handleSubmit:t,submitting:o,values:r})=>{return(0,i.jsx)(Lm,{button:e.isEdit&&(0,i.jsx)(zl,{isLoading:o,onClick:t,children:n("mettre_jour_l_14264")}),category:n("_metteur_d_e_ma_51878"),fallbackClosePath:Ps.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(s),heading:e.isEdit?(h=e.initialValues.emailSender,m(h.fromName)?`${h.fromName} (${h.fromEmail})`:h.fromEmail):n("nouvel_metteur_58381"),children:(0,i.jsxs)(Mm,{ref:a,children:[(0,i.jsx)(jl,{}),(0,i.jsx)(Vm,{hideToggle:!0,initialIsOpen:!0,heading:n("informations_su_10889"),children:(0,i.jsxs)(Ba,{direction:"column",gap:"4",width:1,children:[(0,i.jsx)(Vl,{label:"Label",name:"emailSender.name"}),(0,i.jsx)(Vl,{hint:n("les_e_mails_ser_70662"),label:n("nom_de_l_mette_49412"),name:"emailSender.fromName"}),(0,i.jsx)(Vl,{hint:n("les_e_mails_ser_62925"),isEmail:!0,label:n("e_mail_de_l_me_98374"),name:"emailSender.fromEmail"}),(0,i.jsx)(Vl,{hint:n("cette_adresse_r_36038",r.emailSender.fromEmail),isEmail:!0,label:(0,i.jsx)(Zv,{children:n("adresse_de_r_po_86181")}),name:"emailSender.replyTo"}),(0,i.jsx)(Yj,{accept:yv.Images,acl:"public-read",hint:n("chaque_e_mail_c_30386"),label:n("en_t_te_11987"),organizationId:s,prefix:"emailSender.header."}),(0,i.jsx)(CC,{label:n("photo_de_profil_08618"),organizationId:s,prefix:"emailSender.picture."}),(0,i.jsx)(rb,{label:n("signature_67521"),name:"emailSender.signature"}),(0,i.jsx)(Yj,{accept:yv.Images,acl:"public-read",hint:n("chaque_e_mail_c_65078"),label:n("bas_de_page_86491"),organizationId:s,prefix:"emailSender.footer."}),(0,i.jsxs)(Ba,{direction:"column",gap:"3",children:[(0,i.jsx)(_c,{state:l?"checked":"unchecked",onClick:e=>{d("checked"===e)},children:n("utiliser_cet_m_47949")}),l&&(0,i.jsxs)(Ba,{children:[(0,i.jsx)(Ya,{width:"6"}),(0,i.jsxs)(yc,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,values:c,onChange:u,children:[(0,i.jsx)("option",{value:"community",children:n("communaut_20896")}),e.events.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))]})]})]})]})}),(0,i.jsx)(Ya,{height:"5"}),(0,i.jsx)(Bm,{children:(0,i.jsx)(zl,{isLoading:o,textAlign:"center",onClick:t,children:e.isEdit?n("mettre_jour_l_14264"):n("cr_er_l_metteu_36451")})})]})});var h},schema:r.createUpdateEmailSenderSchema(),width:1,onSubmit:async i=>{const r={...i.emailSender,eventsIds:c.filter(e=>"community"!==e),isOrganizationDefault:c.includes("community")};await e.mutate(r),o(e.isEdit?n("l_metteur_a_t_48335"):n("l_metteur_a_t_67653")),t.push(Ps.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(s))}})},EK=()=>{const{params:{organizationId:e}}=vl(),{data:t,loader:n}=oa({organizationId:e}),s=Zn(wK),{mutate:o}=function(e={}){return ei("mutation EmailSenderCreate($organizationId: OrganizationId!, $emailSender: EmailsSenderInput!) {\n emailSenderCreate(organizationId: $organizationId, emailSender: $emailSender) {\n id\n }\n}\n",e)}();return n||(0,i.jsx)(SK,{events:t.organization.events.nodes,initialValues:{emailSender:s.emailSenderInputDefault()},isEdit:!1,mutate:t=>o({organizationId:e,emailSender:t})})},TK=()=>{const{params:{organizationId:e,emailSenderId:t}}=vl(),n=Zn(wK),{data:s,loader:o}=Qn("query EmailSenderToEdit($organizationId: OrganizationId!, $emailSenderId: EmailsSenderId!) {\n organization(id: $organizationId) {\n emailSender(id: $emailSenderId) {\n id\n name\n signature\n fromEmail\n fromName\n replyTo\n eventsIds\n isOrganizationDefault\n isValidToSendEmail\n\n header {\n acl\n name\n key\n }\n\n picture {\n acl\n name\n key\n }\n\n footer {\n acl\n name\n key\n }\n }\n\n events {\n nodes {\n id\n name\n }\n }\n }\n}\n",{organizationId:e,emailSenderId:t},[]),{mutate:r}=function(e={}){return ei("mutation EmailSenderUpdate(\n $organizationId: OrganizationId!\n $emailSenderId: EmailsSenderId!\n $emailSender: EmailsSenderInput!\n) {\n emailSenderUpdate(\n organizationId: $organizationId\n emailSenderId: $emailSenderId\n emailSender: $emailSender\n ) {\n id\n }\n}\n",e)}();return o||(0,i.jsx)(SK,{events:s.organization.events.nodes,initialValues:{emailSender:n.emailSenderInputDefault(s.organization.emailSender)},isEdit:!0,mutate:n=>r({organizationId:e,emailSenderId:t,emailSender:n})})},zK=()=>{const{translate:e,params:{organizationId:t,emailSenderId:n}}=vl(),{data:s,loader:o}=Qn("query EmailSenderPreview($organizationId: OrganizationId!, $emailSenderId: EmailsSenderId!) {\n organization(id: $organizationId) {\n emailSender(id: $emailSenderId) {\n name\n from\n preview\n }\n }\n}\n",{organizationId:t,emailSenderId:n},[]),r=(0,L.useMemo)(()=>s.organization?s.organization.emailSender.from:"-",[s.organization]);return(0,i.jsx)(Lm,{category:e("aper_u_d_un_me_46930"),fallbackClosePath:Ps.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(t),heading:r,children:o||(0,i.jsx)(Ar,{css:{overflowY:"auto"},height:1,width:1,children:(0,i.jsx)(Aj,{content:s.organization.emailSender.preview,from:s.organization.emailSender.from,subject:e("e_mail_test_me_23293")})})})},OK=_r("h3",{color:"$gray800",fontWeight:"$bold",margin:"$3 $4"}),RK=_r("button",{background:"none",border:"none",color:"$error700",fontWeight:"$semiBold"}),$K=()=>{const{organizationId:e}=ti(),t=ni(),{mutate:n}=ga(),s=Xn(),o=()=>{t.push(Ps.ORGANIZATION_PARAMETERS(e))};return(0,i.jsx)(xH,{onClose:o,children:(0,i.jsxs)(Ba,{align:"center",direction:"column",children:[(0,i.jsx)(sC,{color:"error",icon:"user-slash"}),(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(OK,{children:s("suppression_de_67160")}),(0,i.jsx)(Ar,{color:"gray500",textAlign:"center",children:s("souhaitez_vous_30775")}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(zl,{onClick:o,children:s("non_je_ne_souh_99960")}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(RK,{onClick:async()=>{await n({}),X()},children:s("oui_je_souhait_87268")})]})})},DK=({icon:e,children:t,onClick:n})=>(0,i.jsxs)(Ba,{align:"center",css:{color:"$gray800",fontWeight:"$medium"},gap:"5",onClick:n,children:[(0,i.jsx)(nl,{icon:e}),(0,i.jsx)("span",{children:t})]}),PK=_r(Ba,{background:"$white",borderRadius:"$2",boxShadow:"$sm",gap:"$6",padding:"$4 $3"}),FK=_r("h3",{color:"$gray500",fontSize:"$textSm",margin:0}),MK=_r(Ba,{backgroundColor:"$gray50",padding:"$6 $3",height:"100%"}),NK=_r("h1",{color:"$gray800",fontSize:"$displaySm",fontWeight:"$semiBold",margin:0}),LK=({organization:e,user:t})=>{const{history:n,translate:s}=vl();return(0,i.jsxs)(MK,{direction:"column",gap:"6",children:[(0,i.jsx)(NK,{children:s("profil_14444")}),(0,i.jsxs)(Ba,{align:"center",gap:"4",children:[(0,i.jsx)(sp,{email:t.email,image:t.userInfo.picture?.url,name:t.userInfo.name,size:64}),(0,i.jsx)(Fq,{size:64,userInfo:{email:t.email,...t.userInfo}})]}),(0,i.jsx)(PK,{direction:"column",children:(0,i.jsxs)(Ba,{align:"center",gap:"3",justify:"between",children:[(0,i.jsx)(Ar,{css:{color:"$gray800",fontWeight:"$medium"},children:e.name}),(0,i.jsx)(zl,{onClick:()=>{n.push(Ps.ORGANIZATION_PARAMETERS_ORGANIZATION_SWITCH(e.id))},children:s("changer_74000")})]})}),(0,i.jsxs)(Ba,{direction:"column",gap:"2",children:[(0,i.jsx)(FK,{children:s("profil_14444")}),(0,i.jsx)(PK,{direction:"column",children:(0,i.jsx)(DK,{icon:"user-gear",onClick:()=>{n.push(Ps.ORGANIZATION_PARAMETERS_PROFILE(e.id))},children:s("informations_pe_37892")})})]}),(0,i.jsxs)(Ba,{direction:"column",gap:"2",children:[(0,i.jsx)(FK,{children:s("g_n_ral_64953")}),(0,i.jsxs)(PK,{direction:"column",children:[(0,i.jsx)(DK,{icon:"shield",onClick:()=>{window.open(kd(jd(t?.language,new URL(location.href).searchParams)),"_blank")},children:s("cgu_51460")}),(0,i.jsx)(DK,{icon:"circle-question",onClick:()=>{window.open("https://support.weezevent.com/fr/weezcrew","_blank")},children:s("aide_et_support_49790")})]})]}),(0,i.jsxs)(PK,{direction:"column",children:[(0,i.jsx)(DK,{icon:"arrow-left-from-line",onClick:X,children:s("se_d_connecter_74151")}),(0,i.jsx)(DK,{icon:"user-xmark",onClick:()=>{n.push(Ps.ORGANIZATION_PARAMETERS_DELETE_ACCOUNT(e.id))},children:s("supprimer_mon_c_07051")})]})]})},BK=({organizations:e})=>{const{organizationId:t}=ti(),[n,s]=(0,L.useState)(t),o=Xn(),r=ni();return(0,i.jsxs)(Ba,{css:{margin:"0 $4 $7 $4"},direction:"column",children:[(0,i.jsx)(Ba,{direction:"column",gap:"4",children:e.map(e=>(0,i.jsx)(JR,{state:e.id===n?"checked":"unchecked",onClick:()=>s(e.id),children:e.name},e.id))}),(0,i.jsx)(Ya,{height:7}),(0,i.jsx)(zl,{onClick:()=>{r.push(Ps.ORGANIZATION_PARAMETERS(n))},children:o("s_lectionner_l_18914")})]})},VK=_r("h3",{color:"$gray800",fontWeight:"$bold",margin:"$3 $4"}),UK=()=>{const{loader:e,data:t}=ua({}),{organization:n}=TI(),s=Xn(),o=ni();return(0,i.jsxs)(xH,{onClose:()=>{o.push(Ps.ORGANIZATION_PARAMETERS(n.id))},children:[(0,i.jsx)(VK,{children:s("liste_de_vos_or_87919")}),e||(0,i.jsx)(BK,{organizations:t.organizations})]})},WK=({inputName:e})=>{const t=Xn(),n=Bc();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ba,{css:{gap:"$6","@tablet":{gap:"$4","> *":{flexGrow:1,width:"auto"}}},wrap:"wrap",children:[(0,i.jsx)(Vl,{autoComplete:"given-name",label:t("pr_nom_66988"),name:`${e}fields.firstName`}),(0,i.jsx)(Vl,{autoComplete:"family-name",label:t("last_name"),name:`${e}fields.lastName`})]}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(Vl,{autoComplete:"email",isEmail:!0,label:t("e_mail_13869"),name:`${e}email`}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(Qj,{autoComplete:"language",label:t("Language"),name:`${e}fields.language`,children:n(Id)}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(lI,{label:t("Phone"),prefix:`${e}fields.phone.`})]})},GK=_r(Ba,{backgroundColor:"$gray900",height:"110px",marginBottom:"$11","> *":{transform:"translateY(50%)",boxShadow:"$md"}}),HK=()=>{const{user:e}=TI();return(0,i.jsx)(GK,{align:"end",justify:"center",children:(0,i.jsx)(sp,{email:e.email,image:e.userInfo.picture?.url,name:e.userInfo.name,size:96})})},qK=()=>{const{organizationId:e}=ti(),{data:t,loader:n}=qo({organizationId:e}),s=Zn(CT),o=Zn(Ua),{user:r}=ai(),{mutate:a,isLoading:l}=Ko(),d=Xn();return n||(0,i.jsx)(kl,{initialValues:{userInfo:s.userInfoProfileInputDefault(t.user)},render:({handleSubmit:e})=>(0,i.jsxs)(Ba,{direction:"column",children:[(0,i.jsx)(HK,{}),(0,i.jsxs)(yH,{children:[(0,i.jsx)(WK,{inputName:"userInfo."}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(zl,{isLoading:l,textAlign:"center",onClick:e,children:d("enregistrer_06519")})]})]}),validate:o.validateForForm(s.updateProfileSchema()),onSubmit:async e=>{const{userProfileUpdate:{email:n,language:i}}=await a({userId:r.id,userInfoId:t.user.userInfo.id,userInfo:e.userInfo});r.email!==n?X():r.language!==i&&location.reload()}})},KK=_r("h1",{color:"$gray900",fontSize:"$textMd",fontWeight:"$medium"}),YK=()=>{const{organizationId:e}=ti(),t=ni(),n=Xn();return(0,i.jsxs)(wH,{children:[(0,i.jsx)(AH,{back:()=>{t.push(Ps.ORGANIZATION_PARAMETERS(e))},children:(0,i.jsx)(cq,{children:(0,i.jsx)(KK,{children:n("informations_pe_37892")})})}),(0,i.jsx)(qK,{})]})},ZK=()=>{const{organization:e,user:t}=TI();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Sr.dO,{children:[(0,i.jsx)(Sr.qh,{path:Ps.ORGANIZATION_PARAMETERS_PROFILE(":organizationId"),children:(0,i.jsx)(YK,{})}),so(e.events.nodes)&&(0,i.jsx)(Sr.qh,{children:(0,i.jsx)(rH,{eventId:e.events.nodes[0].id,user:t,children:(0,i.jsx)(LK,{organization:e,user:t})})})]}),(0,i.jsx)(Sr.dO,{children:(0,i.jsx)(Sr.qh,{path:Ps.ORGANIZATION_PARAMETERS_ORGANIZATION_SWITCH(":organizationId"),children:(0,i.jsx)(UK,{})})}),(0,i.jsx)(Sr.dO,{children:(0,i.jsx)(Sr.qh,{path:Ps.ORGANIZATION_PARAMETERS_DELETE_ACCOUNT(":organizationId"),children:(0,i.jsx)($K,{})})})]})};var XK,JK;!function(e){e.AccreditationCategoryCreate="AccreditationCategoryCreate",e.AccreditationCategoryDelete="AccreditationCategoryDelete",e.AccreditationCategoryDuplicate="AccreditationCategoryDuplicate",e.AccreditationCategoryUpdate="AccreditationCategoryUpdate",e.AccreditationCreate="AccreditationCreate",e.AccreditationDuplicate="AccreditationDuplicate",e.AccreditationSlotDelete="AccreditationSlotDelete",e.AccreditationSlotUpdate="AccreditationSlotUpdate",e.AccreditationUpdate="AccreditationUpdate",e.AccreditationsEmailsEstimate="AccreditationsEmailsEstimate",e.AccreditationsMassDelete="AccreditationsMassDelete",e.AccreditationsMassEdit="AccreditationsMassEdit",e.AccreditationsSlotsUsersInfosCheckIn="AccreditationsSlotsUsersInfosCheckIn",e.AssignmentsEmailsEstimate="AssignmentsEmailsEstimate",e.BackofficeEventUnarchive="BackofficeEventUnarchive",e.BackofficeInvoiceMarkAsPaid="BackofficeInvoiceMarkAsPaid",e.BackofficeInvoiceMarkAsRefunded="BackofficeInvoiceMarkAsRefunded",e.BackofficeOrganizationUpdate="BackofficeOrganizationUpdate",e.BackofficeOrganizationUserAdd="BackofficeOrganizationUserAdd",e.BackofficeOrganizationUserRemove="BackofficeOrganizationUserRemove",e.CampaignCreate="CampaignCreate",e.CampaignDelete="CampaignDelete",e.CampaignDuplicate="CampaignDuplicate",e.CampaignEstimate="CampaignEstimate",e.CampaignSend="CampaignSend",e.CampaignUpdate="CampaignUpdate",e.CommentCreate="CommentCreate",e.CommentDelete="CommentDelete",e.CommentUpdate="CommentUpdate",e.CreateEvent="CreateEvent",e.CustomDocumentCreate="CustomDocumentCreate",e.CustomDocumentDelete="CustomDocumentDelete",e.CustomDocumentDuplicate="CustomDocumentDuplicate",e.CustomDocumentUpdate="CustomDocumentUpdate",e.CustomFieldCategoryCreate="CustomFieldCategoryCreate",e.CustomFieldCategoryDelete="CustomFieldCategoryDelete",e.CustomFieldCategoryUpdate="CustomFieldCategoryUpdate",e.CustomFieldCreate="CustomFieldCreate",e.CustomFieldDuplicate="CustomFieldDuplicate",e.CustomFieldUpdate="CustomFieldUpdate",e.CustomFieldsMassDelete="CustomFieldsMassDelete",e.CustomFieldsMassEdit="CustomFieldsMassEdit",e.DelegationCategoryCreate="DelegationCategoryCreate",e.DelegationCategoryDelete="DelegationCategoryDelete",e.DelegationCategoryDuplicate="DelegationCategoryDuplicate",e.DelegationCategoryUpdate="DelegationCategoryUpdate",e.DelegationCreate="DelegationCreate",e.DelegationDuplicate="DelegationDuplicate",e.DelegationFormInvite="DelegationFormInvite",e.DelegationUpdate="DelegationUpdate",e.DelegationUpdateFields="DelegationUpdateFields",e.DelegationsCategoriesMassLeadersEdit="DelegationsCategoriesMassLeadersEdit",e.DelegationsExport="DelegationsExport",e.DelegationsImport="DelegationsImport",e.DelegationsImportResult="DelegationsImportResult",e.DelegationsMassDelete="DelegationsMassDelete",e.DelegationsMassEdit="DelegationsMassEdit",e.DelegationsMassLeadersEdit="DelegationsMassLeadersEdit",e.DelegationsMassMove="DelegationsMassMove",e.DomainDkimVerificationRetry="DomainDkimVerificationRetry",e.EmailFormInviteSend="EmailFormInviteSend",e.EmailResend="EmailResend",e.EmailSenderCreate="EmailSenderCreate",e.EmailSenderDelete="EmailSenderDelete",e.EmailSenderDuplicate="EmailSenderDuplicate",e.EmailSenderUpdate="EmailSenderUpdate",e.EmailSenderVerificationResend="EmailSenderVerificationResend",e.EmailTemplateUpdate="EmailTemplateUpdate",e.EmailUpdate="EmailUpdate",e.EventDocumentUpdate="EventDocumentUpdate",e.EventDocumentsExport="EventDocumentsExport",e.EventDocumentsExportResult="EventDocumentsExportResult",e.EventDuplicate="EventDuplicate",e.EventInvite="EventInvite",e.EventLayerUpdate="EventLayerUpdate",e.EventOrganizationCreate="EventOrganizationCreate",e.EventProfilePrivateFieldsUpdate="EventProfilePrivateFieldsUpdate",e.EventUpdate="EventUpdate",e.EventWeezeventUpdate="EventWeezeventUpdate",e.EventsImport="EventsImport",e.EventsImportResult="EventsImportResult",e.EventsMassArchive="EventsMassArchive",e.EventsMassEdit="EventsMassEdit",e.ExportResult="ExportResult",e.FilesImport="FilesImport",e.FilesImportResult="FilesImportResult",e.FormCreate="FormCreate",e.FormDelete="FormDelete",e.FormDuplicate="FormDuplicate",e.FormElementsUpdate="FormElementsUpdate",e.FormParametersAccreditationsUpdate="FormParametersAccreditationsUpdate",e.FormParametersAvailabilitiesUpdate="FormParametersAvailabilitiesUpdate",e.FormParametersBroadcastUpdate="FormParametersBroadcastUpdate",e.FormParametersDesignUpdate="FormParametersDesignUpdate",e.FormParametersGeneralUpdate="FormParametersGeneralUpdate",e.FormParametersMissionsUpdate="FormParametersMissionsUpdate",e.FormParametersStateUpdate="FormParametersStateUpdate",e.FormRegister="FormRegister",e.LoginCodeEmailCreate="LoginCodeEmailCreate",e.OrganizationCreate="OrganizationCreate",e.OrganizationDelegationSpaceSettingsUpdate="OrganizationDelegationSpaceSettingsUpdate",e.OrganizationEventsShowcaseSettingsUpdate="OrganizationEventsShowcaseSettingsUpdate",e.OrganizationInvite="OrganizationInvite",e.OrganizationMembersSpaceSettingsUpdate="OrganizationMembersSpaceSettingsUpdate",e.OrganizationProfilePrivateFieldsUpdate="OrganizationProfilePrivateFieldsUpdate",e.OrganizationSpaceDesignUpdate="OrganizationSpaceDesignUpdate",e.OrganizationUpdateInfos="OrganizationUpdateInfos",e.PositionCategoryCreate="PositionCategoryCreate",e.PositionCategoryDelete="PositionCategoryDelete",e.PositionCategoryDescriptionUpdate="PositionCategoryDescriptionUpdate",e.PositionCategoryDuplicate="PositionCategoryDuplicate",e.PositionCategoryUpdate="PositionCategoryUpdate",e.PositionCreate="PositionCreate",e.PositionDuplicate="PositionDuplicate",e.PositionSlotCreate="PositionSlotCreate",e.PositionSlotDelete="PositionSlotDelete",e.PositionSlotUpdate="PositionSlotUpdate",e.PositionUpdate="PositionUpdate",e.PositionsCategoriesMassLeadersEdit="PositionsCategoriesMassLeadersEdit",e.PositionsCreate="PositionsCreate",e.PositionsImport="PositionsImport",e.PositionsImportResult="PositionsImportResult",e.PositionsMassConditions="PositionsMassConditions",e.PositionsMassDelete="PositionsMassDelete",e.PositionsMassEdit="PositionsMassEdit",e.PositionsMassLeadersEdit="PositionsMassLeadersEdit",e.PositionsSlotsUsersInfosCheckIn="PositionsSlotsUsersInfosCheckIn",e.RoleCreate="RoleCreate",e.RoleDelete="RoleDelete",e.RoleDuplicate="RoleDuplicate",e.RoleUpdate="RoleUpdate",e.SegmentCreate="SegmentCreate",e.SegmentDelete="SegmentDelete",e.SegmentDuplicate="SegmentDuplicate",e.SegmentFolderCreate="SegmentFolderCreate",e.SegmentFolderDelete="SegmentFolderDelete",e.SegmentFolderMoveDown="SegmentFolderMoveDown",e.SegmentFolderMoveUp="SegmentFolderMoveUp",e.SegmentFolderUpdateName="SegmentFolderUpdateName",e.SegmentMoveDown="SegmentMoveDown",e.SegmentMoveFolder="SegmentMoveFolder",e.SegmentMoveUp="SegmentMoveUp",e.SegmentUpdate="SegmentUpdate",e.SegmentUpdateMetadata="SegmentUpdateMetadata",e.SegmentsFoldersReorder="SegmentsFoldersReorder",e.SendAccreditationsEmails="SendAccreditationsEmails",e.SendAssignmentsEmails="SendAssignmentsEmails",e.SkidataConnectionInfoSeaonEventAdd="SkidataConnectionInfoSeaonEventAdd",e.SkidataConnectionInfoSeaonEventDelete="SkidataConnectionInfoSeaonEventDelete",e.SkidataConnectionInfoSynchronizedEventAdd="SkidataConnectionInfoSynchronizedEventAdd",e.SkidataConnectionInfoSynchronizedEventDelete="SkidataConnectionInfoSynchronizedEventDelete",e.SkidataConnectionInfosDelete="SkidataConnectionInfosDelete",e.SkidataConnectionInfosUpsert="SkidataConnectionInfosUpsert",e.SkidataSynchronize="SkidataSynchronize",e.TagCreate="TagCreate",e.TagDelete="TagDelete",e.TagUpdateName="TagUpdateName",e.TeamAssign="TeamAssign",e.TeamAssignmentRefuse="TeamAssignmentRefuse",e.TextMessageRepliesRead="TextMessageRepliesRead",e.TextMessageSend="TextMessageSend",e.TraceCreate="TraceCreate",e.TraceDelete="TraceDelete",e.TraceUpdate="TraceUpdate",e.TranslationUpdate="TranslationUpdate",e.UserAccessCreate="UserAccessCreate",e.UserAccessDelete="UserAccessDelete",e.UserAccessUpdate="UserAccessUpdate",e.UserCreate="UserCreate",e.UserDelete="UserDelete",e.UserInfoAccreditationsUpdate="UserInfoAccreditationsUpdate",e.UserInfoAdminCreate="UserInfoAdminCreate",e.UserInfoAdminDelete="UserInfoAdminDelete",e.UserInfoAndTermsUpdate="UserInfoAndTermsUpdate",e.UserInfoPositionsUpdate="UserInfoPositionsUpdate",e.UserInfoSlotsUpdate="UserInfoSlotsUpdate",e.UserInfoUpdate="UserInfoUpdate",e.UserInfoUpdateField="UserInfoUpdateField",e.UserProfileUpdate="UserProfileUpdate",e.UserRolesDelete="UserRolesDelete",e.UsersInfosExport="UsersInfosExport",e.UsersInfosMassAddEvent="UsersInfosMassAddEvent",e.UsersInfosMassCampaignSend="UsersInfosMassCampaignSend",e.UsersInfosMassDelegationAdd="UsersInfosMassDelegationAdd",e.UsersInfosMassDelegationDelete="UsersInfosMassDelegationDelete",e.UsersInfosMassDelete="UsersInfosMassDelete",e.UsersInfosMassEdit="UsersInfosMassEdit",e.UsersInfosMassFormAdd="UsersInfosMassFormAdd",e.UsersInfosMassFormRemove="UsersInfosMassFormRemove",e.UsersInfosMerge="UsersInfosMerge",e.VolunteerRegistrationAssignmentRefuse="VolunteerRegistrationAssignmentRefuse",e.VolunteerRegistrationDuplicate="VolunteerRegistrationDuplicate",e.VolunteerRegistrationTicketIdRegenerate="VolunteerRegistrationTicketIdRegenerate",e.VolunteerRegistrationUpdate="VolunteerRegistrationUpdate",e.VolunteerRegistrationUpdateField="VolunteerRegistrationUpdateField",e.VolunteersExport="VolunteersExport",e.VolunteersImport="VolunteersImport",e.VolunteersImportResult="VolunteersImportResult",e.VolunteersRegistrationsAccreditationsValidate="VolunteersRegistrationsAccreditationsValidate",e.VolunteersRegistrationsAdminAdd="VolunteersRegistrationsAdminAdd",e.VolunteersRegistrationsMassAccredit="VolunteersRegistrationsMassAccredit",e.VolunteersRegistrationsMassAccreditationStateUpdate="VolunteersRegistrationsMassAccreditationStateUpdate",e.VolunteersRegistrationsMassAssign="VolunteersRegistrationsMassAssign",e.VolunteersRegistrationsMassDelegationAdd="VolunteersRegistrationsMassDelegationAdd",e.VolunteersRegistrationsMassDelete="VolunteersRegistrationsMassDelete",e.VolunteersRegistrationsMassFormAdd="VolunteersRegistrationsMassFormAdd",e.VolunteersRegistrationsMassFormRemove="VolunteersRegistrationsMassFormRemove",e.VolunteersRegistrationsMassPreAssign="VolunteersRegistrationsMassPreAssign",e.VolunteersRegistrationsMassStateUpdate="VolunteersRegistrationsMassStateUpdate",e.VolunteersRegistrationsMassWishedAccreditationsUpdate="VolunteersRegistrationsMassWishedAccreditationsUpdate",e.WorkflowCreate="WorkflowCreate",e.WorkflowDuplicate="WorkflowDuplicate",e.WorkflowExecute="WorkflowExecute",e.WorkflowUpdate="WorkflowUpdate",e.WorkflowssMassDelete="WorkflowssMassDelete"}(XK||(XK={})),function(e){e.AccreditationsEmailsEstimate="AccreditationsEmailsEstimate",e.AssignmentsEmailsEstimate="AssignmentsEmailsEstimate",e.BackofficeEventUnarchive="BackofficeEventUnarchive",e.BackofficeInvoiceMarkAsPaid="BackofficeInvoiceMarkAsPaid",e.BackofficeInvoiceMarkAsRefunded="BackofficeInvoiceMarkAsRefunded",e.BackofficeOrganizationUpdate="BackofficeOrganizationUpdate",e.BackofficeOrganizationUserAdd="BackofficeOrganizationUserAdd",e.BackofficeOrganizationUserRemove="BackofficeOrganizationUserRemove",e.CampaignEstimate="CampaignEstimate",e.DelegationsExport="DelegationsExport",e.DelegationsImportResult="DelegationsImportResult",e.DomainDkimVerificationRetry="DomainDkimVerificationRetry",e.EmailFormInviteSend="EmailFormInviteSend",e.EmailResend="EmailResend",e.EmailSenderVerificationResend="EmailSenderVerificationResend",e.EventDocumentsExport="EventDocumentsExport",e.EventDocumentsExportResult="EventDocumentsExportResult",e.EventLayerUpdate="EventLayerUpdate",e.EventProfilePrivateFieldsUpdate="EventProfilePrivateFieldsUpdate",e.EventWeezeventUpdate="EventWeezeventUpdate",e.ExportResult="ExportResult",e.FormRegister="FormRegister",e.LoginCodeEmailCreate="LoginCodeEmailCreate",e.OrganizationProfilePrivateFieldsUpdate="OrganizationProfilePrivateFieldsUpdate",e.PositionsImportResult="PositionsImportResult",e.SegmentFolderMoveDown="SegmentFolderMoveDown",e.SegmentFolderMoveUp="SegmentFolderMoveUp",e.SegmentMoveDown="SegmentMoveDown",e.SegmentMoveUp="SegmentMoveUp",e.SegmentsFoldersReorder="SegmentsFoldersReorder",e.SkidataConnectionInfoSeaonEventAdd="SkidataConnectionInfoSeaonEventAdd",e.SkidataConnectionInfoSeaonEventDelete="SkidataConnectionInfoSeaonEventDelete",e.SkidataConnectionInfoSynchronizedEventAdd="SkidataConnectionInfoSynchronizedEventAdd",e.SkidataConnectionInfoSynchronizedEventDelete="SkidataConnectionInfoSynchronizedEventDelete",e.SkidataSynchronize="SkidataSynchronize",e.TextMessageRepliesRead="TextMessageRepliesRead",e.TranslationUpdate="TranslationUpdate",e.UserCreate="UserCreate",e.UserDelete="UserDelete",e.UserInfoAdminDelete="UserInfoAdminDelete",e.UserInfoAndTermsUpdate="UserInfoAndTermsUpdate",e.UsersInfosMassDelegationDelete="UsersInfosMassDelegationDelete",e.UserProfileUpdate="UserProfileUpdate",e.UsersInfosExport="UsersInfosExport",e.VolunteersExport="VolunteersExport",e.VolunteersImportResult="VolunteersImportResult"}(JK||(JK={}));const QK=e=>{const t=Zn(Jc);return(0,i.jsxs)(Mc,{children:[(0,i.jsxs)(Oc,{align:"center",gap:"3",children:[(0,i.jsx)(Ba,{align:"center",css:{background:"$primary300",borderRadius:"32px",color:"$primary600",height:"32px",width:"32px"},justify:"center",children:(0,i.jsx)(nl,{icon:e.activity.icon})}),(0,i.jsx)(Ar,{font:"gray900 textSm medium",children:e.activity.text})]}),(0,i.jsx)(Oc,{children:t.toLocaleString(e.activity.date.toLocal(),eo.DateTime)})]})},eY=()=>{const{translate:e,params:{organizationId:t}}=vl(),[n,s]=(0,L.useState)([]),[o,r]=(0,L.useState)([]),[a,l]=(0,L.useState)(Gs.c9.invalid("Invalid")),[d,c]=(0,L.useState)(0),{data:u,isLoading:h}=Qn("query Activities(\n $organizationId: OrganizationId!\n $operations: [String!]\n $eventsIds: [EventId!]\n $date: Date\n $offset: Int\n) {\n organization(id: $organizationId) {\n events {\n nodes {\n id\n name\n }\n }\n\n activities(\n operations: $operations\n eventsIds: $eventsIds\n date: $date\n limit: 25\n offset: $offset\n ) {\n nodes {\n date\n icon\n text\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{organizationId:t,operations:n,eventsIds:o,date:a,offset:d},[]),{numberOfPages:m,totalCount:g}=Su(u.organization?.activities),p=(0,L.useMemo)(()=>{const t=Object.keys(JK);return Object.keys(XK).filter(e=>!t.includes(e)).map(t=>(0,i.jsx)("option",{value:t,children:e(t)},t))},[]);return(0,i.jsxs)(dj,{css:{overflowY:"auto"},children:[(0,i.jsx)(lj,{children:(0,i.jsx)(Ar,{font:"gray900 displayXs semiBold",children:e("activit_95747")})}),(0,i.jsx)(aj,{children:(0,i.jsx)(Lc,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ar,{width:320,children:(0,i.jsx)(yc,{isSearchVisible:!0,multiple:!0,placeholder:e("op_ration_25453"),values:n,onChange:s,children:p})}),(0,i.jsx)(Ar,{width:320,children:(0,i.jsx)(yc,{isSearchVisible:!0,multiple:!0,placeholder:e("_v_nement_22345"),values:o,onChange:r,children:(u.organization?.events.nodes??[]).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})}),(0,i.jsx)(Ar,{width:200,children:(0,i.jsx)(Mu,{value:a,onChange:l})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Gc,{children:e("Description")}),(0,i.jsx)(Gc,{children:e("Date")})]}),numberOfPages:m,offset:d,rows:h?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Hc,{bx:!0}),(0,i.jsx)(Hc,{bx:!0}),(0,i.jsx)(Hc,{bx:!0})]}):u.organization.activities.nodes.map((e,t)=>(0,i.jsx)(QK,{activity:e},t)),setOffset:c,totalCount:g})})]})},tY=e=>{const{translate:t}=vl(),[n,s]=(0,L.useState)(!1),[o,r]=(0,L.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Yc,{children:[(0,i.jsx)(Kd,{icon:"pen",onClick:()=>{s(!0)},children:t("renommer_42135")}),(0,i.jsx)(Kd,{color:"red",icon:"trash-can",onClick:()=>{r(!0)},children:t("supprimer_43083")})]}),n&&(0,i.jsx)(XP,{accreditationCategory:e.accreditationCategory,eventId:e.accreditationCategory.eventId,onClose:()=>{s(!1)},onSuccess:e.reload}),o&&(0,i.jsx)(jN,{accreditationCategory:e.accreditationCategory,eventId:e.accreditationCategory.eventId,onClose:()=>{r(!1)},onSuccess:e.reload})]})},nY=()=>{const{translate:e,params:{organizationId:t}}=vl(),{canOrganizationParamEdit:n}=DS(),[s,o,r]=Wc(""),[a,l]=(0,L.useState)(-1),[d,c]=(0,L.useState)(0),{data:u,isLoading:h,reload:g}=Qn("query OrganizationCategoriesAccreditations(\n $organizationId: OrganizationId!\n $name: String\n $eventId: EventId\n $offset: Int\n) {\n organization(id: $organizationId) {\n events {\n nodes {\n id\n name\n }\n }\n\n accreditationsCategories(name: $name, eventId: $eventId, offset: $offset, limit: 25) {\n nodes {\n id\n eventId\n name\n numberOfAccreditations\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{organizationId:t,name:m(o)?o:void 0,eventId:-1!==a?a:void 0,offset:d},[]);const{numberOfPages:p,totalCount:f}=Su(u.organization?.accreditationsCategories),_=(0,L.useMemo)(()=>(0,uc.A)(u.organization?.events.nodes??[],e=>e.name.toLowerCase()),[u.organization]),x=(0,L.useMemo)(()=>Object.fromEntries(_.map(e=>[e.id,e.name])),[_]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(Lc,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ar,{width:200,children:(0,i.jsxs)($u,{shouldParseAsInt:!0,value:a,onChange:e=>{l(e)},children:[(0,i.jsx)("option",{value:"-1",children:e("tous_les_v_nem_16033")}),_.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))]})}),(0,i.jsx)(Ar,{width:320,children:(0,i.jsx)(Bl,{icon:"magnifying-glass",placeholder:e("rechercher_une_66722"),value:s,onChange:r})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Gc,{children:e("nom_de_la_cat_g_03860")}),(0,i.jsx)(Gc,{children:e("_v_nement_22345")}),(0,i.jsx)(Gc,{children:e("nombre_d_utilis_58389")}),n&&(0,i.jsx)(Gc,{width:100})]}),numberOfPages:p,offset:d,rows:h?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Hc,{bx:!0}),(0,i.jsx)(Hc,{bx:!0}),(0,i.jsx)(Hc,{bx:!0})]}):u.organization.accreditationsCategories.nodes.map(e=>(0,i.jsxs)(Mc,{children:[(0,i.jsx)(Oc,{children:(0,i.jsx)(Zc,{to:is.ACCREDITATION_CATEGORY({organizationId:t,eventId:e.eventId,accreditationCategoryId:e.id}),children:e.name})}),(0,i.jsx)(Oc,{children:x[e.eventId]??""}),(0,i.jsx)(Oc,{children:e.numberOfAccreditations}),n&&(0,i.jsx)(Xc,{justify:"center",children:(0,i.jsx)(tY,{accreditationCategory:e,reload:g})})]},e.id)),setOffset:c,title:e("liste_des_cat_g_39450"),totalCount:f})]})},iY=e=>{const t=Xn(),{mutate:n}=function(e={}){return ei("mutation CustomFieldCategoryDelete(\n $organizationId: OrganizationId!\n $customFieldCategoryId: CustomFieldsCategoryId!\n) {\n customFieldCategoryDelete(\n organizationId: $organizationId\n customFieldCategoryId: $customFieldCategoryId\n ) {\n id\n }\n}\n",e)}();return(0,i.jsx)(cA,{buttonText:t("supprimer_43083"),subtext:[t("_tes_vous_s_r_d_50954")],text:t("suppression_de_73669",e.customFieldCategory.name),onClose:e.onClose,onDelete:async()=>{await n({organizationId:e.organizationId,customFieldCategoryId:e.customFieldCategory.id}),e.onSuccess()}})},sY=e=>{const{mutate:t}=function(e={}){return ei("mutation CustomFieldCategoryUpdate(\n $organizationId: OrganizationId!\n $customFieldCategoryId: CustomFieldsCategoryId!\n $customFieldCategory: CustomFieldsCategoryInput!\n) {\n customFieldCategoryUpdate(\n organizationId: $organizationId\n customFieldCategoryId: $customFieldCategoryId\n customFieldCategory: $customFieldCategory\n ) {\n id\n name\n }\n}\n",e)}();return(0,i.jsx)(ny,{initialName:e.customFieldCategory.name,isEdit:!0,mutate:async n=>(await t({organizationId:e.organizationId,customFieldCategoryId:e.customFieldCategory.id,customFieldCategory:{name:n}})).customFieldCategoryUpdate,onClose:e.onClose,onSuccess:e.onSuccess})},oY=e=>{const{translate:t}=vl(),[n,s]=(0,L.useState)(!1),[o,r]=(0,L.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Yc,{children:[(0,i.jsx)(Kd,{icon:"pen",onClick:()=>{s(!0)},children:t("renommer_42135")}),(0,i.jsx)(Kd,{color:0===e.customFieldCategory.numberOfCustomFields?"red":"disabled",icon:"trash-can",onClick:()=>{r(!0)},children:t("supprimer_43083")})]}),n&&(0,i.jsx)(sY,{customFieldCategory:e.customFieldCategory,organizationId:e.organizationId,onClose:()=>{s(!1)},onSuccess:e.reload}),o&&(0,i.jsx)(iY,{customFieldCategory:e.customFieldCategory,organizationId:e.organizationId,onClose:()=>{r(!1)},onSuccess:e.reload})]})},rY=()=>{const{translate:e,params:{organizationId:t}}=vl(),{canOrganizationParamEdit:n}=DS(),[s,o,r]=Wc(""),[a,l]=(0,L.useState)(0),{data:d,isLoading:c,reload:u}=Qn("query OrganizationCategoriesCustomFields(\n $organizationId: OrganizationId!\n $name: String\n $offset: Int\n) {\n organization(id: $organizationId) {\n customFieldsCategories(name: $name, offset: $offset, limit: 25) {\n nodes {\n id\n name\n numberOfCustomFields\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{organizationId:t,name:m(o)?o:void 0,offset:a},[]);const{numberOfPages:h,totalCount:g}=Su(d.organization?.customFieldsCategories);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(Lc,{filters:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Ar,{width:320,children:(0,i.jsx)(Bl,{icon:"magnifying-glass",placeholder:e("rechercher_une_66722"),value:s,onChange:r})})}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Gc,{children:e("nom_de_la_cat_g_03860")}),(0,i.jsx)(Gc,{children:e("nombre_d_utilis_58389")}),n&&(0,i.jsx)(Gc,{width:100})]}),numberOfPages:h,offset:a,rows:c?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Hc,{bx:!0}),(0,i.jsx)(Hc,{bx:!0}),(0,i.jsx)(Hc,{bx:!0})]}):d.organization.customFieldsCategories.nodes.map(e=>(0,i.jsxs)(Mc,{children:[(0,i.jsx)(Oc,{children:e.name}),(0,i.jsx)(Oc,{children:e.numberOfCustomFields}),n&&(0,i.jsx)(Xc,{justify:"end",children:(0,i.jsx)(oY,{customFieldCategory:e,organizationId:t,reload:u})})]},e.id)),setOffset:l,title:e("liste_des_cat_g_39450"),totalCount:g})]})},aY=e=>{const{translate:t}=vl(),[n,s]=(0,L.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Yc,{children:[(0,i.jsx)(Kd,{icon:"pen",onClick:()=>{},children:t("renommer_42135")}),(0,i.jsx)(Kd,{color:"red",icon:"trash-can",onClick:()=>{s(!0)},children:t("supprimer_43083")})]}),n&&(0,i.jsx)(vS,{delegationCategory:e.delegationCategory,eventId:e.delegationCategory.eventId,organizationId:e.delegationCategory.organizationId,onClose:()=>{s(!1)},onSuccess:e.reload})]})},lY=()=>{const{translate:e,params:{organizationId:t}}=vl(),{canOrganizationParamEdit:n}=DS(),[s,o,r]=Wc(""),[a,l]=(0,L.useState)(-1),[d,c]=(0,L.useState)(0),{data:u,isLoading:h,reload:g}=Qn("query OrganizationCategoriesDelegations(\n $organizationId: OrganizationId!\n $name: String\n $eventId: EventId\n $offset: Int\n) {\n organization(id: $organizationId) {\n events {\n nodes {\n id\n name\n }\n }\n\n delegationsCategories(\n level: Both\n name: $name\n eventId: $eventId\n offset: $offset\n limit: 25\n ) {\n nodes {\n id\n organizationId\n eventId\n name\n numberOfDelegations\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{organizationId:t,name:m(o)?o:void 0,eventId:-1!==a?a:void 0,offset:d},[]);const{numberOfPages:p,totalCount:f}=Su(u.organization?.delegationsCategories),_=(0,L.useMemo)(()=>(0,uc.A)(u.organization?.events.nodes??[],e=>e.name.toLowerCase()),[u.organization]),x=(0,L.useMemo)(()=>Object.fromEntries(_.map(e=>[e.id,e.name])),[_]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(Lc,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ar,{width:200,children:(0,i.jsxs)($u,{shouldParseAsInt:!0,value:a,onChange:e=>{l(e)},children:[(0,i.jsx)("option",{value:"-1",children:e("tous_les_v_nem_16033")}),_.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))]})}),(0,i.jsx)(Ar,{width:320,children:(0,i.jsx)(Bl,{icon:"magnifying-glass",placeholder:e("rechercher_une_66722"),value:s,onChange:r})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Gc,{children:e("nom_de_la_cat_g_03860")}),(0,i.jsx)(Gc,{children:e("_v_nement_22345")}),(0,i.jsx)(Gc,{children:e("nombre_d_utilis_58389")}),n&&(0,i.jsx)(Gc,{width:100})]}),numberOfPages:p,offset:d,rows:h?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Hc,{bx:!0}),(0,i.jsx)(Hc,{bx:!0}),(0,i.jsx)(Hc,{bx:!0})]}):u.organization.delegationsCategories.nodes.map(s=>(0,i.jsxs)(Mc,{children:[(0,i.jsx)(Oc,{children:(0,i.jsx)(Zc,{to:hs.DELEGATION_CATEGORY({organizationId:t,eventId:s.eventId,delegationCategoryId:s.id}),children:s.name})}),(0,i.jsx)(Oc,{children:s.eventId?x[s.eventId]??"":e("communaut_20896")}),(0,i.jsx)(Oc,{children:s.numberOfDelegations}),n&&(0,i.jsx)(Xc,{justify:"center",children:(0,i.jsx)(aY,{delegationCategory:s,reload:g})})]},s.id)),setOffset:c,title:e("liste_des_cat_g_39450"),totalCount:f})]})},dY=e=>{const{translate:t}=vl(),[n,s]=(0,L.useState)(!1),[o,r]=(0,L.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Yc,{children:[(0,i.jsx)(Kd,{icon:"pen",onClick:()=>{s(!0)},children:t("renommer_42135")}),(0,i.jsx)(Kd,{color:"red",icon:"trash-can",onClick:()=>{r(!0)},children:t("supprimer_43083")})]}),n&&(0,i.jsx)(OU,{eventId:e.positionCategory.eventId,positionCategoryId:e.positionCategory.id,positionCategoryName:e.positionCategory.name,onClose:()=>{s(!1)},onSuccess:e.reload}),o&&(0,i.jsx)(xG,{eventId:e.positionCategory.eventId,positionCategory:e.positionCategory,onClose:()=>{r(!1)},onSuccess:e.reload})]})},cY=()=>{const{translate:e,params:{organizationId:t}}=vl(),{canOrganizationParamEdit:n}=DS(),[s,o,r]=Wc(""),[a,l]=(0,L.useState)(-1),[d,c]=(0,L.useState)(0),{data:u,isLoading:h,reload:g}=Qn("query OrganizationCategoriesPositions(\n $organizationId: OrganizationId!\n $name: String\n $eventId: EventId\n $offset: Int\n) {\n organization(id: $organizationId) {\n events {\n nodes {\n id\n name\n }\n }\n\n positionsCategories(name: $name, eventId: $eventId, offset: $offset, limit: 25) {\n nodes {\n id\n eventId\n name\n numberOfPositions\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{organizationId:t,name:m(o)?o:void 0,eventId:-1!==a?a:void 0,offset:d},[]);const{numberOfPages:p,totalCount:f}=Su(u.organization?.positionsCategories),_=(0,L.useMemo)(()=>(0,uc.A)(u.organization?.events.nodes??[],e=>e.name.toLowerCase()),[u.organization]),x=(0,L.useMemo)(()=>Object.fromEntries(_.map(e=>[e.id,e.name])),[_]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(Lc,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ar,{width:200,children:(0,i.jsxs)($u,{shouldParseAsInt:!0,value:a,onChange:e=>{l(e)},children:[(0,i.jsx)("option",{value:"-1",children:e("tous_les_v_nem_16033")}),_.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))]})}),(0,i.jsx)(Ar,{width:320,children:(0,i.jsx)(Bl,{icon:"magnifying-glass",placeholder:e("rechercher_une_66722"),value:s,onChange:r})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Gc,{children:e("nom_de_la_cat_g_03860")}),(0,i.jsx)(Gc,{children:e("_v_nement_22345")}),(0,i.jsx)(Gc,{children:e("nombre_d_utilis_58389")}),n&&(0,i.jsx)(Gc,{width:100})]}),numberOfPages:p,offset:d,rows:h?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Hc,{bx:!0}),(0,i.jsx)(Hc,{bx:!0}),(0,i.jsx)(Hc,{bx:!0})]}):u.organization.positionsCategories.nodes.map(e=>(0,i.jsxs)(Mc,{children:[(0,i.jsx)(Oc,{children:(0,i.jsx)(Zc,{to:xs.POSITION_CATEGORY({organizationId:t,eventId:e.eventId,positionCategoryId:e.id}),children:e.name})}),(0,i.jsx)(Oc,{children:x[e.eventId]??""}),(0,i.jsx)(Oc,{children:e.numberOfPositions}),n&&(0,i.jsx)(Xc,{justify:"center",children:(0,i.jsx)(dY,{positionCategory:e,reload:g})})]},e.id)),setOffset:c,title:e("liste_des_cat_g_39450"),totalCount:f})]})},uY=()=>{const{translate:e,params:{organizationId:t}}=vl();return(0,i.jsxs)(Ba,{css:{overflowY:"auto",padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(Ar,{font:"gray900 displayXs semiBold",children:e("cat_gories_24533")}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsxs)(mj,{children:[(0,i.jsxs)(uj,{children:[(0,i.jsx)(cj,{path:Ps.ORGANIZATION_PARAMETERS_CATEGORIES_CUSTOM_FIELDS(t),children:e("champs_de_formu_64126")}),(0,i.jsx)(cj,{path:Ps.ORGANIZATION_PARAMETERS_CATEGORIES_POSITIONS(t),children:e("missions_63972")}),(0,i.jsx)(cj,{path:Ps.ORGANIZATION_PARAMETERS_CATEGORIES_ACCREDITATIONS(t),children:e("accr_ditations_39450")}),(0,i.jsx)(cj,{path:Ps.ORGANIZATION_PARAMETERS_CATEGORIES_DELEGATIONS(t),children:e("d_l_gations_78318")})]}),(0,i.jsx)(hj,{path:Ps.ORGANIZATION_PARAMETERS_CATEGORIES_CUSTOM_FIELDS(":organizationId"),children:(0,i.jsx)(rY,{})}),(0,i.jsx)(hj,{path:Ps.ORGANIZATION_PARAMETERS_CATEGORIES_POSITIONS(":organizationId"),children:(0,i.jsx)(cY,{})}),(0,i.jsx)(hj,{path:Ps.ORGANIZATION_PARAMETERS_CATEGORIES_ACCREDITATIONS(":organizationId"),children:(0,i.jsx)(nY,{})}),(0,i.jsx)(hj,{path:Ps.ORGANIZATION_PARAMETERS_CATEGORIES_DELEGATIONS(":organizationId"),children:(0,i.jsx)(lY,{})})]})]})},hY=e=>{const{params:{organizationId:t},translate:n}=vl(),s=hg(t,e.linkPath);return(0,i.jsxs)(Ba,{align:"start",gap:"6",children:[(0,i.jsx)(gb,{heading:n("DelegationSpaceLink"),children:(0,i.jsx)(qS,{heading:n("lien_de_l_espac_85081"),link:s,qrCodeDescription:n("facilitez_la_co_59826")})}),(0,i.jsx)(gb,{heading:n("iframe_27513"),children:(0,i.jsx)(HS,{alert:e.alert,heading:e.iframeLabel,iframeLabel:e.iframeLabel,link:s})})]})},mY=()=>{const{params:{organizationId:e},translate:t}=vl(),{data:n,loader:s}=ha({organizationId:e,includeIntro:!1,spaceType:kt.DelegationSpace}),{mutate:o}=ma(),r=Zn(DE);return s||(0,i.jsx)(kl,{direction:"column",initialValues:{design:r.organizationDesignInputDefault(n.organization.spaceDesign)},render:({handleSubmit:e,submitting:n})=>(0,i.jsxs)(_b,{footerActions:(0,i.jsx)(Kb,{rolesTypes:bI,children:(0,i.jsx)(Ba,{children:(0,i.jsx)(zl,{isLoading:n,onClick:e,children:t("enregistrer_06519")})})}),heading:t("design_15043"),hideHeader:!0,children:[(0,i.jsx)(LE,{heading:t("images_de_votre_51694"),showLogo:!0}),(0,i.jsx)(NE,{})]}),onSubmit:async t=>await o({organizationId:e,spaceDesign:t.design,spaceType:kt.DelegationSpace})})},gY=()=>{const{params:{organizationId:e},translate:t}=vl(),[n,s]=(0,L.useState)($e.Code);return(0,i.jsx)(gb,{children:(0,i.jsx)(Ba,{direction:"column",children:(0,i.jsxs)(Ba,{gap:"7",children:[(0,i.jsxs)(Ba,{css:{flex:"1"},direction:"column",gap:"6",children:[(0,i.jsx)(ml,{children:t("liste_des_e_mai_73508")}),(0,i.jsxs)(Sc,{children:[(0,i.jsx)(kc,{children:(0,i.jsx)(Gc,{children:t("type_d_e_mail_06577")})}),(0,i.jsx)(bE,{isSelected:n===$e.Code,subtitle:t("cet_e_mail_est_80490"),title:t("code_20843"),onClick:()=>s($e.Code)})]})]}),(0,i.jsx)(Ar,{css:{borderRight:"1px solid $gray200",width:"1px"}}),(0,i.jsx)(Ba,{css:{flex:"1",py:"$3"},children:(0,i.jsx)(CE,{emailType:n,eventId:null,formId:null,organizationId:e,source:tt.DelegationsSpace})})]})})})},pY=e=>{const t=Xn(),n="badge"===e.type?e.badge:e.customDocument.slug,s=Zn(Jc);return(0,i.jsxs)(Ba,{align:"center",css:{borderBottom:"1px solid $gray200",padding:"$4 $6","&:last-child":{borderBottom:"none"}},gap:"3",children:[(0,i.jsx)(Ba,{align:"center",css:{background:"$blueGray100",borderRadius:"12px",color:"$blueGray700"},height:40,justify:"center",width:40,children:(0,i.jsx)(nl,{icon:"file-lines"})}),(0,i.jsxs)(Ba,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(hl,{textStyle:"heading",children:"badge"===e.type?Vx(e.badge):`${e.customDocument.event.name} - ${e.customDocument.name}`}),(0,i.jsx)(hl,{textStyle:"subtitle",children:t("ajout_par_1_48224",e.customDocument.createdBy.name,s.toLocaleString(e.customDocument.insertedAt.toLocal(),eo.DateTime))})]}),(0,i.jsx)(ku,{value:e.delegationsSpaceCustomBadges.includes(n),onChange:t=>{e.change("delegationsSpaceCustomBadges",ro(e.delegationsSpaceCustomBadges,n,t))},children:t("document_t_l_ch_56704")})]})},fY=()=>{const{params:{organizationId:e},translate:t}=vl(),{data:n,loader:s}=Qn("query OrganizationDelegationSpaceSettings($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n customBadges\n allowDelegationSpaceDownload\n delegationsSpaceCustomBadges\n\n customDocuments {\n id\n slug\n name\n\n event {\n id\n name\n }\n\n insertedAt\n createdBy {\n ...CreatedBy\n }\n }\n }\n}\n",{organizationId:e},[Vs.CreatedByFragment]),{mutate:o}=function(e={}){return ei("mutation OrganizationDelegationSpaceSettingsUpdate(\n $organizationId: OrganizationId!\n $delegationSpaceSettings: DelegationSpaceSettingsInput!\n) {\n organizationDelegationSpaceSettingsUpdate(\n organizationId: $organizationId\n delegationSpaceSettings: $delegationSpaceSettings\n ) {\n id\n }\n}\n",e)}(),r=(0,L.useMemo)(()=>(0,uc.A)(n.organization?.customDocuments??[],e=>`${e.event.name} - ${e.name}`.toLowerCase()),[n.organization]);return s||(0,i.jsx)(kl,{direction:"column",initialValues:{allowDelegationSpaceDownload:n.organization.allowDelegationSpaceDownload,delegationsSpaceCustomBadges:n.organization.delegationsSpaceCustomBadges},render:({form:e,handleSubmit:s,submitting:o,values:a})=>(0,i.jsxs)(_b,{footerActions:(0,i.jsx)(Kb,{rolesTypes:bI,children:(0,i.jsx)(zl,{isLoading:o,onClick:s,children:t("enregistrer_06519")})}),heading:t("Documents"),subtitle:t("personnaliser_l_64606"),children:[(0,i.jsx)(ME,{heading:t("allow_documents_96106"),children:(0,i.jsx)(Jm,{name:"allowDelegationSpaceDownload",children:t("allow_delegatio_08622")})}),a.allowDelegationSpaceDownload&&(0,i.jsx)(ME,{heading:t("documents_dispo_46996"),children:(0,i.jsxs)(Ba,{css:{border:"1px solid $gray200",borderRadius:"$2",flex:"1",overflow:"hidden"},direction:"column",children:[n.organization.customBadges.map(t=>(0,i.jsx)(pY,{badge:t,change:e.change,delegationsSpaceCustomBadges:a.delegationsSpaceCustomBadges,type:"badge"},t)),r.map(t=>(0,i.jsx)(pY,{change:e.change,customDocument:t,delegationsSpaceCustomBadges:a.delegationsSpaceCustomBadges,type:"customDocument"},t.id))]})})]}),onSubmit:async t=>{await o({organizationId:e,delegationSpaceSettings:t})}})},_Y=()=>{const{translate:e,params:{organizationId:t}}=vl();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(lj,{css:{padding:"$6 $7 0 $7",borderBlockEnd:"1px solid $gray200"},children:(0,i.jsxs)(Ba,{direction:"column",gap:"4",children:[(0,i.jsx)(ml,{children:e("espace_d_l_gati_59251")}),(0,i.jsxs)(uj,{css:{borderBlockEnd:"unset"},children:[(0,i.jsx)(cj,{path:yi.ORGANIZATION_SETTINGS_DELEGATION_SPACE_DESIGN({organizationId:t}),children:e("design_15043")}),(0,i.jsx)(cj,{path:yi.ORGANIZATION_SETTINGS_DELEGATION_SPACE_INTEGRATION({organizationId:t}),children:e("int_gration_10662")}),(0,i.jsx)(cj,{path:yi.ORGANIZATION_SETTINGS_DELEGATION_SPACE_EMAIL_TEMPLATES({organizationId:t}),children:e("mod_les_e_mail_91257")}),(0,i.jsx)(cj,{path:yi.ORGANIZATION_SETTINGS_DELEGATION_SPACE_SETTINGS({organizationId:t}),children:e("param_tres_78420")})]})]})}),(0,i.jsx)(aj,{css:{overflowY:"auto"},children:(0,i.jsxs)(Sr.dO,{children:[(0,i.jsx)(hj,{path:yi.ORGANIZATION_SETTINGS_DELEGATION_SPACE_DESIGN({organizationId:":organizationId"}),children:(0,i.jsx)(mY,{})}),(0,i.jsx)(hj,{path:yi.ORGANIZATION_SETTINGS_DELEGATION_SPACE_INTEGRATION({organizationId:":organizationId"}),children:(0,i.jsx)(hY,{alert:(0,i.jsxs)(gl,{alertStyle:"warning",children:[(0,i.jsx)(pl,{children:e("comment_marche_79958")}),(0,i.jsx)(fl,{children:e("ce_code_va_vous_19546")})]}),iframeLabel:e("code_html_pour_86852"),linkPath:pi(yi.ORGANIZATION_DELEGATIONS({organizationId:t}))})}),(0,i.jsx)(hj,{path:yi.ORGANIZATION_SETTINGS_DELEGATION_SPACE_EMAIL_TEMPLATES({organizationId:":organizationId"}),children:(0,i.jsx)(gY,{})}),(0,i.jsx)(hj,{path:yi.ORGANIZATION_SETTINGS_DELEGATION_SPACE_SETTINGS({organizationId:":organizationId"}),children:(0,i.jsx)(fY,{})})]})})]})},xY=e=>{const t=Xn(),{isLoading:n,copy:s}=WS(),{isLoading:o,copy:r}=WS();return(0,i.jsxs)(Mc,{children:[(0,i.jsx)(Oc,{children:(0,i.jsxs)(Ba,{align:"center",css:{"& i":{cursor:"pointer"}},children:[(0,i.jsxs)(km,{children:[(0,i.jsx)(Sm,{children:(0,i.jsx)(Ar,{width:20,children:n?(0,i.jsx)(nl,{icon:"loader"}):(0,i.jsx)(nl,{icon:"copy",onClick:()=>s(e.name)})})}),(0,i.jsx)(wm,{placement:"top",children:t("copier_75889")})]}),e.name]})}),(0,i.jsx)(Oc,{width:100,children:e.type}),(0,i.jsx)(Oc,{children:(0,i.jsxs)(Ba,{align:"center",css:{"& i":{cursor:"pointer"}},gap:"1",children:[(0,i.jsxs)(km,{children:[(0,i.jsx)(Sm,{children:(0,i.jsx)(Ar,{width:20,children:o?(0,i.jsx)(nl,{icon:"loader"}):(0,i.jsx)(nl,{icon:"copy",onClick:()=>r(e.value)})})}),(0,i.jsx)(wm,{placement:"top",children:t("copier_75889")})]}),e.value]})})]})},IY=e=>{const t=Xn(),{mutate:n,isLoading:s}=function(e={}){return ei("mutation DomainDkimVerificationRetry(\n $organizationId: OrganizationId!\n $eventId: EventId\n $domain: String!\n) {\n domainDkimVerificationRetry(organizationId: $organizationId, eventId: $eventId, domain: $domain)\n}\n",e)}();return(0,i.jsx)(Lc,{filters:(0,i.jsx)(i.Fragment,{children:e.domain.status===Se.Failed&&(0,i.jsx)(zl,{color:"white",isLoading:s,leftIcon:"arrows-rotate",size:"sm",onClick:async()=>{await n({organizationId:e.organizationId,domain:e.domain.name}),e.reload()},children:t("r_essayer_43543")})}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Gc,{children:t("nom_08311")}),(0,i.jsx)(Gc,{width:100,children:t("type_35427")}),(0,i.jsx)(Gc,{children:t("valeur_22437")})]}),numberOfPages:0,offset:0,rows:(0,i.jsxs)(i.Fragment,{children:[e.domain.dnsEntries.map((e,t)=>(0,i.jsx)(xY,{name:e.name,type:e.type,value:e.value},t)),(0,i.jsx)(xY,{name:`_dmarc.${e.domain.name}`,type:"TXT",value:"v=DMARC1; p=quarantine; adkim=r;"})]}),setOffset:td.A,title:(0,i.jsxs)(Ba,{align:"center",gap:"2",children:[(0,i.jsx)(Ar,{font:"gray900 textMd semiBold",children:t("liste_des_entr_35559",e.domain.name)}),e.domain.status===Se.Success&&(0,i.jsx)(rc,{color:"success",leftIcon:"circle",leftIconStyle:"solid",children:t("vos_entr_es_dns_05106")}),e.domain.status===Se.Pending&&(0,i.jsx)(rc,{color:"warning",leftIcon:"circle",leftIconStyle:"solid",children:t("vos_entr_es_dns_31271")}),e.domain.status===Se.Failed&&(0,i.jsx)(rc,{color:"error",leftIcon:"circle",leftIconStyle:"solid",children:t("la_v_rification_65771")})]}),totalCount:0})},vY=e=>{const{history:t,translate:n}=vl(),{data:s,loader:o,reload:r}=Qn("query OrganizationDomains($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n domains {\n name\n status\n\n dnsEntries {\n name\n type\n value\n }\n }\n }\n}\n",{organizationId:e.organizationId},[]);return o||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"7"}),0===s.organization.domains.length?(0,i.jsxs)(Ba,{direction:"column",children:[(0,i.jsx)(Ar,{height:250,width:1,children:(0,i.jsx)(Gk,{imageSrc:_d.DnsBlank,subtitle:n("pour_avoir_acc_02742"),title:n("les_entr_es_dns_52899")})}),(0,i.jsxs)(Ba,{gap:"3",justify:"center",children:[(0,i.jsx)(zl,{color:"white",onClick:()=>{open("https://support.weezevent.com/fr/param%C3%A9trer-ladresse-e-mail-de-lexp%C3%A9diteur")},children:n("lire_la_documen_25597")}),(0,i.jsx)(Kb,{rolesTypes:bI,children:(0,i.jsx)(zl,{onClick:()=>{t.push(Ps.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(e.organizationId))},children:n("ajouter_un_met_38216")})})]})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(rl,{color:"gray",leftIcon:"circle-exclamation",children:n("les_entr_es_dns_55177")}),s.organization.domains.map((t,n)=>(0,i.jsxs)(L.Fragment,{children:[(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(IY,{domain:t,organizationId:e.organizationId,reload:r})]},n))]})]})},bY=e=>{const{history:t,translate:n}=vl(),{mutate:s}=function(e={}){return ei("mutation EmailSenderDuplicate($organizationId: OrganizationId!, $emailSenderId: EmailsSenderId!) {\n emailSenderDuplicate(organizationId: $organizationId, emailSenderId: $emailSenderId) {\n id\n }\n}\n",e)}(),{mutate:o}=function(e={}){return ei("mutation EmailSenderDelete($organizationId: OrganizationId!, $emailSenderId: EmailsSenderId!) {\n emailSenderDelete(organizationId: $organizationId, emailSenderId: $emailSenderId) {\n id\n }\n}\n",e)}(),{mutate:r}=function(e={}){return ei("mutation EmailSenderVerificationResend(\n $organizationId: OrganizationId!\n $emailSenderId: EmailsSenderId!\n) {\n emailSenderVerificationResend(organizationId: $organizationId, emailSenderId: $emailSenderId)\n}\n",e)}(),[a,l]=(0,L.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ba,{align:"center",css:{padding:"$3 $4"},gap:"3",children:[(0,i.jsxs)(Ba,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsxs)(Ba,{align:"center",gap:"2",children:[(0,i.jsx)(Ar,{color:"gray800",fontWeight:"medium",children:e.emailSender.name}),!e.emailSender.isValidToSendEmail&&(0,i.jsx)(rc,{color:"error",leftIcon:"circle",leftIconStyle:"solid",children:n("e_mail_non_conf_40343")})]}),(0,i.jsx)(Ar,{color:"gray500",children:e.emailSender.from})]}),(0,i.jsx)(Kb,{permissions:Hb.ORGANIZATION_PARAM_EDIT,children:(0,i.jsx)(zl,{color:"white",onClick:()=>{t.push(Ps.EDIT_ORGANIZATION_PARAMETERS_EMAILS_SENDERS(e.organizationId,e.emailSender.id))},children:n("_diter_62574")})}),(0,i.jsx)(zl,{color:"white",onClick:()=>{t.push(Ps.ORGANIZATION_PARAMETERS_EMAILS_SENDERS_PREVIEW(e.organizationId,e.emailSender.id))},children:n("aper_u_25595")}),(0,i.jsx)(Kb,{permissions:Hb.ORGANIZATION_PARAM_EDIT,children:(0,i.jsxs)(Wd,{children:[(0,i.jsx)(Xd,{children:(0,i.jsx)(zl,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(Zd,{placement:"bottom-end",children:[!e.emailSender.isValidToSendEmail&&(0,i.jsx)(Kd,{icon:"paper-plane",onClick:async()=>{await r({organizationId:e.organizationId,emailSenderId:e.emailSender.id})},children:n("r_envoyer_l_e_91472")}),(0,i.jsx)(Kd,{icon:"clone",onClick:async()=>{await s({organizationId:e.organizationId,emailSenderId:e.emailSender.id}),e.reload()},children:n("dupliquer_28256")}),(0,i.jsx)(Xu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Kd,{color:"red",icon:"trash-can",onClick:()=>{l(!0)},children:n("supprimer_43083")})]})]})})]}),a&&(0,i.jsx)(cA,{buttonText:n("supprimer_43083"),subtext:n("_tes_vous_s_r_d_90786"),text:n("suppression_de_73669",e.emailSender.from),onClose:()=>{l(!1)},onDelete:async()=>{await o({organizationId:e.organizationId,emailSenderId:e.emailSender.id}),e.reload()}})]})},jY=e=>{const t=Xn();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(Ar,{font:"gray900 textLg medium",children:t("liste_des_mett_28960")}),(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(Ba,{css:{border:"1px solid $gray200",borderRadius:"$2","& > div:not(:last-child)":{borderBottom:"1px solid $gray200"}},direction:"column",children:e.emailsSenders.map(t=>(0,i.jsx)(bY,{emailSender:t,organizationId:e.organizationId,reload:e.reload},t.id))})]})},CY=e=>{const{history:t,translate:n}=vl(),{data:s,loader:o,reload:r}=Qn("query EmailsSenders($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n emailsSenders {\n id\n name\n from\n fromEmail\n isValidToSendEmail\n }\n }\n}\n",{organizationId:e.organizationId},[]);const[a,l]=(0,L.useState)(null),d=(0,L.useMemo)(()=>(s.organization?.emailsSenders??[]).filter(e=>!e.isValidToSendEmail),[s.organization]);return(0,L.useEffect)(()=>{!o&&s.organization.emailsSenders.length>0&&null===a&&l(s.organization.emailsSenders[0].id)},[o,a,s.organization?.emailsSenders,l]),o||(0===s.organization.emailsSenders.length?(0,i.jsxs)(Ba,{direction:"column",children:[(0,i.jsx)(Ar,{height:250,width:1,children:(0,i.jsx)(Gk,{subtitle:n("cr_er_des_mett_38995"),title:n("aucun_metteur_96777")})}),(0,i.jsx)(Kb,{rolesTypes:bI,children:(0,i.jsx)(Ba,{justify:"center",children:(0,i.jsx)(zl,{onClick:()=>{t.push(Ps.CREATE_ORGANIZATION_PARAMETERS_EMAILS_SENDERS(e.organizationId))},children:n("cr_er_un_mette_14030")})})})]}):(0,i.jsxs)(i.Fragment,{children:[so(d)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"7"}),(0,i.jsxs)(rl,{color:"error",leftIcon:"circle-exclamation",children:[n("veuillez_confir_10865"),(0,i.jsx)("ul",{children:d.map(e=>(0,i.jsx)("li",{children:e.fromEmail},e.id))})]})]}),(0,i.jsx)(jY,{emailsSenders:s.organization.emailsSenders,organizationId:e.organizationId,reload:r})]}))},yY=()=>{const{history:e,translate:t,params:{organizationId:n}}=vl(),s=location.pathname.endsWith("emails/senders");return(0,i.jsxs)(Ba,{css:{overflowY:"auto",padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsxs)(Ba,{children:[(0,i.jsxs)(Ba,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(Ar,{font:"gray900 displayXs semiBold",children:t("e_mails_09850")}),(0,i.jsx)(Ar,{color:"gray500",children:t("param_trer_les_39470")})]}),s&&(0,i.jsx)(Kb,{permissions:Hb.ORGANIZATION_PARAM_EDIT,children:(0,i.jsx)(zl,{onClick:()=>{e.push(Ps.CREATE_ORGANIZATION_PARAMETERS_EMAILS_SENDERS(n))},children:t("cr_er_une_nouve_77052")})})]}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsxs)(mj,{children:[(0,i.jsxs)(uj,{children:[(0,i.jsx)(cj,{path:Ps.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(n),children:t("_metteurs_74545")}),(0,i.jsx)(cj,{path:Ps.ORGANIZATION_PARAMETERS_EMAILS_DNS(n),children:t("entr_es_dns_11256")})]}),(0,i.jsx)(hj,{path:Ps.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(n),children:(0,i.jsx)(CY,{organizationId:n})}),(0,i.jsx)(hj,{path:Ps.ORGANIZATION_PARAMETERS_EMAILS_DNS(n),children:(0,i.jsx)(vY,{organizationId:n})})]})]})};let kY=class extends Gl{constructor(e){super(e)}settingsDesignInputSchema(){return d.Ik().shape({title:d.Yj().required(),description:d.Yj()})}settingsInputSchema(){return d.Ik().shape({events:d.YO().of(d.Ik().shape({buttonText:d.Yj().required(),eventId:d.ai().required(),formId:d.ai().nullable()}))})}};kY=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[qn])],kY);const AY=()=>{const{translate:e}=vl();return(0,i.jsx)(FE,{heading:e("contenu_persona_18596"),subtitle:e("personnaliser_l_09507"),children:(0,i.jsxs)(Ba,{direction:"column",gap:"6",children:[(0,i.jsx)(Vl,{label:e("titre_de_l_intr_54141"),name:"settings.title"}),(0,i.jsx)(Vl,{label:e("contenu_29668"),name:"settings.description"})]})})},wY=()=>{const{params:{organizationId:e},translate:t}=vl(),{data:n,loader:s}=ha({organizationId:e,includeIntro:!0,spaceType:kt.EventsShowcase}),{mutate:o}=ma(),r=Zn(Ua),a=Zn(DE),l=Zn(kY);return s||(0,i.jsx)(kl,{direction:"column",initialValues:{design:a.organizationDesignInputDefault(n.organization.spaceDesign),settings:{title:n.organization.eventsShowcaseSettings.title??t("liste_des_v_ne_29929"),description:n.organization.eventsShowcaseSettings.description??t("visualiser_tous_33187")}},render:({handleSubmit:e,submitting:n})=>(0,i.jsxs)(_b,{footerActions:(0,i.jsx)(Kb,{rolesTypes:bI,children:(0,i.jsx)(zl,{isLoading:n,onClick:e,children:t("enregistrer_06519")})}),heading:t("design_15043"),hideHeader:!0,children:[(0,i.jsx)(AY,{}),(0,i.jsx)(LE,{heading:t("images_de_votre_51694"),showLogo:!0}),(0,i.jsx)(NE,{})]}),validate:r.validateForForm(l.settingsInputSchema()),onSubmit:async t=>await o({organizationId:e,settings:t.settings,spaceDesign:t.design,spaceType:kt.EventsShowcase})})},SY=L.forwardRef(({shouldLightDismiss:e=!0,initialOpen:t=!1,isOpen:n,setIsOpen:s,onClose:o,children:r,...a},l)=>{const[d,c]=L.useState(t),u=L.useRef(null),h=n??d,m=s??c;return L.useEffect(()=>{const e=u.current;return h?function(e){e&&!e.open&&e.showModal()}(e):e?.close(),()=>{e?.close()}},[h]),L.useEffect(()=>{const t=u.current;function n(e){e.preventDefault(),e.stopPropagation(),a.onClose?.(),m(!1)}function i(e){const{target:t}=e;t instanceof Element&&"DIALOG"===t.nodeName&&n(e)}function s(e){"Escape"===e.code&&n(e)}return e&&t?.addEventListener("click",i),t?.addEventListener("keydown",s),()=>{e&&t?.removeEventListener("click",i),t?.removeEventListener("keydown",s)}},[e,m]),L.useImperativeHandle(l,()=>({close(){m(!1)},showModal(){m(!0)},isOpen:()=>h,addEventListener(e,t,n){u.current?.addEventListener(e,t,n)},removeEventListener(e,t,n){u.current?.removeEventListener(e,t,n)}}),[h,m]),(0,i.jsxs)(i.Fragment,{children:[false,(0,i.jsx)("dialog",{ref:u,"aria-describedby":a["aria-describedby"],"aria-description":a["aria-description"],"aria-label":a["aria-label"],"aria-labelledby":a["aria-labelledby"],style:a.style,onClose:o,children:r})]})});SY.displayName="Dialog";const EY=({children:e,descId:t,labelId:n,isOpen:s,size:o,setIsOpen:r,...a})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("style",{dangerouslySetInnerHTML:{__html:"\n dialog::backdrop {\n background: rgba(52, 64, 84, 0.7)\n }\n "}}),(0,i.jsx)(SY,{"aria-describedby":t,"aria-labelledby":n,"data-testid":"modal-body",isOpen:s,setIsOpen:r,style:{border:"none",borderRadius:"var(--radii-3)",padding:0,inlineSize:"70vw",blockSize:"fit-content",maxWidth:"688px"},onClose:a.onClose,children:(0,i.jsx)(Ba,{align:"center",direction:"column",...a,children:e})})]}),TY=({heading:e,leftIcon:t,leftIconColor:n,leftIconBorder:s,setIsOpen:o,...r})=>{const{translate:a}=vl();return(0,i.jsxs)(Ba,{as:"header",css:{alignItems:"flex-start",alignSelf:"stretch",background:"$white",borderBlockEnd:"1px solid $gray200"},direction:"column",gap:"4",...r,children:[(0,i.jsxs)(Ba,{css:{alignItems:"center",alignSelf:"stretch",padding:"$6 $7 $5 $7"},gap:"4",children:[t&&(0,i.jsx)(Ba,{align:"center",css:{padding:"$3",bd:!0,border:s},justify:"center",children:(0,i.jsx)(Ba,{align:"center",height:24,justify:"center",width:24,children:(0,i.jsx)(nl,{className:"fa-xl",color:n,icon:t})})}),(0,i.jsx)(Ba,{css:{alignItems:"flex-start",flex:1},direction:"column",justify:"center",children:e})]}),(0,i.jsx)(Ba,{align:"center",css:{padding:"$2",height:"$space$9",width:"$space$9",position:"absolute",right:"$space$4",top:"$space$4"},justify:"center",children:(0,i.jsx)(zl,{"aria-label":a("close_dialog_50926"),color:"invisible",css:{color:"$gray500",width:"$space$6",height:"$space$6",padding:0},textAlign:"center",onClick:()=>o(!1),children:(0,i.jsx)("i",{className:"far fa-xmark"})})}),r.children]})},zY=e=>(0,i.jsx)(Ba,{css:{alignSelf:"stretch",alignItems:"start",padding:"$6",overflowY:"auto",...e.css},direction:"column",gap:"6",children:e.children}),OY=({handleSubmit:e,isSubmitDisabled:t=!1,setIsOpen:n,submitStyle:s,submitText:o,...r})=>{const{translate:a}=vl();return(0,i.jsxs)(Ba,{as:"footer",css:{alignItems:"flex-end",alignSelf:"stretch",background:"$white",borderBlockStart:"1px solid $gray200",padding:"$6"},direction:"column",gap:"4",...r,children:[(0,i.jsxs)(Ba,{align:"center",gap:"4",justify:"end",children:[(0,i.jsx)(zl,{color:"white",onClick:()=>n(!1),children:a("annuler_48254")}),(0,i.jsx)(zl,{color:s,disabled:t,onClick:()=>e(),children:o??a("submit_21373")})]}),r.children]})},RY=e=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(TY,{heading:(0,i.jsxs)(Ba,{direction:"column",children:[(0,i.jsx)(ml,{id:e.labelId,children:e.heading}),e.subtitle&&(0,i.jsx)(hl,{id:e.descId,textStyle:"subtitle",children:e.subtitle})]}),id:e.labelId,leftIcon:e.leftIcon,leftIconBorder:e.leftIconBorder,leftIconColor:e.leftIconColor,setIsOpen:e.setIsOpen}),(0,i.jsx)(zY,{id:e.descId,children:e.children}),(0,i.jsx)(OY,{handleSubmit:()=>{e.setValue(),e.setIsOpen(!1)},setIsOpen:e.setIsOpen,submitStyle:e.submitStyle,submitText:e.submitText})]}),$Y=({role:e,setShowModal:t,showModal:n,...s})=>{const[o,r]=(0,L.useState)(!1),a=qa();return(0,L.useEffect)(()=>(r(!(!n||o)),()=>{r(!1)}),[n]),(0,i.jsx)(EY,{descId:a.descId,isOpen:o,labelId:a.labelId,role:e,setIsOpen:r,size:"md",onClose:()=>{t(null)},children:(0,i.jsx)(RY,{descId:a.descId,labelId:a.labelId,setIsOpen:r,...s,children:s.children})})},DY=e=>{const{params:{organizationId:t},translate:n}=vl(),{data:s,loader:o}=Qn("query EventModalFormSelector($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n forms(level: Event, eventId: $eventId) {\n nodes {\n id\n name\n }\n }\n }\n}\n",{organizationId:t,eventId:e.eventId},[]);return o||(so(s.organization.forms.nodes)?(0,i.jsxs)($u,{label:n("avez_quel_formu_13642"),shouldParseAsInt:!0,value:e.formId??-1,onChange:e.setFormId,children:[(0,i.jsx)("option",{disabled:!0,hidden:!0,value:-1,children:n("s_lectionner_un_13356")}),s.organization.forms.nodes.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))]}):(0,i.jsx)(Gk,{imageSrc:_d.WeezeventBlankPerson,title:n("you_have_no_for_84347")}))},PY=e=>{const{translate:t}=vl(),[n,s]=(0,L.useState)(!1);return(0,L.useEffect)(()=>{!n&&e.linkedFormId&&e.setLinkedFormId(null)},[n,e.linkedFormId]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ml,{textStyle:"smallcapsheading",children:t("personnalisatio_98369")}),(0,i.jsxs)(Ba,{direction:"column",gap:"4",children:[(0,i.jsx)(Bl,{label:t("personnalisatio_58948"),value:e.buttonText,onChange:e.setButtonText}),(0,i.jsx)(ku,{value:n,onChange:s,children:(0,i.jsx)(Ar,{children:t("l_v_nement_est_24339")})}),n&&(0,i.jsx)(DY,{eventId:e.eventId,formId:e.linkedFormId,setFormId:e.setLinkedFormId})]})]})},FY=e=>{const{params:{organizationId:t},translate:n}=vl(),[s,o]=(0,L.useState)(void 0),[r,a]=(0,L.useState)(n("s_inscrire_20304")),[l,d]=(0,L.useState)(null),{data:c,loader:u}=Qn("query EventsShowcaseAddEventModal($organizationId: OrganizationId!, $existingEventIds: [EventId]!) {\n organization(id: $organizationId) {\n events(excludedEventIds: $existingEventIds) {\n nodes {\n id\n name\n }\n }\n }\n}\n",{organizationId:t,existingEventIds:e.eventIds},[]);return(0,i.jsx)($Y,{heading:n("nouvel_v_nemen_99684"),isSubmitDisabled:!s,leftIcon:"building",leftIconBorder:"gray200",leftIconColor:"gray800",setShowModal:e.setShowModal,setValue:()=>e.setValue({eventId:s,formId:l,buttonText:r}),showModal:e.showModal,submitText:n("ajouter_97327"),subtitle:n("ajouter_et_pers_06084"),children:e.eventIds&&u||(so(c.organization.events.nodes)?(0,i.jsxs)(Ba,{css:{inlineSize:"100%"},direction:"column",gap:"4",children:[(0,i.jsxs)($u,{label:n("quel_v_nement_57240"),shouldParseAsInt:!0,value:s??-1,onChange:o,children:[(0,i.jsx)("option",{disabled:!0,hidden:!0,value:-1,children:n("s_lectionner_un_57793")}),c.organization.events.nodes.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))]}),s&&(0,i.jsx)(Ba,{css:{bd:!0,borderRadius:"$1",backgroundColor:"$gray50",padding:"$4"},direction:"column",gap:"3",children:(0,i.jsx)(PY,{buttonText:r,eventId:s,linkedFormId:l,setButtonText:a,setLinkedFormId:d})})]}):(0,i.jsx)(Gk,{imageSrc:_d.WeezeventBlankPerson,title:n("you_have_no_oth_58056")}))})},MY=e=>(0,i.jsx)($Y,{...e,leftIcon:"trash-can",leftIconBorder:"gray200",leftIconColor:"gray800",role:"alertdialog",submitStyle:"error"}),NY=e=>{const{translate:t}=vl(),[n,s]=(0,L.useState)(e.event.buttonText),[o,r]=(0,L.useState)(!!e.event.formId),[a,l]=(0,L.useState)(e.event.formId??null);return(0,L.useEffect)(()=>{!o&&a&&l(null)},[o,a]),(0,i.jsx)($Y,{heading:t("mettre_jour_l_28846"),leftIcon:"building",leftIconBorder:"gray800",leftIconColor:"gray200",setShowModal:e.setShowModal,setValue:()=>e.setValue({eventId:e.event.eventId,formId:a,buttonText:n}),showModal:e.showModal,submitText:t("ajouter_97327"),subtitle:t("personalise_the_05652"),children:(0,i.jsxs)(gb,{gap:"3",children:[(0,i.jsx)(ml,{textStyle:"smallcapsheading",children:t("personnalisatio_98369")}),(0,i.jsxs)(Ba,{direction:"column",gap:"4",children:[(0,i.jsx)(Bl,{label:t("personnalisatio_58948"),value:n,onChange:s}),(0,i.jsx)(ku,{value:o,onChange:r,children:(0,i.jsx)(Ar,{children:t("l_v_nement_est_24339")})}),o&&(0,i.jsx)(DY,{eventId:e.event.eventId,formId:a,setFormId:l})]})]})})},LY=e=>{const{translate:t}=vl(),[n,s]=(0,L.useState)(null),[o,r]=(0,L.useState)(null),a=(0,L.useMemo)(()=>e.events?.find(t=>t.id===e.showcaseEvent.eventId)?.name??"",[e.showcaseEvent,e.events]),l=(0,L.useMemo)(()=>e.forms?.find(t=>t.id===e.showcaseEvent.formId)?.name??"",[e.showcaseEvent,e.forms]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ba,{...e.draggableProvided.draggableProps,ref:e.draggableProvided.innerRef,align:"center",css:{padding:"$4 $6",borderBlockStart:"1px solid $gray200"},gap:"2",children:[(0,i.jsx)(Ar,{color:"gray300",css:{cursor:"pointer"},...e.draggableProvided.dragHandleProps,children:(0,i.jsx)(nl,{icon:"grip-vertical",iconStyle:"solid"})}),(0,i.jsxs)(Ba,{css:{alignItems:"center"},gap:"4",children:[(0,i.jsx)(hl,{textStyle:"subheading",children:a}),e.showcaseEvent.formId&&(0,i.jsx)(rc,{leftIcon:"pen",children:t("linked_to_form_64790",l)})]}),(0,i.jsx)(Ar,{css:{flex:"1"}}),(0,i.jsxs)(Ba,{gap:"2",children:[(0,i.jsx)(zl,{color:"white",leftIcon:"pen-line",onClick:()=>r(e.showcaseEvent.eventId)}),(0,i.jsx)(zl,{color:"white",leftIcon:"trash-can",onClick:()=>s(e.showcaseEvent.eventId)})]})]}),n&&n===e.showcaseEvent.eventId&&(0,i.jsx)(MY,{heading:t("vous_tes_sur_l_04795"),setShowModal:s,setValue:()=>{e.form.change("events",co(e.values.events,e.values.events.findIndex(t=>t.eventId===e.showcaseEvent.eventId)))},showModal:!!n,submitText:t("oui_supprimer_57212"),subtitle:t("la_suppression_96669"),children:(0,i.jsx)(hl,{children:t("vous_tes_sur_l_80749",a)})}),o&&o===e.showcaseEvent.eventId&&(0,i.jsx)(NY,{event:e.showcaseEvent,setShowModal:r,setValue:t=>{e.form.change("events",e.values.events.map(n=>n.eventId===e.showcaseEvent.eventId?t:n))},showModal:!!o})]})},BY=e=>{const{translate:t}=vl(),n=(0,L.useCallback)(({reason:t,source:n,destination:i})=>{"DROP"===t&&i&&n.index!==i.index&&e.form.change("events",lo(e.values.events,n.index,i.index))},[e.values.events,e.form]);return(0,i.jsx)(Iu.JY,{onDragEnd:n,children:(0,i.jsx)(Iu.gL,{droppableId:"main",type:"accreditation",children:n=>(0,i.jsx)(Ba,{css:{bd:!0,"& > div:first-child":{borderBlockStart:"none !important"}},direction:"column",...n.droppableProps,ref:n.innerRef,children:so(e.values.events)?(0,i.jsxs)(i.Fragment,{children:[e.values.events.map((t,n)=>(0,i.jsx)(Iu.sx,{draggableId:`a-${t.eventId}`,index:n,children:n=>(0,i.jsx)(LY,{draggableProvided:n,showcaseEvent:t,...e},t.eventId)},t.eventId)),n.placeholder]}):(0,i.jsx)(Ar,{css:{padding:"$4"},children:(0,i.jsx)(Gk,{title:t("no_events_selec_80121")})})})})})},VY=()=>{const{params:{organizationId:e},translate:t}=vl(),[n,s]=(0,L.useState)(!1),{data:o,loader:r}=Qn("query OrganizationEventsShowcaseSettings($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n events {\n nodes {\n id\n name\n }\n }\n\n forms(level: Event) {\n nodes {\n id\n name\n }\n }\n\n eventsShowcaseSettings {\n title\n description\n events {\n eventId\n buttonText\n formId\n }\n }\n }\n}\n",{organizationId:e},[]),{mutate:a}=function(e={}){return ei("mutation OrganizationEventsShowcaseSettingsUpdate(\n $organizationId: OrganizationId!\n $eventsShowcaseSettings: EventsShowcaseSettingsInput!\n) {\n organizationEventsShowcaseSettingsUpdate(\n organizationId: $organizationId\n eventsShowcaseSettings: $eventsShowcaseSettings\n ) {\n id\n }\n}\n",e)}(),l=Zn(Ua),d=Zn(kY);return r||(0,i.jsx)(kl,{direction:"column",initialValues:{events:o.organization.eventsShowcaseSettings.events??[]},mutators:{setValue:([e,t],n,{changeValue:i})=>i(n,e,()=>t)},render:({form:e,handleSubmit:r,submitting:a,values:l})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(_b,{footerActions:(0,i.jsx)(Kb,{permissions:Hb.ORGANIZATION_PARAM_EDIT,children:(0,i.jsx)(zl,{isLoading:a,onClick:r,children:t("enregistrer_06519")})}),gap:"7",headerActions:(0,i.jsx)(Kb,{permissions:Hb.ORGANIZATION_PARAM_EDIT,children:(0,i.jsx)(zl,{onClick:()=>s(!0),children:t("ajouter_un_v_n_49943")})}),heading:t("difusion_des_v_78418"),subtitle:t("personnaliser_l_19452"),children:(0,i.jsx)(Ba,{direction:"column",gap:"6",children:(0,i.jsx)(BY,{events:o.organization.events.nodes,form:e,forms:o.organization.forms.nodes,values:l})})}),n&&(0,i.jsx)(FY,{eventIds:l.events.map(e=>e.eventId),setShowModal:s,setValue:t=>{e.change("events",[...l.events,t])},showModal:n})]}),validate:l.validateForForm(d.settingsInputSchema()),onSubmit:async t=>{await a({organizationId:e,eventsShowcaseSettings:t})}})},UY=()=>{const{translate:e,params:{organizationId:t}}=vl();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(lj,{css:{padding:"$6 $7 0 $7",borderBlockEnd:"1px solid $gray200"},children:(0,i.jsxs)(Ba,{direction:"column",gap:"4",children:[(0,i.jsx)(ml,{children:e("site_vitrine_17673")}),(0,i.jsxs)(uj,{css:{borderBlockEnd:"unset"},children:[(0,i.jsx)(cj,{path:yi.ORGANIZATION_SETTINGS_EVENTS_SHOWCASE_DESIGN({organizationId:t}),children:e("design_15043")}),(0,i.jsx)(cj,{path:yi.ORGANIZATION_SETTINGS_EVENTS_SHOWCASE_INTEGRATION({organizationId:t}),children:e("int_gration_10662")}),(0,i.jsx)(cj,{path:yi.ORGANIZATION_SETTINGS_EVENTS_SHOWCASE_SETTINGS({organizationId:t}),children:e("param_tres_78420")})]})]})}),(0,i.jsx)(aj,{css:{overflowY:"auto"},children:(0,i.jsxs)(Sr.dO,{children:[(0,i.jsx)(Sr.qh,{path:yi.ORGANIZATION_SETTINGS_EVENTS_SHOWCASE_DESIGN({organizationId:":organizationId"}),children:(0,i.jsx)(wY,{})}),(0,i.jsx)(Sr.qh,{path:yi.ORGANIZATION_SETTINGS_EVENTS_SHOWCASE_INTEGRATION({organizationId:":organizationId"}),children:(0,i.jsx)(hY,{alert:(0,i.jsxs)(gl,{alertStyle:"warning",children:[(0,i.jsx)(pl,{children:e("comment_marche_91826")}),(0,i.jsx)(fl,{children:e("ce_code_va_vous_11261")})]}),iframeLabel:e("code_html_pour_31742"),linkPath:Hi.EVENTS({organizationId:t})})}),(0,i.jsx)(Sr.qh,{path:yi.ORGANIZATION_SETTINGS_EVENTS_SHOWCASE_SETTINGS({organizationId:":organizationId"}),children:(0,i.jsx)(VY,{})})]})})]})},WY=e=>{const{history:t,translate:n,params:{organizationId:s}}=vl(),o=Zn(sI),r=Zn(hu),{mutate:a,isLoading:l}=function(e={}){return ei("mutation OrganizationUpdateInfos(\n $organizationId: OrganizationId!\n $organization: OrganizationInfosInput!\n) {\n organizationUpdateInfos(organizationId: $organizationId, organization: $organization) {\n id\n }\n}\n",e)}(),d=(0,L.useMemo)(()=>({organization:e.initialValues}),[e.initialValues]),c=(0,L.useMemo)(()=>eI.map((e,t)=>(0,i.jsx)("option",{value:e,children:e},t)),[]),u=Gs.c9.now();return(0,i.jsx)(kl,{css:{overflowY:"auto",padding:"$7"},direction:"column",height:1,initialValues:d,render:({form:o,handleSubmit:a,values:d})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(wT,{change:o.change,changeCity:!0,changeCountry:!0,changeLatLng:!1,changePostalCode:!0,name:"place",prefix:"organization."}),(0,i.jsx)(Ar,{color:"gray900",fontSize:"displayXs",fontWeight:"semiBold",children:n("organisation_71863")}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(Ju,{height:"5"}),(0,i.jsxs)(Ba,{gap:"7",children:[(0,i.jsx)(Ar,{font:"gray700 textSm medium",width:280,children:n("_propos_de_l_o_80406")}),(0,i.jsxs)(Ba,{css:{flex:"1"},direction:"column",gap:"4",children:[(0,i.jsx)(Vl,{label:n("nom_de_l_organi_49583"),name:"organization.name"}),(0,i.jsx)(IC,{addressName:"organization.street",label:n("Address"),placeName:"place"}),(0,i.jsx)(Vl,{label:n("code_postal_40328"),name:"organization.postalCode"}),(0,i.jsx)(Vl,{label:n("ville_67740"),name:"organization.city"}),(0,i.jsx)(Ym,{isSearchVisible:!0,label:n("Country"),name:"organization.country",children:r.getCountriesIdName().map(({id:e,name:t})=>(0,i.jsx)("option",{value:e,children:t},e))}),(0,i.jsx)(Ym,{isSearchVisible:!0,label:n("fuseau_horaire_14654"),name:"organization.timeZone",children:c})]})]}),(0,i.jsx)(Ju,{height:"5"}),(0,i.jsxs)(Ba,{gap:"7",children:[(0,i.jsx)(Ar,{font:"gray700 textSm medium",width:280,children:n("responsable_de_20624")}),(0,i.jsxs)(Ba,{css:{flex:"1"},direction:"column",gap:"4",children:[(0,i.jsx)(Vl,{label:n("nom_du_responsa_44907"),name:"organization.adminName"}),(0,i.jsx)(Vl,{isEmail:!0,label:n("e_mail_du_respo_66060"),name:"organization.adminEmail"})]})]}),(0,i.jsx)(Ju,{height:"5"}),(0,i.jsxs)(Ba,{gap:"7",children:[(0,i.jsx)(Ar,{font:"gray700 textSm medium",width:280,children:n("_metteur_de_e_m_77028")}),(0,i.jsx)(Ba,{css:{flex:"1"},direction:"column",gap:"4",children:(0,i.jsx)(Ym,{isCreateVisible:!0,isSearchVisible:!0,label:n("_metteur_des_e_27849"),name:"organization.emailSenderId",onCreateClick:()=>{t.push(Ps.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(s))},children:e.emailsSenders.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})})]}),(0,i.jsx)(Ju,{height:"5"}),(0,i.jsxs)(Ba,{gap:"7",children:[(0,i.jsx)(Ar,{font:"gray700 textSm medium",width:280,children:n("date_time_for_13370")}),(0,i.jsxs)(Ba,{css:{flex:"1"},direction:"column",gap:"4",children:[(0,i.jsx)(Vl,{hint:n("rendu_avec_la_d_41897",u.toFormat(d.organization.dateFormat)),label:n("format_de_date_82059"),name:"organization.dateFormat"}),(0,i.jsx)(Vl,{hint:n("rendu_avec_la_d_41897",u.toFormat(d.organization.datetimeFormat)),label:n("format_de_date_24474"),name:"organization.datetimeFormat"}),(0,i.jsx)(Vl,{hint:n("rendu_avec_la_d_41897",u.toFormat(d.organization.timeFormat)),label:n("format_d_heure_46798"),name:"organization.timeFormat"})]})]}),(0,i.jsxs)(Kb,{rolesTypes:bI,children:[(0,i.jsx)(Ju,{height:"5"}),(0,i.jsx)(Ba,{children:(0,i.jsx)(zl,{isLoading:l,onClick:a,children:n("enregistrer_les_30411")})})]})]}),schema:o.updateOrganizationGeneralSchema(),width:1,onSubmit:async e=>{await a({organizationId:s,organization:e.organization})}})},GY=()=>{const e=Zn(sI),{organizationId:t}=ti(),{data:n,loader:s}=Lo({organizationId:t});return s||(0,i.jsx)(WY,{emailsSenders:n.organization.emailsSenders,initialValues:e.organizationInfosInputDefault(n.organization)})},HY=()=>{const e=Xn(),{organizationId:t}=ti(),{data:n,loader:s}=Qn("query Invoices($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n invoices {\n id\n invoiceNumber\n amountCents\n smsAmountCents\n currency\n paidAt\n url\n insertedAt\n isRefunded\n }\n }\n}\n",{organizationId:t},[]);return s||(0,i.jsxs)(Ba,{css:{overflowY:"auto",padding:"$7"},direction:"column",height:1,children:[(0,i.jsx)(Ar,{color:"gray900",fontSize:"displayXs",fontWeight:"semiBold",children:e("factures_03552")}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(Lc,{filters:(0,i.jsx)(i.Fragment,{}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Gc,{children:e("num_ro_de_factu_68150")}),(0,i.jsx)(Gc,{children:e("Date")}),(0,i.jsx)(Gc,{children:e("montant_55595")}),(0,i.jsx)(Gc,{children:e("status_06428")}),(0,i.jsx)(Gc,{})]}),numberOfPages:1,offset:0,rows:(0,i.jsx)(i.Fragment,{children:n.organization.invoices.map((e,t)=>(0,i.jsx)(iu,{invoice:e,isBackoffice:!1,showColumn:()=>!0},t))}),setOffset:td.A,title:e("factures_03552"),totalCount:0})]})},qY=()=>{const{params:{organizationId:e},translate:t}=vl(),{data:n,loader:s}=ha({organizationId:e,includeIntro:!1,spaceType:kt.MembersSpace}),{mutate:o}=ma(),r=Zn(DE);return s||(0,i.jsx)(kl,{direction:"column",initialValues:{design:r.organizationDesignInputDefault(n.organization.spaceDesign)},render:({handleSubmit:e,submitting:n})=>(0,i.jsxs)(_b,{footerActions:(0,i.jsx)(Kb,{permissions:Hb.ORGANIZATION_PARAM_EDIT,children:(0,i.jsx)(Ba,{children:(0,i.jsx)(zl,{isLoading:n,onClick:e,children:t("enregistrer_06519")})})}),heading:t("design_15043"),hideHeader:!0,children:[(0,i.jsx)(LE,{heading:t("images_de_votre_51694"),showLogo:!0}),(0,i.jsx)(NE,{})]}),onSubmit:async t=>await o({organizationId:e,spaceDesign:t.design,spaceType:kt.MembersSpace})})},KY=()=>{const{params:{organizationId:e},translate:t}=vl(),[n,s]=(0,L.useState)($e.Code);return(0,i.jsx)(gb,{children:(0,i.jsx)(Ba,{direction:"column",children:(0,i.jsxs)(Ba,{gap:"7",children:[(0,i.jsxs)(Ba,{css:{flex:"1"},direction:"column",gap:"6",children:[(0,i.jsx)(ml,{children:t("liste_des_e_mai_73508")}),(0,i.jsxs)(Sc,{children:[(0,i.jsx)(kc,{children:(0,i.jsx)(Gc,{children:t("type_d_e_mail_06577")})}),(0,i.jsx)(bE,{isSelected:n===$e.Code,subtitle:t("cet_e_mail_est_80490"),title:t("code_20843"),onClick:()=>s($e.Code)})]})]}),(0,i.jsx)(Ar,{css:{borderRight:"1px solid $gray200",width:"1px"}}),(0,i.jsx)(Ba,{css:{flex:"1",py:"$3"},children:(0,i.jsx)(CE,{emailType:n,eventId:null,formId:null,organizationId:e,source:tt.MembersSpace})})]})})})},YY=()=>{const{params:{organizationId:e},translate:t}=vl(),{data:n,loader:s}=Qn("query OrganizationMembersSpaceSettings($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n hideAssignmentsUntilConfirmationEmailSent\n hideAccreditationsUntilConfirmationEmailSent\n\n membersSpaceExcludeAccreditations\n accreditationsCategories {\n nodes {\n id\n name\n\n accreditations {\n id\n name\n }\n }\n }\n }\n}\n",{organizationId:e},[]),{mutate:o}=function(e={}){return ei("mutation OrganizationMembersSpaceSettingsUpdate(\n $organizationId: OrganizationId!\n $membersSpaceSettings: MembersSpaceSettingsInput!\n) {\n organizationMembersSpaceSettingsUpdate(\n organizationId: $organizationId\n membersSpaceSettings: $membersSpaceSettings\n ) {\n id\n }\n}\n",e)}();return s||(0,i.jsx)(kl,{direction:"column",initialValues:{hideAssignmentsUntilConfirmationEmailSent:n.organization.hideAssignmentsUntilConfirmationEmailSent,hideAccreditationsUntilConfirmationEmailSent:n.organization.hideAccreditationsUntilConfirmationEmailSent,membersSpaceExcludeAccreditations:n.organization.membersSpaceExcludeAccreditations},render:({form:e,handleSubmit:s,submitting:o,values:r})=>(0,i.jsxs)(_b,{footerActions:(0,i.jsx)(Kb,{rolesTypes:bI,children:(0,i.jsx)(zl,{isLoading:o,onClick:s,children:t("enregistrer_06519")})}),heading:t("param_tres_de_l_83556"),subtitle:t("personnalisez_l_44387"),children:[(0,i.jsx)(ME,{heading:t("diffusion_des_a_83706"),children:(0,i.jsx)(Jm,{name:"hideAssignmentsUntilConfirmationEmailSent",children:t("afficher_les_af_06759")})}),(0,i.jsx)(ME,{heading:t("diffusion_des_a_32535"),children:(0,i.jsx)(Jm,{name:"hideAccreditationsUntilConfirmationEmailSent",children:t("afficher_les_ac_55704")})}),(0,i.jsx)(ME,{heading:t("restriction_de_66151"),children:(0,i.jsxs)(FE,{heading:t("quelle_s_accr_53793"),children:[(0,i.jsx)(vc,{css:{"& label > div > div":{fontWeight:"$regular !important"}},state:r.membersSpaceExcludeAccreditations?"unchecked":"checked",onClick:()=>{e.change("membersSpaceExcludeAccreditations",void 0)},children:t("afficher_toutes_12183")}),(0,i.jsx)(vc,{css:{"& label > div > div":{fontWeight:"$regular !important"}},state:r.membersSpaceExcludeAccreditations?"checked":"unchecked",onClick:()=>{e.change("membersSpaceExcludeAccreditations",[])},children:t("seulement_certa_92801")}),r.membersSpaceExcludeAccreditations&&(0,i.jsx)(Ym,{multiple:!0,name:"membersSpaceExcludeAccreditations",placeholder:t("ajouter_des_cat_15537"),children:n.organization.accreditationsCategories.nodes.map(e=>(0,i.jsx)("optgroup",{label:e.name,children:e.accreditations.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},e.id))})]})})]}),onSubmit:async t=>{await o({organizationId:e,membersSpaceSettings:t})}})},ZY=()=>{const{translate:e,params:{organizationId:t}}=vl();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(lj,{css:{padding:"$6 $7 0 $7",borderBlockEnd:"1px solid $gray200"},children:(0,i.jsxs)(Ba,{direction:"column",gap:"4",children:[(0,i.jsx)(ml,{children:e("espace_membres_90896")}),(0,i.jsxs)(uj,{css:{borderBlockEnd:"unset"},children:[(0,i.jsx)(cj,{path:yi.ORGANIZATION_SETTINGS_MEMBERS_SPACE_DESIGN({organizationId:t}),children:e("design_15043")}),(0,i.jsx)(cj,{path:yi.ORGANIZATION_SETTINGS_MEMBERS_SPACE_INTEGRATION({organizationId:t}),children:e("int_gration_10662")}),(0,i.jsx)(cj,{path:yi.ORGANIZATION_SETTINGS_MEMBERS_SPACE_EMAIL_TEMPLATES({organizationId:t}),children:e("mod_les_e_mail_91257")}),(0,i.jsx)(cj,{path:yi.ORGANIZATION_SETTINGS_MEMBERS_SPACE_SETTINGS({organizationId:t}),children:e("param_tres_78420")})]})]})}),(0,i.jsx)(aj,{css:{overflowY:"auto"},children:(0,i.jsxs)(Sr.dO,{children:[(0,i.jsx)(hj,{path:yi.ORGANIZATION_SETTINGS_MEMBERS_SPACE_DESIGN({organizationId:":organizationId"}),children:(0,i.jsx)(qY,{})}),(0,i.jsx)(hj,{path:yi.ORGANIZATION_SETTINGS_MEMBERS_SPACE_INTEGRATION({organizationId:":organizationId"}),children:(0,i.jsx)(hY,{alert:(0,i.jsxs)(gl,{alertStyle:"warning",children:[(0,i.jsx)(pl,{children:e("comment_marche_87686")}),(0,i.jsx)(fl,{children:e("ce_code_va_vous_50849")})]}),iframeLabel:e("code_html_pour_26450"),linkPath:pi(yi.ORGANIZATION({organizationId:t}))})}),(0,i.jsx)(hj,{path:yi.ORGANIZATION_SETTINGS_MEMBERS_SPACE_EMAIL_TEMPLATES({organizationId:":organizationId"}),children:(0,i.jsx)(KY,{})}),(0,i.jsx)(hj,{path:yi.ORGANIZATION_SETTINGS_MEMBERS_SPACE_SETTINGS({organizationId:":organizationId"}),children:(0,i.jsx)(YY,{})})]})})]})},XY=e=>{const t=ii(),n=e.isActive?e.isActive(t.pathname):t.pathname===e.path;return(0,i.jsx)(el,{to:e.path,children:(0,i.jsxs)(Zj,{active:n,css:{gap:"$3",justifyContent:"flex-start",px:"$3",width:"100%"},children:[(0,i.jsx)(Ar,{width:20,children:(0,i.jsx)(nl,{icon:e.icon})}),(0,i.jsx)(Ar,{children:e.title})]})})},JY=e=>{const{localOrganization:t,updateLocalOrganization:n}=TI(),[s,o]=L.useState(t?.areParametersMenuSectionsOpen?.[e.name]??!0),r=L.useCallback(async i=>{o(i),await n({areParametersMenuSectionsOpen:(0,Xa.A)(t?.areParametersMenuSectionsOpen,{[e.name]:i})})},[t,s,o]);return(0,i.jsxs)(Ba,{css:{borderBottom:"1px solid $gray200",paddingBottom:"$1",paddingTop:"$4"},direction:"column",children:[(0,i.jsxs)(Ba,{align:"center",css:{color:"$gray800",cursor:"pointer",px:"$5"},gap:"3",onClick:async()=>{await r(!s)},children:[(0,i.jsx)(Ar,{css:{textTransform:"uppercase"},fontSize:"textXs",fontWeight:"semiBold",children:e.title}),(0,i.jsx)(Ar,{css:{fontSize:"10px"},children:(0,i.jsx)(nl,{icon:s?"chevron-down":"chevron-up"})})]}),s&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(Ba,{css:{px:"$3"},direction:"column",children:e.children})]})]})},QY=()=>{const{translate:e,params:{organizationId:t}}=vl();Md(e("param_tres_78420"));const{isOrganizationAdmin:n,isOrganizationReader:s,hasFeature:o}=TI(),{canOrganizationParamRead:r,canOrganizationUserRead:a}=DS();return(0,i.jsx)(Ba,{as:Ma.Nav,css:{background:"$gray100",overflowY:"auto",py:"$2"},height:1,children:(0,i.jsxs)(Ba,{"aria-orientation":"vertical",direction:"column",role:"menubar",width:240,children:[(0,i.jsxs)(JY,{name:"general",title:e("g_n_ral_64953"),children:[(0,i.jsx)(XY,{icon:"user",path:Ps.ORGANIZATION_PARAMETERS_PROFILE(t),title:e("mon_profil_48224")}),r&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(XY,{icon:"building",path:Ps.ORGANIZATION_PARAMETERS_INFOS(t),title:e("organisation_71863")}),(0,i.jsx)(XY,{icon:"wave-pulse",path:Ps.ORGANIZATION_PARAMETERS_ACTIVITY(t),title:e("activit_95747")})]})]}),r&&(0,i.jsxs)(JY,{name:"parameters",title:e("param_tres_78420"),children:[(0,i.jsx)(XY,{icon:"star",isActive:e=>e.includes(yi.ORGANIZATION_SETTINGS_EVENTS_SHOWCASE({organizationId:t})),path:yi.ORGANIZATION_SETTINGS_EVENTS_SHOWCASE_DESIGN({organizationId:t}),title:e("site_vitrine_17673")}),(0,i.jsx)(XY,{icon:"address-card",isActive:e=>e.includes(yi.ORGANIZATION_SETTINGS_MEMBERS_SPACE({organizationId:t})),path:yi.ORGANIZATION_SETTINGS_MEMBERS_SPACE_DESIGN({organizationId:t}),title:e("espace_membres_90896")}),o(Be.Delegation)&&(0,i.jsx)(XY,{icon:"users",isActive:e=>e.includes(yi.ORGANIZATION_SETTINGS_DELEGATION_SPACE({organizationId:t})),path:yi.ORGANIZATION_SETTINGS_DELEGATION_SPACE_DESIGN({organizationId:t}),title:e("espace_d_l_gati_59251")}),(0,i.jsx)(XY,{icon:"at",isActive:e=>e.includes(Ps.ORGANIZATION_PARAMETERS_EMAILS(t)),path:Ps.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(t),title:e("e_mails_09850")}),(0,i.jsx)(XY,{icon:"layer-group",isActive:e=>e.includes(Ps.ORGANIZATION_PARAMETERS_CATEGORIES(t)),path:Ps.ORGANIZATION_PARAMETERS_CATEGORIES_CUSTOM_FIELDS(t),title:e("cat_gories_24533")}),(0,i.jsx)(XY,{icon:"tag",path:Ps.ORGANIZATION_PARAMETERS_TAGS(t),title:e("tags_79499")}),(0,i.jsx)(XY,{icon:"language",path:Ps.ORGANIZATION_PARAMETERS_TRANSLATIONS(t),title:e("traductions_88349")})]}),a&&(0,i.jsxs)(JY,{name:"users",title:e("utilisateurs_04975"),children:[(0,i.jsx)(XY,{icon:"user-group",path:Ps.ORGANIZATION_PARAMETERS_TEAM(t),title:e("utilisateurs_04975")}),(0,i.jsx)(XY,{icon:"shield",path:Ps.ORGANIZATION_PARAMETERS_ROLES(t),title:e("r_les_et_permis_27853")})]}),n&&(0,i.jsx)(JY,{name:"subscription",title:e("abonnement_98940"),children:(0,i.jsx)(XY,{icon:"receipt",path:Ps.ORGANIZATION_PARAMETERS_INVOICES(t),title:e("factures_03552")})}),s&&o(Be.Skidata)&&(0,i.jsx)(JY,{name:"integrations",title:e("int_grations_88619"),children:(0,i.jsx)(XY,{icon:"person-skiing",path:Ps.ORGANIZATION_PARAMETERS_SKIDATA(t),title:"Skidata"})})]})})},eZ=()=>{const{translate:e,params:{organizationId:t}}=vl(),{data:n,loader:s}=qo({organizationId:t}),o=Zn(CT),r=Zn(Ua),{mutate:a,isLoading:l}=Ko(),{mutate:d}=ga(),{user:c}=ai(),{reload:u}=TI(),[h,m]=(0,L.useState)(!1);return s||(0,i.jsx)(kl,{css:{overflowY:"auto",padding:"$7"},direction:"column",height:1,initialValues:{userInfo:o.userInfoProfileInputDefault(n.user)},render:({handleSubmit:n})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ar,{color:"gray900",fontSize:"displayXs",fontWeight:"semiBold",children:e("mon_profil_48224")}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(Ar,{color:"gray800",fontSize:"textLg",fontWeight:"semiBold",children:e("informations_pe_37892")}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(Yj,{accept:yv.Images,acl:"public-read",allowCrop:!0,label:e("photo_de_profil_08618"),organizationId:t,prefix:"userInfo.fields.picture."}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(WK,{inputName:"userInfo."}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(Ar,{color:"gray800",fontSize:"textLg",fontWeight:"semiBold",children:e("compte_16579")}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(Ar,{color:"error700",css:{cursor:"pointer",textDecoration:"underline"},onClick:()=>{m(!0)},children:e("supprimer_mon_c_07051")}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(Ba,{children:(0,i.jsx)(zl,{isLoading:l,onClick:n,children:e("enregistrer_les_30411")})}),h&&(0,i.jsx)(cA,{buttonText:"Supprimer",subtext:e("_tes_vous_s_r_d_50084"),text:e("supprimer_mon_c_07051"),onClose:()=>{m(!1)},onDelete:async()=>{await d({}),X()}})]}),validate:r.validateForForm(o.updateProfileSchema()),width:1,onSubmit:async e=>{const{userProfileUpdate:{email:t,language:i}}=await a({userId:c.id,userInfoId:n.user.userInfo.id,userInfo:e.userInfo});c.email!==t||c.language!==i?X():u()}})},tZ=()=>{const{organizationId:e}=ti(),t=Xn();return(0,i.jsxs)(Ba,{align:"center",gap:"6",children:[(0,i.jsx)(Ar,{color:"gray900",css:{flexGrow:1},fontSize:"displayXs",fontWeight:"semiBold",children:t("r_les_et_permis_27853")}),(0,i.jsx)(Kb,{permissions:Hb.ORGANIZATION_USER_EDIT,children:(0,i.jsx)(zl,{to:Ps.CREATE_ORGANIZATION_PARAMETERS_ROLE(e),children:t("cr_er_un_nouvea_53551")})})]})},nZ=({role:e})=>{const{organizationId:t}=ti(),n=Xn(),{data:s,isLoading:o}=Qn("query RoleUses($organizationId: OrganizationId!, $roleId: RoleId!) {\n organization(id: $organizationId) {\n role(id: $roleId) {\n uses {\n __typename\n\n ... on UsersEvent {\n userInfo {\n id\n name\n }\n event {\n id\n name\n }\n }\n\n ... on UsersPosition {\n userInfo {\n id\n name\n }\n position {\n id\n name\n }\n }\n\n ... on UsersPositionsCategory {\n userInfo {\n id\n name\n }\n positionCategory {\n id\n name\n }\n }\n\n ... on UsersDelegationsCategory {\n userInfo {\n id\n name\n }\n delegationCategory {\n id\n name\n }\n }\n }\n }\n }\n}\n",{organizationId:t,roleId:e.id},[]);if(o)return(0,i.jsx)(lc,{borderRadius:"$1",height:18,width:160});{const e=s.organization.role.uses;if(0===e.length)return(0,i.jsx)("div",{children:n("ce_r_le_n_est_p_61959")});{const t=(0,cc.A)(e,e=>e.userInfo.id);return(0,i.jsxs)("div",{children:[(0,i.jsx)("div",{children:n("les_responsable_31151")}),Object.entries(t).map(([e,t])=>(0,i.jsxs)("dl",{children:[(0,i.jsx)("dt",{children:n("_1_sur_84610",t[0].userInfo.name)}),t.map(e=>"UsersEvent"===e.__typename?(0,i.jsx)("dd",{children:n("l_v_nement_1_80078",e.event.name)},e.event.id):"UsersPosition"===e.__typename?(0,i.jsx)("dd",{children:n("la_mission_1_50232",e.position.name)},e.position.id):"UsersPositionsCategory"===e.__typename?(0,i.jsx)("dd",{children:n("la_cat_gorie_1_00613",e.positionCategory.name)},e.positionCategory.id):(0,i.jsx)("dd",{children:n("la_cat_gorie_1_00613",e.delegationCategory.name)},e.delegationCategory.id))]},e))]})}}},iZ=({onClose:e,onDelete:t,role:n})=>{const s=Xn(),{organizationId:o}=ti(),{mutate:r}=function(e={}){return ei("mutation RoleDelete($organizationId: OrganizationId!, $roleId: RoleId!) {\n roleDelete(organizationId: $organizationId, roleId: $roleId) {\n id\n }\n}\n",e)}();return(0,i.jsx)(cA,{buttonText:s("supprimer_43083"),text:s("suppression_de_73669",n.name),onClose:e,onDelete:()=>r({organizationId:o,roleId:n.id}).then(e=>(t(),e)),children:(0,i.jsx)(nZ,{role:n})})},sZ=({onDelete:e,role:t})=>{const{history:n,translate:s,params:{organizationId:o}}=vl(),{mutate:r}=function(e={}){return ei("mutation RoleDuplicate($organizationId: OrganizationId!, $roleId: RoleId!) {\n roleDuplicate(organizationId: $organizationId, roleId: $roleId) {\n id\n }\n}\n",e)}(),{canOrganizationUserEdit:a}=DS(),[l,d]=(0,L.useState)(!1),c=(0,L.useMemo)(()=>a&&t.type===bt.Custom,[a,t]),u=async()=>{const{roleDuplicate:e}=await r({organizationId:o,roleId:t.id});n.push(Ps.EDIT_ORGANIZATION_PARAMETERS_ROLE(o,e.id))};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Yc,{children:[c&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Kd,{icon:"pen",onClick:()=>{n.push(Ps.EDIT_ORGANIZATION_PARAMETERS_ROLE(o,t.id))},children:s("_diter_62574")}),(0,i.jsx)(Kd,{icon:"clone",onClick:u,children:s("dupliquer_28256")}),(0,i.jsx)(Xu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Kd,{color:"red",icon:"trash-can",onClick:e=>{Vd(e.target),d(!0)},children:s("supprimer_43083")})]}),t.type!==bt.Custom&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Kd,{icon:"eye",onClick:()=>{n.push(Ps.EDIT_ORGANIZATION_PARAMETERS_ROLE(o,t.id))},children:s("voir_36533")}),(0,i.jsx)(Kd,{icon:"clone",onClick:u,children:s("dupliquer_28256")})]})]}),l&&(0,i.jsx)(iZ,{role:t,onClose:()=>{d(!1)},onDelete:e})]})},oZ=()=>{const{history:e,translate:t,params:{organizationId:n}}=vl(),{canOrganizationUserEdit:s}=DS(),{data:o,isLoading:r,reload:a}=Qn("query Roles($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n roles {\n id\n name\n description\n accessLevel\n type\n }\n }\n}\n",{organizationId:n},[]),{showNotification:l}=Ob(),d=(0,L.useMemo)(()=>(0,uc.A)(o.organization?.roles??[],e=>[e.accessLevel===vt.Organization?1:e.accessLevel===vt.Event?2:e.accessLevel===vt.Position?3:4,u(e.name)]),[o.organization]),c=()=>{l({color:"success",text:t("le_r_le_a_bien_53462")}),a()};return(0,i.jsx)(Cm,{"aria-busy":r,css:{height:"auto",overflow:"visible","& > div:first-child":{borderRadius:"$2 $2 0 0"},"& > div:last-child":{borderBottom:"1px solid $gray200",borderRadius:"0 0 $2 $2"}},headerRow:(0,i.jsxs)(kc,{children:[(0,i.jsx)(Gc,{children:t("nom_du_r_le_38492")}),(0,i.jsx)(Gc,{children:t("niveau_d_acc_s_29898")}),(0,i.jsx)(Gc,{css:{flexGrow:2},children:t("description_du_94520")}),s&&(0,i.jsx)(Gc,{width:100})]}),children:r?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Hc,{}),(0,i.jsx)(Hc,{css:{borderBottom:"none"}})]}):d.map(o=>(0,i.jsxs)(Mc,{css:{cursor:"pointer","&:hover":{background:"$gray100"},"&:last-child":{borderBottom:"none"}},onClick:()=>{e.push(Ps.EDIT_ORGANIZATION_PARAMETERS_ROLE(n,o.id))},onMouseLeave:e=>{Vd(e.target)},children:[(0,i.jsx)(Oc,{children:(0,i.jsx)(Ar,{ellipsis:!0,title:o.name,children:o.name})}),(0,i.jsx)(Oc,{children:o.accessLevel===vt.Organization?t("administrateur_10076"):o.accessLevel===vt.Event?t("administrateur_99393"):o.accessLevel===vt.Position?t("responsable_de_82794"):t("responsable_de_75445")}),(0,i.jsx)(Oc,{css:{flexGrow:2,minWidth:0},children:(0,i.jsx)(Ar,{ellipsis:!0,title:o.description,children:o.description})}),s&&(0,i.jsx)(Xc,{justify:"end",children:(0,i.jsx)(sZ,{role:o,onDelete:c})})]},o.id))})},rZ=()=>{const e=Xn();return(0,i.jsxs)(Ba,{css:{overflowY:"auto",padding:"$6 $7"},direction:"column",gap:"6",height:1,children:[(0,i.jsx)(tZ,{}),(0,i.jsx)(al.Root,{children:(0,i.jsxs)(al.Titled,{children:[(0,i.jsx)(al.Title,{icon:"circle-info",children:e("contr_ler_les_p_50104")}),(0,i.jsx)(al.Text,{children:e("les_r_les_aiden_19371")})]})}),(0,i.jsx)(oZ,{})]})};let aZ=class extends Gl{constructor(e){super(e)}connectionInfosInputDefault(e){return{url:e?.url??"",issuer:e?.issuer??"",receiver:e?.receiver??"",synchronizedEventsIds:e?.synchronizedEventsIds??[],seasonEventsIds:e?.seasonEventsIds??[],place:e?.place??""}}};aZ=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[qn])],aZ);const lZ=e=>{const t=Xn(),n=Zn(Jc),{mutate:s}=function(e={}){return ei("mutation SkidataConnectionInfoSeaonEventAdd($organizationId: OrganizationId!, $eventId: EventId!) {\n skidataConnectionInfoSeaonEventAdd(organizationId: $organizationId, eventId: $eventId) {\n organizationId\n }\n}\n",e)}(),{mutate:o}=function(e={}){return ei("mutation SkidataConnectionInfoSeaonEventDelete(\n $organizationId: OrganizationId!\n $eventId: EventId!\n) {\n skidataConnectionInfoSeaonEventDelete(organizationId: $organizationId, eventId: $eventId) {\n organizationId\n }\n}\n",e)}(),{mutate:r}=function(e={}){return ei("mutation SkidataConnectionInfoSynchronizedEventAdd(\n $organizationId: OrganizationId!\n $eventId: EventId!\n) {\n skidataConnectionInfoSynchronizedEventAdd(organizationId: $organizationId, eventId: $eventId) {\n organizationId\n }\n}\n",e)}(),{mutate:a}=function(e={}){return ei("mutation SkidataConnectionInfoSynchronizedEventDelete(\n $organizationId: OrganizationId!\n $eventId: EventId!\n) {\n skidataConnectionInfoSynchronizedEventDelete(\n organizationId: $organizationId\n eventId: $eventId\n ) {\n organizationId\n }\n}\n",e)}();return(0,i.jsxs)(Ba,{gap:"3",width:1,children:[(0,i.jsxs)(Ba,{direction:"column",gap:"1",width:280,children:[(0,i.jsx)(Ar,{color:"gray700",fontWeight:"medium",children:e.title}),(0,i.jsx)(Ar,{color:"gray500",children:e.subtitle})]}),(0,i.jsx)(Ar,{width:1,children:(0,i.jsxs)(Sc,{children:[(0,i.jsxs)(kc,{children:[(0,i.jsx)(Gc,{children:t("nom_de_l_v_nem_08711")}),(0,i.jsx)(Gc,{children:t("Date")}),"all"===e.eventType&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Gc,{}),(0,i.jsx)(Gc,{})]}),"synchronized"===e.eventType&&(0,i.jsx)(Gc,{}),"season"===e.eventType&&(0,i.jsx)(Gc,{})]}),so(e.events)?e.events.map(l=>(0,i.jsxs)(Mc,{children:[(0,i.jsx)(Oc,{children:(0,i.jsx)(Ar,{color:"gray800",width:1,children:l.name})}),(0,i.jsx)(Oc,{children:Wx(n,l.startAt,l.endAt)}),"all"===e.eventType&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Oc,{onClick:async()=>{await r({organizationId:e.organizationId,eventId:l.id}),e.reload()},children:(0,i.jsx)(Ar,{color:"primary500",css:{cursor:"pointer"},fontWeight:"medium",width:1,children:t("synchroniser_34754")})}),(0,i.jsx)(Oc,{onClick:async()=>{await s({organizationId:e.organizationId,eventId:l.id}),e.reload()},children:(0,i.jsx)(Ar,{color:"primary500",css:{cursor:"pointer"},fontWeight:"medium",width:1,children:t("_v_nement_saiso_67885")})})]}),"synchronized"===e.eventType&&(0,i.jsx)(Oc,{onClick:async()=>{await a({organizationId:e.organizationId,eventId:l.id}),e.reload()},children:(0,i.jsx)(Ar,{color:"error700",css:{cursor:"pointer"},fontWeight:"medium",width:1,children:t("supprimer_43083")})}),"season"===e.eventType&&(0,i.jsx)(Oc,{onClick:async()=>{await o({organizationId:e.organizationId,eventId:l.id}),e.reload()},children:(0,i.jsx)(Ar,{color:"error700",css:{cursor:"pointer"},fontWeight:"medium",width:1,children:t("supprimer_43083")})})]},l.id)):(0,i.jsx)(Mc,{css:{height:"auto"},children:(0,i.jsx)(Oc,{children:(0,i.jsxs)(Ba,{align:"center",css:{padding:"$8"},direction:"column",gap:"4",width:1,children:[(0,i.jsx)(sC,{color:"primary",icon:"magnifying-glass"}),(0,i.jsx)(Ar,{fontSize:"textMd",fontWeight:"medium",children:t("aucun_v_nement_39620")})]})})})]})})]})},dZ=()=>{const e=Xn(),{organizationId:t}=ti(),n=Zn(aZ),{data:s,loader:o,reload:r}=Qn("query SkidataConnectionInfos($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n events(states: [Ongoing, Upcoming]) {\n nodes {\n id\n name\n startAt\n endAt\n }\n }\n\n skidataConnectionInfos {\n url\n issuer\n receiver\n seasonEventsIds\n synchronizedEventsIds\n place\n }\n }\n}\n",{organizationId:t},[]),{mutate:a}=function(e={}){return ei("mutation SkidataConnectionInfosDelete($organizationId: OrganizationId!) {\n skidataConnectionInfosDelete(organizationId: $organizationId) {\n organizationId\n }\n}\n",e)}(),{mutate:l,isLoading:d}=function(e={}){return ei("mutation SkidataConnectionInfosUpsert(\n $organizationId: OrganizationId!\n $connectionInfos: SkidataConnectionInfoInput!\n) {\n skidataConnectionInfosUpsert(\n organizationId: $organizationId\n connectionInfos: $connectionInfos\n ) {\n organizationId\n }\n}\n",e)}(),{mutate:c,isLoading:u}=function(e={}){return ei("mutation SkidataSynchronize($organizationId: OrganizationId!) {\n skidataSynchronize(organizationId: $organizationId)\n}\n",e)}(),h=(0,L.useMemo)(()=>s.organization?.events.nodes??[],[s.organization]),m=(0,L.useMemo)(()=>h.map(({id:e})=>e),[h]),g=(0,L.useMemo)(()=>s.organization?.skidataConnectionInfos?.synchronizedEventsIds??[],[s.organization]),p=(0,L.useMemo)(()=>s.organization?.skidataConnectionInfos?.seasonEventsIds??[],[s.organization]),f=(0,L.useMemo)(()=>{const e=(0,mc.A)(m,g.concat(p));return h.filter(t=>e.includes(t.id))},[h,g,p]),_=(0,L.useMemo)(()=>h.filter(e=>g.includes(e.id)),[h]),x=(0,L.useMemo)(()=>h.filter(e=>p.includes(e.id)),[h,p]);return o||(0,i.jsx)(kl,{css:{overflowY:"auto",padding:"$7"},direction:"column",height:1,initialValues:{connectionInfos:n.connectionInfosInputDefault(s.organization.skidataConnectionInfos)},render:({handleSubmit:n})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ba,{gap:"3",children:[(0,i.jsx)(Ar,{color:"gray900",css:{flex:"1"},fontSize:"displayXs",fontWeight:"semiBold",children:"Skidata"}),s.organization.skidataConnectionInfos&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zl,{isLoading:d,onClick:n,children:e("enregistrer_06519")}),(0,i.jsxs)(km,{children:[(0,i.jsx)(Sm,{children:(0,i.jsx)(Ar,{children:u?(0,i.jsx)(zl,{color:"white",leftIcon:"loader"}):(0,i.jsx)(zl,{color:"white",leftIcon:"arrows-rotate",onClick:async()=>{await c({organizationId:t})}})})}),(0,i.jsx)(wm,{placement:"top",children:e("synchroniser_34754")})]}),(0,i.jsxs)(km,{children:[(0,i.jsx)(Sm,{children:(0,i.jsx)(Ar,{children:(0,i.jsx)(zl,{color:"white",leftIcon:"arrow-right-from-bracket",onClick:async()=>{await a({organizationId:t}),r()}})})}),(0,i.jsx)(wm,{placement:"top",children:e("se_d_connecter_74151")})]})]})]}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsxs)(Ba,{align:"center",gap:"3",width:1,children:[(0,i.jsx)(Ar,{color:"gray700",fontWeight:"medium",width:280,children:e("adresse_du_web_92125")}),(0,i.jsx)(Vl,{name:"connectionInfos.url"})]}),(0,i.jsx)(Ju,{height:"5"}),(0,i.jsxs)(Ba,{align:"center",gap:"3",width:1,children:[(0,i.jsx)(Ar,{color:"gray700",fontWeight:"medium",width:280,children:"Issuer"}),(0,i.jsx)(Vl,{name:"connectionInfos.issuer"})]}),(0,i.jsx)(Ju,{height:"5"}),(0,i.jsxs)(Ba,{align:"center",gap:"3",width:1,children:[(0,i.jsx)(Ar,{color:"gray700",fontWeight:"medium",width:280,children:"Receiver"}),(0,i.jsx)(Vl,{name:"connectionInfos.receiver"})]}),(0,i.jsx)(Ju,{height:"5"}),(0,i.jsxs)(Ba,{align:"center",gap:"3",width:1,children:[(0,i.jsx)(Ar,{color:"gray700",fontWeight:"medium",width:280,children:e("lieu_20541")}),(0,i.jsx)(Vl,{name:"connectionInfos.place"})]}),s.organization.skidataConnectionInfos&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"5"}),(0,i.jsx)(Xu,{direction:"horizontal"}),(0,i.jsx)(Ya,{height:"5"}),(0,i.jsx)(lZ,{eventType:"all",events:f,organizationId:t,reload:r,subtitle:"",title:e("liste_des_v_ne_29929")}),(0,i.jsx)(Ju,{height:"5"}),(0,i.jsx)(lZ,{eventType:"synchronized",events:_,organizationId:t,reload:r,subtitle:e("ces_v_nements_58722"),title:e("liste_des_v_ne_09741")}),(0,i.jsx)(Ju,{height:"5"}),(0,i.jsx)(lZ,{eventType:"season",events:x,organizationId:t,reload:r,subtitle:e("ces_v_nements_24479"),title:e("liste_des_v_ne_73078")})]}),!s.organization.skidataConnectionInfos&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"5"}),(0,i.jsx)(Ba,{justify:"end",children:(0,i.jsx)(zl,{isLoading:d,onClick:n,children:e("se_connecter_63820")})})]})]}),width:1,onSubmit:async e=>{await l({organizationId:t,connectionInfos:e.connectionInfos}),r()}})},cZ=e=>{const t=Xn(),{mutate:n}=function(e={}){return ei("mutation TagUpdateName($organizationId: OrganizationId!, $tagId: TagId!, $name: String!) {\n tagUpdateName(organizationId: $organizationId, tagId: $tagId, name: $name) {\n id\n }\n}\n",e)}();return(0,i.jsx)(oC,{buttonText:t("renommer_42135"),icon:"tag",initialValues:{name:e.name},title:t("renommer_1_40542",e.name),onClose:e.onClose,onSubmit:async t=>{await n({organizationId:e.organizationId,tagId:e.tagId,name:t.name}),e.onSuccess(),e.onClose()},children:(0,i.jsx)(Vl,{label:t("nom_du_tag_95054"),name:"name"})})},uZ=e=>{const t=Xn(),{canOrganizationParamEdit:n}=DS(),{mutate:s}=function(e={}){return ei("mutation TagDelete($organizationId: OrganizationId!, $tagId: TagId!) {\n tagDelete(organizationId: $organizationId, tagId: $tagId) {\n id\n }\n}\n",e)}(),[o,r]=(0,L.useState)(!1),[a,l]=(0,L.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Mc,{css:{"&:hover":{background:"$gray100"}},children:[(0,i.jsx)(Oc,{css:{color:"$gray800"},children:e.tag.name}),(0,i.jsx)(Oc,{children:e.tag.numberOfTimesUsed}),n&&(0,i.jsxs)(Xc,{justify:"center",children:[(0,i.jsxs)(km,{children:[(0,i.jsx)(Sm,{children:(0,i.jsx)(Ar,{children:(0,i.jsx)(nl,{icon:"pen",onClick:()=>{r(!0)}})})}),(0,i.jsx)(wm,{placement:"top",children:t("_diter_62574")})]}),(0,i.jsxs)(km,{children:[(0,i.jsx)(Sm,{children:(0,i.jsx)(Ar,{color:"error700",children:(0,i.jsx)(nl,{icon:"trash-can",onClick:()=>{l(!0)}})})}),(0,i.jsx)(wm,{placement:"top",children:t("supprimer_02105")})]})]})]}),o&&(0,i.jsx)(cZ,{name:e.tag.name,organizationId:e.organizationId,tagId:e.tag.id,onClose:()=>{r(!1)},onSuccess:e.reload}),a&&(0,i.jsx)(cA,{buttonText:t("supprimer_43083"),subtext:t("_tes_vous_s_r_d_70200"),text:t("suppression_de_73669",e.tag.name),onClose:()=>{l(!1)},onDelete:async()=>{await s({organizationId:e.organizationId,tagId:e.tag.id}),e.reload()}})]})},hZ=()=>{const{translate:e,params:{organizationId:t}}=vl(),{canOrganizationParamEdit:n}=DS(),[s,o,r]=Wc(""),[a,l]=(0,L.useState)(0),{data:d,isLoading:c,reload:u}=Qn("query OrganizationTags($organizationId: OrganizationId!, $name: String, $offset: Int) {\n organization(id: $organizationId) {\n tags(name: $name, offset: $offset, limit: 25) {\n nodes {\n id\n name\n numberOfTimesUsed\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{organizationId:t,name:m(o)?o:void 0,offset:a},[]);const{numberOfPages:h,totalCount:g}=Su(d.organization?.tags),[p,f]=(0,L.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ba,{css:{overflowY:"auto",padding:"$7"},direction:"column",height:1,children:[(0,i.jsxs)(Ba,{gap:"3",children:[(0,i.jsx)(Ar,{color:"gray900",css:{flex:"1"},fontSize:"displayXs",fontWeight:"semiBold",children:e("tags_79499")}),(0,i.jsx)(Kb,{permissions:Hb.ORGANIZATION_PARAM_EDIT,children:(0,i.jsx)(zl,{onClick:()=>{f(!0)},children:e("cr_er_un_nouvea_56617")})})]}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(Lc,{filters:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Ar,{width:320,children:(0,i.jsx)(Bl,{icon:"magnifying-glass",placeholder:e("rechercher_un_t_34829"),value:s,onChange:r})})}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Gc,{children:e("nom_08311")}),(0,i.jsx)(Gc,{children:e("nombre_d_utilis_58389")}),n&&(0,i.jsx)(Gc,{width:100})]}),numberOfPages:h,offset:a,rows:c?(0,i.jsx)(i.Fragment,{}):d.organization.tags.nodes.map(e=>(0,i.jsx)(uZ,{organizationId:t,reload:u,tag:e},e.id)),setOffset:l,title:e("liste_des_tags_83521"),totalCount:g})]}),p&&(0,i.jsx)(rC,{organizationId:t,onClose:()=>{f(!1)},onSuccess:u})]})};function mZ(e,t){const n=e[`${t.toLowerCase()}String`];return m(n)?n:m(e.enString)?e.enString:m(e.frString)?e.frString:m(e.esString)?e.esString:m(e.deString)?e.deString:m(e.nlString)?e.nlString:""}const gZ=e=>{const{translate:t,params:{organizationId:n}}=vl(),{user:s}=ai(),{mutate:o,isLoading:r}=function(e={}){return ei("mutation TranslationUpdate(\n $organizationId: OrganizationId!\n $translationId: TranslationId!\n $translation: TranslationInput!\n) {\n translationUpdate(\n organizationId: $organizationId\n translationId: $translationId\n translation: $translation\n ) {\n id\n }\n}\n",e)}(),[a,l]=(0,L.useState)(!1),[d,c]=(0,L.useState)(Object.fromEntries(e.languages.map(t=>[t,e.translation[t.toLowerCase()]||""]))),u=s.language,h=e.languages.every(t=>e.translation[`is${t}Translated`]);return(0,i.jsxs)(Ba,{css:{border:"1px solid $gray200",borderBottom:e.isLast?"1px solid $gray200":"none",borderBottomLeftRadius:e.isLast?"$2":"0",borderBottomRightRadius:e.isLast?"$2":"0",borderTopLeftRadius:e.isFirst?"$2":"0",borderTopRightRadius:e.isFirst?"$2":"0",overflow:"hidden"},direction:"column",children:[(0,i.jsxs)(Ba,{align:"center",css:{background:"white",cursor:"pointer",padding:"$4",userSelect:"none"},gap:"2",width:1,onClick:()=>{l(!a)},children:[(0,i.jsx)(zl,{color:"invisible",css:{color:"$gray700"},leftIcon:a?"chevron-down":"chevron-right"}),(0,i.jsx)(Ar,{css:{flex:"1"},font:"gray800 textMd medium",children:mZ(e.translation,u)}),(0,i.jsxs)(Ba,{gap:"3",children:[(0,i.jsx)(rc,{children:t(e.translation.module)}),h?(0,i.jsx)(rc,{color:"success",children:t("Translated")}):(0,i.jsx)(rc,{color:"warning",children:t("NotTranslated")})]})]}),a&&(0,i.jsxs)(Ba,{css:{background:"$gray100",padding:"$6"},direction:"column",gap:"6",children:[e.languages.map(t=>{const n=`Version ${t}`;return e.translation.translationType===Rt.RichText?(0,i.jsx)(ob,{initialValue:d[t],label:n,onChange:e=>{c({...d,[t]:e})}},t):(0,i.jsx)(Bl,{label:n,value:d[t],onChange:e=>{c({...d,[t]:e})}},t)}),(0,i.jsx)(Kb,{permissions:Hb.ORGANIZATION_PARAM_EDIT,children:(0,i.jsx)(Ba,{children:(0,i.jsx)(zl,{isLoading:r,onClick:async()=>{await o({organizationId:n,translationId:e.translation.id,translation:Object.fromEntries(Object.entries(d).map(([e,t])=>[e.toLowerCase(),t]))})},children:t("mettre_jour_85141")})})})]})]})},pZ=e=>{const t=Xn(),n=Bc(),[s,o]=(0,L.useState)(!1),[r,a]=(0,L.useState)(e.eventsIds),[l,d]=(0,L.useState)(e.modules),[c,u]=(0,L.useState)(e.translationStatus),h=(0,L.useMemo)(()=>(0,uc.A)(e.organization.events.nodes,e=>e.name.toLowerCase()),[e.organization]);return(0,i.jsxs)(Ba,{css:{background:"white",bd:!0,padding:"$4"},gap:"3",children:[(0,i.jsx)(Bl,{icon:"search",placeholder:t("rechercher_une_22159"),value:e.content,onChange:e.setContent}),(0,i.jsxs)(EC,{apply:()=>{e.setEventsIds(r),e.setModules(l),e.setTranslationStatus(c),o(!1)},color:"gray",isOpen:s,reinit:()=>{e.setEventsIds([]),a([]),e.setModules([]),d([]),e.setTranslationStatus(Ot.TranslatedAndNotTranslated),u(Ot.TranslatedAndNotTranslated),o(!1)},showButtons:!0,onStateChange:o,children:[(0,i.jsx)(yc,{isSearchVisible:!0,label:t("_v_nements_53672"),multiple:!0,renderOnPortal:!0,values:r,onChange:a,children:h.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(yc,{isSearchVisible:!0,label:t("module_67984"),multiple:!0,renderOnPortal:!0,values:l,onChange:d,children:n(Pn)}),(0,i.jsx)($u,{label:t("statut_de_tradu_58384"),value:c,onChange:u,children:n(Fn)})]})]})},fZ=e=>(0,i.jsx)(Ba,{css:{background:"white",border:"1px solid $gray200",borderBottom:e.isLast?"1px solid $gray200":"none",borderBottomLeftRadius:e.isLast?"$2":"0",borderBottomRightRadius:e.isLast?"$2":"0",borderTopLeftRadius:e.isFirst?"$2":"0",borderTopRightRadius:e.isFirst?"$2":"0",padding:"$4"},children:(0,i.jsx)(lc,{borderRadius:"$2",height:32,width:1})}),_Z=e=>{const{translate:t}=vl(),n=e.organization.translations.totalCount-e.organization.translated.totalCount;return(0,i.jsxs)(Ba,{css:{height:"fit-content"},gap:"6",width:1,children:[(0,i.jsx)(Ar,{width:.3,children:(0,i.jsx)(pN,{css:{height:"100%"},children:(0,i.jsxs)(Ba,{direction:"column",gap:"4",children:[(0,i.jsx)(Ar,{font:"gray500 textSm medium",children:t("nombre_de_langu_75924")}),(0,i.jsx)(Ar,{font:"gray900 displayMd medium",children:e.organization.languages.length})]})})}),(0,i.jsx)(Ar,{css:{flex:"1"},children:(0,i.jsx)(pN,{children:(0,i.jsxs)(Ba,{gap:"6",justify:"between",children:[(0,i.jsxs)(Ba,{direction:"column",gap:"4",children:[(0,i.jsx)(Ar,{font:"gray500 textSm medium",children:t("nombre_de_champ_26560")}),(0,i.jsx)(Ar,{font:"gray900 displayMd medium",children:e.organization.translations.totalCount})]}),(0,i.jsxs)(Ba,{direction:"column",gap:"3",children:[(0,i.jsx)(Ar,{font:"gray700 textXs semiBold",children:t("dont_10477")}),(0,i.jsxs)(Ba,{align:"center",gap:"8",justify:"between",children:[(0,i.jsx)(Ar,{font:"gray500 textSm medium",children:t("champs_tradui_47609")}),(0,i.jsx)(Ar,{font:"gray900 textMd semiBold",children:n})]}),(0,i.jsxs)(Ba,{align:"center",gap:"8",justify:"between",children:[(0,i.jsx)(Ar,{font:"gray500 textSm medium",children:t("champs_traduits_03119")}),(0,i.jsx)(Ar,{font:"gray900 textMd semiBold",children:e.organization.translated.totalCount})]})]})]})})})]})},xZ=e=>{const{translate:t,params:{organizationId:n}}=vl(),[s,o,r]=Wc(""),[a,l]=(0,L.useState)([]),[d,c]=(0,L.useState)(Ot.TranslatedAndNotTranslated),[u,h]=(0,L.useState)([]),[g,p]=(0,L.useState)(0),{data:f,isLoading:_}=Qn("query OrganizationTranslations(\n $organizationId: OrganizationId!\n $content: String\n $status: TranslationStatus\n $eventsIds: [EventId!]\n $modules: [TranslationModule!]\n $offset: Int\n) {\n organization(id: $organizationId) {\n translations(\n content: $content\n status: $status\n eventsIds: $eventsIds\n modules: $modules\n limit: 25\n offset: $offset\n ) {\n nodes {\n ...Translation\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{organizationId:n,content:m(o)?o:null,eventsIds:a,modules:u,status:d,offset:g},[Vs.TranslationFragment]);const{numberOfPages:x,totalCount:I}=Su(f.organization?.translations),v=f.organization?.translations.nodes??[];return(0,i.jsxs)(Ba,{css:{overflowY:"auto"},direction:"column",height:1,children:[(0,i.jsxs)(Ba,{css:{borderBottom:"1px solid $gray200",padding:"$6 $7"},direction:"column",children:[(0,i.jsx)(Ar,{font:"gray900 textXl medium",children:t("traductions_88349")}),(0,i.jsx)(Ar,{color:"gray500",children:t("g_rer_toutes_le_39107")})]}),(0,i.jsxs)(Ba,{css:{background:"$gray50",flex:"1",padding:"$7"},direction:"column",children:[(0,i.jsx)(_Z,{organization:e.organization}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(pZ,{content:s,eventsIds:a,modules:u,organization:e.organization,setContent:r,setEventsIds:l,setModules:h,setTranslationStatus:c,translationStatus:d}),(0,i.jsx)(Ya,{height:"4"}),_?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fZ,{isFirst:!0,isLast:!1}),(0,i.jsx)(fZ,{isFirst:!1,isLast:!1}),(0,i.jsx)(fZ,{isFirst:!1,isLast:!0})]}):v.map((t,n)=>(0,i.jsx)(gZ,{isFirst:0===n,isLast:n===v.length-1,languages:e.organization.languages,translation:t},t.id)),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(Fc,{numberOfPages:x,offset:g,setOffset:p,totalCount:I})]})]})},IZ=()=>{const{params:{organizationId:e}}=vl(),{data:t,loader:n}=Qn("query OrganizationTranslationsStats($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n languages\n\n events {\n nodes {\n id\n name\n }\n }\n\n translations {\n totalCount\n }\n\n translated: translations(status: Translated) {\n totalCount\n }\n }\n}\n",{organizationId:e},[]);return n||(0,i.jsx)(xZ,{organization:t.organization})},vZ=e=>{const{translate:t,params:{organizationId:n}}=vl(),{showNotification:s}=Ob(),{mutate:o}=function(e={}){return ei("mutation UserRolesDelete($organizationId: OrganizationId!, $userId: UserId!) {\n userRolesDelete(organizationId: $organizationId, userId: $userId)\n}\n",e)}(),r=function(e,t){const{mutate:n}=Yo();return(0,L.useCallback)(()=>Promise.all([$e.PositionCategoryLeaderAssign,$e.PositionLeaderAssign,$e.DelegationCategoryLeaderAssign,$e.DelegationLeaderAssign,$e.EventInvite,$e.OrganizationInvite].map(i=>n({organizationId:e,userInfoId:t,emailType:i}))),[n,e,t])}(n,e.userInfo.id),[a,l]=(0,L.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Yc,{children:[(0,i.jsx)(Kd,{icon:"paper-plane",onClick:async e=>{Vd(e.target),await r()},children:t("r_envoyer_l_e_96215")}),(0,i.jsx)(Xu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Kd,{color:"red",icon:"trash-can",onClick:e=>{Vd(e.target),l(!0)},children:t("supprimer_l_acc_85342")})]}),a&&(0,i.jsx)(cA,{buttonText:t("supprimer_les_a_96621"),subtext:t("_tes_vous_s_r_d_35776",e.userInfo.nameOrEmail),text:t("supprimer_l_acc_85342"),onClose:()=>l(!1),onDelete:async()=>{await o({organizationId:n,userId:e.userInfo.userId}),s(t("tous_les_acc_s_26440",e.userInfo.nameOrEmail)),e.reload()}})]})};var bZ;!function(e){e[e.Delegations=0]="Delegations",e[e.DelegationsCategories=1]="DelegationsCategories",e[e.Positions=2]="Positions",e[e.PositionsCategories=3]="PositionsCategories"}(bZ||(bZ={}));const jZ=e=>{const{translate:t}=vl(),n=(0,L.useMemo)(()=>e.level??(e.eventId?ot.Event:ot.Both),[e.eventId,e.level]),[s,o]=(0,L.useState)(!1),[r,a]=(0,L.useState)(null),[l,d,c]=Wc("");(0,L.useEffect)(()=>{(async()=>{if(o(!0),e.resource===bZ.Delegations){const{organization:s}=await(t={organizationId:e.organizationId,eventId:e.eventId,hasSelected:e.hasSelected,level:n,name:m(d)?d:void 0,ids:e.ids},i=await Y(),go('query DelegationsSearch(\n $organizationId: OrganizationId!\n $eventId: EventId\n $hasSelected: Boolean!\n $level: OrganizationEventLevel!\n $ids: [DelegationId!]!\n $name: String\n) {\n organization(id: $organizationId) {\n name\n\n list: delegations(\n level: $level\n eventId: $eventId\n name: $name\n limit: 50\n sort: { attribute: "Name", direction: Asc }\n ) {\n nodes {\n id\n name\n\n event {\n id\n name\n }\n }\n }\n\n selected: delegations(level: $level, ids: $ids) @include(if: $hasSelected) {\n nodes {\n id\n name\n\n event {\n id\n name\n }\n }\n }\n }\n}\n',{variables:t,token:i||void 0,fragments:[]}));a(s)}else if(e.resource===bZ.DelegationsCategories){const{organization:t}=await function(e,t){return go('query DelegationsCategoriesSearch(\n $organizationId: OrganizationId!\n $eventId: EventId\n $hasSelected: Boolean!\n $level: OrganizationEventLevel!\n $ids: [DelegationsCategoryId!]!\n $name: String\n) {\n organization(id: $organizationId) {\n name\n\n list: delegationsCategories(\n level: $level\n eventId: $eventId\n name: $name\n limit: 50\n sort: { attribute: "Name", direction: Asc }\n ) {\n nodes {\n id\n name\n\n event {\n id\n name\n }\n }\n }\n\n selected: delegationsCategories(level: $level, ids: $ids) @include(if: $hasSelected) {\n nodes {\n id\n name\n\n event {\n id\n name\n }\n }\n }\n }\n}\n',{variables:e,token:t||void 0,fragments:[]})}({organizationId:e.organizationId,eventId:e.eventId,hasSelected:e.hasSelected,level:n,name:m(d)?d:void 0,ids:e.ids},await Y());a(t)}else if(e.resource===bZ.Positions){const{organization:t}=await function(e,t){return go(xo,{variables:e,token:t||void 0,fragments:[]})}({organizationId:e.organizationId,eventId:e.eventId,hasSelected:e.hasSelected,name:m(d)?d:void 0,ids:e.ids},await Y());a(t)}else if(e.resource===bZ.PositionsCategories){const{organization:t}=await function(e,t){return go('query PositionsCategoriesSearch(\n $organizationId: OrganizationId!\n $eventId: EventId\n $hasSelected: Boolean!\n $ids: [DelegationsCategoryId!]!\n $name: String\n) {\n organization(id: $organizationId) {\n name\n\n list: positionsCategories(\n eventId: $eventId\n name: $name\n limit: 50\n sort: { attribute: "Name", direction: Asc }\n ) {\n nodes {\n id\n name\n\n event {\n id\n name\n }\n }\n }\n\n selected: positionsCategories(ids: $ids) @include(if: $hasSelected) {\n nodes {\n id\n name\n\n event {\n id\n name\n }\n }\n }\n }\n}\n',{variables:e,token:t||void 0,fragments:[]})}({organizationId:e.organizationId,eventId:e.eventId,hasSelected:e.hasSelected,name:m(d)?d:void 0,ids:e.ids},await Y());a(t)}var t,i;o(!1)})()},[n,d,e.eventId,e.hasSelected,e.organizationId,e.resource]);const u=(0,L.useMemo)(()=>{if(r){const t=(0,uc.A)((0,xh.A)(r.list.nodes.concat(r.selected.nodes),e=>e.id),e=>e.name.toLowerCase());return n!==ot.Both&&e.eventId?t.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id)):Object.values((0,cc.A)(t,e=>e.event?.id??-1)).map(e=>{const t=e[0];return(0,i.jsx)("optgroup",{label:t.event?.name??r.name,children:e.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},t.event?.id??-1)})}return(0,i.jsx)(i.Fragment,{})},[e.eventId,n,r]);return(0,i.jsx)(yc,{isSearchLoading:s,isSearchVisible:!0,renderOnPortal:!0,searchElement:(0,i.jsx)(Bl,{icon:"magnifying-glass",placeholder:t("rechercher_50038"),state:"search",value:l,onChange:c}),values:e.ids,onChange:e.onChange,children:u})},CZ=e=>{const{translate:t,params:{organizationId:n}}=vl();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:e.accessScope===ne.DelegationCategory?"checked":"unchecked",onClick:()=>e.setAccessScope(ne.DelegationCategory),children:t("r_le_sur_une_ca_31475")}),e.accessScope===ne.DelegationCategory&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"1"}),(0,i.jsxs)(Ba,{css:{paddingLeft:"$6"},gap:"4",children:[(0,i.jsx)(Ar,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(jZ,{hasSelected:!0,ids:[e.resourceId],level:ot.Event,organizationId:n,resource:bZ.DelegationsCategories,onChange:t=>{so(t)&&e.setResourceId(t[0])}})}),(0,i.jsx)(Ar,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)($u,{shouldParseAsInt:!0,value:e.roleId,onChange:e.setRoleId,children:e.delegationCategoryRoles.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})})]})]})]})},yZ=e=>{const{translate:t,params:{organizationId:n}}=vl();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:e.accessScope===ne.Delegation?"checked":"unchecked",onClick:()=>e.setAccessScope(ne.Delegation),children:t("r_le_sur_une_d_10967")}),e.accessScope===ne.Delegation&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ba,{css:{paddingLeft:"$6"},gap:"4",children:(0,i.jsx)(jZ,{hasSelected:!0,ids:[e.resourceId],level:ot.Both,organizationId:n,resource:bZ.Delegations,onChange:t=>{so(t)&&e.setResourceId(t[0])}})})]})]})},kZ=e=>{const{translate:t}=vl(),{organization:n}=TI();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:e.accessScope===ne.Event?"checked":"unchecked",onClick:()=>e.setAccessScope(ne.Event),children:t("r_le_sur_un_v_89523")}),e.accessScope===ne.Event&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"1"}),(0,i.jsxs)(Ba,{css:{paddingLeft:"$6"},gap:"4",children:[(0,i.jsx)(Ar,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)($u,{shouldParseAsInt:!0,value:e.resourceId,onChange:e.setResourceId,children:n.events.nodes.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})}),(0,i.jsx)(Ar,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)($u,{shouldParseAsInt:!0,value:e.roleId,onChange:e.setRoleId,children:e.eventRoles.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})})]})]})]})},AZ=e=>{const{translate:t,params:{organizationId:n}}=vl();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:e.accessScope===ne.PositionCategory?"checked":"unchecked",onClick:()=>e.setAccessScope(ne.PositionCategory),children:t("r_le_sur_une_ca_13181")}),e.accessScope===ne.PositionCategory&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"1"}),(0,i.jsxs)(Ba,{css:{paddingLeft:"$6"},gap:"4",children:[(0,i.jsx)(Ar,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(jZ,{hasSelected:!0,ids:[e.resourceId],organizationId:n,resource:bZ.PositionsCategories,onChange:t=>{so(t)&&e.setResourceId(t[0])}})}),(0,i.jsx)(Ar,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)($u,{shouldParseAsInt:!0,value:e.roleId,onChange:e.setRoleId,children:e.positionCategoryRoles.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})})]})]})]})},wZ=e=>{const{translate:t,params:{organizationId:n}}=vl();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:e.accessScope===ne.Position?"checked":"unchecked",onClick:()=>e.setAccessScope(ne.Position),children:t("r_le_sur_une_mi_92313")}),e.accessScope===ne.Position&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"1"}),(0,i.jsxs)(Ba,{css:{paddingLeft:"$6"},gap:"4",children:[(0,i.jsx)(Ar,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(jZ,{hasSelected:!0,ids:[e.resourceId],organizationId:n,resource:bZ.Positions,onChange:t=>{so(t)&&e.setResourceId(t[0])}})}),(0,i.jsx)(Ar,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)($u,{shouldParseAsInt:!0,value:e.roleId,onChange:e.setRoleId,children:e.positionRoles.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})})]})]})]})},SZ=()=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(lc,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(lc,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(lc,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(lc,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(lc,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(lc,{borderRadius:"$1",height:20,width:1})]}),EZ=e=>{const{translate:t,params:{organizationId:n}}=vl(),{organization:s,roles:o}=TI(),{mutate:r}=function(e={}){return ei("mutation UserAccessCreate(\n $organizationId: OrganizationId!\n $scope: AccessScope!\n $userInfoId: UsersInfoId!\n $resourceId: Int!\n $roleId: RoleId\n) {\n userAccessCreate(\n organizationId: $organizationId\n scope: $scope\n userInfoId: $userInfoId\n resourceId: $resourceId\n roleId: $roleId\n )\n}\n",e)}(),{data:a,isLoading:l}=Qn('query OrganizationUserAddRole($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n delegations(level: Both, limit: 1, sort: { attribute: "Name", direction: Asc }) {\n nodes {\n id\n }\n }\n\n delegationsCategories(level: Event, limit: 1, sort: { attribute: "Name", direction: Asc }) {\n nodes {\n id\n }\n }\n\n positions(limit: 1, sort: { attribute: "Name", direction: Asc }) {\n nodes {\n id\n }\n }\n\n positionsCategories(limit: 1, sort: { attribute: "Name", direction: Asc }) {\n nodes {\n id\n }\n }\n }\n}\n',{organizationId:n},[]),[d,c]=(0,L.useState)(ne.Organization),[u,h]=(0,L.useState)(o.organizationRoles[0].id),[m,g]=(0,L.useState)(-1),p=e=>{e===ne.Organization?h(o.organizationRoles[0].id):e===ne.Event?(h(o.eventRoles[0].id),g(s.events.nodes[0].id)):e===ne.Delegation?(h(-1),g(a.organization.delegations.nodes[0].id)):e===ne.DelegationCategory?(h(o.delegationCategoryRoles[0].id),g(a.organization.delegationsCategories.nodes[0].id)):e===ne.Position?(h(o.positionRoles[0].id),g(a.organization.positions.nodes[0].id)):e===ne.PositionCategory&&(h(o.positionRoles[0].id),g(a.organization.positionsCategories.nodes[0].id)),c(e)};return(0,i.jsxs)(Lb,{children:[(0,i.jsx)(Bb,{children:(0,i.jsx)(zl,{color:"invisible",leftIcon:"plus",children:t("ajouter_un_r_le_19073")})}),(0,i.jsxs)(Nb,{children:[(0,i.jsx)(Mb,{icon:"user-lock",children:t("ajouter_un_r_le_19073")}),(0,i.jsx)(Fb,{children:l?(0,i.jsx)(SZ,{}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(vc,{state:d===ne.Organization?"checked":"unchecked",onClick:()=>p(ne.Organization),children:t("r_le_sur_l_orga_15663")}),d===ne.Organization&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ba,{css:{paddingLeft:"$6"},children:(0,i.jsx)($u,{shouldParseAsInt:!0,value:u,onChange:h,children:o.organizationRoles.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})})]}),so(s.events.nodes)&&(0,i.jsx)(kZ,{accessScope:d,eventRoles:o.eventRoles,resourceId:m,roleId:u,setAccessScope:p,setResourceId:g,setRoleId:h}),so(a.organization?.delegations.nodes)&&(0,i.jsx)(yZ,{accessScope:d,resourceId:m,setAccessScope:p,setResourceId:g}),so(a.organization?.delegationsCategories.nodes)&&(0,i.jsx)(CZ,{accessScope:d,delegationCategoryRoles:o.delegationCategoryRoles,resourceId:m,roleId:u,setAccessScope:p,setResourceId:g,setRoleId:h}),so(a.organization?.positions.nodes)&&(0,i.jsx)(wZ,{accessScope:d,positionRoles:o.positionRoles,resourceId:m,roleId:u,setAccessScope:p,setResourceId:g,setRoleId:h}),so(a.organization?.positionsCategories.nodes)&&(0,i.jsx)(AZ,{accessScope:d,positionCategoryRoles:o.positionRoles,resourceId:m,roleId:u,setAccessScope:p,setResourceId:g,setRoleId:h})]})}),(0,i.jsx)(Pb,{children:(0,i.jsx)(zl,{onClick:async()=>{await r({organizationId:n,scope:d,resourceId:d===ne.Organization?n:m,roleId:d===ne.Delegation?void 0:u,userInfoId:e.userInfoId}),e.onClose()},children:t("ajouter_97327")})})]})]})},TZ=e=>{const{organization:t}=TI(),{canOrganizationUserEdit:n}=DS(),{mutate:s}=fa(),[o,r]=(0,L.useState)(e.roleId);return(0,i.jsxs)(Mc,{children:[(0,i.jsx)(Oc,{children:(0,i.jsx)($u,{shouldParseAsInt:!0,state:n?"active":"disabled",value:o,onChange:n=>(r(n),(n=>s({organizationId:t.id,scope:e.scope,id:e.id,roleId:n}))(n)),children:e.roles.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})}),(0,i.jsx)(Oc,{children:e.resource}),n&&(0,i.jsx)(Xc,{justify:"center",children:(0,i.jsx)(Ar,{color:"error700",onClick:async()=>{e.onDelete(e.scope,e.id)},children:(0,i.jsx)(nl,{icon:"trash-can"})})})]})},zZ=e=>{const{translate:t}=vl(),{organization:n,roles:s}=TI(),{canOrganizationUserEdit:o}=DS(),{mutate:r}=pa(),[a,l]=(0,L.useState)(e.userInfo.usersEvents.filter(t=>t.event.id===e.event.id)),[d,c]=(0,L.useState)(e.userInfo.usersDelegations.filter(t=>t.eventId===e.event.id)),[u,h]=(0,L.useState)(e.userInfo.usersDelegationsCategories.filter(t=>t.eventId===e.event.id)),[m,g]=(0,L.useState)(e.userInfo.usersPositions.filter(t=>t.eventId===e.event.id)),[p,f]=(0,L.useState)(e.userInfo.usersPositionsCategories.filter(t=>t.eventId===e.event.id)),_=async(e,t)=>{await r({organizationId:n.id,scope:e,id:t}),l(e=>e.filter(e=>e.id!==t)),c(e=>e.filter(e=>e.id!==t)),h(e=>e.filter(e=>e.id!==t)),g(e=>e.filter(e=>e.id!==t)),f(e=>e.filter(e=>e.id!==t))};return so(a)||so(d)||so(u)||so(m)||so(p)?(0,i.jsx)(Lc,{headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Gc,{children:t("r_le_59302")}),(0,i.jsx)(Gc,{}),o&&(0,i.jsx)(Gc,{width:100})]}),rows:(0,i.jsxs)(i.Fragment,{children:[a.map(t=>(0,i.jsx)(TZ,{id:t.id,resource:"-",roleId:t.role.id,roles:s.eventRoles,scope:ne.Event,userId:e.userInfo.userId,onDelete:_},t.id)),d.map(e=>(0,i.jsxs)(Mc,{children:[(0,i.jsx)(Oc,{children:t("responsable_de_70462")}),(0,i.jsx)(Oc,{children:e.delegation.name}),o&&(0,i.jsx)(Xc,{justify:"center",children:(0,i.jsx)(Ar,{color:"error700",onClick:()=>_(ne.Delegation,e.id),children:(0,i.jsx)(nl,{icon:"trash-can"})})})]},e.id)),u.map(t=>(0,i.jsx)(TZ,{id:t.id,resource:t.delegationCategory.name,roleId:t.role.id,roles:s.delegationCategoryRoles,scope:ne.DelegationCategory,userId:e.userInfo.userId,onDelete:_},t.id)),m.map(t=>(0,i.jsx)(TZ,{id:t.id,resource:t.position.name,roleId:t.role.id,roles:s.positionRoles,scope:ne.Position,userId:e.userInfo.userId,onDelete:_},t.id)),p.map(t=>(0,i.jsx)(TZ,{id:t.id,resource:t.positionCategory.name,roleId:t.role.id,roles:s.positionRoles,scope:ne.PositionCategory,userId:e.userInfo.userId,onDelete:_},t.id))]}),title:e.event.name}):null},OZ=e=>{const{translate:t}=vl(),{organization:n,roles:s}=TI(),{canOrganizationUserEdit:o}=DS(),{mutate:r}=fa(),{mutate:a}=pa(),[l,d]=(0,L.useState)(e.userOrganization.role.id),[c,u]=(0,L.useState)(e.userOrganization.sendNotifications),h=(t,i)=>r({organizationId:n.id,scope:ne.Organization,id:e.userOrganization.id,sendNotifications:t,roleId:i});return(0,i.jsxs)(Mc,{children:[(0,i.jsx)(Oc,{children:(0,i.jsx)($u,{shouldParseAsInt:!0,state:o?"active":"disabled",value:l,onChange:e=>(d(e),h(c,e)),children:s.organizationRoles.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})}),(0,i.jsx)(Oc,{children:(0,i.jsx)(ku,{disabled:!o,value:c,onChange:e=>(u(e),h(e,l)),children:t("activer_38612")})}),o&&(0,i.jsx)(Xc,{justify:"center",children:(0,i.jsx)(Ar,{color:"error700",onClick:async()=>{await a({organizationId:n.id,scope:ne.Organization,id:e.userOrganization.id}),e.onDelete(e.userOrganization.id)},children:(0,i.jsx)(nl,{icon:"trash-can"})})})]})},RZ=e=>{const{translate:t}=vl(),{organization:n}=TI(),{canOrganizationUserEdit:s}=DS(),[o,r]=(0,L.useState)(e.userInfo.usersOrganizations),a=e=>{r(t=>t.filter(t=>t.id!==e))};return(0,i.jsx)(Lc,{headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Gc,{children:t("r_le_59302")}),(0,i.jsx)(Gc,{children:t("notifications_98765")}),s&&(0,i.jsx)(Gc,{width:100})]}),rows:(0,i.jsx)(i.Fragment,{children:o.map((t,n)=>(0,i.jsx)(OZ,{userId:e.userInfo.userId,userOrganization:t,onDelete:a},n))}),title:n.name})},$Z=e=>{const{translate:t}=vl(),{organization:n}=TI(),{canOrganizationUserEdit:s}=DS();return(0,i.jsxs)(vu,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(zj,{children:e.userInfo.nameOrEmail}),(0,i.jsxs)(bu,{css:{gap:"$4",py:"$6"},children:[so(e.userInfo.usersOrganizations)&&(0,i.jsx)(RZ,{userInfo:e.userInfo}),n.events.nodes.map(t=>(0,i.jsx)(zZ,{event:t,userInfo:e.userInfo},t.id)),s&&(0,i.jsx)(EZ,{userInfoId:e.userInfo.id,onClose:e.onClose})]}),(0,i.jsx)(ju,{children:(0,i.jsx)(Ba,{gap:"3",justify:"end",children:(0,i.jsx)(zl,{color:"white",onClick:e.onClose,children:t("fermer_62479")})})})]})},DZ=e=>{const[t,n]=(0,L.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Mc,{css:{cursor:"pointer",userSelect:"none","&:hover":{background:"$gray100"}},onClick:()=>n(!0),children:[(0,i.jsx)(Oc,{children:(0,i.jsx)(xj,{isClickDisabled:!0,size:32,userInfo:e.userInfo})}),(0,i.jsx)(Wy,{userPermissions:e.userInfo}),(0,i.jsx)(Kb,{permissions:Hb.ORGANIZATION_USER_EDIT,children:(0,i.jsx)(Xc,{justify:"end",children:(0,i.jsx)(vZ,{reload:e.reload,userInfo:e.userInfo})})})]}),t&&(0,i.jsx)($Z,{userInfo:e.userInfo,onClose:()=>{e.reloadUserInfo(e.userInfo.id),n(!1)}})]})},PZ=e=>{const{translate:t}=vl(),{organization:n}=TI(),{showNotification:s}=Ob(),{onClose:o}=$b(),{mutate:r,isLoading:a}=function(e={}){return ei("mutation OrganizationInvite(\n $organizationId: OrganizationId!\n $email: UserEmail!\n $roleId: RoleId!\n) {\n organizationInvite(organizationId: $organizationId, email: $email, roleId: $roleId) {\n id\n }\n}\n",e)}(),{mutate:l,isLoading:c}=function(e={}){return ei("mutation EventInvite($eventId: EventId!, $email: UserEmail!, $roleId: RoleId!) {\n eventInvite(eventId: $eventId, email: $email, roleId: $roleId) {\n id\n }\n}\n",e)}(),u=n.roles.find(e=>e.type===bt.OrganizationAdmin),h=n.roles.find(e=>e.type===bt.OrganizationReader),m=n.roles.find(e=>e.type===bt.EventAdmin),g=n.roles.find(e=>e.type===bt.EventReader),[p,f]=(0,L.useState)(""),[_,x]=(0,L.useState)(u.id),I=n.events.nodes,[v,b]=(0,L.useState)(I[0]?.id),j=(0,L.useMemo)(()=>I.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id)),[I]),C=function(e){return d.Yj().email().required().isValidSync(e)}(p);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mb,{icon:"user-plus",children:t("inviter_un_util_06611")}),(0,i.jsxs)(Fb,{gap:"6",children:[(0,i.jsx)(Bl,{isEmail:!0,label:t("Email"),value:p,onChange:f}),(0,i.jsxs)(Ba,{direction:"column",children:[(0,i.jsx)(Ar,{font:"gray800 textSm medium",children:t("quel_r_le_souha_92592")}),(0,i.jsx)(Ya,{height:"2"}),(0,i.jsx)(vc,{state:_===u.id?"checked":"unchecked",onClick:()=>x(u.id),children:u.name}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:_===h.id?"checked":"unchecked",onClick:()=>x(h.id),children:h.name}),so(I)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:_===m.id?"checked":"unchecked",onClick:()=>x(m.id),children:m.name}),_===m.id&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ba,{css:{paddingLeft:"$6"},children:(0,i.jsx)($u,{shouldParseAsInt:!0,value:v,onChange:b,children:j})})]}),(0,i.jsx)(Ya,{height:"3"}),(0,i.jsx)(vc,{state:_===g.id?"checked":"unchecked",onClick:()=>x(g.id),children:g.name}),_===g.id&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ba,{css:{paddingLeft:"$6"},children:(0,i.jsx)($u,{shouldParseAsInt:!0,value:v,onChange:b,children:j})})]})]})]})]}),(0,i.jsx)(Pb,{children:(0,i.jsx)(zl,{disabled:!C,isLoading:a||c,onClick:async()=>{const i=n.roles.find(e=>e.id===_);if(_===u.id||_===h.id)await r({organizationId:n.id,email:p,roleId:_}),s(t("_1_a_t_invit_38156",p,i.name));else{const e=I.find(e=>e.id===v);await l({eventId:v,email:p,roleId:_}),s(t("_1_a_t_invit_15646",p,i.name,e.name))}e.reload(),o()},children:t("inviter_35349")})})]})},FZ=e=>{const{translate:t}=vl();return(0,i.jsxs)(lj,{gap:"6",children:[(0,i.jsx)(Ar,{css:{flex:"1"},font:"gray900 displayXs medium",children:t("utilisateurs_04975")}),(0,i.jsx)(Kb,{permissions:Hb.ORGANIZATION_USER_EDIT,children:(0,i.jsxs)(Lb,{children:[(0,i.jsx)(Bb,{children:(0,i.jsx)(zl,{children:t("inviter_un_util_06611")})}),(0,i.jsx)(Nb,{children:(0,i.jsx)(PZ,{reload:e.reload})})]})})]})},MZ=()=>{const{translate:e,params:{organizationId:t}}=vl(),{organization:n,roles:s}=TI(),[o,r]=(0,L.useState)(!0),[a,l,d]=Wc(""),[c,u]=(0,L.useState)(-1),[h,g]=(0,L.useState)(-1),[p,f]=(0,L.useState)(Rc),[_,x]=(0,L.useState)(0),{data:I,isLoading:v,reload:b}=Qn("query OrganizationUsers(\n $organizationId: OrganizationId!\n $hasRole: Boolean!\n $name: String\n $roleId: RoleId\n $eventId: EventId\n $limit: Int\n $offset: Int\n) {\n organization(id: $organizationId) {\n usersInfos(\n hasRole: $hasRole\n name: $name\n roleId: $roleId\n eventId: $eventId\n limit: $limit\n offset: $offset\n ) {\n nodes {\n ...UserInfoOrganization\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{organizationId:t,hasRole:o,name:m(l)?l:void 0,roleId:-1!==c?c:void 0,eventId:-1!==h?h:void 0,limit:p,offset:_},[Vs.UserInfoOrganizationFragment]);const{numberOfPages:j,totalCount:C}=Su(I.organization?.usersInfos),[y,k]=(0,L.useState)([]),[A,w]=(0,L.useState)({}),S=(0,L.useCallback)(async e=>{w(t=>({...t,[e]:!0}));const{organization:{userInfo:t}}=await function(e,t){return go("query OrganizationUsersUser(\n $organizationId: OrganizationId!\n $eventId: EventId\n $userInfoId: UsersInfoId!\n) {\n organization(id: $organizationId) {\n userInfo(id: $userInfoId) {\n ...UserInfoOrganization\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[Vs.UserInfoOrganizationFragment]})}({organizationId:n.id,userInfoId:e},await Y());k(n=>n.map(n=>n.id===e?t:n)),w(t=>({...t,[e]:!1}))},[n]);return(0,L.useEffect)(()=>{k(I.organization?.usersInfos.nodes??[])},[I.organization]),(0,i.jsxs)(dj,{css:{overflowY:"auto"},children:[(0,i.jsx)(FZ,{reload:b}),(0,i.jsx)(aj,{children:(0,i.jsx)(Lc,{filters:(0,i.jsxs)(Ba,{align:"center",gap:"3",width:1,children:[(0,i.jsx)(Ar,{width:300,children:(0,i.jsx)(Bl,{icon:"magnifying-glass",placeholder:e("rechercher_un_m_05904"),value:a,onChange:d})}),(0,i.jsx)(Ar,{css:{flex:"1"}}),(0,i.jsx)(_c,{state:o?"checked":"unchecked",onClick:e=>r("checked"===e),children:e("seulement_les_u_63675")}),(0,i.jsx)(Ar,{width:240,children:(0,i.jsxs)(yc,{isSearchVisible:!0,menuWidth:320,renderOnPortal:!0,values:[c],onChange:e=>{so(e)&&u(e[0])},children:[(0,i.jsx)("option",{value:-1,children:e("tous_les_r_les_18736")}),(0,i.jsx)("optgroup",{label:e("organisation_71863"),children:s.organizationRoles.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)("optgroup",{label:e("_v_nement_22345"),children:s.eventRoles.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)("optgroup",{label:e("Delegation"),children:s.delegationCategoryRoles.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)("optgroup",{label:e("Position"),children:s.positionRoles.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})]})}),(0,i.jsx)(Ar,{width:240,children:(0,i.jsxs)($u,{shouldParseAsInt:!0,value:h,onChange:g,children:[(0,i.jsx)("option",{value:-1,children:e("tous_les_v_nem_16033")}),n.events.nodes.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))]})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Gc,{children:e("full_name")}),(0,i.jsx)(Gc,{children:e("r_les_61679")}),(0,i.jsx)(Kb,{rolesTypes:[bt.OrganizationAdmin],children:(0,i.jsx)(Gc,{width:100})})]}),limit:p,numberOfPages:j,offset:_,rows:v?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Hc,{bx:!0}),(0,i.jsx)(Hc,{bx:!0}),(0,i.jsx)(Hc,{bx:!0})]}):(0,i.jsx)(i.Fragment,{children:y.map(e=>A[e.id]?(0,i.jsx)(Hc,{bx:!0},e.id):(0,i.jsx)(DZ,{reload:b,reloadUserInfo:S,userInfo:e},e.id))}),setLimit:f,setOffset:x,totalCount:C})})]})},NZ=()=>{const{translate:e,params:{organizationId:t}}=vl();Md(e("param_tres_78420"));const{isOrganizationAdmin:n,isOrganizationReader:s,hasFeature:o}=TI(),{canOrganizationParamRead:r,canOrganizationUserRead:a}=DS();return(0,i.jsxs)(Ba,{height:1,width:1,children:[(0,i.jsx)(QY,{}),(0,i.jsx)(Ar,{css:{flex:"1"},height:1,children:(0,i.jsxs)(Sr.dO,{children:[(0,i.jsx)(Sr.qh,{exact:!0,path:Ps.ORGANIZATION_PARAMETERS_PROFILE(":organizationId"),children:(0,i.jsx)(eZ,{})}),r&&(0,i.jsx)(Sr.qh,{exact:!0,path:Ps.ORGANIZATION_PARAMETERS_INFOS(":organizationId"),children:(0,i.jsx)(GY,{})}),a&&(0,i.jsx)(Sr.qh,{exact:!0,path:Ps.ORGANIZATION_PARAMETERS_TEAM(":organizationId"),children:(0,i.jsx)(MZ,{})}),a&&(0,i.jsx)(Sr.qh,{exact:!0,path:Ps.ORGANIZATION_PARAMETERS_ROLES(":organizationId"),children:(0,i.jsx)(rZ,{})}),r&&(0,i.jsx)(Sr.qh,{path:Ps.ORGANIZATION_PARAMETERS_EMAILS(":organizationId"),children:(0,i.jsx)(yY,{})}),r&&(0,i.jsx)(Sr.qh,{path:yi.ORGANIZATION_SETTINGS_EVENTS_SHOWCASE({organizationId:":organizationId"}),children:(0,i.jsx)(dj,{children:(0,i.jsx)(UY,{})})}),r&&(0,i.jsx)(Sr.qh,{path:yi.ORGANIZATION_SETTINGS_MEMBERS_SPACE({organizationId:":organizationId"}),children:(0,i.jsx)(dj,{children:(0,i.jsx)(ZY,{})})}),r&&o(Be.Delegation)&&(0,i.jsx)(Sr.qh,{path:yi.ORGANIZATION_SETTINGS_DELEGATION_SPACE({organizationId:":organizationId"}),children:(0,i.jsx)(dj,{children:(0,i.jsx)(_Y,{})})}),r&&(0,i.jsx)(Sr.qh,{path:Ps.ORGANIZATION_PARAMETERS_CATEGORIES(":organizationId"),children:(0,i.jsx)(uY,{})}),r&&(0,i.jsx)(Sr.qh,{exact:!0,path:Ps.ORGANIZATION_PARAMETERS_TAGS(":organizationId"),children:(0,i.jsx)(hZ,{})}),r&&(0,i.jsx)(Sr.qh,{path:Ps.ORGANIZATION_PARAMETERS_TRANSLATIONS(":organizationId"),children:(0,i.jsx)(IZ,{})}),n&&(0,i.jsx)(Sr.qh,{exact:!0,path:Ps.ORGANIZATION_PARAMETERS_INVOICES(":organizationId"),children:(0,i.jsx)(HY,{})}),r&&(0,i.jsx)(Sr.qh,{exact:!0,path:Ps.ORGANIZATION_PARAMETERS_ACTIVITY(":organizationId"),children:(0,i.jsx)(eY,{})}),s&&(0,i.jsx)(Sr.qh,{exact:!0,path:Ps.ORGANIZATION_PARAMETERS_SKIDATA(":organizationId"),children:(0,i.jsx)(dZ,{})}),(0,i.jsx)(Sr.qh,{children:(0,i.jsx)(oi,{path:Ps.ORGANIZATION_PARAMETERS_PROFILE(t)})})]})})]})},LZ=Object.keys(Hb).length/2;function BZ(e){return new Array(LZ).fill("0").map((t,n)=>e.includes(n)?"1":"0").join("")}const VZ=BZ([Hb.POSITION_READ,Hb.POSITION_EDIT,Hb.MEMBER_EDIT,Hb.MEMBER_ASSIGNMENT_STATE_EDIT,Hb.COMMENT_READ,Hb.COMMENT_ADD,Hb.MEMBER_AVAILABILITIES_EDIT,Hb.MEMBER_ASSIGN,Hb.CAMPAIGN_SEND,Hb.ACCREDITATION_READ,Hb.ACCREDITATION_EDIT,Hb.MEMBER_ACCREDIT,Hb.DELEGATION_READ,Hb.DELEGATION_EDIT,Hb.FORM_READ,Hb.FORM_EDIT,Hb.EMAIL_EDIT,Hb.CAMPAIGN_READ,Hb.DOCUMENT_READ,Hb.DOCUMENT_EDIT,Hb.WORKFLOW_READ,Hb.WORKFLOW_EDIT,Hb.CUSTOM_FIELD_READ,Hb.CUSTOM_FIELD_EDIT,Hb.SEGMENT_EDIT,Hb.MEMBER_CREATE,Hb.MEMBER_DELETE,Hb.EVENT_EDIT,Hb.ORGANIZATION_PARAM_READ,Hb.ORGANIZATION_PARAM_EDIT,Hb.ORGANIZATION_USER_READ,Hb.ORGANIZATION_USER_EDIT]),UZ=BZ([Hb.POSITION_READ,Hb.COMMENT_READ,Hb.ACCREDITATION_READ,Hb.DELEGATION_READ,Hb.FORM_READ,Hb.CAMPAIGN_READ,Hb.DOCUMENT_READ,Hb.WORKFLOW_READ,Hb.CUSTOM_FIELD_READ,Hb.ORGANIZATION_PARAM_READ,Hb.ORGANIZATION_USER_READ]),WZ=BZ([Hb.POSITION_READ,Hb.POSITION_EDIT,Hb.MEMBER_EDIT,Hb.MEMBER_ASSIGNMENT_STATE_EDIT,Hb.COMMENT_READ,Hb.COMMENT_ADD,Hb.MEMBER_AVAILABILITIES_EDIT,Hb.MEMBER_ASSIGN,Hb.CAMPAIGN_SEND,Hb.ACCREDITATION_READ,Hb.ACCREDITATION_EDIT,Hb.MEMBER_ACCREDIT,Hb.DELEGATION_READ,Hb.DELEGATION_EDIT,Hb.FORM_READ,Hb.FORM_EDIT,Hb.EMAIL_EDIT,Hb.CAMPAIGN_READ,Hb.DOCUMENT_READ,Hb.DOCUMENT_EDIT,Hb.WORKFLOW_READ,Hb.WORKFLOW_EDIT,Hb.SEGMENT_EDIT,Hb.MEMBER_CREATE,Hb.MEMBER_DELETE]),GZ=BZ([Hb.POSITION_READ,Hb.COMMENT_READ,Hb.ACCREDITATION_READ,Hb.DELEGATION_READ,Hb.FORM_READ,Hb.CAMPAIGN_READ,Hb.DOCUMENT_READ,Hb.WORKFLOW_READ]),HZ=BZ([Hb.POSITION_READ,Hb.POSITION_EDIT,Hb.COMMENT_READ,Hb.MEMBER_ASSIGN,Hb.CAMPAIGN_SEND,Hb.CAMPAIGN_READ]),qZ=BZ([Hb.POSITION_READ,Hb.COMMENT_READ]),KZ=BZ([Hb.DELEGATION_READ]);let YZ=class extends Gl{constructor(e){super(e)}default(e){return{name:e?.name??"",description:e?.description??"",accessLevel:e?.accessLevel??vt.Position,permissions:e?.permissions??HZ}}schema(){return d.Ik().shape({role:d.Ik().shape({name:d.Yj().required(this.t("le_nom_est_requ_61536")),description:d.Yj().required(this.t("la_description_46559")),accessLevel:d.Yj().required(this.t("le_niveau_d_acc_94726")).oneOf(On,this.t("le_niveau_d_acc_94726")),permissions:d.Yj().matches(new RegExp(`^[01]{${LZ}}$`),this.t("le_format_des_p_68818")).required(this.t("le_format_des_p_68818"))}).required()}).required()}};YZ=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[qn])],YZ);const ZZ=_r("div",{display:"grid",gap:"$4 $7",gridTemplateColumns:"280px auto"}),XZ=_r("div",{fontWeight:"$medium",gridColumn:1}),JZ=({children:e,disabled:t,permission:n,subtext:s,permissions:o,change:r})=>(0,i.jsx)("div",{style:{gridColumn:2},children:(0,i.jsx)(ku,{css:{alignItems:"start","> *:first-child":{margin:"2px 0"}},disabled:t,subtext:s,value:"1"===o[n],onChange:e=>r("role.permissions",function(e,t,n){return[...e].toSpliced(t,1,n).join("")}(o,n,e?"1":"0")),children:e})}),QZ=({children:e,...t})=>(0,i.jsx)(Vm,{css:{"legend + div":{minHeight:"32px"}},...t,hideToggle:!0,initialIsOpen:!0,children:e}),eX=e=>{const{translate:t}=vl(),n=e.roleInput.accessLevel;return(0,i.jsxs)(QZ,{heading:t("accr_ditations_39450"),children:[(0,i.jsxs)(ZZ,{children:[(0,i.jsx)(XZ,{children:t("accr_ditations_39450")}),(0,i.jsx)(JZ,{change:e.change,disabled:e.disabled,permission:Hb.ACCREDITATION_READ,permissions:e.roleInput.permissions,children:t("voir_les_accr_d_34867")}),n!==vt.DelegationCategory&&(0,i.jsx)(JZ,{change:e.change,disabled:e.disabled,permission:Hb.ACCREDITATION_EDIT,permissions:e.roleInput.permissions,children:t("_diter_les_accr_86042")})]}),(0,i.jsx)(Ju,{height:"6"}),(0,i.jsxs)(ZZ,{children:[(0,i.jsx)(XZ,{children:t("mod_ration_09947")}),(0,i.jsx)(JZ,{change:e.change,disabled:e.disabled,permission:Hb.MEMBER_ACCREDIT,permissions:e.roleInput.permissions,children:t("accr_diter_les_48281")})]})]})},tX=e=>{const t=Xn(),n=e.roleInput.accessLevel===vt.Organization||e.roleInput.accessLevel===vt.Event,s=e.roleInput.accessLevel===vt.Organization||e.roleInput.accessLevel===vt.Event,o=e.roleInput.accessLevel===vt.Organization||e.roleInput.accessLevel===vt.Event;return(0,i.jsxs)(QZ,{heading:t("communication_05277"),children:[n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(ZZ,{children:[(0,i.jsx)(XZ,{children:t("Form_plural")}),(0,i.jsx)(JZ,{change:e.change,disabled:e.disabled,permission:Hb.FORM_READ,permissions:e.roleInput.permissions,children:t("voir_les_formul_55824")}),(0,i.jsx)(JZ,{change:e.change,disabled:e.disabled,permission:Hb.FORM_EDIT,permissions:e.roleInput.permissions,children:t("_diter_les_form_10612")})]}),(0,i.jsx)(Ju,{height:"6"})]}),(0,i.jsxs)(ZZ,{children:[(0,i.jsx)(XZ,{children:t("Campaigns")}),(0,i.jsx)(JZ,{change:e.change,disabled:e.disabled,permission:Hb.CAMPAIGN_READ,permissions:e.roleInput.permissions,children:t("voir_les_campag_02148")}),(0,i.jsx)(JZ,{change:e.change,disabled:e.disabled,permission:Hb.CAMPAIGN_SEND,permissions:e.roleInput.permissions,children:t("envoyer_une_cam_35768")})]}),s&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ju,{height:"6"}),(0,i.jsxs)(ZZ,{children:[(0,i.jsx)(XZ,{children:t("e_mails_09850")}),(0,i.jsx)(JZ,{change:e.change,disabled:e.disabled,permission:Hb.EMAIL_EDIT,permissions:e.roleInput.permissions,children:t("_diter_les_e_ma_05609")})]})]}),o&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ju,{height:"6"}),(0,i.jsxs)(ZZ,{children:[(0,i.jsx)(XZ,{children:t("Documents")}),(0,i.jsx)(JZ,{change:e.change,disabled:e.disabled,permission:Hb.DOCUMENT_READ,permissions:e.roleInput.permissions,children:t("voir_les_docume_33988")}),(0,i.jsx)(JZ,{change:e.change,disabled:e.disabled,permission:Hb.DOCUMENT_EDIT,permissions:e.roleInput.permissions,children:t("_diter_les_docu_87778")})]})]})]})},nX=()=>{const e=Xn();return(0,i.jsx)(QZ,{heading:e("communication_05277"),children:(0,i.jsxs)(ZZ,{children:[(0,i.jsx)(XZ,{children:e("Campaigns")}),(0,i.jsx)(lc,{borderRadius:"$1",css:{gridColumn:2},height:20})]})})},iX=e=>{const t=Xn();return(0,i.jsx)(QZ,{heading:t("informations_su_20567"),children:(0,i.jsxs)(Ba,{direction:"column",gap:"6",children:[(0,i.jsx)(Vl,{disabled:e.disabled,label:t("nom_du_r_le_38492"),name:"role.name"}),(0,i.jsx)(Xm,{disabled:e.disabled,label:t("Description"),name:"role.description"}),(0,i.jsxs)(Qj,{label:t("niveau_d_acc_s_29898"),name:"role.accessLevel",state:e.disabled||e.isEdit?"disabled":"active",children:[(0,i.jsx)("option",{value:vt.Organization,children:t("administrateur_10076")}),(0,i.jsx)("option",{value:vt.Event,children:t("administrateur_99393")}),(0,i.jsx)("option",{value:vt.Position,children:t("responsable_de_82794")}),(0,i.jsx)("option",{value:vt.DelegationCategory,children:t("responsable_de_75445")})]})]})})},sX=()=>{const e=Xn();return(0,i.jsx)(QZ,{heading:e("informations_su_20567"),children:(0,i.jsxs)(Ba,{direction:"column",gap:"6",children:[(0,i.jsx)(lc,{borderRadius:"$2",height:64,width:"100%"}),(0,i.jsx)(lc,{borderRadius:"$2",height:126,width:"100%"})]})})},oX=e=>{const t=Xn(),n=e.roleInput.accessLevel,s=n===vt.Organization||n===vt.Event||n===vt.Position,o=n===vt.Organization||n===vt.Event||n===vt.Position,r=n===vt.Organization||n===vt.Event||n===vt.DelegationCategory,a=n===vt.Organization||n===vt.Event,l=n===vt.Organization,d=(0,Za.A)([s?(0,i.jsxs)(ZZ,{children:[(0,i.jsx)(XZ,{children:t("membres_11310")}),(0,i.jsx)(JZ,{change:e.change,disabled:e.disabled,permission:Hb.MEMBER_CREATE,permissions:e.roleInput.permissions,children:t("cr_er_des_membr_28893")}),(0,i.jsx)(JZ,{change:e.change,disabled:e.disabled,permission:Hb.MEMBER_EDIT,permissions:e.roleInput.permissions,children:t("_diter_les_memb_39894")}),(0,i.jsx)(JZ,{change:e.change,disabled:e.disabled,permission:Hb.MEMBER_DELETE,permissions:e.roleInput.permissions,children:t("supprimer_les_m_98024")}),(0,i.jsx)(JZ,{change:e.change,disabled:e.disabled,permission:Hb.MEMBER_AVAILABILITIES_EDIT,permissions:e.roleInput.permissions,children:t("_diter_les_disp_75220")})]}):null,o?(0,i.jsxs)(ZZ,{children:[(0,i.jsx)(XZ,{children:t("commentaires_96492")}),(0,i.jsx)(JZ,{change:e.change,disabled:e.disabled,permission:Hb.COMMENT_READ,permissions:e.roleInput.permissions,subtext:t("sans_cette_perm_08373",t("Private")),children:t("lire_les_commen_55215")}),(0,i.jsx)(JZ,{change:e.change,disabled:e.disabled,permission:Hb.COMMENT_ADD,permissions:e.roleInput.permissions,children:t("ajouter_et_supp_32493")})]}):null,r?(0,i.jsxs)(ZZ,{children:[(0,i.jsx)(XZ,{children:t("d_l_gations_78318")}),(0,i.jsx)(JZ,{change:e.change,disabled:e.disabled,permission:Hb.DELEGATION_READ,permissions:e.roleInput.permissions,children:t("voir_les_d_l_ga_71959")}),n!==vt.DelegationCategory&&(0,i.jsx)(JZ,{change:e.change,disabled:e.disabled,permission:Hb.DELEGATION_EDIT,permissions:e.roleInput.permissions,children:t("_diter_les_d_l_60281")})]}):null,a?(0,i.jsxs)(ZZ,{children:[(0,i.jsx)(XZ,{children:t("vues_personnali_80652")}),(0,i.jsx)(JZ,{change:e.change,disabled:e.disabled,permission:Hb.SEGMENT_EDIT,permissions:e.roleInput.permissions,children:t("_diter_les_vues_70658")})]}):null,l?(0,i.jsxs)(ZZ,{children:[(0,i.jsx)(XZ,{children:t("champs_de_formu_64126")}),(0,i.jsx)(JZ,{change:e.change,disabled:e.disabled,permission:Hb.CUSTOM_FIELD_READ,permissions:e.roleInput.permissions,children:t("voir_les_champs_59185")}),(0,i.jsx)(JZ,{change:e.change,disabled:e.disabled,permission:Hb.CUSTOM_FIELD_EDIT,permissions:e.roleInput.permissions,children:t("_diter_les_cham_47733")})]}):null]);return(0,i.jsx)(QZ,{heading:t("population_38615"),children:d.map((e,t)=>(0,i.jsxs)(L.Fragment,{children:[0!==t&&(0,i.jsx)(Ju,{height:"6"}),e]},t))})},rX=()=>{const e=Xn();return(0,i.jsxs)(QZ,{heading:e("membres_11310"),subtitle:e("permissions_rel_37045"),children:[(0,i.jsxs)(ZZ,{children:[(0,i.jsx)(XZ,{children:e("profil_du_membr_68116")}),(0,i.jsx)(lc,{borderRadius:"$1",css:{gridColumn:2},height:20})]}),(0,i.jsx)(Ju,{height:"6"}),(0,i.jsxs)(ZZ,{children:[(0,i.jsx)(XZ,{children:e("commentaires_96492")}),(0,i.jsx)(lc,{borderRadius:"$1",css:{gridColumn:2},height:40}),(0,i.jsx)(lc,{borderRadius:"$1",css:{gridColumn:2},height:20})]}),(0,i.jsx)(Ju,{height:"6"}),(0,i.jsxs)(ZZ,{children:[(0,i.jsx)(XZ,{children:e("disponibilit_s_49923")}),(0,i.jsx)(lc,{borderRadius:"$1",css:{gridColumn:2},height:20})]})]})},aX=e=>{const{translate:t}=vl();return(0,i.jsx)(QZ,{heading:t("options_53186"),children:(0,i.jsxs)(ZZ,{children:[(0,i.jsx)(XZ,{children:"Automatisations"}),(0,i.jsx)(JZ,{change:e.change,disabled:e.disabled,permission:Hb.WORKFLOW_READ,permissions:e.permissions,children:t("voir_les_automa_58340")}),(0,i.jsx)(JZ,{change:e.change,disabled:e.disabled,permission:Hb.WORKFLOW_EDIT,permissions:e.permissions,children:t("_diter_les_auto_80436")})]})})},lX=e=>{const{translate:t}=vl();return(0,i.jsxs)(QZ,{heading:t("organisation_71863"),children:[(0,i.jsxs)(ZZ,{children:[(0,i.jsx)(XZ,{children:t("_v_nements_53672")}),(0,i.jsx)(JZ,{change:e.change,disabled:e.disabled,permission:Hb.EVENT_EDIT,permissions:e.permissions,children:t("_diter_les_v_n_84914")})]}),(0,i.jsx)(Ju,{height:"6"}),(0,i.jsxs)(ZZ,{children:[(0,i.jsx)(XZ,{children:t("param_tres_78420")}),(0,i.jsx)(JZ,{change:e.change,disabled:e.disabled,permission:Hb.ORGANIZATION_PARAM_READ,permissions:e.permissions,children:t("voir_les_param_41674")}),(0,i.jsx)(JZ,{change:e.change,disabled:e.disabled,permission:Hb.ORGANIZATION_PARAM_EDIT,permissions:e.permissions,children:t("_diter_les_para_86184")})]}),(0,i.jsx)(Ju,{height:"6"}),(0,i.jsxs)(ZZ,{children:[(0,i.jsx)(XZ,{children:t("utilisateurs_et_83787")}),(0,i.jsx)(JZ,{change:e.change,disabled:e.disabled,permission:Hb.ORGANIZATION_USER_READ,permissions:e.permissions,children:t("voir_les_utilis_06462")}),(0,i.jsx)(JZ,{change:e.change,disabled:e.disabled,permission:Hb.ORGANIZATION_USER_EDIT,permissions:e.permissions,children:t("_diter_les_util_98017")})]})]})},dX=e=>{const t=Xn();return(0,i.jsxs)(QZ,{heading:t("missions_63972"),children:[(0,i.jsxs)(ZZ,{children:[(0,i.jsx)(XZ,{children:t("missions_63972")}),(0,i.jsx)(JZ,{change:e.change,disabled:e.disabled,permission:Hb.POSITION_READ,permissions:e.permissions,children:t("voir_les_missio_71964")}),(0,i.jsx)(JZ,{change:e.change,disabled:e.disabled,permission:Hb.POSITION_EDIT,permissions:e.permissions,subtext:t("si_le_r_le_est_05344"),children:t("_diter_les_miss_75420")})]}),(0,i.jsx)(Ju,{height:"6"}),(0,i.jsxs)(ZZ,{children:[(0,i.jsx)(XZ,{children:t("affectation_plural")}),(0,i.jsx)(JZ,{change:e.change,disabled:e.disabled,permission:Hb.MEMBER_ASSIGN,permissions:e.permissions,children:t("affecter_des_me_26669")}),(0,i.jsx)(JZ,{change:e.change,disabled:e.disabled,permission:Hb.MEMBER_ASSIGNMENT_STATE_EDIT,permissions:e.permissions,subtext:t("permet_notammen_90746",t("PreAssigned")),children:t("changer_le_stat_34124")})]})]})},cX=()=>{const e=Xn();return(0,i.jsxs)(QZ,{heading:e("missions_63972"),children:[(0,i.jsxs)(ZZ,{children:[(0,i.jsx)(XZ,{children:e("informations_su_61022")}),(0,i.jsx)(lc,{borderRadius:"$1",css:{gridColumn:2},height:60})]}),(0,i.jsx)(Ju,{height:"6"}),(0,i.jsxs)(ZZ,{children:[(0,i.jsx)(XZ,{children:e("affectation")}),(0,i.jsx)(lc,{borderRadius:"$1",css:{gridColumn:2},height:20}),(0,i.jsx)(lc,{borderRadius:"$1",css:{gridColumn:2},height:40})]})]})},uX=e=>{const{translate:t}=vl(),n=e.values.role.accessLevel,s=n===vt.Organization,o=n===vt.Organization||n===vt.Event||n===vt.Position,r=n===vt.Organization||n===vt.Event||n===vt.DelegationCategory,a=n===vt.Organization||n===vt.Event||n===vt.Position,l=n===vt.Organization||n===vt.Event;return(0,i.jsxs)(Ba,{direction:"column",gap:"4",children:[(0,i.jsx)(jl,{}),(0,i.jsx)(Nr.Yr,{name:"role.accessLevel",children:t=>{t===vt.Organization?e.change("role.permissions",VZ):t===vt.Event?e.change("role.permissions",WZ):t===vt.DelegationCategory?e.change("role.permissions",KZ):t===vt.Position&&e.change("role.permissions",HZ)}}),!e.isCustom&&(0,i.jsx)(al.Root,{color:"warning",children:(0,i.jsxs)(al.Titled,{children:[(0,i.jsx)(al.Title,{icon:"circle-exclamation",children:t("impossible_de_m_46897")}),(0,i.jsx)(al.Text,{children:t("ce_r_le_est_pr_71742")})]})}),(0,i.jsx)(iX,{disabled:e.disabled,isEdit:e.isEdit}),(0,i.jsx)(oX,{change:e.change,disabled:e.disabled,roleInput:e.values.role}),s&&(0,i.jsx)(lX,{change:e.change,disabled:e.disabled,permissions:e.values.role.permissions}),o&&(0,i.jsx)(dX,{change:e.change,disabled:e.disabled,permissions:e.values.role.permissions}),r&&(0,i.jsx)(eX,{change:e.change,disabled:e.disabled,roleInput:e.values.role}),a&&(0,i.jsx)(tX,{change:e.change,disabled:e.disabled,roleInput:e.values.role}),l&&(0,i.jsx)(aX,{change:e.change,disabled:e.disabled,permissions:e.values.role.permissions}),e.children]})},hX=({children:e})=>(0,i.jsxs)(Ba,{direction:"column",gap:"4",children:[(0,i.jsx)(sX,{}),(0,i.jsx)(rX,{}),(0,i.jsx)(cX,{}),(0,i.jsx)(nX,{}),e]}),mX=()=>{const{history:e,translate:t,params:{organizationId:n}}=vl(),s=(0,L.useRef)(null),o=Zn(YZ),{mutate:r}=function(e={}){return ei("mutation RoleCreate($organizationId: OrganizationId!, $role: RoleInput!) {\n roleCreate(organizationId: $organizationId, role: $role) {\n id\n }\n}\n",e)}(),{showNotification:a}=Ob();return Md(t("cr_ation_d_un_r_27933")),(0,i.jsx)(kl,{customErrorRef:s,height:1,initialValues:{role:o.default(null)},render:({form:e,handleSubmit:o,submitting:r,values:a})=>(0,i.jsx)(Lm,{category:t("cr_ation_d_un_r_27933"),color:"dark",fallbackClosePath:Ps.ORGANIZATION_PARAMETERS_ROLES(n),heading:t("nouveau_r_le_20981"),children:(0,i.jsx)(Mm,{ref:s,children:(0,i.jsx)(uX,{change:e.change,disabled:!1,isCustom:!0,isEdit:!1,values:a,children:(0,i.jsx)(Bm,{children:(0,i.jsx)(zl,{isLoading:r,textAlign:"center",onClick:o,children:t("cr_er_le_r_le_55678")})})})})}),schema:o.schema(),onSubmit:async({role:i})=>{await r({organizationId:n,role:i}),a({color:"success",text:t("le_r_le_a_bien_55424")}),e.goBack(Ps.ORGANIZATION_PARAMETERS_ROLES(n))}})},gX=()=>{const{history:e,translate:t,params:{organizationId:n,roleId:s}}=vl(),o=(0,L.useRef)(null),r=Zn(YZ),{mutate:a}=function(e={}){return ei("mutation RoleUpdate($organizationId: OrganizationId!, $roleId: RoleId!, $role: RoleInput!) {\n roleUpdate(organizationId: $organizationId, roleId: $roleId, role: $role) {\n id\n }\n}\n",e)}(),{data:l,isLoading:d}=Qn("query Role($organizationId: OrganizationId!, $roleId: RoleId!) {\n organization(id: $organizationId) {\n role(id: $roleId) {\n id\n type\n name\n description\n accessLevel\n permissions\n }\n }\n}\n",{organizationId:n,roleId:s},[]),{canOrganizationUserEdit:c}=DS(),{showNotification:u}=Ob();Md(t("mise_jour_de_17055",l.organization?.role.name));const h=(0,L.useMemo)(()=>c&&l.organization?.role.type===bt.Custom,[l.organization,c]);return d?(0,i.jsx)(pX,{}):(0,i.jsx)(kl,{customErrorRef:o,height:1,initialValues:{role:r.default(l.organization.role)},render:({form:e,handleSubmit:s,submitting:r,values:a})=>(0,i.jsx)(Lm,{button:h?(0,i.jsx)(zl,{css:{flexShrink:0},isLoading:r,onClick:s,children:t("modifier_le_r_l_58957")}):void 0,category:t("mise_jour_de_17055",l.organization.role.name),color:"dark",fallbackClosePath:Ps.ORGANIZATION_PARAMETERS_ROLES(n),heading:l.organization.role.name,children:(0,i.jsx)(Mm,{ref:o,children:(0,i.jsx)(uX,{change:e.change,disabled:!h,isCustom:l.organization.role.type===bt.Custom,isEdit:!0,values:a,children:h&&(0,i.jsx)(Bm,{children:(0,i.jsx)(zl,{isLoading:r,textAlign:"center",onClick:s,children:t("modifier_le_r_l_58957")})})})})}),schema:r.schema(),onSubmit:async({role:i})=>{h&&(await a({organizationId:n,roleId:s,role:i}),u({color:"success",text:t("le_r_le_a_bien_48312")}),e.goBack(Ps.ORGANIZATION_PARAMETERS_ROLES(n)))}})},pX=()=>{const{organizationId:e}=ti();return(0,i.jsx)(Lm,{fallbackClosePath:Ps.ORGANIZATION_PARAMETERS_ROLES(e),heading:(0,i.jsx)(lc,{borderRadius:"$1",height:39,width:400}),children:(0,i.jsx)(Mm,{children:(0,i.jsx)(hX,{})})})};var fX,_X,xX,IX,vX,bX,jX,CX,yX,kX,AX,wX,SX,EX,TX,zX,OX,RX,$X,DX,PX,FX,MX,NX,LX,BX,VX,UX,WX,GX,HX,qX,KX,YX,ZX,XX,JX,QX,eJ,tJ,nJ,iJ,sJ,oJ,rJ,aJ,lJ,dJ,cJ,uJ,hJ,mJ,gJ,pJ,fJ,_J,xJ,IJ,vJ,bJ,jJ,CJ,yJ,kJ,AJ,wJ,SJ,EJ,TJ,zJ,OJ,RJ,$J,DJ,PJ,FJ,MJ,NJ,LJ,BJ,VJ,UJ,WJ,GJ,HJ,qJ,KJ,YJ,ZJ,XJ,JJ,QJ,eQ,tQ,nQ,iQ,sQ,oQ,rQ,aQ,lQ,dQ,cQ,uQ,hQ,mQ,gQ,pQ,fQ,_Q,xQ,IQ,vQ,bQ,jQ,CQ,yQ,kQ,AQ,wQ,SQ,EQ,TQ,zQ,OQ,RQ,$Q,DQ,PQ,FQ,MQ,NQ,LQ,BQ,VQ,UQ,WQ,GQ,HQ,qQ,KQ,YQ,ZQ,XQ,JQ,QQ,e0,t0,n0,i0,s0,o0,r0,a0,l0,d0,c0,u0,h0,m0,g0,p0,f0,_0,x0,I0;function v0(){return v0=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const e=Xn();return(0,i.jsx)(Ba,{align:"center",css:{background:"$gray50"},height:1,justify:"center",width:1,children:(0,i.jsxs)(Ba,{align:"center",css:{background:"white",borderRadius:"$2",boxShadow:"$xs",padding:"$9"},direction:"column",gap:"2",justify:"center",width:840,children:[(0,i.jsx)(Ar,{css:{"& svg":{height:"100%",width:"100%"}},height:140,width:180,children:(0,i.jsx)(b0,{})}),(0,i.jsx)(Ar,{color:"gray900",fontSize:"displayXs",fontWeight:"semiBold",children:e("votre_compte_1_85226",Cd)}),(0,i.jsxs)(Ar,{color:"gray500",textAlign:"center",children:[e("ne_vous_inqui_t_38880")," ",(0,i.jsx)("br",{}),e("contactez_nous_35526",yd,Cd)]})]})})};var C0;function y0(){return y0=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const e=Xn();return(0,i.jsx)(Ba,{align:"center",css:{background:"$gray50"},height:1,justify:"center",width:1,children:(0,i.jsxs)(Ba,{align:"center",css:{background:"white",borderRadius:"$2",boxShadow:"$xs",padding:"$9"},direction:"column",gap:"2",justify:"center",width:840,children:[(0,i.jsx)(k0,{}),(0,i.jsx)(Ar,{color:"gray900",fontSize:"displayXs",fontWeight:"semiBold",children:e("votre_compte_1_64779",Cd)}),(0,i.jsxs)(Ar,{color:"gray500",textAlign:"center",children:[e("ne_vous_inqui_t_38880")," ",(0,i.jsx)("br",{}),e("contactez_nous_35526",yd,Cd)]})]})})},w0=()=>{const e=Xn(),{user:t}=ai();return(0,i.jsx)("span",{dangerouslySetInnerHTML:{__html:e("accepter_a_hre_50341",kd(jd(t?.language,new URL(location.href).searchParams)),Cd)}})},S0=()=>{const{history:e,translate:t,params:{organizationId:n}}=vl(),{data:s,loader:o}=Qn('query UserInfo($organizationId: OrganizationId!) {\n user {\n userInfo(organizationId: $organizationId) {\n id\n firstName: fieldValue(slug: "firstName")\n lastName: fieldValue(slug: "lastName")\n phone: fieldValue(slug: "phone")\n }\n }\n}\n',{organizationId:n},[]),r=Zn(CT),a=Zn(Ua),{mutate:l}=function(e={}){return ei("mutation UserInfoAndTermsUpdate(\n $userInfoId: UsersInfoId!\n $userInfoAndTermsInput: UserInfoAndTermsInput!\n) {\n userInfoAndTermsUpdate(userInfoId: $userInfoId, userInfoAndTermsInput: $userInfoAndTermsInput) {\n id\n }\n}\n",e)}(),d=(0,L.useRef)(null),{reload:c}=TI();return o||(0,i.jsx)(kl,{customErrorRef:d,height:1,initialValues:{userInfoAndTerms:r.userInfoAndTermsInputDefault(s.user)},render:({handleSubmit:e})=>(0,i.jsxs)(Qx,{ref:d,onClose:X,children:[(0,i.jsx)(jl,{}),(0,i.jsxs)(Vm,{centerTitleAndSubtitle:!0,hideToggle:!0,initialIsOpen:!0,subtitle:t("accepter_nos_co_49122"),heading:t("conditions_g_n_79662"),children:[(0,i.jsx)(Gm,{name:"userInfoAndTerms.termsAccepted",shouldPreventDefault:!1,children:(0,i.jsx)(w0,{})}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsxs)(Ba,{gap:"4",children:[(0,i.jsx)(Vl,{label:(0,i.jsx)(Zv,{children:t("pr_nom_66988")}),name:"userInfoAndTerms.firstName"}),(0,i.jsx)(Vl,{label:(0,i.jsx)(Zv,{children:t("last_name")}),name:"userInfoAndTerms.lastName"})]}),(0,i.jsx)(Ya,{height:"4"}),(0,i.jsx)(lI,{label:(0,i.jsx)(Zv,{children:t("Phone")}),prefix:"userInfoAndTerms.phone."})]}),(0,i.jsx)(Bm,{children:(0,i.jsx)(zl,{textAlign:"center",onClick:e,children:t("mettre_jour_85141")})})]}),validate:a.validateForForm(r.updateUserInfoAndTermsSchema()),width:1,onSubmit:async t=>{await l({userInfoId:s.user.userInfo.id,userInfoAndTermsInput:t.userInfoAndTerms}),c(),e.location.state?e.push(e.location.state):e.push(yi.ORGANIZATION({organizationId:n}))}})},E0=()=>{const{isOrganizationAdmin:e,isOrganizationReader:t,organization:n}=TI(),{canCustomFieldRead:s,canEventEdit:o,canOrganizationUserEdit:r,canOrganizationUserRead:a}=DS(),l=Tc();return(0,i.jsxs)(Sr.dO,{children:[e&&(0,i.jsx)(Sr.qh,{path:Hi.EVENTS_IMPORT({organizationId:":organizationId"}),children:(0,i.jsx)(fP,{})}),o&&(0,i.jsx)(Sr.qh,{exact:!0,path:Ps.CREATE_EVENT(":organizationId"),children:(0,i.jsx)(hP,{})}),o&&(0,i.jsx)(Sr.qh,{exact:!0,path:Ps.EDIT_EVENT(":organizationId",":eventId"),children:(0,i.jsx)(mP,{})}),(0,i.jsx)(Sr.qh,{path:Hi.EVENTS({organizationId:":organizationId"}),children:l?(0,i.jsx)(UP,{}):(0,i.jsx)(jT,{children:(0,i.jsx)(VP,{})})}),(0,i.jsx)(Sr.qh,{path:Hi.EVENT({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(AK,{})}),s&&(0,i.jsx)(Sr.qh,{path:Ps.CUSTOM_FIELDS(":organizationId"),children:(0,i.jsx)(jT,{children:(0,i.jsx)(sP,{})})}),e&&(0,i.jsx)(Sr.qh,{path:Ps.CREATE_ORGANIZATION_PARAMETERS_EMAILS_SENDERS(":organizationId"),children:(0,i.jsx)(EK,{})}),e&&(0,i.jsx)(Sr.qh,{path:Ps.EDIT_ORGANIZATION_PARAMETERS_EMAILS_SENDERS(":organizationId",":emailSenderId"),children:(0,i.jsx)(TK,{})}),t&&(0,i.jsx)(Sr.qh,{path:Ps.ORGANIZATION_PARAMETERS_EMAILS_SENDERS_PREVIEW(":organizationId",":emailSenderId"),children:(0,i.jsx)(zK,{})}),r&&(0,i.jsx)(Sr.qh,{path:Ps.CREATE_ORGANIZATION_PARAMETERS_ROLE(":organizationId"),children:(0,i.jsx)(mX,{})}),a&&(0,i.jsx)(Sr.qh,{path:Ps.EDIT_ORGANIZATION_PARAMETERS_ROLE(":organizationId",":roleId"),children:(0,i.jsx)(gX,{})}),(0,i.jsx)(Sr.qh,{path:Ps.ORGANIZATION_PARAMETERS(":organizationId"),children:l?(0,i.jsx)(ZK,{}):(0,i.jsx)(jT,{children:(0,i.jsx)(NZ,{})})}),(0,i.jsx)(Sr.qh,{path:wi.COMMUNITY({organizationId:":organizationId"}),children:(0,i.jsx)(ND,{})}),(0,i.jsx)(Sr.qh,{path:yi.IS_EXPIRED(yi.ORGANIZATION({organizationId:":organizationId"})),children:(0,i.jsx)(jT,{children:(0,i.jsx)(A0,{})})}),(0,i.jsx)(Sr.qh,{path:yi.IS_BLOCKED(yi.ORGANIZATION({organizationId:":organizationId"})),children:(0,i.jsx)(jT,{children:(0,i.jsx)(j0,{})})}),(0,i.jsx)(Sr.qh,{exact:!0,path:Ps.ACCEPT_TERMS_AND_CONDITIONS(":organizationId"),children:(0,i.jsx)(S0,{})}),(0,i.jsx)(Sr.qh,{children:(0,i.jsx)(oi,{path:Hi.EVENTS({organizationId:n.id}),replace:!0})})]})},T0=()=>(0,i.jsx)(vI,{children:(0,i.jsx)(EI,{children:(0,i.jsx)(E0,{})})}),z0=()=>{const e=JSON.parse(window.HEAVENT_EXPORT_POSITIONS_MAP_DATA),[t,n]=(0,L.useState)(!1),{searchParams:s}=new URL(location.href),o=function(e){if(m(e)){const[t,n]=e.split(",");if(m(t)&&m(n)){const e=parseFloat(t),i=parseFloat(n);return isNaN(e)||isNaN(i)?null:{lat:e,lng:i}}return null}return null}(s.get("center")),r=s.get("acronymIcon")||"icon",a=s.get("zoom"),l=s.get("hiddenTracesIds")?.split(",").map(e=>parseInt(e,10))??[];return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ar,{css:{"& .gm-style-cc":{display:"none"}},height:1,width:1,children:(0,i.jsx)(CW,{acronymIcon:r,hiddenTracesIds:l,initialCenter:o,initialZoom:a?parseInt(a,10):null,layer:e.layer,mapOptions:{zoomControl:!1},positions:e.positions.nodes,showMarker:!1,traces:e.traces,onMapTilesloaded:()=>{n(!0)}})}),t&&(0,i.jsx)(Vr,{})]})},O0=()=>{const{eventId:e,positionId:t}=ti(),{data:n,loader:s}=Qn("query PositionMap($eventId: EventId!, $positionId: PositionId!) {\n eventPublic(id: $eventId) {\n position(id: $positionId) {\n layer\n latitude\n longitude\n zoom\n\n traces {\n ...Trace\n }\n }\n }\n}\n",{eventId:e,positionId:t},[Vs.TraceFragment]),[o,r]=(0,L.useState)(!1);if(s)return s;{const e=n.eventPublic.position;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ar,{css:{"& .gm-style-cc":{display:"none"}},height:1,width:1,children:(0,i.jsx)(Br,{initialZoom:e.zoom,layer:e.layer,mapOptions:{disableDefaultUI:!0,keyboardShortcuts:!1},point:Pr(e),traces:e.traces,onTilesloaded:()=>{r(!0)}})}),o&&(0,i.jsx)(Vr,{})]})}},R0=()=>{const e=Xn(),t=new URL(location.href).searchParams,n=t.get("eventName")||t.get("organizationName")||"",s=`${P.HEAVENT_API_URL}/users/${t.get("userId")||""}/`,o=t.get("eventId")?`${s}blacklist-event?eventId=${t.get("eventId")}`:`${s}blacklist-organization?organizationId=${t.get("organizationId")}`;return(0,i.jsx)(Ba,{align:"center",css:{background:"$gray50",overflow:"hidden"},height:1,justify:"center",width:1,children:(0,i.jsxs)(Ba,{align:"center",css:{background:"white",bd:!0,padding:"$7"},direction:"column",width:640,children:[(0,i.jsx)(Ar,{font:"gray900 textXl semiBold",children:e("d_sinscription_61475")}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ar,{color:"gray500",textAlign:"center",children:e("vous_tes_sur_l_71517",n)}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(Ar,{width:1,children:(0,i.jsx)(zl,{color:"error",textAlign:"center",onClick:()=>{window.open(o,"_blank")},children:e("oui_je_souhait_20141")})})]})})},$0=()=>{const{translate:e,params:{ticketId:t}}=vl(),[n,s]=(0,L.useState)(!1),[o,r]=(0,L.useState)(!1),a=`${P.HEAVENT_API_URL}/users/${t}/check-in`;return(0,i.jsx)(Ba,{align:"center",css:{background:"$gray50",overflow:"hidden"},height:1,justify:"center",width:1,children:(0,i.jsx)(Ba,{align:"center",css:{background:"white",bd:!0,padding:"$7"},direction:"column",width:640,children:(0,i.jsx)(Ba,{justify:"center",width:1,children:o?(0,i.jsx)(rc,{color:"success",leftIcon:"check",children:e("votre_pointage_47695")}):(0,i.jsx)(zl,{isLoading:n,leftIcon:"check",textAlign:"center",onClick:async()=>{s(!0),await fetch(a),r(!0),s(!1)},children:e("point_sur_ma_m_52527")})})})})},D0=()=>{const{translate:e,params:{ticketId:t}}=vl(),[n,s]=(0,L.useState)(!1),[o,r]=(0,L.useState)(!1),a=`${P.HEAVENT_API_URL}/users/${t}/check-out`;return(0,i.jsx)(Ba,{align:"center",css:{background:"$gray50",overflow:"hidden"},height:1,justify:"center",width:1,children:(0,i.jsx)(Ba,{align:"center",css:{background:"white",bd:!0,padding:"$7"},direction:"column",width:640,children:(0,i.jsx)(Ba,{justify:"center",width:1,children:o?(0,i.jsx)(rc,{color:"success",leftIcon:"check",children:e("votre_d_pointag_86150")}):(0,i.jsx)(zl,{isLoading:n,leftIcon:"check",textAlign:"center",onClick:async()=>{s(!0),await fetch(a),r(!0),s(!1)},children:e("d_point_sur_ma_60601")})})})})},P0=()=>{const{translate:e,params:{organizationId:t,userInfoId:n,customFieldSlug:s,value:o}}=vl(),{data:r,loader:a}=ka({organizationId:t,slug:s}),[l,d]=(0,L.useState)(!1),[c,u]=(0,L.useState)(!1),h=r.organization?.customField.name??"",m=r.organization?.customField.description??"",g=`${P.HEAVENT_API_URL}/users/${n}/field/${s}/update/${o}`;return(0,i.jsx)(Ba,{align:"center",css:{background:"$gray50",overflow:"hidden"},height:1,justify:"center",width:1,children:a||(0,i.jsxs)(Ba,{align:"center",css:{background:"white",bd:!0,padding:"$7"},direction:"column",width:640,children:[(0,i.jsx)(Ar,{font:"gray900 textXl semiBold",children:h}),(0,i.jsx)(Ya,{height:"1"}),(0,i.jsx)(Ar,{color:"gray500",textAlign:"center",children:m}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(Ba,{justify:"center",width:1,children:c?(0,i.jsx)(rc,{color:"success",leftIcon:"check",children:e("votre_r_ponse_a_83191")}):(0,i.jsx)(zl,{isLoading:l,leftIcon:"check",textAlign:"center",onClick:async()=>{d(!0),await fetch(g),u(!0),d(!1)},children:h})})]})})},F0=()=>{const{translate:e,params:{organizationId:t,customFieldSlug:n}}=vl(),{data:s,loader:o}=ka({organizationId:t,slug:n}),[r,a]=(0,L.useState)(!1),[l,d]=(0,L.useState)(!1),[c,u]=(0,L.useState)(!1),[h,m]=(0,L.useState)(""),[g,p]=(0,L.useState)(""),f=s.organization?.customField.name??"",_=s.organization?.customField.description??"",x=`${P.HEAVENT_API_URL}/users/organization/${t}/update-by-ticket-id`;return(0,i.jsx)(Ba,{align:"center",css:{background:"$gray50",overflow:"hidden"},height:1,justify:"center",width:1,children:o||(0,i.jsxs)(Ba,{align:"center",css:{background:"white",bd:!0,padding:"$7"},direction:"column",width:640,children:[l&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{width:1,children:(0,i.jsx)(rl,{color:"success",leftIcon:"check",rightIcon:"xmark",rightIconClick:()=>{d(!1)},width:1,children:e("le_champ_1_36490",f)})}),(0,i.jsx)(Ya,{height:"6"})]}),c&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ba,{width:1,children:(0,i.jsx)(rl,{color:"error",leftIcon:"circle-exclamation",rightIcon:"xmark",rightIconClick:()=>{u(!1)},width:1,children:e("le_champ_1_46567",f)})}),(0,i.jsx)(Ya,{height:"6"})]}),(0,i.jsx)(Bl,{label:e("TicketId"),value:h,onChange:m}),(0,i.jsx)(Ya,{height:"6"}),(0,i.jsx)(Bl,{hint:_,label:f,value:g,onChange:p}),(0,i.jsx)(Ya,{height:"7"}),(0,i.jsx)(Ba,{justify:"center",width:1,children:(0,i.jsx)(zl,{isLoading:r,textAlign:"center",onClick:async()=>{a(!0),d(!1),u(!1),200===(await fetch(x,{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify({ticketId:h,slug:n,value:g})})).status?(d(!0),m(""),p("")):u(!0),a(!1)},children:e("mettre_jour_34131",f)})})]})})},M0=()=>{const{history:e,translate:t,params:{weezeventOrganizationId:n}}=vl(),{data:s,loader:o}=Qn("query WeezeventOrganizatio($id: Int) {\n organization: organizationByWeezeventId(id: $id) {\n id\n }\n}\n",{id:parseInt(n,10)},[]);return o||(s.organization?.id?(0,i.jsx)(Sr.rd,{to:yi.ORGANIZATION({organizationId:s.organization.id})}):(0,i.jsxs)(Ba,{align:"center",css:{background:"white"},direction:"column",height:1,justify:"center",width:1,children:[(0,i.jsx)(Ba,{align:"center",css:{background:xr.colors.blueGray900.value},height:64,justify:"center",width:1,children:(0,i.jsx)(Ba,{align:"center",css:{"& svg":{height:"50%"}},height:1,width:300,children:(0,i.jsx)(id,{})})}),(0,i.jsxs)(Ba,{align:"center",css:{background:"white",flex:"1"},direction:"column",gap:"6",justify:"center",width:1,children:[(0,i.jsx)(Ar,{height:240,width:240,children:(0,i.jsx)("img",{height:"100%",src:fd.WeezConstruction,width:"100%"})}),(0,i.jsxs)(Ba,{align:"center",direction:"column",gap:"1",children:[(0,i.jsx)(Ar,{font:"gray800 textMd medium",children:t("aucun_compte_we_48865")}),(0,i.jsx)(Ar,{color:"gray500",dangerouslySetInnerHTML:{__html:t("si_vous_d_sirez_19702")}})]}),(0,i.jsxs)(Ba,{gap:"3",children:[(0,i.jsx)(zl,{onClick:()=>window.open("mailto:benjamin.vuitton@gmail.com","_blank"),children:t("nous_contacter_38070")}),(0,i.jsx)(zl,{color:"invisible",onClick:()=>e.push(Ps.CREATE_EVENT_WITH_ORGANIZATION(n)),children:t("essayer_mainten_36692")})]})]})]}))},N0=e=>(0,i.jsx)(li,{getRedirectPath:()=>Ps.AUTH_SIGN_IN,shouldHaveUser:!0,children:e.children}),L0=e=>(0,i.jsx)(li,{getRedirectPath:()=>Ps.HOME,shouldHaveUser:!1,children:e.children});const B0=async()=>{const{user:e}=await(async()=>{try{const e=await async function(){const e=await Y();if(m(e)){const{user:t}=await function(e,t){return go("query CurrentUser {\n user {\n id\n email\n language\n insertedAt\n hubspotToken\n profile\n termsAcceptedAt\n }\n}\n",{variables:{},token:t||void 0,fragments:[]})}(0,e);return{user:t}}throw new Error("No token")}();return Gs.wB.defaultLocale=e.user.language.toLowerCase(),e}catch{return{user:null}}})();return await(e=>{const t=new URL(location.href).searchParams.get("lang");let n=null;e&&(n=e.language.toLowerCase()),m(t)&&(n=t);const i=n?`lang=${n}`:"";return zv(`${P.HEAVENT_API_URL}/translation/language.js?${i}`)})(e),{user:e}},V0=e=>{const[t,n]=(0,L.useState)(null);return(0,L.useEffect)(()=>{let e=!0;return B0().then(t=>{e&&n(t)}).catch(()=>{alert("Could not load application, please try again.")}),()=>{e=!1}},[]),t?e.render(t):(0,i.jsx)(wl,{})},U0=window.matchMedia("(max-width: 1200px)"),W0=L.createContext({isMobile:!1}),G0=e=>{const[t,n]=L.useState(!1);return L.useEffect(()=>{n(U0.matches),U0.addListener(e=>{n(e.matches)})},[]),(0,i.jsx)(W0.Provider,{value:{isMobile:t},children:e.children})},H0=(0,i.jsx)(wl,{});function q0(e,{redirectOnSuccess:t}={}){const[n,i]=(0,L.useState)(!1),{setIsError:s}=(0,L.useContext)(zH);let o=null;return n&&(o=H0),{isLoading:n,loader:o,mutate:async(n,o)=>{i(!0);try{const r=await Y(),a=await((e,t,n)=>go(e,{variables:t,token:n||void 0}))(e,n,o||r);return!0!==t&&(i(!1),s(!1)),a}catch(e){throw s(!0,so(e)?e:[]),e}}}}const K0=(0,i.jsx)(wl,{});function Y0(e,t,n){const[i,s]=(0,L.useState)(!0),[o,r]=(0,L.useState)({}),[a,l]=(0,L.useState)(0),{setIsError:d}=(0,L.useContext)(zH),c=Object.keys(t).sort().map(e=>{const n=t[e];return`"${e}":${JSON.stringify(n)}`}).join(",");(0,L.useEffect)(()=>{let i=!1;var o;return s(!0),o=c,Y().then(i=>go(e,{reloadOnNewVersion:!0,variables:t,token:i,fragments:n})).then(e=>{i||o!==c||(r(e),d(!1),s(!1))},()=>{i||o!==c||d(!0)}),()=>{i=!0}},[e,c,a]);let u=null;return i&&(u=K0),{data:o,isLoading:i,loader:u,reload(){l(a+1)}}}function Z0(){return function(e,t={}){return Object.fromEntries(Object.entries(e).map(([e,n])=>e.endsWith("Id")||"id"===e?[e,parseInt(n,10)]:t[e]?[e,t[e](n)]:[e,n]))}((0,Sr.g)())}function X0(){const e=(0,Sr.W6)();return{...e,goBack:t=>{"POP"===e.action&&e.length<=2?e.push(t):e.goBack()}}}function J0(){return(0,Sr.zy)()}function Q0(){return(0,L.useMemo)(()=>{try{return{clear:window.localStorage.clear.bind(window.localStorage),setItem:window.localStorage.setItem.bind(window.localStorage),getItem:window.localStorage.getItem.bind(window.localStorage),removeItem:window.localStorage.removeItem.bind(window.localStorage),key:window.localStorage.key.bind(window.localStorage),get length(){return window.localStorage.length},getItemInt(e){const t=parseInt(window.window.localStorage.getItem(e),10);return isNaN(t)?null:t}}}catch{return{clear(){},setItem(){},getItem:()=>null,removeItem(){},key:()=>null,get length(){return 0},getItemInt:()=>null}}},[])}let e1=class extends Gl{constructor(e){super(e)}delegationFormInviteValuesDefault(){return{usersInfos:[{email:"",fields:{firstName:"",lastName:""}}]}}delegationFormInviteValuesSchema(){return d.Ik().shape({usersInfos:d.YO().of(d.Ik().shape({email:d.Yj().email(this.t("l_e_mail_est_re_04856")).required(this.t("l_e_mail_est_re_04856")),fields:d.gl()})).min(1,"Vous devez invité au moins une personne.")})}};e1=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[qn])],e1);let t1=class extends Gl{translationService;constructor(e){super(e),this.translationService=e}massStateUpdateSchema(){return d.Ik().shape({state:d.Yj().required(this.t("le_statut_est_r_13164")).oneOf([Pt.NotApplicable,Pt.PreAssigned,Pt.Refused,Pt.WaitingAssignment],this.t("le_statut_est_r_13164"))})}massAccreditationStateUpdateSchema(){return d.Ik().shape({state:d.Yj().required(this.t("le_statut_est_r_13164")).oneOf([le.NotApplicable,le.Refused,le.WaitingAccreditation],this.t("le_statut_est_r_13164"))})}};t1=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[qn])],t1);let n1=class extends Gl{translationService;constructor(e){super(e),this.translationService=e}};n1=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[qn])],n1);let i1=class{translationInputDefault(e){return{fr:this.default(e.translationType,e.fr),en:this.default(e.translationType,e.en),es:this.default(e.translationType,e.es),de:this.default(e.translationType,e.de),nl:this.default(e.translationType,e.nl)}}default(e,t){switch(e){case Rt.String:return m(t)?t:"";case Rt.StringArray:return Array.isArray(t)?t:[];case Rt.RichText:return m(t)?t:"";default:return ll()}}};i1=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)()],i1);let s1=class{get(){return{[bt.OrganizationAdmin]:{accessLevel:vt.Organization,permissions:VZ,nameKey:"administrateur_11083",descriptionKey:"a_acc_s_toute_73520"},[bt.OrganizationReader]:{accessLevel:vt.Organization,permissions:UZ,nameKey:"acc_s_en_lectur_30252",descriptionKey:"a_acc_s_l_org_94388"},[bt.EventAdmin]:{accessLevel:vt.Event,permissions:WZ,nameKey:"administrateur_24785",descriptionKey:"a_acc_s_toute_25473"},[bt.EventReader]:{accessLevel:vt.Event,permissions:GZ,nameKey:"acc_s_en_lectur_33482",descriptionKey:"a_acc_s_l_v_17476"},[bt.PositionEditor]:{accessLevel:vt.Position,permissions:HZ,nameKey:"responsable_de_95683",descriptionKey:"peut_modifier_s_82832"},[bt.PositionReader]:{accessLevel:vt.Position,permissions:qZ,nameKey:"responsable_de_72569",descriptionKey:"a_acc_s_ses_m_09741"},[bt.DelegationCategoryLeader]:{accessLevel:vt.DelegationCategory,permissions:KZ,nameKey:"responsable_de_32820",descriptionKey:"a_acc_s_aux_d_l_87634"}}}};s1=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,Yt._G)()],s1);const o1=new Yt.i0(e=>{e(s1).toSelf().inSingletonScope(),e(hu).toSelf().inSingletonScope(),e(Jc).toSelf().inSingletonScope(),e(rp).toSelf().inSingletonScope(),e(ph).toSelf().inSingletonScope(),e(Vv).toSelf().inSingletonScope(),e(Fw).toSelf().inSingletonScope(),e(Ua).toSelf().inSingletonScope()}),r1=new Yt.i0(e=>{e(HP).toSelf().inSingletonScope(),e(WP).toSelf().inSingletonScope(),e(GP).toSelf().inSingletonScope(),e(cv).toSelf().inSingletonScope(),e(Zl).toSelf().inSingletonScope(),e(eg).toSelf().inSingletonScope(),e(Iv).toSelf().inSingletonScope(),e(mz).toSelf().inSingletonScope(),e(Cv).toSelf().inSingletonScope(),e(TL).toSelf().inSingletonScope(),e(sE).toSelf().inSingletonScope(),e(cU).toSelf().inSingletonScope(),e(uU).toSelf().inSingletonScope(),e(wL).toSelf().inSingletonScope(),e(AL).toSelf().inSingletonScope(),e(e1).toSelf().inSingletonScope(),e(DE).toSelf().inSingletonScope(),e(mL).toSelf().inSingletonScope(),e(Vj).toSelf().inSingletonScope(),e(Gj).toSelf().inSingletonScope(),e(wK).toSelf().inSingletonScope(),e(jE).toSelf().inSingletonScope(),e(jP).toSelf().inSingletonScope(),e(pP).toSelf().inSingletonScope(),e(oI).toSelf().inSingletonScope(),e(kY).toSelf().inSingletonScope(),e(_C).toSelf().inSingletonScope(),e(AS).toSelf().inSingletonScope(),e(cd).toSelf().inSingletonScope(),e(PS).toSelf().inSingletonScope(),e(oU).toSelf().inSingletonScope(),e(hU).toSelf().inSingletonScope(),e(kE).toSelf().inSingletonScope(),e(WE).toSelf().inSingletonScope(),e(xU).toSelf().inSingletonScope(),e(KE).toSelf().inSingletonScope(),e(AT).toSelf().inSingletonScope(),e(NO).toSelf().inSingletonScope(),e(LO).toSelf().inSingletonScope(),e(jA).toSelf().inSingletonScope(),e(ED).toSelf().inSingletonScope(),e(vM).toSelf().inSingletonScope(),e(dW).toSelf().inSingletonScope(),e(SM).toSelf().inSingletonScope(),e(t1).toSelf().inSingletonScope(),e(sI).toSelf().inSingletonScope(),e(iI).toSelf().inSingletonScope(),e(TU).toSelf().inSingletonScope(),e(VU).toSelf().inSingletonScope(),e(SU).toSelf().inSingletonScope(),e(EU).toSelf().inSingletonScope(),e(YZ).toSelf().inSingletonScope(),e(HR).toSelf().inSingletonScope(),e(n1).toSelf().inSingletonScope(),e(Xl).toSelf().inSingletonScope(),e(wd).toSelf().inSingletonScope(),e(aZ).toSelf().inSingletonScope(),e(Lw).toSelf().inSingletonScope(),e(EW).toSelf().inSingletonScope(),e(i1).toSelf().inSingletonScope(),e(CT).toSelf().inSingletonScope(),e(kT).toSelf().inSingletonScope(),e(yT).toSelf().inSingletonScope(),e(dR).toSelf().inSingletonScope(),e(mR).toSelf().inSingletonScope()}),a1=new Yt.i0(e=>{e(mC).toSelf().inSingletonScope(),e(_u).toSelf().inSingletonScope(),e(cF).toSelf().inSingletonScope(),e(Om).toSelf().inSingletonScope(),e(d$).toSelf().inSingletonScope(),e(LD).toSelf().inSingletonScope(),e(E$).toSelf().inSingletonScope(),e(xP).toSelf().inSingletonScope(),e(XA).toSelf().inSingletonScope(),e(GU).toSelf().inSingletonScope(),e(Zh).toSelf().inSingletonScope(),e(DR).toSelf().inSingletonScope()});function l1(){const e=new Yt.mc,t=window.HEAVENT_TRANSLATIONS||{},n=window.HEAVENT_LANGUAGE;if(0===Object.keys(t).length)throw new Error("window.HEAVENT_TRANSLATIONS does not exist");if(!bd(n))throw new Error("window.HEAVENT_LANGUAGE is not valid");return e.bind(qn).toConstantValue(new qn(bd(n),t)),e.load(o1,r1,a1),e}const d1=e=>(0,i.jsx)(Kn.Provider,{value:{container:l1(),useQuery:Y0,useMutation:q0,useExecuteQuery:po,useParams:Z0,useHistory:X0,useLocation:J0,useLocalStorage:Q0},children:e.children});var c1=n(9132);const u1=L.createContext({}),h1=e=>{const t=L.useCallback((e,t)=>{P.USE_MIXPANEL&&c1.A.track(e,t)},[]);return L.useEffect(()=>{P.USE_MIXPANEL&&c1.A.init(P.MIXPANEL_TOKEN,{debug:!0})},[]),(0,i.jsx)(u1.Provider,{value:{track:t},children:e.children})},m1=L.createContext({active:!1,enable:td.A,disable:td.A}),g1=()=>{const{user:e}=ai(),t=Tc(),n=si(),{active:i}=L.useContext(m1);return L.useEffect(()=>{if(P.USE_HUBSPOT&&m(e?.hubspotToken)){window.hsConversationsSettings={identificationEmail:e.email,identificationToken:e.hubspotToken};try{if(t||"true"===n.getItem(Ul.HIDE_HUBSPOT)||!i){const{loaded:e}=window.HubSpotConversations.widget.status();e?window.HubSpotConversations.widget.remove():window.HubSpotConversations.on("widgetLoaded",()=>{window.HubSpotConversations.widget.remove()})}else window.HubSpotConversations.clear({resetWidget:!0})}catch{}}},[t,i]),null};(0,Kt.render)((0,i.jsx)(L.StrictMode,{children:(0,i.jsxs)(({children:e})=>(0,i.jsx)(V0,{render:t=>(0,i.jsx)(ri.Provider,{value:t,children:(0,i.jsx)(d1,{children:(0,i.jsx)(G0,{children:(0,i.jsx)(OH,{children:(0,i.jsx)(zb,{children:(0,i.jsx)(h1,{children:(0,i.jsx)(xl.Provider,{value:{designSystem:"old"},children:(0,i.jsx)(i.Fragment,{children:e})})})})})})})})}),{children:[(0,i.jsx)(()=>((0,L.useEffect)(()=>{Y().then(e=>{"true"===P.LOG_TOKEN&&console.log(`"${N}": "${e||""}"`)})},[]),null),{}),(0,i.jsx)(({children:e})=>{const[t,n]=L.useState(!0);return(0,i.jsxs)(m1.Provider,{value:{active:t,enable:()=>{n(!0)},disable:()=>{n(!1)}},children:[(0,i.jsx)(g1,{}),e]})},{children:(0,i.jsx)(()=>(0,i.jsx)(Ar,{className:yr,css:{color:"$gray800",height:"100%",overflow:"hidden",position:"relative",width:"100%"},children:(0,i.jsx)(wr.Kd,{basename:P.HEAVENT_APP_URL.pathnameOptional,children:(0,i.jsxs)(Sr.dO,{children:[(0,i.jsx)(Sr.qh,{exact:!0,path:Ps.HOME,children:(0,i.jsx)(N0,{children:(0,i.jsx)(mI,{})})}),(0,i.jsx)(Sr.qh,{path:Ps.USER_UPDATE_BY_TICKET_ID(":organizationId",":customFieldSlug"),children:(0,i.jsx)(F0,{})}),(0,i.jsx)(Sr.qh,{path:Ps.USER_FIELD_UPDATE(":organizationId",":userInfoId",":customFieldSlug",":value"),children:(0,i.jsx)(P0,{})}),(0,i.jsx)(Sr.qh,{path:Ps.USER_CHECK_IN(":organizationId",":ticketId"),children:(0,i.jsx)($0,{})}),(0,i.jsx)(Sr.qh,{path:Ps.USER_CHECK_OUT(":organizationId",":ticketId"),children:(0,i.jsx)(D0,{})}),(0,i.jsx)(Sr.qh,{path:Ps.BACKOFFICE,children:(0,i.jsx)(N0,{children:(0,i.jsx)(Zx,{})})}),(0,i.jsx)(Sr.qh,{path:Ps.POSITION_MAP(":eventId",":positionId"),children:(0,i.jsx)(O0,{})}),(0,i.jsx)(Sr.qh,{path:Ps.ACCREDITATION_MAP(":eventId",":accreditationId"),children:(0,i.jsx)(Fa,{})}),(0,i.jsx)(Sr.qh,{path:Ps.EXPORT_POSITIONS_MAP(":eventId",":segmentId"),children:(0,i.jsx)(z0,{})}),(0,i.jsx)(Sr.qh,{path:fi(yi.ORGANIZATIONS),children:(0,i.jsx)(N0,{children:(0,i.jsx)(gI,{})})}),(0,i.jsx)(Sr.qh,{exact:!0,path:Ps.CREATE_EVENT_WITH_ORGANIZATION(":weezeventOrganizationId?"),children:(0,i.jsx)(N0,{children:(0,i.jsx)(hI,{})})}),(0,i.jsx)(Sr.qh,{path:yi.ORGANIZATION({organizationId:":organizationId"}),children:(0,i.jsx)(N0,{children:(0,i.jsx)(T0,{})})}),(0,i.jsx)(Sr.qh,{path:Ps.AUTH,children:(0,i.jsx)(L0,{children:(0,i.jsx)(zd,{})})}),(0,i.jsx)(Sr.qh,{path:Ps.COGNITO_CALLBACK,children:(0,i.jsx)(L0,{children:(0,i.jsx)(Rd,{})})}),(0,i.jsx)(Sr.qh,{path:Ps.MAGIC_LINK(":code",":source"),children:(0,i.jsx)(L0,{children:(0,i.jsx)(cr,{})})}),(0,i.jsx)(Sr.qh,{path:Ps.UNSUBSCRIBE_EMAIL,children:(0,i.jsx)(R0,{})}),(0,i.jsx)(Sr.qh,{path:"/o:weezeventOrganizationId",children:(0,i.jsx)(M0,{})}),(0,i.jsx)(Sr.qh,{children:(0,i.jsx)(oi,{path:Ps.HOME})})]})})}),{})})]})}),document.getElementById("heavent-react-hook"))},6687:(e,t,n)=>{"use strict";e.exports=n.p+"svg/weezeventBlankMessages-76d6e6c79babc98388e9.svg"},6751:(e,t,n)=>{"use strict";e.exports=n.p+"svg/fileJPG-aed94d931a32b62e488d.svg"},6871:()=>{!function(e){const t=e.it=e.it||{};t.dictionary=Object.assign(t.dictionary||{},{"%0 of %1":"%0 di %1","Align center":"Allinea al centro","Align left":"Allinea a sinistra","Align right":"Allinea a destra",Aquamarine:"Aquamarina",Black:"Nero","Block quote":"Blocco citazione",Blue:"Blu",Bold:"Grassetto","Break text":"Interrompi testo","Bulleted List":"Elenco puntato",Cancel:"Annulla","Centered image":"Immagine centrata","Change image text alternative":"Cambia testo alternativo dell'immagine","Choose heading":"Seleziona intestazione","Dim grey":"Grigio tenue","Document colors":"Colori del docmento",Downloadable:"Scaricabile","Dropdown toolbar":"Barra degli strumenti del menu a discesa","Edit block":"Modifica blocco","Edit link":"Modifica collegamento","Editor toolbar":"Barra degli strumenti dell'editor","Font Background Color":"Colore di sfondo caratteri","Font Color":"Colore caratteri","Full size image":"Immagine a dimensione intera",Green:"Verde",Grey:"Grigio",Heading:"Intestazione","Heading 1":"Intestazione 1","Heading 2":"Intestazione 2","Heading 3":"Intestazione 3","Heading 4":"Intestazione 4","Heading 5":"Intestazione 5","Heading 6":"Intestazione 6","Image resize list":"Elenco ridimensionamenti immagine","Image toolbar":"Barra degli strumenti dell'immagine","image widget":"Widget immagine","In line":"In linea","Insert image":"Inserisci immagine","Insert paragraph after block":"Inserisci paragrafo dopo blocco","Insert paragraph before block":"Inserisci paragrafo prima di blocco",Italic:"Corsivo",Justify:"Giustifica","Left aligned image":"Immagine allineata a sinistra","Light blue":"Azzurro","Light green":"Verde chiaro","Light grey":"Grigio chiaro",Link:"Collegamento","Link URL":"URL del collegamento",Next:"Avanti","Numbered List":"Elenco numerato","Open in a new tab":"Apri in una nuova scheda","Open link in new tab":"Apri collegamento in nuova scheda",Orange:"Arancio",Original:"Originale",Paragraph:"Paragrafo",Previous:"Indietro",Purple:"Porpora",Red:"Rosso",Redo:"Ripristina","Remove color":"Rimuovi colore","Resize image":"Ridimensiona immagine","Resize image to %0":"Ridimensiona immagine a %0","Resize image to the original size":"Ridimensiona immagine alle dimensioni originali","Rich Text Editor":"Editor di testo formattato","Rich Text Editor, %0":"Editor di testo formattato, %0","Right aligned image":"Immagine allineata a destra",Save:"Salva","Select all":"Seleziona tutto","Show more items":"Mostra più elementi","Side image":"Immagine laterale","Text alignment":"Allineamento del testo","Text alignment toolbar":"Barra degli strumenti dell'allineamento","Text alternative":"Testo alternativo","This link has no URL":"Questo collegamento non ha un URL",Turquoise:"Turchese",Underline:"Sottolineato",Undo:"Annulla",Unlink:"Elimina collegamento","Upload failed":"Caricamento fallito","Upload in progress":"Caricamento in corso",White:"Bianco","Widget toolbar":"Barra degli strumenti del widget","Wrap text":"Testo a capo",Yellow:"Giallo"}),t.getPluralForm=function(e){return 1!=e}}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}))},6954:(e,t,n)=>{"use strict";e.exports=n.p+"img/googleSatellite-0706bcb1678d6e9f219c.png"},6959:(e,t,n)=>{"use strict";e.exports=n.p+"svg/filePNG-c7dc0a7230035611ad34.svg"},7008:(e,t,n)=>{"use strict";e.exports=n.p+"img/accreditation-7f66e46aebab965fa566.png"},7619:(e,t,n)=>{"use strict";e.exports=n.p+"svg/fileBlank-8285380bb91a4d9e73d7.svg"},7648:(e,t,n)=>{"use strict";e.exports=n.p+"svg/weezeventBlankPerson-e5c7b9cf3fcac68f3df8.svg"},8144:(e,t,n)=>{"use strict";e.exports=n.p+"img/asoHomeBackground-e46035697a28c8d248e6.jpg"},8184:(e,t,n)=>{"use strict";e.exports=n.p+"svg/dnsWrongDomain-3954cd8d9805c779a7bc.svg"},8264:(e,t,n)=>{"use strict";e.exports=n.p+"img/userProfile-37c0493d81fa861def54.png"},8301:(e,t,n)=>{"use strict";e.exports=n.p+"img/aso-897aab2a976d58ba485d.png"},8652:(e,t,n)=>{"use strict";e.exports=n.p+"svg/done-d3eb25606e0846af3988.svg"},8798:(e,t,n)=>{"use strict";e.exports=n.p+"svg/recrewteerMarker-a76de3956f8adec5ded2.svg"},9191:()=>{},9625:(e,t,n)=>{"use strict";e.exports=n.p+"svg/fileCSV-6ea65d2431d3a4293aad.svg"},9844:()=>{!function(e){const t=e.es=e.es||{};t.dictionary=Object.assign(t.dictionary||{},{"%0 of %1":"%0 de %1","Align center":"Centrar","Align left":"Alinear a la izquierda","Align right":"Alinear a la derecha",Aquamarine:"Aguamarina",Black:"Negro","Block quote":"Cita de bloque",Blue:"Azul",Bold:"Negrita","Break text":"Permitir quebrar texto","Bulleted List":"Lista con viñetas",Cancel:"Cancelar","Centered image":"Imagen centrada","Change image text alternative":"Cambiar el texto alternativo de la imagen","Choose heading":"Elegir Encabezado","Dim grey":"Gris Oscuro","Document colors":"Colores del documento",Downloadable:"Descargable","Dropdown toolbar":"Barra de herramientas desplegable","Edit block":"Cuadro de edición","Edit link":"Editar enlace","Editor toolbar":"Barra de herramientas de edición","Font Background Color":"Color de Fondo","Font Color":"Color de Fuente","Full size image":"Imagen a tamaño completo",Green:"Verde",Grey:"Gris",Heading:"Encabezado","Heading 1":"Encabezado 1","Heading 2":"Encabezado 2","Heading 3":"Encabezado 3","Heading 4":"Encabezado 4","Heading 5":"Encabezado 5","Heading 6":"Encabezado 6","Image resize list":"Listado para redimensionar imagen","Image toolbar":"Barra de herramientas de imagen","image widget":"Widget de imagen","In line":"En línea","Insert image":"Insertar imagen","Insert paragraph after block":"Insertar párrafo después del bloque","Insert paragraph before block":"Insertar párrafo antes del bloque",Italic:"Cursiva",Justify:"Justificar","Left aligned image":"Imagen alineada a la izquierda","Light blue":"Azul Claro","Light green":"Verde Claro","Light grey":"Gris Claro",Link:"Enlace","Link URL":"URL del enlace",Next:"Siguiente","Numbered List":"Lista numerada","Open in a new tab":"Abrir en una pestaña nueva ","Open link in new tab":"Abrir enlace en una pestaña nueva",Orange:"Anaranjado",Original:"Original",Paragraph:"Párrafo",Previous:"Anterior",Purple:"Morado",Red:"Rojo",Redo:"Rehacer","Remove color":"Quitar color","Resize image":"Redimensionar imagen","Resize image to %0":"Redimensionar imagen al %0","Resize image to the original size":"Redimensionar imagen al tamaño original","Rich Text Editor":"Editor de Texto Enriquecido","Rich Text Editor, %0":"Editor de Texto Enriquecido, %0","Right aligned image":"Imagen alineada a la derecha",Save:"Guardar","Select all":"Seleccionar todo","Show more items":"Mostrar más elementos","Side image":"Imagen lateral","Text alignment":"Alineación del texto","Text alignment toolbar":"Barra de herramientas de alineación del texto","Text alternative":"Texto alternativo","This link has no URL":"Este enlace no tiene URL",Turquoise:"Turquesa",Underline:"Subrayado",Undo:"Deshacer",Unlink:"Quitar enlace","Upload failed":"Fallo en la subida","Upload in progress":"Subida en progreso",White:"Blanco","Widget toolbar":"Barra de herramientas del widget","Wrap text":"Mantener texto unido",Yellow:"Amarillo"}),t.getPluralForm=function(e){return 1!=e}}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}))},9848:(e,t,n)=>{"use strict";e.exports=n.p+"svg/filePDF-37cadc96dae9bc3a10ef.svg"},9882:(e,t,n)=>{"use strict";e.exports=n.p+"img/ign-3cfd31ba578060a32efa.png"}},e=>{e.O(0,[121],()=>e(e.s=6498)),e.O()}]);
//# sourceMappingURL=app-30f26c748277af9cc9f3.cjs.map